vercel 58.4.4 → 58.7.0

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 (92) hide show
  1. package/dist/chunks/{add-245XOFJO.js → add-I7X6NXYD.js} +4 -4
  2. package/dist/chunks/{add-P7WBQMBW.js → add-KMRFKOPJ.js} +44 -9
  3. package/dist/chunks/{add-XH24V5VU.js → add-USFLACJX.js} +4 -4
  4. package/dist/chunks/{build-M7NJYJPE.js → build-GNX3QE6Q.js} +4 -4
  5. package/dist/chunks/{chunk-WR7JTCGL.js → chunk-3BU2UCGV.js} +1 -1
  6. package/dist/chunks/{chunk-MAHXF73X.js → chunk-3L2YLLHC.js} +1 -1
  7. package/dist/chunks/{chunk-ZGBBPJ6B.js → chunk-4XKF7JOF.js} +92 -1377
  8. package/dist/chunks/{chunk-2LBVX2H3.js → chunk-5SZ6VX2H.js} +2 -2
  9. package/dist/chunks/{chunk-2MAPZXVV.js → chunk-62SBYAED.js} +5 -5
  10. package/dist/chunks/{chunk-UE3JUVUZ.js → chunk-74XVGG52.js} +2 -2
  11. package/dist/chunks/{chunk-2FMPLU44.js → chunk-7KUQ7BHI.js} +2 -2
  12. package/dist/chunks/{chunk-YDUINEII.js → chunk-7SXWLTXT.js} +6 -4
  13. package/dist/chunks/{chunk-M5NOLAJ4.js → chunk-BIGFTNW6.js} +1 -1
  14. package/dist/chunks/{chunk-YCPUAG77.js → chunk-CDYBV7YA.js} +1 -1
  15. package/dist/chunks/{chunk-4BUPRO5B.js → chunk-D6SC2UJH.js} +1 -1
  16. package/dist/chunks/{chunk-62MH5KPX.js → chunk-DHTB5D3E.js} +5 -5
  17. package/dist/chunks/{chunk-NJ6QXKQD.js → chunk-H3KETQAA.js} +1 -1
  18. package/dist/chunks/{chunk-NJUPUGOE.js → chunk-HT2XWSAJ.js} +1 -1
  19. package/dist/chunks/chunk-I2XE3GMB.js +21 -0
  20. package/dist/chunks/chunk-LC5BYUUP.js +1337 -0
  21. package/dist/chunks/{chunk-SJYAUEZR.js → chunk-MNZUPMZZ.js} +3 -15
  22. package/dist/chunks/chunk-MXLA3VQS.js +20 -0
  23. package/dist/chunks/{chunk-XE5VSQ25.js → chunk-NI4DNP3D.js} +1 -1
  24. package/dist/chunks/{chunk-Y5GTPWXB.js → chunk-NOMQUVGM.js} +2 -2
  25. package/dist/chunks/{chunk-AQDWMAPM.js → chunk-NYKWLQQM.js} +10 -8
  26. package/dist/chunks/{chunk-4CCY5OPH.js → chunk-NZ6GDMPB.js} +306 -217
  27. package/dist/chunks/chunk-TE5MIANG.js +96 -0
  28. package/dist/chunks/{chunk-EBLH23AQ.js → chunk-TEQKKTJQ.js} +4 -7
  29. package/dist/chunks/{chunk-2WILSD7J.js → chunk-TNTJXJSE.js} +1 -1
  30. package/dist/chunks/{chunk-IEDUCUDV.js → chunk-UAVZOOOL.js} +10 -8
  31. package/dist/chunks/{chunk-4UYKSYKQ.js → chunk-UMA66MKW.js} +66 -2
  32. package/dist/chunks/{chunk-CPFNFVCL.js → chunk-UME4MVFU.js} +1 -1
  33. package/dist/chunks/{chunk-HSYF5SI3.js → chunk-YR6M7ZIU.js} +1 -1
  34. package/dist/chunks/{chunk-3QAUXPIR.js → chunk-ZZZEJXHD.js} +172 -51
  35. package/dist/chunks/{clear-HWIKQ4NC.js → clear-ERVHWAHX.js} +4 -4
  36. package/dist/chunks/{compile-vercel-config-U5NRIMZ2.js → compile-vercel-config-PM5ID4CV.js} +2 -2
  37. package/dist/chunks/{constants-3FSSR6E7.js → constants-T6BULVX6.js} +1 -1
  38. package/dist/chunks/{delete-NVMGVD5Z.js → delete-GMVIUCQV.js} +3 -3
  39. package/dist/chunks/{delete-FZCOUFGN.js → delete-XB24AZGV.js} +4 -4
  40. package/dist/chunks/{disable-ERM2BWEQ.js → disable-JJZZQ4IZ.js} +3 -3
  41. package/dist/chunks/{discard-KM5OLEN4.js → discard-CGAS2MSK.js} +3 -3
  42. package/dist/chunks/{edit-HT3UTATZ.js → edit-RKUUUBQF.js} +4 -4
  43. package/dist/chunks/{edit-TOSB2EMI.js → edit-TFZDCJTL.js} +5 -5
  44. package/dist/chunks/{enable-BQL6AOQV.js → enable-UXRVQO6C.js} +3 -3
  45. package/dist/chunks/{export-UOWQHOG3.js → export-WQE3UU4V.js} +3 -3
  46. package/dist/chunks/{image-F5SC6Q7Y.js → image-HV7N6RTK.js} +3 -3
  47. package/dist/chunks/import-builders-IEVZ7KYP.js +28 -0
  48. package/dist/chunks/{inspect-PZJM2CWT.js → inspect-4BXZOMC2.js} +7 -7
  49. package/dist/chunks/{inspect-35FU5R62.js → inspect-DT2PX6LB.js} +4 -4
  50. package/dist/chunks/{inspect-5J5GSTOB.js → inspect-E3YSH5BV.js} +4 -4
  51. package/dist/chunks/{inspect-GKJ6T5H4.js → inspect-NADJYMSZ.js} +4 -4
  52. package/dist/chunks/{inspect-LGKOLH2O.js → inspect-VDQEM3E6.js} +5 -5
  53. package/dist/chunks/{list-KZETH3ZE.js → list-5PLKF2GL.js} +3 -3
  54. package/dist/chunks/{list-ITFJYYQ2.js → list-ARM4RM22.js} +9 -9
  55. package/dist/chunks/{list-2IIE7CAP.js → list-RVE2NAC5.js} +5 -5
  56. package/dist/chunks/{login-BQPJCJEZ.js → login-VHGNOKBB.js} +4 -4
  57. package/dist/chunks/{ls-7GHDK4MD.js → ls-4QRIPSBC.js} +13 -13
  58. package/dist/chunks/{ls-DL2LA35C.js → ls-IVVP4H24.js} +4 -4
  59. package/dist/chunks/{ls-UXUEP54B.js → ls-OTCUUI4L.js} +4 -4
  60. package/dist/chunks/{ls-YSFWSM6J.js → ls-QBKFZC52.js} +4 -4
  61. package/dist/chunks/{ls-ZZFLH7PK.js → ls-YME2AL47.js} +4 -4
  62. package/dist/chunks/{open-ADNJQN5E.js → open-KYVW2GTM.js} +4 -4
  63. package/dist/chunks/{permissions-72SZCBIY.js → permissions-BLHKOJDO.js} +4 -4
  64. package/dist/chunks/{publish-OOAGSEBM.js → publish-4BKTL25X.js} +3 -3
  65. package/dist/chunks/{push-B6TZDXNF.js → push-IJFWOWD7.js} +4 -4
  66. package/dist/chunks/{query-LZWS5TDH.js → query-VIV66DLZ.js} +3 -3
  67. package/dist/chunks/{reorder-MRHFKPMK.js → reorder-C44IJZNE.js} +3 -3
  68. package/dist/chunks/{reply-BKTJXO3B.js → reply-M6WBMKBN.js} +5 -5
  69. package/dist/chunks/{resolve-BKVGSGPN.js → resolve-44ICWDRT.js} +4 -4
  70. package/dist/chunks/{restore-USR7SKWV.js → restore-ACDVNSTC.js} +3 -3
  71. package/dist/chunks/{rm-2UO6BT3A.js → rm-K2FDC5CL.js} +6 -6
  72. package/dist/chunks/{rm-37MKKV3I.js → rm-P2ILGP4I.js} +4 -4
  73. package/dist/chunks/{rm-VY3OHKFH.js → rm-Q7VXI345.js} +4 -4
  74. package/dist/chunks/{rm-KUWPNZIS.js → rm-RO3R3MZT.js} +4 -4
  75. package/dist/chunks/{rule-inspect-JVDOOTWK.js → rule-inspect-JGKJXOUD.js} +13 -20
  76. package/dist/chunks/{rules-NTBFZBIF.js → rules-BRTF5HJP.js} +9 -6
  77. package/dist/chunks/schema-T7RNRNKT.js +426 -0
  78. package/dist/chunks/{schema-6EZ72OVH.js → schema-Z3L5ZOEE.js} +2 -2
  79. package/dist/chunks/{tags-HNPC63QA.js → tags-BPHVFK53.js} +2 -2
  80. package/dist/chunks/{update-LUYWNZP3.js → update-5KQU4HCK.js} +38 -6
  81. package/dist/commands/build/index.js +65 -24
  82. package/dist/commands/deploy/index.js +24 -17
  83. package/dist/commands/dev/index.js +41 -18
  84. package/dist/commands/env/index.js +89 -150
  85. package/dist/commands/link/index.js +9 -9
  86. package/dist/commands/list/index.js +5 -5
  87. package/dist/commands-bulk.js +3183 -2199
  88. package/dist/index.js +12 -11
  89. package/dist/vc.js +11 -14
  90. package/dist/version.mjs +1 -1
  91. package/package.json +54 -48
  92. package/dist/chunks/{chunk-BUZRVER7.js → chunk-P65EEFTR.js} +3 -3
@@ -6,37 +6,39 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  OUTPUT_DIR,
9
- formatResolvedBuilders,
10
9
  getStaticServiceSchedules,
11
- importBuilders,
12
10
  isLambda,
13
11
  staticFiles,
14
12
  writeBuildResult
15
- } from "../../chunks/chunk-ZGBBPJ6B.js";
13
+ } from "../../chunks/chunk-4XKF7JOF.js";
14
+ import {
15
+ formatResolvedBuilders,
16
+ importBuilders
17
+ } from "../../chunks/chunk-LC5BYUUP.js";
16
18
  import {
17
19
  pullCommandLogic
18
- } from "../../chunks/chunk-2MAPZXVV.js";
20
+ } from "../../chunks/chunk-62SBYAED.js";
19
21
  import {
20
22
  require_semver
21
23
  } from "../../chunks/chunk-IB5L4LKZ.js";
22
24
  import {
23
25
  pickOverrides,
24
26
  readProjectSettings
25
- } from "../../chunks/chunk-M5NOLAJ4.js";
27
+ } from "../../chunks/chunk-BIGFTNW6.js";
26
28
  import "../../chunks/chunk-R6IGDGX3.js";
27
- import "../../chunks/chunk-NJUPUGOE.js";
29
+ import "../../chunks/chunk-HT2XWSAJ.js";
28
30
  import {
29
31
  stamp_default
30
32
  } from "../../chunks/chunk-64IF634X.js";
31
33
  import "../../chunks/chunk-VXYGCOKL.js";
32
34
  import {
33
35
  ensureLink
34
- } from "../../chunks/chunk-2FMPLU44.js";
35
- import "../../chunks/chunk-UE3JUVUZ.js";
36
- import "../../chunks/chunk-CPFNFVCL.js";
36
+ } from "../../chunks/chunk-7KUQ7BHI.js";
37
+ import "../../chunks/chunk-74XVGG52.js";
38
+ import "../../chunks/chunk-UME4MVFU.js";
37
39
  import {
38
40
  buildCommand
39
- } from "../../chunks/chunk-YCPUAG77.js";
41
+ } from "../../chunks/chunk-CDYBV7YA.js";
40
42
  import {
41
43
  help
42
44
  } from "../../chunks/chunk-ZX2FSPWV.js";
@@ -64,7 +66,7 @@ import {
64
66
  resolveProjectCwd,
65
67
  ua_default,
66
68
  validateConfig
67
- } from "../../chunks/chunk-4CCY5OPH.js";
69
+ } from "../../chunks/chunk-NZ6GDMPB.js";
68
70
  import {
69
71
  TelemetryClient
70
72
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -73,6 +75,7 @@ import {
73
75
  AGENT_STATUS,
74
76
  outputAgentError
75
77
  } from "../../chunks/chunk-TJJ562C5.js";
78
+ import "../../chunks/chunk-GGP5R3FU.js";
76
79
  import {
77
80
  printError,
78
81
  toEnumerableError
@@ -99,7 +102,6 @@ import {
99
102
  output_manager_default,
100
103
  prependEmoji
101
104
  } from "../../chunks/chunk-OX7KI3LF.js";
102
- import "../../chunks/chunk-GGP5R3FU.js";
103
105
  import {
104
106
  require_source
105
107
  } from "../../chunks/chunk-S7KYDPEM.js";
@@ -319,11 +321,11 @@ async function detectFirstDeploymentFramework(options) {
319
321
  ...detected.detectedVersion && { version: detected.detectedVersion }
320
322
  };
321
323
  }
322
- async function detectAllFrameworks(workPath) {
324
+ async function detectAllFrameworks(workPath, customFrameworkList) {
323
325
  logDebug(`Framework cross-check: detecting frameworks at "${workPath}"`);
324
326
  const frameworks = await (0, import_fs_detectors2.detectFrameworks)({
325
327
  fs: new import_fs_detectors2.LocalFileSystemDetector(workPath),
326
- frameworkList: import_frameworks.frameworkList
328
+ frameworkList: customFrameworkList ?? import_frameworks.frameworkList
327
329
  });
328
330
  const slugs = frameworks.map((f) => f.slug).filter((slug) => Boolean(slug));
329
331
  logDebug(`Framework cross-check: detected [${slugs.join(", ") || "<none>"}]`);
@@ -3556,11 +3558,12 @@ async function writeManifests(packageManifests, diagnostics, ops, outputDir) {
3556
3558
  builderUse
3557
3559
  } of packageManifests) {
3558
3560
  const key = `${builderUse}:${workspace}`;
3561
+ const framework = service?.framework ?? buildConfig.framework ?? manifest.framework;
3559
3562
  projectManifest[key] = {
3560
3563
  ...manifest,
3561
3564
  workspace,
3562
3565
  builder: builderUse,
3563
- framework: service?.framework ?? buildConfig.framework,
3566
+ framework,
3564
3567
  serviceName: service?.name,
3565
3568
  serviceType: service && isExperimentalService(service) ? service.type : void 0,
3566
3569
  routePrefix: service && isExperimentalService(service) ? service.routePrefix : void 0
@@ -3568,6 +3571,7 @@ async function writeManifests(packageManifests, diagnostics, ops, outputDir) {
3568
3571
  const { version: _version, ...manifestWithoutVersion } = manifest;
3569
3572
  deployManifestBuilds[key] = {
3570
3573
  ...manifestWithoutVersion,
3574
+ framework,
3571
3575
  root: workspace,
3572
3576
  builder: builderUse
3573
3577
  };
@@ -4318,6 +4322,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4318
4322
  }
4319
4323
  const diagnostics = {};
4320
4324
  const packageManifests = [];
4325
+ const apiDirFrameworkDetector = createApiDirFrameworkDetector();
4321
4326
  const getHasDetectedServices = () => detectedResolvedServices !== void 0 && detectedResolvedServices.length > 0;
4322
4327
  const synthesizedServiceCrons = [];
4323
4328
  const serviceByBuilder = /* @__PURE__ */ new Map();
@@ -4383,6 +4388,10 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4383
4388
  }
4384
4389
  const isFrontendBuilder = build.config && "framework" in build.config;
4385
4390
  const builderFramework = build.config?.framework ?? projectSettings.framework;
4391
+ const apiDirFramework = isZeroConfig && !service && !isFrontendBuilder ? await apiDirFrameworkDetector.detect(
4392
+ build.use ?? "",
4393
+ buildWorkPath
4394
+ ) : void 0;
4386
4395
  let buildConfig;
4387
4396
  if (isZeroConfig) {
4388
4397
  if (service) {
@@ -4416,7 +4425,7 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4416
4425
  installCommand: projectSettings.installCommand ?? void 0,
4417
4426
  devCommand: projectSettings.devCommand ?? void 0,
4418
4427
  buildCommand: projectSettings.buildCommand ?? void 0,
4419
- framework: projectSettings.framework,
4428
+ framework: isFrontendBuilder ? projectSettings.framework : void 0,
4420
4429
  nodeVersion: projectSettings.nodeVersion,
4421
4430
  bunVersion: localConfig.bunVersion ?? void 0
4422
4431
  };
@@ -4545,14 +4554,22 @@ async function doBuild(client, project, buildsJson, cwd, outputDir, span, standa
4545
4554
  );
4546
4555
  } else {
4547
4556
  const workspace = service && serviceWorkspace && serviceWorkspace !== "." ? serviceWorkspace : ".";
4548
- packageManifests.push({
4549
- workspace,
4550
- key: fullKey,
4551
- buildConfig,
4552
- manifest: packageManifest,
4553
- service,
4554
- builderUse: builderPkg.name
4555
- });
4557
+ const alreadyPushed = packageManifests.some(
4558
+ (m) => m.builderUse === builderPkg.name && m.workspace === workspace
4559
+ );
4560
+ if (!alreadyPushed) {
4561
+ packageManifests.push({
4562
+ workspace,
4563
+ key: fullKey,
4564
+ buildConfig,
4565
+ manifest: {
4566
+ ...packageManifest,
4567
+ framework: packageManifest.framework ?? apiDirFramework
4568
+ },
4569
+ service,
4570
+ builderUse: builderPkg.name
4571
+ });
4572
+ }
4556
4573
  }
4557
4574
  } catch (e) {
4558
4575
  output_manager_default.debug(
@@ -5578,6 +5595,30 @@ async function writeFlagsJSON(buildResults, outputDir) {
5578
5595
  await import_fs_extra3.default.writeJSON(flagsFilePath, flags, { spaces: 2 });
5579
5596
  }
5580
5597
  }
5598
+ function createApiDirFrameworkDetector() {
5599
+ const cache = /* @__PURE__ */ new Map();
5600
+ return {
5601
+ detect(builderUse, workPath) {
5602
+ const cacheKey = `${builderUse}:${workPath}`;
5603
+ let cached = cache.get(cacheKey);
5604
+ if (!cached) {
5605
+ cached = detectApiDirFramework(builderUse, workPath);
5606
+ cache.set(cacheKey, cached);
5607
+ }
5608
+ return cached;
5609
+ }
5610
+ };
5611
+ }
5612
+ async function detectApiDirFramework(builderUse, workPath) {
5613
+ const runtimeFrameworks = import_fs_detectors3.builderToFrameworks.get(builderUse) ?? [];
5614
+ if (runtimeFrameworks.length === 0)
5615
+ return void 0;
5616
+ const detectedSlugs = await detectAllFrameworks(
5617
+ workPath,
5618
+ runtimeFrameworks
5619
+ ).catch(() => []);
5620
+ return detectedSlugs.length === 1 ? detectedSlugs[0] : void 0;
5621
+ }
5581
5622
  async function writeBuildJson(buildsJson, outputDir) {
5582
5623
  await import_fs_extra3.default.writeJSON(join5(outputDir, "builds.json"), buildsJson, { spaces: 2 });
5583
5624
  }
@@ -13,11 +13,12 @@ import {
13
13
  purchaseDomainIfAvailable,
14
14
  require_cjs,
15
15
  setupDomain
16
- } from "../../chunks/chunk-IEDUCUDV.js";
16
+ } from "../../chunks/chunk-UAVZOOOL.js";
17
17
  import "../../chunks/chunk-PRWJUY5U.js";
18
+ import "../../chunks/chunk-I2XE3GMB.js";
18
19
  import {
19
20
  readLocalConfig
20
- } from "../../chunks/chunk-SJYAUEZR.js";
21
+ } from "../../chunks/chunk-MNZUPMZZ.js";
21
22
  import {
22
23
  highlight
23
24
  } from "../../chunks/chunk-V5P25P7F.js";
@@ -37,7 +38,7 @@ import {
37
38
  deprecatedArchiveSplitTgz,
38
39
  getCommandAliases,
39
40
  initSubcommand
40
- } from "../../chunks/chunk-3QAUXPIR.js";
41
+ } from "../../chunks/chunk-ZZZEJXHD.js";
41
42
  import "../../chunks/chunk-AW5YINX6.js";
42
43
  import "../../chunks/chunk-A5KP5HAI.js";
43
44
  import "../../chunks/chunk-J6LK45HT.js";
@@ -46,27 +47,27 @@ import "../../chunks/chunk-CSJBZKC5.js";
46
47
  import "../../chunks/chunk-M22O6CYY.js";
47
48
  import "../../chunks/chunk-4LDQIDRM.js";
48
49
  import "../../chunks/chunk-3KNPVXJ3.js";
49
- import "../../chunks/chunk-MAHXF73X.js";
50
- import "../../chunks/chunk-4UYKSYKQ.js";
50
+ import "../../chunks/chunk-3L2YLLHC.js";
51
+ import "../../chunks/chunk-UMA66MKW.js";
51
52
  import "../../chunks/chunk-7QVJTI5H.js";
52
53
  import "../../chunks/chunk-O5GNPPTU.js";
53
54
  import {
54
55
  pickOverrides
55
- } from "../../chunks/chunk-M5NOLAJ4.js";
56
- import "../../chunks/chunk-NJUPUGOE.js";
56
+ } from "../../chunks/chunk-BIGFTNW6.js";
57
+ import "../../chunks/chunk-HT2XWSAJ.js";
57
58
  import {
58
59
  stamp_default
59
60
  } from "../../chunks/chunk-64IF634X.js";
60
61
  import "../../chunks/chunk-VXYGCOKL.js";
61
62
  import {
62
63
  ensureLink
63
- } from "../../chunks/chunk-2FMPLU44.js";
64
+ } from "../../chunks/chunk-7KUQ7BHI.js";
64
65
  import {
65
66
  validatePaths,
66
67
  validateRootDirectory
67
- } from "../../chunks/chunk-UE3JUVUZ.js";
68
- import "../../chunks/chunk-CPFNFVCL.js";
69
- import "../../chunks/chunk-YCPUAG77.js";
68
+ } from "../../chunks/chunk-74XVGG52.js";
69
+ import "../../chunks/chunk-UME4MVFU.js";
70
+ import "../../chunks/chunk-CDYBV7YA.js";
70
71
  import {
71
72
  help
72
73
  } from "../../chunks/chunk-ZX2FSPWV.js";
@@ -86,7 +87,7 @@ import {
86
87
  require_dist as require_dist2,
87
88
  require_frameworks,
88
89
  require_lib
89
- } from "../../chunks/chunk-4CCY5OPH.js";
90
+ } from "../../chunks/chunk-NZ6GDMPB.js";
90
91
  import {
91
92
  TelemetryClient
92
93
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -95,6 +96,9 @@ import {
95
96
  outputAgentError,
96
97
  withGlobalFlags
97
98
  } from "../../chunks/chunk-TJJ562C5.js";
99
+ import {
100
+ require_ms
101
+ } from "../../chunks/chunk-GGP5R3FU.js";
98
102
  import {
99
103
  printError
100
104
  } from "../../chunks/chunk-KBEX5MYS.js";
@@ -138,9 +142,6 @@ import {
138
142
  prependEmoji,
139
143
  require_dist
140
144
  } from "../../chunks/chunk-OX7KI3LF.js";
141
- import {
142
- require_ms
143
- } from "../../chunks/chunk-GGP5R3FU.js";
144
145
  import {
145
146
  require_source
146
147
  } from "../../chunks/chunk-S7KYDPEM.js";
@@ -768,7 +769,10 @@ async function handleInitDeployment(client, telemetryClient) {
768
769
  }
769
770
  }
770
771
  const meta = Object.assign({}, parseMeta(localConfig.meta), cliMeta);
771
- const gitMetadata = await createGitMeta(cwd, project);
772
+ const gitMetadata = await createGitMeta(
773
+ join2(cwd, project.rootDirectory || ""),
774
+ project
775
+ );
772
776
  const deploymentEnv = Object.assign(
773
777
  {},
774
778
  parseEnv(localConfig.env),
@@ -1539,7 +1543,10 @@ async function handleDefaultDeploy(client, telemetryClient) {
1539
1543
  }
1540
1544
  }
1541
1545
  const meta = Object.assign({}, parseMeta(localConfig.meta), cliMeta);
1542
- const gitMetadata = await createGitMeta(cwd, project);
1546
+ const gitMetadata = await createGitMeta(
1547
+ join2(cwd, project.rootDirectory || ""),
1548
+ project
1549
+ );
1543
1550
  const deploymentEnv = Object.assign(
1544
1551
  {},
1545
1552
  parseEnv(localConfig.env),
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunks/chunk-2HSQ7YUK.js";
10
10
  import {
11
11
  getUpdateCommand
12
- } from "../../chunks/chunk-NJ6QXKQD.js";
12
+ } from "../../chunks/chunk-H3KETQAA.js";
13
13
  import {
14
14
  highlight
15
15
  } from "../../chunks/chunk-V5P25P7F.js";
@@ -22,24 +22,26 @@ import {
22
22
  import {
23
23
  OUTPUT_DIR,
24
24
  getStaticServiceSchedules,
25
- importBuilders,
26
25
  require_mime_types,
27
- require_npa,
28
26
  staticFiles
29
- } from "../../chunks/chunk-ZGBBPJ6B.js";
27
+ } from "../../chunks/chunk-4XKF7JOF.js";
28
+ import {
29
+ importBuilders,
30
+ require_npa
31
+ } from "../../chunks/chunk-LC5BYUUP.js";
30
32
  import "../../chunks/chunk-IB5L4LKZ.js";
31
33
  import {
32
34
  pickOverrides
33
- } from "../../chunks/chunk-M5NOLAJ4.js";
35
+ } from "../../chunks/chunk-BIGFTNW6.js";
34
36
  import "../../chunks/chunk-R6IGDGX3.js";
35
37
  import {
36
38
  displayDetectedServices,
37
39
  readConfig,
38
40
  setupAndLink
39
- } from "../../chunks/chunk-UE3JUVUZ.js";
41
+ } from "../../chunks/chunk-74XVGG52.js";
40
42
  import {
41
43
  getLocalPathConfig
42
- } from "../../chunks/chunk-CPFNFVCL.js";
44
+ } from "../../chunks/chunk-UME4MVFU.js";
43
45
  import {
44
46
  help
45
47
  } from "../../chunks/chunk-ZX2FSPWV.js";
@@ -70,7 +72,7 @@ import {
70
72
  resolveProjectCwd,
71
73
  tryDetectServices,
72
74
  validateConfig
73
- } from "../../chunks/chunk-4CCY5OPH.js";
75
+ } from "../../chunks/chunk-NZ6GDMPB.js";
74
76
  import {
75
77
  TelemetryClient
76
78
  } from "../../chunks/chunk-ECCWJHC6.js";
@@ -78,6 +80,9 @@ import {
78
80
  buildCommandWithYes,
79
81
  outputActionRequired
80
82
  } from "../../chunks/chunk-TJJ562C5.js";
83
+ import {
84
+ require_ms
85
+ } from "../../chunks/chunk-GGP5R3FU.js";
81
86
  import {
82
87
  printError
83
88
  } from "../../chunks/chunk-KBEX5MYS.js";
@@ -107,9 +112,6 @@ import {
107
112
  output_manager_default,
108
113
  require_dist
109
114
  } from "../../chunks/chunk-OX7KI3LF.js";
110
- import {
111
- require_ms
112
- } from "../../chunks/chunk-GGP5R3FU.js";
113
115
  import {
114
116
  require_source,
115
117
  require_supports_color
@@ -18636,7 +18638,6 @@ var ServicesOrchestrator = class {
18636
18638
  env.VERCEL_QUEUE_BASE_URL = `${this.proxyOrigin}/_svc/_queues`;
18637
18639
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18638
18640
  env.VERCEL_REGION = "dev1";
18639
- env.VERCEL_DEPLOYMENT_ID = "dpl_dev";
18640
18641
  }
18641
18642
  if (service.routePrefix && service.routePrefix !== "/") {
18642
18643
  env.VERCEL_SERVICE_ROUTE_PREFIX = service.routePrefix;
@@ -18700,7 +18701,6 @@ var ServicesOrchestrator = class {
18700
18701
  env.VERCEL_QUEUE_BASE_URL = `${this.proxyOrigin}/_svc/_queues`;
18701
18702
  env.VERCEL_QUEUE_TOKEN = "vc-dev-token";
18702
18703
  env.VERCEL_REGION = "dev1";
18703
- env.VERCEL_DEPLOYMENT_ID = "dpl_dev";
18704
18704
  }
18705
18705
  const root = service.root || ".";
18706
18706
  return {
@@ -20661,8 +20661,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20661
20661
  VERCEL_HAS_WORKER_SERVICES: "1",
20662
20662
  VERCEL_QUEUE_BASE_URL: `${this.address.origin}/_svc/_queues`,
20663
20663
  VERCEL_QUEUE_TOKEN: "vc-dev-token",
20664
- VERCEL_REGION: "dev1",
20665
- VERCEL_DEPLOYMENT_ID: "dpl_dev"
20664
+ VERCEL_REGION: "dev1"
20666
20665
  };
20667
20666
  }
20668
20667
  getSidecarDevMeta(match) {
@@ -20981,7 +20980,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20981
20980
  return void 0;
20982
20981
  }
20983
20982
  async _getVercelConfig() {
20984
- const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-U5NRIMZ2.js");
20983
+ const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-PM5ID4CV.js");
20985
20984
  await compileVercelConfig(this.cwd);
20986
20985
  const configPath = getLocalPathConfig(this.cwd);
20987
20986
  const [
@@ -21764,9 +21763,12 @@ ${error_code}
21764
21763
  ...requestTransforms ?? []
21765
21764
  ];
21766
21765
  let responseTransformsToApply = responseTransforms;
21766
+ const lookupUrl = `${lookupPath}${parsed.search || ""}`;
21767
+ let rewrittenUrl;
21768
+ let externalDestUrl;
21767
21769
  if (serviceRoutes.length > 0) {
21768
21770
  const serviceResult = await devRouter(
21769
- `${lookupPath}${parsed.search || ""}`,
21771
+ lookupUrl,
21770
21772
  req.method,
21771
21773
  serviceRoutes,
21772
21774
  this,
@@ -21797,6 +21799,21 @@ ${error_code}
21797
21799
  res.setHeader(name, value);
21798
21800
  }
21799
21801
  }
21802
+ if (serviceResult.dest) {
21803
+ const destParsed = url3.parse(serviceResult.dest);
21804
+ const destQuery = parseQueryString(destParsed.search);
21805
+ Object.assign(destQuery, serviceResult.query);
21806
+ destParsed.search = formatQueryString(destQuery);
21807
+ const resolvedDest = url3.format(destParsed);
21808
+ if (serviceResult.isDestUrl) {
21809
+ externalDestUrl = resolvedDest;
21810
+ } else if (resolvedDest !== lookupUrl) {
21811
+ rewrittenUrl = resolvedDest;
21812
+ }
21813
+ }
21814
+ }
21815
+ if (rewrittenUrl !== void 0) {
21816
+ req.url = rewrittenUrl;
21800
21817
  }
21801
21818
  for (const [name, value] of Object.entries(proxyHeaders)) {
21802
21819
  req.headers[name] = value;
@@ -21807,7 +21824,13 @@ ${error_code}
21807
21824
  responseTransformsToApply
21808
21825
  );
21809
21826
  this.setResponseHeaders(res, requestId);
21810
- debug(`Delegating to service "${serviceName}": ${origin}`);
21827
+ if (externalDestUrl) {
21828
+ debug(
21829
+ `Service "${serviceName}" rewrite to external URL: ${externalDestUrl}`
21830
+ );
21831
+ return proxyPass(req, res, externalDestUrl, this, requestId);
21832
+ }
21833
+ debug(`Delegating to service "${serviceName}": ${origin}${req.url}`);
21811
21834
  return proxyPass(req, res, origin, this, requestId, false);
21812
21835
  }
21813
21836
  async triggerBuild(match, requestPath, req, vercelConfig, previousBuildResult, filesChanged, filesRemoved) {