Skip to content

Commit fe4ee82

Browse files
Test Userclaude
andcommitted
Replace webpack build in fdc3-conformance with vite (#1830)
- Remove webpack.config.js and webpack/webpack-cli/ts-loader/css-loader/style-loader deps - Add vite.config.ts with multiple TS entry points (ES module format) - Use vite-plugin-node-polyfills to replace manual Buffer/process/stream polyfills - Use vite-plugin-css-injected-by-js to inline CSS (mirrors webpack style-loader) - Remove node polyfill runtime deps (buffer, process, stream-browserify, util, window) - Convert require() to ES imports in src/test/index.ts - Update all static HTML app pages to use <script type="module"> for ES module output - Remove redundant sourceMapSupport.install() inline script from app/index.html Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c545f1e commit fe4ee82

21 files changed

Lines changed: 65 additions & 108 deletions

File tree

toolbox/fdc3-conformance/package.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,27 @@
1010
"license": "Apache-2.0",
1111
"scripts": {
1212
"copy": "shx mkdir -p ./dist && shx cp -R static/* ./dist",
13-
"build": "webpack build && npm run copy",
13+
"build": "vite build && npm run copy",
1414
"serve": "npx http-server ./dist -p 3001 -c-1",
1515
"dev": "npm run clean && npm run build && npm run serve",
1616
"clean": "rimraf dist"
1717
},
1818
"dependencies": {
1919
"@finos/fdc3": "2.2.2-beta.1",
20-
"buffer": "^6.0.3",
2120
"chai": "^4.3.6",
2221
"mocha": "^10.0.0",
23-
"process": "^0.11.10",
24-
"source-map-support": "^0.5.21",
25-
"stream-browserify": "^3.0.0",
26-
"util": "^0.12.4",
27-
"window": "^1.0.0"
22+
"source-map-support": "^0.5.21"
2823
},
2924
"devDependencies": {
3025
"@types/chai": "^4.3.0",
3126
"@types/mocha": "^10.0.10",
32-
"css-loader": "^6.7.2",
3327
"http-server": "^14.1.1",
3428
"prettier": "3.4.1",
35-
"replace-in-file": "^6.3.5",
29+
"rimraf": "^5.0.0",
3630
"shx": "^0.3.4",
37-
"style-loader": "^3.3.1",
38-
"ts-loader": "^9.2.7",
3931
"typescript": "^5.6.3",
40-
"webpack": "^5.69.1",
41-
"webpack-cli": "^4.9.2"
32+
"vite": "^6.4.1",
33+
"vite-plugin-css-injected-by-js": "^3.5.2",
34+
"vite-plugin-node-polyfills": "^0.23.0"
4235
}
4336
}

toolbox/fdc3-conformance/src/test/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { getAgent } from '@finos/fdc3';
33
import { getPackMembers, getPackNames, executeTestsInBrowser, executeManualTestsInBrowser } from './testSuite';
44
import { ProgressReporter } from './progressReporter';
55

6-
// eslint-disable-next-line @typescript-eslint/no-require-imports
7-
require('mocha/mocha.css');
8-
// eslint-disable-next-line @typescript-eslint/no-require-imports
9-
require('source-map-support/browser-source-map-support.js');
6+
import 'mocha/mocha.css';
7+
import 'source-map-support/browser-source-map-support.js';
108

119
mocha.setup('bdd');
1210
mocha.reporter(ProgressReporter);

toolbox/fdc3-conformance/static/apps/app/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@
4444
i.e. It should not fail to raise the intent or resolve it to multiple applications.</p>
4545
</div>
4646
<p id="context"></p>
47-
<script src="../../lib/fdc3-compliance.js"></script>
48-
<script>
49-
// no idea why but this doesn't seem to work when added in the above script.
50-
sourceMapSupport.install();
51-
</script>
47+
<script type="module" src="../../lib/fdc3-compliance.js"></script>
5248
</body>
5349

5450
</html>

toolbox/fdc3-conformance/static/apps/basic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<p>Conformance Framework Basic Mock app</p>
1010
<p>This app is only used by the conformance framework for intent test purposes.</p>
1111

12-
<script src="../../lib/basic.js"></script>
12+
<script type="module" src="../../lib/basic.js"></script>
1313
</body>
1414

1515
</html>

toolbox/fdc3-conformance/static/apps/channels/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p>This app is only used by the conformance framework for test purposes</p>
1111
<p></p>
1212

13-
<script src="../../lib/channel.js"></script>
13+
<script type="module" src="../../lib/channel.js"></script>
1414
</body>
1515

1616
</html>

toolbox/fdc3-conformance/static/apps/general/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<p>Conformance Framework Mock App</p>
99
<p>This app is only used by the conformance framework for test purposes.</p>
1010

11-
<script src="../../lib/general.js"></script>
11+
<script type="module" src="../../lib/general.js"></script>
1212
</body>
1313
</html>

toolbox/fdc3-conformance/static/apps/intent-a/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<p>Conformance Framework Mock Intent App A</p>
1010
<p>This app is only used by the conformance framework for intent test purposes.</p>
11-
<script src="../../lib/intent-a.js"></script>
11+
<script type="module" src="../../lib/intent-a.js"></script>
1212

1313
</body>
1414

toolbox/fdc3-conformance/static/apps/intent-b/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<p>Conformance Framework Mock Intent App B</p>
1010
<p>This app is only used by the conformance framework for intent test purposes.</p>
11-
<script src="../../lib/intent-b.js"></script>
11+
<script type="module" src="../../lib/intent-b.js"></script>
1212

1313
</body>
1414

toolbox/fdc3-conformance/static/apps/intent-c/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<p>Conformance Framework Mock Intent App C</p>
1010
<p>This app is only used by the conformance framework for intent test purposes.</p>
1111

12-
<script src="../../lib/intent-c.js"></script>
12+
<script type="module" src="../../lib/intent-c.js"></script>
1313
</body>
1414

1515
</html>

toolbox/fdc3-conformance/static/apps/intent-e/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<body>
99
<p>Conformance Framework Mock Intent App E</p>
1010
<p>This app is only used by the conformance framework for intent test purposes.</p>
11-
<script src="../../lib/intent-e.js"></script>
11+
<script type="module" src="../../lib/intent-e.js"></script>
1212

1313
</body>
1414

0 commit comments

Comments
 (0)