[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:
Steven
2020-01-14 13:15:17 -05:00
committed by kodiakhq[bot]
parent fc4cb9a044
commit ce76dc980d
5 changed files with 6 additions and 35 deletions

View File

@@ -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();