@vercel/build-utils 6.2.1 → 6.2.3

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/errors.js CHANGED
@@ -17,7 +17,7 @@ class NowBuildError extends Error {
17
17
  }
18
18
  exports.NowBuildError = NowBuildError;
19
19
  function getPrettyError(obj) {
20
- const docsUrl = 'https://vercel.com/docs/configuration';
20
+ const docsUrl = 'https://vercel.com/docs/concepts/projects/project-configuration';
21
21
  try {
22
22
  const { dataPath, params, message: ajvMessage } = obj;
23
23
  const prop = getTopLevelPropertyName(dataPath);
@@ -35,7 +35,7 @@ function getPrettyError(obj) {
35
35
  return new NowBuildError({
36
36
  code: 'INVALID_VERCEL_CONFIG',
37
37
  message: message,
38
- link: prop ? `${docsUrl}#project/${prop.toLowerCase()}` : docsUrl,
38
+ link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
39
39
  action: 'View Documentation',
40
40
  });
41
41
  }
package/dist/fs/glob.js CHANGED
@@ -32,13 +32,24 @@ async function glob(pattern, opts, mountpoint) {
32
32
  const dirs = new Set();
33
33
  const dirsWithEntries = new Set();
34
34
  for (const relativePath of files) {
35
- const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
35
+ const absPath = path_1.default.join(options.cwd, relativePath);
36
+ const fsPath = normalize_path_1.normalizePath(absPath);
36
37
  let stat = statCache[fsPath];
37
38
  assert_1.default(stat, `statCache does not contain value for ${relativePath} (resolved to ${fsPath})`);
38
39
  const isSymlink = symlinks[fsPath];
40
+ // When `follow` mode is enabled, ensure that the entry is not a symlink
41
+ // that points to outside of `cwd`
42
+ if (options.follow &&
43
+ (isSymlink || (await fs_extra_1.lstat(fsPath)).isSymbolicLink())) {
44
+ const target = await fs_extra_1.readlink(absPath);
45
+ const absTarget = path_1.default.resolve(path_1.default.dirname(absPath), target);
46
+ if (path_1.default.relative(options.cwd, absTarget).startsWith(`..${path_1.default.sep}`)) {
47
+ continue;
48
+ }
49
+ }
39
50
  if (isSymlink || stat.isFile() || stat.isDirectory()) {
40
51
  if (isSymlink) {
41
- stat = await fs_extra_1.lstat(fsPath);
52
+ stat = await fs_extra_1.lstat(absPath);
42
53
  }
43
54
  // Some bookkeeping to track which directories already have entries within
44
55
  const dirname = path_1.default.dirname(relativePath);
package/dist/index.js CHANGED
@@ -30284,7 +30284,7 @@ class NowBuildError extends Error {
30284
30284
  }
30285
30285
  exports.NowBuildError = NowBuildError;
30286
30286
  function getPrettyError(obj) {
30287
- const docsUrl = 'https://vercel.com/docs/configuration';
30287
+ const docsUrl = 'https://vercel.com/docs/concepts/projects/project-configuration';
30288
30288
  try {
30289
30289
  const { dataPath, params, message: ajvMessage } = obj;
30290
30290
  const prop = getTopLevelPropertyName(dataPath);
@@ -30302,7 +30302,7 @@ function getPrettyError(obj) {
30302
30302
  return new NowBuildError({
30303
30303
  code: 'INVALID_VERCEL_CONFIG',
30304
30304
  message: message,
30305
- link: prop ? `${docsUrl}#project/${prop.toLowerCase()}` : docsUrl,
30305
+ link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
30306
30306
  action: 'View Documentation',
30307
30307
  });
30308
30308
  }
@@ -30744,13 +30744,24 @@ async function glob(pattern, opts, mountpoint) {
30744
30744
  const dirs = new Set();
30745
30745
  const dirsWithEntries = new Set();
30746
30746
  for (const relativePath of files) {
30747
- const fsPath = normalize_path_1.normalizePath(path_1.default.join(options.cwd, relativePath));
30747
+ const absPath = path_1.default.join(options.cwd, relativePath);
30748
+ const fsPath = normalize_path_1.normalizePath(absPath);
30748
30749
  let stat = statCache[fsPath];
30749
30750
  assert_1.default(stat, `statCache does not contain value for ${relativePath} (resolved to ${fsPath})`);
30750
30751
  const isSymlink = symlinks[fsPath];
30752
+ // When `follow` mode is enabled, ensure that the entry is not a symlink
30753
+ // that points to outside of `cwd`
30754
+ if (options.follow &&
30755
+ (isSymlink || (await fs_extra_1.lstat(fsPath)).isSymbolicLink())) {
30756
+ const target = await fs_extra_1.readlink(absPath);
30757
+ const absTarget = path_1.default.resolve(path_1.default.dirname(absPath), target);
30758
+ if (path_1.default.relative(options.cwd, absTarget).startsWith(`..${path_1.default.sep}`)) {
30759
+ continue;
30760
+ }
30761
+ }
30751
30762
  if (isSymlink || stat.isFile() || stat.isDirectory()) {
30752
30763
  if (isSymlink) {
30753
- stat = await fs_extra_1.lstat(fsPath);
30764
+ stat = await fs_extra_1.lstat(absPath);
30754
30765
  }
30755
30766
  // Some bookkeeping to track which directories already have entries within
30756
30767
  const dirname = path_1.default.dirname(relativePath);
@@ -31982,10 +31993,8 @@ exports.functionsSchema = {
31982
31993
  maxLength: 256,
31983
31994
  },
31984
31995
  memory: {
31985
- // Number between 128 and 3008 in steps of 64
31986
- enum: Object.keys(Array.from({ length: 50 }))
31987
- .slice(2, 48)
31988
- .map(x => Number(x) * 64),
31996
+ minimum: 128,
31997
+ maximum: 3008,
31989
31998
  },
31990
31999
  maxDuration: {
31991
32000
  type: 'number',
package/dist/schemas.d.ts CHANGED
@@ -13,7 +13,8 @@ export declare const functionsSchema: {
13
13
  maxLength: number;
14
14
  };
15
15
  memory: {
16
- enum: number[];
16
+ minimum: number;
17
+ maximum: number;
17
18
  };
18
19
  maxDuration: {
19
20
  type: string;
package/dist/schemas.js CHANGED
@@ -16,10 +16,8 @@ exports.functionsSchema = {
16
16
  maxLength: 256,
17
17
  },
18
18
  memory: {
19
- // Number between 128 and 3008 in steps of 64
20
- enum: Object.keys(Array.from({ length: 50 }))
21
- .slice(2, 48)
22
- .map(x => Number(x) * 64),
19
+ minimum: 128,
20
+ maximum: 3008,
23
21
  },
24
22
  maxDuration: {
25
23
  type: 'number',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -14,7 +14,7 @@
14
14
  "build": "node build",
15
15
  "test": "jest --env node --verbose --runInBand --bail",
16
16
  "test-unit": "pnpm test test/unit.*test.*",
17
- "test-integration-once": "pnpm test test/integration.test.ts"
17
+ "test-e2e": "pnpm test test/integration.test.ts"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@iarna/toml": "2.2.3",
@@ -51,5 +51,5 @@
51
51
  "typescript": "4.3.4",
52
52
  "yazl": "2.5.1"
53
53
  },
54
- "gitHead": "c1c8b454cc29de4bd306b87078f36d6416ceb90f"
54
+ "gitHead": "881e43a0e2d6daa2f7654ad16566960b00d412aa"
55
55
  }