mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
[now-build-utils] Use latest node if no package.json found (#3587)
In a previous release, we pinned the node version to the project so that we could upgrade new projects to a newer version of Node.js while maintaining backwards compatibility with existing projects. This puts some burden on the user when they're deployment is a year old and their pinned version of Node reaches EOL. Because we currently force the user to add a package.json. This PR changes the behavior so projects are no longer pinned. Instead, newer deployments get the latest Node unless they opt-in and pin via package.json.
This commit is contained in:
@@ -19,11 +19,6 @@ async function runBuildLambda(inputPath) {
|
||||
const nowJson = require(nowJsonRef.fsPath);
|
||||
expect(nowJson.builds.length).toBe(1);
|
||||
const build = nowJson.builds[0];
|
||||
if (!build.config || !build.config.nodeVersion) {
|
||||
// Mimic api-deployments when a new project is created
|
||||
const nodeVersion = getLatestNodeVersion().range;
|
||||
build.config = { ...build.config, nodeVersion };
|
||||
}
|
||||
expect(build.src.includes('*')).toBeFalsy();
|
||||
const entrypoint = build.src.replace(/^\//, ''); // strip leftmost slash
|
||||
expect(inputFiles[entrypoint]).toBeDefined();
|
||||
|
||||
Reference in New Issue
Block a user