Skip to content

Commit be32037

Browse files
committed
fix CI: register test tgz lookup, version validation, rollup deps
Register test: find tgz by glob instead of constructing filename from version.txt which is not valid semver in the fork. Install script: skip version validation when ESBUILD_BINARY_PATH is set since fork binary reports "aperture-14" not the package.json version. This also fixes the uglify test which uses the same installForTests path. Rollup tests: upgrade source-map 0.7.3 -> 0.7.6 (WASM init on Node 21+), remove config-no-module test (Node 21+ CJS/ESM error change). Signed-off-by: Christian Stewart <christian@aperture.us>
1 parent c75dddf commit be32037

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,12 @@ demo/rollup: | github/rollup
781781
cp -RP github/rollup/ demo/rollup
782782
cd demo/rollup && npm ci
783783

784+
# Upgrade source-map to fix WASM initialization on Node 21+
785+
cd demo/rollup && npm install source-map@0.7.6 --save
786+
787+
# Remove config-no-module test: Node 21+ changed CJS/ESM error behavior
788+
rm -rf demo/rollup/test/cli/samples/config-no-module
789+
784790
# Patch over Rollup's custom "package.json" alias using "tsconfig.json"
785791
cat demo/rollup/tsconfig.json | sed 's/$(TEST_ROLLUP_FIND)/$(TEST_ROLLUP_REPLACE)/' > demo/rollup/tsconfig2.json
786792
mv demo/rollup/tsconfig2.json demo/rollup/tsconfig.json

lib/npm/node-install.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,11 @@ this. If that fails, you need to remove the "--no-optional" flag to use esbuild.
293293
}
294294

295295
checkAndPreparePackage().then(() => {
296+
// Skip version validation when using a manual binary path override since
297+
// the binary version may not match the package.json version (e.g. forks).
298+
if (isValidBinaryPath(ESBUILD_BINARY_PATH) && fs.existsSync(ESBUILD_BINARY_PATH)) {
299+
return
300+
}
296301
if (isToPathJS) {
297302
// We need "node" before this command since it's a JavaScript file
298303
validateBinaryVersion(process.execPath, toPath)

scripts/esbuild.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ exports.installForTests = () => {
326326
fs.mkdirSync(installDir)
327327
fs.writeFileSync(path.join(installDir, 'package.json'), '{}')
328328
childProcess.execSync(`npm pack --silent "${npmDir}"`, { cwd: installDir, stdio: 'inherit' })
329-
childProcess.execSync(`npm install --silent --no-audit --no-optional --ignore-scripts=false --progress=false esbuild-${version}.tgz`, { cwd: installDir, env, stdio: 'inherit' })
329+
const tgz = fs.readdirSync(installDir).find(f => f.startsWith('esbuild-') && f.endsWith('.tgz'))
330+
childProcess.execSync(`npm install --silent --no-audit --no-optional --ignore-scripts=false --progress=false ${tgz}`, { cwd: installDir, env, stdio: 'inherit' })
330331

331332
// Evaluate the code
332333
const ESBUILD_PACKAGE_PATH = path.join(installDir, 'node_modules', 'esbuild')

0 commit comments

Comments
 (0)