Skip to content

Commit e81927d

Browse files
chore: replace rollup with vite for better dx and hmr for demo pages with player with worker (#43)
* chore: replace rollup with vite for better dx and hmr for demo pages with player with worker * chore: add main-to-worker mssage tests * chore: update gitignore * chore: use node instead of npm script
1 parent 8ffbe91 commit e81927d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2306
-1959
lines changed

.github/workflows/limit-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ jobs:
3333
with:
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
3535
skip_step: build
36-
script: npm run size-limit:output-json
36+
script: node cli/prepare-size-limit.js

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,4 @@ dist-demo
185185
.nx/cache
186186

187187
.size-limit-output.json
188+
.qodo

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export default [
6767
ignores: [
6868
'node_modules/**',
6969
'**/node_modules/**',
70-
'**/rollup.config.js',
7170
'**/dist/**',
7271
'**/dist-api-reference/**',
7372
'**/dist-demo/**',

package-lock.json

Lines changed: 1659 additions & 1304 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,53 +25,47 @@
2525
"preserve": "npm run prepare-deploy"
2626
},
2727
"devDependencies": {
28-
"@commitlint/cli": "^19.6.0",
28+
"@commitlint/cli": "^19.6.1",
2929
"@commitlint/config-conventional": "^19.6.0",
30-
"@eslint/js": "^9.16.0",
31-
"@nx/js": "20.1.2",
32-
"@rollup/plugin-commonjs": "^28.0.1",
33-
"@rollup/plugin-node-resolve": "^15.3.0",
34-
"@rollup/plugin-replace": "^6.0.1",
35-
"@rollup/plugin-terser": "^0.4.4",
36-
"@rollup/plugin-typescript": "^12.1.1",
30+
"@eslint/js": "^9.17.0",
31+
"@nx/js": "20.3.1",
3732
"@size-limit/preset-big-lib": "^11.1.6",
3833
"@types/eslint__js": "^8.42.3",
39-
"@types/react": "^18.3.12",
40-
"@types/react-dom": "^18.3.1",
34+
"@types/react": "^19.0.4",
35+
"@types/react-dom": "^19.0.2",
4136
"@typestrong/ts-mockito": "^2.7.12",
4237
"@vitejs/plugin-react": "^4.3.4",
4338
"@vitest/browser": "^2.1.8",
4439
"@vitest/coverage-v8": "^2.1.8",
4540
"@vitest/ui": "^2.1.8",
46-
"eslint": "^9.16.0",
41+
"eslint": "^9.17.0",
4742
"eslint-config-prettier": "^9.1.0",
48-
"eslint-plugin-jsdoc": "^50.6.0",
43+
"eslint-plugin-jsdoc": "^50.6.1",
4944
"eslint-plugin-prettier": "^5.2.1",
50-
"eslint-plugin-react-hooks": "^5.0.0",
45+
"eslint-plugin-react-hooks": "^5.1.0",
5146
"eslint-plugin-react-refresh": "^0.4.16",
5247
"eslint-plugin-unicorn": "^56.0.1",
5348
"eslint-plugin-vitest": "^0.5.4",
54-
"globals": "^15.13.0",
49+
"globals": "^15.14.0",
5550
"http-server": "^14.1.1",
5651
"husky": "^9.1.7",
5752
"jsdom": "^25.0.1",
58-
"lint-staged": "^15.2.10",
53+
"lint-staged": "^15.3.0",
5954
"npm-run-all": "^4.1.5",
60-
"nx": "20.1.2",
61-
"playwright": "^1.49.0",
62-
"prettier": "^3.4.1",
63-
"react": "^18.3.1",
64-
"react-dom": "^18.3.1",
55+
"nx": "20.3.1",
56+
"playwright": "^1.49.1",
57+
"prettier": "^3.4.2",
58+
"react": "^19.0.0",
59+
"react-dom": "^19.0.0",
6560
"rimraf": "^6.0.1",
66-
"rollup": "^4.28.0",
67-
"rollup-plugin-copy": "^3.5.0",
68-
"rollup-plugin-dts": "^6.1.1",
69-
"rollup-plugin-visualizer": "^5.12.0",
7061
"size-limit": "^11.1.6",
71-
"typedoc": "^0.27.2",
72-
"typescript": "~5.7.2",
73-
"typescript-eslint": "^8.17.0",
74-
"vite": "^6.0.2",
62+
"typedoc": "^0.27.6",
63+
"typescript": "~5.7.3",
64+
"typescript-eslint": "^8.19.1",
65+
"vite": "^6.0.7",
66+
"vite-plugin-banner": "^0.8.0",
67+
"vite-plugin-dts": "^4.4.0",
68+
"vite-plugin-static-copy": "^2.2.0",
7569
"vitest": "^2.1.8"
7670
}
7771
}

packages/dash-parser/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
"clean": "rimraf ./dist ./dist-api-reference ./dist-demo ./*.tgz ./coverage ./node_modules .size-limit-output.json",
88
"prebuild": "npm run clean",
99
"build": "run-p build:js build:api-reference build:demo",
10-
"build:js": "rollup -c rollup.config.js",
10+
"build:js": "npm run build:js:prod && npm run build:js:dev",
11+
"build:js:prod": "vite build -c vite.lib.prod.config.ts",
12+
"build:js:dev": "vite build -c vite.lib.dev.config.ts",
1113
"build:api-reference": "npx typedoc --options typedoc.json",
12-
"build:demo": "vite build",
13-
"dev": "vite",
14+
"build:demo": "vite build -c vite.demo.config.ts",
15+
"dev": "vite -c vite.demo.config.ts",
1416
"size-limit:verify": "npx size-limit",
1517
"size-limit:json": "output=$(size-limit --json) && echo \"$output\" > .size-limit-output.json",
1618
"test": "vitest run",

packages/dash-parser/rollup.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import packageJson from './package.json';
2+
import { defineConfig } from 'vite';
3+
import banner from 'vite-plugin-banner';
4+
5+
export default defineConfig({
6+
mode: 'development',
7+
plugins: [
8+
banner({
9+
content: `/**
10+
* @license
11+
* ${packageJson.name} ${packageJson.version}
12+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
13+
* Available under Apache License Version 2.0
14+
* <https://github.com/videojs/monorepo/blob/main/LICENSE>
15+
*/`,
16+
}),
17+
],
18+
build: {
19+
sourcemap: 'inline',
20+
outDir: 'dist',
21+
emptyOutDir: false,
22+
minify: false,
23+
lib: {
24+
entry: 'src/index.ts',
25+
formats: ['cjs', 'es', 'iife'],
26+
name: 'DashParserNamespace',
27+
fileName: (format) => `${format}/index.debug.js`,
28+
},
29+
},
30+
});
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import packageJson from './package.json';
2+
import { defineConfig } from 'vite';
3+
import dts from 'vite-plugin-dts';
4+
import banner from 'vite-plugin-banner';
5+
import { viteStaticCopy } from 'vite-plugin-static-copy';
6+
7+
export default defineConfig({
8+
mode: 'production',
9+
plugins: [
10+
viteStaticCopy({
11+
targets: [
12+
{
13+
src: '../../LICENSE',
14+
dest: './',
15+
},
16+
],
17+
}),
18+
dts({ rollupTypes: true, outDir: 'dist/types', tsconfigPath: 'tsconfig.json' }),
19+
banner({
20+
content: `/**
21+
* @license
22+
* ${packageJson.name} ${packageJson.version}
23+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
24+
* Available under Apache License Version 2.0
25+
* <https://github.com/videojs/monorepo/blob/main/LICENSE>
26+
*/`,
27+
}),
28+
],
29+
build: {
30+
outDir: 'dist',
31+
lib: {
32+
entry: 'src/index.ts',
33+
formats: ['cjs', 'es', 'iife'],
34+
name: 'DashParserNamespace',
35+
fileName: (format) => `${format}/index.min.js`,
36+
},
37+
},
38+
});

0 commit comments

Comments
 (0)