Skip to content

Commit 548d2a5

Browse files
committed
codecov
1 parent 520ca93 commit 548d2a5

4 files changed

Lines changed: 37 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,6 @@ jobs:
2828
ACTIONS_STEP_DEBUG: false
2929
ACTIONS_RUNNER_DEBUG: false
3030
- name: Run tests
31-
run: bash test/run.sh
31+
run: bash test/run.sh
32+
env:
33+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828

2929
- name: Build
3030
run: bash src/build.sh
31+
env:
32+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3133

3234
- name: Publish to npm
3335
run: npm publish --access public || npm publish --access public --tag beta

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@
113113
"test": "node test/run.cjs"
114114
},
115115
"devDependencies": {
116+
"@codecov/rollup-plugin": "^1.9.1",
116117
"@rollup/plugin-commonjs": "^29.0.0",
117118
"@rollup/plugin-json": "^6.1.0",
118119
"@rollup/plugin-node-resolve": "^16.0.3",
119-
"rollup": "^4.57.1",
120-
"terser": "^5.46.0",
121-
120+
"@strc/utf16-to-any-base": "^1.0.0",
121+
"crc-32": "^1.2.2",
122122
"lz-string": "^1.5.0",
123+
"rollup": "^4.57.1",
123124
"semver": "^7.7.4",
125+
"terser": "^5.46.0",
124126
"uint8arrays": "^5.1.0",
125-
"utf8": "^3.0.0",
126-
"@strc/utf16-to-any-base": "^1.0.0",
127-
"crc-32": "^1.2.2"
127+
"utf8": "^3.0.0"
128128
},
129129
"module": "dist/jssc.mjs",
130130
"browser": "dist/jssc.js",

rollup.config.js

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
import resolve from '@rollup/plugin-node-resolve';
22
import json from '@rollup/plugin-json';
33
import commonjs from '@rollup/plugin-commonjs';
4+
import { codecovRollupPlugin } from "@codecov/rollup-plugin";
45

56
import { name__ } from './lib/meta.js';
67

8+
function bundleName(str) {
9+
return str
10+
.replaceAll(' ', '_')
11+
.replaceAll('(', '[')
12+
.replaceAll(')', ']');
13+
}
14+
const codecovConfig = (name) => ({
15+
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
16+
bundleName: name__ + (
17+
name.length > 0 ? bundleName('_' + name) : ''
18+
),
19+
uploadToken: process.env.CODECOV_TOKEN,
20+
telemetry: false
21+
})
22+
723
export default [
824
{
925
input: 'src/index.js',
1026
plugins: [
1127
resolve(),
1228
json(),
13-
commonjs()
29+
commonjs(),
30+
codecovRollupPlugin(codecovConfig(''))
1431
],
1532
output: [
1633
{
@@ -40,7 +57,8 @@ export default [
4057
plugins: [
4158
resolve({ preferBuiltins: true }),
4259
json(),
43-
commonjs()
60+
commonjs(),
61+
codecovRollupPlugin(codecovConfig('Worker'))
4462
],
4563
output: {
4664
file: 'dist/worker.js',
@@ -60,7 +78,8 @@ export default [
6078
exportConditions: ['node']
6179
}),
6280
json(),
63-
commonjs()
81+
commonjs(),
82+
codecovRollupPlugin(codecovConfig('CLI'))
6483
],
6584
output: {
6685
file: 'dist/cli.js',
@@ -84,7 +103,8 @@ export default [
84103
exportConditions: ['node']
85104
}),
86105
json(),
87-
commonjs()
106+
commonjs(),
107+
codecovRollupPlugin(codecovConfig('Windows Integration (Install)'))
88108
],
89109
output: {
90110
file: 'dist/windows/install.js',
@@ -108,7 +128,8 @@ export default [
108128
exportConditions: ['node']
109129
}),
110130
json(),
111-
commonjs()
131+
commonjs(),
132+
codecovRollupPlugin(codecovConfig('Windows Integration (Uninstall)'))
112133
],
113134
output: {
114135
file: 'dist/windows/uninstall.js',

0 commit comments

Comments
 (0)