@vercel/build-utils 14.9.1 → 14.9.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.
@@ -8,7 +8,7 @@
8
8
  * this client-side bound is intentionally coarse — it exists only to give fast
9
9
  * local feedback on obviously-invalid values.
10
10
  */
11
- export declare const DEFAULT_MAX_DURATION_LIMIT = 1800;
11
+ export declare const DEFAULT_MAX_DURATION_LIMIT = 3600;
12
12
  /**
13
13
  * Internal env var used to skip the client-side `maxDuration` upper-bound check.
14
14
  * When set to `'1'`, the client-side maximum ({@link DEFAULT_MAX_DURATION_LIMIT})
@@ -24,7 +24,7 @@ __export(max_duration_exports, {
24
24
  getMaxDurationSchema: () => getMaxDurationSchema
25
25
  });
26
26
  module.exports = __toCommonJS(max_duration_exports);
27
- const DEFAULT_MAX_DURATION_LIMIT = 1800;
27
+ const DEFAULT_MAX_DURATION_LIMIT = 3600;
28
28
  const SKIP_MAX_DURATION_LIMIT_ENV = "VERCEL_CLI_SKIP_MAX_DURATION_LIMIT";
29
29
  function getMaxDurationLimit() {
30
30
  if (process.env[SKIP_MAX_DURATION_LIMIT_ENV] === "1") {
package/lazy-entry.mjs ADDED
@@ -0,0 +1,39 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { transform } from 'esbuild';
3
+
4
+ // Keep the public CommonJS barrel's getters, but initialize each re-exported
5
+ // module on first use. All exports still share one bundled module cache.
6
+ export function lazyEntryPlugin() {
7
+ return {
8
+ name: 'lazy-build-utils-entry',
9
+ setup(build) {
10
+ build.onLoad(
11
+ { filter: /[/\\]build-utils[/\\]src[/\\]index\.ts$/ },
12
+ async args => {
13
+ const source = await readFile(args.path, 'utf8');
14
+ let { code } = await transform(source, {
15
+ loader: 'ts',
16
+ format: 'cjs',
17
+ });
18
+ const imports = [];
19
+ code = code.replace(
20
+ /^var (import_\w+) = (.+);$/gm,
21
+ (_, name, initializer) => {
22
+ imports.push(name);
23
+ return `var ${name};\nvar load_${name} = () => ${name} ??= ${initializer};`;
24
+ }
25
+ );
26
+ if (imports.length === 0) {
27
+ throw new Error(
28
+ 'Expected CommonJS imports in the build-utils barrel'
29
+ );
30
+ }
31
+ for (const name of imports) {
32
+ code = code.replaceAll(`() => ${name}.`, `() => load_${name}().`);
33
+ }
34
+ return { contents: code, loader: 'js' };
35
+ }
36
+ );
37
+ },
38
+ };
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "14.9.1",
3
+ "version": "14.9.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -52,8 +52,8 @@
52
52
  "vitest": "4.1.10",
53
53
  "typescript": "4.9.5",
54
54
  "yazl": "2.5.1",
55
- "@vercel/error-utils": "2.2.1",
56
- "@vercel/routing-utils": "6.5.0"
55
+ "@vercel/routing-utils": "6.5.0",
56
+ "@vercel/error-utils": "2.2.1"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "node build.mjs",