@vercel/static-build 0.24.2-canary.0 → 0.25.0

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -13
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -17073,6 +17073,9 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
17073
17073
  }
17074
17074
  const nodeVersion = await build_utils_1.getNodeVersion(entrypointDir, undefined, config, meta);
17075
17075
  const spawnOpts = build_utils_1.getSpawnOptions(meta, nodeVersion);
17076
+ if (!spawnOpts.env) {
17077
+ spawnOpts.env = {};
17078
+ }
17076
17079
  /* Don't fail the build on warnings from Create React App.
17077
17080
  Node.js will load 'false' as a string, not a boolean, so it's truthy still.
17078
17081
  This is to ensure we don't accidentally break other packages that check
@@ -17083,11 +17086,25 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
17083
17086
  https://github.com/vercel/community/discussions/30
17084
17087
  */
17085
17088
  if ((framework === null || framework === void 0 ? void 0 : framework.slug) === 'create-react-app') {
17086
- if (!spawnOpts.env) {
17087
- spawnOpts.env = {};
17088
- }
17089
17089
  spawnOpts.env.CI = 'false';
17090
17090
  }
17091
+ const { cliType, lockfileVersion } = await build_utils_1.scanParentDirs(entrypointDir);
17092
+ if (cliType === 'npm') {
17093
+ if (typeof lockfileVersion === 'number' &&
17094
+ lockfileVersion >= 2 &&
17095
+ ((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) < 16) {
17096
+ // Ensure that npm 7 is at the beginning of the `$PATH`
17097
+ spawnOpts.env.PATH = `/node16/bin-npm7:${spawnOpts.env.PATH}`;
17098
+ console.log('Detected `package-lock.json` generated by npm 7...');
17099
+ }
17100
+ }
17101
+ else if (cliType === 'pnpm') {
17102
+ if (typeof lockfileVersion === 'number' && lockfileVersion === 5.4) {
17103
+ // Ensure that pnpm 7 is at the beginning of the `$PATH`
17104
+ spawnOpts.env.PATH = `/pnpm7/node_modules/.bin:${spawnOpts.env.PATH}`;
17105
+ console.log('Detected `pnpm-lock.yaml` generated by pnpm 7...');
17106
+ }
17107
+ }
17091
17108
  if (meta.isDev) {
17092
17109
  build_utils_1.debug('Skipping dependency installation because dev mode is enabled');
17093
17110
  }
@@ -17107,20 +17124,10 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
17107
17124
  else if (typeof installCommand === 'string') {
17108
17125
  if (installCommand.trim()) {
17109
17126
  console.log(`Running "install" command: \`${installCommand}\`...`);
17110
- const { cliType, lockfileVersion } = await build_utils_1.scanParentDirs(entrypointDir);
17111
17127
  const env = {
17112
17128
  YARN_NODE_LINKER: 'node-modules',
17113
17129
  ...spawnOpts.env,
17114
17130
  };
17115
- if (cliType === 'npm') {
17116
- if (typeof lockfileVersion === 'number' &&
17117
- lockfileVersion >= 2 &&
17118
- ((nodeVersion === null || nodeVersion === void 0 ? void 0 : nodeVersion.major) || 0) < 16) {
17119
- // Ensure that npm 7 is at the beginning of the `$PATH`
17120
- env.PATH = `/node16/bin-npm7:${env.PATH}`;
17121
- console.log('Detected `package-lock.json` generated by npm 7...');
17122
- }
17123
- }
17124
17131
  await build_utils_1.execCommand(installCommand, {
17125
17132
  ...spawnOpts,
17126
17133
  // Yarn v2 PnP mode may be activated, so force
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "0.24.2-canary.0",
3
+ "version": "0.25.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -36,7 +36,7 @@
36
36
  "@types/ms": "0.7.31",
37
37
  "@types/node-fetch": "2.5.4",
38
38
  "@types/promise-timeout": "1.3.0",
39
- "@vercel/build-utils": "3.0.1-canary.1",
39
+ "@vercel/build-utils": "3.0.1",
40
40
  "@vercel/frameworks": "0.9.0",
41
41
  "@vercel/ncc": "0.24.0",
42
42
  "@vercel/routing-utils": "1.13.2",
@@ -47,5 +47,5 @@
47
47
  "node-fetch": "2.6.1",
48
48
  "rc9": "1.2.0"
49
49
  },
50
- "gitHead": "4c20218e05122c439e5fa4f4997e9c5a5c7a93e2"
50
+ "gitHead": "5e66d4b2ccd80a7e6a21d53cf4be3b11f2861513"
51
51
  }