diff --git a/README.md b/README.md index d5533969d..8e9aa9f15 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ +[cover]: https://codecov.io/gh/rollup/plugins/beep/branch/master/graph/badge.svg +[cover-url]: https://codecov.io/gh/rollup/plugins/beep [tests]: https://img.shields.io/circleci/project/github/rollup/plugins.svg [tests-url]: https://circleci.com/gh/rollup/plugins [![tests][tests]][tests-url] +[![cover][cover]][cover-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) # Rollup Plugins @@ -9,6 +13,15 @@ This repository houses plugins that Rollup considers critical to every day use of Rollup, plugins which the organization has adopted maintenance of, and plugins that the project recommends to its users. +## Plugins Found Here + +- [alias](packages/alias) 🍣 A Rollup plugin for defining aliases when bundling packages. +- [beep](packages/beep) 🍣 A Rollup plugin that beeps when a build ends with errors. +- [buble](packages/buble) 🍣 A Rollup which converts ES2015+ code with the Bublé compiler. +- [replace](packages/replace) 🍣 A Rollup which replaces strings in files while bundling. +- [strip](packages/strip) 🍣 Remove statements and other bits from your code. +- [wasm](packages/wasm) 🍣 A Rollup which allows importing and bundling [WebAssembly modules](http://webassembly.org). + ## Contributing This repository is a [monorepo](https://en.wikipedia.org/wiki/Monorepo) which leverages [pnpm](https://pnpm.js.org/) for dependency management. diff --git a/package.json b/package.json index 526607090..dd8f83daf 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "ci:coverage": "node scripts/run-changed.js ci:coverage", - "ci:coverage:submit": "node scripts/run-changed.js ci:coverage:submit", + "ci:coverage:submit": "node scripts/codecov", "ci:lint": "node scripts/run-changed.js ci:lint", "ci:test": "node scripts/run-changed.js ci:test", "lint": "pnpm run lint:docs && pnpm run lint:package && node scripts/run-changed.js lint", @@ -16,8 +16,10 @@ "devDependencies": { "ava": "^2.2.0", "chalk": "^2.4.2", + "codecov-lite": "^0.3.1", "eslint-config-rollup": "^0.1.0", "execa": "^2.0.4", + "globby": "^10.0.1", "lint-staged": "^9.2.0", "nyc": "^14.1.1", "pnpm": "^4.1.5", diff --git a/packages/beep/README.md b/packages/beep/README.md index 2c15a9846..e250f1b9c 100644 --- a/packages/beep/README.md +++ b/packages/beep/README.md @@ -1,5 +1,5 @@ -[cover]: https://codecov.io/gh/rollup/plugins/beep/branch/master/graph/badge.svg -[cover-url]: https://codecov.io/gh/rollup/plugins/beep +[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg +[cover-url]: https://codecov.io/gh/rollup/plugins [size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-beep [size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-beep diff --git a/packages/buble/README.md b/packages/buble/README.md index 5f9172a51..412ce29ad 100644 --- a/packages/buble/README.md +++ b/packages/buble/README.md @@ -1,4 +1,4 @@ -[cover]: https://codecov.io/gh/rollup/plugins/buble/branch/master/graph/badge.svg +[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg [cover-url]: https://codecov.io/gh/rollup/plugins [size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-buble [size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-buble diff --git a/packages/buble/package.json b/packages/buble/package.json index 9bef9cff8..f950d6eec 100644 --- a/packages/buble/package.json +++ b/packages/buble/package.json @@ -49,13 +49,13 @@ }, "dependencies": { "buble": "^0.19.8", - "rollup-pluginutils": "^2.6.0", - "typescript": "^3.4.3" + "rollup-pluginutils": "^2.6.0" }, "devDependencies": { "del-cli": "^3.0.0", "rollup": "^1.20.0", - "source-map": "^0.7.3" + "source-map": "^0.7.3", + "typescript": "^3.4.3" }, "ava": { "files": [ diff --git a/packages/replace/README.md b/packages/replace/README.md index b64908d47..39b651919 100644 --- a/packages/replace/README.md +++ b/packages/replace/README.md @@ -1,4 +1,4 @@ -[cover]: https://codecov.io/gh/rollup/plugins/replace/branch/master/graph/badge.svg +[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg [cover-url]: https://codecov.io/gh/rollup/plugins [size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-replace [size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-replace diff --git a/packages/replace/package.json b/packages/replace/package.json index 0a781ba67..92c1d10c5 100644 --- a/packages/replace/package.json +++ b/packages/replace/package.json @@ -48,15 +48,15 @@ }, "dependencies": { "magic-string": "^0.25.2", - "rollup-pluginutils": "^2.6.0", - "typescript": "^3.4.3" + "rollup-pluginutils": "^2.6.0" }, "devDependencies": { "del-cli": "^3.0.0", "locate-character": "^2.0.5", "rollup": "^1.20.0", "rollup-plugin-buble": "^0.19.6", - "source-map": "^0.7.3" + "source-map": "^0.7.3", + "typescript": "^3.4.3" }, "ava": { "files": [ diff --git a/packages/strip/README.md b/packages/strip/README.md index 618d2c884..857e76964 100755 --- a/packages/strip/README.md +++ b/packages/strip/README.md @@ -1,6 +1,18 @@ +[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg +[cover-url]: https://codecov.io/gh/rollup/plugins +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-strip +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-strip +[tests]: https://img.shields.io/circleci/project/github/rollup/plugins.svg +[tests-url]: https://circleci.com/gh/rollup/plugins + +[![tests][tests]][tests-url] +[![cover][cover]][cover-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + # @rollup/plugin-strip -Remove `debugger` statements and functions like `assert.equal` and `console.log` from your code. +🍣 A Rollup plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code. ## Installation diff --git a/packages/wasm/README.md b/packages/wasm/README.md index 82810cd2a..a3594f57a 100755 --- a/packages/wasm/README.md +++ b/packages/wasm/README.md @@ -1,4 +1,4 @@ -[cover]: https://codecov.io/gh/rollup/plugins/replace/branch/master/graph/badge.svg +[cover]: https://codecov.io/gh/rollup/plugins/branch/master/graph/badge.svg [cover-url]: https://codecov.io/gh/rollup/plugins [size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-wasm [size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-wasm diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 838e75de2..8e9a62d26 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,11 +3,13 @@ importers: devDependencies: ava: 2.4.0 chalk: 2.4.2 + codecov-lite: 0.3.1 eslint-config-rollup: 0.1.0 execa: 2.1.0 + globby: 10.0.1 lint-staged: 9.4.2 nyc: 14.1.1 - pnpm: 4.1.6 + pnpm: 4.1.7 pre-commit: 1.2.2 prettier: 1.18.2 prettier-plugin-package: 0.3.1_prettier@1.18.2 @@ -19,8 +21,10 @@ importers: specifiers: ava: ^2.2.0 chalk: ^2.4.2 + codecov-lite: ^0.3.1 eslint-config-rollup: ^0.1.0 execa: ^2.0.4 + globby: ^10.0.1 lint-staged: ^9.2.0 nyc: ^14.1.1 pnpm: ^4.1.5 @@ -44,7 +48,7 @@ importers: slash: ^3.0.0 packages/beep: devDependencies: - rollup: 1.24.0 + rollup: 1.26.0 strip-ansi: 5.2.0 specifiers: rollup: ^1.20.0 @@ -53,11 +57,11 @@ importers: dependencies: buble: 0.19.8 rollup-pluginutils: 2.8.2 - typescript: 3.6.4 devDependencies: del-cli: 3.0.0 - rollup: 1.25.0 + rollup: 1.26.0 source-map: 0.7.3 + typescript: 3.6.4 specifiers: buble: ^0.19.8 del-cli: ^3.0.0 @@ -91,13 +95,13 @@ importers: dependencies: magic-string: 0.25.4 rollup-pluginutils: 2.8.2 - typescript: 3.6.4 devDependencies: del-cli: 3.0.0 locate-character: 2.0.5 - rollup: 1.24.0 + rollup: 1.26.0 rollup-plugin-buble: 0.19.8 source-map: 0.7.3 + typescript: 3.6.4 specifiers: del-cli: ^3.0.0 locate-character: ^2.0.5 @@ -503,7 +507,7 @@ packages: /@types/node/12.12.0: dev: true resolution: - integrity: sha512-6N8Sa5AaENRtJnpKXZgvc119PKxT1Lk9VPy4kfT8JF23tIe1qDfaGkBR2DRKJFIA7NptMz+fps//C6aLi1Uoug== + integrity: sha512-opgSsy+cEF9N8MgaVPnWVtdJ3o4mV2aMHvDq7thkQUFt0EuOHJon4rQpJfhjmNHB+ikl0Cd6WhWIErOyQ+f7tw== /acorn-dynamic-import/4.0.0_acorn@6.3.0: dependencies: acorn: 6.3.0 @@ -625,7 +629,7 @@ packages: /anymatch/3.1.1: dependencies: normalize-path: 3.0.0 - picomatch: 2.0.7 + picomatch: 2.1.0 dev: true engines: node: '>= 8' @@ -1123,6 +1127,15 @@ packages: node: '>=0.10.0' resolution: integrity: sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + /codecov-lite/0.3.1: + dependencies: + '@babel/runtime': 7.6.3 + got: 9.6.0 + dev: true + engines: + node: '>=8.6.0' + resolution: + integrity: sha512-AVLT4qyljd6lkzvUszA1tilsPj1fIBE1fL9/X/Q90qm+kTZh5JL2L1n+Ak9cPwUe/ZpSr0rzzJpH1kqlsi2i/g== /color-convert/1.9.3: dependencies: color-name: 1.1.3 @@ -2999,7 +3012,7 @@ packages: /micromatch/4.0.2: dependencies: braces: 3.0.2 - picomatch: 2.0.7 + picomatch: 2.1.0 dev: true engines: node: '>=8' @@ -3500,12 +3513,12 @@ packages: node: '>=8' resolution: integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - /picomatch/2.0.7: + /picomatch/2.1.0: dev: true engines: - node: '>=8' + node: '>=8.6' resolution: - integrity: sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + integrity: sha512-uhnEDzAbrcJ8R3g2fANnSuXZMBtkpSjxTTgn2LeSiQlfmq72enQJWdQllXW24MBLYnA1SBD2vfvx2o0Zw3Ielw== /pify/2.3.0: dev: true engines: @@ -3585,13 +3598,13 @@ packages: node: '>=6' resolution: integrity: sha512-t1Ax8KUvV3FFII8ltczPn2tJdjqbd1sIzu6t4JL7nQ3EyeL/lTrj5PWKb06ic5/6XYDr65rQ4uzQEGN70/6X5w== - /pnpm/4.1.6: + /pnpm/4.1.7: dev: true engines: node: '>=10' hasBin: true resolution: - integrity: sha512-pTeynpUShgdh1fyP1hbqL+Q0ozaCHqDoG46KzkPfdSyUXxhLO/MSxxc7Wcx1Rl2uvu69CeENL85QFgUa/NOp0Q== + integrity: sha512-0JfrmMLsy5x5nwUULUnXmKz6IbRXLc1r04STPDje6SIwcnyDwiRC5gR4LkC+AgVe2HuIhOSQm/MM1ypC63JDnQ== /pre-commit/1.2.2: dependencies: cross-spawn: 5.1.0 @@ -3750,7 +3763,7 @@ packages: integrity: sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== /readdirp/3.2.0: dependencies: - picomatch: 2.0.7 + picomatch: 2.1.0 dev: true engines: node: '>= 8' @@ -3951,28 +3964,10 @@ packages: estree-walker: 0.6.1 resolution: integrity: sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== - /rollup/1.24.0: - dependencies: - '@types/estree': 0.0.39 - '@types/node': 12.11.1 - acorn: 7.1.0 - dev: true - hasBin: true - resolution: - integrity: sha512-PiFETY/rPwodQ8TTC52Nz2DSCYUATznGh/ChnxActCr8rV5FIk3afBUb3uxNritQW/Jpbdn3kq1Rwh1HHYMwdQ== - /rollup/1.25.0: - dependencies: - '@types/estree': 0.0.39 - '@types/node': 12.11.1 - acorn: 7.1.0 - dev: true - hasBin: true - resolution: - integrity: sha512-tcf5ThhnhOUaNrxBSABvaaX9uC8hNxgyJpJmDIXaCkKHq/nPocaDz/4F/KBDiUpOt/ThvUxFrUq3XkyWiyXQiQ== /rollup/1.26.0: dependencies: '@types/estree': 0.0.39 - '@types/node': 12.12.0 + '@types/node': 12.12.3 acorn: 7.1.0 dev: true hasBin: true @@ -4532,6 +4527,7 @@ packages: resolution: integrity: sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= /typescript/3.6.4: + dev: true engines: node: '>=4.2.0' hasBin: true diff --git a/scripts/codecov.js b/scripts/codecov.js new file mode 100644 index 000000000..c3eca8df2 --- /dev/null +++ b/scripts/codecov.js @@ -0,0 +1,38 @@ +/* eslint-disable import/no-extraneous-dependencies */ + +const { readFileSync } = require('fs'); +const { join } = require('path'); + +const chalk = require('chalk'); +const { default: codecov } = require('codecov-lite'); +const globby = require('globby'); + +const { log } = console; +const root = join(__dirname, '..'); + +(async () => { + const files = await globby(['packages/*/coverage.lcov'], { + cwd: root, + onlyFiles: false + }); + + if (!files.length) { + log(chalk.cyan('No Coverage Files Found to Submit')); + return; + } + + log(chalk.blue('Submitting Coverage to CodeCov.io')); + log('Found Coverage Files:'); + log(' ', chalk.grey(files.join('\n ')), '\n'); + + for (const file of files) { + try { + const lcovData = readFileSync(join(root, file), 'utf8'); + await codecov(lcovData); // eslint-disable-line no-await-in-loop + log(chalk.green('Coverage Submitted:'), file.replace(root, '')); + } catch (e) { + log(chalk.red('Coverage Failure:'), file.replace(root, '')); + log(e.stack); + } + } +})();