Skip to content

Commit

Permalink
chore: fix coverage reporting to codecov (#23)
Browse files Browse the repository at this point in the history
* chore: update metadata for packages

* docs: add plugins to readme

* docs: update coverage url in plugin readmes

* chore: move typescript from dep to devDep

* chore: update pnpm lock
  • Loading branch information
shellscape authored Oct 31, 2019
1 parent 866e5dc commit 8121cd1
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 47 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
[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

🍣 The one-stop shop for official Rollup plugins

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.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/beep/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/buble/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/buble/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/replace/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions packages/replace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
14 changes: 13 additions & 1 deletion packages/strip/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/wasm/README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
64 changes: 30 additions & 34 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions scripts/codecov.js
Original file line number Diff line number Diff line change
@@ -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);
}
}
})();

0 comments on commit 8121cd1

Please sign in to comment.