@vercel/static-build 2.9.0 → 2.9.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 -7
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -10386,7 +10386,6 @@ var require_frameworks = __commonJS({
10386
10386
  {
10387
10387
  name: "Django",
10388
10388
  slug: "django",
10389
- experimental: true,
10390
10389
  logo: "https://api-frameworks.vercel.sh/framework-logos/django.svg",
10391
10390
  tagline: "Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. ",
10392
10391
  description: "A Django project served via the Python Runtime.",
@@ -12007,7 +12006,6 @@ var require_frameworks = __commonJS({
12007
12006
  {
12008
12007
  name: "Python",
12009
12008
  slug: "python",
12010
- experimental: true,
12011
12009
  runtimeFramework: true,
12012
12010
  logo: "https://api-frameworks.vercel.sh/framework-logos/python.svg",
12013
12011
  tagline: "Python is a programming language that lets you work quickly and integrate systems more effectively.",
@@ -12202,7 +12200,6 @@ var require_frameworks = __commonJS({
12202
12200
  {
12203
12201
  name: "Go",
12204
12202
  slug: "go",
12205
- experimental: true,
12206
12203
  runtimeFramework: true,
12207
12204
  logo: "https://api-frameworks.vercel.sh/framework-logos/go.svg",
12208
12205
  tagline: "An open-source programming language supported by Google.",
@@ -22452,6 +22449,7 @@ var require_utils4 = __commonJS({
22452
22449
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
22453
22450
  var utils_exports = {};
22454
22451
  __export2(utils_exports, {
22452
+ INTERNAL_QUEUES_PREFIX: () => INTERNAL_QUEUES_PREFIX,
22455
22453
  INTERNAL_SERVICE_PREFIX: () => INTERNAL_SERVICE_PREFIX2,
22456
22454
  filterFrameworksByRuntime: () => filterFrameworksByRuntime,
22457
22455
  getBuilderForRuntime: () => getBuilderForRuntime,
@@ -22478,6 +22476,7 @@ var require_utils4 = __commonJS({
22478
22476
  }
22479
22477
  }
22480
22478
  var INTERNAL_SERVICE_PREFIX2 = "/_svc";
22479
+ var INTERNAL_QUEUES_PREFIX = "/_svc/_queues";
22481
22480
  function getInternalServiceFunctionPath2(serviceName) {
22482
22481
  return `${INTERNAL_SERVICE_PREFIX2}/${serviceName}/index`;
22483
22482
  }
@@ -23735,6 +23734,7 @@ var require_detect_services = __commonJS({
23735
23734
  (s) => s.type === "web" && typeof s.routePrefix === "string"
23736
23735
  ).sort((a, b) => b.routePrefix.length - a.routePrefix.length);
23737
23736
  const allWebPrefixes = getWebRoutePrefixes(sortedWebServices);
23737
+ const explicitHostPrefixGuard = getExplicitHostPrefixNegativeLookahead(allWebPrefixes);
23738
23738
  for (const service of sortedWebServices) {
23739
23739
  const { routePrefix } = service;
23740
23740
  const normalizedPrefix = routePrefix.slice(1);
@@ -23742,7 +23742,6 @@ var require_detect_services = __commonJS({
23742
23742
  const hostCondition = getHostCondition(service);
23743
23743
  if (hostCondition && routePrefix !== "/") {
23744
23744
  const normalizedRoutePrefix = (0, import_routing_utils.normalizeRoutePrefix)(routePrefix);
23745
- const escapedPrefix = escapeRegex(normalizedRoutePrefix.slice(1));
23746
23745
  hostRewrites.push({
23747
23746
  src: "^/$",
23748
23747
  dest: normalizedRoutePrefix,
@@ -23751,7 +23750,9 @@ var require_detect_services = __commonJS({
23751
23750
  check: true
23752
23751
  });
23753
23752
  hostRewrites.push({
23754
- src: `^/(?!${escapedPrefix}(?:/|$))(.*)$`,
23753
+ // Preserve explicit service prefixes so canonical paths like /_/api
23754
+ // keep routing to their target service even on another service's host.
23755
+ src: `^/${explicitHostPrefixGuard}(.*)$`,
23755
23756
  dest: `${normalizedRoutePrefix}/$1`,
23756
23757
  has: hostCondition,
23757
23758
  missing: PREVIEW_DOMAIN_MISSING,
@@ -23842,6 +23843,16 @@ var require_detect_services = __commonJS({
23842
23843
  }
23843
23844
  return Array.from(unique);
23844
23845
  }
23846
+ function getExplicitHostPrefixNegativeLookahead(routePrefixes) {
23847
+ const explicitPrefixes = routePrefixes.map(import_routing_utils.normalizeRoutePrefix).filter((prefix) => prefix !== "/").sort((a, b) => b.length - a.length).map((prefix) => escapeRegex(prefix.slice(1)));
23848
+ if (explicitPrefixes.length === 0) {
23849
+ return "";
23850
+ }
23851
+ if (explicitPrefixes.length === 1) {
23852
+ return `(?!${explicitPrefixes[0]}(?:/|$))`;
23853
+ }
23854
+ return `(?!(?:${explicitPrefixes.join("|")})(?:/|$))`;
23855
+ }
23845
23856
  function getHostCondition(service) {
23846
23857
  if (service.type !== "web") {
23847
23858
  return void 0;
@@ -24241,9 +24252,10 @@ var require_detect_builders = __commonJS({
24241
24252
  return publicBuilder ? publicBuilder.src.replace("/**/*", "") : null;
24242
24253
  }
24243
24254
  async function detectBuilders2(files, pkg, options = {}) {
24244
- const { projectSettings = {} } = options;
24255
+ const { experimentalServices: services, projectSettings = {} } = options;
24245
24256
  const { framework } = projectSettings;
24246
- if (framework === "services") {
24257
+ const hasServicesConfig = services != null && typeof services === "object";
24258
+ if (hasServicesConfig || framework === "services") {
24247
24259
  return (0, import_get_services_builders.getServicesBuilders)({
24248
24260
  workPath: options.workPath
24249
24261
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/static-build",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/build-step",
@@ -15,8 +15,8 @@
15
15
  "dependencies": {
16
16
  "ts-morph": "12.0.0",
17
17
  "@vercel/gatsby-plugin-vercel-analytics": "1.0.11",
18
- "@vercel/gatsby-plugin-vercel-builder": "2.1.0",
19
- "@vercel/static-config": "3.2.0"
18
+ "@vercel/static-config": "3.2.0",
19
+ "@vercel/gatsby-plugin-vercel-builder": "2.1.1"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/aws-lambda": "8.10.64",
@@ -38,10 +38,10 @@
38
38
  "rc9": "1.2.0",
39
39
  "semver": "7.5.2",
40
40
  "tree-kill": "1.2.2",
41
- "@vercel/build-utils": "13.8.0",
42
- "@vercel/frameworks": "3.20.0",
41
+ "@vercel/build-utils": "13.8.1",
42
+ "@vercel/frameworks": "3.21.1",
43
+ "@vercel/fs-detectors": "5.11.0",
43
44
  "@vercel/error-utils": "2.0.3",
44
- "@vercel/fs-detectors": "5.10.0",
45
45
  "@vercel/routing-utils": "6.0.2"
46
46
  },
47
47
  "scripts": {