Skip to content

Commit fe6cb3a

Browse files
perf: run lint while constructing nodes (#5207)
* wip: remove swc_ecma_lints * wip: duplicate_bindings rule * wip: disallow assign to import * wip: duplicate_exports rule * wip: no_dupe_args * Improve catch clause scoping and add more tests * Use enum for variable kinds * Handle variable and import redeclarations and duplicate parameters * Detect nested conflictes with hoisted variables * Handle redeclared parameters * Attempt to improve scoping * Fix catch scoping TODO: Parameter redeclaration * Fix remaining tests * Update TODOs * Improve coverage * Fix nested catch scope hoisting * Improve coverage * Improve coverage * Improve coverage * hasExportNamedAs -> assertUniqueExportName * extract `specifier.local.name` as `localName` * Improve handling of missing entry exports Otherwise, it will throw an internal error * Use forceExit to fix failing MacOS CI --------- Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com> Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
1 parent 52c55bb commit fe6cb3a

File tree

131 files changed

+1096
-796
lines changed

Some content is hidden

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

131 files changed

+1096
-796
lines changed

package-lock.json

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

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
"build:wasm": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm --target web --no-pack && shx rm wasm/.gitignore",
3939
"build:wasm:node": "wasm-pack build rust/bindings_wasm --out-dir ../../wasm-node --target nodejs --no-pack && shx rm wasm-node/.gitignore",
4040
"update:napi": "npm run build:napi && npm run build:copy-native",
41-
"build:js": "rollup --config rollup.config.ts --configPlugin typescript",
42-
"build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode",
41+
"build:js": "rollup --config rollup.config.ts --configPlugin typescript --forceExit",
42+
"build:js:node": "rollup --config rollup.config.ts --configPlugin typescript --configIsBuildNode --forceExit",
4343
"build:prepare": "concurrently -c green,blue \"npm run build:napi -- --release\" \"npm:build:js:node\" && npm run build:copy-native",
4444
"update:js": "npm run build:js && npm run build:copy-native",
4545
"build:copy-native": "shx mkdir -p dist && shx cp rollup.*.node dist/",
4646
"dev": "vitepress dev docs",
47-
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest",
48-
"build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript && shx rm -rf dist-build",
47+
"build:cjs": "rollup --config rollup.config.ts --configPlugin typescript --configTest --forceExit",
48+
"build:bootstrap": "shx mv dist dist-build && node dist-build/bin/rollup --config rollup.config.ts --configPlugin typescript --forceExit && shx rm -rf dist-build",
4949
"build:docs": "vitepress build docs",
5050
"preview:docs": "vitepress preview docs",
5151
"ci:artifacts": "napi artifacts",
@@ -165,7 +165,7 @@
165165
"pretty-bytes": "^6.1.1",
166166
"pretty-ms": "^8.0.0",
167167
"requirejs": "^2.3.6",
168-
"rollup": "^4.3.0",
168+
"rollup": "^4.3.1",
169169
"rollup-plugin-license": "^3.2.0",
170170
"rollup-plugin-string": "^3.0.0",
171171
"rollup-plugin-thatworks": "^1.0.4",

rollup.config.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,6 @@ export default async function (
9999
return commonJSBuild;
100100
}
101101

102-
const exitOnCloseBundle: Plugin = {
103-
closeBundle() {
104-
// On CI, macOS runs sometimes do not close properly. This is a hack
105-
// to fix this until the problem is understood.
106-
console.log('Force quit.');
107-
setTimeout(() => process.exit(0));
108-
},
109-
name: 'force-close'
110-
};
111-
112102
const esmBuild: RollupOptions = {
113103
...commonJSBuild,
114104
input: {
@@ -127,7 +117,6 @@ export default async function (
127117
};
128118

129119
if (command.configIsBuildNode) {
130-
(esmBuild.plugins as Plugin[]).push(exitOnCloseBundle);
131120
return [commonJSBuild, esmBuild];
132121
}
133122

@@ -164,8 +153,7 @@ export default async function (
164153
collectLicensesBrowser(),
165154
writeLicenseBrowser(),
166155
cleanBeforeWrite('browser/dist'),
167-
emitWasmFile(),
168-
exitOnCloseBundle
156+
emitWasmFile()
169157
],
170158
strictDeprecations: true,
171159
treeshake

0 commit comments

Comments
 (0)