@vercel/gatsby-plugin-vercel-builder 2.0.135 → 2.0.137

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 +74 -0
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1390,6 +1390,76 @@ var require_merge = __commonJS({
1390
1390
  }
1391
1391
  });
1392
1392
 
1393
+ // ../routing-utils/dist/service-route-ownership.js
1394
+ var require_service_route_ownership = __commonJS({
1395
+ "../routing-utils/dist/service-route-ownership.js"(exports, module2) {
1396
+ "use strict";
1397
+ var __defProp2 = Object.defineProperty;
1398
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
1399
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
1400
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
1401
+ var __export2 = (target, all) => {
1402
+ for (var name in all)
1403
+ __defProp2(target, name, { get: all[name], enumerable: true });
1404
+ };
1405
+ var __copyProps2 = (to, from, except, desc) => {
1406
+ if (from && typeof from === "object" || typeof from === "function") {
1407
+ for (let key of __getOwnPropNames2(from))
1408
+ if (!__hasOwnProp2.call(to, key) && key !== except)
1409
+ __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
1410
+ }
1411
+ return to;
1412
+ };
1413
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1414
+ var service_route_ownership_exports = {};
1415
+ __export2(service_route_ownership_exports, {
1416
+ getOwnershipGuard: () => getOwnershipGuard2,
1417
+ normalizeRoutePrefix: () => normalizeRoutePrefix2,
1418
+ scopeRouteSourceToOwnership: () => scopeRouteSourceToOwnership2
1419
+ });
1420
+ module2.exports = __toCommonJS2(service_route_ownership_exports);
1421
+ function normalizeRoutePrefix2(routePrefix) {
1422
+ let normalized = routePrefix.startsWith("/") ? routePrefix : `/${routePrefix}`;
1423
+ if (normalized !== "/" && normalized.endsWith("/")) {
1424
+ normalized = normalized.slice(0, -1);
1425
+ }
1426
+ return normalized || "/";
1427
+ }
1428
+ function escapeForRegex(value) {
1429
+ return value.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
1430
+ }
1431
+ function toPrefixMatcher(routePrefix) {
1432
+ return `${escapeForRegex(routePrefix)}(?:/|$)`;
1433
+ }
1434
+ function isDescendantPrefix(candidate, prefix) {
1435
+ return candidate !== prefix && candidate.startsWith(`${prefix}/`);
1436
+ }
1437
+ function getOwnershipGuard2(ownerPrefix, allRoutePrefixes) {
1438
+ const owner = normalizeRoutePrefix2(ownerPrefix);
1439
+ const normalizedPrefixes = Array.from(
1440
+ new Set(allRoutePrefixes.map(normalizeRoutePrefix2))
1441
+ );
1442
+ const nonRootPrefixes = normalizedPrefixes.filter((prefix) => prefix !== "/").sort((a, b) => b.length - a.length);
1443
+ if (owner === "/") {
1444
+ return nonRootPrefixes.map((prefix) => `(?!${toPrefixMatcher(prefix)})`).join("");
1445
+ }
1446
+ const descendants = nonRootPrefixes.filter(
1447
+ (prefix) => isDescendantPrefix(prefix, owner)
1448
+ );
1449
+ const positive = `(?=${toPrefixMatcher(owner)})`;
1450
+ const negative = descendants.map((prefix) => `(?!${toPrefixMatcher(prefix)})`).join("");
1451
+ return `${positive}${negative}`;
1452
+ }
1453
+ function scopeRouteSourceToOwnership2(source, ownershipGuard) {
1454
+ if (!ownershipGuard) {
1455
+ return source;
1456
+ }
1457
+ const inner = source.startsWith("^") ? source.slice(1) : source;
1458
+ return `^${ownershipGuard}(?:${inner})`;
1459
+ }
1460
+ }
1461
+ });
1462
+
1393
1463
  // ../routing-utils/dist/schemas.js
1394
1464
  var require_schemas = __commonJS({
1395
1465
  "../routing-utils/dist/schemas.js"(exports, module2) {
@@ -2127,11 +2197,14 @@ var require_dist3 = __commonJS({
2127
2197
  __export2(src_exports2, {
2128
2198
  appendRoutesToPhase: () => import_append.appendRoutesToPhase,
2129
2199
  getCleanUrls: () => import_superstatic2.getCleanUrls,
2200
+ getOwnershipGuard: () => import_service_route_ownership.getOwnershipGuard,
2130
2201
  getTransformedRoutes: () => getTransformedRoutes2,
2131
2202
  isHandler: () => isHandler,
2132
2203
  isValidHandleValue: () => isValidHandleValue,
2133
2204
  mergeRoutes: () => import_merge.mergeRoutes,
2205
+ normalizeRoutePrefix: () => import_service_route_ownership.normalizeRoutePrefix,
2134
2206
  normalizeRoutes: () => normalizeRoutes,
2207
+ scopeRouteSourceToOwnership: () => import_service_route_ownership.scopeRouteSourceToOwnership,
2135
2208
  sourceToRegex: () => import_superstatic2.sourceToRegex
2136
2209
  });
2137
2210
  module2.exports = __toCommonJS2(src_exports2);
@@ -2139,6 +2212,7 @@ var require_dist3 = __commonJS({
2139
2212
  var import_superstatic = require_superstatic();
2140
2213
  var import_append = require_append();
2141
2214
  var import_merge = require_merge();
2215
+ var import_service_route_ownership = require_service_route_ownership();
2142
2216
  __reExport(src_exports2, require_schemas(), module2.exports);
2143
2217
  var import_superstatic2 = require_superstatic();
2144
2218
  __reExport(src_exports2, require_types(), module2.exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/gatsby-plugin-vercel-builder",
3
- "version": "2.0.135",
3
+ "version": "2.0.137",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -17,7 +17,7 @@
17
17
  "esbuild": "0.27.0",
18
18
  "etag": "1.8.1",
19
19
  "fs-extra": "11.1.0",
20
- "@vercel/build-utils": "13.4.0"
20
+ "@vercel/build-utils": "13.4.2"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/etag": "1.8.0",
@@ -27,7 +27,7 @@
27
27
  "@types/react": "18.0.26",
28
28
  "jest-junit": "16.0.0",
29
29
  "typescript": "4.9.5",
30
- "@vercel/routing-utils": "5.3.2"
30
+ "@vercel/routing-utils": "5.3.3"
31
31
  },
32
32
  "license": "Apache-2.0",
33
33
  "scripts": {