vercel 54.14.2 → 54.15.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/dist/chunks/{add-PKT6ULVJ.js → add-6XHROCMP.js} +5 -5
- package/dist/chunks/{chunk-3BR246Y6.js → chunk-3RIVJWW5.js} +2 -11
- package/dist/chunks/{chunk-J7BMPRCU.js → chunk-574PHXNT.js} +9 -4
- package/dist/chunks/{chunk-FLW73SZ3.js → chunk-6A62YUBE.js} +3 -3
- package/dist/chunks/{chunk-G3NXHUFT.js → chunk-6SL223IW.js} +1 -1
- package/dist/chunks/{chunk-2ZSXQQXI.js → chunk-6TPH3ZBU.js} +10 -19
- package/dist/chunks/{chunk-2XEEOHHH.js → chunk-AG6TBL6C.js} +1 -1
- package/dist/chunks/chunk-BRQ6PX3U.js +593 -0
- package/dist/chunks/{chunk-O7RJHL34.js → chunk-CENOYXK3.js} +583 -11
- package/dist/chunks/{chunk-YLGMXYFG.js → chunk-DCN3SOR6.js} +2 -2
- package/dist/chunks/{chunk-OHIZ4SVU.js → chunk-EAEEBPMD.js} +15 -3
- package/dist/chunks/{chunk-2HN6DLIY.js → chunk-HSXUEJ4T.js} +1 -1
- package/dist/chunks/{chunk-SDZ5ICZL.js → chunk-LABX5FSJ.js} +1 -1
- package/dist/chunks/{chunk-JISJDGJF.js → chunk-LOPPFUV3.js} +2 -2
- package/dist/chunks/{chunk-O4V7CMVO.js → chunk-OEYKL4IY.js} +7 -5
- package/dist/chunks/{chunk-372SHB43.js → chunk-OQD4G5FW.js} +4 -4
- package/dist/chunks/{chunk-LJ5WXXG6.js → chunk-QH7WYDEP.js} +11 -0
- package/dist/chunks/{chunk-Z3X747P6.js → chunk-RHXSECUF.js} +206 -31
- package/dist/chunks/{chunk-LQR3CHMH.js → chunk-SFPJ3VR7.js} +421 -799
- package/dist/chunks/{chunk-FEYVO2US.js → chunk-TLVKY7WL.js} +90 -32
- package/dist/chunks/{chunk-4BFK3C7V.js → chunk-UZD3DM6V.js} +1 -1
- package/dist/chunks/{chunk-IPWWE7PB.js → chunk-WGH26RJV.js} +1 -1
- package/dist/chunks/{chunk-ILJH44MK.js → chunk-YE3C5CUX.js} +1 -1
- package/dist/chunks/{compile-vercel-config-3LV7J3IZ.js → compile-vercel-config-ATU3UBFK.js} +1 -1
- package/dist/chunks/{delete-GFW6Y6TZ.js → delete-WIN4UHQY.js} +3 -3
- package/dist/chunks/{disable-PGRAS2ZL.js → disable-24KUO3TS.js} +3 -3
- package/dist/chunks/{discard-S6N5Q4G5.js → discard-B6ATZCPD.js} +3 -3
- package/dist/chunks/{edit-TICKX4ZV.js → edit-DIYIVLFQ.js} +7 -7
- package/dist/chunks/{enable-L3BYWN6S.js → enable-BF7NKTV7.js} +3 -3
- package/dist/chunks/{export-NXS33U5T.js → export-HHONDN7V.js} +3 -3
- package/dist/chunks/{inspect-OOI5JN3Y.js → inspect-GSYKUMK5.js} +4 -4
- package/dist/chunks/{list-77WL6463.js → list-OSJGB5AE.js} +4 -4
- package/dist/chunks/{list-6EHRL2D4.js → list-PZ4DRWLO.js} +2 -2
- package/dist/chunks/{ls-PBSOEXFG.js → ls-QBCHGSIC.js} +5 -5
- package/dist/chunks/{publish-CU2THVYW.js → publish-QYPZQ66O.js} +3 -3
- package/dist/chunks/{query-HEATRYAK.js → query-BDMX4CF6.js} +3 -3
- package/dist/chunks/{reorder-IQVKSM3H.js → reorder-YDTGTTJB.js} +3 -3
- package/dist/chunks/{restore-RDEOBGAS.js → restore-LXO2ZBAF.js} +3 -3
- package/dist/chunks/{rm-MCSGTU4J.js → rm-3L7FVCDA.js} +5 -5
- package/dist/chunks/{rule-inspect-3YK2XSL3.js → rule-inspect-T57QBYJR.js} +5 -5
- package/dist/chunks/{rules-F4MRDDHM.js → rules-E5DTNMFG.js} +7 -7
- package/dist/chunks/{schema-65C5EBJ7.js → schema-VYVJ4GYP.js} +3 -3
- package/dist/chunks/{update-XB4WSRGY.js → update-LT3LZVEZ.js} +5 -5
- package/dist/commands/build/index.js +157 -101
- package/dist/commands/deploy/index.js +13 -12
- package/dist/commands/dev/index.js +70 -23
- package/dist/commands/env/index.js +8 -6
- package/dist/commands/link/index.js +9 -16
- package/dist/commands/list/index.js +3 -3
- package/dist/commands-bulk.js +5371 -1618
- package/dist/index.js +9 -9
- package/dist/version.mjs +1 -1
- package/package.json +21 -21
|
@@ -889,7 +889,7 @@ var require_uri_all = __commonJS({
|
|
|
889
889
|
target.fragment = relative2.fragment;
|
|
890
890
|
return target;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
892
|
+
function resolve4(baseURI, relativeURI, options) {
|
|
893
893
|
var schemelessOptions = assign({ scheme: "null" }, options);
|
|
894
894
|
return serialize(resolveComponents(parse3(baseURI, schemelessOptions), parse3(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
|
|
895
895
|
}
|
|
@@ -1157,7 +1157,7 @@ var require_uri_all = __commonJS({
|
|
|
1157
1157
|
exports2.removeDotSegments = removeDotSegments;
|
|
1158
1158
|
exports2.serialize = serialize;
|
|
1159
1159
|
exports2.resolveComponents = resolveComponents;
|
|
1160
|
-
exports2.resolve =
|
|
1160
|
+
exports2.resolve = resolve4;
|
|
1161
1161
|
exports2.normalize = normalize;
|
|
1162
1162
|
exports2.equal = equal;
|
|
1163
1163
|
exports2.escapeComponent = escapeComponent;
|
|
@@ -1543,20 +1543,20 @@ var require_resolve = __commonJS({
|
|
|
1543
1543
|
var util = require_util();
|
|
1544
1544
|
var SchemaObject = require_schema_obj();
|
|
1545
1545
|
var traverse = require_json_schema_traverse();
|
|
1546
|
-
module.exports =
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
function
|
|
1546
|
+
module.exports = resolve4;
|
|
1547
|
+
resolve4.normalizeId = normalizeId;
|
|
1548
|
+
resolve4.fullPath = getFullPath;
|
|
1549
|
+
resolve4.url = resolveUrl;
|
|
1550
|
+
resolve4.ids = resolveIds;
|
|
1551
|
+
resolve4.inlineRef = inlineRef;
|
|
1552
|
+
resolve4.schema = resolveSchema;
|
|
1553
|
+
function resolve4(compile, root, ref) {
|
|
1554
1554
|
var refVal = this._refs[ref];
|
|
1555
1555
|
if (typeof refVal == "string") {
|
|
1556
1556
|
if (this._refs[refVal])
|
|
1557
1557
|
refVal = this._refs[refVal];
|
|
1558
1558
|
else
|
|
1559
|
-
return
|
|
1559
|
+
return resolve4.call(this, compile, root, refVal);
|
|
1560
1560
|
}
|
|
1561
1561
|
refVal = refVal || this._schemas[ref];
|
|
1562
1562
|
if (refVal instanceof SchemaObject) {
|
|
@@ -1782,7 +1782,7 @@ var require_resolve = __commonJS({
|
|
|
1782
1782
|
var require_error_classes = __commonJS({
|
|
1783
1783
|
"../../node_modules/.pnpm/ajv@6.12.3/node_modules/ajv/lib/compile/error_classes.js"(exports, module) {
|
|
1784
1784
|
"use strict";
|
|
1785
|
-
var
|
|
1785
|
+
var resolve4 = require_resolve();
|
|
1786
1786
|
module.exports = {
|
|
1787
1787
|
Validation: errorSubclass(ValidationError2),
|
|
1788
1788
|
MissingRef: errorSubclass(MissingRefError)
|
|
@@ -1797,8 +1797,8 @@ var require_error_classes = __commonJS({
|
|
|
1797
1797
|
};
|
|
1798
1798
|
function MissingRefError(baseId, ref, message) {
|
|
1799
1799
|
this.message = message || MissingRefError.message(baseId, ref);
|
|
1800
|
-
this.missingRef =
|
|
1801
|
-
this.missingSchema =
|
|
1800
|
+
this.missingRef = resolve4.url(baseId, ref);
|
|
1801
|
+
this.missingSchema = resolve4.normalizeId(resolve4.fullPath(this.missingRef));
|
|
1802
1802
|
}
|
|
1803
1803
|
function errorSubclass(Subclass) {
|
|
1804
1804
|
Subclass.prototype = Object.create(Error.prototype);
|
|
@@ -2357,7 +2357,7 @@ var require_validate = __commonJS({
|
|
|
2357
2357
|
var require_compile = __commonJS({
|
|
2358
2358
|
"../../node_modules/.pnpm/ajv@6.12.3/node_modules/ajv/lib/compile/index.js"(exports, module) {
|
|
2359
2359
|
"use strict";
|
|
2360
|
-
var
|
|
2360
|
+
var resolve4 = require_resolve();
|
|
2361
2361
|
var util = require_util();
|
|
2362
2362
|
var errorClasses = require_error_classes();
|
|
2363
2363
|
var stableStringify = require_fast_json_stable_stringify();
|
|
@@ -2417,7 +2417,7 @@ var require_compile = __commonJS({
|
|
|
2417
2417
|
RULES,
|
|
2418
2418
|
validate: validateGenerator,
|
|
2419
2419
|
util,
|
|
2420
|
-
resolve:
|
|
2420
|
+
resolve: resolve4,
|
|
2421
2421
|
resolveRef,
|
|
2422
2422
|
usePattern,
|
|
2423
2423
|
useDefault,
|
|
@@ -2479,7 +2479,7 @@ var require_compile = __commonJS({
|
|
|
2479
2479
|
return validate;
|
|
2480
2480
|
}
|
|
2481
2481
|
function resolveRef(baseId2, ref, isRoot) {
|
|
2482
|
-
ref =
|
|
2482
|
+
ref = resolve4.url(baseId2, ref);
|
|
2483
2483
|
var refIndex = refs[ref];
|
|
2484
2484
|
var _refVal, refCode;
|
|
2485
2485
|
if (refIndex !== void 0) {
|
|
@@ -2496,11 +2496,11 @@ var require_compile = __commonJS({
|
|
|
2496
2496
|
}
|
|
2497
2497
|
}
|
|
2498
2498
|
refCode = addLocalRef(ref);
|
|
2499
|
-
var v2 =
|
|
2499
|
+
var v2 = resolve4.call(self2, localCompile, root, ref);
|
|
2500
2500
|
if (v2 === void 0) {
|
|
2501
2501
|
var localSchema = localRefs && localRefs[ref];
|
|
2502
2502
|
if (localSchema) {
|
|
2503
|
-
v2 =
|
|
2503
|
+
v2 = resolve4.inlineRef(localSchema, opts.inlineRefs) ? localSchema : compile.call(self2, localSchema, root, localRefs, baseId2);
|
|
2504
2504
|
}
|
|
2505
2505
|
}
|
|
2506
2506
|
if (v2 === void 0) {
|
|
@@ -6135,7 +6135,7 @@ var require_ajv = __commonJS({
|
|
|
6135
6135
|
"../../node_modules/.pnpm/ajv@6.12.3/node_modules/ajv/lib/ajv.js"(exports, module) {
|
|
6136
6136
|
"use strict";
|
|
6137
6137
|
var compileSchema = require_compile();
|
|
6138
|
-
var
|
|
6138
|
+
var resolve4 = require_resolve();
|
|
6139
6139
|
var Cache = require_cache();
|
|
6140
6140
|
var SchemaObject = require_schema_obj();
|
|
6141
6141
|
var stableStringify = require_fast_json_stable_stringify();
|
|
@@ -6227,7 +6227,7 @@ var require_ajv = __commonJS({
|
|
|
6227
6227
|
var id = this._getId(schema);
|
|
6228
6228
|
if (id !== void 0 && typeof id != "string")
|
|
6229
6229
|
throw new Error("schema id must be string");
|
|
6230
|
-
key =
|
|
6230
|
+
key = resolve4.normalizeId(key || id);
|
|
6231
6231
|
checkUnique(this, key);
|
|
6232
6232
|
this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
|
|
6233
6233
|
return this;
|
|
@@ -6273,7 +6273,7 @@ var require_ajv = __commonJS({
|
|
|
6273
6273
|
}
|
|
6274
6274
|
}
|
|
6275
6275
|
function _getSchemaFragment(self2, ref) {
|
|
6276
|
-
var res =
|
|
6276
|
+
var res = resolve4.schema.call(self2, { schema: {} }, ref);
|
|
6277
6277
|
if (res) {
|
|
6278
6278
|
var schema = res.schema, root = res.root, baseId = res.baseId;
|
|
6279
6279
|
var v = compileSchema.call(self2, schema, root, void 0, baseId);
|
|
@@ -6289,7 +6289,7 @@ var require_ajv = __commonJS({
|
|
|
6289
6289
|
}
|
|
6290
6290
|
}
|
|
6291
6291
|
function _getSchemaObj(self2, keyRef) {
|
|
6292
|
-
keyRef =
|
|
6292
|
+
keyRef = resolve4.normalizeId(keyRef);
|
|
6293
6293
|
return self2._schemas[keyRef] || self2._refs[keyRef] || self2._fragments[keyRef];
|
|
6294
6294
|
}
|
|
6295
6295
|
function removeSchema(schemaKeyRef) {
|
|
@@ -6317,7 +6317,7 @@ var require_ajv = __commonJS({
|
|
|
6317
6317
|
this._cache.del(cacheKey);
|
|
6318
6318
|
var id = this._getId(schemaKeyRef);
|
|
6319
6319
|
if (id) {
|
|
6320
|
-
id =
|
|
6320
|
+
id = resolve4.normalizeId(id);
|
|
6321
6321
|
delete this._schemas[id];
|
|
6322
6322
|
delete this._refs[id];
|
|
6323
6323
|
}
|
|
@@ -6342,14 +6342,14 @@ var require_ajv = __commonJS({
|
|
|
6342
6342
|
if (cached)
|
|
6343
6343
|
return cached;
|
|
6344
6344
|
shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
|
|
6345
|
-
var id =
|
|
6345
|
+
var id = resolve4.normalizeId(this._getId(schema));
|
|
6346
6346
|
if (id && shouldAddSchema)
|
|
6347
6347
|
checkUnique(this, id);
|
|
6348
6348
|
var willValidate = this._opts.validateSchema !== false && !skipValidation;
|
|
6349
6349
|
var recursiveMeta;
|
|
6350
|
-
if (willValidate && !(recursiveMeta = id && id ==
|
|
6350
|
+
if (willValidate && !(recursiveMeta = id && id == resolve4.normalizeId(schema.$schema)))
|
|
6351
6351
|
this.validateSchema(schema, true);
|
|
6352
|
-
var localRefs =
|
|
6352
|
+
var localRefs = resolve4.ids.call(this, schema);
|
|
6353
6353
|
var schemaObj = new SchemaObject({
|
|
6354
6354
|
id,
|
|
6355
6355
|
schema,
|
|
@@ -6521,8 +6521,8 @@ var require_universalify = __commonJS({
|
|
|
6521
6521
|
if (typeof args[args.length - 1] === "function")
|
|
6522
6522
|
fn.apply(this, args);
|
|
6523
6523
|
else {
|
|
6524
|
-
return new Promise((
|
|
6525
|
-
args.push((err, res) => err != null ? reject(err) :
|
|
6524
|
+
return new Promise((resolve4, reject) => {
|
|
6525
|
+
args.push((err, res) => err != null ? reject(err) : resolve4(res));
|
|
6526
6526
|
fn.apply(this, args);
|
|
6527
6527
|
});
|
|
6528
6528
|
}
|
|
@@ -6595,19 +6595,19 @@ var require_fs = __commonJS({
|
|
|
6595
6595
|
if (typeof callback === "function") {
|
|
6596
6596
|
return fs5.exists(filename, callback);
|
|
6597
6597
|
}
|
|
6598
|
-
return new Promise((
|
|
6599
|
-
return fs5.exists(filename,
|
|
6598
|
+
return new Promise((resolve4) => {
|
|
6599
|
+
return fs5.exists(filename, resolve4);
|
|
6600
6600
|
});
|
|
6601
6601
|
};
|
|
6602
6602
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
6603
6603
|
if (typeof callback === "function") {
|
|
6604
6604
|
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
6605
6605
|
}
|
|
6606
|
-
return new Promise((
|
|
6606
|
+
return new Promise((resolve4, reject) => {
|
|
6607
6607
|
fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
6608
6608
|
if (err)
|
|
6609
6609
|
return reject(err);
|
|
6610
|
-
|
|
6610
|
+
resolve4({ bytesRead, buffer: buffer2 });
|
|
6611
6611
|
});
|
|
6612
6612
|
});
|
|
6613
6613
|
};
|
|
@@ -6615,11 +6615,11 @@ var require_fs = __commonJS({
|
|
|
6615
6615
|
if (typeof args[args.length - 1] === "function") {
|
|
6616
6616
|
return fs5.write(fd, buffer, ...args);
|
|
6617
6617
|
}
|
|
6618
|
-
return new Promise((
|
|
6618
|
+
return new Promise((resolve4, reject) => {
|
|
6619
6619
|
fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
6620
6620
|
if (err)
|
|
6621
6621
|
return reject(err);
|
|
6622
|
-
|
|
6622
|
+
resolve4({ bytesWritten, buffer: buffer2 });
|
|
6623
6623
|
});
|
|
6624
6624
|
});
|
|
6625
6625
|
};
|
|
@@ -6628,11 +6628,11 @@ var require_fs = __commonJS({
|
|
|
6628
6628
|
if (typeof args[args.length - 1] === "function") {
|
|
6629
6629
|
return fs5.writev(fd, buffers, ...args);
|
|
6630
6630
|
}
|
|
6631
|
-
return new Promise((
|
|
6631
|
+
return new Promise((resolve4, reject) => {
|
|
6632
6632
|
fs5.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
|
|
6633
6633
|
if (err)
|
|
6634
6634
|
return reject(err);
|
|
6635
|
-
|
|
6635
|
+
resolve4({ bytesWritten, buffers: buffers2 });
|
|
6636
6636
|
});
|
|
6637
6637
|
});
|
|
6638
6638
|
};
|
|
@@ -8006,7 +8006,7 @@ var require_jsonfile = __commonJS({
|
|
|
8006
8006
|
}
|
|
8007
8007
|
return obj;
|
|
8008
8008
|
}
|
|
8009
|
-
var
|
|
8009
|
+
var readFile6 = universalify.fromPromise(_readFile);
|
|
8010
8010
|
function readFileSync(file, options = {}) {
|
|
8011
8011
|
if (typeof options === "string") {
|
|
8012
8012
|
options = { encoding: options };
|
|
@@ -8031,16 +8031,16 @@ var require_jsonfile = __commonJS({
|
|
|
8031
8031
|
const str = stringify(obj, options);
|
|
8032
8032
|
await universalify.fromCallback(fs5.writeFile)(file, str, options);
|
|
8033
8033
|
}
|
|
8034
|
-
var
|
|
8034
|
+
var writeFile5 = universalify.fromPromise(_writeFile);
|
|
8035
8035
|
function writeFileSync(file, obj, options = {}) {
|
|
8036
8036
|
const fs5 = options.fs || _fs;
|
|
8037
8037
|
const str = stringify(obj, options);
|
|
8038
8038
|
return fs5.writeFileSync(file, str, options);
|
|
8039
8039
|
}
|
|
8040
8040
|
module.exports = {
|
|
8041
|
-
readFile:
|
|
8041
|
+
readFile: readFile6,
|
|
8042
8042
|
readFileSync,
|
|
8043
|
-
writeFile:
|
|
8043
|
+
writeFile: writeFile5,
|
|
8044
8044
|
writeFileSync
|
|
8045
8045
|
};
|
|
8046
8046
|
}
|
|
@@ -8431,14 +8431,14 @@ var require_templates = __commonJS({
|
|
|
8431
8431
|
}
|
|
8432
8432
|
return results;
|
|
8433
8433
|
}
|
|
8434
|
-
function buildStyle(
|
|
8434
|
+
function buildStyle(chalk14, styles) {
|
|
8435
8435
|
const enabled = {};
|
|
8436
8436
|
for (const layer of styles) {
|
|
8437
8437
|
for (const style of layer.styles) {
|
|
8438
8438
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
8439
8439
|
}
|
|
8440
8440
|
}
|
|
8441
|
-
let current =
|
|
8441
|
+
let current = chalk14;
|
|
8442
8442
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
8443
8443
|
if (!Array.isArray(styles2)) {
|
|
8444
8444
|
continue;
|
|
@@ -8450,7 +8450,7 @@ var require_templates = __commonJS({
|
|
|
8450
8450
|
}
|
|
8451
8451
|
return current;
|
|
8452
8452
|
}
|
|
8453
|
-
module.exports = (
|
|
8453
|
+
module.exports = (chalk14, temporary) => {
|
|
8454
8454
|
const styles = [];
|
|
8455
8455
|
const chunks = [];
|
|
8456
8456
|
let chunk = [];
|
|
@@ -8460,13 +8460,13 @@ var require_templates = __commonJS({
|
|
|
8460
8460
|
} else if (style) {
|
|
8461
8461
|
const string = chunk.join("");
|
|
8462
8462
|
chunk = [];
|
|
8463
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
8463
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk14, styles)(string));
|
|
8464
8464
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
8465
8465
|
} else if (close) {
|
|
8466
8466
|
if (styles.length === 0) {
|
|
8467
8467
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
8468
8468
|
}
|
|
8469
|
-
chunks.push(buildStyle(
|
|
8469
|
+
chunks.push(buildStyle(chalk14, styles)(chunk.join("")));
|
|
8470
8470
|
chunk = [];
|
|
8471
8471
|
styles.pop();
|
|
8472
8472
|
} else {
|
|
@@ -8514,16 +8514,16 @@ var require_source2 = __commonJS({
|
|
|
8514
8514
|
}
|
|
8515
8515
|
};
|
|
8516
8516
|
var chalkFactory = (options) => {
|
|
8517
|
-
const
|
|
8518
|
-
applyOptions(
|
|
8519
|
-
|
|
8520
|
-
Object.setPrototypeOf(
|
|
8521
|
-
Object.setPrototypeOf(
|
|
8522
|
-
|
|
8517
|
+
const chalk15 = {};
|
|
8518
|
+
applyOptions(chalk15, options);
|
|
8519
|
+
chalk15.template = (...arguments_) => chalkTag(chalk15.template, ...arguments_);
|
|
8520
|
+
Object.setPrototypeOf(chalk15, Chalk.prototype);
|
|
8521
|
+
Object.setPrototypeOf(chalk15.template, chalk15);
|
|
8522
|
+
chalk15.template.constructor = () => {
|
|
8523
8523
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
8524
8524
|
};
|
|
8525
|
-
|
|
8526
|
-
return
|
|
8525
|
+
chalk15.template.Instance = ChalkClass;
|
|
8526
|
+
return chalk15.template;
|
|
8527
8527
|
};
|
|
8528
8528
|
function Chalk(options) {
|
|
8529
8529
|
return chalkFactory(options);
|
|
@@ -8634,7 +8634,7 @@ var require_source2 = __commonJS({
|
|
|
8634
8634
|
return openAll + string + closeAll;
|
|
8635
8635
|
};
|
|
8636
8636
|
var template;
|
|
8637
|
-
var chalkTag = (
|
|
8637
|
+
var chalkTag = (chalk15, ...strings) => {
|
|
8638
8638
|
const [firstString] = strings;
|
|
8639
8639
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
8640
8640
|
return strings.join(" ");
|
|
@@ -8650,14 +8650,14 @@ var require_source2 = __commonJS({
|
|
|
8650
8650
|
if (template === void 0) {
|
|
8651
8651
|
template = require_templates();
|
|
8652
8652
|
}
|
|
8653
|
-
return template(
|
|
8653
|
+
return template(chalk15, parts.join(""));
|
|
8654
8654
|
};
|
|
8655
8655
|
Object.defineProperties(Chalk.prototype, styles);
|
|
8656
|
-
var
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
module.exports =
|
|
8656
|
+
var chalk14 = Chalk();
|
|
8657
|
+
chalk14.supportsColor = stdoutColor;
|
|
8658
|
+
chalk14.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
8659
|
+
chalk14.stderr.supportsColor = stderrColor;
|
|
8660
|
+
module.exports = chalk14;
|
|
8661
8661
|
}
|
|
8662
8662
|
});
|
|
8663
8663
|
|
|
@@ -13734,10 +13734,10 @@ var require_read_config_file = __commonJS({
|
|
|
13734
13734
|
var import_smol_toml3 = __require("smol-toml");
|
|
13735
13735
|
var import_fs4 = __require("fs");
|
|
13736
13736
|
var import_error_utils5 = require_dist();
|
|
13737
|
-
var { readFile:
|
|
13737
|
+
var { readFile: readFile6 } = import_fs4.promises;
|
|
13738
13738
|
async function readFileOrNull(file) {
|
|
13739
13739
|
try {
|
|
13740
|
-
const data = await
|
|
13740
|
+
const data = await readFile6(file);
|
|
13741
13741
|
return data;
|
|
13742
13742
|
} catch (error) {
|
|
13743
13743
|
if (!(0, import_error_utils5.isErrnoException)(error)) {
|
|
@@ -13824,7 +13824,7 @@ var require_frameworks = __commonJS({
|
|
|
13824
13824
|
var import_fs4 = __require("fs");
|
|
13825
13825
|
var import_read_config_file = require_read_config_file();
|
|
13826
13826
|
__reExport(frameworks_exports, require_types(), module.exports);
|
|
13827
|
-
var { readdir, readFile:
|
|
13827
|
+
var { readdir, readFile: readFile6, unlink: unlink2 } = import_fs4.promises;
|
|
13828
13828
|
var frameworks = [
|
|
13829
13829
|
{
|
|
13830
13830
|
name: "Blitz.js (Legacy)",
|
|
@@ -13952,7 +13952,7 @@ var require_frameworks = __commonJS({
|
|
|
13952
13952
|
"public",
|
|
13953
13953
|
"__now_routes_g4t5bY.json"
|
|
13954
13954
|
);
|
|
13955
|
-
const content = await
|
|
13955
|
+
const content = await readFile6(nowRoutesPath, "utf8");
|
|
13956
13956
|
const nowRoutes = JSON.parse(content);
|
|
13957
13957
|
try {
|
|
13958
13958
|
await unlink2(nowRoutesPath);
|
|
@@ -16012,12 +16012,12 @@ var require_frameworks = __commonJS({
|
|
|
16012
16012
|
experimental: true
|
|
16013
16013
|
},
|
|
16014
16014
|
{
|
|
16015
|
-
name: "
|
|
16015
|
+
name: "eve",
|
|
16016
16016
|
slug: "eve",
|
|
16017
16017
|
logo: "https://api-frameworks.vercel.sh/framework-logos/eve.svg",
|
|
16018
16018
|
darkModeLogo: "https://api-frameworks.vercel.sh/framework-logos/eve-dark.svg",
|
|
16019
16019
|
tagline: "A filesystem-first framework for durable backend agents on Vercel.",
|
|
16020
|
-
description: "An
|
|
16020
|
+
description: "An eve app: agents authored as a directory of files, compiled and served on Vercel.",
|
|
16021
16021
|
detectors: {
|
|
16022
16022
|
every: [
|
|
16023
16023
|
{
|
|
@@ -18350,11 +18350,11 @@ var require_brace_expansion = __commonJS({
|
|
|
18350
18350
|
if (pad) {
|
|
18351
18351
|
var need = width - c.length;
|
|
18352
18352
|
if (need > 0) {
|
|
18353
|
-
var
|
|
18353
|
+
var z = new Array(need + 1).join("0");
|
|
18354
18354
|
if (i < 0)
|
|
18355
|
-
c = "-" +
|
|
18355
|
+
c = "-" + z + c.slice(1);
|
|
18356
18356
|
else
|
|
18357
|
-
c =
|
|
18357
|
+
c = z + c;
|
|
18358
18358
|
}
|
|
18359
18359
|
}
|
|
18360
18360
|
}
|
|
@@ -20940,6 +20940,7 @@ var require_superstatic = __commonJS({
|
|
|
20940
20940
|
var superstatic_exports = {};
|
|
20941
20941
|
__export2(superstatic_exports, {
|
|
20942
20942
|
collectHasSegments: () => collectHasSegments,
|
|
20943
|
+
compilePathToRegexpTemplate: () => compilePathToRegexpTemplate2,
|
|
20943
20944
|
convertCleanUrls: () => convertCleanUrls,
|
|
20944
20945
|
convertHeaders: () => convertHeaders,
|
|
20945
20946
|
convertRedirects: () => convertRedirects,
|
|
@@ -21083,6 +21084,22 @@ var require_superstatic = __commonJS({
|
|
|
21083
21084
|
}
|
|
21084
21085
|
route = { src, destination };
|
|
21085
21086
|
}
|
|
21087
|
+
if (r.transforms) {
|
|
21088
|
+
route.transforms = r.transforms.map((transform) => {
|
|
21089
|
+
if (transform.type !== "request.path") {
|
|
21090
|
+
return { ...transform };
|
|
21091
|
+
}
|
|
21092
|
+
return {
|
|
21093
|
+
...transform,
|
|
21094
|
+
args: compilePathToRegexpTemplateFromSegments(
|
|
21095
|
+
transform.args,
|
|
21096
|
+
segments,
|
|
21097
|
+
hasSegments,
|
|
21098
|
+
transform.env
|
|
21099
|
+
)
|
|
21100
|
+
};
|
|
21101
|
+
});
|
|
21102
|
+
}
|
|
21086
21103
|
if (typeof r.env !== "undefined") {
|
|
21087
21104
|
route.env = r.env;
|
|
21088
21105
|
}
|
|
@@ -21223,6 +21240,81 @@ var require_superstatic = __commonJS({
|
|
|
21223
21240
|
}
|
|
21224
21241
|
var escapeSegment = (str, segmentName) => str.replace(new RegExp(`:${segmentName}`, "g"), `__ESC_COLON_${segmentName}`);
|
|
21225
21242
|
var unescapeSegments = (str) => str.replace(/__ESC_COLON_/gi, ":");
|
|
21243
|
+
var pathTemplateSegmentNameRegex = /^([a-zA-Z_][a-zA-Z0-9_]*)/;
|
|
21244
|
+
function isEscaped(value, index) {
|
|
21245
|
+
let backslashCount = 0;
|
|
21246
|
+
for (let i = index - 1; i >= 0 && value[i] === "\\"; i--) {
|
|
21247
|
+
backslashCount++;
|
|
21248
|
+
}
|
|
21249
|
+
return backslashCount % 2 === 1;
|
|
21250
|
+
}
|
|
21251
|
+
function collectPathTemplateSegments(template) {
|
|
21252
|
+
const segments = [];
|
|
21253
|
+
for (let i = 0; i < template.length; i++) {
|
|
21254
|
+
if (template[i] !== ":" || isEscaped(template, i)) {
|
|
21255
|
+
continue;
|
|
21256
|
+
}
|
|
21257
|
+
const match = template.slice(i + 1).match(pathTemplateSegmentNameRegex);
|
|
21258
|
+
if (match) {
|
|
21259
|
+
segments.push(match[1]);
|
|
21260
|
+
i += match[1].length;
|
|
21261
|
+
}
|
|
21262
|
+
}
|
|
21263
|
+
return segments;
|
|
21264
|
+
}
|
|
21265
|
+
function collectNamedDollarReferences(template) {
|
|
21266
|
+
const references = [];
|
|
21267
|
+
for (let i = 0; i < template.length; i++) {
|
|
21268
|
+
if (template[i] !== "$" || isEscaped(template, i)) {
|
|
21269
|
+
continue;
|
|
21270
|
+
}
|
|
21271
|
+
const remainder = template.slice(i + 1);
|
|
21272
|
+
const bracedMatch = remainder.match(/^\{([a-zA-Z_][a-zA-Z0-9_]*)\}/);
|
|
21273
|
+
const unbracedMatch = remainder.match(pathTemplateSegmentNameRegex);
|
|
21274
|
+
const name = bracedMatch?.[1] || unbracedMatch?.[1];
|
|
21275
|
+
if (name) {
|
|
21276
|
+
references.push(name);
|
|
21277
|
+
}
|
|
21278
|
+
}
|
|
21279
|
+
return references;
|
|
21280
|
+
}
|
|
21281
|
+
function compilePathToRegexpTemplateFromSegments(template, segments, hasItemSegments, env = []) {
|
|
21282
|
+
const indexes = {};
|
|
21283
|
+
segments.forEach((name, index) => {
|
|
21284
|
+
indexes[name] = toSegmentDest(index);
|
|
21285
|
+
});
|
|
21286
|
+
hasItemSegments.forEach((name) => {
|
|
21287
|
+
indexes[name] = `$${name}`;
|
|
21288
|
+
});
|
|
21289
|
+
for (const name of collectPathTemplateSegments(template)) {
|
|
21290
|
+
if (!(name in indexes)) {
|
|
21291
|
+
throw new Error(
|
|
21292
|
+
`Path template references parameter ":${name}" that is not present in the source or has conditions.`
|
|
21293
|
+
);
|
|
21294
|
+
}
|
|
21295
|
+
}
|
|
21296
|
+
const routeParameters = /* @__PURE__ */ new Set([
|
|
21297
|
+
...segments.filter((name) => name !== UN_NAMED_SEGMENT),
|
|
21298
|
+
...hasItemSegments
|
|
21299
|
+
]);
|
|
21300
|
+
for (const name of collectNamedDollarReferences(template)) {
|
|
21301
|
+
if (routeParameters.has(name) && !env.includes(name)) {
|
|
21302
|
+
throw new Error(
|
|
21303
|
+
`Path template references route parameter "${name}" as \`$${name}\`. Use \`:${name}\` path-to-regexp syntax in high-level rewrites, or list "${name}" in the transform env allowlist if it is an environment variable.`
|
|
21304
|
+
);
|
|
21305
|
+
}
|
|
21306
|
+
}
|
|
21307
|
+
return safelyCompile(template, indexes, true);
|
|
21308
|
+
}
|
|
21309
|
+
function compilePathToRegexpTemplate2(source, template, has, env) {
|
|
21310
|
+
const { segments } = sourceToRegex2(source);
|
|
21311
|
+
return compilePathToRegexpTemplateFromSegments(
|
|
21312
|
+
template,
|
|
21313
|
+
segments,
|
|
21314
|
+
collectHasSegments(has),
|
|
21315
|
+
env
|
|
21316
|
+
);
|
|
21317
|
+
}
|
|
21226
21318
|
function replaceSegments(segments, hasItemSegments, destination, isRedirect, internalParamNames) {
|
|
21227
21319
|
const namedSegments = segments.filter((name) => name !== UN_NAMED_SEGMENT);
|
|
21228
21320
|
const canNeedReplacing = destination.includes(":") && namedSegments.length > 0 || hasItemSegments.length > 0 || !isRedirect;
|
|
@@ -21624,7 +21716,8 @@ var require_schemas = __commonJS({
|
|
|
21624
21716
|
redirectsSchema: () => redirectsSchema2,
|
|
21625
21717
|
rewritesSchema: () => rewritesSchema2,
|
|
21626
21718
|
routesSchema: () => routesSchema2,
|
|
21627
|
-
trailingSlashSchema: () => trailingSlashSchema2
|
|
21719
|
+
trailingSlashSchema: () => trailingSlashSchema2,
|
|
21720
|
+
transformsSchema: () => transformsSchema
|
|
21628
21721
|
});
|
|
21629
21722
|
module.exports = __toCommonJS2(schemas_exports);
|
|
21630
21723
|
var mitigateSchema = {
|
|
@@ -21789,18 +21882,23 @@ var require_schemas = __commonJS({
|
|
|
21789
21882
|
}
|
|
21790
21883
|
};
|
|
21791
21884
|
var transformsSchema = {
|
|
21792
|
-
description: "A list of transform rules to adjust
|
|
21885
|
+
description: "A list of transform rules to adjust a request path, request query parameters, or request/response headers",
|
|
21793
21886
|
type: "array",
|
|
21794
21887
|
minItems: 1,
|
|
21795
21888
|
items: {
|
|
21796
21889
|
type: "object",
|
|
21797
21890
|
additionalProperties: false,
|
|
21798
|
-
required: ["type", "op"
|
|
21891
|
+
required: ["type", "op"],
|
|
21799
21892
|
properties: {
|
|
21800
21893
|
type: {
|
|
21801
21894
|
description: "The scope of the transform to apply",
|
|
21802
21895
|
type: "string",
|
|
21803
|
-
enum: [
|
|
21896
|
+
enum: [
|
|
21897
|
+
"request.headers",
|
|
21898
|
+
"request.query",
|
|
21899
|
+
"response.headers",
|
|
21900
|
+
"request.path"
|
|
21901
|
+
]
|
|
21804
21902
|
},
|
|
21805
21903
|
op: {
|
|
21806
21904
|
description: "The operation to perform on the target",
|
|
@@ -21986,10 +22084,90 @@ var require_schemas = __commonJS({
|
|
|
21986
22084
|
}
|
|
21987
22085
|
}
|
|
21988
22086
|
}
|
|
22087
|
+
},
|
|
22088
|
+
{
|
|
22089
|
+
if: {
|
|
22090
|
+
required: ["type"],
|
|
22091
|
+
properties: {
|
|
22092
|
+
type: {
|
|
22093
|
+
enum: ["request.headers", "request.query", "response.headers"]
|
|
22094
|
+
}
|
|
22095
|
+
}
|
|
22096
|
+
},
|
|
22097
|
+
// biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
|
|
22098
|
+
then: {
|
|
22099
|
+
required: ["target"]
|
|
22100
|
+
}
|
|
22101
|
+
},
|
|
22102
|
+
{
|
|
22103
|
+
if: {
|
|
22104
|
+
required: ["type"],
|
|
22105
|
+
properties: {
|
|
22106
|
+
type: {
|
|
22107
|
+
enum: ["request.path"]
|
|
22108
|
+
}
|
|
22109
|
+
}
|
|
22110
|
+
},
|
|
22111
|
+
// biome-ignore lint/suspicious/noThenProperty: JSON Schema if/then keyword
|
|
22112
|
+
then: {
|
|
22113
|
+
required: ["args"],
|
|
22114
|
+
not: {
|
|
22115
|
+
required: ["target"]
|
|
22116
|
+
},
|
|
22117
|
+
properties: {
|
|
22118
|
+
op: {
|
|
22119
|
+
enum: ["set"]
|
|
22120
|
+
},
|
|
22121
|
+
args: {
|
|
22122
|
+
description: "The runtime-visible request path. Must be an origin-form path without query or fragment.",
|
|
22123
|
+
type: "string",
|
|
22124
|
+
maxLength: 2048,
|
|
22125
|
+
pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
|
|
22126
|
+
}
|
|
22127
|
+
}
|
|
22128
|
+
}
|
|
21989
22129
|
}
|
|
21990
22130
|
]
|
|
21991
22131
|
}
|
|
21992
22132
|
};
|
|
22133
|
+
var rewriteTransformsSchema = {
|
|
22134
|
+
description: "A list of request path transforms using path-to-regexp parameters.",
|
|
22135
|
+
type: "array",
|
|
22136
|
+
minItems: 1,
|
|
22137
|
+
items: {
|
|
22138
|
+
type: "object",
|
|
22139
|
+
additionalProperties: false,
|
|
22140
|
+
required: ["type", "op", "args"],
|
|
22141
|
+
properties: {
|
|
22142
|
+
type: {
|
|
22143
|
+
description: "The request path to expose to the target runtime",
|
|
22144
|
+
type: "string",
|
|
22145
|
+
enum: ["request.path"]
|
|
22146
|
+
},
|
|
22147
|
+
op: {
|
|
22148
|
+
description: "Replace the runtime-visible request path",
|
|
22149
|
+
type: "string",
|
|
22150
|
+
enum: ["set"]
|
|
22151
|
+
},
|
|
22152
|
+
args: {
|
|
22153
|
+
description: "An origin-form request path. Route parameters use path-to-regexp syntax such as `/:path*`.",
|
|
22154
|
+
type: "string",
|
|
22155
|
+
maxLength: 2048,
|
|
22156
|
+
pattern: "^/(?!/)(?!.*[?#\\s\\x00-\\x1F\\x7F]).*$"
|
|
22157
|
+
},
|
|
22158
|
+
env: {
|
|
22159
|
+
description: "An array of environment variable names that should be replaced at runtime in the args value",
|
|
22160
|
+
type: "array",
|
|
22161
|
+
minItems: 1,
|
|
22162
|
+
maxItems: 64,
|
|
22163
|
+
items: {
|
|
22164
|
+
type: "string",
|
|
22165
|
+
maxLength: 256
|
|
22166
|
+
}
|
|
22167
|
+
}
|
|
22168
|
+
}
|
|
22169
|
+
}
|
|
22170
|
+
};
|
|
21993
22171
|
var routesSchema2 = {
|
|
21994
22172
|
type: "array",
|
|
21995
22173
|
description: "A list of routes objects used to rewrite paths to point towards other internal or external paths",
|
|
@@ -22169,6 +22347,7 @@ var require_schemas = __commonJS({
|
|
|
22169
22347
|
description: "An absolute pathname to an existing resource, an external URL, or a service-targeted destination object.",
|
|
22170
22348
|
anyOf: [{ type: "string", maxLength: 4096 }, serviceDestinationSchema]
|
|
22171
22349
|
},
|
|
22350
|
+
transforms: rewriteTransformsSchema,
|
|
22172
22351
|
has: hasSchema,
|
|
22173
22352
|
missing: hasSchema,
|
|
22174
22353
|
statusCode: {
|
|
@@ -22337,6 +22516,7 @@ var require_dist5 = __commonJS({
|
|
|
22337
22516
|
var src_exports = {};
|
|
22338
22517
|
__export2(src_exports, {
|
|
22339
22518
|
appendRoutesToPhase: () => import_append.appendRoutesToPhase,
|
|
22519
|
+
compilePathToRegexpTemplate: () => import_superstatic2.compilePathToRegexpTemplate,
|
|
22340
22520
|
getCleanUrls: () => import_superstatic2.getCleanUrls,
|
|
22341
22521
|
getOwnershipGuard: () => import_service_route_ownership.getOwnershipGuard,
|
|
22342
22522
|
getTransformedRoutes: () => getTransformedRoutes,
|
|
@@ -22510,7 +22690,8 @@ var require_dist5 = __commonJS({
|
|
|
22510
22690
|
function checkPatternSyntax(type, index, {
|
|
22511
22691
|
source,
|
|
22512
22692
|
destination,
|
|
22513
|
-
has
|
|
22693
|
+
has,
|
|
22694
|
+
transforms
|
|
22514
22695
|
}) {
|
|
22515
22696
|
let sourceSegments = /* @__PURE__ */ new Set();
|
|
22516
22697
|
const destinationSegments = /* @__PURE__ */ new Set();
|
|
@@ -22550,6 +22731,19 @@ var require_dist5 = __commonJS({
|
|
|
22550
22731
|
}
|
|
22551
22732
|
}
|
|
22552
22733
|
}
|
|
22734
|
+
for (const transform of transforms || []) {
|
|
22735
|
+
if (transform.type !== "request.path") {
|
|
22736
|
+
continue;
|
|
22737
|
+
}
|
|
22738
|
+
try {
|
|
22739
|
+
(0, import_superstatic.compilePathToRegexpTemplate)(source, transform.args, has, transform.env);
|
|
22740
|
+
} catch (error) {
|
|
22741
|
+
return {
|
|
22742
|
+
message: `${type} at index ${index} has an invalid \`request.path\` transform: ${error instanceof Error ? error.message : String(error)}`,
|
|
22743
|
+
link: "https://vercel.link/invalid-route-destination-segment"
|
|
22744
|
+
};
|
|
22745
|
+
}
|
|
22746
|
+
}
|
|
22553
22747
|
return null;
|
|
22554
22748
|
}
|
|
22555
22749
|
function checkRedirect(r, index) {
|
|
@@ -22841,7 +23035,8 @@ var require_utils3 = __commonJS({
|
|
|
22841
23035
|
isFrontendFramework: () => isFrontendFramework,
|
|
22842
23036
|
isRouteOwningBuilder: () => isRouteOwningBuilder2,
|
|
22843
23037
|
isStaticBuild: () => isStaticBuild2,
|
|
22844
|
-
readVercelConfig: () => readVercelConfig
|
|
23038
|
+
readVercelConfig: () => readVercelConfig,
|
|
23039
|
+
stripTrailingSlash: () => stripTrailingSlash
|
|
22845
23040
|
});
|
|
22846
23041
|
module.exports = __toCommonJS2(utils_exports);
|
|
22847
23042
|
var import_framework_helpers = __require("@vercel/build-utils/dist/framework-helpers");
|
|
@@ -22851,6 +23046,10 @@ var require_utils3 = __commonJS({
|
|
|
22851
23046
|
var DETECTION_FRAMEWORKS = import_frameworks2.frameworkList.filter(
|
|
22852
23047
|
(framework) => !framework.experimental || framework.runtimeFramework
|
|
22853
23048
|
);
|
|
23049
|
+
function stripTrailingSlash(p) {
|
|
23050
|
+
const stripped = p.replace(/\/+$/, "");
|
|
23051
|
+
return stripped === "" ? "." : stripped;
|
|
23052
|
+
}
|
|
22854
23053
|
async function hasFile(fs5, filePath) {
|
|
22855
23054
|
try {
|
|
22856
23055
|
return await fs5.isFile(filePath);
|
|
@@ -23327,7 +23526,7 @@ var require_resolve2 = __commonJS({
|
|
|
23327
23526
|
if (!root) {
|
|
23328
23527
|
return { fs: fs5 };
|
|
23329
23528
|
}
|
|
23330
|
-
const normalizedRoot = import_path12.posix.normalize(root);
|
|
23529
|
+
const normalizedRoot = (0, import_utils4.stripTrailingSlash)(import_path12.posix.normalize(root));
|
|
23331
23530
|
if (!await fs5.hasPath(normalizedRoot)) {
|
|
23332
23531
|
return {
|
|
23333
23532
|
fs: fs5,
|
|
@@ -24251,9 +24450,8 @@ var require_resolve_v2 = __commonJS({
|
|
|
24251
24450
|
return null;
|
|
24252
24451
|
}
|
|
24253
24452
|
async function resolveConfiguredServiceV22(name, config, fs5) {
|
|
24254
|
-
const
|
|
24255
|
-
const
|
|
24256
|
-
const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, root);
|
|
24453
|
+
const normalizedRoot = (0, import_utils4.stripTrailingSlash)(import_path12.posix.normalize(config.root));
|
|
24454
|
+
const serviceFsResult = normalizedRoot === "." ? { fs: fs5 } : await (0, import_resolve.getServiceFs)(fs5, name, normalizedRoot);
|
|
24257
24455
|
if (serviceFsResult.error) {
|
|
24258
24456
|
return { error: serviceFsResult.error };
|
|
24259
24457
|
}
|
|
@@ -24343,7 +24541,7 @@ var require_resolve_v2 = __commonJS({
|
|
|
24343
24541
|
service: {
|
|
24344
24542
|
schema: "experimentalServicesV2",
|
|
24345
24543
|
name,
|
|
24346
|
-
root,
|
|
24544
|
+
root: normalizedRoot,
|
|
24347
24545
|
framework,
|
|
24348
24546
|
runtime,
|
|
24349
24547
|
entrypoint: entrypointFile,
|
|
@@ -28760,7 +28958,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28760
28958
|
LocalFileSystemDetector: () => LocalFileSystemDetector4
|
|
28761
28959
|
});
|
|
28762
28960
|
module.exports = __toCommonJS2(local_file_system_detector_exports);
|
|
28763
|
-
var
|
|
28961
|
+
var import_promises4 = __toESM2(__require("fs/promises"));
|
|
28764
28962
|
var import_path12 = __require("path");
|
|
28765
28963
|
var import_filesystem = require_filesystem();
|
|
28766
28964
|
var import_error_utils5 = require_dist();
|
|
@@ -28771,7 +28969,7 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28771
28969
|
}
|
|
28772
28970
|
async _hasPath(name) {
|
|
28773
28971
|
try {
|
|
28774
|
-
await
|
|
28972
|
+
await import_promises4.default.stat(this.getFilePath(name));
|
|
28775
28973
|
return true;
|
|
28776
28974
|
} catch (err) {
|
|
28777
28975
|
if ((0, import_error_utils5.isErrnoException)(err) && err.code === "ENOENT") {
|
|
@@ -28781,15 +28979,15 @@ var require_local_file_system_detector = __commonJS({
|
|
|
28781
28979
|
}
|
|
28782
28980
|
}
|
|
28783
28981
|
_readFile(name) {
|
|
28784
|
-
return
|
|
28982
|
+
return import_promises4.default.readFile(this.getFilePath(name));
|
|
28785
28983
|
}
|
|
28786
28984
|
async _isFile(name) {
|
|
28787
|
-
const stat2 = await
|
|
28985
|
+
const stat2 = await import_promises4.default.stat(this.getFilePath(name));
|
|
28788
28986
|
return stat2.isFile();
|
|
28789
28987
|
}
|
|
28790
28988
|
async _readdir(dir) {
|
|
28791
28989
|
const dirPath = this.getFilePath(dir);
|
|
28792
|
-
const entries = await
|
|
28990
|
+
const entries = await import_promises4.default.readdir(dirPath, { withFileTypes: true });
|
|
28793
28991
|
const result = [];
|
|
28794
28992
|
for (const entry of entries) {
|
|
28795
28993
|
let type;
|
|
@@ -30685,11 +30883,11 @@ var require_brace_expansion2 = __commonJS({
|
|
|
30685
30883
|
if (pad) {
|
|
30686
30884
|
var need = width - c.length;
|
|
30687
30885
|
if (need > 0) {
|
|
30688
|
-
var
|
|
30886
|
+
var z = new Array(need + 1).join("0");
|
|
30689
30887
|
if (i < 0)
|
|
30690
|
-
c = "-" +
|
|
30888
|
+
c = "-" + z + c.slice(1);
|
|
30691
30889
|
else
|
|
30692
|
-
c =
|
|
30890
|
+
c = z + c;
|
|
30693
30891
|
}
|
|
30694
30892
|
}
|
|
30695
30893
|
}
|
|
@@ -33737,7 +33935,7 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33737
33935
|
async function getPackagePaths(packages, fs5) {
|
|
33738
33936
|
return (await Promise.all(
|
|
33739
33937
|
packages.map(
|
|
33740
|
-
(packageGlob) => new Promise((
|
|
33938
|
+
(packageGlob) => new Promise((resolve4, reject) => {
|
|
33741
33939
|
(0, import_glob.default)(
|
|
33742
33940
|
normalizePath3(posixPath.join(packageGlob, "package.json")),
|
|
33743
33941
|
{
|
|
@@ -33748,7 +33946,7 @@ var require_get_workspace_package_paths = __commonJS({
|
|
|
33748
33946
|
if (err)
|
|
33749
33947
|
reject(err);
|
|
33750
33948
|
else
|
|
33751
|
-
|
|
33949
|
+
resolve4(matches);
|
|
33752
33950
|
}
|
|
33753
33951
|
);
|
|
33754
33952
|
})
|
|
@@ -34649,14 +34847,14 @@ var require_open = __commonJS({
|
|
|
34649
34847
|
}
|
|
34650
34848
|
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
34651
34849
|
if (options.wait) {
|
|
34652
|
-
return new Promise((
|
|
34850
|
+
return new Promise((resolve4, reject) => {
|
|
34653
34851
|
subprocess.once("error", reject);
|
|
34654
34852
|
subprocess.once("close", (exitCode) => {
|
|
34655
34853
|
if (options.allowNonzeroExitCode && exitCode > 0) {
|
|
34656
34854
|
reject(new Error(`Exited with code ${exitCode}`));
|
|
34657
34855
|
return;
|
|
34658
34856
|
}
|
|
34659
|
-
|
|
34857
|
+
resolve4(subprocess);
|
|
34660
34858
|
});
|
|
34661
34859
|
});
|
|
34662
34860
|
}
|
|
@@ -34747,11 +34945,11 @@ var require_universalify2 = __commonJS({
|
|
|
34747
34945
|
if (typeof arguments[arguments.length - 1] === "function")
|
|
34748
34946
|
fn.apply(this, arguments);
|
|
34749
34947
|
else {
|
|
34750
|
-
return new Promise((
|
|
34948
|
+
return new Promise((resolve4, reject) => {
|
|
34751
34949
|
arguments[arguments.length] = (err, res) => {
|
|
34752
34950
|
if (err)
|
|
34753
34951
|
return reject(err);
|
|
34754
|
-
|
|
34952
|
+
resolve4(res);
|
|
34755
34953
|
};
|
|
34756
34954
|
arguments.length++;
|
|
34757
34955
|
fn.apply(this, arguments);
|
|
@@ -34826,19 +35024,19 @@ var require_fs3 = __commonJS({
|
|
|
34826
35024
|
if (typeof callback === "function") {
|
|
34827
35025
|
return fs5.exists(filename, callback);
|
|
34828
35026
|
}
|
|
34829
|
-
return new Promise((
|
|
34830
|
-
return fs5.exists(filename,
|
|
35027
|
+
return new Promise((resolve4) => {
|
|
35028
|
+
return fs5.exists(filename, resolve4);
|
|
34831
35029
|
});
|
|
34832
35030
|
};
|
|
34833
35031
|
exports.read = function(fd, buffer, offset, length, position, callback) {
|
|
34834
35032
|
if (typeof callback === "function") {
|
|
34835
35033
|
return fs5.read(fd, buffer, offset, length, position, callback);
|
|
34836
35034
|
}
|
|
34837
|
-
return new Promise((
|
|
35035
|
+
return new Promise((resolve4, reject) => {
|
|
34838
35036
|
fs5.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => {
|
|
34839
35037
|
if (err)
|
|
34840
35038
|
return reject(err);
|
|
34841
|
-
|
|
35039
|
+
resolve4({ bytesRead, buffer: buffer2 });
|
|
34842
35040
|
});
|
|
34843
35041
|
});
|
|
34844
35042
|
};
|
|
@@ -34846,11 +35044,11 @@ var require_fs3 = __commonJS({
|
|
|
34846
35044
|
if (typeof args[args.length - 1] === "function") {
|
|
34847
35045
|
return fs5.write(fd, buffer, ...args);
|
|
34848
35046
|
}
|
|
34849
|
-
return new Promise((
|
|
35047
|
+
return new Promise((resolve4, reject) => {
|
|
34850
35048
|
fs5.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => {
|
|
34851
35049
|
if (err)
|
|
34852
35050
|
return reject(err);
|
|
34853
|
-
|
|
35051
|
+
resolve4({ bytesWritten, buffer: buffer2 });
|
|
34854
35052
|
});
|
|
34855
35053
|
});
|
|
34856
35054
|
};
|
|
@@ -36329,7 +36527,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
36329
36527
|
} catch (_) {
|
|
36330
36528
|
_fs = __require("fs");
|
|
36331
36529
|
}
|
|
36332
|
-
function
|
|
36530
|
+
function readFile6(file, options, callback) {
|
|
36333
36531
|
if (callback == null) {
|
|
36334
36532
|
callback = options;
|
|
36335
36533
|
options = {};
|
|
@@ -36398,7 +36596,7 @@ var require_jsonfile3 = __commonJS({
|
|
|
36398
36596
|
var str = JSON.stringify(obj, options ? options.replacer : null, spaces);
|
|
36399
36597
|
return str.replace(/\n/g, EOL) + EOL;
|
|
36400
36598
|
}
|
|
36401
|
-
function
|
|
36599
|
+
function writeFile5(file, obj, options, callback) {
|
|
36402
36600
|
if (callback == null) {
|
|
36403
36601
|
callback = options;
|
|
36404
36602
|
options = {};
|
|
@@ -36428,9 +36626,9 @@ var require_jsonfile3 = __commonJS({
|
|
|
36428
36626
|
return content;
|
|
36429
36627
|
}
|
|
36430
36628
|
var jsonfile = {
|
|
36431
|
-
readFile:
|
|
36629
|
+
readFile: readFile6,
|
|
36432
36630
|
readFileSync,
|
|
36433
|
-
writeFile:
|
|
36631
|
+
writeFile: writeFile5,
|
|
36434
36632
|
writeFileSync
|
|
36435
36633
|
};
|
|
36436
36634
|
module.exports = jsonfile;
|
|
@@ -36862,12 +37060,12 @@ var require_lib7 = __commonJS({
|
|
|
36862
37060
|
if (token !== void 0) {
|
|
36863
37061
|
return token;
|
|
36864
37062
|
}
|
|
36865
|
-
return new Promise((
|
|
37063
|
+
return new Promise((resolve4, reject) => {
|
|
36866
37064
|
if (this.pauseFn && !this.paused) {
|
|
36867
37065
|
this.paused = true;
|
|
36868
37066
|
this.pauseFn();
|
|
36869
37067
|
}
|
|
36870
|
-
this.waiting.push({ resolve:
|
|
37068
|
+
this.waiting.push({ resolve: resolve4, reject });
|
|
36871
37069
|
});
|
|
36872
37070
|
}
|
|
36873
37071
|
release(token) {
|
|
@@ -37408,7 +37606,7 @@ var require_package = __commonJS({
|
|
|
37408
37606
|
"../client/package.json"(exports, module) {
|
|
37409
37607
|
module.exports = {
|
|
37410
37608
|
name: "@vercel/client",
|
|
37411
|
-
version: "17.5.
|
|
37609
|
+
version: "17.5.17",
|
|
37412
37610
|
main: "dist/index.js",
|
|
37413
37611
|
typings: "dist/index.d.ts",
|
|
37414
37612
|
homepage: "https://vercel.com",
|
|
@@ -37549,14 +37747,14 @@ var require_readdir_recursive = __commonJS({
|
|
|
37549
37747
|
function readdir(path, ignores) {
|
|
37550
37748
|
ignores = ignores.map(toMatcherFunction);
|
|
37551
37749
|
let list2 = [];
|
|
37552
|
-
return new Promise(function(
|
|
37750
|
+
return new Promise(function(resolve4, reject) {
|
|
37553
37751
|
import_fs4.default.readdir(path, function(err, files) {
|
|
37554
37752
|
if (err) {
|
|
37555
37753
|
return reject(err);
|
|
37556
37754
|
}
|
|
37557
37755
|
let pending = files.length;
|
|
37558
37756
|
if (!pending) {
|
|
37559
|
-
return
|
|
37757
|
+
return resolve4(list2);
|
|
37560
37758
|
}
|
|
37561
37759
|
files.forEach(function(file) {
|
|
37562
37760
|
const filePath = import_path12.default.join(path, file);
|
|
@@ -37568,7 +37766,7 @@ var require_readdir_recursive = __commonJS({
|
|
|
37568
37766
|
if (matches) {
|
|
37569
37767
|
pending -= 1;
|
|
37570
37768
|
if (!pending) {
|
|
37571
|
-
return
|
|
37769
|
+
return resolve4(list2);
|
|
37572
37770
|
}
|
|
37573
37771
|
return null;
|
|
37574
37772
|
}
|
|
@@ -37580,14 +37778,14 @@ var require_readdir_recursive = __commonJS({
|
|
|
37580
37778
|
list2 = list2.concat(res);
|
|
37581
37779
|
pending -= 1;
|
|
37582
37780
|
if (!pending) {
|
|
37583
|
-
return
|
|
37781
|
+
return resolve4(list2);
|
|
37584
37782
|
}
|
|
37585
37783
|
}).catch(reject);
|
|
37586
37784
|
} else {
|
|
37587
37785
|
list2.push(filePath);
|
|
37588
37786
|
pending -= 1;
|
|
37589
37787
|
if (!pending) {
|
|
37590
|
-
return
|
|
37788
|
+
return resolve4(list2);
|
|
37591
37789
|
}
|
|
37592
37790
|
}
|
|
37593
37791
|
});
|
|
@@ -43839,42 +44037,42 @@ var require_queue = __commonJS({
|
|
|
43839
44037
|
queue.drained = drained;
|
|
43840
44038
|
return queue;
|
|
43841
44039
|
function push(value) {
|
|
43842
|
-
var p = new Promise(function(
|
|
44040
|
+
var p = new Promise(function(resolve4, reject) {
|
|
43843
44041
|
pushCb(value, function(err, result) {
|
|
43844
44042
|
if (err) {
|
|
43845
44043
|
reject(err);
|
|
43846
44044
|
return;
|
|
43847
44045
|
}
|
|
43848
|
-
|
|
44046
|
+
resolve4(result);
|
|
43849
44047
|
});
|
|
43850
44048
|
});
|
|
43851
44049
|
p.catch(noop);
|
|
43852
44050
|
return p;
|
|
43853
44051
|
}
|
|
43854
44052
|
function unshift(value) {
|
|
43855
|
-
var p = new Promise(function(
|
|
44053
|
+
var p = new Promise(function(resolve4, reject) {
|
|
43856
44054
|
unshiftCb(value, function(err, result) {
|
|
43857
44055
|
if (err) {
|
|
43858
44056
|
reject(err);
|
|
43859
44057
|
return;
|
|
43860
44058
|
}
|
|
43861
|
-
|
|
44059
|
+
resolve4(result);
|
|
43862
44060
|
});
|
|
43863
44061
|
});
|
|
43864
44062
|
p.catch(noop);
|
|
43865
44063
|
return p;
|
|
43866
44064
|
}
|
|
43867
44065
|
function drained() {
|
|
43868
|
-
var p = new Promise(function(
|
|
44066
|
+
var p = new Promise(function(resolve4) {
|
|
43869
44067
|
process.nextTick(function() {
|
|
43870
44068
|
if (queue.idle()) {
|
|
43871
|
-
|
|
44069
|
+
resolve4();
|
|
43872
44070
|
} else {
|
|
43873
44071
|
var previousDrain = queue.drain;
|
|
43874
44072
|
queue.drain = function() {
|
|
43875
44073
|
if (typeof previousDrain === "function")
|
|
43876
44074
|
previousDrain();
|
|
43877
|
-
|
|
44075
|
+
resolve4();
|
|
43878
44076
|
queue.drain = previousDrain;
|
|
43879
44077
|
};
|
|
43880
44078
|
}
|
|
@@ -44360,9 +44558,9 @@ var require_stream3 = __commonJS({
|
|
|
44360
44558
|
});
|
|
44361
44559
|
}
|
|
44362
44560
|
_getStat(filepath) {
|
|
44363
|
-
return new Promise((
|
|
44561
|
+
return new Promise((resolve4, reject) => {
|
|
44364
44562
|
this._stat(filepath, this._fsStatSettings, (error, stats) => {
|
|
44365
|
-
return error === null ?
|
|
44563
|
+
return error === null ? resolve4(stats) : reject(error);
|
|
44366
44564
|
});
|
|
44367
44565
|
});
|
|
44368
44566
|
}
|
|
@@ -44386,10 +44584,10 @@ var require_async6 = __commonJS({
|
|
|
44386
44584
|
this._readerStream = new stream_1.default(this._settings);
|
|
44387
44585
|
}
|
|
44388
44586
|
dynamic(root, options) {
|
|
44389
|
-
return new Promise((
|
|
44587
|
+
return new Promise((resolve4, reject) => {
|
|
44390
44588
|
this._walkAsync(root, options, (error, entries) => {
|
|
44391
44589
|
if (error === null) {
|
|
44392
|
-
|
|
44590
|
+
resolve4(entries);
|
|
44393
44591
|
} else {
|
|
44394
44592
|
reject(error);
|
|
44395
44593
|
}
|
|
@@ -44399,10 +44597,10 @@ var require_async6 = __commonJS({
|
|
|
44399
44597
|
async static(patterns, options) {
|
|
44400
44598
|
const entries = [];
|
|
44401
44599
|
const stream = this._readerStream.static(patterns, options);
|
|
44402
|
-
return new Promise((
|
|
44600
|
+
return new Promise((resolve4, reject) => {
|
|
44403
44601
|
stream.once("error", reject);
|
|
44404
44602
|
stream.on("data", (entry) => entries.push(entry));
|
|
44405
|
-
stream.once("end", () =>
|
|
44603
|
+
stream.once("end", () => resolve4(entries));
|
|
44406
44604
|
});
|
|
44407
44605
|
}
|
|
44408
44606
|
};
|
|
@@ -45097,14 +45295,14 @@ var require_utils8 = __commonJS({
|
|
|
45097
45295
|
});
|
|
45098
45296
|
module.exports = __toCommonJS2(utils_exports);
|
|
45099
45297
|
var import_node_fs2 = __toESM2(__require("fs"), 1);
|
|
45100
|
-
var
|
|
45298
|
+
var import_node_path2 = __require("path");
|
|
45101
45299
|
var CONFIGURATION_FILENAMES = [
|
|
45102
45300
|
"microfrontends.jsonc",
|
|
45103
45301
|
"microfrontends.json"
|
|
45104
45302
|
];
|
|
45105
45303
|
function findConfig({ dir }) {
|
|
45106
45304
|
for (const filename of CONFIGURATION_FILENAMES) {
|
|
45107
|
-
const maybeConfig = (0,
|
|
45305
|
+
const maybeConfig = (0, import_node_path2.join)(dir, filename);
|
|
45108
45306
|
if (import_node_fs2.default.existsSync(maybeConfig)) {
|
|
45109
45307
|
return maybeConfig;
|
|
45110
45308
|
}
|
|
@@ -46301,7 +46499,7 @@ var require_lib8 = __commonJS({
|
|
|
46301
46499
|
"../../node_modules/.pnpm/async-retry@1.2.3/node_modules/async-retry/lib/index.js"(exports, module) {
|
|
46302
46500
|
var retrier = require_retry2();
|
|
46303
46501
|
function retry(fn, opts) {
|
|
46304
|
-
function run(
|
|
46502
|
+
function run(resolve4, reject) {
|
|
46305
46503
|
var options = opts || {};
|
|
46306
46504
|
var op = retrier.operation(options);
|
|
46307
46505
|
function bail(err) {
|
|
@@ -46326,7 +46524,7 @@ var require_lib8 = __commonJS({
|
|
|
46326
46524
|
onError(err, num);
|
|
46327
46525
|
return;
|
|
46328
46526
|
}
|
|
46329
|
-
Promise.resolve(val).then(
|
|
46527
|
+
Promise.resolve(val).then(resolve4).catch(function catchIt(err) {
|
|
46330
46528
|
onError(err, num);
|
|
46331
46529
|
});
|
|
46332
46530
|
}
|
|
@@ -47006,7 +47204,7 @@ var require_BufferList = __commonJS({
|
|
|
47006
47204
|
this.head = this.tail = null;
|
|
47007
47205
|
this.length = 0;
|
|
47008
47206
|
};
|
|
47009
|
-
BufferList.prototype.join = function
|
|
47207
|
+
BufferList.prototype.join = function join11(s) {
|
|
47010
47208
|
if (this.length === 0)
|
|
47011
47209
|
return "";
|
|
47012
47210
|
var p = this.head;
|
|
@@ -52014,7 +52212,7 @@ var require_archive = __commonJS({
|
|
|
52014
52212
|
createTgzFiles: () => createTgzFiles
|
|
52015
52213
|
});
|
|
52016
52214
|
module.exports = __toCommonJS2(archive_exports);
|
|
52017
|
-
var
|
|
52215
|
+
var import_node_path2 = __require("path");
|
|
52018
52216
|
var import_node_zlib = __require("zlib");
|
|
52019
52217
|
var import_build_utils6 = __require("@vercel/build-utils");
|
|
52020
52218
|
var import_tar_fs = __toESM2(require_tar_fs());
|
|
@@ -52023,7 +52221,7 @@ var require_archive = __commonJS({
|
|
|
52023
52221
|
const filesToArchive = exclude ? fileList.filter((file) => !exclude.includes(file)) : fileList;
|
|
52024
52222
|
debug?.("Packing tarball");
|
|
52025
52223
|
const tarStream = import_tar_fs.default.pack(workPath, {
|
|
52026
|
-
entries: filesToArchive.map((file) => (0,
|
|
52224
|
+
entries: filesToArchive.map((file) => (0, import_node_path2.relative)(workPath, file))
|
|
52027
52225
|
}).pipe((0, import_node_zlib.createGzip)());
|
|
52028
52226
|
const chunkedTarBuffers = await (0, import_build_utils6.streamToBufferChunks)(tarStream);
|
|
52029
52227
|
debug?.(`Packed tarball into ${chunkedTarBuffers.length} chunks`);
|
|
@@ -52031,7 +52229,7 @@ var require_archive = __commonJS({
|
|
|
52031
52229
|
chunkedTarBuffers.map((chunk, index) => [
|
|
52032
52230
|
(0, import_hashes.hash)(chunk),
|
|
52033
52231
|
{
|
|
52034
|
-
names: [(0,
|
|
52232
|
+
names: [(0, import_node_path2.join)(workPath, `.vercel/source.tgz.part${index + 1}`)],
|
|
52035
52233
|
data: chunk,
|
|
52036
52234
|
mode: 438
|
|
52037
52235
|
}
|
|
@@ -52498,8 +52696,8 @@ var require_dist7 = __commonJS({
|
|
|
52498
52696
|
|
|
52499
52697
|
// src/util/compile-vercel-config.ts
|
|
52500
52698
|
var import_dotenv = __toESM(require_main(), 1);
|
|
52501
|
-
import { mkdir, readFile as
|
|
52502
|
-
import { join as
|
|
52699
|
+
import { mkdir, readFile as readFile5, writeFile as writeFile4, unlink, access } from "fs/promises";
|
|
52700
|
+
import { join as join10, basename as basename3 } from "path";
|
|
52503
52701
|
import { fork } from "child_process";
|
|
52504
52702
|
import { parse as tomlParse2 } from "smol-toml";
|
|
52505
52703
|
|
|
@@ -52507,7 +52705,7 @@ import { parse as tomlParse2 } from "smol-toml";
|
|
|
52507
52705
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
52508
52706
|
var import_fs_extra8 = __toESM(require_lib3(), 1);
|
|
52509
52707
|
import fs4 from "fs";
|
|
52510
|
-
import { join as
|
|
52708
|
+
import { join as join9, relative } from "path";
|
|
52511
52709
|
import { promisify } from "util";
|
|
52512
52710
|
|
|
52513
52711
|
// src/util/projects/get-project-by-id-or-name.ts
|
|
@@ -52976,13 +53174,13 @@ var CancelablePromise = class _CancelablePromise extends Promise {
|
|
|
52976
53174
|
});
|
|
52977
53175
|
}
|
|
52978
53176
|
static withResolver() {
|
|
52979
|
-
let
|
|
53177
|
+
let resolve4;
|
|
52980
53178
|
let reject;
|
|
52981
53179
|
const promise = new _CancelablePromise((res, rej) => {
|
|
52982
|
-
|
|
53180
|
+
resolve4 = res;
|
|
52983
53181
|
reject = rej;
|
|
52984
53182
|
});
|
|
52985
|
-
return { promise, resolve:
|
|
53183
|
+
return { promise, resolve: resolve4, reject };
|
|
52986
53184
|
}
|
|
52987
53185
|
};
|
|
52988
53186
|
|
|
@@ -53345,7 +53543,7 @@ function createPrompt(view) {
|
|
|
53345
53543
|
const screen = new ScreenManager(rl);
|
|
53346
53544
|
let cancel = () => {
|
|
53347
53545
|
};
|
|
53348
|
-
const answer = new CancelablePromise((
|
|
53546
|
+
const answer = new CancelablePromise((resolve4, reject) => {
|
|
53349
53547
|
withHooks(rl, (store) => {
|
|
53350
53548
|
function checkCursorPos() {
|
|
53351
53549
|
screen.checkCursorPos();
|
|
@@ -53378,7 +53576,7 @@ function createPrompt(view) {
|
|
|
53378
53576
|
function done(value) {
|
|
53379
53577
|
setImmediate(() => {
|
|
53380
53578
|
onExit2();
|
|
53381
|
-
|
|
53579
|
+
resolve4(value);
|
|
53382
53580
|
});
|
|
53383
53581
|
}
|
|
53384
53582
|
function workLoop(resolvedConfig) {
|
|
@@ -53919,20 +54117,20 @@ ${dirtyResult.reason}`
|
|
|
53919
54117
|
};
|
|
53920
54118
|
}
|
|
53921
54119
|
function getLastCommit(directory) {
|
|
53922
|
-
return new Promise((
|
|
54120
|
+
return new Promise((resolve4, reject) => {
|
|
53923
54121
|
import_git_last_commit.default.getLastCommit(
|
|
53924
54122
|
(err, commit) => {
|
|
53925
54123
|
if (err) {
|
|
53926
54124
|
return reject((0, import_error_utils.normalizeError)(err));
|
|
53927
54125
|
}
|
|
53928
|
-
|
|
54126
|
+
resolve4(commit);
|
|
53929
54127
|
},
|
|
53930
54128
|
{ dst: directory }
|
|
53931
54129
|
);
|
|
53932
54130
|
});
|
|
53933
54131
|
}
|
|
53934
54132
|
function isDirty(directory) {
|
|
53935
|
-
return new Promise((
|
|
54133
|
+
return new Promise((resolve4, reject) => {
|
|
53936
54134
|
exec(
|
|
53937
54135
|
"git --no-optional-locks status -s",
|
|
53938
54136
|
{ cwd: directory },
|
|
@@ -53943,7 +54141,7 @@ function isDirty(directory) {
|
|
|
53943
54141
|
if (stderr !== void 0 && stderr.trim().length > 0) {
|
|
53944
54142
|
return reject(new Error(stderr));
|
|
53945
54143
|
}
|
|
53946
|
-
|
|
54144
|
+
resolve4(stdout.trim().length > 0);
|
|
53947
54145
|
}
|
|
53948
54146
|
);
|
|
53949
54147
|
});
|
|
@@ -54603,7 +54801,7 @@ async function selectAndParseRemoteUrl(client, remoteUrls) {
|
|
|
54603
54801
|
}
|
|
54604
54802
|
async function checkExistsAndConnect({
|
|
54605
54803
|
client,
|
|
54606
|
-
confirm
|
|
54804
|
+
confirm,
|
|
54607
54805
|
org,
|
|
54608
54806
|
project,
|
|
54609
54807
|
gitProviderLink,
|
|
@@ -54640,7 +54838,7 @@ async function checkExistsAndConnect({
|
|
|
54640
54838
|
}
|
|
54641
54839
|
const shouldReplaceRepo = await confirmRepoConnect(
|
|
54642
54840
|
client,
|
|
54643
|
-
|
|
54841
|
+
confirm,
|
|
54644
54842
|
connectedProvider,
|
|
54645
54843
|
connectedRepoPath
|
|
54646
54844
|
);
|
|
@@ -55162,10 +55360,10 @@ function findProjectsFromPath(projects, path) {
|
|
|
55162
55360
|
}
|
|
55163
55361
|
|
|
55164
55362
|
// src/commands/env/pull.ts
|
|
55165
|
-
var
|
|
55363
|
+
var import_chalk12 = __toESM(require_source(), 1);
|
|
55166
55364
|
var import_fs_extra5 = __toESM(require_lib3(), 1);
|
|
55167
55365
|
import { closeSync, openSync, readSync } from "fs";
|
|
55168
|
-
import { resolve as
|
|
55366
|
+
import { resolve as resolve3 } from "path";
|
|
55169
55367
|
|
|
55170
55368
|
// src/util/output/param.ts
|
|
55171
55369
|
var import_chalk8 = __toESM(require_source(), 1);
|
|
@@ -55762,584 +55960,11 @@ function parseTarget({
|
|
|
55762
55960
|
}
|
|
55763
55961
|
|
|
55764
55962
|
// src/commands/login/future.ts
|
|
55765
|
-
var
|
|
55963
|
+
var import_chalk11 = __toESM(require_source(), 1);
|
|
55766
55964
|
var open = __toESM(require_open(), 1);
|
|
55767
55965
|
var import_ansi_escapes4 = __toESM(require_ansi_escapes(), 1);
|
|
55768
55966
|
import readline3 from "readline";
|
|
55769
|
-
import { KNOWN_AGENTS as KNOWN_AGENTS2 } from "@vercel/detect-agent";
|
|
55770
|
-
|
|
55771
|
-
// src/util/agent/auto-install-agentic.ts
|
|
55772
|
-
var import_chalk11 = __toESM(require_source(), 1);
|
|
55773
|
-
import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
|
|
55774
|
-
import { access } from "fs/promises";
|
|
55775
|
-
import { dirname, join as join6, resolve as resolve3 } from "path";
|
|
55776
|
-
import { homedir as homedir3 } from "os";
|
|
55777
|
-
import { spawn } from "child_process";
|
|
55778
55967
|
import { KNOWN_AGENTS } from "@vercel/detect-agent";
|
|
55779
|
-
import { z } from "zod";
|
|
55780
|
-
var PREFS_FILE = "agent-preferences.json";
|
|
55781
|
-
var CLAUDE_LEGACY_PLUGIN_ID = "vercel-plugin@vercel";
|
|
55782
|
-
var CLAUDE_OFFICIAL_PLUGIN_ID = "vercel@claude-plugins-official";
|
|
55783
|
-
var VERCEL_PLUGIN_VERSION_URL = "https://raw.githubusercontent.com/vercel/vercel-plugin/main/.claude-plugin/plugin.json";
|
|
55784
|
-
var AGENT_TO_TARGET = {
|
|
55785
|
-
[KNOWN_AGENTS.CLAUDE]: "claude-code",
|
|
55786
|
-
[KNOWN_AGENTS.COWORK]: "claude-code"
|
|
55787
|
-
};
|
|
55788
|
-
function getPluginTargetForAgent(agentName) {
|
|
55789
|
-
if (!agentName) {
|
|
55790
|
-
return void 0;
|
|
55791
|
-
}
|
|
55792
|
-
if (agentName === KNOWN_AGENTS.CLAUDE || agentName.startsWith("claude-code") || agentName === KNOWN_AGENTS.COWORK) {
|
|
55793
|
-
return "claude-code";
|
|
55794
|
-
}
|
|
55795
|
-
return AGENT_TO_TARGET[agentName];
|
|
55796
|
-
}
|
|
55797
|
-
var promptedAtSchema = z.codec(
|
|
55798
|
-
z.union([z.iso.date(), z.iso.datetime()]),
|
|
55799
|
-
z.date(),
|
|
55800
|
-
{
|
|
55801
|
-
decode: (value) => new Date(value),
|
|
55802
|
-
encode: (value) => value.toISOString()
|
|
55803
|
-
}
|
|
55804
|
-
);
|
|
55805
|
-
var agentPreferencesSchema = z.object({
|
|
55806
|
-
pluginDeclined: z.boolean().optional(),
|
|
55807
|
-
pluginAutoUpdate: z.boolean().optional(),
|
|
55808
|
-
lastPromptedAt: promptedAtSchema.optional(),
|
|
55809
|
-
lastPluginAutoUpdateAttemptedAt: promptedAtSchema.optional(),
|
|
55810
|
-
lastPluginAutoUpdateAttemptedKey: z.string().optional()
|
|
55811
|
-
});
|
|
55812
|
-
async function fileExists(filePath) {
|
|
55813
|
-
try {
|
|
55814
|
-
await access(filePath);
|
|
55815
|
-
return true;
|
|
55816
|
-
} catch {
|
|
55817
|
-
return false;
|
|
55818
|
-
}
|
|
55819
|
-
}
|
|
55820
|
-
async function readPrefs(client) {
|
|
55821
|
-
return await client.maybeReadConfig(PREFS_FILE, agentPreferencesSchema) ?? {};
|
|
55822
|
-
}
|
|
55823
|
-
async function writePrefs(client, prefs) {
|
|
55824
|
-
try {
|
|
55825
|
-
await client.writeConfig(PREFS_FILE, agentPreferencesSchema, prefs);
|
|
55826
|
-
} catch {
|
|
55827
|
-
}
|
|
55828
|
-
}
|
|
55829
|
-
function encodeClaudeProjectDir(projectPath) {
|
|
55830
|
-
return projectPath.replace(/[^A-Za-z0-9]/g, "-");
|
|
55831
|
-
}
|
|
55832
|
-
async function projectHasUsedClaudeCode(cwd) {
|
|
55833
|
-
const home2 = homedir3();
|
|
55834
|
-
const projectsDir = join6(home2, ".claude", "projects");
|
|
55835
|
-
let dir = resolve3(cwd);
|
|
55836
|
-
while (dir !== home2) {
|
|
55837
|
-
if (await fileExists(join6(projectsDir, encodeClaudeProjectDir(dir)))) {
|
|
55838
|
-
return true;
|
|
55839
|
-
}
|
|
55840
|
-
const parent = dirname(dir);
|
|
55841
|
-
if (parent === dir) {
|
|
55842
|
-
break;
|
|
55843
|
-
}
|
|
55844
|
-
dir = parent;
|
|
55845
|
-
}
|
|
55846
|
-
return false;
|
|
55847
|
-
}
|
|
55848
|
-
async function getPluginTargets(agentName, cwd) {
|
|
55849
|
-
const targetForAgent = getPluginTargetForAgent(agentName);
|
|
55850
|
-
if (targetForAgent) {
|
|
55851
|
-
return [targetForAgent];
|
|
55852
|
-
}
|
|
55853
|
-
if (agentName) {
|
|
55854
|
-
return [];
|
|
55855
|
-
}
|
|
55856
|
-
if (cwd && await projectHasUsedClaudeCode(cwd)) {
|
|
55857
|
-
return ["claude-code"];
|
|
55858
|
-
}
|
|
55859
|
-
return [];
|
|
55860
|
-
}
|
|
55861
|
-
async function readClaudeInstalledPluginsFromRegistry() {
|
|
55862
|
-
try {
|
|
55863
|
-
const raw = await readFile3(
|
|
55864
|
-
getClaudeInstalledPluginsRegistryPath(),
|
|
55865
|
-
"utf-8"
|
|
55866
|
-
);
|
|
55867
|
-
const data = JSON.parse(raw);
|
|
55868
|
-
const plugins = data?.plugins ?? {};
|
|
55869
|
-
const entries = [];
|
|
55870
|
-
for (const [id, installs] of Object.entries(plugins)) {
|
|
55871
|
-
if (!Array.isArray(installs))
|
|
55872
|
-
continue;
|
|
55873
|
-
for (const install of installs) {
|
|
55874
|
-
if (!install || typeof install !== "object")
|
|
55875
|
-
continue;
|
|
55876
|
-
entries.push({
|
|
55877
|
-
id,
|
|
55878
|
-
...install,
|
|
55879
|
-
enabled: true
|
|
55880
|
-
});
|
|
55881
|
-
}
|
|
55882
|
-
}
|
|
55883
|
-
return entries;
|
|
55884
|
-
} catch {
|
|
55885
|
-
return [];
|
|
55886
|
-
}
|
|
55887
|
-
}
|
|
55888
|
-
function getClaudeInstalledPluginsRegistryPath() {
|
|
55889
|
-
return join6(homedir3(), ".claude", "plugins", "installed_plugins.json");
|
|
55890
|
-
}
|
|
55891
|
-
async function markStaleClaudePluginInstalls(plugins) {
|
|
55892
|
-
return Promise.all(
|
|
55893
|
-
plugins.map(async (plugin) => {
|
|
55894
|
-
if (plugin.installPath && !await fileExists(plugin.installPath)) {
|
|
55895
|
-
return { ...plugin, stale: true };
|
|
55896
|
-
}
|
|
55897
|
-
return plugin;
|
|
55898
|
-
})
|
|
55899
|
-
);
|
|
55900
|
-
}
|
|
55901
|
-
async function removeClaudePluginFromRegistry(pluginId) {
|
|
55902
|
-
try {
|
|
55903
|
-
const registryPath = getClaudeInstalledPluginsRegistryPath();
|
|
55904
|
-
const raw = await readFile3(registryPath, "utf-8");
|
|
55905
|
-
const data = JSON.parse(raw);
|
|
55906
|
-
if (!data.plugins || !(pluginId in data.plugins)) {
|
|
55907
|
-
return false;
|
|
55908
|
-
}
|
|
55909
|
-
delete data.plugins[pluginId];
|
|
55910
|
-
await writeFile2(
|
|
55911
|
-
registryPath,
|
|
55912
|
-
`${JSON.stringify(data, null, 2)}
|
|
55913
|
-
`,
|
|
55914
|
-
"utf-8"
|
|
55915
|
-
);
|
|
55916
|
-
return true;
|
|
55917
|
-
} catch (err) {
|
|
55918
|
-
output_manager_default.debug(`Failed to remove Claude plugin registry entry: ${err}`);
|
|
55919
|
-
return false;
|
|
55920
|
-
}
|
|
55921
|
-
}
|
|
55922
|
-
async function isPluginInstalledForTarget(target) {
|
|
55923
|
-
if (target === "claude-code") {
|
|
55924
|
-
const status = await getClaudePluginStatus();
|
|
55925
|
-
return status.state === "official-only";
|
|
55926
|
-
}
|
|
55927
|
-
return false;
|
|
55928
|
-
}
|
|
55929
|
-
async function confirm(client, message) {
|
|
55930
|
-
if (!client.stdin.isTTY) {
|
|
55931
|
-
return false;
|
|
55932
|
-
}
|
|
55933
|
-
return client.input.confirm(message, true);
|
|
55934
|
-
}
|
|
55935
|
-
function isSameDay(left, right) {
|
|
55936
|
-
return left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate();
|
|
55937
|
-
}
|
|
55938
|
-
function wasPromptedToday(prefs) {
|
|
55939
|
-
return prefs.lastPromptedAt ? isSameDay(prefs.lastPromptedAt, /* @__PURE__ */ new Date()) : false;
|
|
55940
|
-
}
|
|
55941
|
-
function wasPluginAutoUpdateAttemptedToday(prefs, attemptKey) {
|
|
55942
|
-
return prefs.lastPluginAutoUpdateAttemptedKey === attemptKey && !!prefs.lastPluginAutoUpdateAttemptedAt && isSameDay(prefs.lastPluginAutoUpdateAttemptedAt, /* @__PURE__ */ new Date());
|
|
55943
|
-
}
|
|
55944
|
-
async function markPromptedToday(client, prefs) {
|
|
55945
|
-
prefs.lastPromptedAt = /* @__PURE__ */ new Date();
|
|
55946
|
-
await writePrefs(client, prefs);
|
|
55947
|
-
}
|
|
55948
|
-
function markPluginAutoUpdateAttempted(prefs, attemptKey) {
|
|
55949
|
-
if (!attemptKey)
|
|
55950
|
-
return;
|
|
55951
|
-
prefs.lastPluginAutoUpdateAttemptedAt = /* @__PURE__ */ new Date();
|
|
55952
|
-
prefs.lastPluginAutoUpdateAttemptedKey = attemptKey;
|
|
55953
|
-
}
|
|
55954
|
-
async function runCommand(command, args) {
|
|
55955
|
-
return await new Promise((resolve5) => {
|
|
55956
|
-
const child = spawn(command, args, { stdio: "pipe" });
|
|
55957
|
-
let stdout = "";
|
|
55958
|
-
let stderr = "";
|
|
55959
|
-
child.stdout.on("data", (chunk) => {
|
|
55960
|
-
stdout += chunk.toString();
|
|
55961
|
-
});
|
|
55962
|
-
child.stderr.on("data", (chunk) => {
|
|
55963
|
-
stderr += chunk.toString();
|
|
55964
|
-
});
|
|
55965
|
-
child.on("close", (code2) => {
|
|
55966
|
-
resolve5({ exitCode: code2 ?? 1, stdout, stderr });
|
|
55967
|
-
});
|
|
55968
|
-
child.on("error", (err) => {
|
|
55969
|
-
resolve5({ exitCode: 1, stdout, stderr: `${stderr}${String(err)}` });
|
|
55970
|
-
});
|
|
55971
|
-
});
|
|
55972
|
-
}
|
|
55973
|
-
async function getClaudeInstalledPlugins() {
|
|
55974
|
-
const result = await runCommand("claude", ["plugins", "list", "--json"]);
|
|
55975
|
-
if (result.exitCode === 0) {
|
|
55976
|
-
try {
|
|
55977
|
-
const parsed = JSON.parse(result.stdout);
|
|
55978
|
-
if (Array.isArray(parsed)) {
|
|
55979
|
-
return markStaleClaudePluginInstalls(parsed);
|
|
55980
|
-
}
|
|
55981
|
-
} catch (err) {
|
|
55982
|
-
output_manager_default.debug(`Failed to parse Claude plugin list JSON: ${err}`);
|
|
55983
|
-
}
|
|
55984
|
-
} else if (result.stderr.trim().length > 0) {
|
|
55985
|
-
output_manager_default.debug(
|
|
55986
|
-
`Failed to run 'claude plugins list --json': ${result.stderr}`
|
|
55987
|
-
);
|
|
55988
|
-
}
|
|
55989
|
-
return markStaleClaudePluginInstalls(
|
|
55990
|
-
await readClaudeInstalledPluginsFromRegistry()
|
|
55991
|
-
);
|
|
55992
|
-
}
|
|
55993
|
-
async function fetchLatestVercelPluginVersion() {
|
|
55994
|
-
try {
|
|
55995
|
-
const response = await fetch(VERCEL_PLUGIN_VERSION_URL);
|
|
55996
|
-
if (!response.ok) {
|
|
55997
|
-
output_manager_default.debug(
|
|
55998
|
-
`Failed to fetch latest Vercel plugin version: ${response.status}`
|
|
55999
|
-
);
|
|
56000
|
-
return void 0;
|
|
56001
|
-
}
|
|
56002
|
-
const manifest = await response.json();
|
|
56003
|
-
return typeof manifest.version === "string" ? manifest.version : void 0;
|
|
56004
|
-
} catch (err) {
|
|
56005
|
-
output_manager_default.debug(`Failed to fetch latest Vercel plugin version: ${err}`);
|
|
56006
|
-
return void 0;
|
|
56007
|
-
}
|
|
56008
|
-
}
|
|
56009
|
-
function comparePluginVersions(a, b) {
|
|
56010
|
-
if (!a && !b)
|
|
56011
|
-
return 0;
|
|
56012
|
-
if (!a)
|
|
56013
|
-
return -1;
|
|
56014
|
-
if (!b)
|
|
56015
|
-
return 1;
|
|
56016
|
-
const parse3 = (value) => value.split(".").map((part) => Number.parseInt(part, 10) || 0);
|
|
56017
|
-
const left = parse3(a);
|
|
56018
|
-
const right = parse3(b);
|
|
56019
|
-
const maxLength = Math.max(left.length, right.length);
|
|
56020
|
-
for (let i = 0; i < maxLength; i++) {
|
|
56021
|
-
const l = left[i] ?? 0;
|
|
56022
|
-
const r = right[i] ?? 0;
|
|
56023
|
-
if (l > r)
|
|
56024
|
-
return 1;
|
|
56025
|
-
if (l < r)
|
|
56026
|
-
return -1;
|
|
56027
|
-
}
|
|
56028
|
-
return 0;
|
|
56029
|
-
}
|
|
56030
|
-
function buildClaudePluginStatus(installedPlugins, latestVersion) {
|
|
56031
|
-
const legacy = installedPlugins.find(
|
|
56032
|
-
(plugin) => plugin.id === CLAUDE_LEGACY_PLUGIN_ID
|
|
56033
|
-
);
|
|
56034
|
-
const official = installedPlugins.find(
|
|
56035
|
-
(plugin) => plugin.id === CLAUDE_OFFICIAL_PLUGIN_ID
|
|
56036
|
-
);
|
|
56037
|
-
let state = "none";
|
|
56038
|
-
if (legacy && official)
|
|
56039
|
-
state = "both";
|
|
56040
|
-
else if (legacy)
|
|
56041
|
-
state = "legacy-only";
|
|
56042
|
-
else if (official)
|
|
56043
|
-
state = "official-only";
|
|
56044
|
-
return {
|
|
56045
|
-
state,
|
|
56046
|
-
legacy,
|
|
56047
|
-
official,
|
|
56048
|
-
latestVersion
|
|
56049
|
-
};
|
|
56050
|
-
}
|
|
56051
|
-
function buildClaudePluginMigrationPlan(status) {
|
|
56052
|
-
const plan = {
|
|
56053
|
-
installOfficial: false,
|
|
56054
|
-
updateOfficial: false,
|
|
56055
|
-
removeLegacy: false,
|
|
56056
|
-
removeLegacyMarketplace: false
|
|
56057
|
-
};
|
|
56058
|
-
switch (status.state) {
|
|
56059
|
-
case "none":
|
|
56060
|
-
plan.installOfficial = true;
|
|
56061
|
-
break;
|
|
56062
|
-
case "legacy-only":
|
|
56063
|
-
plan.installOfficial = true;
|
|
56064
|
-
plan.removeLegacy = true;
|
|
56065
|
-
plan.removeLegacyMarketplace = true;
|
|
56066
|
-
break;
|
|
56067
|
-
case "both":
|
|
56068
|
-
plan.removeLegacy = true;
|
|
56069
|
-
plan.removeLegacyMarketplace = true;
|
|
56070
|
-
break;
|
|
56071
|
-
case "official-only":
|
|
56072
|
-
break;
|
|
56073
|
-
}
|
|
56074
|
-
if (status.official?.version && status.latestVersion && comparePluginVersions(status.official.version, status.latestVersion) < 0) {
|
|
56075
|
-
plan.updateOfficial = true;
|
|
56076
|
-
}
|
|
56077
|
-
return plan;
|
|
56078
|
-
}
|
|
56079
|
-
function hasClaudeMigrationActions(plan) {
|
|
56080
|
-
return plan.installOfficial || plan.updateOfficial || plan.removeLegacy || plan.removeLegacyMarketplace;
|
|
56081
|
-
}
|
|
56082
|
-
function getClaudeAutoUpdateAttemptKey(status, plan) {
|
|
56083
|
-
return [
|
|
56084
|
-
status.state,
|
|
56085
|
-
status.legacy?.version ?? "none",
|
|
56086
|
-
status.official?.version ?? "none",
|
|
56087
|
-
status.latestVersion ?? "unknown",
|
|
56088
|
-
plan.installOfficial ? "install" : "",
|
|
56089
|
-
plan.updateOfficial ? "update" : "",
|
|
56090
|
-
plan.removeLegacy ? "remove-legacy" : "",
|
|
56091
|
-
plan.removeLegacyMarketplace ? "remove-marketplace" : ""
|
|
56092
|
-
].join(":");
|
|
56093
|
-
}
|
|
56094
|
-
function buildClaudePromptCopy(status, plan) {
|
|
56095
|
-
if (plan.installOfficial && status.state === "none") {
|
|
56096
|
-
return {
|
|
56097
|
-
message: "Vercel Plugin for Claude Code is not installed.",
|
|
56098
|
-
confirm: "Would you like to install it now?"
|
|
56099
|
-
};
|
|
56100
|
-
}
|
|
56101
|
-
if (plan.installOfficial && status.state === "legacy-only") {
|
|
56102
|
-
return {
|
|
56103
|
-
message: "Update available for Vercel Plugin for Claude Code (legacy -> official).",
|
|
56104
|
-
confirm: "Would you like to update now?"
|
|
56105
|
-
};
|
|
56106
|
-
}
|
|
56107
|
-
if (status.state === "both" && plan.removeLegacy) {
|
|
56108
|
-
return {
|
|
56109
|
-
message: "Vercel Plugin for Claude Code has a legacy install to clean up.",
|
|
56110
|
-
confirm: "Would you like to update now?"
|
|
56111
|
-
};
|
|
56112
|
-
}
|
|
56113
|
-
if (plan.updateOfficial) {
|
|
56114
|
-
const fromVersion = status.official?.version;
|
|
56115
|
-
const toVersion = status.latestVersion;
|
|
56116
|
-
const versionRange = fromVersion && toVersion ? ` (v${fromVersion} -> v${toVersion})` : "";
|
|
56117
|
-
return {
|
|
56118
|
-
message: `Update available for Vercel Plugin for Claude Code${versionRange}.`,
|
|
56119
|
-
confirm: "Would you like to update now?"
|
|
56120
|
-
};
|
|
56121
|
-
}
|
|
56122
|
-
return {
|
|
56123
|
-
message: "The Vercel plugin needs attention in Claude Code before your agent harness is fully up to date.",
|
|
56124
|
-
confirm: "Apply the Vercel plugin changes for Claude Code?"
|
|
56125
|
-
};
|
|
56126
|
-
}
|
|
56127
|
-
async function runClaudeCommand(spinnerMessage, successMessage, failureMessage, args, options) {
|
|
56128
|
-
output_manager_default.spinner(spinnerMessage);
|
|
56129
|
-
const result = await runCommand("claude", args);
|
|
56130
|
-
output_manager_default.stopSpinner();
|
|
56131
|
-
if (result.exitCode === 0) {
|
|
56132
|
-
if (!options?.quietSuccess) {
|
|
56133
|
-
output_manager_default.success(successMessage);
|
|
56134
|
-
}
|
|
56135
|
-
return true;
|
|
56136
|
-
}
|
|
56137
|
-
output_manager_default.warn(failureMessage);
|
|
56138
|
-
output_manager_default.debug(
|
|
56139
|
-
`Claude command failed: claude ${args.join(" ")}
|
|
56140
|
-
${result.stderr || result.stdout}`
|
|
56141
|
-
);
|
|
56142
|
-
return false;
|
|
56143
|
-
}
|
|
56144
|
-
async function removeStaleLegacyClaudePlugin(removeMarketplace) {
|
|
56145
|
-
output_manager_default.spinner("Removing the stale legacy Vercel Claude plugin...");
|
|
56146
|
-
const removedRegistryEntry = await removeClaudePluginFromRegistry(
|
|
56147
|
-
CLAUDE_LEGACY_PLUGIN_ID
|
|
56148
|
-
);
|
|
56149
|
-
output_manager_default.stopSpinner();
|
|
56150
|
-
if (!removedRegistryEntry) {
|
|
56151
|
-
output_manager_default.warn(
|
|
56152
|
-
"Could not remove the stale legacy Vercel Claude plugin registry entry."
|
|
56153
|
-
);
|
|
56154
|
-
return false;
|
|
56155
|
-
}
|
|
56156
|
-
output_manager_default.success("Removed the stale legacy Vercel Claude plugin");
|
|
56157
|
-
if (removeMarketplace) {
|
|
56158
|
-
const removedMarketplace = await runClaudeCommand(
|
|
56159
|
-
"Removing the legacy Vercel marketplace...",
|
|
56160
|
-
"Removed the legacy Vercel marketplace",
|
|
56161
|
-
"Removed the stale legacy Vercel plugin, but could not remove the legacy marketplace.",
|
|
56162
|
-
["plugins", "marketplace", "remove", "vercel"],
|
|
56163
|
-
{ quietSuccess: true }
|
|
56164
|
-
);
|
|
56165
|
-
if (!removedMarketplace) {
|
|
56166
|
-
output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel");
|
|
56167
|
-
}
|
|
56168
|
-
}
|
|
56169
|
-
return true;
|
|
56170
|
-
}
|
|
56171
|
-
async function runClaudeMigration(plan) {
|
|
56172
|
-
let removedStaleLegacy = false;
|
|
56173
|
-
if (plan.removeLegacy) {
|
|
56174
|
-
const statusBeforeInstall = await getClaudePluginStatus();
|
|
56175
|
-
if (statusBeforeInstall.legacy?.stale) {
|
|
56176
|
-
removedStaleLegacy = await removeStaleLegacyClaudePlugin(
|
|
56177
|
-
plan.removeLegacyMarketplace
|
|
56178
|
-
);
|
|
56179
|
-
}
|
|
56180
|
-
}
|
|
56181
|
-
if (plan.installOfficial) {
|
|
56182
|
-
const installed = await runClaudeCommand(
|
|
56183
|
-
"Installing the official Vercel Claude plugin...",
|
|
56184
|
-
"Updated the Vercel plugin",
|
|
56185
|
-
"Failed to install the official Vercel Claude plugin.",
|
|
56186
|
-
["plugins", "install", CLAUDE_OFFICIAL_PLUGIN_ID]
|
|
56187
|
-
);
|
|
56188
|
-
if (!installed) {
|
|
56189
|
-
return;
|
|
56190
|
-
}
|
|
56191
|
-
} else if (plan.updateOfficial) {
|
|
56192
|
-
await runClaudeCommand(
|
|
56193
|
-
"Updating the official Vercel Claude plugin...",
|
|
56194
|
-
"Updated the Vercel plugin",
|
|
56195
|
-
"Failed to update the official Vercel Claude plugin.",
|
|
56196
|
-
["plugins", "update", CLAUDE_OFFICIAL_PLUGIN_ID]
|
|
56197
|
-
);
|
|
56198
|
-
}
|
|
56199
|
-
const statusAfterInstall = await getClaudePluginStatus();
|
|
56200
|
-
if (!statusAfterInstall.official) {
|
|
56201
|
-
output_manager_default.warn(
|
|
56202
|
-
"Skipping Claude cleanup because the official Vercel plugin is not installed."
|
|
56203
|
-
);
|
|
56204
|
-
return;
|
|
56205
|
-
}
|
|
56206
|
-
if (plan.removeLegacy && statusAfterInstall.legacy) {
|
|
56207
|
-
const removedLegacy = await runClaudeCommand(
|
|
56208
|
-
"Removing the legacy Vercel Claude plugin...",
|
|
56209
|
-
"Removed the legacy Vercel Claude plugin",
|
|
56210
|
-
"Installed the official Vercel Claude plugin, but could not remove the legacy install.",
|
|
56211
|
-
["plugins", "uninstall", CLAUDE_LEGACY_PLUGIN_ID],
|
|
56212
|
-
{ quietSuccess: true }
|
|
56213
|
-
);
|
|
56214
|
-
if (!removedLegacy) {
|
|
56215
|
-
output_manager_default.log(
|
|
56216
|
-
`Cleanup command: claude plugins uninstall ${CLAUDE_LEGACY_PLUGIN_ID}`
|
|
56217
|
-
);
|
|
56218
|
-
return;
|
|
56219
|
-
}
|
|
56220
|
-
}
|
|
56221
|
-
if (plan.removeLegacyMarketplace && !removedStaleLegacy) {
|
|
56222
|
-
const finalStatus = await getClaudePluginStatus();
|
|
56223
|
-
if (!finalStatus.legacy) {
|
|
56224
|
-
const removedMarketplace = await runClaudeCommand(
|
|
56225
|
-
"Removing the legacy Vercel marketplace...",
|
|
56226
|
-
"Removed the legacy Vercel marketplace",
|
|
56227
|
-
"Removed the legacy Vercel plugin, but could not remove the legacy marketplace.",
|
|
56228
|
-
["plugins", "marketplace", "remove", "vercel"],
|
|
56229
|
-
{ quietSuccess: true }
|
|
56230
|
-
);
|
|
56231
|
-
if (!removedMarketplace) {
|
|
56232
|
-
output_manager_default.log("Cleanup command: claude plugins marketplace remove vercel");
|
|
56233
|
-
}
|
|
56234
|
-
}
|
|
56235
|
-
}
|
|
56236
|
-
}
|
|
56237
|
-
async function getClaudePluginStatus() {
|
|
56238
|
-
const [installedPlugins, latestVersion] = await Promise.all([
|
|
56239
|
-
getClaudeInstalledPlugins(),
|
|
56240
|
-
fetchLatestVercelPluginVersion()
|
|
56241
|
-
]);
|
|
56242
|
-
return buildClaudePluginStatus(installedPlugins, latestVersion);
|
|
56243
|
-
}
|
|
56244
|
-
async function applyPluginActions(targets, claudePlan) {
|
|
56245
|
-
for (const target of targets) {
|
|
56246
|
-
if (target === "claude-code" && claudePlan) {
|
|
56247
|
-
await runClaudeMigration(claudePlan);
|
|
56248
|
-
} else {
|
|
56249
|
-
output_manager_default.debug(`Skipping unsupported plugin target: ${target}`);
|
|
56250
|
-
}
|
|
56251
|
-
}
|
|
56252
|
-
}
|
|
56253
|
-
async function autoInstallVercelPlugin(client, options) {
|
|
56254
|
-
try {
|
|
56255
|
-
const prefs = await readPrefs(client);
|
|
56256
|
-
const applyMode = options?.mode === "apply";
|
|
56257
|
-
if (!prefs.pluginDeclined || prefs.pluginAutoUpdate || applyMode) {
|
|
56258
|
-
const targets = await getPluginTargets(client.agentName, client.cwd);
|
|
56259
|
-
const uninstalledTargets = [];
|
|
56260
|
-
const claudeStatus = targets.includes("claude-code") ? await getClaudePluginStatus() : void 0;
|
|
56261
|
-
const claudePlan = claudeStatus ? buildClaudePluginMigrationPlan(claudeStatus) : void 0;
|
|
56262
|
-
const claudeAutoUpdateAttemptKey = claudeStatus && claudePlan ? getClaudeAutoUpdateAttemptKey(claudeStatus, claudePlan) : void 0;
|
|
56263
|
-
for (const target of targets) {
|
|
56264
|
-
if (target === "claude-code") {
|
|
56265
|
-
if (claudePlan && hasClaudeMigrationActions(claudePlan)) {
|
|
56266
|
-
uninstalledTargets.push(target);
|
|
56267
|
-
}
|
|
56268
|
-
continue;
|
|
56269
|
-
}
|
|
56270
|
-
if (!await isPluginInstalledForTarget(target)) {
|
|
56271
|
-
uninstalledTargets.push(target);
|
|
56272
|
-
}
|
|
56273
|
-
}
|
|
56274
|
-
if (uninstalledTargets.length > 0) {
|
|
56275
|
-
if (prefs.pluginAutoUpdate) {
|
|
56276
|
-
if (claudeAutoUpdateAttemptKey && wasPluginAutoUpdateAttemptedToday(prefs, claudeAutoUpdateAttemptKey)) {
|
|
56277
|
-
return;
|
|
56278
|
-
}
|
|
56279
|
-
prefs.pluginDeclined = false;
|
|
56280
|
-
markPluginAutoUpdateAttempted(prefs, claudeAutoUpdateAttemptKey);
|
|
56281
|
-
await writePrefs(client, prefs);
|
|
56282
|
-
await applyPluginActions(uninstalledTargets, claudePlan);
|
|
56283
|
-
return;
|
|
56284
|
-
}
|
|
56285
|
-
if (!applyMode && wasPromptedToday(prefs)) {
|
|
56286
|
-
return;
|
|
56287
|
-
}
|
|
56288
|
-
if (applyMode) {
|
|
56289
|
-
prefs.pluginDeclined = false;
|
|
56290
|
-
prefs.pluginAutoUpdate = true;
|
|
56291
|
-
await writePrefs(client, prefs);
|
|
56292
|
-
await applyPluginActions(uninstalledTargets, claudePlan);
|
|
56293
|
-
return;
|
|
56294
|
-
}
|
|
56295
|
-
const promptMessages = [];
|
|
56296
|
-
let confirmMessage = "Install the Vercel plugin?";
|
|
56297
|
-
if (uninstalledTargets.includes("claude-code") && claudeStatus && claudePlan) {
|
|
56298
|
-
const claudePrompt = buildClaudePromptCopy(claudeStatus, claudePlan);
|
|
56299
|
-
promptMessages.push(claudePrompt.message);
|
|
56300
|
-
confirmMessage = claudePrompt.confirm;
|
|
56301
|
-
}
|
|
56302
|
-
const promptMessage = promptMessages.join(" ").trim();
|
|
56303
|
-
if (promptMessage) {
|
|
56304
|
-
output_manager_default.log(promptMessage);
|
|
56305
|
-
}
|
|
56306
|
-
const accepted = await confirm(client, confirmMessage);
|
|
56307
|
-
await markPromptedToday(client, prefs);
|
|
56308
|
-
if (accepted) {
|
|
56309
|
-
prefs.pluginDeclined = false;
|
|
56310
|
-
prefs.pluginAutoUpdate = true;
|
|
56311
|
-
await writePrefs(client, prefs);
|
|
56312
|
-
await applyPluginActions(uninstalledTargets, claudePlan);
|
|
56313
|
-
} else {
|
|
56314
|
-
prefs.pluginDeclined = true;
|
|
56315
|
-
prefs.pluginAutoUpdate = false;
|
|
56316
|
-
await writePrefs(client, prefs);
|
|
56317
|
-
}
|
|
56318
|
-
}
|
|
56319
|
-
}
|
|
56320
|
-
} catch (err) {
|
|
56321
|
-
output_manager_default.debug(`Auto-install agent tooling failed: ${err}`);
|
|
56322
|
-
}
|
|
56323
|
-
}
|
|
56324
|
-
async function showPluginTipIfNeeded(client) {
|
|
56325
|
-
try {
|
|
56326
|
-
const prefs = await readPrefs(client);
|
|
56327
|
-
if (prefs.pluginDeclined)
|
|
56328
|
-
return;
|
|
56329
|
-
const targets = await getPluginTargets(client.agentName, client.cwd);
|
|
56330
|
-
for (const target of targets) {
|
|
56331
|
-
if (!await isPluginInstalledForTarget(target)) {
|
|
56332
|
-
output_manager_default.log(
|
|
56333
|
-
import_chalk11.default.dim(
|
|
56334
|
-
"Tip: Run `npx plugins add vercel/vercel-plugin` to enhance your agent experience"
|
|
56335
|
-
)
|
|
56336
|
-
);
|
|
56337
|
-
return;
|
|
56338
|
-
}
|
|
56339
|
-
}
|
|
56340
|
-
} catch {
|
|
56341
|
-
}
|
|
56342
|
-
}
|
|
56343
55968
|
|
|
56344
55969
|
// src/util/login/update-current-team-after-login.ts
|
|
56345
55970
|
async function updateCurrentTeamAfterLogin(client, ssoTeamId) {
|
|
@@ -56618,17 +56243,17 @@ async function performDeviceCodeFlow(client, options) {
|
|
|
56618
56243
|
url.searchParams.set("team_id", options.teamId);
|
|
56619
56244
|
verification_uri_complete = url.toString();
|
|
56620
56245
|
}
|
|
56621
|
-
const isCursorAgent = client.agentName ===
|
|
56246
|
+
const isCursorAgent = client.agentName === KNOWN_AGENTS.CURSOR || client.agentName === KNOWN_AGENTS.CURSOR_CLI;
|
|
56622
56247
|
const shouldSkipBrowser = process.env.CI && !isCursorAgent;
|
|
56623
56248
|
output_manager_default.log(
|
|
56624
56249
|
`
|
|
56625
|
-
Visit ${
|
|
56250
|
+
Visit ${import_chalk11.default.bold(
|
|
56626
56251
|
output_manager_default.link(
|
|
56627
56252
|
verification_uri.replace("https://", ""),
|
|
56628
56253
|
verification_uri_complete,
|
|
56629
56254
|
{ color: false, fallback: () => verification_uri_complete }
|
|
56630
56255
|
)
|
|
56631
|
-
)}${output_manager_default.supportsHyperlink ? ` and enter ${
|
|
56256
|
+
)}${output_manager_default.supportsHyperlink ? ` and enter ${import_chalk11.default.bold(user_code)}` : ""}
|
|
56632
56257
|
`
|
|
56633
56258
|
);
|
|
56634
56259
|
if (!shouldSkipBrowser) {
|
|
@@ -56642,7 +56267,7 @@ async function performDeviceCodeFlow(client, options) {
|
|
|
56642
56267
|
if (client.isAgent && client.nonInteractive) {
|
|
56643
56268
|
output_manager_default.log(
|
|
56644
56269
|
`
|
|
56645
|
-
${
|
|
56270
|
+
${import_chalk11.default.yellow("\u26A0")} ${import_chalk11.default.bold("Browser could not be opened automatically.")}
|
|
56646
56271
|
`
|
|
56647
56272
|
);
|
|
56648
56273
|
output_manager_default.log(
|
|
@@ -56740,19 +56365,18 @@ async function login(client, telemetry) {
|
|
|
56740
56365
|
client.writeToConfigFile();
|
|
56741
56366
|
output_manager_default.debug(`Saved credentials in "${humanizePath(client.getGlobalPathConfig())}"`);
|
|
56742
56367
|
output_manager_default.print(`
|
|
56743
|
-
${
|
|
56368
|
+
${import_chalk11.default.cyan("Congratulations!")} You are now signed in.
|
|
56744
56369
|
|
|
56745
56370
|
To deploy something, run ${getCommandName()}.
|
|
56746
56371
|
|
|
56747
56372
|
${emoji("tip")} To deploy every commit automatically,
|
|
56748
|
-
connect a Git Repository (${
|
|
56373
|
+
connect a Git Repository (${import_chalk11.default.bold(output_manager_default.link("vercel.link/git", "https://vercel.link/git", { color: false }))}).
|
|
56749
56374
|
`);
|
|
56750
56375
|
telemetry.trackState("success");
|
|
56751
|
-
await autoInstallVercelPlugin(client);
|
|
56752
56376
|
return 0;
|
|
56753
56377
|
}
|
|
56754
56378
|
async function wait(intervalMs) {
|
|
56755
|
-
await new Promise((
|
|
56379
|
+
await new Promise((resolve4) => setTimeout(resolve4, intervalMs));
|
|
56756
56380
|
}
|
|
56757
56381
|
|
|
56758
56382
|
// src/commands/env/pull.ts
|
|
@@ -56873,11 +56497,11 @@ async function pull(client, argv, source = "vercel-cli:env:pull") {
|
|
|
56873
56497
|
return 0;
|
|
56874
56498
|
}
|
|
56875
56499
|
async function envPullCommandLogic(client, filename, skipConfirmation, environment, link, gitBranch, cwd, source, deploymentId) {
|
|
56876
|
-
const fullPath =
|
|
56500
|
+
const fullPath = resolve3(cwd, filename);
|
|
56877
56501
|
const head = tryReadHeadSync(fullPath, Buffer.byteLength(CONTENTS_PREFIX));
|
|
56878
56502
|
const exists = typeof head !== "undefined";
|
|
56879
56503
|
if (head === CONTENTS_PREFIX) {
|
|
56880
|
-
output_manager_default.log(`Overwriting existing ${
|
|
56504
|
+
output_manager_default.log(`Overwriting existing ${import_chalk12.default.bold(filename)} file`);
|
|
56881
56505
|
} else if (exists && !skipConfirmation) {
|
|
56882
56506
|
if (client.nonInteractive) {
|
|
56883
56507
|
outputActionRequired(client, {
|
|
@@ -56905,11 +56529,11 @@ async function envPullCommandLogic(client, filename, skipConfirmation, environme
|
|
|
56905
56529
|
}
|
|
56906
56530
|
}
|
|
56907
56531
|
const projectSlugLink = formatProject(link.org.slug, link.project.name);
|
|
56908
|
-
const downloadMessage = gitBranch ? `Downloading \`${
|
|
56532
|
+
const downloadMessage = gitBranch ? `Downloading \`${import_chalk12.default.cyan(
|
|
56909
56533
|
environment
|
|
56910
|
-
)}\` environment variables for ${projectSlugLink} and any overrides for branch ${
|
|
56534
|
+
)}\` environment variables for ${projectSlugLink} and any overrides for branch ${import_chalk12.default.cyan(
|
|
56911
56535
|
gitBranch
|
|
56912
|
-
)}` : `Downloading \`${
|
|
56536
|
+
)}` : `Downloading \`${import_chalk12.default.cyan(
|
|
56913
56537
|
environment
|
|
56914
56538
|
)}\` environment variables for ${projectSlugLink}`;
|
|
56915
56539
|
output_manager_default.log(downloadMessage);
|
|
@@ -57001,15 +56625,15 @@ function escapeValue(value) {
|
|
|
57001
56625
|
}
|
|
57002
56626
|
|
|
57003
56627
|
// src/util/projects/find-project-root.ts
|
|
57004
|
-
var
|
|
56628
|
+
var import_chalk13 = __toESM(require_source(), 1);
|
|
57005
56629
|
var import_fs_extra7 = __toESM(require_lib3(), 1);
|
|
57006
56630
|
import { stat } from "fs/promises";
|
|
57007
|
-
import { join as
|
|
56631
|
+
import { join as join8, dirname } from "path";
|
|
57008
56632
|
|
|
57009
56633
|
// src/util/projects/detect-services.ts
|
|
57010
56634
|
var import_fs_detectors2 = __toESM(require_dist6(), 1);
|
|
57011
|
-
import { readFile as
|
|
57012
|
-
import { basename as basename2, join as
|
|
56635
|
+
import { readFile as readFile3, writeFile as writeFile2 } from "fs/promises";
|
|
56636
|
+
import { basename as basename2, join as join7 } from "path";
|
|
57013
56637
|
import { parse as tomlParse, stringify as tomlStringify } from "smol-toml";
|
|
57014
56638
|
|
|
57015
56639
|
// src/util/is-vercel-toml-enabled.ts
|
|
@@ -57698,7 +57322,7 @@ function validateConfig(config) {
|
|
|
57698
57322
|
}
|
|
57699
57323
|
|
|
57700
57324
|
// src/util/projects/detect-entrypoint.ts
|
|
57701
|
-
import { join as
|
|
57325
|
+
import { join as join6 } from "path";
|
|
57702
57326
|
import {
|
|
57703
57327
|
isPythonFramework,
|
|
57704
57328
|
isNodeBackendFramework,
|
|
@@ -57706,7 +57330,7 @@ import {
|
|
|
57706
57330
|
} from "@vercel/build-utils";
|
|
57707
57331
|
function createDetectEntrypoint(projectRoot) {
|
|
57708
57332
|
return async ({ workPath, framework }) => {
|
|
57709
|
-
const absWorkPath = normalizePath2(
|
|
57333
|
+
const absWorkPath = normalizePath2(join6(projectRoot, workPath));
|
|
57710
57334
|
if (isPythonFramework(framework)) {
|
|
57711
57335
|
const { detectEntrypoint } = await import("@vercel/python");
|
|
57712
57336
|
return detectEntrypoint({
|
|
@@ -57769,7 +57393,7 @@ async function tryDetectServices(cwd) {
|
|
|
57769
57393
|
}
|
|
57770
57394
|
async function writeServicesConfig(cwd, config) {
|
|
57771
57395
|
const prepared = await prepareServicesConfigWrite(cwd, config);
|
|
57772
|
-
await
|
|
57396
|
+
await writeFile2(prepared.configPath, prepared.content, "utf8");
|
|
57773
57397
|
return { configFileName: basename2(prepared.configPath) };
|
|
57774
57398
|
}
|
|
57775
57399
|
async function getServicesConfigWriteBlocker(cwd, config) {
|
|
@@ -57787,9 +57411,9 @@ function toProjectServicesConfigPatch(config) {
|
|
|
57787
57411
|
}
|
|
57788
57412
|
async function prepareServicesConfigWrite(cwd, config) {
|
|
57789
57413
|
const compileResult = await compileVercelConfig(cwd);
|
|
57790
|
-
const configPath =
|
|
57414
|
+
const configPath = join7(cwd, "vercel.json");
|
|
57791
57415
|
if (isVercelTomlEnabled() && compileResult.sourceFile === "vercel.toml") {
|
|
57792
|
-
return prepareTomlServicesConfigWrite(
|
|
57416
|
+
return prepareTomlServicesConfigWrite(join7(cwd, "vercel.toml"), config);
|
|
57793
57417
|
}
|
|
57794
57418
|
if (compileResult.wasCompiled) {
|
|
57795
57419
|
throw new Error(
|
|
@@ -57822,7 +57446,7 @@ async function prepareTomlServicesConfigWrite(configPath, config) {
|
|
|
57822
57446
|
const patchKeys = Object.keys(patch);
|
|
57823
57447
|
let existingContent;
|
|
57824
57448
|
try {
|
|
57825
|
-
existingContent = await
|
|
57449
|
+
existingContent = await readFile3(configPath, "utf8");
|
|
57826
57450
|
} catch {
|
|
57827
57451
|
existingContent = "";
|
|
57828
57452
|
}
|
|
@@ -57860,8 +57484,8 @@ async function findProjectRoot(startDir) {
|
|
|
57860
57484
|
} catch {
|
|
57861
57485
|
return null;
|
|
57862
57486
|
}
|
|
57863
|
-
let dir =
|
|
57864
|
-
while (
|
|
57487
|
+
let dir = dirname(startDir);
|
|
57488
|
+
while (dirname(dir) !== dir) {
|
|
57865
57489
|
try {
|
|
57866
57490
|
if ((await stat(dir)).dev !== cwdDev) {
|
|
57867
57491
|
return null;
|
|
@@ -57869,14 +57493,14 @@ async function findProjectRoot(startDir) {
|
|
|
57869
57493
|
} catch {
|
|
57870
57494
|
return null;
|
|
57871
57495
|
}
|
|
57872
|
-
const hasVercelDir = await (0, import_fs_extra7.pathExists)(
|
|
57873
|
-
const hasVercelJson = await (0, import_fs_extra7.pathExists)(
|
|
57874
|
-
const hasVercelToml = isVercelTomlEnabled() && await (0, import_fs_extra7.pathExists)(
|
|
57875
|
-
const hasGit = await (0, import_fs_extra7.pathExists)(
|
|
57496
|
+
const hasVercelDir = await (0, import_fs_extra7.pathExists)(join8(dir, ".vercel"));
|
|
57497
|
+
const hasVercelJson = await (0, import_fs_extra7.pathExists)(join8(dir, "vercel.json"));
|
|
57498
|
+
const hasVercelToml = isVercelTomlEnabled() && await (0, import_fs_extra7.pathExists)(join8(dir, "vercel.toml"));
|
|
57499
|
+
const hasGit = await (0, import_fs_extra7.pathExists)(join8(dir, ".git"));
|
|
57876
57500
|
if (hasVercelDir || hasVercelJson || hasVercelToml || hasGit) {
|
|
57877
57501
|
return dir;
|
|
57878
57502
|
}
|
|
57879
|
-
dir =
|
|
57503
|
+
dir = dirname(dir);
|
|
57880
57504
|
}
|
|
57881
57505
|
return null;
|
|
57882
57506
|
}
|
|
@@ -57890,15 +57514,15 @@ async function resolveProjectCwd(cwd) {
|
|
|
57890
57514
|
}
|
|
57891
57515
|
const result = await tryDetectServices(projectRoot);
|
|
57892
57516
|
if (result && (result.services?.length ?? 0) > 0) {
|
|
57893
|
-
output_manager_default.debug(`Running from project root: ${
|
|
57517
|
+
output_manager_default.debug(`Running from project root: ${import_chalk13.default.cyan(projectRoot)}`);
|
|
57894
57518
|
return projectRoot;
|
|
57895
57519
|
}
|
|
57896
57520
|
return cwd;
|
|
57897
57521
|
}
|
|
57898
57522
|
|
|
57899
57523
|
// src/util/projects/link.ts
|
|
57900
|
-
var
|
|
57901
|
-
var
|
|
57524
|
+
var readFile4 = promisify(fs4.readFile);
|
|
57525
|
+
var writeFile3 = promisify(fs4.writeFile);
|
|
57902
57526
|
var VERCEL_DIR = ".vercel";
|
|
57903
57527
|
var VERCEL_DIR_FALLBACK = ".now";
|
|
57904
57528
|
var VERCEL_DIR_README = "README.txt";
|
|
@@ -57923,7 +57547,7 @@ var linkSchema = {
|
|
|
57923
57547
|
}
|
|
57924
57548
|
};
|
|
57925
57549
|
function getVercelDirectory(cwd) {
|
|
57926
|
-
const possibleDirs = [
|
|
57550
|
+
const possibleDirs = [join9(cwd, VERCEL_DIR), join9(cwd, VERCEL_DIR_FALLBACK)];
|
|
57927
57551
|
const existingDirs = possibleDirs.filter((d) => isDirectory(d));
|
|
57928
57552
|
if (existingDirs.length > 1) {
|
|
57929
57553
|
throw new NowBuildError2({
|
|
@@ -58015,7 +57639,7 @@ async function getProjectLinkFromRepoLink(client, path, projectName, projectName
|
|
|
58015
57639
|
}
|
|
58016
57640
|
async function getLinkFromDir(dir) {
|
|
58017
57641
|
try {
|
|
58018
|
-
const json = await
|
|
57642
|
+
const json = await readFile4(join9(dir, VERCEL_DIR_PROJECT), "utf8");
|
|
58019
57643
|
const ajv2 = new import_ajv2.default();
|
|
58020
57644
|
const link = JSON.parse(json);
|
|
58021
57645
|
if (!ajv2.validate(linkSchema, link)) {
|
|
@@ -58175,8 +57799,8 @@ No, you should not share the ".vercel" folder with anyone.
|
|
|
58175
57799
|
Upon creation, it will be automatically added to your ".gitignore" file.
|
|
58176
57800
|
`;
|
|
58177
57801
|
async function writeReadme(path) {
|
|
58178
|
-
await
|
|
58179
|
-
|
|
57802
|
+
await writeFile3(
|
|
57803
|
+
join9(path, VERCEL_DIR, VERCEL_DIR_README),
|
|
58180
57804
|
VERCEL_DIR_README_CONTENT
|
|
58181
57805
|
);
|
|
58182
57806
|
}
|
|
@@ -58185,15 +57809,15 @@ async function linkFolderToProject(client, path, projectLink, projectName, orgSl
|
|
|
58185
57809
|
return;
|
|
58186
57810
|
}
|
|
58187
57811
|
try {
|
|
58188
|
-
await (0, import_fs_extra8.ensureDir)(
|
|
57812
|
+
await (0, import_fs_extra8.ensureDir)(join9(path, VERCEL_DIR));
|
|
58189
57813
|
} catch (err) {
|
|
58190
57814
|
if ((0, import_error_utils4.isErrnoException)(err) && err.code === "ENOTDIR") {
|
|
58191
57815
|
return;
|
|
58192
57816
|
}
|
|
58193
57817
|
throw err;
|
|
58194
57818
|
}
|
|
58195
|
-
await
|
|
58196
|
-
|
|
57819
|
+
await writeFile3(
|
|
57820
|
+
join9(path, VERCEL_DIR, VERCEL_DIR_PROJECT),
|
|
58197
57821
|
JSON.stringify({
|
|
58198
57822
|
...projectLink,
|
|
58199
57823
|
projectName
|
|
@@ -58307,9 +57931,9 @@ var VERCEL_CONFIG_EXTENSIONS = [
|
|
|
58307
57931
|
"cjs"
|
|
58308
57932
|
];
|
|
58309
57933
|
var DEFAULT_VERCEL_CONFIG_FILENAME = "Vercel config";
|
|
58310
|
-
async function
|
|
57934
|
+
async function fileExists(filePath) {
|
|
58311
57935
|
try {
|
|
58312
|
-
await
|
|
57936
|
+
await access(filePath);
|
|
58313
57937
|
return true;
|
|
58314
57938
|
} catch {
|
|
58315
57939
|
return false;
|
|
@@ -58318,8 +57942,8 @@ async function fileExists2(filePath) {
|
|
|
58318
57942
|
async function findAllVercelConfigFiles(workPath) {
|
|
58319
57943
|
const foundFiles = [];
|
|
58320
57944
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
58321
|
-
const configPath =
|
|
58322
|
-
if (await
|
|
57945
|
+
const configPath = join10(workPath, `vercel.${ext}`);
|
|
57946
|
+
if (await fileExists(configPath)) {
|
|
58323
57947
|
foundFiles.push(configPath);
|
|
58324
57948
|
}
|
|
58325
57949
|
}
|
|
@@ -58327,14 +57951,14 @@ async function findAllVercelConfigFiles(workPath) {
|
|
|
58327
57951
|
}
|
|
58328
57952
|
async function findSourceVercelConfigFile(workPath) {
|
|
58329
57953
|
for (const ext of VERCEL_CONFIG_EXTENSIONS) {
|
|
58330
|
-
const configPath =
|
|
58331
|
-
if (await
|
|
57954
|
+
const configPath = join10(workPath, `vercel.${ext}`);
|
|
57955
|
+
if (await fileExists(configPath)) {
|
|
58332
57956
|
return basename3(configPath);
|
|
58333
57957
|
}
|
|
58334
57958
|
}
|
|
58335
57959
|
if (isVercelTomlEnabled()) {
|
|
58336
|
-
const tomlPath =
|
|
58337
|
-
if (await
|
|
57960
|
+
const tomlPath = join10(workPath, "vercel.toml");
|
|
57961
|
+
if (await fileExists(tomlPath)) {
|
|
58338
57962
|
return "vercel.toml";
|
|
58339
57963
|
}
|
|
58340
57964
|
}
|
|
@@ -58375,15 +57999,15 @@ function parseConfigLoaderError(stderr) {
|
|
|
58375
57999
|
return stderr.trim();
|
|
58376
58000
|
}
|
|
58377
58001
|
async function compileVercelConfig(workPath) {
|
|
58378
|
-
const vercelJsonPath =
|
|
58379
|
-
const nowJsonPath =
|
|
58380
|
-
const vercelTomlPath =
|
|
58381
|
-
const hasVercelJson = await
|
|
58382
|
-
const hasNowJson = await
|
|
58383
|
-
const hasVercelToml = isVercelTomlEnabled() && await
|
|
58002
|
+
const vercelJsonPath = join10(workPath, "vercel.json");
|
|
58003
|
+
const nowJsonPath = join10(workPath, "now.json");
|
|
58004
|
+
const vercelTomlPath = join10(workPath, "vercel.toml");
|
|
58005
|
+
const hasVercelJson = await fileExists(vercelJsonPath);
|
|
58006
|
+
const hasNowJson = await fileExists(nowJsonPath);
|
|
58007
|
+
const hasVercelToml = isVercelTomlEnabled() && await fileExists(vercelTomlPath);
|
|
58384
58008
|
const vercelConfigPath = await findVercelConfigFile(workPath);
|
|
58385
|
-
const vercelDir =
|
|
58386
|
-
const compiledConfigPath =
|
|
58009
|
+
const vercelDir = join10(workPath, VERCEL_DIR);
|
|
58010
|
+
const compiledConfigPath = join10(vercelDir, "vercel.json");
|
|
58387
58011
|
if (hasNowJson) {
|
|
58388
58012
|
throw new DeprecatedNowJson(nowJsonPath);
|
|
58389
58013
|
}
|
|
@@ -58408,7 +58032,7 @@ async function compileVercelConfig(workPath) {
|
|
|
58408
58032
|
wasCompiled: false
|
|
58409
58033
|
};
|
|
58410
58034
|
}
|
|
58411
|
-
if (await
|
|
58035
|
+
if (await fileExists(compiledConfigPath)) {
|
|
58412
58036
|
return {
|
|
58413
58037
|
configPath: compiledConfigPath,
|
|
58414
58038
|
wasCompiled: true,
|
|
@@ -58422,11 +58046,11 @@ async function compileVercelConfig(workPath) {
|
|
|
58422
58046
|
}
|
|
58423
58047
|
if (hasVercelToml) {
|
|
58424
58048
|
try {
|
|
58425
|
-
const tomlContent = await
|
|
58049
|
+
const tomlContent = await readFile5(vercelTomlPath, "utf8");
|
|
58426
58050
|
const config = tomlParse2(tomlContent);
|
|
58427
58051
|
const normalizedConfig = normalizeConfig(config);
|
|
58428
58052
|
await mkdir(vercelDir, { recursive: true });
|
|
58429
|
-
await
|
|
58053
|
+
await writeFile4(
|
|
58430
58054
|
compiledConfigPath,
|
|
58431
58055
|
JSON.stringify(normalizedConfig, null, 2),
|
|
58432
58056
|
"utf-8"
|
|
@@ -58446,10 +58070,10 @@ async function compileVercelConfig(workPath) {
|
|
|
58446
58070
|
}
|
|
58447
58071
|
}
|
|
58448
58072
|
const sourceConfigPath = vercelConfigPath;
|
|
58449
|
-
(0, import_dotenv.config)({ path:
|
|
58450
|
-
(0, import_dotenv.config)({ path:
|
|
58451
|
-
const tempOutPath =
|
|
58452
|
-
const loaderPath =
|
|
58073
|
+
(0, import_dotenv.config)({ path: join10(workPath, ".env") });
|
|
58074
|
+
(0, import_dotenv.config)({ path: join10(workPath, ".env.local") });
|
|
58075
|
+
const tempOutPath = join10(vercelDir, "vercel-temp.mjs");
|
|
58076
|
+
const loaderPath = join10(vercelDir, "vercel-loader.mjs");
|
|
58453
58077
|
try {
|
|
58454
58078
|
const { build } = await import("esbuild");
|
|
58455
58079
|
await mkdir(vercelDir, { recursive: true });
|
|
@@ -58469,8 +58093,8 @@ async function compileVercelConfig(workPath) {
|
|
|
58469
58093
|
const config = ('default' in configModule) ? configModule.default : ('config' in configModule) ? configModule.config : configModule;
|
|
58470
58094
|
process.send(config);
|
|
58471
58095
|
`;
|
|
58472
|
-
await
|
|
58473
|
-
const config = await new Promise((
|
|
58096
|
+
await writeFile4(loaderPath, loaderScript, "utf-8");
|
|
58097
|
+
const config = await new Promise((resolve4, reject) => {
|
|
58474
58098
|
const child = fork(loaderPath, [tempOutPath], {
|
|
58475
58099
|
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
58476
58100
|
});
|
|
@@ -58493,7 +58117,7 @@ async function compileVercelConfig(workPath) {
|
|
|
58493
58117
|
child.on("message", (message) => {
|
|
58494
58118
|
clearTimeout(timeout);
|
|
58495
58119
|
child.kill();
|
|
58496
|
-
|
|
58120
|
+
resolve4(message);
|
|
58497
58121
|
});
|
|
58498
58122
|
child.on("error", (err) => {
|
|
58499
58123
|
clearTimeout(timeout);
|
|
@@ -58520,7 +58144,7 @@ async function compileVercelConfig(workPath) {
|
|
|
58520
58144
|
});
|
|
58521
58145
|
});
|
|
58522
58146
|
const normalizedConfig = normalizeConfig(config);
|
|
58523
|
-
await
|
|
58147
|
+
await writeFile4(
|
|
58524
58148
|
compiledConfigPath,
|
|
58525
58149
|
JSON.stringify(normalizedConfig, null, 2),
|
|
58526
58150
|
"utf-8"
|
|
@@ -58553,16 +58177,16 @@ async function compileVercelConfig(workPath) {
|
|
|
58553
58177
|
}
|
|
58554
58178
|
}
|
|
58555
58179
|
async function getVercelConfigPath(workPath) {
|
|
58556
|
-
const vercelJsonPath =
|
|
58557
|
-
const vercelTomlPath =
|
|
58558
|
-
const compiledConfigPath =
|
|
58559
|
-
if (await
|
|
58180
|
+
const vercelJsonPath = join10(workPath, "vercel.json");
|
|
58181
|
+
const vercelTomlPath = join10(workPath, "vercel.toml");
|
|
58182
|
+
const compiledConfigPath = join10(workPath, VERCEL_DIR, "vercel.json");
|
|
58183
|
+
if (await fileExists(vercelJsonPath)) {
|
|
58560
58184
|
return vercelJsonPath;
|
|
58561
58185
|
}
|
|
58562
|
-
if (isVercelTomlEnabled() && await
|
|
58186
|
+
if (isVercelTomlEnabled() && await fileExists(vercelTomlPath)) {
|
|
58563
58187
|
return vercelTomlPath;
|
|
58564
58188
|
}
|
|
58565
|
-
if (await
|
|
58189
|
+
if (await fileExists(compiledConfigPath)) {
|
|
58566
58190
|
return compiledConfigPath;
|
|
58567
58191
|
}
|
|
58568
58192
|
return vercelJsonPath;
|
|
@@ -58602,8 +58226,6 @@ export {
|
|
|
58602
58226
|
esm_default3,
|
|
58603
58227
|
ua_default,
|
|
58604
58228
|
require_open,
|
|
58605
|
-
autoInstallVercelPlugin,
|
|
58606
|
-
showPluginTipIfNeeded,
|
|
58607
58229
|
processTokenResponse,
|
|
58608
58230
|
revocationRequest,
|
|
58609
58231
|
processRevocationResponse,
|