vercel 53.3.2 → 54.0.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 (68) hide show
  1. package/dist/chunks/{add-3SVEYCYO.js → add-FEHGU5ZE.js} +8 -8
  2. package/dist/chunks/{chunk-X7KU44KR.js → chunk-23SNIB7J.js} +1 -1
  3. package/dist/chunks/{chunk-NIOGCTVR.js → chunk-2GC2GW2H.js} +2 -2
  4. package/dist/chunks/{chunk-WOWCXMTU.js → chunk-3CBPQ6CA.js} +1 -1
  5. package/dist/chunks/{chunk-FVDSS6AL.js → chunk-4243WWHE.js} +4 -4
  6. package/dist/chunks/{chunk-OY4HIPQO.js → chunk-4I5SPKXV.js} +99 -41
  7. package/dist/chunks/{chunk-E4OPPX7M.js → chunk-4UJDQ2WM.js} +2 -2
  8. package/dist/chunks/{chunk-HFCK3QBJ.js → chunk-4WPY4WO3.js} +6 -6
  9. package/dist/chunks/{chunk-EBEBY45K.js → chunk-4XB5UFP4.js} +2 -2
  10. package/dist/chunks/{chunk-KSIISCB2.js → chunk-5GZAC4CI.js} +1 -1
  11. package/dist/chunks/{chunk-K5WXYAUP.js → chunk-AH6RCY4L.js} +1 -1
  12. package/dist/chunks/{chunk-LQOXSEJW.js → chunk-DIOSHJ4H.js} +5 -5
  13. package/dist/chunks/{chunk-NF7HK5MP.js → chunk-DVV42VA6.js} +2 -2
  14. package/dist/chunks/{chunk-E6EUZBB3.js → chunk-DXZ5RVOC.js} +6 -6
  15. package/dist/chunks/{chunk-X32G5X53.js → chunk-F6MUOB5B.js} +1 -1
  16. package/dist/chunks/{chunk-QGLS47RE.js → chunk-GRPLZLEB.js} +1 -1
  17. package/dist/chunks/{chunk-3JREBTWA.js → chunk-GWM32SE3.js} +16 -3
  18. package/dist/chunks/{chunk-U7NBRDCA.js → chunk-JWN6JMVY.js} +2 -2
  19. package/dist/chunks/{chunk-Z2O2S6ZA.js → chunk-KAC4IO5S.js} +483 -62
  20. package/dist/chunks/{chunk-ADLCFLGH.js → chunk-LANWQ2NA.js} +9 -9
  21. package/dist/chunks/{chunk-5V2IIK5P.js → chunk-MEAUBEGT.js} +3 -3
  22. package/dist/chunks/{chunk-3NSIZGHP.js → chunk-MWQHQ7FW.js} +3 -3
  23. package/dist/chunks/{chunk-H2IRGYM2.js → chunk-MXSNLYVL.js} +6 -6
  24. package/dist/chunks/{chunk-HAJ2XRTQ.js → chunk-NQQWZYTY.js} +2 -2
  25. package/dist/chunks/{chunk-JZLADLMF.js → chunk-NVV6BWQP.js} +2 -2
  26. package/dist/chunks/{chunk-P6Z4AGTA.js → chunk-OGWD7VBC.js} +2 -2
  27. package/dist/chunks/{chunk-6ESUYMQ6.js → chunk-OLJ6HISC.js} +3 -3
  28. package/dist/chunks/{chunk-GQLARSTH.js → chunk-P5NASM3L.js} +1 -1
  29. package/dist/chunks/{chunk-GCKUEAUE.js → chunk-Q5MHVELE.js} +2 -2
  30. package/dist/chunks/{chunk-IS56OO2J.js → chunk-S62XC5XL.js} +2 -2
  31. package/dist/chunks/{chunk-ONYQGA2O.js → chunk-S6EMI466.js} +2 -2
  32. package/dist/chunks/{chunk-SIRIGCP6.js → chunk-TEDMSWBX.js} +2 -2
  33. package/dist/chunks/{chunk-435PAKFA.js → chunk-TTEDSKHO.js} +4 -4
  34. package/dist/chunks/{chunk-4LDQIDKG.js → chunk-U5GMPX5T.js} +2 -2
  35. package/dist/chunks/{chunk-AXQNAI65.js → chunk-V6BFG564.js} +1 -1
  36. package/dist/chunks/{chunk-HENJXUSM.js → chunk-VOXVKDJQ.js} +4 -4
  37. package/dist/chunks/{chunk-KSF2MOCF.js → chunk-Y6X3VMO3.js} +1 -1
  38. package/dist/chunks/{compile-vercel-config-LDMZFRM6.js → compile-vercel-config-SGZPQDRN.js} +4 -4
  39. package/dist/chunks/{delete-Y2K2SKOJ.js → delete-WMHTTHG3.js} +6 -6
  40. package/dist/chunks/{disable-P72GFXPO.js → disable-QBDO6UIV.js} +6 -6
  41. package/dist/chunks/{discard-PJICIKZS.js → discard-GZZ553AR.js} +6 -6
  42. package/dist/chunks/{edit-UBF4GZ74.js → edit-H2BF2MZY.js} +7 -7
  43. package/dist/chunks/{enable-WKNZCBBP.js → enable-YYWIMKHP.js} +6 -6
  44. package/dist/chunks/{export-47S3H44M.js → export-D3XBBQZD.js} +6 -6
  45. package/dist/chunks/{inspect-VN5RPWZ4.js → inspect-LUCGK7HU.js} +8 -8
  46. package/dist/chunks/{list-2MOCSIVK.js → list-EGJ7X43H.js} +6 -6
  47. package/dist/chunks/{list-E2776667.js → list-WV3JSWCB.js} +9 -9
  48. package/dist/chunks/{ls-K6VVPESL.js → ls-DXRXKG6Q.js} +8 -8
  49. package/dist/chunks/{publish-YTJF333F.js → publish-LW57QZ56.js} +6 -6
  50. package/dist/chunks/{query-573BCOCL.js → query-AQSXA32P.js} +11 -11
  51. package/dist/chunks/{reorder-WGMITOMK.js → reorder-YJGPY7SA.js} +6 -6
  52. package/dist/chunks/{restore-R5SP6QDT.js → restore-VANQDIFO.js} +6 -6
  53. package/dist/chunks/{rm-3CARKENK.js → rm-GNY6PA2Z.js} +8 -8
  54. package/dist/chunks/{rule-inspect-N6HDKT6I.js → rule-inspect-EECXOMPN.js} +8 -8
  55. package/dist/chunks/{rules-D32GEN6D.js → rules-G2VMMW7U.js} +8 -8
  56. package/dist/chunks/{schema-7I3UHM6W.js → schema-4TUQAXX6.js} +9 -9
  57. package/dist/chunks/{types-7VDI75PV.js → types-54VLSVRV.js} +4 -4
  58. package/dist/chunks/{update-RQ7YZS6M.js → update-GSE7WNBV.js} +8 -8
  59. package/dist/commands/build/index.js +86 -53
  60. package/dist/commands/deploy/index.js +24 -24
  61. package/dist/commands/dev/index.js +254 -52
  62. package/dist/commands/env/index.js +18 -18
  63. package/dist/commands/link/index.js +19 -19
  64. package/dist/commands/list/index.js +10 -10
  65. package/dist/commands-bulk.js +1845 -1356
  66. package/dist/index.js +22 -22
  67. package/dist/version.mjs +1 -1
  68. package/package.json +20 -20
@@ -9,7 +9,7 @@ import {
9
9
  } from "../../chunks/chunk-2HSQ7YUK.js";
10
10
  import {
11
11
  getUpdateCommand
12
- } from "../../chunks/chunk-P6Z4AGTA.js";
12
+ } from "../../chunks/chunk-OGWD7VBC.js";
13
13
  import {
14
14
  highlight
15
15
  } from "../../chunks/chunk-V5P25P7F.js";
@@ -18,33 +18,35 @@ import {
18
18
  } from "../../chunks/chunk-YPQSDAEW.js";
19
19
  import {
20
20
  devCommand
21
- } from "../../chunks/chunk-HAJ2XRTQ.js";
21
+ } from "../../chunks/chunk-NQQWZYTY.js";
22
22
  import {
23
23
  OUTPUT_DIR,
24
+ getStaticServiceSchedules,
24
25
  importBuilders,
25
26
  require_mime_types,
26
27
  require_npa,
27
28
  staticFiles
28
- } from "../../chunks/chunk-3JREBTWA.js";
29
+ } from "../../chunks/chunk-GWM32SE3.js";
29
30
  import "../../chunks/chunk-IB5L4LKZ.js";
30
31
  import {
31
32
  pickOverrides
32
- } from "../../chunks/chunk-KSF2MOCF.js";
33
- import "../../chunks/chunk-X32G5X53.js";
33
+ } from "../../chunks/chunk-Y6X3VMO3.js";
34
+ import "../../chunks/chunk-F6MUOB5B.js";
34
35
  import {
35
36
  displayDetectedServices,
36
37
  readConfig,
37
38
  setupAndLink
38
- } from "../../chunks/chunk-LQOXSEJW.js";
39
+ } from "../../chunks/chunk-DIOSHJ4H.js";
39
40
  import {
40
41
  getLocalPathConfig
41
- } from "../../chunks/chunk-5V2IIK5P.js";
42
+ } from "../../chunks/chunk-MEAUBEGT.js";
42
43
  import {
43
44
  help
44
- } from "../../chunks/chunk-IS56OO2J.js";
45
- import "../../chunks/chunk-KSIISCB2.js";
45
+ } from "../../chunks/chunk-S62XC5XL.js";
46
+ import "../../chunks/chunk-5GZAC4CI.js";
46
47
  import {
47
48
  VERCEL_DIR,
49
+ findRepoRoot,
48
50
  getLinkedProject,
49
51
  getVercelDirectory,
50
52
  param,
@@ -66,14 +68,14 @@ import {
66
68
  resolveProjectCwd,
67
69
  tryDetectServices,
68
70
  validateConfig
69
- } from "../../chunks/chunk-Z2O2S6ZA.js";
71
+ } from "../../chunks/chunk-KAC4IO5S.js";
70
72
  import {
71
73
  TelemetryClient
72
74
  } from "../../chunks/chunk-4OEA5ILS.js";
73
75
  import {
74
76
  buildCommandWithYes,
75
77
  outputActionRequired
76
- } from "../../chunks/chunk-AXQNAI65.js";
78
+ } from "../../chunks/chunk-V6BFG564.js";
77
79
  import {
78
80
  require_ms
79
81
  } from "../../chunks/chunk-CO5D46AG.js";
@@ -81,7 +83,7 @@ import {
81
83
  getFlagsSpecification,
82
84
  parseArguments,
83
85
  printError
84
- } from "../../chunks/chunk-GQLARSTH.js";
86
+ } from "../../chunks/chunk-P5NASM3L.js";
85
87
  import {
86
88
  CantParseJSONFile,
87
89
  LambdaSizeExceededError,
@@ -93,7 +95,7 @@ import {
93
95
  getTitleName,
94
96
  packageName,
95
97
  require_bytes
96
- } from "../../chunks/chunk-EBEBY45K.js";
98
+ } from "../../chunks/chunk-4XB5UFP4.js";
97
99
  import {
98
100
  link_default,
99
101
  output_manager_default,
@@ -15756,7 +15758,7 @@ var require_error = __commonJS({
15756
15758
  // ../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/index.js
15757
15759
  var require_src2 = __commonJS({
15758
15760
  "../../node_modules/.pnpm/serve-handler@6.1.1/node_modules/serve-handler/src/index.js"(exports2, module2) {
15759
- var { promisify: promisify2 } = __require("util");
15761
+ var { promisify } = __require("util");
15760
15762
  var path5 = __require("path");
15761
15763
  var { createHash } = __require("crypto");
15762
15764
  var { realpath, lstat, createReadStream, readdir } = __require("fs");
@@ -16151,10 +16153,10 @@ var require_src2 = __commonJS({
16151
16153
  return sendError(...args2);
16152
16154
  };
16153
16155
  var getHandlers = (methods) => Object.assign({
16154
- lstat: promisify2(lstat),
16155
- realpath: promisify2(realpath),
16156
+ lstat: promisify(lstat),
16157
+ realpath: promisify(realpath),
16156
16158
  createReadStream,
16157
- readdir: promisify2(readdir),
16159
+ readdir: promisify(readdir),
16158
16160
  sendError
16159
16161
  }, methods);
16160
16162
  module2.exports = async (request, response, config = {}, methods = {}) => {
@@ -17059,8 +17061,16 @@ import {
17059
17061
 
17060
17062
  // src/util/tree-kill.ts
17061
17063
  var import_tree_kill = __toESM(require_tree_kill(), 1);
17062
- import { promisify } from "util";
17063
- var treeKill = promisify(import_tree_kill.default);
17064
+ function treeKill(pid, signal = "SIGTERM") {
17065
+ return new Promise((resolve2, reject) => {
17066
+ (0, import_tree_kill.default)(pid, signal, (err) => {
17067
+ if (err)
17068
+ reject(err);
17069
+ else
17070
+ resolve2();
17071
+ });
17072
+ });
17073
+ }
17064
17074
 
17065
17075
  // src/util/dev/builder.ts
17066
17076
  var import_routing_utils2 = __toESM(require_dist3(), 1);
@@ -17703,7 +17713,8 @@ import {
17703
17713
  spawnCommand,
17704
17714
  NowBuildError,
17705
17715
  runNpmInstall,
17706
- getServiceUrlEnvVars
17716
+ getServiceUrlEnvVars,
17717
+ getExperimentalServiceUrlEnvVars
17707
17718
  } from "@vercel/build-utils";
17708
17719
  var STARTUP_TIMEOUT = (0, import_ms2.default)("5m");
17709
17720
  var ServiceStartError = class extends Error {
@@ -17784,6 +17795,56 @@ function getServiceRoutePrefixes(service) {
17784
17795
  }
17785
17796
  return [];
17786
17797
  }
17798
+ var FORCE_KILL_GRACE_MS = 2e3;
17799
+ var STOP_ALL_TIMEOUT_MS = 8e3;
17800
+ function killGroup(pid, signal) {
17801
+ try {
17802
+ process.kill(-pid, signal);
17803
+ return true;
17804
+ } catch (err) {
17805
+ const code = err.code;
17806
+ if (code === "ESRCH" || code === "EPERM")
17807
+ return false;
17808
+ throw err;
17809
+ }
17810
+ }
17811
+ function isProcessAlive(pid) {
17812
+ try {
17813
+ process.kill(pid, 0);
17814
+ return true;
17815
+ } catch (err) {
17816
+ return err.code === "EPERM";
17817
+ }
17818
+ }
17819
+ function waitForExit(pid, proc, timeoutMs) {
17820
+ if (proc && (proc.exitCode !== null || proc.signalCode !== null)) {
17821
+ return Promise.resolve(true);
17822
+ }
17823
+ if (!isProcessAlive(pid)) {
17824
+ return Promise.resolve(true);
17825
+ }
17826
+ return new Promise((resolve2) => {
17827
+ let settled = false;
17828
+ const finish = (died) => {
17829
+ if (settled)
17830
+ return;
17831
+ settled = true;
17832
+ clearInterval(poll);
17833
+ clearTimeout(deadline);
17834
+ if (proc)
17835
+ proc.removeListener("exit", onExit);
17836
+ resolve2(died);
17837
+ };
17838
+ const onExit = () => finish(true);
17839
+ if (proc)
17840
+ proc.once("exit", onExit);
17841
+ const poll = setInterval(() => {
17842
+ if (!isProcessAlive(pid))
17843
+ finish(true);
17844
+ }, 100);
17845
+ const deadline = setTimeout(() => finish(false), timeoutMs);
17846
+ });
17847
+ }
17787
17848
  var ServicesOrchestrator = class {
17788
17849
  constructor(options) {
17789
17850
  this.managedServices = /* @__PURE__ */ new Map();
@@ -17795,14 +17856,49 @@ var ServicesOrchestrator = class {
17795
17856
  this.repoRoot = options.repoRoot;
17796
17857
  this.maxNameLength = Math.max(...options.services.map((s) => s.name.length));
17797
17858
  this.proxyOrigin = options.proxyOrigin;
17798
- this.env = options.env;
17859
+ this.envFilesValues = options.env;
17860
+ this.useImplicitEnvInjection = options.useImplicitEnvInjection;
17799
17861
  this.pythonServiceCount = options.services.filter(
17800
17862
  (s) => s.runtime === "python"
17801
17863
  ).length;
17802
17864
  this.hasQueueServices = options.services.some(isQueueTriggeredService);
17803
17865
  }
17866
+ // Synchronously SIGKILL every tracked process group. Used from
17867
+ // `process.on('exit' | 'uncaughtException')` so that orphans are reaped even
17868
+ // when normal async cleanup never runs (crash, uncaught exception, plain
17869
+ // `process.exit`). Must stay synchronous — the 'exit' event allows no I/O.
17870
+ // Each kill is isolated so one failure (EPERM, unexpected error) cannot
17871
+ // abort the loop and leave siblings orphaned.
17872
+ forceKillAllSync() {
17873
+ const killOne = (pid) => {
17874
+ if (!pid)
17875
+ return;
17876
+ try {
17877
+ killGroup(pid, "SIGKILL");
17878
+ } catch {
17879
+ }
17880
+ };
17881
+ for (const [, proc] of this.managedProcesses)
17882
+ killOne(proc.pid);
17883
+ for (const [, service] of this.managedServices)
17884
+ killOne(service.pid);
17885
+ }
17886
+ registerExitBackstop() {
17887
+ if (this.exitBackstop)
17888
+ return;
17889
+ const backstop = () => this.forceKillAllSync();
17890
+ this.exitBackstop = backstop;
17891
+ process.on("exit", backstop);
17892
+ }
17893
+ unregisterExitBackstop() {
17894
+ if (this.exitBackstop) {
17895
+ process.removeListener("exit", this.exitBackstop);
17896
+ this.exitBackstop = void 0;
17897
+ }
17898
+ }
17804
17899
  async startAll() {
17805
17900
  output_manager_default.debug(`Starting ${this.services.length} services`);
17901
+ this.registerExitBackstop();
17806
17902
  const startPromises = this.services.map(
17807
17903
  (service, index) => this.startService(service, index).then((result) => {
17808
17904
  this.managedServices.set(result.name, result);
@@ -17838,7 +17934,11 @@ var ServicesOrchestrator = class {
17838
17934
  });
17839
17935
  }
17840
17936
  if (service.pid) {
17841
- await treeKill(service.pid).catch((err) => {
17937
+ await this.terminateProcessGroup(
17938
+ name,
17939
+ service.pid,
17940
+ service.process
17941
+ ).catch((err) => {
17842
17942
  output_manager_default.debug(`Failed to kill service "${name}": ${err}`);
17843
17943
  });
17844
17944
  }
@@ -17850,7 +17950,7 @@ var ServicesOrchestrator = class {
17850
17950
  if (proc.pid && !this.managedServices.has(name)) {
17851
17951
  output_manager_default.debug(`Stopping process "${name}" (PID: ${proc.pid})`);
17852
17952
  stopPromises.push(
17853
- treeKill(proc.pid).catch((err) => {
17953
+ this.terminateProcessGroup(name, proc.pid, proc).catch((err) => {
17854
17954
  output_manager_default.debug(`Failed to stop process "${name}": ${err}`);
17855
17955
  })
17856
17956
  );
@@ -17860,10 +17960,58 @@ var ServicesOrchestrator = class {
17860
17960
  clearTimeout(timer);
17861
17961
  }
17862
17962
  this.cronTimers = [];
17863
- await Promise.all(stopPromises);
17864
- this.managedServices.clear();
17865
- this.managedProcesses.clear();
17866
- output_manager_default.debug("All services stopped");
17963
+ let timedOut = false;
17964
+ let timeoutHandle;
17965
+ const timeout = new Promise((resolve2) => {
17966
+ timeoutHandle = setTimeout(() => {
17967
+ timedOut = true;
17968
+ output_manager_default.debug(
17969
+ `stopAll timed out after ${STOP_ALL_TIMEOUT_MS}ms; remaining processes will be SIGKILLed on exit`
17970
+ );
17971
+ resolve2();
17972
+ }, STOP_ALL_TIMEOUT_MS);
17973
+ });
17974
+ try {
17975
+ await Promise.race([Promise.all(stopPromises), timeout]);
17976
+ } finally {
17977
+ if (timeoutHandle)
17978
+ clearTimeout(timeoutHandle);
17979
+ }
17980
+ if (!timedOut) {
17981
+ this.managedServices.clear();
17982
+ this.managedProcesses.clear();
17983
+ this.unregisterExitBackstop();
17984
+ output_manager_default.debug("All services stopped");
17985
+ }
17986
+ }
17987
+ // Graceful → forceful termination of a single service's process group.
17988
+ // Sends SIGTERM to the entire pgid (services run with `detached: true`, so
17989
+ // pgid === pid), waits *up to* a grace window — polling so well-behaved
17990
+ // services exit immediately — and escalates to SIGKILL only if still alive.
17991
+ // `tree-kill` runs in parallel to mop up descendants that switched process
17992
+ // groups via `setsid` and so escape `kill(-pgid)`. Every step is wrapped:
17993
+ // no error from a single service can prevent the rest of `stopAll` from
17994
+ // completing.
17995
+ async terminateProcessGroup(name, pid, proc) {
17996
+ try {
17997
+ killGroup(pid, "SIGTERM");
17998
+ } catch (err) {
17999
+ output_manager_default.debug(`SIGTERM group kill for "${name}" failed: ${err}`);
18000
+ }
18001
+ await treeKill(pid, "SIGTERM").catch((err) => {
18002
+ output_manager_default.debug(`tree-kill (SIGTERM) for "${name}" failed: ${err}`);
18003
+ });
18004
+ const died = await waitForExit(pid, proc, FORCE_KILL_GRACE_MS);
18005
+ if (died)
18006
+ return;
18007
+ output_manager_default.debug(`Escalating to SIGKILL for "${name}" (PID: ${pid})`);
18008
+ try {
18009
+ killGroup(pid, "SIGKILL");
18010
+ } catch (err) {
18011
+ output_manager_default.debug(`SIGKILL group kill for "${name}" failed: ${err}`);
18012
+ }
18013
+ await treeKill(pid, "SIGKILL").catch(() => {
18014
+ });
17867
18015
  }
17868
18016
  getServiceForRoute(pathname) {
17869
18017
  let bestMatch = null;
@@ -17906,21 +18054,32 @@ var ServicesOrchestrator = class {
17906
18054
  colorIndex,
17907
18055
  this.maxNameLength
17908
18056
  );
17909
- const serviceUrlEnvVars = getServiceUrlEnvVars({
17910
- services: this.services,
17911
- frameworkList: framework ? [framework] : [],
17912
- origin: this.proxyOrigin,
17913
- currentEnv: this.env,
17914
- envPrefix: service.envPrefix
17915
- });
18057
+ const effectiveProcessEnv = cloneEnv(this.envFilesValues, process.env);
18058
+ let perServiceEnv = {};
18059
+ if (this.useImplicitEnvInjection) {
18060
+ perServiceEnv = getExperimentalServiceUrlEnvVars({
18061
+ services: this.services,
18062
+ frameworkList: framework ? [framework] : [],
18063
+ origin: this.proxyOrigin,
18064
+ currentEnv: effectiveProcessEnv
18065
+ });
18066
+ } else if (service.env) {
18067
+ perServiceEnv = getServiceUrlEnvVars({
18068
+ requestedEnv: service.env,
18069
+ consumerService: service,
18070
+ services: this.services,
18071
+ frameworkList: import_frameworks.frameworkList,
18072
+ origin: this.proxyOrigin,
18073
+ currentEnv: effectiveProcessEnv
18074
+ });
18075
+ }
17916
18076
  const env = cloneEnv(
17917
18077
  {
17918
18078
  FORCE_COLOR: process.stdout.isTTY ? "1" : "0",
17919
18079
  BROWSER: "none"
17920
18080
  },
17921
- process.env,
17922
- this.env,
17923
- serviceUrlEnvVars
18081
+ perServiceEnv,
18082
+ effectiveProcessEnv
17924
18083
  );
17925
18084
  env.VERCEL_SERVICE_TYPE = service.type;
17926
18085
  if (service.trigger) {
@@ -18201,16 +18360,14 @@ var ServicesOrchestrator = class {
18201
18360
  startCronSchedulers() {
18202
18361
  for (const [name, managed] of this.managedServices) {
18203
18362
  const service = this.services.find((candidate) => candidate.name === name);
18204
- const crons = managed.crons && managed.crons.length > 0 ? managed.crons : service && isScheduleTriggeredService(service) && service.schedule && service.schedule !== "<dynamic>" ? [
18205
- {
18206
- path: (0, import_fs_detectors2.getInternalServiceCronPath)(
18207
- name,
18208
- service.entrypoint || service.builder.src || "index",
18209
- service.handlerFunction || "cron"
18210
- ),
18211
- schedule: service.schedule
18212
- }
18213
- ] : [];
18363
+ const crons = managed.crons && managed.crons.length > 0 ? managed.crons : service && isScheduleTriggeredService(service) && service.schedule ? getStaticServiceSchedules(service.schedule).map((schedule) => ({
18364
+ path: (0, import_fs_detectors2.getInternalServiceCronPath)(
18365
+ name,
18366
+ service.entrypoint || service.builder.src || "index",
18367
+ service.handlerFunction || "cron"
18368
+ ),
18369
+ schedule
18370
+ })) : [];
18214
18371
  if (crons.length === 0)
18215
18372
  continue;
18216
18373
  for (const cron of crons) {
@@ -19549,10 +19706,13 @@ Please ensure that ${cmd(err.path)} is properly installed`;
19549
19706
  this.repoRoot = options.repoRoot ?? cwd;
19550
19707
  this.envConfigs = { buildEnv: {}, runEnv: {}, allEnv: {} };
19551
19708
  this.envValues = options.envValues || {};
19709
+ this.projectId = options.projectId;
19710
+ this.orgId = options.orgId;
19552
19711
  this.files = {};
19553
19712
  this.originalProjectSettings = options.projectSettings;
19554
19713
  this.projectSettings = options.projectSettings;
19555
19714
  this.services = options.services;
19715
+ this.useImplicitServicesEnvInjection = options.useImplicitServicesEnvInjection ?? true;
19556
19716
  this.caseSensitive = false;
19557
19717
  this.apiDir = null;
19558
19718
  this.apiExtensions = /* @__PURE__ */ new Set();
@@ -19857,7 +20017,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
19857
20017
  return void 0;
19858
20018
  }
19859
20019
  async _getVercelConfig() {
19860
- const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-LDMZFRM6.js");
20020
+ const { compileVercelConfig } = await import("../../chunks/compile-vercel-config-SGZPQDRN.js");
19861
20021
  await compileVercelConfig(this.cwd);
19862
20022
  const configPath = getLocalPathConfig(this.cwd);
19863
20023
  const [
@@ -19880,7 +20040,7 @@ Please ensure that ${cmd(err.path)} is properly installed`;
19880
20040
  await this.exit();
19881
20041
  }
19882
20042
  vercelConfig.routes = maybeRoutes || [];
19883
- if (!vercelConfig.experimentalServices && (!vercelConfig.builds || vercelConfig.builds.length === 0)) {
20043
+ if (!vercelConfig.services && !vercelConfig.experimentalServices && (!vercelConfig.builds || vercelConfig.builds.length === 0)) {
19884
20044
  const featHandleMiss = true;
19885
20045
  const { projectSettings, cleanUrls, trailingSlash } = vercelConfig;
19886
20046
  const files = (await staticFiles(this.cwd, {})).map(
@@ -19966,8 +20126,9 @@ Please ensure that ${cmd(err.path)} is properly installed`;
19966
20126
  this.caseSensitive = hasNewRoutingProperties(vercelConfig);
19967
20127
  this.apiDir = (0, import_fs_detectors3.detectApiDirectory)(vercelConfig.builds || []);
19968
20128
  this.apiExtensions = (0, import_fs_detectors3.detectApiExtensions)(vercelConfig.builds || []);
20129
+ const literalTopLevelEnv = isLiteralEnvRecord(vercelConfig.env) ? vercelConfig.env : void 0;
19969
20130
  let [runEnv, buildEnv] = await Promise.all([
19970
- this.getLocalEnv(".env", vercelConfig.env),
20131
+ this.getLocalEnv(".env", literalTopLevelEnv),
19971
20132
  this.getLocalEnv(".env.build", vercelConfig.build?.env)
19972
20133
  ]);
19973
20134
  let allEnv = { ...buildEnv, ...runEnv };
@@ -19985,6 +20146,22 @@ Please ensure that ${cmd(err.path)} is properly installed`;
19985
20146
  allEnv["NOW_REGION"] = "dev1";
19986
20147
  allEnv["VERCEL_ENV"] = "development";
19987
20148
  allEnv["VERCEL"] = "1";
20149
+ if (this.projectId && !process.env.VERCEL_PROJECT_ID) {
20150
+ if (!("VERCEL_PROJECT_ID" in allEnv)) {
20151
+ allEnv["VERCEL_PROJECT_ID"] = this.projectId;
20152
+ }
20153
+ if (!("VERCEL_PROJECT_ID" in runEnv)) {
20154
+ runEnv["VERCEL_PROJECT_ID"] = this.projectId;
20155
+ }
20156
+ }
20157
+ if (this.orgId && !process.env.VERCEL_ORG_ID) {
20158
+ if (!("VERCEL_ORG_ID" in allEnv)) {
20159
+ allEnv["VERCEL_ORG_ID"] = this.orgId;
20160
+ }
20161
+ if (!("VERCEL_ORG_ID" in runEnv)) {
20162
+ runEnv["VERCEL_ORG_ID"] = this.orgId;
20163
+ }
20164
+ }
19988
20165
  if (this.projectSettings?.autoExposeSystemEnvs) {
19989
20166
  runEnv["VERCEL_REGION"] = "dev1";
19990
20167
  }
@@ -20141,7 +20318,8 @@ Please ensure that ${cmd(err.path)} is properly installed`;
20141
20318
  cwd: this.cwd,
20142
20319
  repoRoot: this.repoRoot,
20143
20320
  env: this.envConfigs.allEnv,
20144
- proxyOrigin: this.address.origin
20321
+ proxyOrigin: this.address.origin,
20322
+ useImplicitEnvInjection: this.useImplicitServicesEnvInjection
20145
20323
  });
20146
20324
  devCommandPromise = this.orchestrator.startAll();
20147
20325
  this.devProcessOrigin = void 0;
@@ -20678,6 +20856,12 @@ function generateRequestId(podId, isInvoke = false) {
20678
20856
  function hasProp(obj, prop) {
20679
20857
  return Object.prototype.hasOwnProperty.call(obj, prop);
20680
20858
  }
20859
+ function isLiteralEnvRecord(env) {
20860
+ if (!env)
20861
+ return false;
20862
+ const first = Object.values(env)[0];
20863
+ return first === void 0 || typeof first === "string";
20864
+ }
20681
20865
  async function findBuildMatch(matches, files, requestPath, devServer, vercelConfig, isFilesystem = false) {
20682
20866
  requestPath = requestPath.replace(/^\//, "");
20683
20867
  let bestIndexMatch;
@@ -21086,24 +21270,35 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
21086
21270
  let projectSettings;
21087
21271
  let envValues = {};
21088
21272
  let repoRoot;
21273
+ let projectId;
21274
+ let orgId;
21089
21275
  if (link.status === "linked") {
21090
21276
  const { project, org } = link;
21091
21277
  if (link.repoRoot) {
21092
21278
  repoRoot = cwd = link.repoRoot;
21279
+ } else if (project.rootDirectory) {
21280
+ const monorepoRoot = await findRepoRoot(cwd);
21281
+ if (monorepoRoot) {
21282
+ repoRoot = cwd = monorepoRoot;
21283
+ }
21093
21284
  }
21094
21285
  client.config.currentTeam = org.type === "team" ? org.id : void 0;
21095
21286
  projectSettings = project;
21287
+ projectId = project.id;
21288
+ orgId = org.id;
21096
21289
  if (project.rootDirectory) {
21097
21290
  cwd = join4(cwd, project.rootDirectory);
21098
21291
  }
21099
21292
  envValues = (await pullEnvRecords(client, project.id, "vercel-cli:dev")).env;
21100
21293
  }
21101
21294
  let services;
21295
+ let useImplicitServicesEnvInjection = true;
21102
21296
  const servicesResult = await tryDetectServices(cwd);
21103
21297
  const foundServices = servicesResult && servicesResult.services.length > 0;
21104
21298
  if (foundServices) {
21105
21299
  displayDetectedServices(servicesResult.services);
21106
21300
  services = servicesResult.services;
21301
+ useImplicitServicesEnvInjection = servicesResult.useImplicitEnvInjection;
21107
21302
  }
21108
21303
  let lockAcquired = false;
21109
21304
  if (foundServices) {
@@ -21136,7 +21331,10 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
21136
21331
  projectSettings,
21137
21332
  envValues,
21138
21333
  repoRoot,
21139
- services
21334
+ services,
21335
+ useImplicitServicesEnvInjection,
21336
+ projectId,
21337
+ orgId
21140
21338
  });
21141
21339
  const controller = new AbortController();
21142
21340
  const timeout = setTimeout(async () => {
@@ -21183,11 +21381,15 @@ To link your project, run ${getCommandName("dev")} without \`-L\` or \`--local\`
21183
21381
  case "SIGTERM":
21184
21382
  exitCode = 143;
21185
21383
  break;
21384
+ case "SIGHUP":
21385
+ exitCode = 129;
21386
+ break;
21186
21387
  }
21187
21388
  process.exit(exitCode);
21188
21389
  };
21189
21390
  process.on("SIGTERM", async () => await cleanup("SIGTERM"));
21190
21391
  process.on("SIGINT", async () => await cleanup("SIGINT"));
21392
+ process.on("SIGHUP", async () => await cleanup("SIGHUP"));
21191
21393
  if (!devServer.devCommand) {
21192
21394
  const outputDir = join4(cwd, OUTPUT_DIR);
21193
21395
  if (await import_fs_extra2.default.pathExists(outputDir)) {
@@ -12,14 +12,14 @@ import {
12
12
  } from "../../chunks/chunk-C5YP6KFI.js";
13
13
  import {
14
14
  formatTable
15
- } from "../../chunks/chunk-NF7HK5MP.js";
15
+ } from "../../chunks/chunk-DVV42VA6.js";
16
16
  import {
17
17
  suggestNextCommands
18
18
  } from "../../chunks/chunk-LOS7HHU3.js";
19
19
  import {
20
20
  formatEnvironment,
21
21
  validateLsArgs
22
- } from "../../chunks/chunk-U7NBRDCA.js";
22
+ } from "../../chunks/chunk-JWN6JMVY.js";
23
23
  import {
24
24
  validateJsonOutput
25
25
  } from "../../chunks/chunk-XPKWKPWA.js";
@@ -28,24 +28,24 @@ import {
28
28
  } from "../../chunks/chunk-YPQSDAEW.js";
29
29
  import {
30
30
  getCommandAliases
31
- } from "../../chunks/chunk-OY4HIPQO.js";
32
- import "../../chunks/chunk-4LDQIDKG.js";
33
- import "../../chunks/chunk-NIOGCTVR.js";
34
- import "../../chunks/chunk-HAJ2XRTQ.js";
35
- import "../../chunks/chunk-GCKUEAUE.js";
36
- import "../../chunks/chunk-3NSIZGHP.js";
37
- import "../../chunks/chunk-JZLADLMF.js";
38
- import "../../chunks/chunk-ONYQGA2O.js";
31
+ } from "../../chunks/chunk-4I5SPKXV.js";
32
+ import "../../chunks/chunk-U5GMPX5T.js";
33
+ import "../../chunks/chunk-2GC2GW2H.js";
34
+ import "../../chunks/chunk-NQQWZYTY.js";
35
+ import "../../chunks/chunk-Q5MHVELE.js";
36
+ import "../../chunks/chunk-MWQHQ7FW.js";
37
+ import "../../chunks/chunk-NVV6BWQP.js";
38
+ import "../../chunks/chunk-S6EMI466.js";
39
39
  import {
40
40
  require_execa
41
- } from "../../chunks/chunk-X32G5X53.js";
41
+ } from "../../chunks/chunk-F6MUOB5B.js";
42
42
  import {
43
43
  autoInstallVercelPlugin
44
- } from "../../chunks/chunk-6ESUYMQ6.js";
44
+ } from "../../chunks/chunk-OLJ6HISC.js";
45
45
  import {
46
46
  help
47
- } from "../../chunks/chunk-IS56OO2J.js";
48
- import "../../chunks/chunk-KSIISCB2.js";
47
+ } from "../../chunks/chunk-S62XC5XL.js";
48
+ import "../../chunks/chunk-5GZAC4CI.js";
49
49
  import {
50
50
  STANDARD_ENVIRONMENTS,
51
51
  addSubcommand,
@@ -66,7 +66,7 @@ import {
66
66
  require_frameworks,
67
67
  runSubcommand,
68
68
  updateSubcommand
69
- } from "../../chunks/chunk-Z2O2S6ZA.js";
69
+ } from "../../chunks/chunk-KAC4IO5S.js";
70
70
  import {
71
71
  TelemetryClient,
72
72
  require_dist as require_dist2
@@ -81,7 +81,7 @@ import {
81
81
  getPreservedArgsForEnvUpdate,
82
82
  outputActionRequired,
83
83
  outputAgentError
84
- } from "../../chunks/chunk-AXQNAI65.js";
84
+ } from "../../chunks/chunk-V6BFG564.js";
85
85
  import {
86
86
  require_ms,
87
87
  stamp_default
@@ -90,13 +90,13 @@ import {
90
90
  getFlagsSpecification,
91
91
  parseArguments,
92
92
  printError
93
- } from "../../chunks/chunk-GQLARSTH.js";
93
+ } from "../../chunks/chunk-P5NASM3L.js";
94
94
  import {
95
95
  getCommandName,
96
96
  getCommandNamePlain,
97
97
  isAPIError,
98
98
  require_lib
99
- } from "../../chunks/chunk-EBEBY45K.js";
99
+ } from "../../chunks/chunk-4XB5UFP4.js";
100
100
  import {
101
101
  emoji,
102
102
  output_manager_default,