chore: script/bootstrap fails when node cannot find a module the tests load (closes #263)
yarn install exits 0 without touching node_modules whenever node_modules/.yarn-integrity matches yarn.lock, so a package deleted from node_modules stayed deleted while bootstrap printed "bootstrap complete". After the install, bootstrap now asks node to resolve jest, playwright-core and ethers, and on the first it cannot find it names the module and the fix: rm -rf node_modules && make bootstrap. Model: opus-5-5
This commit is contained in:
@@ -218,7 +218,8 @@ development workflow, and the Makefile targets are thin shims that call them. We
|
|||||||
provide:
|
provide:
|
||||||
|
|
||||||
- `script/bootstrap` — install all dependencies (pinned node via nvm if needed,
|
- `script/bootstrap` — install all dependencies (pinned node via nvm if needed,
|
||||||
yarn via corepack, `yarn install --frozen-lockfile`)
|
yarn via corepack, `yarn install --frozen-lockfile`), then fail, naming the
|
||||||
|
module, if node cannot find `jest`, `playwright-core` or `ethers`
|
||||||
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
|
- `script/setup` — make a fresh clone ready for development: bootstrap plus the
|
||||||
git pre-commit hook
|
git pre-commit hook
|
||||||
- `script/projectname` — print the project name (used for the Docker image tag)
|
- `script/projectname` — print the project name (used for the Docker image tag)
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ but the review is broader than any of them.
|
|||||||
|
|
||||||
# Completed Steps
|
# Completed Steps
|
||||||
|
|
||||||
|
- 2026-10-06: `script/bootstrap` no longer reports success while node cannot
|
||||||
|
find a module the tests load
|
||||||
|
([#263](https://git.eeqj.de/sneak/AutistMask/issues/263)). After the install
|
||||||
|
it asks node for `jest`, `playwright-core` and `ethers`, and fails naming the
|
||||||
|
missing one and the fix. yarn skips the install whenever
|
||||||
|
`node_modules/.yarn-integrity` matches `yarn.lock`, so a package deleted from
|
||||||
|
`node_modules` stayed deleted while bootstrap said it was complete. The
|
||||||
|
fresh-clone failure the issue reports did not reproduce.
|
||||||
|
|
||||||
- 2026-10-06: A token symbol or name read off a contract is no longer stored cut
|
- 2026-10-06: A token symbol or name read off a contract is no longer stored cut
|
||||||
between the two halves of an emoji
|
between the two halves of an emoji
|
||||||
([#458](https://git.eeqj.de/sneak/AutistMask/issues/458)). `lookupTokenInfo()`
|
([#458](https://git.eeqj.de/sneak/AutistMask/issues/458)). `lookupTokenInfo()`
|
||||||
|
|||||||
@@ -127,6 +127,30 @@ install_js_deps() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# resolvable <module>: true when node, run from the repo root, finds it
|
||||||
|
resolvable() {
|
||||||
|
if missing node && [ -s "$HOME/.nvm/nvm.sh" ]; then
|
||||||
|
nvm_sh "nvm use $NODE_VERSION >/dev/null && cd \"$ROOT\" && \
|
||||||
|
node -e \"require.resolve('$1')\"" 2>/dev/null
|
||||||
|
else
|
||||||
|
node -e "require.resolve('$1')" 2>/dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# yarn install exits 0 without touching node_modules once
|
||||||
|
# node_modules/.yarn-integrity matches yarn.lock, so a package deleted from
|
||||||
|
# node_modules stays deleted. Fail unless node finds the modules the tests
|
||||||
|
# load: jest for make test, playwright-core and ethers for tests/e2e/.
|
||||||
|
check_js_deps() {
|
||||||
|
for module in jest playwright-core ethers; do
|
||||||
|
if ! resolvable "$module"; then
|
||||||
|
echo "bootstrap: node cannot find $module after yarn install" >&2
|
||||||
|
echo " fix: rm -rf node_modules && make bootstrap" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$ROOT"
|
cd "$ROOT"
|
||||||
|
|
||||||
@@ -136,6 +160,7 @@ main() {
|
|||||||
ensure_node
|
ensure_node
|
||||||
ensure_yarn
|
ensure_yarn
|
||||||
install_js_deps
|
install_js_deps
|
||||||
|
check_js_deps
|
||||||
|
|
||||||
echo "bootstrap complete"
|
echo "bootstrap complete"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user