vercel 35.0.3 → 35.2.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 (2) hide show
  1. package/dist/index.js +168 -58
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ var require_dist2 = __commonJS2({
96
96
  __export4(src_exports2, {
97
97
  errorToString: () => errorToString13,
98
98
  isErrnoException: () => isErrnoException21,
99
- isError: () => isError14,
99
+ isError: () => isError15,
100
100
  isErrorLike: () => isErrorLike,
101
101
  isObject: () => isObject,
102
102
  isSpawnError: () => isSpawnError2,
@@ -105,22 +105,22 @@ var require_dist2 = __commonJS2({
105
105
  module2.exports = __toCommonJS4(src_exports2);
106
106
  var import_node_util = __toESM4(require("util"));
107
107
  var isObject = (obj) => typeof obj === "object" && obj !== null;
108
- var isError14 = (error4) => {
108
+ var isError15 = (error4) => {
109
109
  return import_node_util.default.types.isNativeError(error4);
110
110
  };
111
111
  var isErrnoException21 = (error4) => {
112
- return isError14(error4) && "code" in error4;
112
+ return isError15(error4) && "code" in error4;
113
113
  };
114
114
  var isErrorLike = (error4) => isObject(error4) && "message" in error4;
115
115
  var errorToString13 = (error4, fallback) => {
116
- if (isError14(error4) || isErrorLike(error4))
116
+ if (isError15(error4) || isErrorLike(error4))
117
117
  return error4.message;
118
118
  if (typeof error4 === "string")
119
119
  return error4;
120
120
  return fallback ?? "An unknown error has ocurred.";
121
121
  };
122
122
  var normalizeError3 = (error4) => {
123
- if (isError14(error4))
123
+ if (isError15(error4))
124
124
  return error4;
125
125
  const errorMessage = errorToString13(error4);
126
126
  return isErrorLike(error4) ? Object.assign(new Error(errorMessage), error4) : new Error(errorMessage);
@@ -6204,7 +6204,7 @@ var require_error = __commonJS2({
6204
6204
  var require_is = __commonJS2({
6205
6205
  "../../node_modules/.pnpm/@sentry+utils@5.5.0/node_modules/@sentry/utils/dist/is.js"(exports2) {
6206
6206
  Object.defineProperty(exports2, "__esModule", { value: true });
6207
- function isError14(wat) {
6207
+ function isError15(wat) {
6208
6208
  switch (Object.prototype.toString.call(wat)) {
6209
6209
  case "[object Error]":
6210
6210
  return true;
@@ -6216,7 +6216,7 @@ var require_is = __commonJS2({
6216
6216
  return wat instanceof Error;
6217
6217
  }
6218
6218
  }
6219
- exports2.isError = isError14;
6219
+ exports2.isError = isError15;
6220
6220
  function isErrorEvent(wat) {
6221
6221
  return Object.prototype.toString.call(wat) === "[object ErrorEvent]";
6222
6222
  }
@@ -30929,10 +30929,10 @@ var require_util2 = __commonJS2({
30929
30929
  return objectToString(d) === "[object Date]";
30930
30930
  }
30931
30931
  exports2.isDate = isDate;
30932
- function isError14(e2) {
30932
+ function isError15(e2) {
30933
30933
  return objectToString(e2) === "[object Error]" || e2 instanceof Error;
30934
30934
  }
30935
- exports2.isError = isError14;
30935
+ exports2.isError = isError15;
30936
30936
  function isFunction(arg2) {
30937
30937
  return typeof arg2 === "function";
30938
30938
  }
@@ -62540,7 +62540,7 @@ var require_package = __commonJS2({
62540
62540
  "../client/package.json"(exports2, module2) {
62541
62541
  module2.exports = {
62542
62542
  name: "@vercel/client",
62543
- version: "13.3.2",
62543
+ version: "13.3.3",
62544
62544
  main: "dist/index.js",
62545
62545
  typings: "dist/index.d.ts",
62546
62546
  homepage: "https://vercel.com",
@@ -62577,7 +62577,7 @@ var require_package = __commonJS2({
62577
62577
  typescript: "4.9.5"
62578
62578
  },
62579
62579
  dependencies: {
62580
- "@vercel/build-utils": "8.3.4",
62580
+ "@vercel/build-utils": "8.3.5",
62581
62581
  "@vercel/error-utils": "2.0.2",
62582
62582
  "@vercel/routing-utils": "3.1.0",
62583
62583
  "@zeit/fetch": "5.2.0",
@@ -64828,10 +64828,10 @@ var require_util4 = __commonJS2({
64828
64828
  return objectToString(d) === "[object Date]";
64829
64829
  }
64830
64830
  exports2.isDate = isDate;
64831
- function isError14(e2) {
64831
+ function isError15(e2) {
64832
64832
  return objectToString(e2) === "[object Error]" || e2 instanceof Error;
64833
64833
  }
64834
- exports2.isError = isError14;
64834
+ exports2.isError = isError15;
64835
64835
  function isFunction(arg2) {
64836
64836
  return typeof arg2 === "function";
64837
64837
  }
@@ -120569,6 +120569,48 @@ var require_frameworks = __commonJS2({
120569
120569
  }
120570
120570
  ]
120571
120571
  },
120572
+ {
120573
+ name: "FastHTML (Experimental)",
120574
+ slug: "fasthtml",
120575
+ demo: "https://fasthtml-template.vercel.app",
120576
+ logo: "https://api-frameworks.vercel.sh/framework-logos/fasthtml.svg",
120577
+ tagline: "The fastest way to create an HTML app",
120578
+ description: "A library for writing fast and scalable Starlette-powered web applications",
120579
+ website: "https://fastht.ml",
120580
+ useRuntime: { src: "main.py", use: "@vercel/python" },
120581
+ detectors: {
120582
+ every: [
120583
+ {
120584
+ path: "main.py"
120585
+ }
120586
+ ]
120587
+ },
120588
+ settings: {
120589
+ installCommand: {
120590
+ placeholder: "`pip install`"
120591
+ },
120592
+ buildCommand: {
120593
+ placeholder: "None",
120594
+ value: null
120595
+ },
120596
+ devCommand: {
120597
+ value: "uvicorn main:app --reload"
120598
+ },
120599
+ outputDirectory: {
120600
+ value: "N/A"
120601
+ }
120602
+ },
120603
+ getOutputDirName: async () => "",
120604
+ defaultRoutes: [
120605
+ {
120606
+ handle: "filesystem"
120607
+ },
120608
+ {
120609
+ src: "/(.*)",
120610
+ dest: "/main"
120611
+ }
120612
+ ]
120613
+ },
120572
120614
  {
120573
120615
  name: "Sanity",
120574
120616
  slug: "sanity",
@@ -142934,6 +142976,7 @@ async function displayRuntimeLogs(client2, options, abortController) {
142934
142976
  }
142935
142977
  const handleData = (data) => {
142936
142978
  let log3 = parse5 ? data : JSON.parse(data);
142979
+ stopSpinner();
142937
142980
  if (isRuntimeLimitDelimiter(log3)) {
142938
142981
  abortController.abort();
142939
142982
  warn(`${import_chalk44.default.bold(log3.message)}
@@ -142971,18 +143014,11 @@ async function displayRuntimeLogs(client2, options, abortController) {
142971
143014
  function printBuildLog(log2, print) {
142972
143015
  if (!log2.created)
142973
143016
  return;
142974
- let data;
142975
- data = (log2.text || "").replace(/\n$/, "").replace(/^\n/, "").replace(/\x1b\[1000D/g, "").replace(/\x1b\[0K/g, "").replace(/\x1b\[1A/g, "");
142976
- if (/warning/i.test(data)) {
142977
- data = import_chalk44.default.yellow(data);
142978
- } else if (log2.type === "stderr") {
142979
- data = import_chalk44.default.red(data);
142980
- }
142981
143017
  const date = new Date(log2.created).toISOString();
142982
- data.split("\n").forEach((line) => {
143018
+ for (const line of colorize(sanitize(log2)).split("\n")) {
142983
143019
  print(`${import_chalk44.default.dim(date)} ${line.replace("[now-builder-debug] ", "")}
142984
143020
  `);
142985
- });
143021
+ }
142986
143022
  }
142987
143023
  function isRuntimeLimitDelimiter(log2) {
142988
143024
  return log2.rowId === "" && log2.level === "error" && log2.source === "delimiter";
@@ -143043,6 +143079,25 @@ function getSourceIcon(source) {
143043
143079
  return "\u0192";
143044
143080
  return " ";
143045
143081
  }
143082
+ function sanitize(log2) {
143083
+ return (log2.text || "").replace(/\n$/, "").replace(/^\n/, "").replace(/\x1b\[1000D/g, "").replace(/\x1b\[0K/g, "").replace(/\x1b\[1A/g, "");
143084
+ }
143085
+ function colorize(text2) {
143086
+ if (isError7(text2)) {
143087
+ return import_chalk44.default.red(text2);
143088
+ }
143089
+ return isWarning(text2) ? import_chalk44.default.yellow(text2) : text2;
143090
+ }
143091
+ function isError7(text2) {
143092
+ return /^(\s+⨯\s+|\s+at\s+|npm err!)/i.test(text2) || /(^| |\[|eval|internal|range|reference|syntax|type|uri|fetch)err(or)?( |:)/i.test(
143093
+ text2
143094
+ ) || /(command not found|module not found|failed to compile|cannot open shared object file|err_pnpm_|please contact vercel.com\/help|exit code 1|elifecycle|exited)/i.test(
143095
+ text2
143096
+ );
143097
+ }
143098
+ function isWarning(text2) {
143099
+ return /^warn(ing)?(:|!)/i.test(text2) && !text2.includes("deprecationwarning");
143100
+ }
143046
143101
  var import_chalk44, import_date_fns, import_ms7, import_jsonlines2, import_split2, import_url13, runtimeLogSpinnerMessage, dateTimeFormat, moreSymbol, statusWidth;
143047
143102
  var init_logs = __esm({
143048
143103
  "src/util/logs.ts"() {
@@ -147921,7 +147976,8 @@ function sortBuilders(builds) {
147921
147976
  const frontendRuntimeSet2 = new Set(
147922
147977
  import_frameworks3.frameworkList.map((f) => f.useRuntime?.use || "@vercel/static-build")
147923
147978
  );
147924
- const toNumber = (build2) => frontendRuntimeSet2.has(build2.use) ? 0 : 1;
147979
+ frontendRuntimeSet2.delete("@vercel/python");
147980
+ const toNumber = (build2) => build2.use === "@vercel/python" ? 1 : frontendRuntimeSet2.has(build2.use) ? 0 : 2;
147925
147981
  return builds.sort((build1, build2) => {
147926
147982
  return toNumber(build1) - toNumber(build2);
147927
147983
  });
@@ -148163,6 +148219,13 @@ var init_command5 = __esm({
148163
148219
  type: Boolean,
148164
148220
  deprecated: false
148165
148221
  },
148222
+ {
148223
+ name: "target",
148224
+ shorthand: null,
148225
+ type: String,
148226
+ deprecated: false,
148227
+ description: "Specify the target environment"
148228
+ },
148166
148229
  {
148167
148230
  name: "output",
148168
148231
  description: "Directory where built assets should be written to",
@@ -148213,6 +148276,35 @@ var init_scrub_argv = __esm({
148213
148276
  }
148214
148277
  });
148215
148278
 
148279
+ // src/util/parse-target.ts
148280
+ function parseTarget({
148281
+ output: output2,
148282
+ targetFlagName,
148283
+ targetFlagValue,
148284
+ prodFlagValue
148285
+ }) {
148286
+ if (prodFlagValue && targetFlagValue) {
148287
+ output2.warn(
148288
+ `Both \`--prod\` and \`--${targetFlagName}\` detected. Ignoring \`--prod\`.`
148289
+ );
148290
+ }
148291
+ if (targetFlagValue) {
148292
+ const lowerCaseTarget = targetFlagValue.toLowerCase();
148293
+ output2.debug(`Setting target to ${lowerCaseTarget}`);
148294
+ return lowerCaseTarget;
148295
+ }
148296
+ if (prodFlagValue) {
148297
+ output2.debug("Setting target to production");
148298
+ return "production";
148299
+ }
148300
+ return void 0;
148301
+ }
148302
+ var init_parse_target = __esm({
148303
+ "src/util/parse-target.ts"() {
148304
+ "use strict";
148305
+ }
148306
+ });
148307
+
148216
148308
  // src/commands/build/index.ts
148217
148309
  var build_exports = {};
148218
148310
  __export3(build_exports, {
@@ -148248,7 +148340,12 @@ async function main2(client2) {
148248
148340
  output2.print(help2(buildCommand, { columns: client2.stderr.columns }));
148249
148341
  return 2;
148250
148342
  }
148251
- const target = parsedArgs.flags["--prod"] ? "production" : "preview";
148343
+ const target = parseTarget({
148344
+ output: output2,
148345
+ targetFlagName: "target",
148346
+ targetFlagValue: parsedArgs.flags["--target"],
148347
+ prodFlagValue: parsedArgs.flags["--prod"]
148348
+ }) || "preview";
148252
148349
  const yes = Boolean(parsedArgs.flags["--yes"]);
148253
148350
  try {
148254
148351
  await (0, import_build_utils13.validateNpmrc)(cwd);
@@ -148538,6 +148635,15 @@ async function doBuild(client2, project, buildsJson, cwd, outputDir) {
148538
148635
  let buildResult;
148539
148636
  try {
148540
148637
  buildResult = await builder.build(buildOptions);
148638
+ if (buildConfig.zeroConfig && buildConfig.framework && "output" in buildResult && !buildResult.routes) {
148639
+ const framework2 = import_frameworks4.frameworkList.find(
148640
+ (f) => f.slug === buildConfig.framework
148641
+ );
148642
+ if (framework2) {
148643
+ const defaultRoutes = await getFrameworkRoutes(framework2, workPath);
148644
+ buildResult.routes = defaultRoutes;
148645
+ }
148646
+ }
148541
148647
  } finally {
148542
148648
  try {
148543
148649
  Object.assign(diagnostics, await builder.diagnostics?.(buildOptions));
@@ -148804,6 +148910,15 @@ async function writeFlagsJSON({ output: output2 }, buildResults, outputDir) {
148804
148910
  async function writeBuildJson(buildsJson, outputDir) {
148805
148911
  await import_fs_extra18.default.writeJSON((0, import_path28.join)(outputDir, "builds.json"), buildsJson, { spaces: 2 });
148806
148912
  }
148913
+ async function getFrameworkRoutes(framework, dirPrefix) {
148914
+ let routes2 = [];
148915
+ if (typeof framework.defaultRoutes === "function") {
148916
+ routes2 = await framework.defaultRoutes(dirPrefix);
148917
+ } else if (Array.isArray(framework.defaultRoutes)) {
148918
+ routes2 = framework.defaultRoutes;
148919
+ }
148920
+ return routes2;
148921
+ }
148807
148922
  var import_fs_extra18, import_chalk49, import_dotenv, import_semver3, import_minimatch2, import_path28, import_frameworks4, import_build_utils13, import_fs_detectors4, import_routing_utils2, import_client8;
148808
148923
  var init_build = __esm({
148809
148924
  "src/commands/build/index.ts"() {
@@ -148843,6 +148958,7 @@ var init_build = __esm({
148843
148958
  init_command5();
148844
148959
  init_scrub_argv();
148845
148960
  init_get_flags_specification();
148961
+ init_parse_target();
148846
148962
  }
148847
148963
  });
148848
148964
 
@@ -149710,29 +149826,6 @@ var init_get_prebuilt_json = __esm({
149710
149826
  }
149711
149827
  });
149712
149828
 
149713
- // src/util/deploy/parse-target.ts
149714
- function parseTarget(output2, targetArg, prodArg) {
149715
- if (targetArg) {
149716
- if (targetArg === "production") {
149717
- output2.warn(
149718
- "We recommend using the much shorter `--prod` option instead of `--target production` (deprecated)"
149719
- );
149720
- }
149721
- output2.debug(`Setting target to ${targetArg}`);
149722
- return targetArg;
149723
- }
149724
- if (prodArg) {
149725
- output2.debug("Setting target to production");
149726
- return "production";
149727
- }
149728
- return void 0;
149729
- }
149730
- var init_parse_target = __esm({
149731
- "src/util/deploy/parse-target.ts"() {
149732
- "use strict";
149733
- }
149734
- });
149735
-
149736
149829
  // src/util/deploy/is-deploying.ts
149737
149830
  function isDeploying(readyState) {
149738
149831
  return deploymentInProgressStates.includes(readyState);
@@ -150123,7 +150216,6 @@ var init_deploy = __esm({
150123
150216
  init_create_deploy();
150124
150217
  init_get_deployment_checks();
150125
150218
  init_get_prebuilt_json();
150126
- init_parse_target();
150127
150219
  init_print_deployment_status();
150128
150220
  init_validate_archive_format();
150129
150221
  init_purchase_domain_if_available();
@@ -150153,6 +150245,7 @@ var init_deploy = __esm({
150153
150245
  init_validate_paths();
150154
150246
  init_help();
150155
150247
  init_command7();
150248
+ init_parse_target();
150156
150249
  deploy_default = async (client2) => {
150157
150250
  const { output: output2 } = client2;
150158
150251
  let parsedArguments = null;
@@ -150232,14 +150325,12 @@ var init_deploy = __esm({
150232
150325
  `
150233
150326
  );
150234
150327
  }
150235
- const target = parseTarget(
150236
- output2,
150237
- parsedArguments.flags["--target"],
150238
- parsedArguments.flags["--prod"]
150239
- );
150240
- if (typeof target === "number") {
150241
- return target;
150242
- }
150328
+ const target = parseTarget({
150329
+ output: output2,
150330
+ targetFlagName: "target",
150331
+ targetFlagValue: parsedArguments.flags["--target"],
150332
+ prodFlagValue: parsedArguments.flags["--prod"]
150333
+ });
150243
150334
  const archive = parsedArguments.flags["--archive"];
150244
150335
  if (typeof archive === "string" && !isValidArchive(archive)) {
150245
150336
  output2.error(`Format must be one of: ${import_client10.VALID_ARCHIVE_FORMATS.join(", ")}`);
@@ -173300,7 +173391,11 @@ async function main6(client2) {
173300
173391
  const subArgs = argv2._.slice(1);
173301
173392
  const { subcommand: subcommand2, args: args2 } = getSubcommand(subArgs, COMMAND_CONFIG6);
173302
173393
  const { cwd, output: output2, config: config3 } = client2;
173303
- const target = argv2["--environment"]?.toLowerCase() || "development";
173394
+ const target = parseTarget({
173395
+ output: output2,
173396
+ targetFlagName: "environment",
173397
+ targetFlagValue: argv2["--environment"]
173398
+ }) || "development";
173304
173399
  if (!isValidEnvTarget(target)) {
173305
173400
  output2.error(
173306
173401
  `Invalid environment \`${import_chalk83.default.cyan(
@@ -173368,6 +173463,7 @@ var init_env = __esm({
173368
173463
  init_pull();
173369
173464
  init_rm5();
173370
173465
  init_command11();
173466
+ init_parse_target();
173371
173467
  COMMAND_CONFIG6 = {
173372
173468
  ls: ["ls", "list"],
173373
173469
  add: ["add"],
@@ -175124,7 +175220,12 @@ async function list2(client2) {
175124
175220
  }
175125
175221
  const autoConfirm = !!argv2["--yes"];
175126
175222
  const meta = parseMeta(argv2["--meta"]);
175127
- const target = argv2["--prod"] ? "production" : typeof argv2["--environment"] === "string" ? argv2["--environment"].toLowerCase() : void 0;
175223
+ const target = parseTarget({
175224
+ output: output2,
175225
+ targetFlagName: "environment",
175226
+ targetFlagValue: argv2["--environment"],
175227
+ prodFlagValue: argv2["--prod"]
175228
+ });
175128
175229
  let link4 = await getLinkedProject(client2, cwd);
175129
175230
  if (link4.status === "error") {
175130
175231
  return link4.exitCode;
@@ -175368,6 +175469,7 @@ var init_list2 = __esm({
175368
175469
  import_error_utils25 = __toESM3(require_dist2());
175369
175470
  init_help();
175370
175471
  init_command16();
175472
+ init_parse_target();
175371
175473
  }
175372
175474
  });
175373
175475
 
@@ -175408,6 +175510,13 @@ async function logs(client2) {
175408
175510
  }
175409
175511
  const asJson = parsedArguments.flags["--json"];
175410
175512
  let [deploymentIdOrHost] = parsedArguments.args;
175513
+ if (!deploymentIdOrHost) {
175514
+ error4(
175515
+ `${getCommandName("logs <deployment>")} expects exactly one argument`
175516
+ );
175517
+ print(help2(logsCommand, { columns: client2.stderr.columns }));
175518
+ return 1;
175519
+ }
175411
175520
  let contextName = null;
175412
175521
  try {
175413
175522
  ({ contextName } = await getScope(client2));
@@ -175483,6 +175592,7 @@ var init_logs2 = __esm({
175483
175592
  init_get_scope();
175484
175593
  init_logs();
175485
175594
  init_param();
175595
+ init_pkg_name();
175486
175596
  init_help();
175487
175597
  init_list2();
175488
175598
  init_command3();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vercel",
3
- "version": "35.0.3",
3
+ "version": "35.2.0",
4
4
  "preferGlobal": true,
5
5
  "license": "Apache-2.0",
6
6
  "description": "The command-line interface for Vercel",
@@ -21,17 +21,17 @@
21
21
  "node": ">= 16"
22
22
  },
23
23
  "dependencies": {
24
- "@vercel/build-utils": "8.3.4",
24
+ "@vercel/build-utils": "8.3.5",
25
25
  "@vercel/fun": "1.1.0",
26
26
  "@vercel/go": "3.1.1",
27
27
  "@vercel/hydrogen": "1.0.4",
28
28
  "@vercel/next": "4.3.6",
29
- "@vercel/node": "3.2.6",
29
+ "@vercel/node": "3.2.7",
30
30
  "@vercel/python": "4.3.0",
31
31
  "@vercel/redwood": "2.1.3",
32
32
  "@vercel/remix-builder": "2.2.1",
33
33
  "@vercel/ruby": "2.1.0",
34
- "@vercel/static-build": "2.5.16",
34
+ "@vercel/static-build": "2.5.17",
35
35
  "chokidar": "3.3.1"
36
36
  },
37
37
  "devDependencies": {
@@ -82,11 +82,11 @@
82
82
  "@types/yauzl-promise": "2.1.0",
83
83
  "@vercel-internals/constants": "1.0.4",
84
84
  "@vercel-internals/get-package-json": "1.0.0",
85
- "@vercel-internals/types": "1.0.43",
86
- "@vercel/client": "13.3.2",
85
+ "@vercel-internals/types": "1.0.44",
86
+ "@vercel/client": "13.3.3",
87
87
  "@vercel/error-utils": "2.0.2",
88
- "@vercel/frameworks": "3.0.3",
89
- "@vercel/fs-detectors": "5.2.5",
88
+ "@vercel/frameworks": "3.1.0",
89
+ "@vercel/fs-detectors": "5.2.6",
90
90
  "@vercel/routing-utils": "3.1.0",
91
91
  "@vitest/expect": "1.4.0",
92
92
  "ajv": "6.12.2",