vercel-cli 41.1.0__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.
- vercel_cli/vendor/LICENSE +202 -0
- vercel_cli/vendor/README.md +63 -0
- vercel_cli/vendor/dist/VERCEL_DIR_README.txt +11 -0
- vercel_cli/vendor/dist/builder-worker.js +62 -0
- vercel_cli/vendor/dist/get-latest-worker.js +272 -0
- vercel_cli/vendor/dist/index.js +172693 -0
- vercel_cli/vendor/dist/vc.js +11 -0
- vercel_cli/vendor/node_modules/.package-lock.json +18 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/CHANGELOG.md +488 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/LICENSE +202 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/build.mjs +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.d.ts +10 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/clone-env.js +43 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/debug.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/default-cache-path-glob.js +28 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.d.ts +41 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/edge-function.js +40 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.d.ts +39 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/errors.js +95 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.d.ts +23 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-blob.js +67 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.d.ts +27 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-fs-ref.js +113 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.d.ts +38 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/file-ref.js +147 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.d.ts +9 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/download.js +136 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/get-writable-directory.js +32 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.d.ts +10 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/glob.js +111 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.d.ts +9 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/node-version.js +180 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.d.ts +4 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/normalize-path.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/read-config-file.js +76 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.d.ts +11 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/rename.js +30 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.d.ts +206 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/run-user-scripts.js +944 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/fs/stream-to-buffer.js +87 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-ignore-filter.js +90 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-installed-package-version.js +53 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.d.ts +5 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-platform-env.js +45 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.d.ts +14 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/get-prefixed-env-vars.js +51 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.d.ts +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/hard-link-dir.js +104 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.d.ts +33 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/index.js +24390 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.d.ts +81 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/lambda.js +231 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.d.ts +16 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/nodejs-lambda.js +44 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/os.js +62 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.d.ts +37 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/prerender.js +169 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.d.ts +60 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/schemas.js +87 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.d.ts +2 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/should-serve.js +47 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.d.ts +2 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/constants.js +31 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.d.ts +3 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/index.js +33 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.d.ts +37 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/trace/trace.js +92 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.d.ts +503 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/types.js +51 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.d.ts +12 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/dist/validate-npmrc.js +41 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-blob.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-fs-ref.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/file-ref.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/download.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/get-writable-directory.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/glob.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/rename.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/run-user-scripts.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/fs/stream-to-buffer.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/lambda.js +1 -0
- vercel_cli/vendor/node_modules/@vercel/build-utils/package.json +60 -0
- vercel_cli/vendor/node_modules/@vercel/python/LICENSE +202 -0
- vercel_cli/vendor/node_modules/@vercel/python/dist/index.js +3132 -0
- vercel_cli/vendor/node_modules/@vercel/python/package.json +36 -0
- vercel_cli/vendor/node_modules/@vercel/python/vc_init.py +681 -0
- vercel_cli/vendor/package.json +40 -0
- vercel_cli-41.1.0.dist-info/METADATA +188 -0
- vercel_cli-41.1.0.dist-info/RECORD +99 -0
- vercel_cli-41.1.0.dist-info/WHEEL +4 -0
- vercel_cli-41.1.0.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type FileRef from './file-ref';
|
|
3
|
+
import type FileFsRef from './file-fs-ref';
|
|
4
|
+
import type FileBlob from './file-blob';
|
|
5
|
+
import type { Lambda } from './lambda';
|
|
6
|
+
import type { Prerender } from './prerender';
|
|
7
|
+
import type { EdgeFunction } from './edge-function';
|
|
8
|
+
import type { Span } from './trace';
|
|
9
|
+
export interface Env {
|
|
10
|
+
[name: string]: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export type File = FileRef | FileFsRef | FileBlob;
|
|
13
|
+
export interface FileBase {
|
|
14
|
+
type: string;
|
|
15
|
+
mode: number;
|
|
16
|
+
contentType?: string;
|
|
17
|
+
toStream: () => NodeJS.ReadableStream;
|
|
18
|
+
toStreamAsync?: () => Promise<NodeJS.ReadableStream>;
|
|
19
|
+
}
|
|
20
|
+
export interface Files {
|
|
21
|
+
[filePath: string]: File;
|
|
22
|
+
}
|
|
23
|
+
export interface Config {
|
|
24
|
+
maxLambdaSize?: string;
|
|
25
|
+
includeFiles?: string | string[];
|
|
26
|
+
excludeFiles?: string | string[];
|
|
27
|
+
bundle?: boolean;
|
|
28
|
+
ldsflags?: string;
|
|
29
|
+
helpers?: boolean;
|
|
30
|
+
rust?: string;
|
|
31
|
+
debug?: boolean;
|
|
32
|
+
zeroConfig?: boolean;
|
|
33
|
+
import?: {
|
|
34
|
+
[key: string]: string;
|
|
35
|
+
};
|
|
36
|
+
functions?: BuilderFunctions;
|
|
37
|
+
projectSettings?: ProjectSettings;
|
|
38
|
+
outputDirectory?: string;
|
|
39
|
+
installCommand?: string;
|
|
40
|
+
buildCommand?: string;
|
|
41
|
+
devCommand?: string;
|
|
42
|
+
framework?: string | null;
|
|
43
|
+
nodeVersion?: string;
|
|
44
|
+
middleware?: boolean;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
export type HasField = Array<{
|
|
48
|
+
type: 'host';
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'header' | 'cookie' | 'query';
|
|
52
|
+
key: string;
|
|
53
|
+
value?: string;
|
|
54
|
+
}>;
|
|
55
|
+
export interface Meta {
|
|
56
|
+
isDev?: boolean;
|
|
57
|
+
devCacheDir?: string;
|
|
58
|
+
skipDownload?: boolean;
|
|
59
|
+
requestPath?: string | null;
|
|
60
|
+
filesChanged?: string[];
|
|
61
|
+
filesRemoved?: string[];
|
|
62
|
+
env?: Env;
|
|
63
|
+
buildEnv?: Env;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
66
|
+
export interface BuildOptions {
|
|
67
|
+
/**
|
|
68
|
+
* All source files of the project
|
|
69
|
+
*/
|
|
70
|
+
files: Files;
|
|
71
|
+
/**
|
|
72
|
+
* Name of entrypoint file for this particular build job. Value
|
|
73
|
+
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
|
|
74
|
+
* `entrypoint` is always a discrete file and never a glob, since globs are
|
|
75
|
+
* expanded into separate builds at deployment time.
|
|
76
|
+
*/
|
|
77
|
+
entrypoint: string;
|
|
78
|
+
/**
|
|
79
|
+
* A writable temporary directory where you are encouraged to perform your
|
|
80
|
+
* build process. This directory will be populated with the restored cache.
|
|
81
|
+
*/
|
|
82
|
+
workPath: string;
|
|
83
|
+
/**
|
|
84
|
+
* The "Root Directory" is assigned to the `workPath` so the `repoRootPath`
|
|
85
|
+
* is the Git Repository Root. This is only relevant for Monorepos.
|
|
86
|
+
* See https://vercel.com/blog/monorepos
|
|
87
|
+
*/
|
|
88
|
+
repoRootPath: string;
|
|
89
|
+
/**
|
|
90
|
+
* An arbitrary object passed by the user in the build definition defined
|
|
91
|
+
* in `vercel.json`.
|
|
92
|
+
*/
|
|
93
|
+
config: Config;
|
|
94
|
+
/**
|
|
95
|
+
* Metadata related to the invoker of the builder, used by `vercel dev`.
|
|
96
|
+
* Builders may use the properties on this object to change behavior based
|
|
97
|
+
* on the build environment.
|
|
98
|
+
*/
|
|
99
|
+
meta?: Meta;
|
|
100
|
+
/**
|
|
101
|
+
* A callback to be invoked by a builder after a project's
|
|
102
|
+
* build command has been run but before the outputs have been
|
|
103
|
+
* fully processed
|
|
104
|
+
*/
|
|
105
|
+
buildCallback?: (opts: Omit<BuildOptions, 'buildCallback'>) => Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
* The current trace state from the internal vc tracing
|
|
108
|
+
*/
|
|
109
|
+
span?: Span;
|
|
110
|
+
}
|
|
111
|
+
export interface PrepareCacheOptions {
|
|
112
|
+
/**
|
|
113
|
+
* All source files of the project
|
|
114
|
+
*/
|
|
115
|
+
files: Files;
|
|
116
|
+
/**
|
|
117
|
+
* Name of entrypoint file for this particular build job. Value
|
|
118
|
+
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
|
|
119
|
+
* `entrypoint` is always a discrete file and never a glob, since globs are
|
|
120
|
+
* expanded into separate builds at deployment time.
|
|
121
|
+
*/
|
|
122
|
+
entrypoint: string;
|
|
123
|
+
/**
|
|
124
|
+
* A writable temporary directory where you are encouraged to perform your
|
|
125
|
+
* build process.
|
|
126
|
+
*/
|
|
127
|
+
workPath: string;
|
|
128
|
+
/**
|
|
129
|
+
* The "Root Directory" is assigned to the `workPath` so the `repoRootPath`
|
|
130
|
+
* is the Git Repository Root. This is only relevant for Monorepos.
|
|
131
|
+
* See https://vercel.com/blog/monorepos
|
|
132
|
+
*/
|
|
133
|
+
repoRootPath: string;
|
|
134
|
+
/**
|
|
135
|
+
* An arbitrary object passed by the user in the build definition defined
|
|
136
|
+
* in `vercel.json`.
|
|
137
|
+
*/
|
|
138
|
+
config: Config;
|
|
139
|
+
}
|
|
140
|
+
export interface ShouldServeOptions {
|
|
141
|
+
/**
|
|
142
|
+
* A path string from a request.
|
|
143
|
+
*/
|
|
144
|
+
requestPath: string;
|
|
145
|
+
/**
|
|
146
|
+
* Name of entrypoint file for this particular build job. Value
|
|
147
|
+
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
|
|
148
|
+
* `entrypoint` is always a discrete file and never a glob, since globs are
|
|
149
|
+
* expanded into separate builds at deployment time.
|
|
150
|
+
*/
|
|
151
|
+
entrypoint: string;
|
|
152
|
+
/**
|
|
153
|
+
* All source files of the project
|
|
154
|
+
*/
|
|
155
|
+
files: {
|
|
156
|
+
[path: string]: FileFsRef;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* A writable temporary directory where you are encouraged to perform your
|
|
160
|
+
* build process. This directory will be populated with the restored cache.
|
|
161
|
+
*/
|
|
162
|
+
workPath: string;
|
|
163
|
+
/**
|
|
164
|
+
* An arbitrary object passed by the user in the build definition defined
|
|
165
|
+
* in `vercel.json`.
|
|
166
|
+
*/
|
|
167
|
+
config: Config;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* `startDevServer()` is given the same parameters as `build()`.
|
|
171
|
+
*/
|
|
172
|
+
export type StartDevServerOptions = BuildOptions;
|
|
173
|
+
export interface StartDevServerSuccess {
|
|
174
|
+
/**
|
|
175
|
+
* Port number where the dev server can be connected to, assumed to be running
|
|
176
|
+
* on `localhost`.
|
|
177
|
+
*/
|
|
178
|
+
port: number;
|
|
179
|
+
/**
|
|
180
|
+
* Process ID number of the dev server. Useful for the `vercel dev` server to
|
|
181
|
+
* shut down the dev server once an HTTP request has been fulfilled.
|
|
182
|
+
*/
|
|
183
|
+
pid: number;
|
|
184
|
+
/**
|
|
185
|
+
* An optional function to shut down the dev server. If not provided, the
|
|
186
|
+
* dev server will forcefully be killed.
|
|
187
|
+
*/
|
|
188
|
+
shutdown?: () => Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* `startDevServer()` may return `null` to opt-out of spawning a dev server for
|
|
192
|
+
* a given `entrypoint`.
|
|
193
|
+
*/
|
|
194
|
+
export type StartDevServerResult = StartDevServerSuccess | null;
|
|
195
|
+
/**
|
|
196
|
+
* Credit to Iain Reid, MIT license.
|
|
197
|
+
* Source: https://gist.github.com/iainreid820/5c1cc527fe6b5b7dba41fec7fe54bf6e
|
|
198
|
+
*/
|
|
199
|
+
export declare namespace PackageJson {
|
|
200
|
+
/**
|
|
201
|
+
* An author or contributor
|
|
202
|
+
*/
|
|
203
|
+
interface Author {
|
|
204
|
+
name: string;
|
|
205
|
+
email?: string;
|
|
206
|
+
homepage?: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* A map of exposed bin commands
|
|
210
|
+
*/
|
|
211
|
+
interface BinMap {
|
|
212
|
+
[commandName: string]: string;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* A bugs link
|
|
216
|
+
*/
|
|
217
|
+
interface Bugs {
|
|
218
|
+
email: string;
|
|
219
|
+
url: string;
|
|
220
|
+
}
|
|
221
|
+
interface Config {
|
|
222
|
+
name?: string;
|
|
223
|
+
config?: unknown;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* A map of dependencies
|
|
227
|
+
*/
|
|
228
|
+
interface DependencyMap {
|
|
229
|
+
[dependencyName: string]: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* CommonJS package structure
|
|
233
|
+
*/
|
|
234
|
+
interface Directories {
|
|
235
|
+
lib?: string;
|
|
236
|
+
bin?: string;
|
|
237
|
+
man?: string;
|
|
238
|
+
doc?: string;
|
|
239
|
+
example?: string;
|
|
240
|
+
}
|
|
241
|
+
interface Engines {
|
|
242
|
+
node?: string;
|
|
243
|
+
npm?: string;
|
|
244
|
+
pnpm?: string;
|
|
245
|
+
}
|
|
246
|
+
interface PublishConfig {
|
|
247
|
+
registry?: string;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* A project repository
|
|
251
|
+
*/
|
|
252
|
+
interface Repository {
|
|
253
|
+
type: string;
|
|
254
|
+
url: string;
|
|
255
|
+
}
|
|
256
|
+
interface ScriptsMap {
|
|
257
|
+
[scriptName: string]: string;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
export interface PackageJson {
|
|
261
|
+
readonly name?: string;
|
|
262
|
+
readonly version?: string;
|
|
263
|
+
readonly description?: string;
|
|
264
|
+
readonly keywords?: string[];
|
|
265
|
+
readonly homepage?: string;
|
|
266
|
+
readonly bugs?: string | PackageJson.Bugs;
|
|
267
|
+
readonly license?: string;
|
|
268
|
+
readonly author?: string | PackageJson.Author;
|
|
269
|
+
readonly contributors?: string[] | PackageJson.Author[];
|
|
270
|
+
readonly files?: string[];
|
|
271
|
+
readonly main?: string;
|
|
272
|
+
readonly bin?: string | PackageJson.BinMap;
|
|
273
|
+
readonly man?: string | string[];
|
|
274
|
+
readonly directories?: PackageJson.Directories;
|
|
275
|
+
readonly repository?: string | PackageJson.Repository;
|
|
276
|
+
readonly scripts?: PackageJson.ScriptsMap;
|
|
277
|
+
readonly config?: PackageJson.Config;
|
|
278
|
+
readonly dependencies?: PackageJson.DependencyMap;
|
|
279
|
+
readonly devDependencies?: PackageJson.DependencyMap;
|
|
280
|
+
readonly peerDependencies?: PackageJson.DependencyMap;
|
|
281
|
+
readonly optionalDependencies?: PackageJson.DependencyMap;
|
|
282
|
+
readonly bundledDependencies?: string[];
|
|
283
|
+
readonly engines?: PackageJson.Engines;
|
|
284
|
+
readonly os?: string[];
|
|
285
|
+
readonly cpu?: string[];
|
|
286
|
+
readonly preferGlobal?: boolean;
|
|
287
|
+
readonly private?: boolean;
|
|
288
|
+
readonly publishConfig?: PackageJson.PublishConfig;
|
|
289
|
+
readonly packageManager?: string;
|
|
290
|
+
}
|
|
291
|
+
export interface ConstructorVersion {
|
|
292
|
+
/** major version number: 18 */
|
|
293
|
+
major: number;
|
|
294
|
+
/** minor version number: 18 */
|
|
295
|
+
minor?: number;
|
|
296
|
+
/** major version range: "18.x" */
|
|
297
|
+
range: string;
|
|
298
|
+
/** runtime descriptor: "nodejs18.x" */
|
|
299
|
+
runtime: string;
|
|
300
|
+
discontinueDate?: Date;
|
|
301
|
+
}
|
|
302
|
+
interface BaseVersion extends ConstructorVersion {
|
|
303
|
+
state: 'active' | 'deprecated' | 'discontinued';
|
|
304
|
+
}
|
|
305
|
+
export declare class Version implements BaseVersion {
|
|
306
|
+
major: number;
|
|
307
|
+
minor?: number;
|
|
308
|
+
range: string;
|
|
309
|
+
runtime: string;
|
|
310
|
+
discontinueDate?: Date;
|
|
311
|
+
constructor(version: ConstructorVersion);
|
|
312
|
+
get state(): "active" | "deprecated" | "discontinued";
|
|
313
|
+
get formattedDate(): string | undefined;
|
|
314
|
+
}
|
|
315
|
+
export declare class NodeVersion extends Version {
|
|
316
|
+
}
|
|
317
|
+
export interface Builder {
|
|
318
|
+
use: string;
|
|
319
|
+
src?: string;
|
|
320
|
+
config?: Config;
|
|
321
|
+
}
|
|
322
|
+
export interface BuilderFunctions {
|
|
323
|
+
[key: string]: {
|
|
324
|
+
memory?: number;
|
|
325
|
+
maxDuration?: number;
|
|
326
|
+
runtime?: string;
|
|
327
|
+
includeFiles?: string;
|
|
328
|
+
excludeFiles?: string;
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
export interface ProjectSettings {
|
|
332
|
+
framework?: string | null;
|
|
333
|
+
devCommand?: string | null;
|
|
334
|
+
installCommand?: string | null;
|
|
335
|
+
buildCommand?: string | null;
|
|
336
|
+
outputDirectory?: string | null;
|
|
337
|
+
rootDirectory?: string | null;
|
|
338
|
+
nodeVersion?: string;
|
|
339
|
+
createdAt?: number;
|
|
340
|
+
autoExposeSystemEnvs?: boolean;
|
|
341
|
+
sourceFilesOutsideRootDirectory?: boolean;
|
|
342
|
+
directoryListing?: boolean;
|
|
343
|
+
gitForkProtection?: boolean;
|
|
344
|
+
commandForIgnoringBuildStep?: string | null;
|
|
345
|
+
}
|
|
346
|
+
export interface BuilderV2 {
|
|
347
|
+
version: 2;
|
|
348
|
+
build: BuildV2;
|
|
349
|
+
diagnostics?: Diagnostics;
|
|
350
|
+
prepareCache?: PrepareCache;
|
|
351
|
+
shouldServe?: ShouldServe;
|
|
352
|
+
}
|
|
353
|
+
export interface BuilderV3 {
|
|
354
|
+
version: 3;
|
|
355
|
+
build: BuildV3;
|
|
356
|
+
diagnostics?: Diagnostics;
|
|
357
|
+
prepareCache?: PrepareCache;
|
|
358
|
+
shouldServe?: ShouldServe;
|
|
359
|
+
startDevServer?: StartDevServer;
|
|
360
|
+
}
|
|
361
|
+
type ImageFormat = 'image/avif' | 'image/webp';
|
|
362
|
+
type ImageContentDispositionType = 'inline' | 'attachment';
|
|
363
|
+
export type RemotePattern = {
|
|
364
|
+
/**
|
|
365
|
+
* Must be `http` or `https`.
|
|
366
|
+
*/
|
|
367
|
+
protocol?: 'http' | 'https';
|
|
368
|
+
/**
|
|
369
|
+
* Can be literal or wildcard.
|
|
370
|
+
* Single `*` matches a single subdomain.
|
|
371
|
+
* Double `**` matches any number of subdomains.
|
|
372
|
+
*/
|
|
373
|
+
hostname: string;
|
|
374
|
+
/**
|
|
375
|
+
* Can be literal port such as `8080` or empty string
|
|
376
|
+
* meaning no port.
|
|
377
|
+
*/
|
|
378
|
+
port?: string;
|
|
379
|
+
/**
|
|
380
|
+
* Can be literal or wildcard.
|
|
381
|
+
* Single `*` matches a single path segment.
|
|
382
|
+
* Double `**` matches any number of path segments.
|
|
383
|
+
*/
|
|
384
|
+
pathname?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Can be literal query string such as `?v=1` or
|
|
387
|
+
* empty string meaning no query string.
|
|
388
|
+
*/
|
|
389
|
+
search?: string;
|
|
390
|
+
};
|
|
391
|
+
export interface LocalPattern {
|
|
392
|
+
/**
|
|
393
|
+
* Can be literal or wildcard.
|
|
394
|
+
* Single `*` matches a single path segment.
|
|
395
|
+
* Double `**` matches any number of path segments.
|
|
396
|
+
*/
|
|
397
|
+
pathname?: string;
|
|
398
|
+
/**
|
|
399
|
+
* Can be literal query string such as `?v=1` or
|
|
400
|
+
* empty string meaning no query string.
|
|
401
|
+
*/
|
|
402
|
+
search?: string;
|
|
403
|
+
}
|
|
404
|
+
export interface Images {
|
|
405
|
+
domains: string[];
|
|
406
|
+
remotePatterns?: RemotePattern[];
|
|
407
|
+
localPatterns?: LocalPattern[];
|
|
408
|
+
qualities?: number[];
|
|
409
|
+
sizes: number[];
|
|
410
|
+
minimumCacheTTL?: number;
|
|
411
|
+
formats?: ImageFormat[];
|
|
412
|
+
dangerouslyAllowSVG?: boolean;
|
|
413
|
+
contentSecurityPolicy?: string;
|
|
414
|
+
contentDispositionType?: ImageContentDispositionType;
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* If a Builder ends up creating filesystem outputs conforming to
|
|
418
|
+
* the Build Output API, then the Builder should return this type.
|
|
419
|
+
*/
|
|
420
|
+
export interface BuildResultBuildOutput {
|
|
421
|
+
/**
|
|
422
|
+
* Version number of the Build Output API that was created.
|
|
423
|
+
* Currently only `3` is a valid value.
|
|
424
|
+
* @example 3
|
|
425
|
+
*/
|
|
426
|
+
buildOutputVersion: 3;
|
|
427
|
+
/**
|
|
428
|
+
* Filesystem path to the Build Output directory.
|
|
429
|
+
* @example "/path/to/.vercel/output"
|
|
430
|
+
*/
|
|
431
|
+
buildOutputPath: string;
|
|
432
|
+
}
|
|
433
|
+
export interface Cron {
|
|
434
|
+
path: string;
|
|
435
|
+
schedule: string;
|
|
436
|
+
}
|
|
437
|
+
/** The framework which created the function */
|
|
438
|
+
export interface FunctionFramework {
|
|
439
|
+
slug: string;
|
|
440
|
+
version?: string;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* When a Builder implements `version: 2`, the `build()` function is expected
|
|
444
|
+
* to return this type.
|
|
445
|
+
*/
|
|
446
|
+
export interface BuildResultV2Typical {
|
|
447
|
+
routes?: any[];
|
|
448
|
+
images?: Images;
|
|
449
|
+
output: {
|
|
450
|
+
[key: string]: File | Lambda | Prerender | EdgeFunction;
|
|
451
|
+
};
|
|
452
|
+
wildcard?: Array<{
|
|
453
|
+
domain: string;
|
|
454
|
+
value: string;
|
|
455
|
+
}>;
|
|
456
|
+
framework?: {
|
|
457
|
+
version: string;
|
|
458
|
+
};
|
|
459
|
+
flags?: {
|
|
460
|
+
definitions: FlagDefinitions;
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;
|
|
464
|
+
export interface BuildResultV3 {
|
|
465
|
+
routes?: any[];
|
|
466
|
+
output: Lambda | EdgeFunction;
|
|
467
|
+
}
|
|
468
|
+
export type BuildV2 = (options: BuildOptions) => Promise<BuildResultV2>;
|
|
469
|
+
export type BuildV3 = (options: BuildOptions) => Promise<BuildResultV3>;
|
|
470
|
+
export type PrepareCache = (options: PrepareCacheOptions) => Promise<Files>;
|
|
471
|
+
export type Diagnostics = (options: BuildOptions) => Promise<Files>;
|
|
472
|
+
export type ShouldServe = (options: ShouldServeOptions) => boolean | Promise<boolean>;
|
|
473
|
+
export type StartDevServer = (options: StartDevServerOptions) => Promise<StartDevServerResult>;
|
|
474
|
+
/**
|
|
475
|
+
* TODO: The following types will eventually be exported by a more
|
|
476
|
+
* relevant package.
|
|
477
|
+
*/
|
|
478
|
+
type FlagJSONArray = ReadonlyArray<FlagJSONValue>;
|
|
479
|
+
type FlagJSONValue = string | boolean | number | null | FlagJSONArray | {
|
|
480
|
+
[key: string]: FlagJSONValue;
|
|
481
|
+
};
|
|
482
|
+
type FlagOption = {
|
|
483
|
+
value: FlagJSONValue;
|
|
484
|
+
label?: string;
|
|
485
|
+
};
|
|
486
|
+
export interface FlagDefinition {
|
|
487
|
+
options?: FlagOption[];
|
|
488
|
+
origin?: string;
|
|
489
|
+
description?: string;
|
|
490
|
+
}
|
|
491
|
+
export type FlagDefinitions = Record<string, FlagDefinition>;
|
|
492
|
+
export interface Chain {
|
|
493
|
+
/**
|
|
494
|
+
* The build output to use that references the lambda that will be used to
|
|
495
|
+
* append to the response.
|
|
496
|
+
*/
|
|
497
|
+
outputPath: string;
|
|
498
|
+
/**
|
|
499
|
+
* The headers to send when making the request to append to the response.
|
|
500
|
+
*/
|
|
501
|
+
headers: Record<string, string>;
|
|
502
|
+
}
|
|
503
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var types_exports = {};
|
|
20
|
+
__export(types_exports, {
|
|
21
|
+
NodeVersion: () => NodeVersion,
|
|
22
|
+
Version: () => Version
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(types_exports);
|
|
25
|
+
class Version {
|
|
26
|
+
constructor(version) {
|
|
27
|
+
this.major = version.major;
|
|
28
|
+
this.minor = version.minor;
|
|
29
|
+
this.range = version.range;
|
|
30
|
+
this.runtime = version.runtime;
|
|
31
|
+
this.discontinueDate = version.discontinueDate;
|
|
32
|
+
}
|
|
33
|
+
get state() {
|
|
34
|
+
if (this.discontinueDate && this.discontinueDate.getTime() <= Date.now()) {
|
|
35
|
+
return "discontinued";
|
|
36
|
+
} else if (this.discontinueDate) {
|
|
37
|
+
return "deprecated";
|
|
38
|
+
}
|
|
39
|
+
return "active";
|
|
40
|
+
}
|
|
41
|
+
get formattedDate() {
|
|
42
|
+
return this.discontinueDate && this.discontinueDate.toISOString().split("T")[0];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
class NodeVersion extends Version {
|
|
46
|
+
}
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
NodeVersion,
|
|
50
|
+
Version
|
|
51
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if there is a `.npmrc` in the cwd (project root) and makes sure it
|
|
3
|
+
* doesn't contain a `use-node-version`. This config setting is not supported
|
|
4
|
+
* since it causes the package manager to install the Node.js version which in
|
|
5
|
+
* the case of newer Node.js versions is not compatible with AWS due to
|
|
6
|
+
* outdated GLIBC binaries.
|
|
7
|
+
*
|
|
8
|
+
* @see https://pnpm.io/npmrc#use-node-version
|
|
9
|
+
*
|
|
10
|
+
* @param cwd The current working directory (e.g. project root);
|
|
11
|
+
*/
|
|
12
|
+
export declare function validateNpmrc(cwd: string): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var validate_npmrc_exports = {};
|
|
20
|
+
__export(validate_npmrc_exports, {
|
|
21
|
+
validateNpmrc: () => validateNpmrc
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(validate_npmrc_exports);
|
|
24
|
+
var import_path = require("path");
|
|
25
|
+
var import_promises = require("fs/promises");
|
|
26
|
+
async function validateNpmrc(cwd) {
|
|
27
|
+
const npmrc = await (0, import_promises.readFile)((0, import_path.join)(cwd, ".npmrc"), "utf-8").catch((err) => {
|
|
28
|
+
if (err.code !== "ENOENT")
|
|
29
|
+
throw err;
|
|
30
|
+
});
|
|
31
|
+
const nodeRegExp = /(?<!#.*)use-node-version/;
|
|
32
|
+
if (npmrc?.match(nodeRegExp)) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
'Detected unsupported "use-node-version" in your ".npmrc". Please use "engines" in your "package.json" instead.'
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
validateNpmrc
|
|
41
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/index').FileBlob;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/index').FileFsRef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/index').FileRef;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index').download;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index').getWriteableDirectory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index').glob;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index').rename;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/index').streamToBuffer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/index');
|