@depup/vercel 58.4.4-depup.0 → 59.1.3-depup.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.
- package/README.md +8 -9
- package/changes.json +7 -11
- package/dist/chunks/{add-245XOFJO.js → add-CUGPQYFW.js} +11 -11
- package/dist/chunks/{add-XH24V5VU.js → add-PP3PJPJV.js} +8 -8
- package/dist/chunks/{add-P7WBQMBW.js → add-PRG4KKYH.js} +45 -12
- package/dist/chunks/{build-M7NJYJPE.js → build-T22GMLY6.js} +11 -11
- package/dist/chunks/{chunk-AW5YINX6.js → chunk-2MF3ZAVW.js} +48 -6
- package/dist/chunks/{chunk-WR7JTCGL.js → chunk-3BU2UCGV.js} +1 -1
- package/dist/chunks/{chunk-MAHXF73X.js → chunk-3L2YLLHC.js} +1 -1
- package/dist/chunks/{chunk-ZGBBPJ6B.js → chunk-43DD2KNM.js} +254 -1539
- package/dist/chunks/{chunk-M5NOLAJ4.js → chunk-4HI7G6KG.js} +1 -1
- package/dist/chunks/chunk-4JKZ7SRX.js +559 -0
- package/dist/chunks/{chunk-Y5GTPWXB.js → chunk-57G6HBJ4.js} +3 -3
- package/dist/chunks/{chunk-2LBVX2H3.js → chunk-5DVMXOFT.js} +3 -3
- package/dist/chunks/{chunk-YCPUAG77.js → chunk-7NQLRE5V.js} +1 -1
- package/dist/chunks/{chunk-JLWQWYKO.js → chunk-BBSS3XIW.js} +2 -4
- package/dist/chunks/{chunk-IEDUCUDV.js → chunk-BCZFZETZ.js} +92 -46
- package/dist/chunks/{chunk-SJYAUEZR.js → chunk-DAWJOQF6.js} +52 -79
- package/dist/chunks/chunk-DEB45ND4.js +61 -0
- package/dist/chunks/{chunk-AQDWMAPM.js → chunk-DOMLWKKZ.js} +795 -516
- package/dist/chunks/{chunk-EBLH23AQ.js → chunk-F7OXZLY2.js} +6 -9
- package/dist/chunks/{chunk-J6LK45HT.js → chunk-GFCTRJI5.js} +16 -2
- package/dist/chunks/{chunk-V5P25P7F.js → chunk-GGPE5377.js} +5 -12
- package/dist/chunks/{chunk-4LDQIDRM.js → chunk-GMWRTZVZ.js} +9 -1
- package/dist/chunks/{chunk-NJUPUGOE.js → chunk-HT2XWSAJ.js} +1 -1
- package/dist/chunks/chunk-IKKUCZE7.js +96 -0
- package/dist/chunks/chunk-JKQWQA2T.js +39 -0
- package/dist/chunks/{chunk-XIG4GH62.js → chunk-JYEO6OJS.js} +188 -102
- package/dist/chunks/{chunk-HSYF5SI3.js → chunk-KTLFN5FV.js} +1 -1
- package/dist/chunks/{chunk-XPKWKPWA.js → chunk-KXDWXXJH.js} +27 -1
- package/dist/chunks/chunk-LNVZ3T7X.js +2908 -0
- package/dist/chunks/{chunk-NJ6QXKQD.js → chunk-M34ZRNDQ.js} +1 -1
- package/dist/chunks/chunk-MXLA3VQS.js +20 -0
- package/dist/chunks/{chunk-2SFMOCWR.js → chunk-PD7ZUXE7.js} +1 -1
- package/dist/chunks/chunk-QCVKGY2A.js +151 -0
- package/dist/chunks/{chunk-XE5VSQ25.js → chunk-QD5NX7RG.js} +1 -1
- package/dist/chunks/{chunk-4N7XLXM2.js → chunk-QQ6PH4RY.js} +1 -0
- package/dist/chunks/{chunk-A5KP5HAI.js → chunk-RIB4S2IB.js} +10 -1
- package/dist/chunks/{chunk-ZX2FSPWV.js → chunk-SJQEGGH7.js} +4 -4
- package/dist/chunks/{chunk-3QAUXPIR.js → chunk-SOKQBFF7.js} +1128 -162
- package/dist/chunks/chunk-SQGMTRZD.js +1385 -0
- package/dist/chunks/{chunk-TJJ562C5.js → chunk-TJLBCLEX.js} +15 -0
- package/dist/chunks/{chunk-62MH5KPX.js → chunk-TM3F7PLR.js} +7 -7
- package/dist/chunks/{chunk-2WILSD7J.js → chunk-TNKRSTMB.js} +1 -1
- package/dist/chunks/{chunk-4UYKSYKQ.js → chunk-UMA66MKW.js} +66 -2
- package/dist/chunks/{chunk-KT4XXKJK.js → chunk-VAFU7DXZ.js} +195 -3
- package/dist/chunks/{chunk-RQ7H43CJ.js → chunk-VDJN4WKH.js} +1 -1
- package/dist/chunks/{chunk-4CCY5OPH.js → chunk-VE545BR3.js} +5039 -3119
- package/dist/chunks/{chunk-B3JTF4CF.js → chunk-WC7IINFV.js} +10 -1
- package/dist/chunks/{chunk-YDUINEII.js → chunk-XZLI27ES.js} +7 -5
- package/dist/chunks/{chunk-4BUPRO5B.js → chunk-ZUVJISHS.js} +3 -3
- package/dist/chunks/{clear-HWIKQ4NC.js → clear-Z4IKUIN7.js} +8 -8
- package/dist/chunks/{compile-vercel-config-U5NRIMZ2.js → compile-vercel-config-PSVXFAZW.js} +4 -4
- package/dist/chunks/config-M5GMZ2X5.js +159 -0
- package/dist/chunks/{constants-3FSSR6E7.js → constants-YMCRE6IG.js} +5 -3
- package/dist/chunks/{delete-NVMGVD5Z.js → delete-5GRRDJSF.js} +5 -5
- package/dist/chunks/{delete-FZCOUFGN.js → delete-P4XIBY7T.js} +8 -8
- package/dist/chunks/{disable-ERM2BWEQ.js → disable-NT5NYVO7.js} +5 -5
- package/dist/chunks/{discard-KM5OLEN4.js → discard-TBNIEAJZ.js} +5 -5
- package/dist/chunks/{edit-HT3UTATZ.js → edit-DJ6MT6HA.js} +6 -6
- package/dist/chunks/{edit-TOSB2EMI.js → edit-UF3D2CCH.js} +9 -9
- package/dist/chunks/{enable-BQL6AOQV.js → enable-JTQBQMBO.js} +5 -5
- package/dist/chunks/{export-UOWQHOG3.js → export-OKMRGRVM.js} +5 -5
- package/dist/chunks/{image-F5SC6Q7Y.js → image-ARUJH4H5.js} +4 -4
- package/dist/chunks/import-builders-3NTMZM64.js +30 -0
- package/dist/chunks/{inspect-PZJM2CWT.js → inspect-5NETOGAI.js} +11 -12
- package/dist/chunks/{inspect-GKJ6T5H4.js → inspect-CHFKZKKP.js} +8 -8
- package/dist/chunks/{inspect-LGKOLH2O.js → inspect-FXZTQY62.js} +9 -9
- package/dist/chunks/{inspect-35FU5R62.js → inspect-PTXIBSYW.js} +11 -11
- package/dist/chunks/{inspect-5J5GSTOB.js → inspect-UXP2HDES.js} +8 -8
- package/dist/chunks/{list-2IIE7CAP.js → list-2WMIVJ2R.js} +31 -15
- package/dist/chunks/{list-ITFJYYQ2.js → list-ADI55WKW.js} +13 -14
- package/dist/chunks/{list-KZETH3ZE.js → list-DYCZA2VX.js} +6 -6
- package/dist/chunks/{login-BQPJCJEZ.js → login-YCSIQG6B.js} +11 -11
- package/dist/chunks/{ls-UXUEP54B.js → ls-2TKUIUK4.js} +14 -15
- package/dist/chunks/{ls-YSFWSM6J.js → ls-EOMIQLRH.js} +14 -15
- package/dist/chunks/{ls-7GHDK4MD.js → ls-PQFDGOJL.js} +17 -18
- package/dist/chunks/{ls-DL2LA35C.js → ls-RZVTIP5U.js} +14 -15
- package/dist/chunks/{ls-ZZFLH7PK.js → ls-VIOMDUGW.js} +17 -18
- package/dist/chunks/{open-ADNJQN5E.js → open-JYPWOXQD.js} +7 -7
- package/dist/chunks/{permissions-72SZCBIY.js → permissions-SGJWGEVD.js} +6 -6
- package/dist/chunks/{publish-OOAGSEBM.js → publish-ZUQHJAXL.js} +5 -5
- package/dist/chunks/{push-B6TZDXNF.js → push-XMVKG5A5.js} +11 -11
- package/dist/chunks/{query-LZWS5TDH.js → query-ZLJZEGZB.js} +240 -52
- package/dist/chunks/{reorder-MRHFKPMK.js → reorder-NVHDWMRU.js} +5 -5
- package/dist/chunks/{reply-BKTJXO3B.js → reply-PUUPUQ3V.js} +9 -9
- package/dist/chunks/{resolve-BKVGSGPN.js → resolve-5U2LJVE6.js} +8 -8
- package/dist/chunks/{restore-USR7SKWV.js → restore-OXIUY2UI.js} +5 -5
- package/dist/chunks/{rm-2UO6BT3A.js → rm-3IOCBNPE.js} +9 -9
- package/dist/chunks/{rm-37MKKV3I.js → rm-BZNKJRXU.js} +8 -8
- package/dist/chunks/{rm-VY3OHKFH.js → rm-OUI4ZB5R.js} +8 -8
- package/dist/chunks/{rm-KUWPNZIS.js → rm-Z2KYJ7XT.js} +11 -11
- package/dist/chunks/{rule-inspect-JVDOOTWK.js → rule-inspect-ZBJJCDQV.js} +17 -25
- package/dist/chunks/{rules-NTBFZBIF.js → rules-HEGAXXUN.js} +10 -7
- package/dist/chunks/{schema-6EZ72OVH.js → schema-7GVL3BNP.js} +65 -33
- package/dist/chunks/schema-ZYIJYA2E.js +425 -0
- package/dist/chunks/{tags-HNPC63QA.js → tags-3SCWCMNQ.js} +3 -3
- package/dist/chunks/{types-QTOA2BTQ.js → types-AJHILHO5.js} +3 -5
- package/dist/chunks/{update-LUYWNZP3.js → update-YR2GCCJN.js} +40 -9
- package/dist/commands/build/index.js +282 -2932
- package/dist/commands/deploy/index.js +397 -84
- package/dist/commands/dev/index.js +339 -194
- package/dist/commands/env/index.js +101 -163
- package/dist/commands/link/index.js +17 -23
- package/dist/commands/list/index.js +11 -13
- package/dist/commands-bulk.js +10189 -4062
- package/dist/help.js +1 -1
- package/dist/index.js +141 -114
- package/dist/vc.js +18 -17
- package/dist/version.mjs +2 -1
- package/package.json +80 -77
- package/dist/chunks/chunk-2FMPLU44.js +0 -106
- package/dist/chunks/chunk-2MAPZXVV.js +0 -206
- package/dist/chunks/chunk-CPFNFVCL.js +0 -85
- package/dist/chunks/chunk-GFG6QDIE.js +0 -101
- package/dist/chunks/chunk-KBEX5MYS.js +0 -208
- package/dist/chunks/chunk-UE3JUVUZ.js +0 -1474
- package/dist/chunks/{chunk-BUZRVER7.js → chunk-P65EEFTR.js} +3 -3
- /package/dist/{commands/dev/next-dev-websocket-shim-preload.cjs → runtime-assets/node-preloads/next-dev-websocket.cjs} +0 -0
|
@@ -5,900 +5,21 @@ const require = __createRequire(import.meta.url);
|
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
7
|
import {
|
|
8
|
-
require_semver
|
|
9
|
-
} from "./chunk-IB5L4LKZ.js";
|
|
10
|
-
import {
|
|
11
|
-
require_execa
|
|
12
|
-
} from "./chunk-R6IGDGX3.js";
|
|
13
|
-
import {
|
|
14
|
-
VERCEL_CONFIG_EXTENSIONS,
|
|
15
8
|
VERCEL_DIR,
|
|
16
|
-
readJSONFile,
|
|
17
9
|
require_dist as require_dist2,
|
|
18
10
|
require_dist3,
|
|
19
|
-
require_lib
|
|
20
|
-
|
|
21
|
-
require_pluralize
|
|
22
|
-
} from "./chunk-4CCY5OPH.js";
|
|
23
|
-
import {
|
|
24
|
-
CantParseJSONFile,
|
|
25
|
-
cmd,
|
|
26
|
-
code
|
|
27
|
-
} from "./chunk-SOFC4MLS.js";
|
|
28
|
-
import {
|
|
29
|
-
pkg_default
|
|
30
|
-
} from "./chunk-P4QNYOFB.js";
|
|
11
|
+
require_lib
|
|
12
|
+
} from "./chunk-VE545BR3.js";
|
|
31
13
|
import {
|
|
32
14
|
output_manager_default,
|
|
33
15
|
require_dist
|
|
34
16
|
} from "./chunk-OX7KI3LF.js";
|
|
35
17
|
import {
|
|
36
18
|
__commonJS,
|
|
37
|
-
__export,
|
|
38
19
|
__require,
|
|
39
20
|
__toESM
|
|
40
21
|
} from "./chunk-TZ2YI2VH.js";
|
|
41
22
|
|
|
42
|
-
// ../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json
|
|
43
|
-
var require_builtins = __commonJS({
|
|
44
|
-
"../../node_modules/.pnpm/builtins@1.0.3/node_modules/builtins/builtins.json"(exports, module) {
|
|
45
|
-
module.exports = [
|
|
46
|
-
"assert",
|
|
47
|
-
"buffer",
|
|
48
|
-
"child_process",
|
|
49
|
-
"cluster",
|
|
50
|
-
"console",
|
|
51
|
-
"constants",
|
|
52
|
-
"crypto",
|
|
53
|
-
"dgram",
|
|
54
|
-
"dns",
|
|
55
|
-
"domain",
|
|
56
|
-
"events",
|
|
57
|
-
"fs",
|
|
58
|
-
"http",
|
|
59
|
-
"https",
|
|
60
|
-
"module",
|
|
61
|
-
"net",
|
|
62
|
-
"os",
|
|
63
|
-
"path",
|
|
64
|
-
"process",
|
|
65
|
-
"punycode",
|
|
66
|
-
"querystring",
|
|
67
|
-
"readline",
|
|
68
|
-
"repl",
|
|
69
|
-
"stream",
|
|
70
|
-
"string_decoder",
|
|
71
|
-
"timers",
|
|
72
|
-
"tls",
|
|
73
|
-
"tty",
|
|
74
|
-
"url",
|
|
75
|
-
"util",
|
|
76
|
-
"v8",
|
|
77
|
-
"vm",
|
|
78
|
-
"zlib"
|
|
79
|
-
];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
// ../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js
|
|
84
|
-
var require_validate_npm_package_name = __commonJS({
|
|
85
|
-
"../../node_modules/.pnpm/validate-npm-package-name@3.0.0/node_modules/validate-npm-package-name/index.js"(exports, module) {
|
|
86
|
-
"use strict";
|
|
87
|
-
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
|
|
88
|
-
var builtins = require_builtins();
|
|
89
|
-
var blacklist = [
|
|
90
|
-
"node_modules",
|
|
91
|
-
"favicon.ico"
|
|
92
|
-
];
|
|
93
|
-
var validate = module.exports = function(name) {
|
|
94
|
-
var warnings = [];
|
|
95
|
-
var errors = [];
|
|
96
|
-
if (name === null) {
|
|
97
|
-
errors.push("name cannot be null");
|
|
98
|
-
return done(warnings, errors);
|
|
99
|
-
}
|
|
100
|
-
if (name === void 0) {
|
|
101
|
-
errors.push("name cannot be undefined");
|
|
102
|
-
return done(warnings, errors);
|
|
103
|
-
}
|
|
104
|
-
if (typeof name !== "string") {
|
|
105
|
-
errors.push("name must be a string");
|
|
106
|
-
return done(warnings, errors);
|
|
107
|
-
}
|
|
108
|
-
if (!name.length) {
|
|
109
|
-
errors.push("name length must be greater than zero");
|
|
110
|
-
}
|
|
111
|
-
if (name.match(/^\./)) {
|
|
112
|
-
errors.push("name cannot start with a period");
|
|
113
|
-
}
|
|
114
|
-
if (name.match(/^_/)) {
|
|
115
|
-
errors.push("name cannot start with an underscore");
|
|
116
|
-
}
|
|
117
|
-
if (name.trim() !== name) {
|
|
118
|
-
errors.push("name cannot contain leading or trailing spaces");
|
|
119
|
-
}
|
|
120
|
-
blacklist.forEach(function(blacklistedName) {
|
|
121
|
-
if (name.toLowerCase() === blacklistedName) {
|
|
122
|
-
errors.push(blacklistedName + " is a blacklisted name");
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
builtins.forEach(function(builtin) {
|
|
126
|
-
if (name.toLowerCase() === builtin) {
|
|
127
|
-
warnings.push(builtin + " is a core module name");
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
if (name.length > 214) {
|
|
131
|
-
warnings.push("name can no longer contain more than 214 characters");
|
|
132
|
-
}
|
|
133
|
-
if (name.toLowerCase() !== name) {
|
|
134
|
-
warnings.push("name can no longer contain capital letters");
|
|
135
|
-
}
|
|
136
|
-
if (/[~'!()*]/.test(name.split("/").slice(-1)[0])) {
|
|
137
|
-
warnings.push(`name can no longer contain special characters ("~'!()*")`);
|
|
138
|
-
}
|
|
139
|
-
if (encodeURIComponent(name) !== name) {
|
|
140
|
-
var nameMatch = name.match(scopedPackagePattern);
|
|
141
|
-
if (nameMatch) {
|
|
142
|
-
var user = nameMatch[1];
|
|
143
|
-
var pkg = nameMatch[2];
|
|
144
|
-
if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) {
|
|
145
|
-
return done(warnings, errors);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
errors.push("name can only contain URL-friendly characters");
|
|
149
|
-
}
|
|
150
|
-
return done(warnings, errors);
|
|
151
|
-
};
|
|
152
|
-
validate.scopedPackagePattern = scopedPackagePattern;
|
|
153
|
-
var done = function(warnings, errors) {
|
|
154
|
-
var result = {
|
|
155
|
-
validForNewPackages: errors.length === 0 && warnings.length === 0,
|
|
156
|
-
validForOldPackages: errors.length === 0,
|
|
157
|
-
warnings,
|
|
158
|
-
errors
|
|
159
|
-
};
|
|
160
|
-
if (!result.warnings.length)
|
|
161
|
-
delete result.warnings;
|
|
162
|
-
if (!result.errors.length)
|
|
163
|
-
delete result.errors;
|
|
164
|
-
return result;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
// ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js
|
|
170
|
-
var require_git_host_info = __commonJS({
|
|
171
|
-
"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host-info.js"(exports, module) {
|
|
172
|
-
"use strict";
|
|
173
|
-
var gitHosts = module.exports = {
|
|
174
|
-
github: {
|
|
175
|
-
// First two are insecure and generally shouldn't be used any more, but
|
|
176
|
-
// they are still supported.
|
|
177
|
-
"protocols": ["git", "http", "git+ssh", "git+https", "ssh", "https"],
|
|
178
|
-
"domain": "github.com",
|
|
179
|
-
"treepath": "tree",
|
|
180
|
-
"filetemplate": "https://{auth@}raw.githubusercontent.com/{user}/{project}/{committish}/{path}",
|
|
181
|
-
"bugstemplate": "https://{domain}/{user}/{project}/issues",
|
|
182
|
-
"gittemplate": "git://{auth@}{domain}/{user}/{project}.git{#committish}",
|
|
183
|
-
"tarballtemplate": "https://codeload.{domain}/{user}/{project}/tar.gz/{committish}"
|
|
184
|
-
},
|
|
185
|
-
bitbucket: {
|
|
186
|
-
"protocols": ["git+ssh", "git+https", "ssh", "https"],
|
|
187
|
-
"domain": "bitbucket.org",
|
|
188
|
-
"treepath": "src",
|
|
189
|
-
"tarballtemplate": "https://{domain}/{user}/{project}/get/{committish}.tar.gz"
|
|
190
|
-
},
|
|
191
|
-
gitlab: {
|
|
192
|
-
"protocols": ["git+ssh", "git+https", "ssh", "https"],
|
|
193
|
-
"domain": "gitlab.com",
|
|
194
|
-
"treepath": "tree",
|
|
195
|
-
"bugstemplate": "https://{domain}/{user}/{project}/issues",
|
|
196
|
-
"httpstemplate": "git+https://{auth@}{domain}/{user}/{projectPath}.git{#committish}",
|
|
197
|
-
"tarballtemplate": "https://{domain}/{user}/{project}/repository/archive.tar.gz?ref={committish}",
|
|
198
|
-
"pathmatch": /^[/]([^/]+)[/]((?!.*(\/-\/|\/repository\/archive\.tar\.gz\?=.*|\/repository\/[^/]+\/archive.tar.gz$)).*?)(?:[.]git|[/])?$/
|
|
199
|
-
},
|
|
200
|
-
gist: {
|
|
201
|
-
"protocols": ["git", "git+ssh", "git+https", "ssh", "https"],
|
|
202
|
-
"domain": "gist.github.com",
|
|
203
|
-
"pathmatch": /^[/](?:([^/]+)[/])?([a-z0-9]{32,})(?:[.]git)?$/,
|
|
204
|
-
"filetemplate": "https://gist.githubusercontent.com/{user}/{project}/raw{/committish}/{path}",
|
|
205
|
-
"bugstemplate": "https://{domain}/{project}",
|
|
206
|
-
"gittemplate": "git://{domain}/{project}.git{#committish}",
|
|
207
|
-
"sshtemplate": "git@{domain}:/{project}.git{#committish}",
|
|
208
|
-
"sshurltemplate": "git+ssh://git@{domain}/{project}.git{#committish}",
|
|
209
|
-
"browsetemplate": "https://{domain}/{project}{/committish}",
|
|
210
|
-
"browsefiletemplate": "https://{domain}/{project}{/committish}{#path}",
|
|
211
|
-
"docstemplate": "https://{domain}/{project}{/committish}",
|
|
212
|
-
"httpstemplate": "git+https://{domain}/{project}.git{#committish}",
|
|
213
|
-
"shortcuttemplate": "{type}:{project}{#committish}",
|
|
214
|
-
"pathtemplate": "{project}{#committish}",
|
|
215
|
-
"tarballtemplate": "https://codeload.github.com/gist/{project}/tar.gz/{committish}",
|
|
216
|
-
"hashformat": function(fragment) {
|
|
217
|
-
return "file-" + formatHashFragment(fragment);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
var gitHostDefaults = {
|
|
222
|
-
"sshtemplate": "git@{domain}:{user}/{project}.git{#committish}",
|
|
223
|
-
"sshurltemplate": "git+ssh://git@{domain}/{user}/{project}.git{#committish}",
|
|
224
|
-
"browsetemplate": "https://{domain}/{user}/{project}{/tree/committish}",
|
|
225
|
-
"browsefiletemplate": "https://{domain}/{user}/{project}/{treepath}/{committish}/{path}{#fragment}",
|
|
226
|
-
"docstemplate": "https://{domain}/{user}/{project}{/tree/committish}#readme",
|
|
227
|
-
"httpstemplate": "git+https://{auth@}{domain}/{user}/{project}.git{#committish}",
|
|
228
|
-
"filetemplate": "https://{domain}/{user}/{project}/raw/{committish}/{path}",
|
|
229
|
-
"shortcuttemplate": "{type}:{user}/{project}{#committish}",
|
|
230
|
-
"pathtemplate": "{user}/{project}{#committish}",
|
|
231
|
-
"pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git|[/])?$/,
|
|
232
|
-
"hashformat": formatHashFragment
|
|
233
|
-
};
|
|
234
|
-
Object.keys(gitHosts).forEach(function(name) {
|
|
235
|
-
Object.keys(gitHostDefaults).forEach(function(key) {
|
|
236
|
-
if (gitHosts[name][key])
|
|
237
|
-
return;
|
|
238
|
-
gitHosts[name][key] = gitHostDefaults[key];
|
|
239
|
-
});
|
|
240
|
-
gitHosts[name].protocols_re = RegExp("^(" + gitHosts[name].protocols.map(function(protocol) {
|
|
241
|
-
return protocol.replace(/([\\+*{}()[\]$^|])/g, "\\$1");
|
|
242
|
-
}).join("|") + "):$");
|
|
243
|
-
});
|
|
244
|
-
function formatHashFragment(fragment) {
|
|
245
|
-
return fragment.toLowerCase().replace(/^\W+|\/|\W+$/g, "").replace(/\W+/g, "-");
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
// ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js
|
|
251
|
-
var require_git_host = __commonJS({
|
|
252
|
-
"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/git-host.js"(exports, module) {
|
|
253
|
-
"use strict";
|
|
254
|
-
var gitHosts = require_git_host_info();
|
|
255
|
-
var extend = Object.assign || function _extend(target, source) {
|
|
256
|
-
if (source === null || typeof source !== "object")
|
|
257
|
-
return target;
|
|
258
|
-
var keys = Object.keys(source);
|
|
259
|
-
var i = keys.length;
|
|
260
|
-
while (i--) {
|
|
261
|
-
target[keys[i]] = source[keys[i]];
|
|
262
|
-
}
|
|
263
|
-
return target;
|
|
264
|
-
};
|
|
265
|
-
module.exports = GitHost;
|
|
266
|
-
function GitHost(type, user, auth, project, committish, defaultRepresentation, opts) {
|
|
267
|
-
var gitHostInfo = this;
|
|
268
|
-
gitHostInfo.type = type;
|
|
269
|
-
Object.keys(gitHosts[type]).forEach(function(key) {
|
|
270
|
-
gitHostInfo[key] = gitHosts[type][key];
|
|
271
|
-
});
|
|
272
|
-
gitHostInfo.user = user;
|
|
273
|
-
gitHostInfo.auth = auth;
|
|
274
|
-
gitHostInfo.project = project;
|
|
275
|
-
gitHostInfo.committish = committish;
|
|
276
|
-
gitHostInfo.default = defaultRepresentation;
|
|
277
|
-
gitHostInfo.opts = opts || {};
|
|
278
|
-
}
|
|
279
|
-
GitHost.prototype.hash = function() {
|
|
280
|
-
return this.committish ? "#" + this.committish : "";
|
|
281
|
-
};
|
|
282
|
-
GitHost.prototype._fill = function(template, opts) {
|
|
283
|
-
if (!template)
|
|
284
|
-
return;
|
|
285
|
-
var vars = extend({}, opts);
|
|
286
|
-
vars.path = vars.path ? vars.path.replace(/^[/]+/g, "") : "";
|
|
287
|
-
opts = extend(extend({}, this.opts), opts);
|
|
288
|
-
var self = this;
|
|
289
|
-
Object.keys(this).forEach(function(key) {
|
|
290
|
-
if (self[key] != null && vars[key] == null)
|
|
291
|
-
vars[key] = self[key];
|
|
292
|
-
});
|
|
293
|
-
var rawAuth = vars.auth;
|
|
294
|
-
var rawcommittish = vars.committish;
|
|
295
|
-
var rawFragment = vars.fragment;
|
|
296
|
-
var rawPath = vars.path;
|
|
297
|
-
var rawProject = vars.project;
|
|
298
|
-
Object.keys(vars).forEach(function(key) {
|
|
299
|
-
var value = vars[key];
|
|
300
|
-
if ((key === "path" || key === "project") && typeof value === "string") {
|
|
301
|
-
vars[key] = value.split("/").map(function(pathComponent) {
|
|
302
|
-
return encodeURIComponent(pathComponent);
|
|
303
|
-
}).join("/");
|
|
304
|
-
} else {
|
|
305
|
-
vars[key] = encodeURIComponent(value);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
vars["auth@"] = rawAuth ? rawAuth + "@" : "";
|
|
309
|
-
vars["#fragment"] = rawFragment ? "#" + this.hashformat(rawFragment) : "";
|
|
310
|
-
vars.fragment = vars.fragment ? vars.fragment : "";
|
|
311
|
-
vars["#path"] = rawPath ? "#" + this.hashformat(rawPath) : "";
|
|
312
|
-
vars["/path"] = vars.path ? "/" + vars.path : "";
|
|
313
|
-
vars.projectPath = rawProject.split("/").map(encodeURIComponent).join("/");
|
|
314
|
-
if (opts.noCommittish) {
|
|
315
|
-
vars["#committish"] = "";
|
|
316
|
-
vars["/tree/committish"] = "";
|
|
317
|
-
vars["/committish"] = "";
|
|
318
|
-
vars.committish = "";
|
|
319
|
-
} else {
|
|
320
|
-
vars["#committish"] = rawcommittish ? "#" + rawcommittish : "";
|
|
321
|
-
vars["/tree/committish"] = vars.committish ? "/" + vars.treepath + "/" + vars.committish : "";
|
|
322
|
-
vars["/committish"] = vars.committish ? "/" + vars.committish : "";
|
|
323
|
-
vars.committish = vars.committish || "master";
|
|
324
|
-
}
|
|
325
|
-
var res = template;
|
|
326
|
-
Object.keys(vars).forEach(function(key) {
|
|
327
|
-
res = res.replace(new RegExp("[{]" + key + "[}]", "g"), vars[key]);
|
|
328
|
-
});
|
|
329
|
-
if (opts.noGitPlus) {
|
|
330
|
-
return res.replace(/^git[+]/, "");
|
|
331
|
-
} else {
|
|
332
|
-
return res;
|
|
333
|
-
}
|
|
334
|
-
};
|
|
335
|
-
GitHost.prototype.ssh = function(opts) {
|
|
336
|
-
return this._fill(this.sshtemplate, opts);
|
|
337
|
-
};
|
|
338
|
-
GitHost.prototype.sshurl = function(opts) {
|
|
339
|
-
return this._fill(this.sshurltemplate, opts);
|
|
340
|
-
};
|
|
341
|
-
GitHost.prototype.browse = function(P, F, opts) {
|
|
342
|
-
if (typeof P === "string") {
|
|
343
|
-
if (typeof F !== "string") {
|
|
344
|
-
opts = F;
|
|
345
|
-
F = null;
|
|
346
|
-
}
|
|
347
|
-
return this._fill(this.browsefiletemplate, extend({
|
|
348
|
-
fragment: F,
|
|
349
|
-
path: P
|
|
350
|
-
}, opts));
|
|
351
|
-
} else {
|
|
352
|
-
return this._fill(this.browsetemplate, P);
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
GitHost.prototype.docs = function(opts) {
|
|
356
|
-
return this._fill(this.docstemplate, opts);
|
|
357
|
-
};
|
|
358
|
-
GitHost.prototype.bugs = function(opts) {
|
|
359
|
-
return this._fill(this.bugstemplate, opts);
|
|
360
|
-
};
|
|
361
|
-
GitHost.prototype.https = function(opts) {
|
|
362
|
-
return this._fill(this.httpstemplate, opts);
|
|
363
|
-
};
|
|
364
|
-
GitHost.prototype.git = function(opts) {
|
|
365
|
-
return this._fill(this.gittemplate, opts);
|
|
366
|
-
};
|
|
367
|
-
GitHost.prototype.shortcut = function(opts) {
|
|
368
|
-
return this._fill(this.shortcuttemplate, opts);
|
|
369
|
-
};
|
|
370
|
-
GitHost.prototype.path = function(opts) {
|
|
371
|
-
return this._fill(this.pathtemplate, opts);
|
|
372
|
-
};
|
|
373
|
-
GitHost.prototype.tarball = function(opts_) {
|
|
374
|
-
var opts = extend({}, opts_, { noCommittish: false });
|
|
375
|
-
return this._fill(this.tarballtemplate, opts);
|
|
376
|
-
};
|
|
377
|
-
GitHost.prototype.file = function(P, opts) {
|
|
378
|
-
return this._fill(this.filetemplate, extend({ path: P }, opts));
|
|
379
|
-
};
|
|
380
|
-
GitHost.prototype.getDefaultRepresentation = function() {
|
|
381
|
-
return this.default;
|
|
382
|
-
};
|
|
383
|
-
GitHost.prototype.toString = function(opts) {
|
|
384
|
-
if (this.default && typeof this[this.default] === "function")
|
|
385
|
-
return this[this.default](opts);
|
|
386
|
-
return this.sshurl(opts);
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
// ../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js
|
|
392
|
-
var require_hosted_git_info = __commonJS({
|
|
393
|
-
"../../node_modules/.pnpm/hosted-git-info@2.8.9/node_modules/hosted-git-info/index.js"(exports, module) {
|
|
394
|
-
"use strict";
|
|
395
|
-
var url = __require("url");
|
|
396
|
-
var gitHosts = require_git_host_info();
|
|
397
|
-
var GitHost = module.exports = require_git_host();
|
|
398
|
-
var protocolToRepresentationMap = {
|
|
399
|
-
"git+ssh:": "sshurl",
|
|
400
|
-
"git+https:": "https",
|
|
401
|
-
"ssh:": "sshurl",
|
|
402
|
-
"git:": "git"
|
|
403
|
-
};
|
|
404
|
-
function protocolToRepresentation(protocol) {
|
|
405
|
-
return protocolToRepresentationMap[protocol] || protocol.slice(0, -1);
|
|
406
|
-
}
|
|
407
|
-
var authProtocols = {
|
|
408
|
-
"git:": true,
|
|
409
|
-
"https:": true,
|
|
410
|
-
"git+https:": true,
|
|
411
|
-
"http:": true,
|
|
412
|
-
"git+http:": true
|
|
413
|
-
};
|
|
414
|
-
var cache = {};
|
|
415
|
-
module.exports.fromUrl = function(giturl, opts) {
|
|
416
|
-
if (typeof giturl !== "string")
|
|
417
|
-
return;
|
|
418
|
-
var key = giturl + JSON.stringify(opts || {});
|
|
419
|
-
if (!(key in cache)) {
|
|
420
|
-
cache[key] = fromUrl(giturl, opts);
|
|
421
|
-
}
|
|
422
|
-
return cache[key];
|
|
423
|
-
};
|
|
424
|
-
function fromUrl(giturl, opts) {
|
|
425
|
-
if (giturl == null || giturl === "")
|
|
426
|
-
return;
|
|
427
|
-
var url2 = fixupUnqualifiedGist(
|
|
428
|
-
isGitHubShorthand(giturl) ? "github:" + giturl : giturl
|
|
429
|
-
);
|
|
430
|
-
var parsed = parseGitUrl(url2);
|
|
431
|
-
var shortcutMatch = url2.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/);
|
|
432
|
-
var matches = Object.keys(gitHosts).map(function(gitHostName) {
|
|
433
|
-
try {
|
|
434
|
-
var gitHostInfo = gitHosts[gitHostName];
|
|
435
|
-
var auth = null;
|
|
436
|
-
if (parsed.auth && authProtocols[parsed.protocol]) {
|
|
437
|
-
auth = parsed.auth;
|
|
438
|
-
}
|
|
439
|
-
var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null;
|
|
440
|
-
var user = null;
|
|
441
|
-
var project = null;
|
|
442
|
-
var defaultRepresentation = null;
|
|
443
|
-
if (shortcutMatch && shortcutMatch[1] === gitHostName) {
|
|
444
|
-
user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2]);
|
|
445
|
-
project = decodeURIComponent(shortcutMatch[3].replace(/\.git$/, ""));
|
|
446
|
-
defaultRepresentation = "shortcut";
|
|
447
|
-
} else {
|
|
448
|
-
if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, "") !== gitHostInfo.domain)
|
|
449
|
-
return;
|
|
450
|
-
if (!gitHostInfo.protocols_re.test(parsed.protocol))
|
|
451
|
-
return;
|
|
452
|
-
if (!parsed.path)
|
|
453
|
-
return;
|
|
454
|
-
var pathmatch = gitHostInfo.pathmatch;
|
|
455
|
-
var matched = parsed.path.match(pathmatch);
|
|
456
|
-
if (!matched)
|
|
457
|
-
return;
|
|
458
|
-
if (matched[1] !== null && matched[1] !== void 0) {
|
|
459
|
-
user = decodeURIComponent(matched[1].replace(/^:/, ""));
|
|
460
|
-
}
|
|
461
|
-
project = decodeURIComponent(matched[2]);
|
|
462
|
-
defaultRepresentation = protocolToRepresentation(parsed.protocol);
|
|
463
|
-
}
|
|
464
|
-
return new GitHost(gitHostName, user, auth, project, committish, defaultRepresentation, opts);
|
|
465
|
-
} catch (ex) {
|
|
466
|
-
if (ex instanceof URIError) {
|
|
467
|
-
} else
|
|
468
|
-
throw ex;
|
|
469
|
-
}
|
|
470
|
-
}).filter(function(gitHostInfo) {
|
|
471
|
-
return gitHostInfo;
|
|
472
|
-
});
|
|
473
|
-
if (matches.length !== 1)
|
|
474
|
-
return;
|
|
475
|
-
return matches[0];
|
|
476
|
-
}
|
|
477
|
-
function isGitHubShorthand(arg) {
|
|
478
|
-
return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg);
|
|
479
|
-
}
|
|
480
|
-
function fixupUnqualifiedGist(giturl) {
|
|
481
|
-
var parsed = url.parse(giturl);
|
|
482
|
-
if (parsed.protocol === "gist:" && parsed.host && !parsed.path) {
|
|
483
|
-
return parsed.protocol + "/" + parsed.host;
|
|
484
|
-
} else {
|
|
485
|
-
return giturl;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
function parseGitUrl(giturl) {
|
|
489
|
-
var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/);
|
|
490
|
-
if (!matched) {
|
|
491
|
-
var legacy = url.parse(giturl);
|
|
492
|
-
if (legacy.auth && typeof url.URL === "function") {
|
|
493
|
-
var authmatch = giturl.match(/[^@]+@[^:/]+/);
|
|
494
|
-
if (authmatch) {
|
|
495
|
-
var whatwg = new url.URL(authmatch[0]);
|
|
496
|
-
legacy.auth = whatwg.username || "";
|
|
497
|
-
if (whatwg.password)
|
|
498
|
-
legacy.auth += ":" + whatwg.password;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return legacy;
|
|
502
|
-
}
|
|
503
|
-
return {
|
|
504
|
-
protocol: "git+ssh:",
|
|
505
|
-
slashes: true,
|
|
506
|
-
auth: matched[1],
|
|
507
|
-
host: matched[2],
|
|
508
|
-
port: null,
|
|
509
|
-
hostname: matched[2],
|
|
510
|
-
hash: matched[4],
|
|
511
|
-
search: null,
|
|
512
|
-
query: null,
|
|
513
|
-
pathname: "/" + matched[3],
|
|
514
|
-
path: "/" + matched[3],
|
|
515
|
-
href: "git+ssh://" + matched[1] + "@" + matched[2] + "/" + matched[3] + (matched[4] || "")
|
|
516
|
-
};
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
// ../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js
|
|
522
|
-
var require_os_tmpdir = __commonJS({
|
|
523
|
-
"../../node_modules/.pnpm/os-tmpdir@1.0.2/node_modules/os-tmpdir/index.js"(exports, module) {
|
|
524
|
-
"use strict";
|
|
525
|
-
var isWindows = process.platform === "win32";
|
|
526
|
-
var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
|
|
527
|
-
module.exports = function() {
|
|
528
|
-
var path2;
|
|
529
|
-
if (isWindows) {
|
|
530
|
-
path2 = process.env.TEMP || process.env.TMP || (process.env.SystemRoot || process.env.windir) + "\\temp";
|
|
531
|
-
} else {
|
|
532
|
-
path2 = process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp";
|
|
533
|
-
}
|
|
534
|
-
if (trailingSlashRe.test(path2)) {
|
|
535
|
-
path2 = path2.slice(0, -1);
|
|
536
|
-
}
|
|
537
|
-
return path2;
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
});
|
|
541
|
-
|
|
542
|
-
// ../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js
|
|
543
|
-
var require_os_homedir = __commonJS({
|
|
544
|
-
"../../node_modules/.pnpm/os-homedir@1.0.2/node_modules/os-homedir/index.js"(exports, module) {
|
|
545
|
-
"use strict";
|
|
546
|
-
var os = __require("os");
|
|
547
|
-
function homedir() {
|
|
548
|
-
var env = process.env;
|
|
549
|
-
var home = env.HOME;
|
|
550
|
-
var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
|
|
551
|
-
if (process.platform === "win32") {
|
|
552
|
-
return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
|
|
553
|
-
}
|
|
554
|
-
if (process.platform === "darwin") {
|
|
555
|
-
return home || (user ? "/Users/" + user : null);
|
|
556
|
-
}
|
|
557
|
-
if (process.platform === "linux") {
|
|
558
|
-
return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null);
|
|
559
|
-
}
|
|
560
|
-
return home || null;
|
|
561
|
-
}
|
|
562
|
-
module.exports = typeof os.homedir === "function" ? os.homedir : homedir;
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
|
|
566
|
-
// ../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js
|
|
567
|
-
var require_osenv = __commonJS({
|
|
568
|
-
"../../node_modules/.pnpm/osenv@0.1.5/node_modules/osenv/osenv.js"(exports) {
|
|
569
|
-
var isWindows = process.platform === "win32";
|
|
570
|
-
var path2 = __require("path");
|
|
571
|
-
var exec = __require("child_process").exec;
|
|
572
|
-
var osTmpdir = require_os_tmpdir();
|
|
573
|
-
var osHomedir = require_os_homedir();
|
|
574
|
-
function memo(key, lookup, fallback) {
|
|
575
|
-
var fell = false;
|
|
576
|
-
var falling = false;
|
|
577
|
-
exports[key] = function(cb) {
|
|
578
|
-
var val = lookup();
|
|
579
|
-
if (!val && !fell && !falling && fallback) {
|
|
580
|
-
fell = true;
|
|
581
|
-
falling = true;
|
|
582
|
-
exec(fallback, function(er, output, stderr) {
|
|
583
|
-
falling = false;
|
|
584
|
-
if (er)
|
|
585
|
-
return;
|
|
586
|
-
val = output.trim();
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
exports[key] = function(cb2) {
|
|
590
|
-
if (cb2)
|
|
591
|
-
process.nextTick(cb2.bind(null, null, val));
|
|
592
|
-
return val;
|
|
593
|
-
};
|
|
594
|
-
if (cb && !falling)
|
|
595
|
-
process.nextTick(cb.bind(null, null, val));
|
|
596
|
-
return val;
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
memo("user", function() {
|
|
600
|
-
return isWindows ? process.env.USERDOMAIN + "\\" + process.env.USERNAME : process.env.USER;
|
|
601
|
-
}, "whoami");
|
|
602
|
-
memo("prompt", function() {
|
|
603
|
-
return isWindows ? process.env.PROMPT : process.env.PS1;
|
|
604
|
-
});
|
|
605
|
-
memo("hostname", function() {
|
|
606
|
-
return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME;
|
|
607
|
-
}, "hostname");
|
|
608
|
-
memo("tmpdir", function() {
|
|
609
|
-
return osTmpdir();
|
|
610
|
-
});
|
|
611
|
-
memo("home", function() {
|
|
612
|
-
return osHomedir();
|
|
613
|
-
});
|
|
614
|
-
memo("path", function() {
|
|
615
|
-
return (process.env.PATH || process.env.Path || process.env.path).split(isWindows ? ";" : ":");
|
|
616
|
-
});
|
|
617
|
-
memo("editor", function() {
|
|
618
|
-
return process.env.EDITOR || process.env.VISUAL || (isWindows ? "notepad.exe" : "vi");
|
|
619
|
-
});
|
|
620
|
-
memo("shell", function() {
|
|
621
|
-
return isWindows ? process.env.ComSpec || "cmd" : process.env.SHELL || "bash";
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
// ../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js
|
|
627
|
-
var require_npa = __commonJS({
|
|
628
|
-
"../../node_modules/.pnpm/npm-package-arg@6.1.0/node_modules/npm-package-arg/npa.js"(exports, module) {
|
|
629
|
-
"use strict";
|
|
630
|
-
module.exports = npa2;
|
|
631
|
-
module.exports.resolve = resolve3;
|
|
632
|
-
module.exports.Result = Result;
|
|
633
|
-
var url;
|
|
634
|
-
var HostedGit;
|
|
635
|
-
var semver;
|
|
636
|
-
var path2;
|
|
637
|
-
var validatePackageName;
|
|
638
|
-
var osenv;
|
|
639
|
-
var isWindows = process.platform === "win32" || global.FAKE_WINDOWS;
|
|
640
|
-
var hasSlashes = isWindows ? /\\|[/]/ : /[/]/;
|
|
641
|
-
var isURL = /^(?:git[+])?[a-z]+:/i;
|
|
642
|
-
var isFilename = /[.](?:tgz|tar.gz|tar)$/i;
|
|
643
|
-
function npa2(arg, where) {
|
|
644
|
-
let name;
|
|
645
|
-
let spec;
|
|
646
|
-
if (typeof arg === "object") {
|
|
647
|
-
if (arg instanceof Result && (!where || where === arg.where)) {
|
|
648
|
-
return arg;
|
|
649
|
-
} else if (arg.name && arg.rawSpec) {
|
|
650
|
-
return npa2.resolve(arg.name, arg.rawSpec, where || arg.where);
|
|
651
|
-
} else {
|
|
652
|
-
return npa2(arg.raw, where || arg.where);
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
const nameEndsAt = arg[0] === "@" ? arg.slice(1).indexOf("@") + 1 : arg.indexOf("@");
|
|
656
|
-
const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg;
|
|
657
|
-
if (isURL.test(arg)) {
|
|
658
|
-
spec = arg;
|
|
659
|
-
} else if (namePart[0] !== "@" && (hasSlashes.test(namePart) || isFilename.test(namePart))) {
|
|
660
|
-
spec = arg;
|
|
661
|
-
} else if (nameEndsAt > 0) {
|
|
662
|
-
name = namePart;
|
|
663
|
-
spec = arg.slice(nameEndsAt + 1);
|
|
664
|
-
} else {
|
|
665
|
-
if (!validatePackageName)
|
|
666
|
-
validatePackageName = require_validate_npm_package_name();
|
|
667
|
-
const valid = validatePackageName(arg);
|
|
668
|
-
if (valid.validForOldPackages) {
|
|
669
|
-
name = arg;
|
|
670
|
-
} else {
|
|
671
|
-
spec = arg;
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
return resolve3(name, spec, where, arg);
|
|
675
|
-
}
|
|
676
|
-
var isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/;
|
|
677
|
-
function resolve3(name, spec, where, arg) {
|
|
678
|
-
const res = new Result({
|
|
679
|
-
raw: arg,
|
|
680
|
-
name,
|
|
681
|
-
rawSpec: spec,
|
|
682
|
-
fromArgument: arg != null
|
|
683
|
-
});
|
|
684
|
-
if (name)
|
|
685
|
-
res.setName(name);
|
|
686
|
-
if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) {
|
|
687
|
-
return fromFile(res, where);
|
|
688
|
-
} else if (spec && /^npm:/i.test(spec)) {
|
|
689
|
-
return fromAlias(res, where);
|
|
690
|
-
}
|
|
691
|
-
if (!HostedGit)
|
|
692
|
-
HostedGit = require_hosted_git_info();
|
|
693
|
-
const hosted = HostedGit.fromUrl(spec, { noGitPlus: true, noCommittish: true });
|
|
694
|
-
if (hosted) {
|
|
695
|
-
return fromHostedGit(res, hosted);
|
|
696
|
-
} else if (spec && isURL.test(spec)) {
|
|
697
|
-
return fromURL(res);
|
|
698
|
-
} else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) {
|
|
699
|
-
return fromFile(res, where);
|
|
700
|
-
} else {
|
|
701
|
-
return fromRegistry(res);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
function invalidPackageName(name, valid) {
|
|
705
|
-
const err = new Error(`Invalid package name "${name}": ${valid.errors.join("; ")}`);
|
|
706
|
-
err.code = "EINVALIDPACKAGENAME";
|
|
707
|
-
return err;
|
|
708
|
-
}
|
|
709
|
-
function invalidTagName(name) {
|
|
710
|
-
const err = new Error(`Invalid tag name "${name}": Tags may not have any characters that encodeURIComponent encodes.`);
|
|
711
|
-
err.code = "EINVALIDTAGNAME";
|
|
712
|
-
return err;
|
|
713
|
-
}
|
|
714
|
-
function Result(opts) {
|
|
715
|
-
this.type = opts.type;
|
|
716
|
-
this.registry = opts.registry;
|
|
717
|
-
this.where = opts.where;
|
|
718
|
-
if (opts.raw == null) {
|
|
719
|
-
this.raw = opts.name ? opts.name + "@" + opts.rawSpec : opts.rawSpec;
|
|
720
|
-
} else {
|
|
721
|
-
this.raw = opts.raw;
|
|
722
|
-
}
|
|
723
|
-
this.name = void 0;
|
|
724
|
-
this.escapedName = void 0;
|
|
725
|
-
this.scope = void 0;
|
|
726
|
-
this.rawSpec = opts.rawSpec == null ? "" : opts.rawSpec;
|
|
727
|
-
this.saveSpec = opts.saveSpec;
|
|
728
|
-
this.fetchSpec = opts.fetchSpec;
|
|
729
|
-
if (opts.name)
|
|
730
|
-
this.setName(opts.name);
|
|
731
|
-
this.gitRange = opts.gitRange;
|
|
732
|
-
this.gitCommittish = opts.gitCommittish;
|
|
733
|
-
this.hosted = opts.hosted;
|
|
734
|
-
}
|
|
735
|
-
Result.prototype = {};
|
|
736
|
-
Result.prototype.setName = function(name) {
|
|
737
|
-
if (!validatePackageName)
|
|
738
|
-
validatePackageName = require_validate_npm_package_name();
|
|
739
|
-
const valid = validatePackageName(name);
|
|
740
|
-
if (!valid.validForOldPackages) {
|
|
741
|
-
throw invalidPackageName(name, valid);
|
|
742
|
-
}
|
|
743
|
-
this.name = name;
|
|
744
|
-
this.scope = name[0] === "@" ? name.slice(0, name.indexOf("/")) : void 0;
|
|
745
|
-
this.escapedName = name.replace("/", "%2f");
|
|
746
|
-
return this;
|
|
747
|
-
};
|
|
748
|
-
Result.prototype.toString = function() {
|
|
749
|
-
const full = [];
|
|
750
|
-
if (this.name != null && this.name !== "")
|
|
751
|
-
full.push(this.name);
|
|
752
|
-
const spec = this.saveSpec || this.fetchSpec || this.rawSpec;
|
|
753
|
-
if (spec != null && spec !== "")
|
|
754
|
-
full.push(spec);
|
|
755
|
-
return full.length ? full.join("@") : this.raw;
|
|
756
|
-
};
|
|
757
|
-
Result.prototype.toJSON = function() {
|
|
758
|
-
const result = Object.assign({}, this);
|
|
759
|
-
delete result.hosted;
|
|
760
|
-
return result;
|
|
761
|
-
};
|
|
762
|
-
function setGitCommittish(res, committish) {
|
|
763
|
-
if (committish != null && committish.length >= 7 && committish.slice(0, 7) === "semver:") {
|
|
764
|
-
res.gitRange = decodeURIComponent(committish.slice(7));
|
|
765
|
-
res.gitCommittish = null;
|
|
766
|
-
} else {
|
|
767
|
-
res.gitCommittish = committish === "" ? null : committish;
|
|
768
|
-
}
|
|
769
|
-
return res;
|
|
770
|
-
}
|
|
771
|
-
var isAbsolutePath = /^[/]|^[A-Za-z]:/;
|
|
772
|
-
function resolvePath(where, spec) {
|
|
773
|
-
if (isAbsolutePath.test(spec))
|
|
774
|
-
return spec;
|
|
775
|
-
if (!path2)
|
|
776
|
-
path2 = __require("path");
|
|
777
|
-
return path2.resolve(where, spec);
|
|
778
|
-
}
|
|
779
|
-
function isAbsolute(dir) {
|
|
780
|
-
if (dir[0] === "/")
|
|
781
|
-
return true;
|
|
782
|
-
if (/^[A-Za-z]:/.test(dir))
|
|
783
|
-
return true;
|
|
784
|
-
return false;
|
|
785
|
-
}
|
|
786
|
-
function fromFile(res, where) {
|
|
787
|
-
if (!where)
|
|
788
|
-
where = process.cwd();
|
|
789
|
-
res.type = isFilename.test(res.rawSpec) ? "file" : "directory";
|
|
790
|
-
res.where = where;
|
|
791
|
-
const spec = res.rawSpec.replace(/\\/g, "/").replace(/^file:[/]*([A-Za-z]:)/, "$1").replace(/^file:(?:[/]*([~./]))?/, "$1");
|
|
792
|
-
if (/^~[/]/.test(spec)) {
|
|
793
|
-
if (!osenv)
|
|
794
|
-
osenv = require_osenv();
|
|
795
|
-
res.fetchSpec = resolvePath(osenv.home(), spec.slice(2));
|
|
796
|
-
res.saveSpec = "file:" + spec;
|
|
797
|
-
} else {
|
|
798
|
-
res.fetchSpec = resolvePath(where, spec);
|
|
799
|
-
if (isAbsolute(spec)) {
|
|
800
|
-
res.saveSpec = "file:" + spec;
|
|
801
|
-
} else {
|
|
802
|
-
if (!path2)
|
|
803
|
-
path2 = __require("path");
|
|
804
|
-
res.saveSpec = "file:" + path2.relative(where, res.fetchSpec);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
return res;
|
|
808
|
-
}
|
|
809
|
-
function fromHostedGit(res, hosted) {
|
|
810
|
-
res.type = "git";
|
|
811
|
-
res.hosted = hosted;
|
|
812
|
-
res.saveSpec = hosted.toString({ noGitPlus: false, noCommittish: false });
|
|
813
|
-
res.fetchSpec = hosted.getDefaultRepresentation() === "shortcut" ? null : hosted.toString();
|
|
814
|
-
return setGitCommittish(res, hosted.committish);
|
|
815
|
-
}
|
|
816
|
-
function unsupportedURLType(protocol, spec) {
|
|
817
|
-
const err = new Error(`Unsupported URL Type "${protocol}": ${spec}`);
|
|
818
|
-
err.code = "EUNSUPPORTEDPROTOCOL";
|
|
819
|
-
return err;
|
|
820
|
-
}
|
|
821
|
-
function matchGitScp(spec) {
|
|
822
|
-
const matched = spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);
|
|
823
|
-
return matched && !matched[1].match(/:[0-9]+\/?.*$/i) && {
|
|
824
|
-
fetchSpec: matched[1],
|
|
825
|
-
gitCommittish: matched[2] == null ? null : matched[2]
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
function fromURL(res) {
|
|
829
|
-
if (!url)
|
|
830
|
-
url = __require("url");
|
|
831
|
-
const urlparse = url.parse(res.rawSpec);
|
|
832
|
-
res.saveSpec = res.rawSpec;
|
|
833
|
-
switch (urlparse.protocol) {
|
|
834
|
-
case "git:":
|
|
835
|
-
case "git+http:":
|
|
836
|
-
case "git+https:":
|
|
837
|
-
case "git+rsync:":
|
|
838
|
-
case "git+ftp:":
|
|
839
|
-
case "git+file:":
|
|
840
|
-
case "git+ssh:":
|
|
841
|
-
res.type = "git";
|
|
842
|
-
const match = urlparse.protocol === "git+ssh:" && matchGitScp(res.rawSpec);
|
|
843
|
-
if (match) {
|
|
844
|
-
setGitCommittish(res, match.gitCommittish);
|
|
845
|
-
res.fetchSpec = match.fetchSpec;
|
|
846
|
-
} else {
|
|
847
|
-
setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : "");
|
|
848
|
-
urlparse.protocol = urlparse.protocol.replace(/^git[+]/, "");
|
|
849
|
-
delete urlparse.hash;
|
|
850
|
-
res.fetchSpec = url.format(urlparse);
|
|
851
|
-
}
|
|
852
|
-
break;
|
|
853
|
-
case "http:":
|
|
854
|
-
case "https:":
|
|
855
|
-
res.type = "remote";
|
|
856
|
-
res.fetchSpec = res.saveSpec;
|
|
857
|
-
break;
|
|
858
|
-
default:
|
|
859
|
-
throw unsupportedURLType(urlparse.protocol, res.rawSpec);
|
|
860
|
-
}
|
|
861
|
-
return res;
|
|
862
|
-
}
|
|
863
|
-
function fromAlias(res, where) {
|
|
864
|
-
const subSpec = npa2(res.rawSpec.substr(4), where);
|
|
865
|
-
if (subSpec.type === "alias") {
|
|
866
|
-
throw new Error("nested aliases not supported");
|
|
867
|
-
}
|
|
868
|
-
if (!subSpec.registry) {
|
|
869
|
-
throw new Error("aliases only work for registry deps");
|
|
870
|
-
}
|
|
871
|
-
res.subSpec = subSpec;
|
|
872
|
-
res.registry = true;
|
|
873
|
-
res.type = "alias";
|
|
874
|
-
res.saveSpec = null;
|
|
875
|
-
res.fetchSpec = null;
|
|
876
|
-
return res;
|
|
877
|
-
}
|
|
878
|
-
function fromRegistry(res) {
|
|
879
|
-
res.registry = true;
|
|
880
|
-
const spec = res.rawSpec === "" ? "latest" : res.rawSpec;
|
|
881
|
-
res.saveSpec = null;
|
|
882
|
-
res.fetchSpec = spec;
|
|
883
|
-
if (!semver)
|
|
884
|
-
semver = require_semver();
|
|
885
|
-
const version2 = semver.valid(spec, true);
|
|
886
|
-
const range = semver.validRange(spec, true);
|
|
887
|
-
if (version2) {
|
|
888
|
-
res.type = "version";
|
|
889
|
-
} else if (range) {
|
|
890
|
-
res.type = "range";
|
|
891
|
-
} else {
|
|
892
|
-
if (encodeURIComponent(spec) !== spec) {
|
|
893
|
-
throw invalidTagName(spec);
|
|
894
|
-
}
|
|
895
|
-
res.type = "tag";
|
|
896
|
-
}
|
|
897
|
-
return res;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
});
|
|
901
|
-
|
|
902
23
|
// ../../node_modules/.pnpm/mime-db@1.40.0/node_modules/mime-db/db.json
|
|
903
24
|
var require_db = __commonJS({
|
|
904
25
|
"../../node_modules/.pnpm/mime-db@1.40.0/node_modules/mime-db/db.json"(exports, module) {
|
|
@@ -10795,601 +9916,80 @@ var require_lib3 = __commonJS({
|
|
|
10795
9916
|
}
|
|
10796
9917
|
});
|
|
10797
9918
|
|
|
10798
|
-
// src/util/
|
|
10799
|
-
var
|
|
10800
|
-
var
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
9919
|
+
// src/util/build/write-build-result.ts
|
|
9920
|
+
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
9921
|
+
var import_mime_types = __toESM(require_mime_types(), 1);
|
|
9922
|
+
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
9923
|
+
var import_promisepipe2 = __toESM(require_promisepipe(), 1);
|
|
9924
|
+
import {
|
|
9925
|
+
basename,
|
|
9926
|
+
dirname,
|
|
9927
|
+
extname,
|
|
9928
|
+
join as join2,
|
|
9929
|
+
relative as relative2,
|
|
9930
|
+
resolve,
|
|
9931
|
+
posix
|
|
9932
|
+
} from "path";
|
|
9933
|
+
import {
|
|
9934
|
+
FileFsRef,
|
|
9935
|
+
download,
|
|
9936
|
+
downloadFile,
|
|
9937
|
+
getLambdaOptionsFromFunction,
|
|
9938
|
+
normalizePath,
|
|
9939
|
+
isBackendBuilder,
|
|
9940
|
+
isExperimentalBackendsEnabled,
|
|
9941
|
+
isExperimentalService,
|
|
9942
|
+
isExperimentalServiceV2,
|
|
9943
|
+
isSymbolicLink
|
|
9944
|
+
} from "@vercel/build-utils";
|
|
10814
9945
|
|
|
10815
|
-
// src/util/
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
9946
|
+
// src/util/build/merge.ts
|
|
9947
|
+
var import_error_utils = __toESM(require_dist(), 1);
|
|
9948
|
+
var import_fs_extra = __toESM(require_lib(), 1);
|
|
9949
|
+
import { join, relative } from "path";
|
|
9950
|
+
async function merge(source, destination, ignoreFilter, sourceRoot) {
|
|
9951
|
+
const root = sourceRoot || source;
|
|
9952
|
+
if (ignoreFilter) {
|
|
9953
|
+
const relPath = relative(root, source);
|
|
9954
|
+
if (relPath && !ignoreFilter(relPath)) {
|
|
9955
|
+
await (0, import_fs_extra.remove)(source);
|
|
9956
|
+
return;
|
|
10822
9957
|
}
|
|
10823
9958
|
}
|
|
10824
|
-
|
|
10825
|
-
}
|
|
10826
|
-
var asAbsolute = function(path2, parent) {
|
|
10827
|
-
if (path2[0] === "/") {
|
|
10828
|
-
return path2;
|
|
10829
|
-
}
|
|
10830
|
-
return resolve(parent, path2);
|
|
10831
|
-
};
|
|
10832
|
-
async function staticFiles(path2, { src }) {
|
|
10833
|
-
const { debug, time } = output_manager_default;
|
|
10834
|
-
let files = [];
|
|
10835
|
-
const source = src || ".";
|
|
10836
|
-
const search = resolve(path2, source);
|
|
10837
|
-
const { ig } = await (0, import_client.getVercelIgnore)(path2);
|
|
10838
|
-
const filter = ig.createFilter();
|
|
10839
|
-
const prefixLength = path2.length + 1;
|
|
10840
|
-
const accepts = (file) => {
|
|
10841
|
-
const relativePath = file.slice(prefixLength);
|
|
10842
|
-
if (relativePath === "") {
|
|
10843
|
-
return true;
|
|
10844
|
-
}
|
|
10845
|
-
const accepted = filter(relativePath);
|
|
10846
|
-
if (!accepted) {
|
|
10847
|
-
debug(`Ignoring ${file}`);
|
|
10848
|
-
}
|
|
10849
|
-
return accepted;
|
|
10850
|
-
};
|
|
10851
|
-
files = await time(
|
|
10852
|
-
`Locating files ${path2}`,
|
|
10853
|
-
explode([search], {
|
|
10854
|
-
accepts
|
|
10855
|
-
})
|
|
10856
|
-
);
|
|
10857
|
-
return unique_strings_default(files);
|
|
10858
|
-
}
|
|
10859
|
-
async function explode(paths, { accepts }) {
|
|
10860
|
-
const { debug } = output_manager_default;
|
|
10861
|
-
const list = async (file) => {
|
|
10862
|
-
let path2 = file;
|
|
10863
|
-
let s;
|
|
10864
|
-
if (!accepts(file)) {
|
|
10865
|
-
return null;
|
|
10866
|
-
}
|
|
10867
|
-
try {
|
|
10868
|
-
s = await import_fs_extra.default.stat(path2);
|
|
10869
|
-
} catch (_e) {
|
|
10870
|
-
path2 = `${file}.js`;
|
|
10871
|
-
try {
|
|
10872
|
-
s = await import_fs_extra.default.stat(path2);
|
|
10873
|
-
} catch (_e2) {
|
|
10874
|
-
debug(`Ignoring invalid file ${file}`);
|
|
10875
|
-
return null;
|
|
10876
|
-
}
|
|
10877
|
-
}
|
|
10878
|
-
if (s.isDirectory()) {
|
|
10879
|
-
let all;
|
|
10880
|
-
try {
|
|
10881
|
-
all = await import_fs_extra.default.readdir(file);
|
|
10882
|
-
} catch (err) {
|
|
10883
|
-
const code2 = err instanceof Error && "code" in err ? err.code : void 0;
|
|
10884
|
-
if (code2 === "ENOENT" || code2 === "ENOTDIR") {
|
|
10885
|
-
debug(`Ignoring directory that has since been removed ${file}`);
|
|
10886
|
-
return null;
|
|
10887
|
-
}
|
|
10888
|
-
throw err;
|
|
10889
|
-
}
|
|
10890
|
-
const recursive = many(all.map((subdir) => asAbsolute(subdir, file)));
|
|
10891
|
-
return recursive;
|
|
10892
|
-
}
|
|
10893
|
-
if (!s.isFile()) {
|
|
10894
|
-
debug(`Ignoring special file ${file}`);
|
|
10895
|
-
return null;
|
|
10896
|
-
}
|
|
10897
|
-
return path2;
|
|
10898
|
-
};
|
|
10899
|
-
const many = (all) => Promise.all(all.map((file) => list(file)));
|
|
10900
|
-
const arrayOfArrays = await many(paths);
|
|
10901
|
-
return flatten(arrayOfArrays).filter(notNull);
|
|
10902
|
-
}
|
|
10903
|
-
function notNull(value) {
|
|
10904
|
-
return value !== null;
|
|
10905
|
-
}
|
|
10906
|
-
|
|
10907
|
-
// src/util/build/import-builders.ts
|
|
10908
|
-
var import_npm_package_arg = __toESM(require_npa(), 1);
|
|
10909
|
-
var import_semver2 = __toESM(require_semver(), 1);
|
|
10910
|
-
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
10911
|
-
var import_fs_detectors = __toESM(require_dist3(), 1);
|
|
10912
|
-
import { dirname, join as join2 } from "path";
|
|
10913
|
-
import { createRequire } from "module";
|
|
10914
|
-
|
|
10915
|
-
// src/util/build/static-builder.ts
|
|
10916
|
-
var static_builder_exports = {};
|
|
10917
|
-
__export(static_builder_exports, {
|
|
10918
|
-
build: () => build,
|
|
10919
|
-
shouldServe: () => shouldServe,
|
|
10920
|
-
version: () => version
|
|
10921
|
-
});
|
|
10922
|
-
var import_minimatch = __toESM(require_minimatch(), 1);
|
|
10923
|
-
import { shouldServe as defaultShouldServe } from "@vercel/build-utils";
|
|
10924
|
-
var version = 2;
|
|
10925
|
-
var ALWAYS_EXCLUDED_PREFIXES = [".git/", "node_modules/"];
|
|
10926
|
-
var ALWAYS_EXCLUDED_FILES = [
|
|
10927
|
-
"vercel.json",
|
|
10928
|
-
"vercel.toml",
|
|
10929
|
-
...VERCEL_CONFIG_EXTENSIONS.map((ext) => `vercel.${ext}`),
|
|
10930
|
-
".vercelignore",
|
|
10931
|
-
"now.json",
|
|
10932
|
-
".nowignore"
|
|
10933
|
-
];
|
|
10934
|
-
var DEFAULT_EXCLUDED_FILES = [
|
|
10935
|
-
".gitignore",
|
|
10936
|
-
"package.json",
|
|
10937
|
-
"package-lock.json",
|
|
10938
|
-
"yarn.lock",
|
|
10939
|
-
"pnpm-lock.yaml",
|
|
10940
|
-
"bun.lock",
|
|
10941
|
-
"bun.lockb",
|
|
10942
|
-
"README.md"
|
|
10943
|
-
];
|
|
10944
|
-
var build = async ({ entrypoint, files, config }) => {
|
|
10945
|
-
const output = {};
|
|
10946
|
-
const outputDirectory = config.zeroConfig ? config.outputDirectory : "";
|
|
10947
|
-
for (let [filename, fileFsRef] of Object.entries(files)) {
|
|
10948
|
-
if (ALWAYS_EXCLUDED_PREFIXES.some((prefix) => filename.startsWith(prefix)) || ALWAYS_EXCLUDED_FILES.includes(filename) || DEFAULT_EXCLUDED_FILES.includes(filename) || filename.startsWith(".env")) {
|
|
10949
|
-
continue;
|
|
10950
|
-
}
|
|
10951
|
-
if (entrypoint && !(entrypoint === filename || (0, import_minimatch.default)(filename, entrypoint, { dot: true }))) {
|
|
10952
|
-
continue;
|
|
10953
|
-
}
|
|
10954
|
-
if (outputDirectory) {
|
|
10955
|
-
const outputMatch = outputDirectory + "/";
|
|
10956
|
-
if (filename.startsWith(outputMatch)) {
|
|
10957
|
-
filename = filename.slice(outputMatch.length);
|
|
10958
|
-
}
|
|
10959
|
-
}
|
|
10960
|
-
output[filename] = fileFsRef;
|
|
10961
|
-
}
|
|
10962
|
-
return { output };
|
|
10963
|
-
};
|
|
10964
|
-
var shouldServe = (_opts) => {
|
|
10965
|
-
const opts = { ..._opts };
|
|
10966
|
-
const {
|
|
10967
|
-
config: { zeroConfig, outputDirectory }
|
|
10968
|
-
} = opts;
|
|
10969
|
-
if (zeroConfig && outputDirectory) {
|
|
10970
|
-
opts.entrypoint = `${outputDirectory}/${opts.entrypoint}`;
|
|
10971
|
-
opts.requestPath = `${outputDirectory}/${opts.requestPath}`;
|
|
10972
|
-
}
|
|
10973
|
-
return defaultShouldServe(opts);
|
|
10974
|
-
};
|
|
10975
|
-
|
|
10976
|
-
// src/util/build/import-builders.ts
|
|
10977
|
-
var import_error_utils2 = __toESM(require_dist(), 1);
|
|
10978
|
-
|
|
10979
|
-
// src/util/build/install-builders.ts
|
|
10980
|
-
var import_pluralize = __toESM(require_pluralize(), 1);
|
|
10981
|
-
var import_semver = __toESM(require_semver(), 1);
|
|
10982
|
-
var import_fs_extra2 = __toESM(require_lib(), 1);
|
|
10983
|
-
var import_execa = __toESM(require_execa(), 1);
|
|
10984
|
-
import { URL } from "url";
|
|
10985
|
-
import { join } from "path";
|
|
10986
|
-
var import_error_utils = __toESM(require_dist(), 1);
|
|
10987
|
-
function getErrorMessage(err, execaMessage) {
|
|
10988
|
-
if (!err || !("stderr" in err)) {
|
|
10989
|
-
return execaMessage;
|
|
10990
|
-
}
|
|
10991
|
-
if (typeof err.stderr === "string") {
|
|
10992
|
-
return err.stderr;
|
|
10993
|
-
}
|
|
10994
|
-
return execaMessage;
|
|
10995
|
-
}
|
|
10996
|
-
async function untracedInstallBuilders(buildersDir, buildersToAdd) {
|
|
10997
|
-
const resolvedSpecs = /* @__PURE__ */ new Map();
|
|
10998
|
-
const buildersPkgPath = join(buildersDir, "package.json");
|
|
10999
|
-
try {
|
|
11000
|
-
const emptyPkgJson = {
|
|
11001
|
-
private: true,
|
|
11002
|
-
license: "UNLICENSED"
|
|
11003
|
-
};
|
|
11004
|
-
await (0, import_fs_extra2.outputJSON)(buildersPkgPath, emptyPkgJson, {
|
|
11005
|
-
flag: "wx"
|
|
11006
|
-
});
|
|
11007
|
-
} catch (err) {
|
|
11008
|
-
if (err.code !== "EEXIST")
|
|
11009
|
-
throw err;
|
|
11010
|
-
}
|
|
11011
|
-
output_manager_default.log(
|
|
11012
|
-
`Installing ${(0, import_pluralize.default)("Builder", buildersToAdd.size)}: ${Array.from(
|
|
11013
|
-
buildersToAdd
|
|
11014
|
-
).join(", ")}`
|
|
11015
|
-
);
|
|
11016
|
-
const buildUtilsVersion = pkg_default.dependencies?.["@vercel/build-utils"];
|
|
11017
|
-
const buildUtilsSpec = buildUtilsVersion && (0, import_semver.validRange)(buildUtilsVersion) ? `@vercel/build-utils@${buildUtilsVersion}` : "@vercel/build-utils";
|
|
11018
|
-
try {
|
|
11019
|
-
const { stderr } = await (0, import_execa.default)(
|
|
11020
|
-
"npm",
|
|
11021
|
-
["install", buildUtilsSpec, ...buildersToAdd],
|
|
11022
|
-
{
|
|
11023
|
-
cwd: buildersDir,
|
|
11024
|
-
stdio: "pipe",
|
|
11025
|
-
reject: true
|
|
11026
|
-
}
|
|
11027
|
-
);
|
|
11028
|
-
stderr.split("/\r?\n/").filter((line) => line.includes("npm WARN deprecated")).forEach((line) => {
|
|
11029
|
-
output_manager_default.warn(line);
|
|
11030
|
-
});
|
|
11031
|
-
} catch (err) {
|
|
11032
|
-
if ((0, import_error_utils.isError)(err)) {
|
|
11033
|
-
const execaMessage = err.message;
|
|
11034
|
-
let message = getErrorMessage(err, execaMessage);
|
|
11035
|
-
if (execaMessage.startsWith("Command failed with ENOENT")) {
|
|
11036
|
-
message = `Please install ${cmd("npm")} before continuing`;
|
|
11037
|
-
} else {
|
|
11038
|
-
const notFound = /GET (.*) - Not found/.exec(message);
|
|
11039
|
-
if (notFound) {
|
|
11040
|
-
const url = new URL(notFound[1]);
|
|
11041
|
-
const packageName = decodeURIComponent(url.pathname.slice(1));
|
|
11042
|
-
message = `The package ${code(
|
|
11043
|
-
packageName
|
|
11044
|
-
)} is not published on the npm registry`;
|
|
11045
|
-
}
|
|
11046
|
-
}
|
|
11047
|
-
err.message = message;
|
|
11048
|
-
err.link = "https://vercel.link/builder-dependencies-install-failed";
|
|
11049
|
-
}
|
|
11050
|
-
throw err;
|
|
11051
|
-
}
|
|
11052
|
-
const nowScopePath = join(buildersDir, "node_modules/@now");
|
|
11053
|
-
await (0, import_fs_extra2.mkdirp)(nowScopePath);
|
|
11054
|
-
try {
|
|
11055
|
-
await (0, import_fs_extra2.symlink)("../@vercel/build-utils", join(nowScopePath, "build-utils"));
|
|
11056
|
-
} catch (err) {
|
|
11057
|
-
if (!(0, import_error_utils.isErrnoException)(err) || err.code !== "EEXIST") {
|
|
11058
|
-
throw err;
|
|
11059
|
-
}
|
|
11060
|
-
}
|
|
11061
|
-
const buildersPkg = await readJSONFile(buildersPkgPath);
|
|
11062
|
-
if (buildersPkg instanceof CantParseJSONFile)
|
|
11063
|
-
throw buildersPkg;
|
|
11064
|
-
if (!buildersPkg) {
|
|
11065
|
-
throw new Error(`Failed to load "${buildersPkgPath}"`);
|
|
11066
|
-
}
|
|
11067
|
-
for (const spec of buildersToAdd) {
|
|
11068
|
-
for (const [name, version2] of Object.entries(
|
|
11069
|
-
buildersPkg.dependencies || {}
|
|
11070
|
-
)) {
|
|
11071
|
-
if (version2 === spec) {
|
|
11072
|
-
output_manager_default.debug(`Resolved Builder spec "${spec}" to name "${name}"`);
|
|
11073
|
-
resolvedSpecs.set(spec, name);
|
|
11074
|
-
}
|
|
11075
|
-
}
|
|
11076
|
-
}
|
|
11077
|
-
return resolvedSpecs;
|
|
11078
|
-
}
|
|
11079
|
-
async function installBuilders(buildersDir, buildersToAdd, span, installReasons) {
|
|
11080
|
-
if (!span) {
|
|
11081
|
-
return untracedInstallBuilders(buildersDir, buildersToAdd);
|
|
11082
|
-
}
|
|
11083
|
-
const attributes = {
|
|
11084
|
-
packages: Array.from(buildersToAdd).join(",")
|
|
11085
|
-
};
|
|
11086
|
-
if (installReasons && installReasons.size > 0) {
|
|
11087
|
-
attributes.reasons = Array.from(installReasons).map(([spec, reason]) => `${spec}=${reason}`).join(",");
|
|
11088
|
-
}
|
|
11089
|
-
const installSpan = span.child("vc.installBuilders", attributes);
|
|
11090
|
-
return installSpan.trace(async (s) => {
|
|
11091
|
-
try {
|
|
11092
|
-
return await untracedInstallBuilders(buildersDir, buildersToAdd);
|
|
11093
|
-
} catch (err) {
|
|
11094
|
-
s.setAttributes({
|
|
11095
|
-
error: (0, import_error_utils.isError)(err) ? err.message : String(err)
|
|
11096
|
-
});
|
|
11097
|
-
throw err;
|
|
11098
|
-
}
|
|
11099
|
-
});
|
|
11100
|
-
}
|
|
11101
|
-
|
|
11102
|
-
// src/util/build/import-builders.ts
|
|
11103
|
-
var require_ = createRequire(__filename);
|
|
11104
|
-
var builderPins;
|
|
11105
|
-
function getBuilderPins() {
|
|
11106
|
-
if (!builderPins) {
|
|
11107
|
-
builderPins = /* @__PURE__ */ new Map();
|
|
11108
|
-
const pins = pkg_default.builders ?? {};
|
|
11109
|
-
for (const [name, version2] of Object.entries(pins)) {
|
|
11110
|
-
if ((0, import_semver2.validRange)(version2)) {
|
|
11111
|
-
builderPins.set(name, version2);
|
|
11112
|
-
}
|
|
11113
|
-
}
|
|
11114
|
-
}
|
|
11115
|
-
return builderPins;
|
|
11116
|
-
}
|
|
11117
|
-
function isBareSpec(parsed) {
|
|
11118
|
-
return parsed.type === "tag" && parsed.rawSpec === "";
|
|
11119
|
-
}
|
|
11120
|
-
function formatResolvedBuilders(builders) {
|
|
11121
|
-
return Array.from(
|
|
11122
|
-
builders.values(),
|
|
11123
|
-
(b) => b.pkgPath ? `${b.pkg.name}@${b.pkg.version}=${dirname(b.pkgPath)}` : `${b.pkg.name}=built-in`
|
|
11124
|
-
).join(",");
|
|
11125
|
-
}
|
|
11126
|
-
function pinBuilderSpecs(specs) {
|
|
11127
|
-
const pins = getBuilderPins();
|
|
11128
|
-
const pinnedSpecs = /* @__PURE__ */ new Map();
|
|
11129
|
-
for (const spec of specs) {
|
|
11130
|
-
const parsed = (0, import_npm_package_arg.default)(spec);
|
|
11131
|
-
if (parsed.name && isBareSpec(parsed)) {
|
|
11132
|
-
const version2 = pins.get(parsed.name);
|
|
11133
|
-
if (version2) {
|
|
11134
|
-
pinnedSpecs.set(spec, `${parsed.name}@${version2}`);
|
|
11135
|
-
}
|
|
11136
|
-
}
|
|
11137
|
-
}
|
|
11138
|
-
return pinnedSpecs;
|
|
11139
|
-
}
|
|
11140
|
-
async function importBuilders(builderSpecs, cwd, span) {
|
|
11141
|
-
const buildersDir = join2(cwd, VERCEL_DIR, "builders");
|
|
11142
|
-
let importResult = await resolveBuilders(buildersDir, builderSpecs);
|
|
11143
|
-
if ("buildersToAdd" in importResult) {
|
|
11144
|
-
const { buildersToAdd, installReasons } = importResult;
|
|
11145
|
-
const pinnedSpecs = pinBuilderSpecs(buildersToAdd);
|
|
11146
|
-
const installResult = await installBuilders(
|
|
11147
|
-
buildersDir,
|
|
11148
|
-
new Set(Array.from(buildersToAdd, (spec) => pinnedSpecs.get(spec) ?? spec)),
|
|
11149
|
-
span,
|
|
11150
|
-
installReasons
|
|
11151
|
-
);
|
|
11152
|
-
importResult = await resolveBuilders(
|
|
11153
|
-
buildersDir,
|
|
11154
|
-
builderSpecs,
|
|
11155
|
-
installResult
|
|
11156
|
-
);
|
|
11157
|
-
if ("buildersToAdd" in importResult) {
|
|
11158
|
-
const { buildersToAdd: failed, installReasons: reasons } = importResult;
|
|
11159
|
-
const failures = Array.from(failed, (spec) => {
|
|
11160
|
-
const reason = reasons.get(spec);
|
|
11161
|
-
return reason ? `${spec} (${reason})` : spec;
|
|
11162
|
-
});
|
|
11163
|
-
const err = new Error(
|
|
11164
|
-
`Failed to load Builders after installing them: ${failures.join(
|
|
11165
|
-
", "
|
|
11166
|
-
)}. Retry the build. If the failure persists, contact Vercel Support.`
|
|
11167
|
-
);
|
|
11168
|
-
err.link = "https://vercel.link/builder-dependencies-install-failed";
|
|
11169
|
-
throw err;
|
|
11170
|
-
}
|
|
11171
|
-
}
|
|
11172
|
-
const resolvedBuildersDebug = [];
|
|
11173
|
-
for (const [spec, builderSpec] of importResult.builders) {
|
|
11174
|
-
resolvedBuildersDebug.push(`${spec} => ${builderSpec.pkg.version}`);
|
|
11175
|
-
}
|
|
11176
|
-
output_manager_default.debug(`Resolved builders: "${resolvedBuildersDebug.join(", ")}"`);
|
|
11177
|
-
return importResult.builders;
|
|
11178
|
-
}
|
|
11179
|
-
function missingModuleId(err) {
|
|
11180
|
-
const match = /Cannot find module '([^']+)'/.exec(err.message);
|
|
11181
|
-
const id = match?.[1];
|
|
11182
|
-
if (!id) {
|
|
11183
|
-
return void 0;
|
|
11184
|
-
}
|
|
11185
|
-
if (id.startsWith("/") || id.startsWith(".") || /^[A-Za-z]:[\\/]/.test(id)) {
|
|
11186
|
-
return void 0;
|
|
11187
|
-
}
|
|
11188
|
-
return id.replace(/[,=]/g, "_").slice(0, 100);
|
|
11189
|
-
}
|
|
11190
|
-
async function resolveBuilders(buildersDir, builderSpecs, resolvedSpecs) {
|
|
11191
|
-
const builders = /* @__PURE__ */ new Map();
|
|
11192
|
-
const buildersToAdd = /* @__PURE__ */ new Set();
|
|
11193
|
-
const installReasons = /* @__PURE__ */ new Map();
|
|
11194
|
-
for (const spec of builderSpecs) {
|
|
11195
|
-
const resolvedSpec = resolvedSpecs?.get(spec) || spec;
|
|
11196
|
-
const parsed = (0, import_npm_package_arg.default)(resolvedSpec);
|
|
11197
|
-
const { name } = parsed;
|
|
11198
|
-
if (!name) {
|
|
11199
|
-
buildersToAdd.add(spec);
|
|
11200
|
-
installReasons.set(spec, "url-spec");
|
|
11201
|
-
continue;
|
|
11202
|
-
}
|
|
11203
|
-
if ((0, import_fs_detectors.isStaticRuntime)(name)) {
|
|
11204
|
-
builders.set(name, {
|
|
11205
|
-
builder: static_builder_exports,
|
|
11206
|
-
pkg: { name },
|
|
11207
|
-
path: "",
|
|
11208
|
-
pkgPath: "",
|
|
11209
|
-
dynamicallyInstalled: false
|
|
11210
|
-
});
|
|
11211
|
-
continue;
|
|
11212
|
-
}
|
|
11213
|
-
let entrypointLoadFailed = false;
|
|
11214
|
-
try {
|
|
11215
|
-
let pkgPath;
|
|
11216
|
-
let builderPkg;
|
|
11217
|
-
try {
|
|
11218
|
-
pkgPath = join2(buildersDir, "node_modules", name, "package.json");
|
|
11219
|
-
builderPkg = await (0, import_fs_extra3.readJSON)(pkgPath);
|
|
11220
|
-
} catch (error) {
|
|
11221
|
-
if (!(0, import_error_utils2.isErrnoException)(error)) {
|
|
11222
|
-
throw error;
|
|
11223
|
-
}
|
|
11224
|
-
if (error.code !== "ENOENT") {
|
|
11225
|
-
throw error;
|
|
11226
|
-
}
|
|
11227
|
-
pkgPath = require_.resolve(`${name}/package.json`, {
|
|
11228
|
-
paths: [__dirname]
|
|
11229
|
-
});
|
|
11230
|
-
builderPkg = await (0, import_fs_extra3.readJSON)(pkgPath);
|
|
11231
|
-
}
|
|
11232
|
-
if (!builderPkg || !pkgPath) {
|
|
11233
|
-
throw new Error(`Failed to load \`package.json\` for "${name}"`);
|
|
11234
|
-
}
|
|
11235
|
-
if (typeof builderPkg.version !== "string") {
|
|
11236
|
-
throw new Error(
|
|
11237
|
-
`\`package.json\` for "${name}" does not contain a "version" field`
|
|
11238
|
-
);
|
|
11239
|
-
}
|
|
11240
|
-
const peerVersion = getBuilderPins().get(name);
|
|
11241
|
-
if (isBareSpec(parsed) && peerVersion && pkgPath.startsWith(buildersDir) && !(0, import_semver2.satisfies)(builderPkg.version, peerVersion)) {
|
|
11242
|
-
output_manager_default.debug(
|
|
11243
|
-
`Cached "${name}@${builderPkg.version}" does not satisfy "${peerVersion}"`
|
|
11244
|
-
);
|
|
11245
|
-
buildersToAdd.add(spec);
|
|
11246
|
-
installReasons.set(spec, "peer-version-mismatch");
|
|
11247
|
-
continue;
|
|
11248
|
-
}
|
|
11249
|
-
if (parsed.type === "version" && parsed.rawSpec !== builderPkg.version) {
|
|
11250
|
-
output_manager_default.debug(
|
|
11251
|
-
`Installed version "${name}@${builderPkg.version}" does not match "${parsed.rawSpec}"`
|
|
11252
|
-
);
|
|
11253
|
-
buildersToAdd.add(spec);
|
|
11254
|
-
installReasons.set(spec, "version-mismatch");
|
|
11255
|
-
continue;
|
|
11256
|
-
}
|
|
11257
|
-
if (parsed.type === "range" && !(0, import_semver2.satisfies)(builderPkg.version, parsed.rawSpec)) {
|
|
11258
|
-
output_manager_default.debug(
|
|
11259
|
-
`Installed version "${name}@${builderPkg.version}" is not compatible with "${parsed.rawSpec}"`
|
|
11260
|
-
);
|
|
11261
|
-
buildersToAdd.add(spec);
|
|
11262
|
-
installReasons.set(spec, "range-mismatch");
|
|
11263
|
-
continue;
|
|
11264
|
-
}
|
|
11265
|
-
const path2 = join2(dirname(pkgPath), builderPkg.main || "index.js");
|
|
11266
|
-
let builder;
|
|
11267
|
-
try {
|
|
11268
|
-
builder = require_(path2);
|
|
11269
|
-
} catch (requireErr) {
|
|
11270
|
-
entrypointLoadFailed = true;
|
|
11271
|
-
throw requireErr;
|
|
11272
|
-
}
|
|
11273
|
-
const dynamicallyInstalled = pkgPath.startsWith(buildersDir);
|
|
11274
|
-
builders.set(spec, {
|
|
11275
|
-
builder,
|
|
11276
|
-
pkg: {
|
|
11277
|
-
name,
|
|
11278
|
-
...builderPkg
|
|
11279
|
-
},
|
|
11280
|
-
path: path2,
|
|
11281
|
-
pkgPath,
|
|
11282
|
-
dynamicallyInstalled
|
|
11283
|
-
});
|
|
11284
|
-
output_manager_default.debug(`Imported Builder "${name}" from "${dirname(pkgPath)}"`);
|
|
11285
|
-
} catch (err) {
|
|
11286
|
-
if (err.code === "MODULE_NOT_FOUND" && !resolvedSpecs) {
|
|
11287
|
-
output_manager_default.debug(`Failed to import "${name}": ${err}`);
|
|
11288
|
-
buildersToAdd.add(spec);
|
|
11289
|
-
if (entrypointLoadFailed) {
|
|
11290
|
-
const missing = missingModuleId(err);
|
|
11291
|
-
installReasons.set(
|
|
11292
|
-
spec,
|
|
11293
|
-
missing ? `entrypoint-load-failed:${missing}` : "entrypoint-load-failed"
|
|
11294
|
-
);
|
|
11295
|
-
} else {
|
|
11296
|
-
installReasons.set(spec, "not-installed");
|
|
11297
|
-
}
|
|
11298
|
-
} else {
|
|
11299
|
-
err.message = `Importing "${name}": ${err.message}`;
|
|
11300
|
-
throw err;
|
|
11301
|
-
}
|
|
11302
|
-
}
|
|
11303
|
-
}
|
|
11304
|
-
if (buildersToAdd.size > 0) {
|
|
11305
|
-
return { buildersToAdd, installReasons };
|
|
11306
|
-
}
|
|
11307
|
-
return { builders };
|
|
11308
|
-
}
|
|
11309
|
-
|
|
11310
|
-
// src/util/service-schedules.ts
|
|
11311
|
-
var DYNAMIC_SCHEDULE = "<dynamic>";
|
|
11312
|
-
function getStaticServiceSchedules(schedule) {
|
|
11313
|
-
if (!schedule || schedule === DYNAMIC_SCHEDULE) {
|
|
11314
|
-
return [];
|
|
11315
|
-
}
|
|
11316
|
-
return Array.isArray(schedule) ? schedule.filter((item) => item !== DYNAMIC_SCHEDULE) : [schedule];
|
|
11317
|
-
}
|
|
11318
|
-
|
|
11319
|
-
// src/util/build/write-build-result.ts
|
|
11320
|
-
var import_fs_extra5 = __toESM(require_lib(), 1);
|
|
11321
|
-
var import_mime_types = __toESM(require_mime_types(), 1);
|
|
11322
|
-
var import_fs_detectors2 = __toESM(require_dist3(), 1);
|
|
11323
|
-
var import_promisepipe2 = __toESM(require_promisepipe(), 1);
|
|
11324
|
-
import {
|
|
11325
|
-
basename,
|
|
11326
|
-
dirname as dirname2,
|
|
11327
|
-
extname,
|
|
11328
|
-
join as join4,
|
|
11329
|
-
relative as relative2,
|
|
11330
|
-
resolve as resolve2,
|
|
11331
|
-
posix
|
|
11332
|
-
} from "path";
|
|
11333
|
-
import {
|
|
11334
|
-
FileFsRef,
|
|
11335
|
-
download,
|
|
11336
|
-
downloadFile,
|
|
11337
|
-
getLambdaOptionsFromFunction,
|
|
11338
|
-
normalizePath,
|
|
11339
|
-
isBackendBuilder,
|
|
11340
|
-
isExperimentalBackendsEnabled,
|
|
11341
|
-
isExperimentalService,
|
|
11342
|
-
isExperimentalServiceV2,
|
|
11343
|
-
isSymbolicLink
|
|
11344
|
-
} from "@vercel/build-utils";
|
|
11345
|
-
|
|
11346
|
-
// src/util/build/merge.ts
|
|
11347
|
-
var import_error_utils3 = __toESM(require_dist(), 1);
|
|
11348
|
-
var import_fs_extra4 = __toESM(require_lib(), 1);
|
|
11349
|
-
import { join as join3, relative } from "path";
|
|
11350
|
-
async function merge(source, destination, ignoreFilter, sourceRoot) {
|
|
11351
|
-
const root = sourceRoot || source;
|
|
11352
|
-
if (ignoreFilter) {
|
|
11353
|
-
const relPath = relative(root, source);
|
|
11354
|
-
if (relPath && !ignoreFilter(relPath)) {
|
|
11355
|
-
await (0, import_fs_extra4.remove)(source);
|
|
11356
|
-
return;
|
|
11357
|
-
}
|
|
11358
|
-
}
|
|
11359
|
-
const destStat = await (0, import_fs_extra4.stat)(destination).catch(
|
|
9959
|
+
const destStat = await (0, import_fs_extra.stat)(destination).catch(
|
|
11360
9960
|
(err) => err
|
|
11361
9961
|
);
|
|
11362
|
-
if ((0,
|
|
9962
|
+
if ((0, import_error_utils.isErrnoException)(destStat)) {
|
|
11363
9963
|
if (destStat.code === "ENOENT") {
|
|
11364
|
-
await (0,
|
|
9964
|
+
await (0, import_fs_extra.move)(source, destination);
|
|
11365
9965
|
return;
|
|
11366
9966
|
}
|
|
11367
9967
|
throw destStat;
|
|
11368
9968
|
} else if (destStat.isDirectory()) {
|
|
11369
|
-
const contents = await (0,
|
|
9969
|
+
const contents = await (0, import_fs_extra.readdir)(
|
|
11370
9970
|
source
|
|
11371
9971
|
).catch((err) => err);
|
|
11372
|
-
if ((0,
|
|
9972
|
+
if ((0, import_error_utils.isErrnoException)(contents)) {
|
|
11373
9973
|
if (contents.code !== "ENOTDIR") {
|
|
11374
9974
|
throw contents;
|
|
11375
9975
|
}
|
|
11376
9976
|
} else {
|
|
11377
9977
|
await Promise.all(
|
|
11378
9978
|
contents.map(
|
|
11379
|
-
(name) => merge(
|
|
9979
|
+
(name) => merge(join(source, name), join(destination, name), ignoreFilter, root)
|
|
11380
9980
|
)
|
|
11381
9981
|
);
|
|
11382
|
-
await (0,
|
|
9982
|
+
await (0, import_fs_extra.rmdir)(source);
|
|
11383
9983
|
return;
|
|
11384
9984
|
}
|
|
11385
9985
|
}
|
|
11386
|
-
await (0,
|
|
11387
|
-
await (0,
|
|
9986
|
+
await (0, import_fs_extra.remove)(destination);
|
|
9987
|
+
await (0, import_fs_extra.move)(source, destination);
|
|
11388
9988
|
}
|
|
11389
9989
|
|
|
11390
9990
|
// src/util/build/unzip.ts
|
|
11391
9991
|
var import_promisepipe = __toESM(require_promisepipe(), 1);
|
|
11392
|
-
var
|
|
9992
|
+
var fs = __toESM(require_lib(), 1);
|
|
11393
9993
|
var import_yauzl_promise = __toESM(require_lib3(), 1);
|
|
11394
9994
|
import path from "path";
|
|
11395
9995
|
import { streamToBuffer } from "@vercel/build-utils";
|
|
@@ -11406,8 +10006,8 @@ async function unzip(buffer, dir) {
|
|
|
11406
10006
|
continue;
|
|
11407
10007
|
try {
|
|
11408
10008
|
const destDir = path.dirname(path.join(dir, entry.fileName));
|
|
11409
|
-
await
|
|
11410
|
-
const canonicalDestDir = await
|
|
10009
|
+
await fs.mkdirp(destDir);
|
|
10010
|
+
const canonicalDestDir = await fs.realpath(destDir);
|
|
11411
10011
|
const relativeDestDir = path.relative(dir, canonicalDestDir);
|
|
11412
10012
|
if (relativeDestDir.split(path.sep).includes("..")) {
|
|
11413
10013
|
throw new Error(
|
|
@@ -11427,7 +10027,7 @@ async function extractEntry(zipFile, entry, dir) {
|
|
|
11427
10027
|
const IFMT = 61440;
|
|
11428
10028
|
const IFDIR = 16384;
|
|
11429
10029
|
const IFLNK = 40960;
|
|
11430
|
-
const
|
|
10030
|
+
const symlink2 = (mode & IFMT) === IFLNK;
|
|
11431
10031
|
let isDir = (mode & IFMT) === IFDIR;
|
|
11432
10032
|
if (!isDir && entry.fileName.endsWith("/")) {
|
|
11433
10033
|
isDir = true;
|
|
@@ -11441,15 +10041,15 @@ async function extractEntry(zipFile, entry, dir) {
|
|
|
11441
10041
|
if (isDir) {
|
|
11442
10042
|
mkdirOptions.mode = procMode;
|
|
11443
10043
|
}
|
|
11444
|
-
await
|
|
10044
|
+
await fs.mkdir(destDir, mkdirOptions);
|
|
11445
10045
|
if (isDir)
|
|
11446
10046
|
return;
|
|
11447
10047
|
const readStream = await zipFile.openReadStream(entry);
|
|
11448
|
-
if (
|
|
10048
|
+
if (symlink2) {
|
|
11449
10049
|
const link = await streamToBuffer(readStream);
|
|
11450
|
-
await
|
|
10050
|
+
await fs.symlink(link.toString("utf8"), dest);
|
|
11451
10051
|
} else {
|
|
11452
|
-
await (0, import_promisepipe.default)(readStream,
|
|
10052
|
+
await (0, import_promisepipe.default)(readStream, fs.createWriteStream(dest, { mode: procMode }));
|
|
11453
10053
|
}
|
|
11454
10054
|
}
|
|
11455
10055
|
function getExtractedMode(entryMode, isDir) {
|
|
@@ -11465,9 +10065,9 @@ function getExtractedMode(entryMode, isDir) {
|
|
|
11465
10065
|
}
|
|
11466
10066
|
|
|
11467
10067
|
// src/util/build/write-build-result.ts
|
|
11468
|
-
var
|
|
10068
|
+
var import_client = __toESM(require_dist2(), 1);
|
|
11469
10069
|
var { normalize } = posix;
|
|
11470
|
-
var OUTPUT_DIR =
|
|
10070
|
+
var OUTPUT_DIR = join2(VERCEL_DIR, "output");
|
|
11471
10071
|
var BUILD_OUTPUT_API_ENTRIES = [
|
|
11472
10072
|
"config.json",
|
|
11473
10073
|
"functions",
|
|
@@ -11479,7 +10079,7 @@ async function writeBuildResult(args) {
|
|
|
11479
10079
|
repoRootPath,
|
|
11480
10080
|
outputDir,
|
|
11481
10081
|
buildResult,
|
|
11482
|
-
build
|
|
10082
|
+
build,
|
|
11483
10083
|
builder,
|
|
11484
10084
|
builderPkg,
|
|
11485
10085
|
vercelConfig,
|
|
@@ -11490,22 +10090,22 @@ async function writeBuildResult(args) {
|
|
|
11490
10090
|
stripServiceRoutePrefix = false
|
|
11491
10091
|
} = args;
|
|
11492
10092
|
const writeOutputDir = service && nestServiceOutput ? getServiceOutputDir(outputDir, service) : outputDir;
|
|
11493
|
-
let
|
|
10093
|
+
let version;
|
|
11494
10094
|
let actualResult;
|
|
11495
10095
|
if (builder.version === -1) {
|
|
11496
10096
|
const vx = buildResult;
|
|
11497
|
-
|
|
10097
|
+
version = vx.resultVersion;
|
|
11498
10098
|
actualResult = vx.result;
|
|
11499
10099
|
} else {
|
|
11500
|
-
|
|
10100
|
+
version = builder.version;
|
|
11501
10101
|
actualResult = buildResult;
|
|
11502
10102
|
}
|
|
11503
|
-
if (typeof
|
|
10103
|
+
if (typeof version !== "number" || version === 2) {
|
|
11504
10104
|
return writeBuildResultV2({
|
|
11505
10105
|
repoRootPath,
|
|
11506
10106
|
outputDir: writeOutputDir,
|
|
11507
10107
|
buildResult: actualResult,
|
|
11508
|
-
build
|
|
10108
|
+
build,
|
|
11509
10109
|
vercelConfig,
|
|
11510
10110
|
standalone,
|
|
11511
10111
|
workPath,
|
|
@@ -11513,12 +10113,12 @@ async function writeBuildResult(args) {
|
|
|
11513
10113
|
rootOutputDir: outputDir,
|
|
11514
10114
|
stripServiceRoutePrefix
|
|
11515
10115
|
});
|
|
11516
|
-
} else if (
|
|
10116
|
+
} else if (version === 3) {
|
|
11517
10117
|
return writeBuildResultV3({
|
|
11518
10118
|
repoRootPath,
|
|
11519
10119
|
outputDir: writeOutputDir,
|
|
11520
10120
|
buildResult: actualResult,
|
|
11521
|
-
build
|
|
10121
|
+
build,
|
|
11522
10122
|
vercelConfig,
|
|
11523
10123
|
standalone,
|
|
11524
10124
|
workPath,
|
|
@@ -11528,7 +10128,7 @@ async function writeBuildResult(args) {
|
|
|
11528
10128
|
});
|
|
11529
10129
|
}
|
|
11530
10130
|
throw new Error(
|
|
11531
|
-
`Unsupported Builder version \`${
|
|
10131
|
+
`Unsupported Builder version \`${version}\` from "${builderPkg.name}"`
|
|
11532
10132
|
);
|
|
11533
10133
|
}
|
|
11534
10134
|
function isEdgeFunction(v) {
|
|
@@ -11597,14 +10197,14 @@ async function resolveFunctionConfiguration(src, vercelConfig, service) {
|
|
|
11597
10197
|
return {};
|
|
11598
10198
|
}
|
|
11599
10199
|
function getServiceOutputDir(outputDir, service) {
|
|
11600
|
-
return
|
|
10200
|
+
return join2(outputDir, "services", service.name);
|
|
11601
10201
|
}
|
|
11602
10202
|
async function writeBuildResultV2(args) {
|
|
11603
10203
|
const {
|
|
11604
10204
|
repoRootPath,
|
|
11605
10205
|
outputDir,
|
|
11606
10206
|
buildResult,
|
|
11607
|
-
build
|
|
10207
|
+
build,
|
|
11608
10208
|
vercelConfig,
|
|
11609
10209
|
standalone,
|
|
11610
10210
|
workPath,
|
|
@@ -11617,15 +10217,15 @@ async function writeBuildResultV2(args) {
|
|
|
11617
10217
|
return;
|
|
11618
10218
|
}
|
|
11619
10219
|
if (!buildResult.output) {
|
|
11620
|
-
const configFile = vercelConfig?.[
|
|
11621
|
-
const updateMessage =
|
|
10220
|
+
const configFile = vercelConfig?.[import_client.fileNameSymbol];
|
|
10221
|
+
const updateMessage = build.use.startsWith("@now/") ? ` Please update from "@now" to "@vercel" in your \`${configFile}\` file.` : "";
|
|
11622
10222
|
throw new Error(
|
|
11623
|
-
`The build result from "${
|
|
10223
|
+
`The build result from "${build.use}" is missing the "output" property.${updateMessage}`
|
|
11624
10224
|
);
|
|
11625
10225
|
}
|
|
11626
10226
|
const existingFunctions = /* @__PURE__ */ new Map();
|
|
11627
10227
|
const overrides = {};
|
|
11628
|
-
const functionConfiguration =
|
|
10228
|
+
const functionConfiguration = build.src ? await resolveFunctionConfiguration(build.src, vercelConfig, service) : {};
|
|
11629
10229
|
for (const [path2, output] of Object.entries(buildResult.output)) {
|
|
11630
10230
|
const normalizedPath = stripDuplicateSlashes(path2);
|
|
11631
10231
|
if (isContainerImage(output)) {
|
|
@@ -11674,11 +10274,11 @@ async function writeBuildResultV2(args) {
|
|
|
11674
10274
|
if (fallback) {
|
|
11675
10275
|
const ext = getFileExtension(fallback);
|
|
11676
10276
|
const fallbackName = `${normalizedPath}.prerender-fallback${ext}`;
|
|
11677
|
-
const fallbackPath =
|
|
10277
|
+
const fallbackPath = join2(outputDir, "functions", fallbackName);
|
|
11678
10278
|
let usedHardLink = false;
|
|
11679
10279
|
if ("fsPath" in fallback) {
|
|
11680
10280
|
try {
|
|
11681
|
-
await
|
|
10281
|
+
await import_fs_extra2.default.link(fallback.fsPath, fallbackPath);
|
|
11682
10282
|
usedHardLink = true;
|
|
11683
10283
|
} catch (_) {
|
|
11684
10284
|
}
|
|
@@ -11687,7 +10287,7 @@ async function writeBuildResultV2(args) {
|
|
|
11687
10287
|
const stream = fallback.toStream();
|
|
11688
10288
|
await (0, import_promisepipe2.default)(
|
|
11689
10289
|
stream,
|
|
11690
|
-
|
|
10290
|
+
import_fs_extra2.default.createWriteStream(fallbackPath, { mode: fallback.mode })
|
|
11691
10291
|
);
|
|
11692
10292
|
}
|
|
11693
10293
|
fallback = new FileFsRef({
|
|
@@ -11695,7 +10295,7 @@ async function writeBuildResultV2(args) {
|
|
|
11695
10295
|
fsPath: basename(fallbackName)
|
|
11696
10296
|
});
|
|
11697
10297
|
}
|
|
11698
|
-
const prerenderConfigPath =
|
|
10298
|
+
const prerenderConfigPath = join2(
|
|
11699
10299
|
outputDir,
|
|
11700
10300
|
"functions",
|
|
11701
10301
|
`${normalizedPath}.prerender-config.json`
|
|
@@ -11705,7 +10305,7 @@ async function writeBuildResultV2(args) {
|
|
|
11705
10305
|
lambda: void 0,
|
|
11706
10306
|
fallback
|
|
11707
10307
|
};
|
|
11708
|
-
await
|
|
10308
|
+
await import_fs_extra2.default.writeJSON(prerenderConfigPath, prerenderConfig, { spaces: 2 });
|
|
11709
10309
|
} else if (isFile(output)) {
|
|
11710
10310
|
await writeStaticFile(
|
|
11711
10311
|
outputDir,
|
|
@@ -11736,7 +10336,7 @@ async function writeBuildResultV3(args) {
|
|
|
11736
10336
|
repoRootPath,
|
|
11737
10337
|
outputDir,
|
|
11738
10338
|
buildResult,
|
|
11739
|
-
build
|
|
10339
|
+
build,
|
|
11740
10340
|
vercelConfig,
|
|
11741
10341
|
standalone,
|
|
11742
10342
|
workPath,
|
|
@@ -11745,14 +10345,14 @@ async function writeBuildResultV3(args) {
|
|
|
11745
10345
|
stripServiceRoutePrefix
|
|
11746
10346
|
} = args;
|
|
11747
10347
|
const { output } = buildResult;
|
|
11748
|
-
const routesJsonPath =
|
|
11749
|
-
if (isBackendBuilder(
|
|
11750
|
-
if ((0,
|
|
10348
|
+
const routesJsonPath = join2(workPath, ".vercel", "routes.json");
|
|
10349
|
+
if (isBackendBuilder(build) || build.use === "@vercel/python") {
|
|
10350
|
+
if ((0, import_fs_extra2.existsSync)(routesJsonPath)) {
|
|
11751
10351
|
try {
|
|
11752
10352
|
const newOutput = {
|
|
11753
10353
|
index: output
|
|
11754
10354
|
};
|
|
11755
|
-
const routesJson = await
|
|
10355
|
+
const routesJson = await import_fs_extra2.default.readJSON(routesJsonPath);
|
|
11756
10356
|
if (routesJson && typeof routesJson === "object" && "routes" in routesJson && Array.isArray(routesJson.routes)) {
|
|
11757
10357
|
for (const route of routesJson.routes) {
|
|
11758
10358
|
if (route.source === "/") {
|
|
@@ -11767,7 +10367,7 @@ async function writeBuildResultV3(args) {
|
|
|
11767
10367
|
repoRootPath,
|
|
11768
10368
|
outputDir,
|
|
11769
10369
|
buildResult: { output: newOutput, routes: buildResult.routes },
|
|
11770
|
-
build
|
|
10370
|
+
build,
|
|
11771
10371
|
vercelConfig,
|
|
11772
10372
|
standalone,
|
|
11773
10373
|
workPath,
|
|
@@ -11779,12 +10379,12 @@ async function writeBuildResultV3(args) {
|
|
|
11779
10379
|
output_manager_default.error(`Failed to read routes.json: ${error}`);
|
|
11780
10380
|
}
|
|
11781
10381
|
}
|
|
11782
|
-
if (isBackendBuilder(
|
|
10382
|
+
if (isBackendBuilder(build) && isExperimentalBackendsEnabled() && "routes" in buildResult) {
|
|
11783
10383
|
return writeBuildResultV2({
|
|
11784
10384
|
repoRootPath,
|
|
11785
10385
|
outputDir,
|
|
11786
10386
|
buildResult,
|
|
11787
|
-
build
|
|
10387
|
+
build,
|
|
11788
10388
|
vercelConfig,
|
|
11789
10389
|
standalone,
|
|
11790
10390
|
workPath,
|
|
@@ -11794,7 +10394,7 @@ async function writeBuildResultV3(args) {
|
|
|
11794
10394
|
});
|
|
11795
10395
|
}
|
|
11796
10396
|
}
|
|
11797
|
-
const src =
|
|
10397
|
+
const src = build.src;
|
|
11798
10398
|
if (typeof src !== "string") {
|
|
11799
10399
|
throw new Error(`Expected "build.src" to be a string`);
|
|
11800
10400
|
}
|
|
@@ -11804,8 +10404,8 @@ async function writeBuildResultV3(args) {
|
|
|
11804
10404
|
service
|
|
11805
10405
|
);
|
|
11806
10406
|
const ext = extname(src);
|
|
11807
|
-
const path2 = service && isExperimentalServiceV2(service) ? "index" : service && typeof service.runtime === "string" ? stripDuplicateSlashes((0,
|
|
11808
|
-
|
|
10407
|
+
const path2 = service && isExperimentalServiceV2(service) ? "index" : service && typeof service.runtime === "string" ? stripDuplicateSlashes((0, import_fs_detectors.getInternalServiceFunctionPath)(service.name)) : stripDuplicateSlashes(
|
|
10408
|
+
build.config?.zeroConfig ? src.substring(0, src.length - ext.length) : src
|
|
11809
10409
|
);
|
|
11810
10410
|
if (isContainerImage(output)) {
|
|
11811
10411
|
injectServiceEnvVars(
|
|
@@ -11840,7 +10440,7 @@ async function writeBuildResultV3(args) {
|
|
|
11840
10440
|
);
|
|
11841
10441
|
} else {
|
|
11842
10442
|
throw new Error(
|
|
11843
|
-
`Unsupported output type: "${output.type}" for ${
|
|
10443
|
+
`Unsupported output type: "${output.type}" for ${build.src}`
|
|
11844
10444
|
);
|
|
11845
10445
|
}
|
|
11846
10446
|
}
|
|
@@ -11867,14 +10467,14 @@ async function writeStaticFile(outputDir, file, path2, overrides, cleanUrls = fa
|
|
|
11867
10467
|
if (override) {
|
|
11868
10468
|
overrides[fsPath] = override;
|
|
11869
10469
|
}
|
|
11870
|
-
const dest =
|
|
11871
|
-
await
|
|
10470
|
+
const dest = join2(outputDir, "static", fsPath);
|
|
10471
|
+
await import_fs_extra2.default.mkdirp(dirname(dest));
|
|
11872
10472
|
if ("fsPath" in file) {
|
|
11873
|
-
if (
|
|
10473
|
+
if (resolve(file.fsPath) === resolve(dest)) {
|
|
11874
10474
|
return;
|
|
11875
10475
|
}
|
|
11876
10476
|
try {
|
|
11877
|
-
return await
|
|
10477
|
+
return await import_fs_extra2.default.link(file.fsPath, dest);
|
|
11878
10478
|
} catch (_) {
|
|
11879
10479
|
}
|
|
11880
10480
|
}
|
|
@@ -11884,15 +10484,15 @@ async function writeFunctionSymlink(outputDir, dest, fn, existingFunctions) {
|
|
|
11884
10484
|
const existingPath = existingFunctions.get(fn);
|
|
11885
10485
|
if (!existingPath)
|
|
11886
10486
|
return false;
|
|
11887
|
-
const destDir =
|
|
11888
|
-
const targetDest =
|
|
10487
|
+
const destDir = dirname(dest);
|
|
10488
|
+
const targetDest = join2(outputDir, "functions", `${existingPath}.func`);
|
|
11889
10489
|
const target = relative2(destDir, targetDest);
|
|
11890
|
-
await
|
|
11891
|
-
await
|
|
10490
|
+
await import_fs_extra2.default.mkdirp(destDir);
|
|
10491
|
+
await import_fs_extra2.default.symlink(target, dest);
|
|
11892
10492
|
return true;
|
|
11893
10493
|
}
|
|
11894
10494
|
async function writeContainerImage(outputDir, containerImage, path2, functionConfiguration) {
|
|
11895
|
-
const dest =
|
|
10495
|
+
const dest = join2(outputDir, "functions", `${path2}.func`);
|
|
11896
10496
|
const handler = containerImage.handler;
|
|
11897
10497
|
if (typeof handler !== "string" || handler.length === 0) {
|
|
11898
10498
|
throw new Error(
|
|
@@ -11907,9 +10507,9 @@ async function writeContainerImage(outputDir, containerImage, path2, functionCon
|
|
|
11907
10507
|
const functionFailoverRegions = functionConfiguration?.functionFailoverRegions ?? containerImage.functionFailoverRegions;
|
|
11908
10508
|
const experimentalTriggers = functionConfiguration?.experimentalTriggers ?? containerImage.experimentalTriggers;
|
|
11909
10509
|
const supportsCancellation = functionConfiguration?.supportsCancellation ?? containerImage.supportsCancellation;
|
|
11910
|
-
await
|
|
11911
|
-
await
|
|
11912
|
-
|
|
10510
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
10511
|
+
await import_fs_extra2.default.writeJSON(
|
|
10512
|
+
join2(dest, ".vc-config.json"),
|
|
11913
10513
|
{
|
|
11914
10514
|
handler,
|
|
11915
10515
|
runtime: "container",
|
|
@@ -11928,7 +10528,7 @@ async function writeContainerImage(outputDir, containerImage, path2, functionCon
|
|
|
11928
10528
|
);
|
|
11929
10529
|
}
|
|
11930
10530
|
async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, existingFunctions, standalone = false) {
|
|
11931
|
-
const dest =
|
|
10531
|
+
const dest = join2(outputDir, "functions", `${path2}.func`);
|
|
11932
10532
|
if (existingFunctions) {
|
|
11933
10533
|
if (await writeFunctionSymlink(
|
|
11934
10534
|
outputDir,
|
|
@@ -11940,7 +10540,7 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, e
|
|
|
11940
10540
|
}
|
|
11941
10541
|
existingFunctions.set(edgeFunction, path2);
|
|
11942
10542
|
}
|
|
11943
|
-
await
|
|
10543
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
11944
10544
|
const ops = [];
|
|
11945
10545
|
const { files, filePathMap } = filesWithoutFsRefs(
|
|
11946
10546
|
edgeFunction.files,
|
|
@@ -11956,23 +10556,23 @@ async function writeEdgeFunction(repoRootPath, outputDir, edgeFunction, path2, e
|
|
|
11956
10556
|
files: void 0,
|
|
11957
10557
|
type: void 0
|
|
11958
10558
|
};
|
|
11959
|
-
const configPath =
|
|
10559
|
+
const configPath = join2(dest, ".vc-config.json");
|
|
11960
10560
|
ops.push(
|
|
11961
|
-
|
|
10561
|
+
import_fs_extra2.default.writeJSON(configPath, config, {
|
|
11962
10562
|
spaces: 2
|
|
11963
10563
|
})
|
|
11964
10564
|
);
|
|
11965
10565
|
await Promise.all(ops);
|
|
11966
10566
|
}
|
|
11967
10567
|
async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfiguration, existingFunctions, standalone = false) {
|
|
11968
|
-
const dest =
|
|
10568
|
+
const dest = join2(outputDir, "functions", `${path2}.func`);
|
|
11969
10569
|
if (existingFunctions) {
|
|
11970
10570
|
if (await writeFunctionSymlink(outputDir, dest, lambda, existingFunctions)) {
|
|
11971
10571
|
return;
|
|
11972
10572
|
}
|
|
11973
10573
|
existingFunctions.set(lambda, path2);
|
|
11974
10574
|
}
|
|
11975
|
-
await
|
|
10575
|
+
await import_fs_extra2.default.mkdirp(dest);
|
|
11976
10576
|
const ops = [];
|
|
11977
10577
|
let filePathMap;
|
|
11978
10578
|
if (lambda.files) {
|
|
@@ -12008,32 +10608,32 @@ async function writeLambda(repoRootPath, outputDir, lambda, path2, functionConfi
|
|
|
12008
10608
|
files: void 0,
|
|
12009
10609
|
zipBuffer: void 0
|
|
12010
10610
|
};
|
|
12011
|
-
const configPath =
|
|
10611
|
+
const configPath = join2(dest, ".vc-config.json");
|
|
12012
10612
|
ops.push(
|
|
12013
|
-
|
|
10613
|
+
import_fs_extra2.default.writeJSON(configPath, config, {
|
|
12014
10614
|
spaces: 2
|
|
12015
10615
|
})
|
|
12016
10616
|
);
|
|
12017
10617
|
await Promise.all(ops);
|
|
12018
10618
|
for await (const dir of findDirs(".vercel", dest)) {
|
|
12019
|
-
const absDir =
|
|
12020
|
-
const entries = await
|
|
10619
|
+
const absDir = join2(dest, dir);
|
|
10620
|
+
const entries = await import_fs_extra2.default.readdir(absDir);
|
|
12021
10621
|
if (entries.includes("cache")) {
|
|
12022
10622
|
await Promise.all(
|
|
12023
|
-
entries.filter((e) => e !== "cache").map((entry) =>
|
|
10623
|
+
entries.filter((e) => e !== "cache").map((entry) => import_fs_extra2.default.remove(join2(absDir, entry)))
|
|
12024
10624
|
);
|
|
12025
10625
|
} else {
|
|
12026
|
-
await
|
|
10626
|
+
await import_fs_extra2.default.remove(absDir);
|
|
12027
10627
|
}
|
|
12028
10628
|
}
|
|
12029
10629
|
}
|
|
12030
10630
|
async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDir) {
|
|
12031
|
-
const absOutputDir =
|
|
12032
|
-
const absRootOutputDir =
|
|
12033
|
-
const { ig } = await (0,
|
|
10631
|
+
const absOutputDir = resolve(outputDir);
|
|
10632
|
+
const absRootOutputDir = resolve(rootOutputDir);
|
|
10633
|
+
const { ig } = await (0, import_client.getVercelIgnore)(workPath);
|
|
12034
10634
|
const filter = ig.createFilter();
|
|
12035
10635
|
if (absOutputDir === buildResult.buildOutputPath) {
|
|
12036
|
-
const staticDir =
|
|
10636
|
+
const staticDir = join2(outputDir, "static");
|
|
12037
10637
|
try {
|
|
12038
10638
|
await cleanIgnoredFiles(staticDir, staticDir, filter);
|
|
12039
10639
|
} catch (err) {
|
|
@@ -12042,7 +10642,7 @@ async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDi
|
|
|
12042
10642
|
}
|
|
12043
10643
|
return;
|
|
12044
10644
|
}
|
|
12045
|
-
if (
|
|
10645
|
+
if (resolve(buildResult.buildOutputPath) === absRootOutputDir) {
|
|
12046
10646
|
await relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath);
|
|
12047
10647
|
return;
|
|
12048
10648
|
}
|
|
@@ -12056,15 +10656,15 @@ async function mergeBuilderOutput(outputDir, buildResult, workPath, rootOutputDi
|
|
|
12056
10656
|
await merge(buildResult.buildOutputPath, outputDir, ignoreFilter);
|
|
12057
10657
|
}
|
|
12058
10658
|
async function relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath) {
|
|
12059
|
-
const { ig } = await (0,
|
|
10659
|
+
const { ig } = await (0, import_client.getVercelIgnore)(workPath);
|
|
12060
10660
|
const filter = ig.createFilter();
|
|
12061
|
-
await
|
|
10661
|
+
await import_fs_extra2.default.mkdirp(outputDir);
|
|
12062
10662
|
await Promise.all(
|
|
12063
10663
|
BUILD_OUTPUT_API_ENTRIES.map(async (entry) => {
|
|
12064
|
-
const src =
|
|
12065
|
-
if (!await
|
|
10664
|
+
const src = join2(rootOutputDir, entry);
|
|
10665
|
+
if (!await import_fs_extra2.default.pathExists(src))
|
|
12066
10666
|
return;
|
|
12067
|
-
const dest =
|
|
10667
|
+
const dest = join2(outputDir, entry);
|
|
12068
10668
|
if (entry === "static") {
|
|
12069
10669
|
await merge(src, dest, (path2) => filter(path2));
|
|
12070
10670
|
} else {
|
|
@@ -12074,21 +10674,21 @@ async function relocateBuildOutputApiEntries(rootOutputDir, outputDir, workPath)
|
|
|
12074
10674
|
);
|
|
12075
10675
|
}
|
|
12076
10676
|
async function cleanIgnoredFiles(dir, staticRoot, filter) {
|
|
12077
|
-
const entries = await
|
|
10677
|
+
const entries = await import_fs_extra2.default.readdir(dir);
|
|
12078
10678
|
await Promise.all(
|
|
12079
10679
|
entries.map(async (entry) => {
|
|
12080
|
-
const entryPath =
|
|
12081
|
-
const stat2 = await
|
|
10680
|
+
const entryPath = join2(dir, entry);
|
|
10681
|
+
const stat2 = await import_fs_extra2.default.stat(entryPath);
|
|
12082
10682
|
const relativePath = relative2(staticRoot, entryPath);
|
|
12083
10683
|
if (stat2.isDirectory()) {
|
|
12084
10684
|
await cleanIgnoredFiles(entryPath, staticRoot, filter);
|
|
12085
|
-
const remaining = await
|
|
10685
|
+
const remaining = await import_fs_extra2.default.readdir(entryPath);
|
|
12086
10686
|
if (remaining.length === 0) {
|
|
12087
|
-
await
|
|
10687
|
+
await import_fs_extra2.default.rmdir(entryPath);
|
|
12088
10688
|
}
|
|
12089
10689
|
} else if (!filter(relativePath)) {
|
|
12090
10690
|
output_manager_default.debug(`Removing ignored file: ${relativePath}`);
|
|
12091
|
-
await
|
|
10691
|
+
await import_fs_extra2.default.remove(entryPath);
|
|
12092
10692
|
}
|
|
12093
10693
|
})
|
|
12094
10694
|
);
|
|
@@ -12109,7 +10709,7 @@ function getFileExtension(file) {
|
|
|
12109
10709
|
async function* findDirs(name, dir, root = dir) {
|
|
12110
10710
|
let paths;
|
|
12111
10711
|
try {
|
|
12112
|
-
paths = await
|
|
10712
|
+
paths = await import_fs_extra2.default.readdir(dir);
|
|
12113
10713
|
} catch (err) {
|
|
12114
10714
|
if (err.code !== "ENOENT") {
|
|
12115
10715
|
throw err;
|
|
@@ -12117,10 +10717,10 @@ async function* findDirs(name, dir, root = dir) {
|
|
|
12117
10717
|
paths = [];
|
|
12118
10718
|
}
|
|
12119
10719
|
for (const path2 of paths) {
|
|
12120
|
-
const abs =
|
|
10720
|
+
const abs = join2(dir, path2);
|
|
12121
10721
|
let stat2;
|
|
12122
10722
|
try {
|
|
12123
|
-
stat2 = await
|
|
10723
|
+
stat2 = await import_fs_extra2.default.lstat(abs);
|
|
12124
10724
|
} catch (err) {
|
|
12125
10725
|
if (err.code === "ENOENT")
|
|
12126
10726
|
continue;
|
|
@@ -12161,16 +10761,131 @@ function filesWithoutFsRefs(files, repoRootPath, standalone) {
|
|
|
12161
10761
|
return { files: out, filePathMap };
|
|
12162
10762
|
}
|
|
12163
10763
|
|
|
10764
|
+
// src/util/get-files.ts
|
|
10765
|
+
var import_fs_extra3 = __toESM(require_lib(), 1);
|
|
10766
|
+
var import_client2 = __toESM(require_dist2(), 1);
|
|
10767
|
+
import { resolve as resolve2 } from "path";
|
|
10768
|
+
|
|
10769
|
+
// src/util/unique-strings.ts
|
|
10770
|
+
var unique_strings_default = (arr) => {
|
|
10771
|
+
const len = arr.length;
|
|
10772
|
+
const res = [];
|
|
10773
|
+
const o = {};
|
|
10774
|
+
let i;
|
|
10775
|
+
for (i = 0; i < len; i += 1) {
|
|
10776
|
+
o[arr[i]] = o[arr[i]] || res.push(arr[i]);
|
|
10777
|
+
}
|
|
10778
|
+
return res;
|
|
10779
|
+
};
|
|
10780
|
+
|
|
10781
|
+
// src/util/get-files.ts
|
|
10782
|
+
function flatten(arr, res = []) {
|
|
10783
|
+
for (const cur of arr) {
|
|
10784
|
+
if (Array.isArray(cur)) {
|
|
10785
|
+
flatten(cur, res);
|
|
10786
|
+
} else {
|
|
10787
|
+
res.push(cur);
|
|
10788
|
+
}
|
|
10789
|
+
}
|
|
10790
|
+
return res;
|
|
10791
|
+
}
|
|
10792
|
+
var asAbsolute = function(path2, parent) {
|
|
10793
|
+
if (path2[0] === "/") {
|
|
10794
|
+
return path2;
|
|
10795
|
+
}
|
|
10796
|
+
return resolve2(parent, path2);
|
|
10797
|
+
};
|
|
10798
|
+
async function staticFiles(path2, { src }) {
|
|
10799
|
+
const { debug, time } = output_manager_default;
|
|
10800
|
+
let files = [];
|
|
10801
|
+
const source = src || ".";
|
|
10802
|
+
const search = resolve2(path2, source);
|
|
10803
|
+
const { ig } = await (0, import_client2.getVercelIgnore)(path2);
|
|
10804
|
+
const filter = ig.createFilter();
|
|
10805
|
+
const prefixLength = path2.length + 1;
|
|
10806
|
+
const accepts = (file) => {
|
|
10807
|
+
const relativePath = file.slice(prefixLength);
|
|
10808
|
+
if (relativePath === "") {
|
|
10809
|
+
return true;
|
|
10810
|
+
}
|
|
10811
|
+
const accepted = filter(relativePath);
|
|
10812
|
+
if (!accepted) {
|
|
10813
|
+
debug(`Ignoring ${file}`);
|
|
10814
|
+
}
|
|
10815
|
+
return accepted;
|
|
10816
|
+
};
|
|
10817
|
+
files = await time(
|
|
10818
|
+
`Locating files ${path2}`,
|
|
10819
|
+
explode([search], {
|
|
10820
|
+
accepts
|
|
10821
|
+
})
|
|
10822
|
+
);
|
|
10823
|
+
return unique_strings_default(files);
|
|
10824
|
+
}
|
|
10825
|
+
async function explode(paths, { accepts }) {
|
|
10826
|
+
const { debug } = output_manager_default;
|
|
10827
|
+
const list = async (file) => {
|
|
10828
|
+
let path2 = file;
|
|
10829
|
+
let s;
|
|
10830
|
+
if (!accepts(file)) {
|
|
10831
|
+
return null;
|
|
10832
|
+
}
|
|
10833
|
+
try {
|
|
10834
|
+
s = await import_fs_extra3.default.stat(path2);
|
|
10835
|
+
} catch (_e) {
|
|
10836
|
+
path2 = `${file}.js`;
|
|
10837
|
+
try {
|
|
10838
|
+
s = await import_fs_extra3.default.stat(path2);
|
|
10839
|
+
} catch (_e2) {
|
|
10840
|
+
debug(`Ignoring invalid file ${file}`);
|
|
10841
|
+
return null;
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
if (s.isDirectory()) {
|
|
10845
|
+
let all;
|
|
10846
|
+
try {
|
|
10847
|
+
all = await import_fs_extra3.default.readdir(file);
|
|
10848
|
+
} catch (err) {
|
|
10849
|
+
const code = err instanceof Error && "code" in err ? err.code : void 0;
|
|
10850
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
10851
|
+
debug(`Ignoring directory that has since been removed ${file}`);
|
|
10852
|
+
return null;
|
|
10853
|
+
}
|
|
10854
|
+
throw err;
|
|
10855
|
+
}
|
|
10856
|
+
const recursive = many(all.map((subdir) => asAbsolute(subdir, file)));
|
|
10857
|
+
return recursive;
|
|
10858
|
+
}
|
|
10859
|
+
if (!s.isFile()) {
|
|
10860
|
+
debug(`Ignoring special file ${file}`);
|
|
10861
|
+
return null;
|
|
10862
|
+
}
|
|
10863
|
+
return path2;
|
|
10864
|
+
};
|
|
10865
|
+
const many = (all) => Promise.all(all.map((file) => list(file)));
|
|
10866
|
+
const arrayOfArrays = await many(paths);
|
|
10867
|
+
return flatten(arrayOfArrays).filter(notNull);
|
|
10868
|
+
}
|
|
10869
|
+
function notNull(value) {
|
|
10870
|
+
return value !== null;
|
|
10871
|
+
}
|
|
10872
|
+
|
|
10873
|
+
// src/util/service-schedules.ts
|
|
10874
|
+
var DYNAMIC_SCHEDULE = "<dynamic>";
|
|
10875
|
+
function getStaticServiceSchedules(schedule) {
|
|
10876
|
+
if (!schedule || schedule === DYNAMIC_SCHEDULE) {
|
|
10877
|
+
return [];
|
|
10878
|
+
}
|
|
10879
|
+
return Array.isArray(schedule) ? schedule.filter((item) => item !== DYNAMIC_SCHEDULE) : [schedule];
|
|
10880
|
+
}
|
|
10881
|
+
|
|
12164
10882
|
export {
|
|
12165
|
-
require_npa,
|
|
12166
|
-
staticFiles,
|
|
12167
10883
|
require_mime_types,
|
|
12168
|
-
formatResolvedBuilders,
|
|
12169
|
-
importBuilders,
|
|
12170
|
-
getStaticServiceSchedules,
|
|
12171
10884
|
OUTPUT_DIR,
|
|
12172
10885
|
writeBuildResult,
|
|
12173
|
-
isLambda
|
|
10886
|
+
isLambda,
|
|
10887
|
+
staticFiles,
|
|
10888
|
+
getStaticServiceSchedules
|
|
12174
10889
|
};
|
|
12175
10890
|
/*! Bundled license information:
|
|
12176
10891
|
|