vercel 48.1.0 → 48.1.2

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 +86 -30
  2. package/package.json +9 -10
package/dist/index.js CHANGED
@@ -31624,6 +31624,15 @@ var init_command3 = __esm({
31624
31624
  ...yesOption,
31625
31625
  description: "Skip the confirmation prompt about pulling environment variables and project settings when not found locally"
31626
31626
  }
31627
+ // FIXME: standalone:replace env var with flag
31628
+ // {
31629
+ // name: 'experimentalStandalone',
31630
+ // description:
31631
+ // 'Create a standalone build with all dependencies inlined into function output folders',
31632
+ // shorthand: null,
31633
+ // type: Boolean,
31634
+ // deprecated: false,
31635
+ // },
31627
31636
  ],
31628
31637
  examples: [
31629
31638
  {
@@ -116930,7 +116939,7 @@ var require_frameworks = __commonJS2({
116930
116939
  getOutputDirName: async () => "public"
116931
116940
  },
116932
116941
  {
116933
- name: "h3",
116942
+ name: "H3",
116934
116943
  slug: "h3",
116935
116944
  logo: "https://api-frameworks.vercel.sh/framework-logos/h3.svg",
116936
116945
  tagline: "Universal, Tiny, and Fast Servers",
@@ -119368,7 +119377,7 @@ var require_detect_builders = __commonJS2({
119368
119377
  builders.push(...apiBuilders);
119369
119378
  }
119370
119379
  if (frontendBuilder) {
119371
- if (frontendBuilder?.use === "@vercel/express") {
119380
+ if (frontendBuilder?.use === "@vercel/express" || frontendBuilder?.use === "@vercel/hono") {
119372
119381
  builders.push({
119373
119382
  src: "public/**/*",
119374
119383
  use: "@vercel/static",
@@ -144699,7 +144708,7 @@ var init_unzip = __esm({
144699
144708
  });
144700
144709
 
144701
144710
  // src/util/build/write-build-result.ts
144702
- async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, builder, builderPkg, vercelConfig) {
144711
+ async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, builder, builderPkg, vercelConfig, standalone = false) {
144703
144712
  const { version: version2 } = builder;
144704
144713
  if (typeof version2 !== "number" || version2 === 2) {
144705
144714
  return writeBuildResultV2(
@@ -144707,7 +144716,8 @@ async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, bu
144707
144716
  outputDir,
144708
144717
  buildResult,
144709
144718
  build2,
144710
- vercelConfig
144719
+ vercelConfig,
144720
+ standalone
144711
144721
  );
144712
144722
  } else if (version2 === 3) {
144713
144723
  return writeBuildResultV3(
@@ -144715,7 +144725,8 @@ async function writeBuildResult(repoRootPath, outputDir, buildResult, build2, bu
144715
144725
  outputDir,
144716
144726
  buildResult,
144717
144727
  build2,
144718
- vercelConfig
144728
+ vercelConfig,
144729
+ standalone
144719
144730
  );
144720
144731
  }
144721
144732
  throw new Error(
@@ -144738,7 +144749,7 @@ function isFile(v) {
144738
144749
  function stripDuplicateSlashes(path11) {
144739
144750
  return normalize2(path11).replace(/(^\/|\/$)/g, "");
144740
144751
  }
144741
- async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2, vercelConfig) {
144752
+ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2, vercelConfig, standalone = false) {
144742
144753
  if ("buildOutputPath" in buildResult) {
144743
144754
  await mergeBuilderOutput(outputDir, buildResult);
144744
144755
  return;
@@ -144761,7 +144772,8 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
144761
144772
  output2,
144762
144773
  normalizedPath,
144763
144774
  void 0,
144764
- existingFunctions
144775
+ existingFunctions,
144776
+ standalone
144765
144777
  );
144766
144778
  } else if (isPrerender(output2)) {
144767
144779
  if (!output2.lambda) {
@@ -144775,7 +144787,8 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
144775
144787
  output2.lambda,
144776
144788
  normalizedPath,
144777
144789
  void 0,
144778
- existingFunctions
144790
+ existingFunctions,
144791
+ standalone
144779
144792
  );
144780
144793
  let fallback = output2.fallback;
144781
144794
  if (fallback) {
@@ -144827,7 +144840,8 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
144827
144840
  outputDir,
144828
144841
  output2,
144829
144842
  normalizedPath,
144830
- existingFunctions
144843
+ existingFunctions,
144844
+ standalone
144831
144845
  );
144832
144846
  } else {
144833
144847
  throw new Error(
@@ -144837,7 +144851,7 @@ async function writeBuildResultV2(repoRootPath, outputDir, buildResult, build2,
144837
144851
  }
144838
144852
  return Object.keys(overrides).length > 0 ? overrides : void 0;
144839
144853
  }
144840
- async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2, vercelConfig) {
144854
+ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2, vercelConfig, standalone = false) {
144841
144855
  const { output: output2 } = buildResult;
144842
144856
  const src = build2.src;
144843
144857
  if (typeof src !== "string") {
@@ -144857,10 +144871,19 @@ async function writeBuildResultV3(repoRootPath, outputDir, buildResult, build2,
144857
144871
  outputDir,
144858
144872
  output2,
144859
144873
  path11,
144860
- functionConfiguration
144874
+ functionConfiguration,
144875
+ void 0,
144876
+ standalone
144861
144877
  );
144862
144878
  } else if (isEdgeFunction(output2)) {
144863
- await writeEdgeFunction(repoRootPath, outputDir, output2, path11);
144879
+ await writeEdgeFunction(
144880
+ repoRootPath,
144881
+ outputDir,
144882
+ output2,
144883
+ path11,
144884
+ void 0,
144885
+ standalone
144886
+ );
144864
144887
  } else {
144865
144888
  throw new Error(
144866
144889
  `Unsupported output type: "${output2.type}" for ${build2.src}`
@@ -144911,7 +144934,7 @@ async function writeFunctionSymlink(outputDir, dest, fn2, existingFunctions) {
144911
144934
  await import_fs_extra12.default.symlink(target, dest);
144912
144935
  return true;
144913
144936
  }
144914
- async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11, existingFunctions) {
144937
+ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11, existingFunctions, standalone = false) {
144915
144938
  const dest = (0, import_path21.join)(outputDir, "functions", `${path11}.func`);
144916
144939
  if (existingFunctions) {
144917
144940
  if (await writeFunctionSymlink(
@@ -144926,11 +144949,17 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11,
144926
144949
  }
144927
144950
  await import_fs_extra12.default.mkdirp(dest);
144928
144951
  const ops = [];
144929
- const { files, filePathMap } = filesWithoutFsRefs(
144952
+ const sharedDest = (0, import_path21.join)(outputDir, "shared");
144953
+ const { files, filePathMap, shared } = filesWithoutFsRefs(
144930
144954
  edgeFunction.files,
144931
- repoRootPath
144955
+ repoRootPath,
144956
+ sharedDest,
144957
+ standalone
144932
144958
  );
144933
144959
  ops.push((0, import_build_utils11.download)(files, dest));
144960
+ if (shared) {
144961
+ ops.push((0, import_build_utils11.download)(shared, sharedDest));
144962
+ }
144934
144963
  const config2 = {
144935
144964
  runtime: "edge",
144936
144965
  ...edgeFunction,
@@ -144947,7 +144976,7 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path11,
144947
144976
  );
144948
144977
  await Promise.all(ops);
144949
144978
  }
144950
- async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConfiguration, existingFunctions) {
144979
+ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConfiguration, existingFunctions, standalone = false) {
144951
144980
  const dest = (0, import_path21.join)(outputDir, "functions", `${path11}.func`);
144952
144981
  if (existingFunctions) {
144953
144982
  if (await writeFunctionSymlink(outputDir, dest, lambda, existingFunctions)) {
@@ -144959,9 +144988,18 @@ async function writeLambda(repoRootPath, outputDir, lambda, path11, functionConf
144959
144988
  const ops = [];
144960
144989
  let filePathMap;
144961
144990
  if (lambda.files) {
144962
- const f = filesWithoutFsRefs(lambda.files, repoRootPath);
144991
+ const sharedDest = (0, import_path21.join)(outputDir, "shared");
144992
+ const f = filesWithoutFsRefs(
144993
+ lambda.files,
144994
+ repoRootPath,
144995
+ sharedDest,
144996
+ standalone
144997
+ );
144963
144998
  filePathMap = f.filePathMap;
144964
144999
  ops.push((0, import_build_utils11.download)(f.files, dest));
145000
+ if (f.shared) {
145001
+ ops.push((0, import_build_utils11.download)(f.shared, sharedDest));
145002
+ }
144965
145003
  } else if (lambda.zipBuffer) {
144966
145004
  ops.push(unzip(lambda.zipBuffer, dest));
144967
145005
  } else {
@@ -145053,21 +145091,29 @@ async function* findDirs(name, dir, root = dir) {
145053
145091
  }
145054
145092
  }
145055
145093
  }
145056
- function filesWithoutFsRefs(files, repoRootPath) {
145094
+ function filesWithoutFsRefs(files, repoRootPath, sharedDest, standalone) {
145057
145095
  let filePathMap;
145058
145096
  const out = {};
145097
+ const shared = {};
145059
145098
  for (const [path11, file] of Object.entries(files)) {
145060
145099
  if (file.type === "FileFsRef") {
145061
145100
  if (!filePathMap)
145062
145101
  filePathMap = {};
145063
- filePathMap[(0, import_build_utils11.normalizePath)(path11)] = (0, import_build_utils11.normalizePath)(
145064
- (0, import_path21.relative)(repoRootPath, file.fsPath)
145065
- );
145102
+ if (standalone && sharedDest) {
145103
+ shared[path11] = file;
145104
+ filePathMap[(0, import_build_utils11.normalizePath)(path11)] = (0, import_build_utils11.normalizePath)(
145105
+ (0, import_path21.relative)(repoRootPath, (0, import_path21.join)(sharedDest, path11))
145106
+ );
145107
+ } else {
145108
+ filePathMap[(0, import_build_utils11.normalizePath)(path11)] = (0, import_build_utils11.normalizePath)(
145109
+ (0, import_path21.relative)(repoRootPath, file.fsPath)
145110
+ );
145111
+ }
145066
145112
  } else {
145067
145113
  out[path11] = file;
145068
145114
  }
145069
145115
  }
145070
- return { files: out, filePathMap };
145116
+ return { files: out, filePathMap, shared };
145071
145117
  }
145072
145118
  var import_fs_extra12, import_mime_types, import_path21, import_build_utils11, import_promisepipe2, import_client3, normalize2, OUTPUT_DIR;
145073
145119
  var init_write_build_result = __esm({
@@ -145335,6 +145381,11 @@ var init_build = __esm({
145335
145381
  this.trackCliFlag("yes");
145336
145382
  }
145337
145383
  }
145384
+ trackCliFlagStandalone(flag) {
145385
+ if (flag) {
145386
+ this.trackCliFlag("standalone");
145387
+ }
145388
+ }
145338
145389
  };
145339
145390
  }
145340
145391
  });
@@ -146710,6 +146761,7 @@ async function main3(client2) {
146710
146761
  flags: parsedArgs.flags
146711
146762
  }) || "preview";
146712
146763
  const yes = Boolean(parsedArgs.flags["--yes"]);
146764
+ const standalone = process.env.VERCEL_EXPERIMENTAL_STANDALONE_BUILD === "1";
146713
146765
  try {
146714
146766
  await (0, import_build_utils13.validateNpmrc)(cwd);
146715
146767
  } catch (err) {
@@ -146816,7 +146868,7 @@ async function main3(client2) {
146816
146868
  process.env.NOW_BUILDER = "1";
146817
146869
  try {
146818
146870
  await rootSpan.child("vc.doBuild").trace(
146819
- (span) => doBuild(client2, project, buildsJson, cwd, outputDir, span)
146871
+ (span) => doBuild(client2, project, buildsJson, cwd, outputDir, span, standalone)
146820
146872
  );
146821
146873
  } finally {
146822
146874
  await rootSpan.stop();
@@ -146849,7 +146901,7 @@ async function main3(client2) {
146849
146901
  }
146850
146902
  }
146851
146903
  }
146852
- async function doBuild(client2, project, buildsJson, cwd, outputDir, span) {
146904
+ async function doBuild(client2, project, buildsJson, cwd, outputDir, span, standalone = false) {
146853
146905
  const { localConfigPath } = client2;
146854
146906
  const workPath = (0, import_path27.join)(cwd, project.settings.rootDirectory || ".");
146855
146907
  const [pkg, vercelConfig, nowConfig, hasInstrumentation] = await Promise.all([
@@ -147085,7 +147137,8 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir, span) {
147085
147137
  build2,
147086
147138
  builder,
147087
147139
  builderPkg,
147088
- localConfig
147140
+ localConfig,
147141
+ standalone
147089
147142
  )
147090
147143
  ).then(
147091
147144
  (override) => {
@@ -151041,7 +151094,8 @@ ${err.stack}`);
151041
151094
  printError(err);
151042
151095
  return 1;
151043
151096
  }
151044
- const guidanceMode = parsedArguments.flags["--guidance"] ?? await (0, import_detect_agent.determineAgent)() !== false;
151097
+ const { isAgent } = await (0, import_detect_agent.determineAgent)();
151098
+ const guidanceMode = parsedArguments.flags["--guidance"] ?? isAgent;
151045
151099
  return printDeploymentStatus(deployment, deployStamp, noWait, guidanceMode);
151046
151100
  };
151047
151101
  addProcessEnv = async (log2, env) => {
@@ -174373,7 +174427,8 @@ async function add4(client2, argv) {
174373
174427
  )}
174374
174428
  `
174375
174429
  );
174376
- const guidanceMode = parsedArgs.flags["--guidance"] ?? await (0, import_detect_agent2.determineAgent)() !== false;
174430
+ const { isAgent } = await (0, import_detect_agent2.determineAgent)();
174431
+ const guidanceMode = parsedArgs.flags["--guidance"] ?? isAgent;
174377
174432
  if (guidanceMode) {
174378
174433
  suggestNextCommands([getCommandName(`env ls`), getCommandName(`env pull`)]);
174379
174434
  }
@@ -174558,7 +174613,8 @@ async function ls5(client2, argv) {
174558
174613
  client2.stdout.write(`${getTable(link4, envs, customEnvs)}
174559
174614
  `);
174560
174615
  }
174561
- const guidanceMode = parsedArgs.flags["--guidance"] ?? await (0, import_detect_agent3.determineAgent)() !== false;
174616
+ const { isAgent } = await (0, import_detect_agent3.determineAgent)();
174617
+ const guidanceMode = parsedArgs.flags["--guidance"] ?? isAgent;
174562
174618
  if (guidanceMode) {
174563
174619
  suggestNextCommands([
174564
174620
  getCommandName(`env add`),
@@ -186027,8 +186083,8 @@ var main17 = async () => {
186027
186083
  store: telemetryEventStore
186028
186084
  }
186029
186085
  });
186030
- const agent = await (0, import_detect_agent4.determineAgent)();
186031
- telemetry2.trackAgenticUse(agent);
186086
+ const { agent } = await (0, import_detect_agent4.determineAgent)();
186087
+ telemetry2.trackAgenticUse(agent?.name);
186032
186088
  telemetry2.trackCPUs();
186033
186089
  telemetry2.trackPlatform();
186034
186090
  telemetry2.trackArch();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "48.1.0",
3
+ "version": "48.1.2",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -23,22 +23,22 @@
23
23
  "dependencies": {
24
24
  "@vercel/blob": "1.0.2",
25
25
  "@vercel/build-utils": "12.1.0",
26
- "@vercel/detect-agent": "0.2.0",
27
26
  "@vercel/fun": "1.1.6",
28
27
  "@vercel/go": "3.2.3",
29
- "@vercel/express": "0.0.17",
30
- "@vercel/hono": "0.1.1",
31
- "@vercel/h3": "0.1.1",
28
+ "@vercel/express": "0.0.18",
29
+ "@vercel/hono": "0.1.2",
30
+ "@vercel/h3": "0.1.2",
32
31
  "@vercel/hydrogen": "1.2.4",
33
32
  "@vercel/next": "4.12.6",
34
- "@vercel/node": "5.3.23",
33
+ "@vercel/node": "5.3.24",
35
34
  "@vercel/python": "5.0.5",
36
35
  "@vercel/redwood": "2.3.6",
37
36
  "@vercel/remix-builder": "5.4.12",
38
37
  "@vercel/ruby": "2.2.1",
39
38
  "@vercel/static-build": "2.7.23",
40
39
  "chokidar": "4.0.0",
41
- "jose": "5.9.6"
40
+ "jose": "5.9.6",
41
+ "@vercel/detect-agent": "1.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@alex_neo/jest-expect-message": "1.0.5",
@@ -84,10 +84,9 @@
84
84
  "@types/write-json-file": "2.2.1",
85
85
  "@types/yauzl-promise": "2.1.0",
86
86
  "@vercel/client": "17.0.0",
87
- "@vercel/detect-agent": "0.2.0",
88
87
  "@vercel/error-utils": "2.0.3",
89
- "@vercel/frameworks": "3.9.1",
90
- "@vercel/fs-detectors": "5.5.5",
88
+ "@vercel/frameworks": "3.9.2",
89
+ "@vercel/fs-detectors": "5.5.6",
91
90
  "@vercel/routing-utils": "5.1.1",
92
91
  "@vitest/expect": "2.1.3",
93
92
  "ajv": "6.12.3",