vercel-cli 48.2.2__py3-none-any.whl → 48.2.6__py3-none-any.whl

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.

Potentially problematic release.


This version of vercel-cli might be problematic. Click here for more details.

@@ -31623,16 +31623,14 @@ var init_command3 = __esm({
31623
31623
  {
31624
31624
  ...yesOption,
31625
31625
  description: "Skip the confirmation prompt about pulling environment variables and project settings when not found locally"
31626
+ },
31627
+ {
31628
+ name: "standalone",
31629
+ description: "Create a standalone build with all dependencies inlined into function output folders",
31630
+ shorthand: null,
31631
+ type: Boolean,
31632
+ deprecated: false
31626
31633
  }
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
- // },
31636
31634
  ],
31637
31635
  examples: [
31638
31636
  {
@@ -49570,7 +49568,7 @@ var require_package = __commonJS2({
49570
49568
  "../client/package.json"(exports2, module2) {
49571
49569
  module2.exports = {
49572
49570
  name: "@vercel/client",
49573
- version: "17.0.1",
49571
+ version: "17.0.3",
49574
49572
  main: "dist/index.js",
49575
49573
  typings: "dist/index.d.ts",
49576
49574
  homepage: "https://vercel.com",
@@ -49609,7 +49607,7 @@ var require_package = __commonJS2({
49609
49607
  vitest: "2.0.1"
49610
49608
  },
49611
49609
  dependencies: {
49612
- "@vercel/build-utils": "12.1.0",
49610
+ "@vercel/build-utils": "12.1.2",
49613
49611
  "@vercel/error-utils": "2.0.3",
49614
49612
  "@vercel/microfrontends": "1.2.2",
49615
49613
  "@vercel/routing-utils": "5.2.0",
@@ -116362,6 +116360,57 @@ var require_frameworks = __commonJS2({
116362
116360
  }
116363
116361
  ]
116364
116362
  },
116363
+ {
116364
+ name: "Flask",
116365
+ slug: "flask",
116366
+ logo: "https://api-frameworks.vercel.sh/framework-logos/flask.svg",
116367
+ tagline: "The Python micro web framework",
116368
+ description: "A Flask app, ready for production",
116369
+ website: "https://flask.palletsprojects.com",
116370
+ useRuntime: { src: "index.py", use: "@vercel/python" },
116371
+ detectors: {
116372
+ some: [
116373
+ {
116374
+ path: "requirements.txt",
116375
+ matchContent: "flask"
116376
+ },
116377
+ {
116378
+ path: "pyproject.toml",
116379
+ matchContent: "flask"
116380
+ },
116381
+ {
116382
+ path: "Pipfile",
116383
+ matchContent: "flask"
116384
+ }
116385
+ ]
116386
+ },
116387
+ settings: {
116388
+ installCommand: {
116389
+ placeholder: "`pip install -r requirements.txt`"
116390
+ },
116391
+ buildCommand: {
116392
+ placeholder: "None",
116393
+ value: null
116394
+ },
116395
+ devCommand: {
116396
+ placeholder: "None",
116397
+ value: null
116398
+ },
116399
+ outputDirectory: {
116400
+ value: "N/A"
116401
+ }
116402
+ },
116403
+ getOutputDirName: async () => "public",
116404
+ defaultRoutes: [
116405
+ {
116406
+ handle: "filesystem"
116407
+ },
116408
+ {
116409
+ src: "/(.*)",
116410
+ dest: "/"
116411
+ }
116412
+ ]
116413
+ },
116365
116414
  {
116366
116415
  name: "FastHTML",
116367
116416
  slug: "fasthtml",
@@ -146855,6 +146904,7 @@ async function main3(client2) {
146855
146904
  telemetryClient.trackCliOptionTarget(parsedArgs.flags["--target"]);
146856
146905
  telemetryClient.trackCliFlagProd(parsedArgs.flags["--prod"]);
146857
146906
  telemetryClient.trackCliFlagYes(parsedArgs.flags["--yes"]);
146907
+ telemetryClient.trackCliFlagStandalone(parsedArgs.flags["--standalone"]);
146858
146908
  } catch (error3) {
146859
146909
  printError(error3);
146860
146910
  return 1;
@@ -146869,7 +146919,15 @@ async function main3(client2) {
146869
146919
  flags: parsedArgs.flags
146870
146920
  }) || "preview";
146871
146921
  const yes = Boolean(parsedArgs.flags["--yes"]);
146872
- const standalone = process.env.VERCEL_EXPERIMENTAL_STANDALONE_BUILD === "1";
146922
+ const hasDeprecatedEnvVar = process.env.VERCEL_EXPERIMENTAL_STANDALONE_BUILD === "1";
146923
+ if (hasDeprecatedEnvVar) {
146924
+ output_manager_default.warn(
146925
+ "The VERCEL_EXPERIMENTAL_STANDALONE_BUILD environment variable is deprecated. Please use the --standalone flag instead."
146926
+ );
146927
+ }
146928
+ const standalone = Boolean(
146929
+ parsedArgs.flags["--standalone"] || hasDeprecatedEnvVar
146930
+ );
146873
146931
  try {
146874
146932
  await (0, import_build_utils13.validateNpmrc)(cwd);
146875
146933
  } catch (err) {
@@ -3,9 +3,9 @@
3
3
  "requires": true,
4
4
  "packages": {
5
5
  "node_modules/@vercel/build-utils": {
6
- "version": "12.1.0",
7
- "resolved": "https://registry.npmjs.org/@vercel/build-utils/-/build-utils-12.1.0.tgz",
8
- "integrity": "sha512-yqpAh2KHm9iWUXo/aRWiLIxi8dMAwFtse2iZsg2QNEMs9W20va6L8PMFvdAa5MX9pgRwc38gbjD3V7drxSwq4g==",
6
+ "version": "12.1.2",
7
+ "resolved": "https://registry.npmjs.org/@vercel/build-utils/-/build-utils-12.1.2.tgz",
8
+ "integrity": "sha512-W0j2n9e65rr/fpzghTCgH4qFJgMX249hCQJmEdVzdKkXRlO6DfSqBljEHASCFaeBeumBdgS5jeSDixXyjKtdfw==",
9
9
  "license": "Apache-2.0"
10
10
  },
11
11
  "node_modules/@vercel/detect-agent": {
@@ -18,9 +18,9 @@
18
18
  }
19
19
  },
20
20
  "node_modules/@vercel/python": {
21
- "version": "5.0.7",
22
- "resolved": "https://registry.npmjs.org/@vercel/python/-/python-5.0.7.tgz",
23
- "integrity": "sha512-hswxQErqha3aLxPqdisPEN2WpN422OMbxK1O2DA8saPi1opRh1SjD9kFaPu74iY9H0lIjN+evQpBVeCFmn6n2g==",
21
+ "version": "5.0.8",
22
+ "resolved": "https://registry.npmjs.org/@vercel/python/-/python-5.0.8.tgz",
23
+ "integrity": "sha512-qCSb8xwwe/WO9Z7+4/q/Bc7lQB4TfLDnKf3pYKkreNzTyPT32S88QbLMSlpM9uVSidyDTGUSJQ1QQ5cuh9DuRQ==",
24
24
  "license": "Apache-2.0"
25
25
  }
26
26
  }
@@ -1,5 +1,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 12.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Reuse duplicated node builder logic ([#14031](https://github.com/vercel/vercel/pull/14031))
8
+
9
+ ## 12.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Change archive split from 100MB -> 20MB ([#14046](https://github.com/vercel/vercel/pull/14046))
14
+
3
15
  ## 12.1.0
4
16
 
5
17
  ### Minor Changes
@@ -56,7 +56,7 @@ function streamToBuffer(stream) {
56
56
  });
57
57
  }
58
58
  const MB = 1024 * 1024;
59
- async function streamToBufferChunks(stream, chunkSize = 100 * MB) {
59
+ async function streamToBufferChunks(stream, chunkSize = 20 * MB) {
60
60
  const chunks = [];
61
61
  let currentChunk = [];
62
62
  let currentSize = 0;
@@ -0,0 +1,11 @@
1
+ import { BuildV3 } from './types';
2
+ import type FileFsRef from './file-fs-ref';
3
+ export declare function generateNodeBuilderFunctions(frameworkName: string, regex: RegExp, validFilenames: string[], validExtensions: string[], nodeBuild: any): {
4
+ require_: NodeRequire;
5
+ findEntrypoint: (files: Record<string, FileFsRef>) => {
6
+ entrypoint: string;
7
+ entrypointsNotMatchingRegex: string[];
8
+ };
9
+ build: BuildV3;
10
+ entrypointCallback: (args: Parameters<BuildV3>[0]) => Promise<string>;
11
+ };
@@ -0,0 +1,196 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var generate_node_builder_functions_exports = {};
30
+ __export(generate_node_builder_functions_exports, {
31
+ generateNodeBuilderFunctions: () => generateNodeBuilderFunctions
32
+ });
33
+ module.exports = __toCommonJS(generate_node_builder_functions_exports);
34
+ var import_glob = __toESM(require("./fs/glob"));
35
+ var import_node_path = require("node:path");
36
+ var import_node_fs = __toESM(require("node:fs"));
37
+ var import_node_module = require("node:module");
38
+ function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, validExtensions, nodeBuild) {
39
+ const entrypointsForMessage = validFilenames.map((filename) => `- ${filename}.{${validExtensions.join(",")}}`).join("\n");
40
+ const require_ = (0, import_node_module.createRequire)(__filename);
41
+ const build = async (args) => {
42
+ process.env.EXPERIMENTAL_NODE_TYPESCRIPT_ERRORS = "1";
43
+ const includeFiles = ["views/**/*"];
44
+ const includeFilesFromConfig = args.config.includeFiles;
45
+ if (includeFilesFromConfig) {
46
+ includeFiles.push(...includeFilesFromConfig);
47
+ }
48
+ const res = await nodeBuild({
49
+ ...args,
50
+ config: {
51
+ ...args.config,
52
+ includeFiles
53
+ },
54
+ // this is package.json, but we'll replace it with the return value of the entrypointCallback
55
+ // after install and build scripts have had a chance to run
56
+ entrypoint: "package.json",
57
+ considerBuildCommand: true,
58
+ entrypointCallback: async () => {
59
+ return entrypointCallback(args);
60
+ }
61
+ });
62
+ let version = void 0;
63
+ try {
64
+ const resolved = require_.resolve(`${frameworkName}/package.json`, {
65
+ paths: [args.workPath]
66
+ });
67
+ const frameworkVersion = require_(resolved).version;
68
+ if (frameworkVersion) {
69
+ version = frameworkVersion;
70
+ }
71
+ } catch (e) {
72
+ }
73
+ res.output.framework = {
74
+ slug: frameworkName,
75
+ version
76
+ };
77
+ return res;
78
+ };
79
+ const entrypointCallback = async (args) => {
80
+ const mainPackageEntrypoint = findMainPackageEntrypoint(args.files);
81
+ const entrypointGlob = `{${validFilenames.map((entrypoint) => `${entrypoint}`).join(",")}}.{${validExtensions.join(",")}}`;
82
+ const dir = args.config.projectSettings?.outputDirectory?.replace(
83
+ /^\/+|\/+$/g,
84
+ ""
85
+ );
86
+ if (dir) {
87
+ const {
88
+ entrypoint: entrypointFromOutputDir,
89
+ entrypointsNotMatchingRegex: entrypointsNotMatchingRegex2
90
+ } = findEntrypoint(await (0, import_glob.default)(entrypointGlob, (0, import_node_path.join)(args.workPath, dir)));
91
+ if (entrypointFromOutputDir) {
92
+ return (0, import_node_path.join)(dir, entrypointFromOutputDir);
93
+ }
94
+ if (entrypointsNotMatchingRegex2.length > 0) {
95
+ throw new Error(
96
+ `No entrypoint found which imports ${frameworkName}. Found possible ${pluralize("entrypoint", entrypointsNotMatchingRegex2.length)}: ${entrypointsNotMatchingRegex2.join(", ")}`
97
+ );
98
+ }
99
+ throw new Error(
100
+ `No entrypoint found in output directory: "${dir}". Searched for:
101
+ ${entrypointsForMessage}`
102
+ );
103
+ }
104
+ const files = await (0, import_glob.default)(entrypointGlob, args.workPath);
105
+ const { entrypoint: entrypointFromRoot, entrypointsNotMatchingRegex } = findEntrypoint(files);
106
+ if (entrypointFromRoot) {
107
+ return entrypointFromRoot;
108
+ }
109
+ if (mainPackageEntrypoint) {
110
+ const entrypointFromPackageJson = await (0, import_glob.default)(
111
+ mainPackageEntrypoint,
112
+ args.workPath
113
+ );
114
+ if (entrypointFromPackageJson[mainPackageEntrypoint]) {
115
+ if (checkMatchesRegex(entrypointFromPackageJson[mainPackageEntrypoint])) {
116
+ return mainPackageEntrypoint;
117
+ }
118
+ }
119
+ }
120
+ if (entrypointsNotMatchingRegex.length > 0) {
121
+ throw new Error(
122
+ `No entrypoint found which imports ${frameworkName}. Found possible ${pluralize("entrypoint", entrypointsNotMatchingRegex.length)}: ${entrypointsNotMatchingRegex.join(", ")}`
123
+ );
124
+ }
125
+ throw new Error(
126
+ `No entrypoint found. Searched for:
127
+ ${entrypointsForMessage}`
128
+ );
129
+ };
130
+ function pluralize(word, count) {
131
+ return count === 1 ? word : `${word}s`;
132
+ }
133
+ const findEntrypoint = (files) => {
134
+ const allEntrypoints = validFilenames.flatMap(
135
+ (filename) => validExtensions.map((extension) => `${filename}.${extension}`)
136
+ );
137
+ const possibleEntrypointsInFiles = allEntrypoints.filter((entrypoint2) => {
138
+ return files[entrypoint2] !== void 0;
139
+ });
140
+ const entrypointsMatchingRegex = possibleEntrypointsInFiles.filter(
141
+ (entrypoint2) => {
142
+ const file = files[entrypoint2];
143
+ return checkMatchesRegex(file);
144
+ }
145
+ );
146
+ const entrypointsNotMatchingRegex = possibleEntrypointsInFiles.filter(
147
+ (entrypoint2) => {
148
+ const file = files[entrypoint2];
149
+ return !checkMatchesRegex(file);
150
+ }
151
+ );
152
+ const entrypoint = entrypointsMatchingRegex[0];
153
+ if (entrypointsMatchingRegex.length > 1) {
154
+ console.warn(
155
+ `Multiple entrypoints found: ${entrypointsMatchingRegex.join(", ")}. Using ${entrypoint}.`
156
+ );
157
+ }
158
+ return {
159
+ entrypoint,
160
+ entrypointsNotMatchingRegex
161
+ };
162
+ };
163
+ const checkMatchesRegex = (file) => {
164
+ const content = import_node_fs.default.readFileSync(file.fsPath, "utf-8");
165
+ const matchesContent = content.match(regex);
166
+ return matchesContent !== null;
167
+ };
168
+ const findMainPackageEntrypoint = (files) => {
169
+ const packageJson = files["package.json"];
170
+ if (packageJson) {
171
+ if (packageJson.type === "FileFsRef") {
172
+ const packageJsonContent = import_node_fs.default.readFileSync(packageJson.fsPath, "utf-8");
173
+ let packageJsonJson;
174
+ try {
175
+ packageJsonJson = JSON.parse(packageJsonContent);
176
+ } catch (_e) {
177
+ packageJsonJson = {};
178
+ }
179
+ if ("main" in packageJsonJson && typeof packageJsonJson.main === "string") {
180
+ return packageJsonJson.main;
181
+ }
182
+ }
183
+ }
184
+ return null;
185
+ };
186
+ return {
187
+ require_,
188
+ findEntrypoint,
189
+ build,
190
+ entrypointCallback
191
+ };
192
+ }
193
+ // Annotate the CommonJS export names for ESM import in node:
194
+ 0 && (module.exports = {
195
+ generateNodeBuilderFunctions
196
+ });
@@ -31,3 +31,4 @@ export * from './trace';
31
31
  export { NODE_VERSIONS } from './fs/node-version';
32
32
  export { getInstalledPackageVersion } from './get-installed-package-version';
33
33
  export { defaultCachePathGlob } from './default-cache-path-glob';
34
+ export { generateNodeBuilderFunctions } from './generate-node-builder-functions';