@vercel/static-build 0.22.2-canary.6 → 0.23.1

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 +19 -10
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -9114,7 +9114,7 @@ exports.frameworks = [
9114
9114
  }));
9115
9115
  return (config && config.publishDir) || 'public';
9116
9116
  },
9117
- defaultVersion: '0.58.2',
9117
+ defaultVersion: '0.58.2', // Must match the build image
9118
9118
  },
9119
9119
  {
9120
9120
  name: 'Jekyll',
@@ -9252,7 +9252,7 @@ exports.frameworks = [
9252
9252
  },
9253
9253
  },
9254
9254
  getOutputDirName: async () => 'public',
9255
- defaultVersion: '0.15.3',
9255
+ defaultVersion: '0.13.0', // Must match the build image
9256
9256
  },
9257
9257
  {
9258
9258
  name: 'Vite',
@@ -13861,9 +13861,16 @@ function getPkg(entrypoint, workPath) {
13861
13861
  if (path_1.default.basename(entrypoint) !== 'package.json') {
13862
13862
  return null;
13863
13863
  }
13864
- const pkgPath = path_1.default.join(workPath, entrypoint);
13865
- const pkg = JSON.parse(fs_1.readFileSync(pkgPath, 'utf8'));
13866
- return pkg;
13864
+ try {
13865
+ const pkgPath = path_1.default.join(workPath, entrypoint);
13866
+ const pkg = JSON.parse(fs_1.readFileSync(pkgPath, 'utf8'));
13867
+ return pkg;
13868
+ }
13869
+ catch (err) {
13870
+ if (err.code !== 'ENOENT')
13871
+ throw err;
13872
+ }
13873
+ return null;
13867
13874
  }
13868
13875
  function getFramework(config, pkg) {
13869
13876
  if (!config || !config.zeroConfig) {
@@ -14256,25 +14263,27 @@ const build = async ({ files, entrypoint, workPath, config, meta = {}, }) => {
14256
14263
  };
14257
14264
  exports.build = build;
14258
14265
  const prepareCache = async ({ entrypoint, workPath, config, }) => {
14266
+ const cacheFiles = {};
14267
+ // File System API v1 cache files
14259
14268
  const buildConfig = await read_build_output_1.readBuildOutputConfig({
14260
14269
  workPath,
14261
14270
  configFileName: 'build.json',
14262
14271
  });
14263
14272
  if ((buildConfig === null || buildConfig === void 0 ? void 0 : buildConfig.cache) && Array.isArray(buildConfig.cache)) {
14264
- const cacheFiles = {};
14265
14273
  for (const cacheGlob of buildConfig.cache) {
14266
14274
  Object.assign(cacheFiles, await build_utils_1.glob(cacheGlob, workPath));
14267
14275
  }
14268
14276
  return cacheFiles;
14269
14277
  }
14270
- const defaultCacheFiles = await build_utils_1.glob('{.shadow-cljs,node_modules}/**', workPath);
14271
- let frameworkCacheFiles = {};
14278
+ // Default cache files
14279
+ Object.assign(cacheFiles, await build_utils_1.glob('{.shadow-cljs,node_modules}/**', workPath));
14280
+ // Framework cache files
14272
14281
  const pkg = getPkg(entrypoint, workPath);
14273
14282
  const framework = getFramework(config, pkg);
14274
14283
  if (framework === null || framework === void 0 ? void 0 : framework.cachePattern) {
14275
- frameworkCacheFiles = await build_utils_1.glob(framework.cachePattern, workPath);
14284
+ Object.assign(cacheFiles, await build_utils_1.glob(framework.cachePattern, workPath));
14276
14285
  }
14277
- return { ...defaultCacheFiles, ...frameworkCacheFiles };
14286
+ return cacheFiles;
14278
14287
  };
14279
14288
  exports.prepareCache = prepareCache;
14280
14289
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "0.22.2-canary.6",
3
+ "version": "0.23.1",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -24,15 +24,15 @@
24
24
  "@types/ms": "0.7.31",
25
25
  "@types/node-fetch": "2.5.4",
26
26
  "@types/promise-timeout": "1.3.0",
27
- "@vercel/build-utils": "2.14.1-canary.8",
28
- "@vercel/frameworks": "0.6.1-canary.7",
27
+ "@vercel/build-utils": "2.15.1",
28
+ "@vercel/frameworks": "0.7.1",
29
29
  "@vercel/ncc": "0.24.0",
30
- "@vercel/routing-utils": "1.12.1-canary.0",
30
+ "@vercel/routing-utils": "1.13.1",
31
31
  "get-port": "5.0.0",
32
32
  "is-port-reachable": "2.0.1",
33
33
  "ms": "2.1.2",
34
34
  "node-fetch": "2.6.1",
35
35
  "rc9": "1.2.0"
36
36
  },
37
- "gitHead": "451e0b0cfb7f5f3e0e4f37642471b2c7b4284649"
37
+ "gitHead": "4a8504fc45092dc4a374bf7a518bd9a07f24fd41"
38
38
  }