mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
* feat(node): prioritize RAILPACK_NODE_VERSION over engines.node - Add regression test case to verify environment variable precedence for Node version resolution. - Add reproduction example for the reported issue where engine constraints override deployment variables. Generated-by: aiautocommit * feat(test): rename and update node version precedence example * Rename `node-subfolder-node-version` to `node-version-precedence` to better reflect its purpose. * Update `test.json` to allow stderr, accommodating potential output variations during version resolution. * Replace the README to clarify the expected precedence behavior for environment variables versus engine settings. Generated-by: aiautocommit * refactor: improve package version resolution comments - Clarify that package versions defined in `railpack.json` serve as defaults. - Clarify that these values are overridden by more specific sources like `package.json` or environment variables. - Update documentation to reflect that version sources are labeled as "custom config" to accommodate CLI flags and external config files. Generated-by: aiautocommit * feat(deps): add bun to idiomatic version resolution Generated-by: aiautocommit * refactor(mise): simplify version resolution logic - Improve readability by removing nested conditional blocks. - Clarify that UseMiseVersions now supports idiomatic version files and explicitly overwrites existing configuration. - Enhance variable naming for better intent representation. Generated-by: aiautocommit * refactor(node): adjust node version resolution precedence - Update node version resolution to ensure ENV-level configuration takes precedence over package.json engines. - Refactor node detection logic for Bun projects to conditionally omit Node.js installation when no dependencies are present. - Streamline Node.js package installation to reduce redundant configuration checks. Generated-by: aiautocommit * feat: add example test for Bun-only apps excluding Node binary Generated-by: aiautocommit * docs: simplify README for node version precedence example Generated-by: aiautocommit * test: add snapshots for node version precedence and bun examples Generated-by: aiautocommit * docs: update project documentation and test guidelines Generated-by: aiautocommit * refactor(test): merge node-bun-no-node into node-bun-no-deps - Remove the redundant node-bun-no-node example. - Consolidate the "no node binary" verification logic into the node-bun-no-deps example. - Improve documentation in the readme for the consolidated example. Generated-by: aiautocommit * test: remove outdated snapshot for node-bun build plan Generated-by: aiautocommit
24 lines
954 B
JavaScript
24 lines
954 B
JavaScript
// Integration test assertion: Railpack should omit Node for Bun-only apps with no dependencies.
|
|
// We shell out to `which -a` instead of Bun.which() because `bun run` injects a temporary node
|
|
// shim at /tmp/bun-node-*/node for npm script compatibility that Bun.which() sees but is not on PATH.
|
|
const result = Bun.spawnSync({
|
|
cmd: ["sh", "-lc", "which -a node 2>/dev/null || true"],
|
|
stdout: "pipe",
|
|
});
|
|
|
|
const nodePaths = result.stdout
|
|
.toString()
|
|
.trim()
|
|
.split("\n")
|
|
.filter(Boolean)
|
|
// Defensive: which -a does not return the bun shim today, but filter it if that ever changes.
|
|
.filter((path) => !path.startsWith("/tmp/bun-node-"));
|
|
|
|
if (nodePaths.length > 0) {
|
|
console.error(`node binary should not exist: ${nodePaths.join(", ")}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
const bunVersion = Bun.version.split(".")[0];
|
|
console.log(`hi from bun without a lock - using Bun major version ${bunVersion}`);
|
|
console.log("bun runtime without node binary"); |