@vercel/redwood 0.8.2-canary.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +20 -10
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -26,23 +26,33 @@ const build = async ({ workPath, files, entrypoint, meta = {}, config = {}, }) =
|
|
|
26
26
|
const entrypointFsDirname = path_1.join(workPath, mountpoint);
|
|
27
27
|
const nodeVersion = await build_utils_1.getNodeVersion(entrypointFsDirname, undefined, config, meta);
|
|
28
28
|
const spawnOpts = build_utils_1.getSpawnOptions(meta, nodeVersion);
|
|
29
|
+
if (!spawnOpts.env) {
|
|
30
|
+
spawnOpts.env = {};
|
|
31
|
+
}
|
|
32
|
+
const { cliType, lockfileVersion } = await build_utils_1.scanParentDirs(entrypointFsDirname);
|
|
33
|
+
if (cliType === 'npm') {
|
|
34
|
+
if (typeof lockfileVersion === 'number' &&
|
|
35
|
+
lockfileVersion >= 2 &&
|
|
36
|
+
((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) < 16) {
|
|
37
|
+
// Ensure that npm 7 is at the beginning of the `$PATH`
|
|
38
|
+
spawnOpts.env.PATH = `/node16/bin-npm7:${spawnOpts.env.PATH}`;
|
|
39
|
+
console.log('Detected `package-lock.json` generated by npm 7...');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else if (cliType === 'pnpm') {
|
|
43
|
+
if (typeof lockfileVersion === 'number' && lockfileVersion === 5.4) {
|
|
44
|
+
// Ensure that pnpm 7 is at the beginning of the `$PATH`
|
|
45
|
+
spawnOpts.env.PATH = `/pnpm7/node_modules/.bin:${spawnOpts.env.PATH}`;
|
|
46
|
+
console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
29
49
|
if (typeof installCommand === 'string') {
|
|
30
50
|
if (installCommand.trim()) {
|
|
31
51
|
console.log(`Running "install" command: \`${installCommand}\`...`);
|
|
32
|
-
const { cliType, lockfileVersion } = await build_utils_1.scanParentDirs(entrypointFsDirname);
|
|
33
52
|
const env = {
|
|
34
53
|
YARN_NODE_LINKER: 'node-modules',
|
|
35
54
|
...spawnOpts.env,
|
|
36
55
|
};
|
|
37
|
-
if (cliType === 'npm') {
|
|
38
|
-
if (typeof lockfileVersion === 'number' &&
|
|
39
|
-
lockfileVersion >= 2 &&
|
|
40
|
-
((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) < 16) {
|
|
41
|
-
// Ensure that npm 7 is at the beginning of the `$PATH`
|
|
42
|
-
env.PATH = `/node16/bin-npm7:${env.PATH}`;
|
|
43
|
-
console.log('Detected `package-lock.json` generated by npm 7...');
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
56
|
await build_utils_1.execCommand(installCommand, {
|
|
47
57
|
...spawnOpts,
|
|
48
58
|
env,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/redwood",
|
|
3
|
-
"version": "0.8.2
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/aws-lambda": "8.10.19",
|
|
28
28
|
"@types/node": "*",
|
|
29
29
|
"@types/semver": "6.0.0",
|
|
30
|
-
"@vercel/build-utils": "3.0.1
|
|
30
|
+
"@vercel/build-utils": "3.0.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "5e66d4b2ccd80a7e6a21d53cf4be3b11f2861513"
|
|
33
33
|
}
|