@vercel/static-build 2.9.36 → 2.9.38

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 +414 -48
  2. package/package.json +7 -7
package/dist/index.js CHANGED
@@ -9345,6 +9345,40 @@ var require_frameworks = __commonJS({
9345
9345
  getOutputDirName: async () => ".output",
9346
9346
  experimental: true
9347
9347
  },
9348
+ {
9349
+ name: "Eve",
9350
+ slug: "eve",
9351
+ logo: "https://api-frameworks.vercel.sh/framework-logos/eve.svg",
9352
+ darkModeLogo: "https://api-frameworks.vercel.sh/framework-logos/eve-dark.svg",
9353
+ tagline: "A filesystem-first framework for durable backend agents on Vercel.",
9354
+ description: "An Eve app: agents authored as a directory of files, compiled and served on Vercel.",
9355
+ detectors: {
9356
+ every: [
9357
+ {
9358
+ path: "package.json",
9359
+ matchContent: '"(dev)?(d|D)ependencies":\\s*{[^}]*"eve":\\s*".+?"[^}]*}'
9360
+ }
9361
+ ]
9362
+ },
9363
+ settings: {
9364
+ installCommand: {
9365
+ placeholder: "`pnpm install`, `yarn install`, or `npm install`"
9366
+ },
9367
+ buildCommand: {
9368
+ value: "eve build",
9369
+ placeholder: "`npm run build` or `eve build`"
9370
+ },
9371
+ devCommand: {
9372
+ value: "eve dev",
9373
+ placeholder: "eve dev"
9374
+ },
9375
+ outputDirectory: {
9376
+ value: ".output"
9377
+ }
9378
+ },
9379
+ getOutputDirName: async () => ".output",
9380
+ experimental: true
9381
+ },
9348
9382
  {
9349
9383
  name: "Sanity",
9350
9384
  slug: "sanity",
@@ -9404,7 +9438,7 @@ var require_frameworks = __commonJS({
9404
9438
  ]
9405
9439
  },
9406
9440
  {
9407
- name: "Sanity (v2)",
9441
+ name: "Sanity (v2 - legacy)",
9408
9442
  slug: "sanity-v2",
9409
9443
  demo: "https://sanity-studio-template.vercel.app",
9410
9444
  logo: "https://api-frameworks.vercel.sh/framework-logos/sanity-v2.svg",
@@ -13621,12 +13655,15 @@ var require_ensure = __commonJS({
13621
13655
  }
13622
13656
  });
13623
13657
 
13624
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
13658
+ // ../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/utils.js
13625
13659
  var require_utils3 = __commonJS({
13626
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module2) {
13660
+ "../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/utils.js"(exports, module2) {
13627
13661
  function stringify2(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
13628
13662
  const EOF = finalEOL ? EOL : "";
13629
13663
  const str = JSON.stringify(obj, replacer, spaces);
13664
+ if (str === void 0) {
13665
+ throw new TypeError(`Converting ${typeof obj} value to JSON is not supported`);
13666
+ }
13630
13667
  return str.replace(/\n/g, EOL) + EOF;
13631
13668
  }
13632
13669
  function stripBom(content) {
@@ -13638,9 +13675,9 @@ var require_utils3 = __commonJS({
13638
13675
  }
13639
13676
  });
13640
13677
 
13641
- // ../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js
13678
+ // ../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/index.js
13642
13679
  var require_jsonfile = __commonJS({
13643
- "../../node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/index.js"(exports, module2) {
13680
+ "../../node_modules/.pnpm/jsonfile@6.2.1/node_modules/jsonfile/index.js"(exports, module2) {
13644
13681
  var _fs;
13645
13682
  try {
13646
13683
  _fs = require_graceful_fs();
@@ -13701,13 +13738,12 @@ var require_jsonfile = __commonJS({
13701
13738
  const str = stringify2(obj, options);
13702
13739
  return fs5.writeFileSync(file, str, options);
13703
13740
  }
13704
- var jsonfile = {
13741
+ module2.exports = {
13705
13742
  readFile,
13706
13743
  readFileSync: readFileSync2,
13707
13744
  writeFile,
13708
13745
  writeFileSync
13709
13746
  };
13710
- module2.exports = jsonfile;
13711
13747
  }
13712
13748
  });
13713
13749
 
@@ -16927,9 +16963,9 @@ var require_balanced_match = __commonJS({
16927
16963
  }
16928
16964
  });
16929
16965
 
16930
- // ../../node_modules/.pnpm/brace-expansion@1.1.11/node_modules/brace-expansion/index.js
16966
+ // ../../node_modules/.pnpm/brace-expansion@1.1.15/node_modules/brace-expansion/index.js
16931
16967
  var require_brace_expansion = __commonJS({
16932
- "../../node_modules/.pnpm/brace-expansion@1.1.11/node_modules/brace-expansion/index.js"(exports, module2) {
16968
+ "../../node_modules/.pnpm/brace-expansion@1.1.15/node_modules/brace-expansion/index.js"(exports, module2) {
16933
16969
  var concatMap = require_concat_map();
16934
16970
  var balanced = require_balanced_match();
16935
16971
  module2.exports = expandTop;
@@ -16967,13 +17003,15 @@ var require_brace_expansion = __commonJS({
16967
17003
  parts.push.apply(parts, p);
16968
17004
  return parts;
16969
17005
  }
16970
- function expandTop(str) {
17006
+ function expandTop(str, options) {
16971
17007
  if (!str)
16972
17008
  return [];
17009
+ options = options || {};
17010
+ var max = options.max == null ? Infinity : options.max;
16973
17011
  if (str.substr(0, 2) === "{}") {
16974
17012
  str = "\\{\\}" + str.substr(2);
16975
17013
  }
16976
- return expand(escapeBraces(str), true).map(unescapeBraces);
17014
+ return expand(escapeBraces(str), max, true).map(unescapeBraces);
16977
17015
  }
16978
17016
  function embrace(str) {
16979
17017
  return "{" + str + "}";
@@ -16987,7 +17025,7 @@ var require_brace_expansion = __commonJS({
16987
17025
  function gte(i, y) {
16988
17026
  return i >= y;
16989
17027
  }
16990
- function expand(str, isTop) {
17028
+ function expand(str, max, isTop) {
16991
17029
  var expansions = [];
16992
17030
  var m = balanced("{", "}", str);
16993
17031
  if (!m || /\$$/.test(m.pre))
@@ -16997,9 +17035,9 @@ var require_brace_expansion = __commonJS({
16997
17035
  var isSequence = isNumericSequence || isAlphaSequence;
16998
17036
  var isOptions = m.body.indexOf(",") >= 0;
16999
17037
  if (!isSequence && !isOptions) {
17000
- if (m.post.match(/,.*\}/)) {
17038
+ if (m.post.match(/,(?!,).*\}/)) {
17001
17039
  str = m.pre + "{" + m.body + escClose + m.post;
17002
- return expand(str);
17040
+ return expand(str, max, true);
17003
17041
  }
17004
17042
  return [str];
17005
17043
  }
@@ -17009,9 +17047,9 @@ var require_brace_expansion = __commonJS({
17009
17047
  } else {
17010
17048
  n = parseCommaParts(m.body);
17011
17049
  if (n.length === 1) {
17012
- n = expand(n[0], false).map(embrace);
17050
+ n = expand(n[0], max, false).map(embrace);
17013
17051
  if (n.length === 1) {
17014
- var post = m.post.length ? expand(m.post, false) : [""];
17052
+ var post = m.post.length ? expand(m.post, max, false) : [""];
17015
17053
  return post.map(function(p) {
17016
17054
  return m.pre + n[0] + p;
17017
17055
  });
@@ -17019,13 +17057,13 @@ var require_brace_expansion = __commonJS({
17019
17057
  }
17020
17058
  }
17021
17059
  var pre = m.pre;
17022
- var post = m.post.length ? expand(m.post, false) : [""];
17060
+ var post = m.post.length ? expand(m.post, max, false) : [""];
17023
17061
  var N;
17024
17062
  if (isSequence) {
17025
17063
  var x = numeric(n[0]);
17026
17064
  var y = numeric(n[1]);
17027
17065
  var width = Math.max(n[0].length, n[1].length);
17028
- var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
17066
+ var incr = n.length == 3 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
17029
17067
  var test = lte;
17030
17068
  var reverse = y < x;
17031
17069
  if (reverse) {
@@ -17034,7 +17072,7 @@ var require_brace_expansion = __commonJS({
17034
17072
  }
17035
17073
  var pad = n.some(isPadded);
17036
17074
  N = [];
17037
- for (var i = x; test(i, y); i += incr) {
17075
+ for (var i = x; test(i, y) && N.length < max; i += incr) {
17038
17076
  var c;
17039
17077
  if (isAlphaSequence) {
17040
17078
  c = String.fromCharCode(i);
@@ -17057,11 +17095,11 @@ var require_brace_expansion = __commonJS({
17057
17095
  }
17058
17096
  } else {
17059
17097
  N = concatMap(n, function(el) {
17060
- return expand(el, false);
17098
+ return expand(el, max, false);
17061
17099
  });
17062
17100
  }
17063
17101
  for (var j = 0; j < N.length; j++) {
17064
- for (var k = 0; k < post.length; k++) {
17102
+ for (var k = 0; k < post.length && expansions.length < max; k++) {
17065
17103
  var expansion = pre + N[j] + post[k];
17066
17104
  if (!isTop || isSequence || expansion)
17067
17105
  expansions.push(expansion);
@@ -22855,8 +22893,13 @@ var require_resolve = __commonJS({
22855
22893
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
22856
22894
  var resolve_exports = {};
22857
22895
  __export2(resolve_exports, {
22896
+ detectFrameworkFromWorkspace: () => detectFrameworkFromWorkspace,
22897
+ getServiceFs: () => getServiceFs,
22898
+ inferWorkspaceFromNearestManifest: () => inferWorkspaceFromNearestManifest,
22899
+ parsePyModuleAttrEntrypoint: () => parsePyModuleAttrEntrypoint,
22858
22900
  resolveAllConfiguredServices: () => resolveAllConfiguredServices,
22859
22901
  resolveConfiguredService: () => resolveConfiguredService,
22902
+ resolveEntrypointPath: () => resolveEntrypointPath,
22860
22903
  validateServiceConfig: () => validateServiceConfig,
22861
22904
  validateServiceEntrypoint: () => validateServiceEntrypoint
22862
22905
  });
@@ -23503,6 +23546,7 @@ var require_resolve = __commonJS({
23503
23546
  builderConfig.handlerFunction = moduleAttrParsed.attrName;
23504
23547
  }
23505
23548
  return {
23549
+ schema: "experimentalServices",
23506
23550
  name,
23507
23551
  type,
23508
23552
  trigger,
@@ -23708,6 +23752,270 @@ var require_resolve = __commonJS({
23708
23752
  }
23709
23753
  });
23710
23754
 
23755
+ // ../fs-detectors/dist/services/resolve-v2.js
23756
+ var require_resolve_v2 = __commonJS({
23757
+ "../fs-detectors/dist/services/resolve-v2.js"(exports, module2) {
23758
+ "use strict";
23759
+ var __defProp2 = Object.defineProperty;
23760
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23761
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
23762
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
23763
+ var __export2 = (target, all) => {
23764
+ for (var name in all)
23765
+ __defProp2(target, name, { get: all[name], enumerable: true });
23766
+ };
23767
+ var __copyProps2 = (to, from, except, desc) => {
23768
+ if (from && typeof from === "object" || typeof from === "function") {
23769
+ for (let key of __getOwnPropNames2(from))
23770
+ if (!__hasOwnProp2.call(to, key) && key !== except)
23771
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
23772
+ }
23773
+ return to;
23774
+ };
23775
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
23776
+ var resolve_v2_exports = {};
23777
+ __export2(resolve_v2_exports, {
23778
+ resolveAllConfiguredServicesV2: () => resolveAllConfiguredServicesV22,
23779
+ resolveConfiguredServiceV2: () => resolveConfiguredServiceV22,
23780
+ validateServiceConfigV2: () => validateServiceConfigV22
23781
+ });
23782
+ module2.exports = __toCommonJS2(resolve_v2_exports);
23783
+ var import_path7 = require("path");
23784
+ var import_build_utils5 = require("@vercel/build-utils");
23785
+ var import_frameworks2 = require_frameworks();
23786
+ var import_types = require_types3();
23787
+ var import_resolve = require_resolve();
23788
+ var import_utils = require_utils4();
23789
+ var frameworksBySlug = new Map(import_frameworks2.frameworkList.map((f) => [f.slug, f]));
23790
+ var SERVICE_NAME_REGEX = /^[a-zA-Z]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$/;
23791
+ function validateServiceConfigV22(name, config) {
23792
+ if (!SERVICE_NAME_REGEX.test(name)) {
23793
+ return {
23794
+ code: "INVALID_SERVICE_NAME",
23795
+ message: `Service name "${name}" is invalid. Names must start with a letter, end with an alphanumeric character, and contain only alphanumeric characters, hyphens, and underscores.`,
23796
+ serviceName: name
23797
+ };
23798
+ }
23799
+ if (!config || typeof config !== "object") {
23800
+ return {
23801
+ code: "INVALID_SERVICE_CONFIG",
23802
+ message: `Service "${name}" has an invalid configuration. Expected an object.`,
23803
+ serviceName: name
23804
+ };
23805
+ }
23806
+ if (typeof config.root !== "string" || config.root.length === 0) {
23807
+ return {
23808
+ code: "MISSING_ROOT",
23809
+ message: `Service "${name}" must specify a "root".`,
23810
+ serviceName: name
23811
+ };
23812
+ }
23813
+ const normalizedRoot = import_path7.posix.normalize(config.root);
23814
+ if (normalizedRoot.startsWith("/")) {
23815
+ return {
23816
+ code: "INVALID_ROOT",
23817
+ message: `Service "${name}" has invalid "root" "${config.root}". Must be a relative path.`,
23818
+ serviceName: name
23819
+ };
23820
+ }
23821
+ if (normalizedRoot === ".." || normalizedRoot.startsWith("../")) {
23822
+ return {
23823
+ code: "INVALID_ROOT",
23824
+ message: `Service "${name}" has invalid "root" "${config.root}". Must not escape the project root.`,
23825
+ serviceName: name
23826
+ };
23827
+ }
23828
+ if (config.runtime && !(config.runtime in import_types.RUNTIME_BUILDERS)) {
23829
+ return {
23830
+ code: "INVALID_RUNTIME",
23831
+ message: `Service "${name}" has invalid runtime "${config.runtime}".`,
23832
+ serviceName: name
23833
+ };
23834
+ }
23835
+ if (config.framework && !frameworksBySlug.has(config.framework)) {
23836
+ return {
23837
+ code: "INVALID_FRAMEWORK",
23838
+ message: `Service "${name}" has invalid framework "${config.framework}".`,
23839
+ serviceName: name
23840
+ };
23841
+ }
23842
+ if (config.runtime && config.framework) {
23843
+ const frameworkRuntime = (0, import_utils.inferRuntimeFromFramework)(config.framework);
23844
+ if (frameworkRuntime && frameworkRuntime !== config.runtime) {
23845
+ return {
23846
+ code: "RUNTIME_FRAMEWORK_MISMATCH",
23847
+ message: `Service "${name}" has conflicting runtime/framework: runtime "${config.runtime}" is incompatible with framework "${config.framework}" (runtime "${frameworkRuntime}").`,
23848
+ serviceName: name
23849
+ };
23850
+ }
23851
+ }
23852
+ if (!config.framework && !config.entrypoint) {
23853
+ return {
23854
+ code: "MISSING_SERVICE_CONFIG",
23855
+ message: `Service "${name}" must specify "framework" or "entrypoint".`,
23856
+ serviceName: name
23857
+ };
23858
+ }
23859
+ return null;
23860
+ }
23861
+ async function resolveConfiguredServiceV22(name, config, fs5) {
23862
+ const root = config.root;
23863
+ const normalizedRoot = import_path7.posix.normalize(root);
23864
+ const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, root);
23865
+ if (serviceFsResult.error) {
23866
+ return { error: serviceFsResult.error };
23867
+ }
23868
+ const serviceFs = serviceFsResult.fs;
23869
+ const rawEntrypoint = config.entrypoint;
23870
+ const moduleAttr = typeof rawEntrypoint === "string" ? (0, import_resolve.parsePyModuleAttrEntrypoint)(rawEntrypoint) : null;
23871
+ let normalizedEntrypoint;
23872
+ let entrypointIsDirectory = false;
23873
+ if (typeof rawEntrypoint === "string") {
23874
+ const entrypointToResolve = moduleAttr ? moduleAttr.filePath : rawEntrypoint;
23875
+ const resolved = await (0, import_resolve.resolveEntrypointPath)({
23876
+ fs: serviceFs,
23877
+ serviceName: name,
23878
+ entrypoint: entrypointToResolve
23879
+ });
23880
+ if (resolved.error) {
23881
+ return { error: resolved.error };
23882
+ }
23883
+ normalizedEntrypoint = resolved.entrypoint?.normalized;
23884
+ entrypointIsDirectory = Boolean(resolved.entrypoint?.isDirectory);
23885
+ }
23886
+ const entrypointFile = entrypointIsDirectory || !normalizedEntrypoint ? void 0 : normalizedEntrypoint;
23887
+ const inferredRuntime = (0, import_utils.inferServiceRuntime)({
23888
+ runtime: config.runtime,
23889
+ framework: config.framework,
23890
+ entrypoint: entrypointFile
23891
+ });
23892
+ let framework = config.framework;
23893
+ if (!framework && normalizedEntrypoint) {
23894
+ const workspace = entrypointIsDirectory ? normalizedEntrypoint : import_path7.posix.dirname(normalizedEntrypoint) || ".";
23895
+ const detection = await (0, import_resolve.detectFrameworkFromWorkspace)({
23896
+ fs: serviceFs,
23897
+ workspace,
23898
+ serviceName: name,
23899
+ runtime: inferredRuntime
23900
+ });
23901
+ if (detection.error) {
23902
+ return { error: detection.error };
23903
+ }
23904
+ framework = detection.framework;
23905
+ }
23906
+ if (entrypointIsDirectory && !framework) {
23907
+ return {
23908
+ error: {
23909
+ code: "MISSING_SERVICE_FRAMEWORK",
23910
+ message: `Service "${name}" uses directory entrypoint "${config.entrypoint}" but no framework could be detected. Specify "framework" explicitly or use a file entrypoint.`,
23911
+ serviceName: name
23912
+ }
23913
+ };
23914
+ }
23915
+ const frameworkDefinition = framework ? frameworksBySlug.get(framework) : void 0;
23916
+ let builderUse;
23917
+ let builderSrc;
23918
+ if (framework) {
23919
+ builderUse = (0, import_build_utils5.isNodeBackendFramework)(framework) ? "@vercel/backends" : frameworkDefinition?.useRuntime?.use || "@vercel/static-build";
23920
+ builderSrc = entrypointFile || frameworkDefinition?.useRuntime?.src || "package.json";
23921
+ } else {
23922
+ if (!inferredRuntime) {
23923
+ return {
23924
+ error: {
23925
+ code: "MISSING_SERVICE_CONFIG",
23926
+ message: `Service "${name}" must specify "framework" or a runtime-resolvable "entrypoint".`,
23927
+ serviceName: name
23928
+ }
23929
+ };
23930
+ }
23931
+ builderUse = inferredRuntime === "node" ? "@vercel/backends" : (0, import_utils.getBuilderForRuntime)(inferredRuntime);
23932
+ builderSrc = entrypointFile;
23933
+ }
23934
+ const isRoot = normalizedRoot === ".";
23935
+ const projectRelativeSrc = isRoot ? builderSrc : import_path7.posix.join(normalizedRoot, builderSrc);
23936
+ const builderConfig = { zeroConfig: true };
23937
+ if (builderUse === "@vercel/backends") {
23938
+ builderConfig.serviceName = name;
23939
+ }
23940
+ if (framework) {
23941
+ builderConfig.framework = framework;
23942
+ }
23943
+ if (!isRoot) {
23944
+ builderConfig.workspace = normalizedRoot;
23945
+ }
23946
+ if (moduleAttr) {
23947
+ builderConfig.handlerFunction = moduleAttr.attrName;
23948
+ }
23949
+ const runtime = import_types.STATIC_BUILDERS.has(builderUse) ? void 0 : inferredRuntime;
23950
+ return {
23951
+ service: {
23952
+ schema: "experimentalServicesV2",
23953
+ name,
23954
+ root,
23955
+ framework,
23956
+ runtime,
23957
+ entrypoint: entrypointFile,
23958
+ builder: {
23959
+ src: projectRelativeSrc,
23960
+ use: builderUse,
23961
+ config: builderConfig
23962
+ },
23963
+ installCommand: config.installCommand,
23964
+ buildCommand: config.buildCommand,
23965
+ devCommand: config.devCommand,
23966
+ ignoreCommand: config.ignoreCommand,
23967
+ outputDirectory: config.outputDirectory,
23968
+ bindings: config.bindings,
23969
+ functions: config.functions,
23970
+ headers: config.headers,
23971
+ redirects: config.redirects,
23972
+ rewrites: config.rewrites,
23973
+ routes: config.routes,
23974
+ cleanUrls: config.cleanUrls,
23975
+ trailingSlash: config.trailingSlash
23976
+ }
23977
+ };
23978
+ }
23979
+ async function resolveAllConfiguredServicesV22(services, fs5) {
23980
+ const resolved = [];
23981
+ const errors = [];
23982
+ for (const name of Object.keys(services)) {
23983
+ const config = services[name];
23984
+ const validationError = validateServiceConfigV22(name, config);
23985
+ if (validationError) {
23986
+ errors.push(validationError);
23987
+ continue;
23988
+ }
23989
+ const { service, error } = await resolveConfiguredServiceV22(
23990
+ name,
23991
+ config,
23992
+ fs5
23993
+ );
23994
+ if (error) {
23995
+ errors.push(error);
23996
+ continue;
23997
+ }
23998
+ if (service) {
23999
+ resolved.push(service);
24000
+ }
24001
+ }
24002
+ const serviceNames = new Set(Object.keys(services));
24003
+ for (const service of resolved) {
24004
+ for (const binding of service.bindings ?? []) {
24005
+ if (!serviceNames.has(binding.service)) {
24006
+ errors.push({
24007
+ code: "UNKNOWN_SERVICE_BINDING",
24008
+ message: `Service "${service.name}" declares a binding to unknown service "${binding.service}".`,
24009
+ serviceName: service.name
24010
+ });
24011
+ }
24012
+ }
24013
+ }
24014
+ return { services: resolved, errors };
24015
+ }
24016
+ }
24017
+ });
24018
+
23711
24019
  // ../fs-detectors/dist/services/auto-detect.js
23712
24020
  var require_auto_detect = __commonJS({
23713
24021
  "../fs-detectors/dist/services/auto-detect.js"(exports, module2) {
@@ -27599,6 +27907,7 @@ var require_detect_services = __commonJS({
27599
27907
  var import_routing_utils = require_dist7();
27600
27908
  var import_utils = require_utils4();
27601
27909
  var import_resolve = require_resolve();
27910
+ var import_resolve_v2 = require_resolve_v2();
27602
27911
  var import_auto_detect = require_auto_detect();
27603
27912
  var import_detect_railway = require_detect_railway();
27604
27913
  var import_detect_render = require_detect_render();
@@ -27663,7 +27972,8 @@ var require_detect_services = __commonJS({
27663
27972
  fs: fs5,
27664
27973
  workPath,
27665
27974
  detectEntrypoint,
27666
- configuredServices: providedConfiguredServices
27975
+ configuredServices: providedConfiguredServices,
27976
+ configuredServicesType: providedConfiguredServicesType
27667
27977
  } = options;
27668
27978
  const scopedFs = workPath ? fs5.chdir(workPath) : fs5;
27669
27979
  const { config: vercelConfig, error: configError } = await (0, import_utils.readVercelConfig)(scopedFs);
@@ -27678,9 +27988,26 @@ var require_detect_services = __commonJS({
27678
27988
  });
27679
27989
  }
27680
27990
  const hasProvidedConfiguredServices = providedConfiguredServices && Object.keys(providedConfiguredServices).length > 0;
27681
- const configuredServices = hasProvidedConfiguredServices ? providedConfiguredServices : vercelConfig?.experimentalServices;
27682
- const hasConfiguredServices = configuredServices && Object.keys(configuredServices).length > 0;
27683
- if (!hasConfiguredServices) {
27991
+ const experimentalServicesV2 = hasProvidedConfiguredServices && providedConfiguredServicesType === "experimentalServicesV2" ? providedConfiguredServices : hasProvidedConfiguredServices ? void 0 : vercelConfig?.experimentalServicesV2;
27992
+ if (experimentalServicesV2 && Object.keys(experimentalServicesV2).length > 0) {
27993
+ const result2 = await (0, import_resolve_v2.resolveAllConfiguredServicesV2)(
27994
+ experimentalServicesV2,
27995
+ scopedFs
27996
+ );
27997
+ return withResolvedResult({
27998
+ services: result2.services,
27999
+ source: "configured",
28000
+ // V2 uses explicit `bindings`, so no implicit `{NAME}_URL` injection.
28001
+ useImplicitEnvInjection: false,
28002
+ // V2 routes are explicitly carried per-service to output them separately.
28003
+ routes: emptyRoutes(),
28004
+ errors: result2.errors,
28005
+ warnings: []
28006
+ });
28007
+ }
28008
+ const experimentalServicesV1 = hasProvidedConfiguredServices ? providedConfiguredServices : vercelConfig?.experimentalServices;
28009
+ const hasExperimentalServicesV1 = experimentalServicesV1 && Object.keys(experimentalServicesV1).length > 0;
28010
+ if (!hasExperimentalServicesV1) {
27684
28011
  const detectors = [
27685
28012
  { detect: import_detect_railway.detectRailwayServices, source: "railway" },
27686
28013
  { detect: import_detect_render.detectRenderServices, source: "render" },
@@ -27708,7 +28035,7 @@ var require_detect_services = __commonJS({
27708
28035
  });
27709
28036
  }
27710
28037
  const result = await (0, import_resolve.resolveAllConfiguredServices)(
27711
- configuredServices,
28038
+ experimentalServicesV1,
27712
28039
  scopedFs,
27713
28040
  "configured"
27714
28041
  );
@@ -27783,7 +28110,8 @@ var require_detect_services = __commonJS({
27783
28110
  inferred
27784
28111
  );
27785
28112
  }
27786
- function generateServicesRoutes2(services) {
28113
+ function generateServicesRoutes2(allServices) {
28114
+ const services = allServices.filter(import_build_utils5.isExperimentalService);
27787
28115
  const hostRewrites = [];
27788
28116
  const rewrites = [];
27789
28117
  const defaults = [];
@@ -28124,7 +28452,8 @@ var require_get_services_builders = __commonJS({
28124
28452
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
28125
28453
  var get_services_builders_exports = {};
28126
28454
  __export2(get_services_builders_exports, {
28127
- getServicesBuilders: () => getServicesBuilders2
28455
+ getServicesBuilders: () => getServicesBuilders2,
28456
+ warnIgnoredDirectories: () => warnIgnoredDirectories
28128
28457
  });
28129
28458
  module2.exports = __toCommonJS2(get_services_builders_exports);
28130
28459
  var import_detect_services = require_detect_services();
@@ -28240,6 +28569,23 @@ var require_get_services_builders = __commonJS({
28240
28569
  useImplicitEnvInjection: result.useImplicitEnvInjection
28241
28570
  };
28242
28571
  }
28572
+ function warnIgnoredDirectories(files, configuredServices) {
28573
+ const warnings = [];
28574
+ if (files.some((f) => f.startsWith("api/"))) {
28575
+ const serviceCoversApi = Object.values(configuredServices).some((service) => {
28576
+ const root = service.root ?? ".";
28577
+ const entrypoint = service.entrypoint ?? "";
28578
+ return root === "api" || root.startsWith("api/") || root === "." && entrypoint.startsWith("api/");
28579
+ });
28580
+ if (!serviceCoversApi) {
28581
+ warnings.push({
28582
+ code: "api_dir_ignored",
28583
+ message: "The `api/` directory will not be built because `experimentalServices` is configured. To serve these files, declare them as a service in your `vercel.json`."
28584
+ });
28585
+ }
28586
+ }
28587
+ return warnings;
28588
+ }
28243
28589
  }
28244
28590
  });
28245
28591
 
@@ -28340,18 +28686,28 @@ var require_detect_builders = __commonJS({
28340
28686
  return publicBuilder ? publicBuilder.src.replace("/**/*", "") : null;
28341
28687
  }
28342
28688
  async function detectBuilders2(files, pkg, options = {}) {
28343
- const { experimentalServices, projectSettings = {} } = options;
28689
+ const {
28690
+ experimentalServices: experimentalServicesV1,
28691
+ experimentalServicesV2,
28692
+ projectSettings = {}
28693
+ } = options;
28344
28694
  const { framework } = projectSettings;
28345
- const configuredServices = experimentalServices;
28346
- const configuredServicesType = "experimentalServices";
28695
+ const configuredServices = experimentalServicesV2 ?? experimentalServicesV1;
28696
+ const configuredServicesType = experimentalServicesV2 ? "experimentalServicesV2" : "experimentalServices";
28347
28697
  const hasServicesConfig = configuredServices != null && typeof configuredServices === "object";
28348
28698
  if (hasServicesConfig || framework === "services") {
28349
- return (0, import_get_services_builders.getServicesBuilders)({
28699
+ const result = await (0, import_get_services_builders.getServicesBuilders)({
28350
28700
  workPath: options.workPath,
28351
28701
  configuredServices,
28352
28702
  configuredServicesType,
28353
28703
  projectFramework: framework
28354
28704
  });
28705
+ if (configuredServices != null) {
28706
+ result.warnings.push(
28707
+ ...(0, import_get_services_builders.warnIgnoredDirectories)(files, configuredServices)
28708
+ );
28709
+ }
28710
+ return result;
28355
28711
  }
28356
28712
  const errors = [];
28357
28713
  const warnings = [];
@@ -28734,10 +29090,11 @@ var require_detect_builders = __commonJS({
28734
29090
  message: "Function must contain at least one property."
28735
29091
  };
28736
29092
  }
28737
- if (func.maxDuration !== void 0 && func.maxDuration !== "max" && (func.maxDuration < 1 || func.maxDuration > 900 || !Number.isInteger(func.maxDuration))) {
29093
+ const maxDurationLimit = (0, import_build_utils5.getMaxDurationLimit)();
29094
+ if (func.maxDuration !== void 0 && func.maxDuration !== "max" && (func.maxDuration < 1 || maxDurationLimit !== void 0 && func.maxDuration > maxDurationLimit || !Number.isInteger(func.maxDuration))) {
28738
29095
  return {
28739
29096
  code: "invalid_function_duration",
28740
- message: 'Functions must have a maxDuration between 1 and 900, or "max".'
29097
+ message: maxDurationLimit !== void 0 ? `Functions must have a maxDuration between 1 and ${maxDurationLimit}, or "max".` : 'Functions must have a positive integer maxDuration, or "max".'
28741
29098
  };
28742
29099
  }
28743
29100
  if (func.memory !== void 0 && (func.memory < 128 || func.memory > 10240)) {
@@ -29812,9 +30169,9 @@ var require_path = __commonJS({
29812
30169
  }
29813
30170
  });
29814
30171
 
29815
- // ../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js
30172
+ // ../../node_modules/.pnpm/brace-expansion@2.1.1/node_modules/brace-expansion/index.js
29816
30173
  var require_brace_expansion2 = __commonJS({
29817
- "../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js"(exports, module2) {
30174
+ "../../node_modules/.pnpm/brace-expansion@2.1.1/node_modules/brace-expansion/index.js"(exports, module2) {
29818
30175
  var balanced = require_balanced_match();
29819
30176
  module2.exports = expandTop;
29820
30177
  var escSlash = "\0SLASH" + Math.random() + "\0";
@@ -29851,13 +30208,15 @@ var require_brace_expansion2 = __commonJS({
29851
30208
  parts.push.apply(parts, p);
29852
30209
  return parts;
29853
30210
  }
29854
- function expandTop(str) {
30211
+ function expandTop(str, options) {
29855
30212
  if (!str)
29856
30213
  return [];
30214
+ options = options || {};
30215
+ var max = options.max == null ? Infinity : options.max;
29857
30216
  if (str.substr(0, 2) === "{}") {
29858
30217
  str = "\\{\\}" + str.substr(2);
29859
30218
  }
29860
- return expand(escapeBraces(str), true).map(unescapeBraces);
30219
+ return expand(escapeBraces(str), max, true).map(unescapeBraces);
29861
30220
  }
29862
30221
  function embrace(str) {
29863
30222
  return "{" + str + "}";
@@ -29871,15 +30230,15 @@ var require_brace_expansion2 = __commonJS({
29871
30230
  function gte(i, y) {
29872
30231
  return i >= y;
29873
30232
  }
29874
- function expand(str, isTop) {
30233
+ function expand(str, max, isTop) {
29875
30234
  var expansions = [];
29876
30235
  var m = balanced("{", "}", str);
29877
30236
  if (!m)
29878
30237
  return [str];
29879
30238
  var pre = m.pre;
29880
- var post = m.post.length ? expand(m.post, false) : [""];
30239
+ var post = m.post.length ? expand(m.post, max, false) : [""];
29881
30240
  if (/\$$/.test(m.pre)) {
29882
- for (var k = 0; k < post.length; k++) {
30241
+ for (var k = 0; k < post.length && k < max; k++) {
29883
30242
  var expansion = pre + "{" + m.body + "}" + post[k];
29884
30243
  expansions.push(expansion);
29885
30244
  }
@@ -29889,9 +30248,9 @@ var require_brace_expansion2 = __commonJS({
29889
30248
  var isSequence = isNumericSequence || isAlphaSequence;
29890
30249
  var isOptions = m.body.indexOf(",") >= 0;
29891
30250
  if (!isSequence && !isOptions) {
29892
- if (m.post.match(/,.*\}/)) {
30251
+ if (m.post.match(/,(?!,).*\}/)) {
29893
30252
  str = m.pre + "{" + m.body + escClose + m.post;
29894
- return expand(str);
30253
+ return expand(str, max, true);
29895
30254
  }
29896
30255
  return [str];
29897
30256
  }
@@ -29901,7 +30260,7 @@ var require_brace_expansion2 = __commonJS({
29901
30260
  } else {
29902
30261
  n = parseCommaParts(m.body);
29903
30262
  if (n.length === 1) {
29904
- n = expand(n[0], false).map(embrace);
30263
+ n = expand(n[0], max, false).map(embrace);
29905
30264
  if (n.length === 1) {
29906
30265
  return post.map(function(p) {
29907
30266
  return m.pre + n[0] + p;
@@ -29914,7 +30273,7 @@ var require_brace_expansion2 = __commonJS({
29914
30273
  var x = numeric(n[0]);
29915
30274
  var y = numeric(n[1]);
29916
30275
  var width = Math.max(n[0].length, n[1].length);
29917
- var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
30276
+ var incr = n.length == 3 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
29918
30277
  var test = lte;
29919
30278
  var reverse = y < x;
29920
30279
  if (reverse) {
@@ -29923,7 +30282,7 @@ var require_brace_expansion2 = __commonJS({
29923
30282
  }
29924
30283
  var pad = n.some(isPadded);
29925
30284
  N = [];
29926
- for (var i = x; test(i, y); i += incr) {
30285
+ for (var i = x; test(i, y) && N.length < max; i += incr) {
29927
30286
  var c;
29928
30287
  if (isAlphaSequence) {
29929
30288
  c = String.fromCharCode(i);
@@ -29947,11 +30306,11 @@ var require_brace_expansion2 = __commonJS({
29947
30306
  } else {
29948
30307
  N = [];
29949
30308
  for (var j = 0; j < n.length; j++) {
29950
- N.push.apply(N, expand(n[j], false));
30309
+ N.push.apply(N, expand(n[j], max, false));
29951
30310
  }
29952
30311
  }
29953
30312
  for (var j = 0; j < N.length; j++) {
29954
- for (var k = 0; k < post.length; k++) {
30313
+ for (var k = 0; k < post.length && expansions.length < max; k++) {
29955
30314
  var expansion = pre + N[j] + post[k];
29956
30315
  if (!isTop || isSequence || expansion)
29957
30316
  expansions.push(expansion);
@@ -33671,17 +34030,24 @@ var require_dist8 = __commonJS({
33671
34030
  getServicesBuilders: () => import_get_services_builders.getServicesBuilders,
33672
34031
  getWorkspacePackagePaths: () => import_get_workspace_package_paths.getWorkspacePackagePaths,
33673
34032
  getWorkspaces: () => import_get_workspaces.getWorkspaces,
34033
+ isExperimentalService: () => import_build_utils5.isExperimentalService,
34034
+ isExperimentalServiceV2: () => import_build_utils5.isExperimentalServiceV2,
33674
34035
  isOfficialRuntime: () => import_is_official_runtime.isOfficialRuntime,
33675
34036
  isRouteOwningBuilder: () => import_utils.isRouteOwningBuilder,
33676
34037
  isStaticBuild: () => import_utils.isStaticBuild,
33677
34038
  isStaticRuntime: () => import_is_official_runtime.isStaticRuntime,
33678
34039
  monorepoManagers: () => import_monorepo_managers.monorepoManagers,
33679
34040
  packageManagers: () => import_package_managers.packageManagers,
34041
+ resolveAllConfiguredServicesV2: () => import_resolve_v2.resolveAllConfiguredServicesV2,
34042
+ resolveConfiguredServiceV2: () => import_resolve_v2.resolveConfiguredServiceV2,
34043
+ validateServiceConfigV2: () => import_resolve_v2.validateServiceConfigV2,
33680
34044
  workspaceManagers: () => import_workspace_managers.workspaceManagers
33681
34045
  });
33682
34046
  module2.exports = __toCommonJS2(src_exports2);
33683
34047
  var import_detect_builders = require_detect_builders();
33684
34048
  var import_detect_services = require_detect_services();
34049
+ var import_resolve_v2 = require_resolve_v2();
34050
+ var import_build_utils5 = require("@vercel/build-utils");
33685
34051
  var import_auto_detect = require_auto_detect();
33686
34052
  var import_utils = require_utils4();
33687
34053
  var import_get_services_builders = require_get_services_builders();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "2.9.36",
3
+ "version": "2.9.38",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -14,9 +14,9 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
- "@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
18
- "@vercel/gatsby-plugin-vercel-builder": "2.2.13",
19
- "@vercel/static-config": "3.4.0"
17
+ "@vercel/gatsby-plugin-vercel-builder": "2.2.15",
18
+ "@vercel/static-config": "3.4.0",
19
+ "@vercel/gatsby-plugin-vercel-analytics": "1.0.11"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/aws-lambda": "8.10.64",
@@ -37,10 +37,10 @@
37
37
  "semver": "7.5.2",
38
38
  "tree-kill": "1.2.2",
39
39
  "vitest": "2.0.3",
40
- "@vercel/build-utils": "13.27.0",
40
+ "@vercel/build-utils": "13.27.2",
41
41
  "@vercel/error-utils": "2.2.0",
42
- "@vercel/frameworks": "3.27.0",
43
- "@vercel/fs-detectors": "6.7.7",
42
+ "@vercel/frameworks": "3.28.0",
43
+ "@vercel/fs-detectors": "6.8.0",
44
44
  "@vercel/routing-utils": "6.2.0"
45
45
  },
46
46
  "scripts": {