ai-hero-cli 0.2.9 → 0.2.11
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/bin.cjs +1214 -588
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -3886,8 +3886,8 @@ var require_compiler = __commonJS({
|
|
|
3886
3886
|
valueAssignments.push(fullPath);
|
|
3887
3887
|
}
|
|
3888
3888
|
}
|
|
3889
|
-
function pathAssigned(
|
|
3890
|
-
return assignedPaths.indexOf(
|
|
3889
|
+
function pathAssigned(path15) {
|
|
3890
|
+
return assignedPaths.indexOf(path15) !== -1;
|
|
3891
3891
|
}
|
|
3892
3892
|
function reduceValueNode(node) {
|
|
3893
3893
|
if (node.type === "Array") {
|
|
@@ -3911,20 +3911,20 @@ var require_compiler = __commonJS({
|
|
|
3911
3911
|
return obj;
|
|
3912
3912
|
}
|
|
3913
3913
|
function setPath(node) {
|
|
3914
|
-
var
|
|
3915
|
-
var quotedPath =
|
|
3914
|
+
var path15 = node.value;
|
|
3915
|
+
var quotedPath = path15.map(quoteDottedString).join(".");
|
|
3916
3916
|
var line4 = node.line;
|
|
3917
3917
|
var column3 = node.column;
|
|
3918
3918
|
if (pathAssigned(quotedPath)) {
|
|
3919
|
-
genError("Cannot redefine existing key '" +
|
|
3919
|
+
genError("Cannot redefine existing key '" + path15 + "'.", line4, column3);
|
|
3920
3920
|
}
|
|
3921
3921
|
assignedPaths.push(quotedPath);
|
|
3922
|
-
context8 = deepRef(data,
|
|
3923
|
-
currentPath =
|
|
3922
|
+
context8 = deepRef(data, path15, /* @__PURE__ */ Object.create(null), line4, column3);
|
|
3923
|
+
currentPath = path15;
|
|
3924
3924
|
}
|
|
3925
3925
|
function addTableArray(node) {
|
|
3926
|
-
var
|
|
3927
|
-
var quotedPath =
|
|
3926
|
+
var path15 = node.value;
|
|
3927
|
+
var quotedPath = path15.map(quoteDottedString).join(".");
|
|
3928
3928
|
var line4 = node.line;
|
|
3929
3929
|
var column3 = node.column;
|
|
3930
3930
|
if (!pathAssigned(quotedPath)) {
|
|
@@ -3934,14 +3934,14 @@ var require_compiler = __commonJS({
|
|
|
3934
3934
|
return p3.indexOf(quotedPath) !== 0;
|
|
3935
3935
|
});
|
|
3936
3936
|
assignedPaths.push(quotedPath);
|
|
3937
|
-
context8 = deepRef(data,
|
|
3937
|
+
context8 = deepRef(data, path15, [], line4, column3);
|
|
3938
3938
|
currentPath = quotedPath;
|
|
3939
3939
|
if (context8 instanceof Array) {
|
|
3940
3940
|
var newObj = /* @__PURE__ */ Object.create(null);
|
|
3941
3941
|
context8.push(newObj);
|
|
3942
3942
|
context8 = newObj;
|
|
3943
3943
|
} else {
|
|
3944
|
-
genError("Cannot redefine existing key '" +
|
|
3944
|
+
genError("Cannot redefine existing key '" + path15 + "'.", line4, column3);
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
3947
|
function deepRef(start5, keys6, value5, line4, column3) {
|
|
@@ -4086,17 +4086,17 @@ var require_visit = __commonJS({
|
|
|
4086
4086
|
visit.BREAK = BREAK;
|
|
4087
4087
|
visit.SKIP = SKIP;
|
|
4088
4088
|
visit.REMOVE = REMOVE;
|
|
4089
|
-
function visit_(key, node, visitor,
|
|
4090
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
4089
|
+
function visit_(key, node, visitor, path15) {
|
|
4090
|
+
const ctrl = callVisitor(key, node, visitor, path15);
|
|
4091
4091
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4092
|
-
replaceNode(key,
|
|
4093
|
-
return visit_(key, ctrl, visitor,
|
|
4092
|
+
replaceNode(key, path15, ctrl);
|
|
4093
|
+
return visit_(key, ctrl, visitor, path15);
|
|
4094
4094
|
}
|
|
4095
4095
|
if (typeof ctrl !== "symbol") {
|
|
4096
4096
|
if (identity3.isCollection(node)) {
|
|
4097
|
-
|
|
4097
|
+
path15 = Object.freeze(path15.concat(node));
|
|
4098
4098
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4099
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
4099
|
+
const ci = visit_(i, node.items[i], visitor, path15);
|
|
4100
4100
|
if (typeof ci === "number")
|
|
4101
4101
|
i = ci - 1;
|
|
4102
4102
|
else if (ci === BREAK)
|
|
@@ -4107,13 +4107,13 @@ var require_visit = __commonJS({
|
|
|
4107
4107
|
}
|
|
4108
4108
|
}
|
|
4109
4109
|
} else if (identity3.isPair(node)) {
|
|
4110
|
-
|
|
4111
|
-
const ck = visit_("key", node.key, visitor,
|
|
4110
|
+
path15 = Object.freeze(path15.concat(node));
|
|
4111
|
+
const ck = visit_("key", node.key, visitor, path15);
|
|
4112
4112
|
if (ck === BREAK)
|
|
4113
4113
|
return BREAK;
|
|
4114
4114
|
else if (ck === REMOVE)
|
|
4115
4115
|
node.key = null;
|
|
4116
|
-
const cv = visit_("value", node.value, visitor,
|
|
4116
|
+
const cv = visit_("value", node.value, visitor, path15);
|
|
4117
4117
|
if (cv === BREAK)
|
|
4118
4118
|
return BREAK;
|
|
4119
4119
|
else if (cv === REMOVE)
|
|
@@ -4134,17 +4134,17 @@ var require_visit = __commonJS({
|
|
|
4134
4134
|
visitAsync.BREAK = BREAK;
|
|
4135
4135
|
visitAsync.SKIP = SKIP;
|
|
4136
4136
|
visitAsync.REMOVE = REMOVE;
|
|
4137
|
-
async function visitAsync_(key, node, visitor,
|
|
4138
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
4137
|
+
async function visitAsync_(key, node, visitor, path15) {
|
|
4138
|
+
const ctrl = await callVisitor(key, node, visitor, path15);
|
|
4139
4139
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4140
|
-
replaceNode(key,
|
|
4141
|
-
return visitAsync_(key, ctrl, visitor,
|
|
4140
|
+
replaceNode(key, path15, ctrl);
|
|
4141
|
+
return visitAsync_(key, ctrl, visitor, path15);
|
|
4142
4142
|
}
|
|
4143
4143
|
if (typeof ctrl !== "symbol") {
|
|
4144
4144
|
if (identity3.isCollection(node)) {
|
|
4145
|
-
|
|
4145
|
+
path15 = Object.freeze(path15.concat(node));
|
|
4146
4146
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4147
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
4147
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path15);
|
|
4148
4148
|
if (typeof ci === "number")
|
|
4149
4149
|
i = ci - 1;
|
|
4150
4150
|
else if (ci === BREAK)
|
|
@@ -4155,13 +4155,13 @@ var require_visit = __commonJS({
|
|
|
4155
4155
|
}
|
|
4156
4156
|
}
|
|
4157
4157
|
} else if (identity3.isPair(node)) {
|
|
4158
|
-
|
|
4159
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
4158
|
+
path15 = Object.freeze(path15.concat(node));
|
|
4159
|
+
const ck = await visitAsync_("key", node.key, visitor, path15);
|
|
4160
4160
|
if (ck === BREAK)
|
|
4161
4161
|
return BREAK;
|
|
4162
4162
|
else if (ck === REMOVE)
|
|
4163
4163
|
node.key = null;
|
|
4164
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
4164
|
+
const cv = await visitAsync_("value", node.value, visitor, path15);
|
|
4165
4165
|
if (cv === BREAK)
|
|
4166
4166
|
return BREAK;
|
|
4167
4167
|
else if (cv === REMOVE)
|
|
@@ -4188,23 +4188,23 @@ var require_visit = __commonJS({
|
|
|
4188
4188
|
}
|
|
4189
4189
|
return visitor;
|
|
4190
4190
|
}
|
|
4191
|
-
function callVisitor(key, node, visitor,
|
|
4191
|
+
function callVisitor(key, node, visitor, path15) {
|
|
4192
4192
|
if (typeof visitor === "function")
|
|
4193
|
-
return visitor(key, node,
|
|
4193
|
+
return visitor(key, node, path15);
|
|
4194
4194
|
if (identity3.isMap(node))
|
|
4195
|
-
return visitor.Map?.(key, node,
|
|
4195
|
+
return visitor.Map?.(key, node, path15);
|
|
4196
4196
|
if (identity3.isSeq(node))
|
|
4197
|
-
return visitor.Seq?.(key, node,
|
|
4197
|
+
return visitor.Seq?.(key, node, path15);
|
|
4198
4198
|
if (identity3.isPair(node))
|
|
4199
|
-
return visitor.Pair?.(key, node,
|
|
4199
|
+
return visitor.Pair?.(key, node, path15);
|
|
4200
4200
|
if (identity3.isScalar(node))
|
|
4201
|
-
return visitor.Scalar?.(key, node,
|
|
4201
|
+
return visitor.Scalar?.(key, node, path15);
|
|
4202
4202
|
if (identity3.isAlias(node))
|
|
4203
|
-
return visitor.Alias?.(key, node,
|
|
4203
|
+
return visitor.Alias?.(key, node, path15);
|
|
4204
4204
|
return void 0;
|
|
4205
4205
|
}
|
|
4206
|
-
function replaceNode(key,
|
|
4207
|
-
const parent =
|
|
4206
|
+
function replaceNode(key, path15, node) {
|
|
4207
|
+
const parent = path15[path15.length - 1];
|
|
4208
4208
|
if (identity3.isCollection(parent)) {
|
|
4209
4209
|
parent.items[key] = node;
|
|
4210
4210
|
} else if (identity3.isPair(parent)) {
|
|
@@ -4803,10 +4803,10 @@ var require_Collection = __commonJS({
|
|
|
4803
4803
|
var createNode = require_createNode();
|
|
4804
4804
|
var identity3 = require_identity();
|
|
4805
4805
|
var Node = require_Node();
|
|
4806
|
-
function collectionFromPath(schema,
|
|
4806
|
+
function collectionFromPath(schema, path15, value5) {
|
|
4807
4807
|
let v = value5;
|
|
4808
|
-
for (let i =
|
|
4809
|
-
const k =
|
|
4808
|
+
for (let i = path15.length - 1; i >= 0; --i) {
|
|
4809
|
+
const k = path15[i];
|
|
4810
4810
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4811
4811
|
const a = [];
|
|
4812
4812
|
a[k] = v;
|
|
@@ -4825,7 +4825,7 @@ var require_Collection = __commonJS({
|
|
|
4825
4825
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4826
4826
|
});
|
|
4827
4827
|
}
|
|
4828
|
-
var isEmptyPath = (
|
|
4828
|
+
var isEmptyPath = (path15) => path15 == null || typeof path15 === "object" && !!path15[Symbol.iterator]().next().done;
|
|
4829
4829
|
var Collection = class extends Node.NodeBase {
|
|
4830
4830
|
constructor(type2, schema) {
|
|
4831
4831
|
super(type2);
|
|
@@ -4855,11 +4855,11 @@ var require_Collection = __commonJS({
|
|
|
4855
4855
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4856
4856
|
* that already exists in the map.
|
|
4857
4857
|
*/
|
|
4858
|
-
addIn(
|
|
4859
|
-
if (isEmptyPath(
|
|
4858
|
+
addIn(path15, value5) {
|
|
4859
|
+
if (isEmptyPath(path15))
|
|
4860
4860
|
this.add(value5);
|
|
4861
4861
|
else {
|
|
4862
|
-
const [key, ...rest] =
|
|
4862
|
+
const [key, ...rest] = path15;
|
|
4863
4863
|
const node = this.get(key, true);
|
|
4864
4864
|
if (identity3.isCollection(node))
|
|
4865
4865
|
node.addIn(rest, value5);
|
|
@@ -4873,8 +4873,8 @@ var require_Collection = __commonJS({
|
|
|
4873
4873
|
* Removes a value from the collection.
|
|
4874
4874
|
* @returns `true` if the item was found and removed.
|
|
4875
4875
|
*/
|
|
4876
|
-
deleteIn(
|
|
4877
|
-
const [key, ...rest] =
|
|
4876
|
+
deleteIn(path15) {
|
|
4877
|
+
const [key, ...rest] = path15;
|
|
4878
4878
|
if (rest.length === 0)
|
|
4879
4879
|
return this.delete(key);
|
|
4880
4880
|
const node = this.get(key, true);
|
|
@@ -4888,8 +4888,8 @@ var require_Collection = __commonJS({
|
|
|
4888
4888
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4889
4889
|
* `true` (collections are always returned intact).
|
|
4890
4890
|
*/
|
|
4891
|
-
getIn(
|
|
4892
|
-
const [key, ...rest] =
|
|
4891
|
+
getIn(path15, keepScalar) {
|
|
4892
|
+
const [key, ...rest] = path15;
|
|
4893
4893
|
const node = this.get(key, true);
|
|
4894
4894
|
if (rest.length === 0)
|
|
4895
4895
|
return !keepScalar && identity3.isScalar(node) ? node.value : node;
|
|
@@ -4907,8 +4907,8 @@ var require_Collection = __commonJS({
|
|
|
4907
4907
|
/**
|
|
4908
4908
|
* Checks if the collection includes a value with the key `key`.
|
|
4909
4909
|
*/
|
|
4910
|
-
hasIn(
|
|
4911
|
-
const [key, ...rest] =
|
|
4910
|
+
hasIn(path15) {
|
|
4911
|
+
const [key, ...rest] = path15;
|
|
4912
4912
|
if (rest.length === 0)
|
|
4913
4913
|
return this.has(key);
|
|
4914
4914
|
const node = this.get(key, true);
|
|
@@ -4918,8 +4918,8 @@ var require_Collection = __commonJS({
|
|
|
4918
4918
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4919
4919
|
* boolean to add/remove the item from the set.
|
|
4920
4920
|
*/
|
|
4921
|
-
setIn(
|
|
4922
|
-
const [key, ...rest] =
|
|
4921
|
+
setIn(path15, value5) {
|
|
4922
|
+
const [key, ...rest] = path15;
|
|
4923
4923
|
if (rest.length === 0) {
|
|
4924
4924
|
this.set(key, value5);
|
|
4925
4925
|
} else {
|
|
@@ -7388,9 +7388,9 @@ var require_Document = __commonJS({
|
|
|
7388
7388
|
this.contents.add(value5);
|
|
7389
7389
|
}
|
|
7390
7390
|
/** Adds a value to the document. */
|
|
7391
|
-
addIn(
|
|
7391
|
+
addIn(path15, value5) {
|
|
7392
7392
|
if (assertCollection(this.contents))
|
|
7393
|
-
this.contents.addIn(
|
|
7393
|
+
this.contents.addIn(path15, value5);
|
|
7394
7394
|
}
|
|
7395
7395
|
/**
|
|
7396
7396
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -7465,14 +7465,14 @@ var require_Document = __commonJS({
|
|
|
7465
7465
|
* Removes a value from the document.
|
|
7466
7466
|
* @returns `true` if the item was found and removed.
|
|
7467
7467
|
*/
|
|
7468
|
-
deleteIn(
|
|
7469
|
-
if (Collection.isEmptyPath(
|
|
7468
|
+
deleteIn(path15) {
|
|
7469
|
+
if (Collection.isEmptyPath(path15)) {
|
|
7470
7470
|
if (this.contents == null)
|
|
7471
7471
|
return false;
|
|
7472
7472
|
this.contents = null;
|
|
7473
7473
|
return true;
|
|
7474
7474
|
}
|
|
7475
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
7475
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path15) : false;
|
|
7476
7476
|
}
|
|
7477
7477
|
/**
|
|
7478
7478
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7487,10 +7487,10 @@ var require_Document = __commonJS({
|
|
|
7487
7487
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7488
7488
|
* `true` (collections are always returned intact).
|
|
7489
7489
|
*/
|
|
7490
|
-
getIn(
|
|
7491
|
-
if (Collection.isEmptyPath(
|
|
7490
|
+
getIn(path15, keepScalar) {
|
|
7491
|
+
if (Collection.isEmptyPath(path15))
|
|
7492
7492
|
return !keepScalar && identity3.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7493
|
-
return identity3.isCollection(this.contents) ? this.contents.getIn(
|
|
7493
|
+
return identity3.isCollection(this.contents) ? this.contents.getIn(path15, keepScalar) : void 0;
|
|
7494
7494
|
}
|
|
7495
7495
|
/**
|
|
7496
7496
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7501,10 +7501,10 @@ var require_Document = __commonJS({
|
|
|
7501
7501
|
/**
|
|
7502
7502
|
* Checks if the document includes a value at `path`.
|
|
7503
7503
|
*/
|
|
7504
|
-
hasIn(
|
|
7505
|
-
if (Collection.isEmptyPath(
|
|
7504
|
+
hasIn(path15) {
|
|
7505
|
+
if (Collection.isEmptyPath(path15))
|
|
7506
7506
|
return this.contents !== void 0;
|
|
7507
|
-
return identity3.isCollection(this.contents) ? this.contents.hasIn(
|
|
7507
|
+
return identity3.isCollection(this.contents) ? this.contents.hasIn(path15) : false;
|
|
7508
7508
|
}
|
|
7509
7509
|
/**
|
|
7510
7510
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7521,13 +7521,13 @@ var require_Document = __commonJS({
|
|
|
7521
7521
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7522
7522
|
* boolean to add/remove the item from the set.
|
|
7523
7523
|
*/
|
|
7524
|
-
setIn(
|
|
7525
|
-
if (Collection.isEmptyPath(
|
|
7524
|
+
setIn(path15, value5) {
|
|
7525
|
+
if (Collection.isEmptyPath(path15)) {
|
|
7526
7526
|
this.contents = value5;
|
|
7527
7527
|
} else if (this.contents == null) {
|
|
7528
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7528
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path15), value5);
|
|
7529
7529
|
} else if (assertCollection(this.contents)) {
|
|
7530
|
-
this.contents.setIn(
|
|
7530
|
+
this.contents.setIn(path15, value5);
|
|
7531
7531
|
}
|
|
7532
7532
|
}
|
|
7533
7533
|
/**
|
|
@@ -9459,9 +9459,9 @@ var require_cst_visit = __commonJS({
|
|
|
9459
9459
|
visit.BREAK = BREAK;
|
|
9460
9460
|
visit.SKIP = SKIP;
|
|
9461
9461
|
visit.REMOVE = REMOVE;
|
|
9462
|
-
visit.itemAtPath = (cst,
|
|
9462
|
+
visit.itemAtPath = (cst, path15) => {
|
|
9463
9463
|
let item = cst;
|
|
9464
|
-
for (const [field, index] of
|
|
9464
|
+
for (const [field, index] of path15) {
|
|
9465
9465
|
const tok = item?.[field];
|
|
9466
9466
|
if (tok && "items" in tok) {
|
|
9467
9467
|
item = tok.items[index];
|
|
@@ -9470,23 +9470,23 @@ var require_cst_visit = __commonJS({
|
|
|
9470
9470
|
}
|
|
9471
9471
|
return item;
|
|
9472
9472
|
};
|
|
9473
|
-
visit.parentCollection = (cst,
|
|
9474
|
-
const parent = visit.itemAtPath(cst,
|
|
9475
|
-
const field =
|
|
9473
|
+
visit.parentCollection = (cst, path15) => {
|
|
9474
|
+
const parent = visit.itemAtPath(cst, path15.slice(0, -1));
|
|
9475
|
+
const field = path15[path15.length - 1][0];
|
|
9476
9476
|
const coll = parent?.[field];
|
|
9477
9477
|
if (coll && "items" in coll)
|
|
9478
9478
|
return coll;
|
|
9479
9479
|
throw new Error("Parent collection not found");
|
|
9480
9480
|
};
|
|
9481
|
-
function _visit(
|
|
9482
|
-
let ctrl = visitor(item,
|
|
9481
|
+
function _visit(path15, item, visitor) {
|
|
9482
|
+
let ctrl = visitor(item, path15);
|
|
9483
9483
|
if (typeof ctrl === "symbol")
|
|
9484
9484
|
return ctrl;
|
|
9485
9485
|
for (const field of ["key", "value"]) {
|
|
9486
9486
|
const token = item[field];
|
|
9487
9487
|
if (token && "items" in token) {
|
|
9488
9488
|
for (let i = 0; i < token.items.length; ++i) {
|
|
9489
|
-
const ci = _visit(Object.freeze(
|
|
9489
|
+
const ci = _visit(Object.freeze(path15.concat([[field, i]])), token.items[i], visitor);
|
|
9490
9490
|
if (typeof ci === "number")
|
|
9491
9491
|
i = ci - 1;
|
|
9492
9492
|
else if (ci === BREAK)
|
|
@@ -9497,10 +9497,10 @@ var require_cst_visit = __commonJS({
|
|
|
9497
9497
|
}
|
|
9498
9498
|
}
|
|
9499
9499
|
if (typeof ctrl === "function" && field === "key")
|
|
9500
|
-
ctrl = ctrl(item,
|
|
9500
|
+
ctrl = ctrl(item, path15);
|
|
9501
9501
|
}
|
|
9502
9502
|
}
|
|
9503
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9503
|
+
return typeof ctrl === "function" ? ctrl(item, path15) : ctrl;
|
|
9504
9504
|
}
|
|
9505
9505
|
exports.visit = visit;
|
|
9506
9506
|
}
|
|
@@ -11482,10 +11482,10 @@ var require_clear = __commonJS({
|
|
|
11482
11482
|
var erase = _require.erase;
|
|
11483
11483
|
var cursor = _require.cursor;
|
|
11484
11484
|
var width3 = (str) => [...strip(str)].length;
|
|
11485
|
-
module.exports = function(
|
|
11485
|
+
module.exports = function(prompt10, perLine) {
|
|
11486
11486
|
if (!perLine) return erase.line + cursor.to(0);
|
|
11487
11487
|
let rows = 0;
|
|
11488
|
-
const lines4 =
|
|
11488
|
+
const lines4 = prompt10.split(/\r?\n/);
|
|
11489
11489
|
var _iterator = _createForOfIteratorHelper(lines4), _step;
|
|
11490
11490
|
try {
|
|
11491
11491
|
for (_iterator.s(); !(_step = _iterator.n()).done; ) {
|
|
@@ -13086,14 +13086,14 @@ Instructions:
|
|
|
13086
13086
|
if (this.closed) return;
|
|
13087
13087
|
if (this.firstRender) this.out.write(cursor.hide);
|
|
13088
13088
|
super.render();
|
|
13089
|
-
let
|
|
13089
|
+
let prompt10 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
13090
13090
|
if (this.showMinError) {
|
|
13091
|
-
|
|
13091
|
+
prompt10 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
13092
13092
|
this.showMinError = false;
|
|
13093
13093
|
}
|
|
13094
|
-
|
|
13095
|
-
this.out.write(this.clear +
|
|
13096
|
-
this.clear = clear3(
|
|
13094
|
+
prompt10 += this.renderOptions(this.value);
|
|
13095
|
+
this.out.write(this.clear + prompt10);
|
|
13096
|
+
this.clear = clear3(prompt10, this.out.columns);
|
|
13097
13097
|
}
|
|
13098
13098
|
};
|
|
13099
13099
|
module.exports = MultiselectPrompt;
|
|
@@ -13498,14 +13498,14 @@ Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter s
|
|
|
13498
13498
|
if (this.closed) return;
|
|
13499
13499
|
if (this.firstRender) this.out.write(cursor.hide);
|
|
13500
13500
|
super.render();
|
|
13501
|
-
let
|
|
13501
|
+
let prompt10 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
13502
13502
|
if (this.showMinError) {
|
|
13503
|
-
|
|
13503
|
+
prompt10 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
13504
13504
|
this.showMinError = false;
|
|
13505
13505
|
}
|
|
13506
|
-
|
|
13507
|
-
this.out.write(this.clear +
|
|
13508
|
-
this.clear = clear3(
|
|
13506
|
+
prompt10 += this.renderOptions(this.filteredOptions);
|
|
13507
|
+
this.out.write(this.clear + prompt10);
|
|
13508
|
+
this.clear = clear3(prompt10, this.out.columns);
|
|
13509
13509
|
}
|
|
13510
13510
|
};
|
|
13511
13511
|
module.exports = AutocompleteMultiselectPrompt;
|
|
@@ -13785,7 +13785,7 @@ var require_dist2 = __commonJS({
|
|
|
13785
13785
|
var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
13786
13786
|
var noop = () => {
|
|
13787
13787
|
};
|
|
13788
|
-
function
|
|
13788
|
+
function prompt10() {
|
|
13789
13789
|
return _prompt.apply(this, arguments);
|
|
13790
13790
|
}
|
|
13791
13791
|
function _prompt() {
|
|
@@ -13794,7 +13794,7 @@ var require_dist2 = __commonJS({
|
|
|
13794
13794
|
onCancel = noop
|
|
13795
13795
|
} = {}) {
|
|
13796
13796
|
const answers = {};
|
|
13797
|
-
const override2 =
|
|
13797
|
+
const override2 = prompt10._override || {};
|
|
13798
13798
|
questions = [].concat(questions);
|
|
13799
13799
|
let answer, question, quit, name, type2, lastPrompt;
|
|
13800
13800
|
const getFormattedAnswer = /* @__PURE__ */ (function() {
|
|
@@ -13843,7 +13843,7 @@ var require_dist2 = __commonJS({
|
|
|
13843
13843
|
}
|
|
13844
13844
|
}
|
|
13845
13845
|
try {
|
|
13846
|
-
answer =
|
|
13846
|
+
answer = prompt10._injected ? getInjectedAnswer(prompt10._injected, question.initial) : yield prompts[type2](question);
|
|
13847
13847
|
answers[name] = answer = yield getFormattedAnswer(question, answer, true);
|
|
13848
13848
|
quit = yield onSubmit(question, answer, answers);
|
|
13849
13849
|
} catch (err) {
|
|
@@ -13868,13 +13868,13 @@ var require_dist2 = __commonJS({
|
|
|
13868
13868
|
return answer === void 0 ? deafultValue : answer;
|
|
13869
13869
|
}
|
|
13870
13870
|
function inject(answers) {
|
|
13871
|
-
|
|
13871
|
+
prompt10._injected = (prompt10._injected || []).concat(answers);
|
|
13872
13872
|
}
|
|
13873
13873
|
function override(answers) {
|
|
13874
|
-
|
|
13874
|
+
prompt10._override = Object.assign({}, answers);
|
|
13875
13875
|
}
|
|
13876
|
-
module.exports = Object.assign(
|
|
13877
|
-
prompt:
|
|
13876
|
+
module.exports = Object.assign(prompt10, {
|
|
13877
|
+
prompt: prompt10,
|
|
13878
13878
|
prompts,
|
|
13879
13879
|
inject,
|
|
13880
13880
|
override
|
|
@@ -13938,10 +13938,10 @@ var require_clear2 = __commonJS({
|
|
|
13938
13938
|
var strip = require_strip2();
|
|
13939
13939
|
var { erase, cursor } = require_src();
|
|
13940
13940
|
var width3 = (str) => [...strip(str)].length;
|
|
13941
|
-
module.exports = function(
|
|
13941
|
+
module.exports = function(prompt10, perLine) {
|
|
13942
13942
|
if (!perLine) return erase.line + cursor.to(0);
|
|
13943
13943
|
let rows = 0;
|
|
13944
|
-
const lines4 =
|
|
13944
|
+
const lines4 = prompt10.split(/\r?\n/);
|
|
13945
13945
|
for (let line4 of lines4) {
|
|
13946
13946
|
rows += 1 + Math.floor(Math.max(width3(line4) - 1, 0) / perLine);
|
|
13947
13947
|
}
|
|
@@ -15380,19 +15380,19 @@ Instructions:
|
|
|
15380
15380
|
if (this.closed) return;
|
|
15381
15381
|
if (this.firstRender) this.out.write(cursor.hide);
|
|
15382
15382
|
super.render();
|
|
15383
|
-
let
|
|
15383
|
+
let prompt10 = [
|
|
15384
15384
|
style.symbol(this.done, this.aborted),
|
|
15385
15385
|
color3.bold(this.msg),
|
|
15386
15386
|
style.delimiter(false),
|
|
15387
15387
|
this.renderDoneOrInstructions()
|
|
15388
15388
|
].join(" ");
|
|
15389
15389
|
if (this.showMinError) {
|
|
15390
|
-
|
|
15390
|
+
prompt10 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
15391
15391
|
this.showMinError = false;
|
|
15392
15392
|
}
|
|
15393
|
-
|
|
15394
|
-
this.out.write(this.clear +
|
|
15395
|
-
this.clear = clear3(
|
|
15393
|
+
prompt10 += this.renderOptions(this.value);
|
|
15394
|
+
this.out.write(this.clear + prompt10);
|
|
15395
|
+
this.clear = clear3(prompt10, this.out.columns);
|
|
15396
15396
|
}
|
|
15397
15397
|
};
|
|
15398
15398
|
module.exports = MultiselectPrompt;
|
|
@@ -15754,19 +15754,19 @@ Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter s
|
|
|
15754
15754
|
if (this.closed) return;
|
|
15755
15755
|
if (this.firstRender) this.out.write(cursor.hide);
|
|
15756
15756
|
super.render();
|
|
15757
|
-
let
|
|
15757
|
+
let prompt10 = [
|
|
15758
15758
|
style.symbol(this.done, this.aborted),
|
|
15759
15759
|
color3.bold(this.msg),
|
|
15760
15760
|
style.delimiter(false),
|
|
15761
15761
|
this.renderDoneOrInstructions()
|
|
15762
15762
|
].join(" ");
|
|
15763
15763
|
if (this.showMinError) {
|
|
15764
|
-
|
|
15764
|
+
prompt10 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
15765
15765
|
this.showMinError = false;
|
|
15766
15766
|
}
|
|
15767
|
-
|
|
15768
|
-
this.out.write(this.clear +
|
|
15769
|
-
this.clear = clear3(
|
|
15767
|
+
prompt10 += this.renderOptions(this.filteredOptions);
|
|
15768
|
+
this.out.write(this.clear + prompt10);
|
|
15769
|
+
this.clear = clear3(prompt10, this.out.columns);
|
|
15770
15770
|
}
|
|
15771
15771
|
};
|
|
15772
15772
|
module.exports = AutocompleteMultiselectPrompt;
|
|
@@ -15934,9 +15934,9 @@ var require_lib = __commonJS({
|
|
|
15934
15934
|
var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
|
|
15935
15935
|
var noop = () => {
|
|
15936
15936
|
};
|
|
15937
|
-
async function
|
|
15937
|
+
async function prompt10(questions = [], { onSubmit = noop, onCancel = noop } = {}) {
|
|
15938
15938
|
const answers = {};
|
|
15939
|
-
const override2 =
|
|
15939
|
+
const override2 = prompt10._override || {};
|
|
15940
15940
|
questions = [].concat(questions);
|
|
15941
15941
|
let answer, question, quit, name, type2, lastPrompt;
|
|
15942
15942
|
const getFormattedAnswer = async (question2, answer2, skipValidation = false) => {
|
|
@@ -15973,7 +15973,7 @@ var require_lib = __commonJS({
|
|
|
15973
15973
|
}
|
|
15974
15974
|
}
|
|
15975
15975
|
try {
|
|
15976
|
-
answer =
|
|
15976
|
+
answer = prompt10._injected ? getInjectedAnswer(prompt10._injected, question.initial) : await prompts[type2](question);
|
|
15977
15977
|
answers[name] = answer = await getFormattedAnswer(question, answer, true);
|
|
15978
15978
|
quit = await onSubmit(question, answer, answers);
|
|
15979
15979
|
} catch (err) {
|
|
@@ -15991,12 +15991,12 @@ var require_lib = __commonJS({
|
|
|
15991
15991
|
return answer === void 0 ? deafultValue : answer;
|
|
15992
15992
|
}
|
|
15993
15993
|
function inject(answers) {
|
|
15994
|
-
|
|
15994
|
+
prompt10._injected = (prompt10._injected || []).concat(answers);
|
|
15995
15995
|
}
|
|
15996
15996
|
function override(answers) {
|
|
15997
|
-
|
|
15997
|
+
prompt10._override = Object.assign({}, answers);
|
|
15998
15998
|
}
|
|
15999
|
-
module.exports = Object.assign(
|
|
15999
|
+
module.exports = Object.assign(prompt10, { prompt: prompt10, prompts, inject, override });
|
|
16000
16000
|
}
|
|
16001
16001
|
});
|
|
16002
16002
|
|
|
@@ -16923,14 +16923,14 @@ var require_util3 = __commonJS({
|
|
|
16923
16923
|
}
|
|
16924
16924
|
const port3 = url3.port != null ? url3.port : url3.protocol === "https:" ? 443 : 80;
|
|
16925
16925
|
let origin = url3.origin != null ? url3.origin : `${url3.protocol || ""}//${url3.hostname || ""}:${port3}`;
|
|
16926
|
-
let
|
|
16926
|
+
let path15 = url3.path != null ? url3.path : `${url3.pathname || ""}${url3.search || ""}`;
|
|
16927
16927
|
if (origin[origin.length - 1] === "/") {
|
|
16928
16928
|
origin = origin.slice(0, origin.length - 1);
|
|
16929
16929
|
}
|
|
16930
|
-
if (
|
|
16931
|
-
|
|
16930
|
+
if (path15 && path15[0] !== "/") {
|
|
16931
|
+
path15 = `/${path15}`;
|
|
16932
16932
|
}
|
|
16933
|
-
return new URL(`${origin}${
|
|
16933
|
+
return new URL(`${origin}${path15}`);
|
|
16934
16934
|
}
|
|
16935
16935
|
if (!isHttpOrHttpsPrefixed(url3.origin || url3.protocol)) {
|
|
16936
16936
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -17476,9 +17476,9 @@ var require_diagnostics = __commonJS({
|
|
|
17476
17476
|
"undici:client:sendHeaders",
|
|
17477
17477
|
(evt) => {
|
|
17478
17478
|
const {
|
|
17479
|
-
request: { method, path:
|
|
17479
|
+
request: { method, path: path15, origin }
|
|
17480
17480
|
} = evt;
|
|
17481
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
17481
|
+
debugLog("sending request to %s %s%s", method, origin, path15);
|
|
17482
17482
|
}
|
|
17483
17483
|
);
|
|
17484
17484
|
}
|
|
@@ -17492,14 +17492,14 @@ var require_diagnostics = __commonJS({
|
|
|
17492
17492
|
"undici:request:headers",
|
|
17493
17493
|
(evt) => {
|
|
17494
17494
|
const {
|
|
17495
|
-
request: { method, path:
|
|
17495
|
+
request: { method, path: path15, origin },
|
|
17496
17496
|
response: { statusCode }
|
|
17497
17497
|
} = evt;
|
|
17498
17498
|
debugLog(
|
|
17499
17499
|
"received response to %s %s%s - HTTP %d",
|
|
17500
17500
|
method,
|
|
17501
17501
|
origin,
|
|
17502
|
-
|
|
17502
|
+
path15,
|
|
17503
17503
|
statusCode
|
|
17504
17504
|
);
|
|
17505
17505
|
}
|
|
@@ -17508,23 +17508,23 @@ var require_diagnostics = __commonJS({
|
|
|
17508
17508
|
"undici:request:trailers",
|
|
17509
17509
|
(evt) => {
|
|
17510
17510
|
const {
|
|
17511
|
-
request: { method, path:
|
|
17511
|
+
request: { method, path: path15, origin }
|
|
17512
17512
|
} = evt;
|
|
17513
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
17513
|
+
debugLog("trailers received from %s %s%s", method, origin, path15);
|
|
17514
17514
|
}
|
|
17515
17515
|
);
|
|
17516
17516
|
diagnosticsChannel.subscribe(
|
|
17517
17517
|
"undici:request:error",
|
|
17518
17518
|
(evt) => {
|
|
17519
17519
|
const {
|
|
17520
|
-
request: { method, path:
|
|
17520
|
+
request: { method, path: path15, origin },
|
|
17521
17521
|
error: error4
|
|
17522
17522
|
} = evt;
|
|
17523
17523
|
debugLog(
|
|
17524
17524
|
"request to %s %s%s errored - %s",
|
|
17525
17525
|
method,
|
|
17526
17526
|
origin,
|
|
17527
|
-
|
|
17527
|
+
path15,
|
|
17528
17528
|
error4.message
|
|
17529
17529
|
);
|
|
17530
17530
|
}
|
|
@@ -17618,7 +17618,7 @@ var require_request = __commonJS({
|
|
|
17618
17618
|
var kHandler = Symbol("handler");
|
|
17619
17619
|
var Request = class {
|
|
17620
17620
|
constructor(origin, {
|
|
17621
|
-
path:
|
|
17621
|
+
path: path15,
|
|
17622
17622
|
method,
|
|
17623
17623
|
body,
|
|
17624
17624
|
headers,
|
|
@@ -17634,11 +17634,11 @@ var require_request = __commonJS({
|
|
|
17634
17634
|
throwOnError,
|
|
17635
17635
|
maxRedirections
|
|
17636
17636
|
}, handler) {
|
|
17637
|
-
if (typeof
|
|
17637
|
+
if (typeof path15 !== "string") {
|
|
17638
17638
|
throw new InvalidArgumentError("path must be a string");
|
|
17639
|
-
} else if (
|
|
17639
|
+
} else if (path15[0] !== "/" && !(path15.startsWith("http://") || path15.startsWith("https://")) && method !== "CONNECT") {
|
|
17640
17640
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
17641
|
-
} else if (invalidPathRegex.test(
|
|
17641
|
+
} else if (invalidPathRegex.test(path15)) {
|
|
17642
17642
|
throw new InvalidArgumentError("invalid request path");
|
|
17643
17643
|
}
|
|
17644
17644
|
if (typeof method !== "string") {
|
|
@@ -17706,7 +17706,7 @@ var require_request = __commonJS({
|
|
|
17706
17706
|
this.completed = false;
|
|
17707
17707
|
this.aborted = false;
|
|
17708
17708
|
this.upgrade = upgrade || null;
|
|
17709
|
-
this.path = query ? serializePathWithQuery(
|
|
17709
|
+
this.path = query ? serializePathWithQuery(path15, query) : path15;
|
|
17710
17710
|
this.origin = origin;
|
|
17711
17711
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
17712
17712
|
this.blocking = blocking ?? this.method !== "HEAD";
|
|
@@ -22449,7 +22449,7 @@ var require_client_h1 = __commonJS({
|
|
|
22449
22449
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
22450
22450
|
}
|
|
22451
22451
|
function writeH1(client, request2) {
|
|
22452
|
-
const { method, path:
|
|
22452
|
+
const { method, path: path15, host, upgrade, blocking, reset: reset3 } = request2;
|
|
22453
22453
|
let { body, headers, contentLength } = request2;
|
|
22454
22454
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
22455
22455
|
if (util.isFormDataLike(body)) {
|
|
@@ -22515,7 +22515,7 @@ var require_client_h1 = __commonJS({
|
|
|
22515
22515
|
if (blocking) {
|
|
22516
22516
|
socket[kBlocking] = true;
|
|
22517
22517
|
}
|
|
22518
|
-
let header = `${method} ${
|
|
22518
|
+
let header = `${method} ${path15} HTTP/1.1\r
|
|
22519
22519
|
`;
|
|
22520
22520
|
if (typeof host === "string") {
|
|
22521
22521
|
header += `host: ${host}\r
|
|
@@ -23071,7 +23071,7 @@ var require_client_h2 = __commonJS({
|
|
|
23071
23071
|
function writeH2(client, request2) {
|
|
23072
23072
|
const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
|
|
23073
23073
|
const session = client[kHTTP2Session];
|
|
23074
|
-
const { method, path:
|
|
23074
|
+
const { method, path: path15, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2;
|
|
23075
23075
|
let { body } = request2;
|
|
23076
23076
|
if (upgrade) {
|
|
23077
23077
|
util.errorRequest(client, request2, new Error("Upgrade not supported for H2"));
|
|
@@ -23142,7 +23142,7 @@ var require_client_h2 = __commonJS({
|
|
|
23142
23142
|
stream4.setTimeout(requestTimeout);
|
|
23143
23143
|
return true;
|
|
23144
23144
|
}
|
|
23145
|
-
headers[HTTP2_HEADER_PATH] =
|
|
23145
|
+
headers[HTTP2_HEADER_PATH] = path15;
|
|
23146
23146
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
23147
23147
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
23148
23148
|
if (body && typeof body.read === "function") {
|
|
@@ -24581,10 +24581,10 @@ var require_proxy_agent = __commonJS({
|
|
|
24581
24581
|
};
|
|
24582
24582
|
const {
|
|
24583
24583
|
origin,
|
|
24584
|
-
path:
|
|
24584
|
+
path: path15 = "/",
|
|
24585
24585
|
headers = {}
|
|
24586
24586
|
} = opts;
|
|
24587
|
-
opts.path = origin +
|
|
24587
|
+
opts.path = origin + path15;
|
|
24588
24588
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
24589
24589
|
const { host } = new URL2(origin);
|
|
24590
24590
|
headers.host = host;
|
|
@@ -26638,20 +26638,20 @@ var require_mock_utils = __commonJS({
|
|
|
26638
26638
|
}
|
|
26639
26639
|
return normalizedQp;
|
|
26640
26640
|
}
|
|
26641
|
-
function safeUrl(
|
|
26642
|
-
if (typeof
|
|
26643
|
-
return
|
|
26641
|
+
function safeUrl(path15) {
|
|
26642
|
+
if (typeof path15 !== "string") {
|
|
26643
|
+
return path15;
|
|
26644
26644
|
}
|
|
26645
|
-
const pathSegments =
|
|
26645
|
+
const pathSegments = path15.split("?", 3);
|
|
26646
26646
|
if (pathSegments.length !== 2) {
|
|
26647
|
-
return
|
|
26647
|
+
return path15;
|
|
26648
26648
|
}
|
|
26649
26649
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
26650
26650
|
qp.sort();
|
|
26651
26651
|
return [...pathSegments, qp.toString()].join("?");
|
|
26652
26652
|
}
|
|
26653
|
-
function matchKey(mockDispatch2, { path:
|
|
26654
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
26653
|
+
function matchKey(mockDispatch2, { path: path15, method, body, headers }) {
|
|
26654
|
+
const pathMatch = matchValue(mockDispatch2.path, path15);
|
|
26655
26655
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
26656
26656
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
26657
26657
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -26676,8 +26676,8 @@ var require_mock_utils = __commonJS({
|
|
|
26676
26676
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
26677
26677
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
26678
26678
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
26679
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
26680
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
26679
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path15, ignoreTrailingSlash }) => {
|
|
26680
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path15)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path15), resolvedPath);
|
|
26681
26681
|
});
|
|
26682
26682
|
if (matchedMockDispatches.length === 0) {
|
|
26683
26683
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -26715,19 +26715,19 @@ var require_mock_utils = __commonJS({
|
|
|
26715
26715
|
mockDispatches.splice(index, 1);
|
|
26716
26716
|
}
|
|
26717
26717
|
}
|
|
26718
|
-
function removeTrailingSlash(
|
|
26719
|
-
while (
|
|
26720
|
-
|
|
26718
|
+
function removeTrailingSlash(path15) {
|
|
26719
|
+
while (path15.endsWith("/")) {
|
|
26720
|
+
path15 = path15.slice(0, -1);
|
|
26721
26721
|
}
|
|
26722
|
-
if (
|
|
26723
|
-
|
|
26722
|
+
if (path15.length === 0) {
|
|
26723
|
+
path15 = "/";
|
|
26724
26724
|
}
|
|
26725
|
-
return
|
|
26725
|
+
return path15;
|
|
26726
26726
|
}
|
|
26727
26727
|
function buildKey(opts) {
|
|
26728
|
-
const { path:
|
|
26728
|
+
const { path: path15, method, body, headers, query } = opts;
|
|
26729
26729
|
return {
|
|
26730
|
-
path:
|
|
26730
|
+
path: path15,
|
|
26731
26731
|
method,
|
|
26732
26732
|
body,
|
|
26733
26733
|
headers,
|
|
@@ -27379,10 +27379,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
27379
27379
|
}
|
|
27380
27380
|
format(pendingInterceptors) {
|
|
27381
27381
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
27382
|
-
({ method, path:
|
|
27382
|
+
({ method, path: path15, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
|
|
27383
27383
|
Method: method,
|
|
27384
27384
|
Origin: origin,
|
|
27385
|
-
Path:
|
|
27385
|
+
Path: path15,
|
|
27386
27386
|
"Status code": statusCode,
|
|
27387
27387
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
27388
27388
|
Invocations: timesInvoked,
|
|
@@ -27461,9 +27461,9 @@ var require_mock_agent = __commonJS({
|
|
|
27461
27461
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
27462
27462
|
const dispatchOpts = { ...opts };
|
|
27463
27463
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
27464
|
-
const [
|
|
27464
|
+
const [path15, searchParams] = dispatchOpts.path.split("?");
|
|
27465
27465
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
27466
|
-
dispatchOpts.path = `${
|
|
27466
|
+
dispatchOpts.path = `${path15}?${normalizedSearchParams}`;
|
|
27467
27467
|
}
|
|
27468
27468
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
27469
27469
|
}
|
|
@@ -27801,12 +27801,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27801
27801
|
* Loads snapshots from file
|
|
27802
27802
|
*/
|
|
27803
27803
|
async loadSnapshots(filePath) {
|
|
27804
|
-
const
|
|
27805
|
-
if (!
|
|
27804
|
+
const path15 = filePath || this.snapshotPath;
|
|
27805
|
+
if (!path15) {
|
|
27806
27806
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27807
27807
|
}
|
|
27808
27808
|
try {
|
|
27809
|
-
const data = await readFile3(resolve7(
|
|
27809
|
+
const data = await readFile3(resolve7(path15), "utf8");
|
|
27810
27810
|
const parsed = JSON.parse(data);
|
|
27811
27811
|
if (Array.isArray(parsed)) {
|
|
27812
27812
|
this.snapshots.clear();
|
|
@@ -27822,7 +27822,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27822
27822
|
this.snapshots.clear();
|
|
27823
27823
|
this.loaded = true;
|
|
27824
27824
|
} else {
|
|
27825
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
27825
|
+
throw new UndiciError(`Failed to load snapshots from ${path15}`, { cause: error4 });
|
|
27826
27826
|
}
|
|
27827
27827
|
}
|
|
27828
27828
|
}
|
|
@@ -27830,11 +27830,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27830
27830
|
* Saves snapshots to file
|
|
27831
27831
|
*/
|
|
27832
27832
|
async saveSnapshots(filePath) {
|
|
27833
|
-
const
|
|
27834
|
-
if (!
|
|
27833
|
+
const path15 = filePath || this.snapshotPath;
|
|
27834
|
+
if (!path15) {
|
|
27835
27835
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27836
27836
|
}
|
|
27837
|
-
const resolvedPath = resolve7(
|
|
27837
|
+
const resolvedPath = resolve7(path15);
|
|
27838
27838
|
await mkdir2(dirname3(resolvedPath), { recursive: true });
|
|
27839
27839
|
const data = Array.from(this.snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
27840
27840
|
hash: hash2,
|
|
@@ -28411,15 +28411,15 @@ var require_redirect_handler = __commonJS({
|
|
|
28411
28411
|
return;
|
|
28412
28412
|
}
|
|
28413
28413
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
28414
|
-
const
|
|
28415
|
-
const redirectUrlString = `${origin}${
|
|
28414
|
+
const path15 = search ? `${pathname}${search}` : pathname;
|
|
28415
|
+
const redirectUrlString = `${origin}${path15}`;
|
|
28416
28416
|
for (const historyUrl of this.history) {
|
|
28417
28417
|
if (historyUrl.toString() === redirectUrlString) {
|
|
28418
28418
|
throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
|
|
28419
28419
|
}
|
|
28420
28420
|
}
|
|
28421
28421
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
28422
|
-
this.opts.path =
|
|
28422
|
+
this.opts.path = path15;
|
|
28423
28423
|
this.opts.origin = origin;
|
|
28424
28424
|
this.opts.query = null;
|
|
28425
28425
|
}
|
|
@@ -34043,9 +34043,9 @@ var require_util6 = __commonJS({
|
|
|
34043
34043
|
}
|
|
34044
34044
|
}
|
|
34045
34045
|
}
|
|
34046
|
-
function validateCookiePath(
|
|
34047
|
-
for (let i = 0; i <
|
|
34048
|
-
const code2 =
|
|
34046
|
+
function validateCookiePath(path15) {
|
|
34047
|
+
for (let i = 0; i < path15.length; ++i) {
|
|
34048
|
+
const code2 = path15.charCodeAt(i);
|
|
34049
34049
|
if (code2 < 32 || // exclude CTLs (0-31)
|
|
34050
34050
|
code2 === 127 || // DEL
|
|
34051
34051
|
code2 === 59) {
|
|
@@ -37102,11 +37102,11 @@ var require_undici = __commonJS({
|
|
|
37102
37102
|
if (typeof opts.path !== "string") {
|
|
37103
37103
|
throw new InvalidArgumentError("invalid opts.path");
|
|
37104
37104
|
}
|
|
37105
|
-
let
|
|
37105
|
+
let path15 = opts.path;
|
|
37106
37106
|
if (!opts.path.startsWith("/")) {
|
|
37107
|
-
|
|
37107
|
+
path15 = `/${path15}`;
|
|
37108
37108
|
}
|
|
37109
|
-
url3 = new URL(util.parseOrigin(url3).origin +
|
|
37109
|
+
url3 = new URL(util.parseOrigin(url3).origin + path15);
|
|
37110
37110
|
} else {
|
|
37111
37111
|
if (!opts) {
|
|
37112
37112
|
opts = typeof url3 === "object" ? url3 : {};
|
|
@@ -38526,11 +38526,11 @@ var require_lodash = __commonJS({
|
|
|
38526
38526
|
return isFunction3(object[key]);
|
|
38527
38527
|
});
|
|
38528
38528
|
}
|
|
38529
|
-
function baseGet(object,
|
|
38530
|
-
|
|
38531
|
-
var index = 0, length4 =
|
|
38529
|
+
function baseGet(object, path15) {
|
|
38530
|
+
path15 = castPath(path15, object);
|
|
38531
|
+
var index = 0, length4 = path15.length;
|
|
38532
38532
|
while (object != null && index < length4) {
|
|
38533
|
-
object = object[toKey(
|
|
38533
|
+
object = object[toKey(path15[index++])];
|
|
38534
38534
|
}
|
|
38535
38535
|
return index && index == length4 ? object : undefined2;
|
|
38536
38536
|
}
|
|
@@ -38594,10 +38594,10 @@ var require_lodash = __commonJS({
|
|
|
38594
38594
|
});
|
|
38595
38595
|
return accumulator;
|
|
38596
38596
|
}
|
|
38597
|
-
function baseInvoke(object,
|
|
38598
|
-
|
|
38599
|
-
object = parent(object,
|
|
38600
|
-
var func = object == null ? object : object[toKey(last5(
|
|
38597
|
+
function baseInvoke(object, path15, args2) {
|
|
38598
|
+
path15 = castPath(path15, object);
|
|
38599
|
+
object = parent(object, path15);
|
|
38600
|
+
var func = object == null ? object : object[toKey(last5(path15))];
|
|
38601
38601
|
return func == null ? undefined2 : apply(func, object, args2);
|
|
38602
38602
|
}
|
|
38603
38603
|
function baseIsArguments(value5) {
|
|
@@ -38753,13 +38753,13 @@ var require_lodash = __commonJS({
|
|
|
38753
38753
|
return object === source || baseIsMatch(object, source, matchData);
|
|
38754
38754
|
};
|
|
38755
38755
|
}
|
|
38756
|
-
function baseMatchesProperty(
|
|
38757
|
-
if (isKey(
|
|
38758
|
-
return matchesStrictComparable(toKey(
|
|
38756
|
+
function baseMatchesProperty(path15, srcValue) {
|
|
38757
|
+
if (isKey(path15) && isStrictComparable(srcValue)) {
|
|
38758
|
+
return matchesStrictComparable(toKey(path15), srcValue);
|
|
38759
38759
|
}
|
|
38760
38760
|
return function(object) {
|
|
38761
|
-
var objValue = get16(object,
|
|
38762
|
-
return objValue === undefined2 && objValue === srcValue ? hasIn(object,
|
|
38761
|
+
var objValue = get16(object, path15);
|
|
38762
|
+
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path15) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
38763
38763
|
};
|
|
38764
38764
|
}
|
|
38765
38765
|
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
@@ -38856,23 +38856,23 @@ var require_lodash = __commonJS({
|
|
|
38856
38856
|
});
|
|
38857
38857
|
}
|
|
38858
38858
|
function basePick(object, paths) {
|
|
38859
|
-
return basePickBy(object, paths, function(value5,
|
|
38860
|
-
return hasIn(object,
|
|
38859
|
+
return basePickBy(object, paths, function(value5, path15) {
|
|
38860
|
+
return hasIn(object, path15);
|
|
38861
38861
|
});
|
|
38862
38862
|
}
|
|
38863
38863
|
function basePickBy(object, paths, predicate) {
|
|
38864
38864
|
var index = -1, length4 = paths.length, result2 = {};
|
|
38865
38865
|
while (++index < length4) {
|
|
38866
|
-
var
|
|
38867
|
-
if (predicate(value5,
|
|
38868
|
-
baseSet(result2, castPath(
|
|
38866
|
+
var path15 = paths[index], value5 = baseGet(object, path15);
|
|
38867
|
+
if (predicate(value5, path15)) {
|
|
38868
|
+
baseSet(result2, castPath(path15, object), value5);
|
|
38869
38869
|
}
|
|
38870
38870
|
}
|
|
38871
38871
|
return result2;
|
|
38872
38872
|
}
|
|
38873
|
-
function basePropertyDeep(
|
|
38873
|
+
function basePropertyDeep(path15) {
|
|
38874
38874
|
return function(object) {
|
|
38875
|
-
return baseGet(object,
|
|
38875
|
+
return baseGet(object, path15);
|
|
38876
38876
|
};
|
|
38877
38877
|
}
|
|
38878
38878
|
function basePullAll(array9, values4, iteratee2, comparator) {
|
|
@@ -38946,14 +38946,14 @@ var require_lodash = __commonJS({
|
|
|
38946
38946
|
var array9 = values3(collection);
|
|
38947
38947
|
return shuffleSelf(array9, baseClamp(n, 0, array9.length));
|
|
38948
38948
|
}
|
|
38949
|
-
function baseSet(object,
|
|
38949
|
+
function baseSet(object, path15, value5, customizer) {
|
|
38950
38950
|
if (!isObject2(object)) {
|
|
38951
38951
|
return object;
|
|
38952
38952
|
}
|
|
38953
|
-
|
|
38954
|
-
var index = -1, length4 =
|
|
38953
|
+
path15 = castPath(path15, object);
|
|
38954
|
+
var index = -1, length4 = path15.length, lastIndex = length4 - 1, nested6 = object;
|
|
38955
38955
|
while (nested6 != null && ++index < length4) {
|
|
38956
|
-
var key = toKey(
|
|
38956
|
+
var key = toKey(path15[index]), newValue = value5;
|
|
38957
38957
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
38958
38958
|
return object;
|
|
38959
38959
|
}
|
|
@@ -38961,7 +38961,7 @@ var require_lodash = __commonJS({
|
|
|
38961
38961
|
var objValue = nested6[key];
|
|
38962
38962
|
newValue = customizer ? customizer(objValue, key, nested6) : undefined2;
|
|
38963
38963
|
if (newValue === undefined2) {
|
|
38964
|
-
newValue = isObject2(objValue) ? objValue : isIndex(
|
|
38964
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path15[index + 1]) ? [] : {};
|
|
38965
38965
|
}
|
|
38966
38966
|
}
|
|
38967
38967
|
assignValue(nested6, key, newValue);
|
|
@@ -39127,13 +39127,13 @@ var require_lodash = __commonJS({
|
|
|
39127
39127
|
}
|
|
39128
39128
|
return result2;
|
|
39129
39129
|
}
|
|
39130
|
-
function baseUnset(object,
|
|
39131
|
-
|
|
39132
|
-
object = parent(object,
|
|
39133
|
-
return object == null || delete object[toKey(last5(
|
|
39130
|
+
function baseUnset(object, path15) {
|
|
39131
|
+
path15 = castPath(path15, object);
|
|
39132
|
+
object = parent(object, path15);
|
|
39133
|
+
return object == null || delete object[toKey(last5(path15))];
|
|
39134
39134
|
}
|
|
39135
|
-
function baseUpdate(object,
|
|
39136
|
-
return baseSet(object,
|
|
39135
|
+
function baseUpdate(object, path15, updater, customizer) {
|
|
39136
|
+
return baseSet(object, path15, updater(baseGet(object, path15)), customizer);
|
|
39137
39137
|
}
|
|
39138
39138
|
function baseWhile(array9, predicate, isDrop, fromRight) {
|
|
39139
39139
|
var length4 = array9.length, index = fromRight ? length4 : -1;
|
|
@@ -40016,11 +40016,11 @@ var require_lodash = __commonJS({
|
|
|
40016
40016
|
var match18 = source.match(reWrapDetails);
|
|
40017
40017
|
return match18 ? match18[1].split(reSplitDetails) : [];
|
|
40018
40018
|
}
|
|
40019
|
-
function hasPath(object,
|
|
40020
|
-
|
|
40021
|
-
var index = -1, length4 =
|
|
40019
|
+
function hasPath(object, path15, hasFunc) {
|
|
40020
|
+
path15 = castPath(path15, object);
|
|
40021
|
+
var index = -1, length4 = path15.length, result2 = false;
|
|
40022
40022
|
while (++index < length4) {
|
|
40023
|
-
var key = toKey(
|
|
40023
|
+
var key = toKey(path15[index]);
|
|
40024
40024
|
if (!(result2 = object != null && hasFunc(object, key))) {
|
|
40025
40025
|
break;
|
|
40026
40026
|
}
|
|
@@ -40222,8 +40222,8 @@ var require_lodash = __commonJS({
|
|
|
40222
40222
|
return apply(func, this, otherArgs);
|
|
40223
40223
|
};
|
|
40224
40224
|
}
|
|
40225
|
-
function parent(object,
|
|
40226
|
-
return
|
|
40225
|
+
function parent(object, path15) {
|
|
40226
|
+
return path15.length < 2 ? object : baseGet(object, baseSlice(path15, 0, -1));
|
|
40227
40227
|
}
|
|
40228
40228
|
function reorder(array9, indexes) {
|
|
40229
40229
|
var arrLength = array9.length, length4 = nativeMin(indexes.length, arrLength), oldArray = copyArray(array9);
|
|
@@ -40500,7 +40500,7 @@ var require_lodash = __commonJS({
|
|
|
40500
40500
|
}
|
|
40501
40501
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
40502
40502
|
});
|
|
40503
|
-
function
|
|
40503
|
+
function join16(array9, separator) {
|
|
40504
40504
|
return array9 == null ? "" : nativeJoin.call(array9, separator);
|
|
40505
40505
|
}
|
|
40506
40506
|
function last5(array9) {
|
|
@@ -40858,10 +40858,10 @@ var require_lodash = __commonJS({
|
|
|
40858
40858
|
}
|
|
40859
40859
|
return isString2(collection) ? fromIndex <= length4 && collection.indexOf(value5, fromIndex) > -1 : !!length4 && baseIndexOf(collection, value5, fromIndex) > -1;
|
|
40860
40860
|
}
|
|
40861
|
-
var invokeMap = baseRest(function(collection,
|
|
40862
|
-
var index = -1, isFunc = typeof
|
|
40861
|
+
var invokeMap = baseRest(function(collection, path15, args2) {
|
|
40862
|
+
var index = -1, isFunc = typeof path15 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
40863
40863
|
baseEach(collection, function(value5) {
|
|
40864
|
-
result2[++index] = isFunc ? apply(
|
|
40864
|
+
result2[++index] = isFunc ? apply(path15, value5, args2) : baseInvoke(value5, path15, args2);
|
|
40865
40865
|
});
|
|
40866
40866
|
return result2;
|
|
40867
40867
|
});
|
|
@@ -41513,15 +41513,15 @@ var require_lodash = __commonJS({
|
|
|
41513
41513
|
function functionsIn(object) {
|
|
41514
41514
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
41515
41515
|
}
|
|
41516
|
-
function get16(object,
|
|
41517
|
-
var result2 = object == null ? undefined2 : baseGet(object,
|
|
41516
|
+
function get16(object, path15, defaultValue) {
|
|
41517
|
+
var result2 = object == null ? undefined2 : baseGet(object, path15);
|
|
41518
41518
|
return result2 === undefined2 ? defaultValue : result2;
|
|
41519
41519
|
}
|
|
41520
|
-
function has8(object,
|
|
41521
|
-
return object != null && hasPath(object,
|
|
41520
|
+
function has8(object, path15) {
|
|
41521
|
+
return object != null && hasPath(object, path15, baseHas);
|
|
41522
41522
|
}
|
|
41523
|
-
function hasIn(object,
|
|
41524
|
-
return object != null && hasPath(object,
|
|
41523
|
+
function hasIn(object, path15) {
|
|
41524
|
+
return object != null && hasPath(object, path15, baseHasIn);
|
|
41525
41525
|
}
|
|
41526
41526
|
var invert2 = createInverter(function(result2, value5, key) {
|
|
41527
41527
|
if (value5 != null && typeof value5.toString != "function") {
|
|
@@ -41574,10 +41574,10 @@ var require_lodash = __commonJS({
|
|
|
41574
41574
|
return result2;
|
|
41575
41575
|
}
|
|
41576
41576
|
var isDeep = false;
|
|
41577
|
-
paths = arrayMap(paths, function(
|
|
41578
|
-
|
|
41579
|
-
isDeep || (isDeep =
|
|
41580
|
-
return
|
|
41577
|
+
paths = arrayMap(paths, function(path15) {
|
|
41578
|
+
path15 = castPath(path15, object);
|
|
41579
|
+
isDeep || (isDeep = path15.length > 1);
|
|
41580
|
+
return path15;
|
|
41581
41581
|
});
|
|
41582
41582
|
copyObject(object, getAllKeysIn(object), result2);
|
|
41583
41583
|
if (isDeep) {
|
|
@@ -41603,19 +41603,19 @@ var require_lodash = __commonJS({
|
|
|
41603
41603
|
return [prop];
|
|
41604
41604
|
});
|
|
41605
41605
|
predicate = getIteratee(predicate);
|
|
41606
|
-
return basePickBy(object, props, function(value5,
|
|
41607
|
-
return predicate(value5,
|
|
41606
|
+
return basePickBy(object, props, function(value5, path15) {
|
|
41607
|
+
return predicate(value5, path15[0]);
|
|
41608
41608
|
});
|
|
41609
41609
|
}
|
|
41610
|
-
function result(object,
|
|
41611
|
-
|
|
41612
|
-
var index = -1, length4 =
|
|
41610
|
+
function result(object, path15, defaultValue) {
|
|
41611
|
+
path15 = castPath(path15, object);
|
|
41612
|
+
var index = -1, length4 = path15.length;
|
|
41613
41613
|
if (!length4) {
|
|
41614
41614
|
length4 = 1;
|
|
41615
41615
|
object = undefined2;
|
|
41616
41616
|
}
|
|
41617
41617
|
while (++index < length4) {
|
|
41618
|
-
var value5 = object == null ? undefined2 : object[toKey(
|
|
41618
|
+
var value5 = object == null ? undefined2 : object[toKey(path15[index])];
|
|
41619
41619
|
if (value5 === undefined2) {
|
|
41620
41620
|
index = length4;
|
|
41621
41621
|
value5 = defaultValue;
|
|
@@ -41624,12 +41624,12 @@ var require_lodash = __commonJS({
|
|
|
41624
41624
|
}
|
|
41625
41625
|
return object;
|
|
41626
41626
|
}
|
|
41627
|
-
function set7(object,
|
|
41628
|
-
return object == null ? object : baseSet(object,
|
|
41627
|
+
function set7(object, path15, value5) {
|
|
41628
|
+
return object == null ? object : baseSet(object, path15, value5);
|
|
41629
41629
|
}
|
|
41630
|
-
function setWith(object,
|
|
41630
|
+
function setWith(object, path15, value5, customizer) {
|
|
41631
41631
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
41632
|
-
return object == null ? object : baseSet(object,
|
|
41632
|
+
return object == null ? object : baseSet(object, path15, value5, customizer);
|
|
41633
41633
|
}
|
|
41634
41634
|
var toPairs = createToPairs(keys6);
|
|
41635
41635
|
var toPairsIn = createToPairs(keysIn);
|
|
@@ -41651,15 +41651,15 @@ var require_lodash = __commonJS({
|
|
|
41651
41651
|
});
|
|
41652
41652
|
return accumulator;
|
|
41653
41653
|
}
|
|
41654
|
-
function unset(object,
|
|
41655
|
-
return object == null ? true : baseUnset(object,
|
|
41654
|
+
function unset(object, path15) {
|
|
41655
|
+
return object == null ? true : baseUnset(object, path15);
|
|
41656
41656
|
}
|
|
41657
|
-
function update5(object,
|
|
41658
|
-
return object == null ? object : baseUpdate(object,
|
|
41657
|
+
function update5(object, path15, updater) {
|
|
41658
|
+
return object == null ? object : baseUpdate(object, path15, castFunction(updater));
|
|
41659
41659
|
}
|
|
41660
|
-
function updateWith2(object,
|
|
41660
|
+
function updateWith2(object, path15, updater, customizer) {
|
|
41661
41661
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
41662
|
-
return object == null ? object : baseUpdate(object,
|
|
41662
|
+
return object == null ? object : baseUpdate(object, path15, castFunction(updater), customizer);
|
|
41663
41663
|
}
|
|
41664
41664
|
function values3(object) {
|
|
41665
41665
|
return object == null ? [] : baseValues(object, keys6(object));
|
|
@@ -42040,17 +42040,17 @@ var require_lodash = __commonJS({
|
|
|
42040
42040
|
function matches(source) {
|
|
42041
42041
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
|
42042
42042
|
}
|
|
42043
|
-
function matchesProperty(
|
|
42044
|
-
return baseMatchesProperty(
|
|
42043
|
+
function matchesProperty(path15, srcValue) {
|
|
42044
|
+
return baseMatchesProperty(path15, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
42045
42045
|
}
|
|
42046
|
-
var method = baseRest(function(
|
|
42046
|
+
var method = baseRest(function(path15, args2) {
|
|
42047
42047
|
return function(object) {
|
|
42048
|
-
return baseInvoke(object,
|
|
42048
|
+
return baseInvoke(object, path15, args2);
|
|
42049
42049
|
};
|
|
42050
42050
|
});
|
|
42051
42051
|
var methodOf = baseRest(function(object, args2) {
|
|
42052
|
-
return function(
|
|
42053
|
-
return baseInvoke(object,
|
|
42052
|
+
return function(path15) {
|
|
42053
|
+
return baseInvoke(object, path15, args2);
|
|
42054
42054
|
};
|
|
42055
42055
|
});
|
|
42056
42056
|
function mixin(object, source, options3) {
|
|
@@ -42097,12 +42097,12 @@ var require_lodash = __commonJS({
|
|
|
42097
42097
|
var over = createOver(arrayMap);
|
|
42098
42098
|
var overEvery = createOver(arrayEvery);
|
|
42099
42099
|
var overSome = createOver(arraySome);
|
|
42100
|
-
function property(
|
|
42101
|
-
return isKey(
|
|
42100
|
+
function property(path15) {
|
|
42101
|
+
return isKey(path15) ? baseProperty(toKey(path15)) : basePropertyDeep(path15);
|
|
42102
42102
|
}
|
|
42103
42103
|
function propertyOf(object) {
|
|
42104
|
-
return function(
|
|
42105
|
-
return object == null ? undefined2 : baseGet(object,
|
|
42104
|
+
return function(path15) {
|
|
42105
|
+
return object == null ? undefined2 : baseGet(object, path15);
|
|
42106
42106
|
};
|
|
42107
42107
|
}
|
|
42108
42108
|
var range4 = createRange();
|
|
@@ -42419,7 +42419,7 @@ var require_lodash = __commonJS({
|
|
|
42419
42419
|
lodash.isUndefined = isUndefined2;
|
|
42420
42420
|
lodash.isWeakMap = isWeakMap;
|
|
42421
42421
|
lodash.isWeakSet = isWeakSet;
|
|
42422
|
-
lodash.join =
|
|
42422
|
+
lodash.join = join16;
|
|
42423
42423
|
lodash.kebabCase = kebabCase4;
|
|
42424
42424
|
lodash.last = last5;
|
|
42425
42425
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -42555,12 +42555,12 @@ var require_lodash = __commonJS({
|
|
|
42555
42555
|
LazyWrapper.prototype.findLast = function(predicate) {
|
|
42556
42556
|
return this.reverse().find(predicate);
|
|
42557
42557
|
};
|
|
42558
|
-
LazyWrapper.prototype.invokeMap = baseRest(function(
|
|
42559
|
-
if (typeof
|
|
42558
|
+
LazyWrapper.prototype.invokeMap = baseRest(function(path15, args2) {
|
|
42559
|
+
if (typeof path15 == "function") {
|
|
42560
42560
|
return new LazyWrapper(this);
|
|
42561
42561
|
}
|
|
42562
42562
|
return this.map(function(value5) {
|
|
42563
|
-
return baseInvoke(value5,
|
|
42563
|
+
return baseInvoke(value5, path15, args2);
|
|
42564
42564
|
});
|
|
42565
42565
|
});
|
|
42566
42566
|
LazyWrapper.prototype.reject = function(predicate) {
|
|
@@ -45061,11 +45061,11 @@ var require_baseGet = __commonJS({
|
|
|
45061
45061
|
"node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js"(exports, module) {
|
|
45062
45062
|
var castPath = require_castPath();
|
|
45063
45063
|
var toKey = require_toKey();
|
|
45064
|
-
function baseGet(object,
|
|
45065
|
-
|
|
45066
|
-
var index = 0, length4 =
|
|
45064
|
+
function baseGet(object, path15) {
|
|
45065
|
+
path15 = castPath(path15, object);
|
|
45066
|
+
var index = 0, length4 = path15.length;
|
|
45067
45067
|
while (object != null && index < length4) {
|
|
45068
|
-
object = object[toKey(
|
|
45068
|
+
object = object[toKey(path15[index++])];
|
|
45069
45069
|
}
|
|
45070
45070
|
return index && index == length4 ? object : void 0;
|
|
45071
45071
|
}
|
|
@@ -45077,8 +45077,8 @@ var require_baseGet = __commonJS({
|
|
|
45077
45077
|
var require_get = __commonJS({
|
|
45078
45078
|
"node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js"(exports, module) {
|
|
45079
45079
|
var baseGet = require_baseGet();
|
|
45080
|
-
function get16(object,
|
|
45081
|
-
var result = object == null ? void 0 : baseGet(object,
|
|
45080
|
+
function get16(object, path15, defaultValue) {
|
|
45081
|
+
var result = object == null ? void 0 : baseGet(object, path15);
|
|
45082
45082
|
return result === void 0 ? defaultValue : result;
|
|
45083
45083
|
}
|
|
45084
45084
|
module.exports = get16;
|
|
@@ -45104,11 +45104,11 @@ var require_hasPath = __commonJS({
|
|
|
45104
45104
|
var isIndex = require_isIndex();
|
|
45105
45105
|
var isLength = require_isLength();
|
|
45106
45106
|
var toKey = require_toKey();
|
|
45107
|
-
function hasPath(object,
|
|
45108
|
-
|
|
45109
|
-
var index = -1, length4 =
|
|
45107
|
+
function hasPath(object, path15, hasFunc) {
|
|
45108
|
+
path15 = castPath(path15, object);
|
|
45109
|
+
var index = -1, length4 = path15.length, result = false;
|
|
45110
45110
|
while (++index < length4) {
|
|
45111
|
-
var key = toKey(
|
|
45111
|
+
var key = toKey(path15[index]);
|
|
45112
45112
|
if (!(result = object != null && hasFunc(object, key))) {
|
|
45113
45113
|
break;
|
|
45114
45114
|
}
|
|
@@ -45129,8 +45129,8 @@ var require_hasIn = __commonJS({
|
|
|
45129
45129
|
"node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/hasIn.js"(exports, module) {
|
|
45130
45130
|
var baseHasIn = require_baseHasIn();
|
|
45131
45131
|
var hasPath = require_hasPath();
|
|
45132
|
-
function hasIn(object,
|
|
45133
|
-
return object != null && hasPath(object,
|
|
45132
|
+
function hasIn(object, path15) {
|
|
45133
|
+
return object != null && hasPath(object, path15, baseHasIn);
|
|
45134
45134
|
}
|
|
45135
45135
|
module.exports = hasIn;
|
|
45136
45136
|
}
|
|
@@ -45148,13 +45148,13 @@ var require_baseMatchesProperty = __commonJS({
|
|
|
45148
45148
|
var toKey = require_toKey();
|
|
45149
45149
|
var COMPARE_PARTIAL_FLAG = 1;
|
|
45150
45150
|
var COMPARE_UNORDERED_FLAG = 2;
|
|
45151
|
-
function baseMatchesProperty(
|
|
45152
|
-
if (isKey(
|
|
45153
|
-
return matchesStrictComparable(toKey(
|
|
45151
|
+
function baseMatchesProperty(path15, srcValue) {
|
|
45152
|
+
if (isKey(path15) && isStrictComparable(srcValue)) {
|
|
45153
|
+
return matchesStrictComparable(toKey(path15), srcValue);
|
|
45154
45154
|
}
|
|
45155
45155
|
return function(object) {
|
|
45156
|
-
var objValue = get16(object,
|
|
45157
|
-
return objValue === void 0 && objValue === srcValue ? hasIn(object,
|
|
45156
|
+
var objValue = get16(object, path15);
|
|
45157
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object, path15) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
45158
45158
|
};
|
|
45159
45159
|
}
|
|
45160
45160
|
module.exports = baseMatchesProperty;
|
|
@@ -45177,9 +45177,9 @@ var require_baseProperty = __commonJS({
|
|
|
45177
45177
|
var require_basePropertyDeep = __commonJS({
|
|
45178
45178
|
"node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyDeep.js"(exports, module) {
|
|
45179
45179
|
var baseGet = require_baseGet();
|
|
45180
|
-
function basePropertyDeep(
|
|
45180
|
+
function basePropertyDeep(path15) {
|
|
45181
45181
|
return function(object) {
|
|
45182
|
-
return baseGet(object,
|
|
45182
|
+
return baseGet(object, path15);
|
|
45183
45183
|
};
|
|
45184
45184
|
}
|
|
45185
45185
|
module.exports = basePropertyDeep;
|
|
@@ -45193,8 +45193,8 @@ var require_property = __commonJS({
|
|
|
45193
45193
|
var basePropertyDeep = require_basePropertyDeep();
|
|
45194
45194
|
var isKey = require_isKey();
|
|
45195
45195
|
var toKey = require_toKey();
|
|
45196
|
-
function property(
|
|
45197
|
-
return isKey(
|
|
45196
|
+
function property(path15) {
|
|
45197
|
+
return isKey(path15) ? baseProperty(toKey(path15)) : basePropertyDeep(path15);
|
|
45198
45198
|
}
|
|
45199
45199
|
module.exports = property;
|
|
45200
45200
|
}
|
|
@@ -46467,10 +46467,10 @@ var require_isRemoteUrl = __commonJS({
|
|
|
46467
46467
|
var require_getSDKVersions = __commonJS({
|
|
46468
46468
|
"node_modules/.pnpm/cloudinary@2.7.0/node_modules/cloudinary/lib/utils/analytics/getSDKVersions.js"(exports, module) {
|
|
46469
46469
|
var fs = __require("fs");
|
|
46470
|
-
var
|
|
46470
|
+
var path15 = __require("path");
|
|
46471
46471
|
var sdkCode = "M";
|
|
46472
46472
|
function readSdkSemver() {
|
|
46473
|
-
const pkgJsonPath =
|
|
46473
|
+
const pkgJsonPath = path15.join(__dirname, "../../../package.json");
|
|
46474
46474
|
try {
|
|
46475
46475
|
const pkgJSONFile = fs.readFileSync(pkgJsonPath, "utf-8");
|
|
46476
46476
|
return JSON.parse(pkgJSONFile).version;
|
|
@@ -47688,11 +47688,11 @@ var require_utils2 = __commonJS({
|
|
|
47688
47688
|
if (!api_version || api_version.length === 0) {
|
|
47689
47689
|
throw new Error("api_version needs to be a non-empty string");
|
|
47690
47690
|
}
|
|
47691
|
-
return (
|
|
47691
|
+
return (path15 = [], options3 = []) => {
|
|
47692
47692
|
let cloudinary2 = ensureOption(options3, "upload_prefix", UPLOAD_PREFIX);
|
|
47693
47693
|
let cloud_name = ensureOption(options3, "cloud_name");
|
|
47694
47694
|
let encode_path = (unencoded_path) => encodeURIComponent(unencoded_path).replace("'", "%27");
|
|
47695
|
-
let encoded_path = Array.isArray(
|
|
47695
|
+
let encoded_path = Array.isArray(path15) ? path15.map(encode_path) : encode_path(path15);
|
|
47696
47696
|
return [cloudinary2, api_version, cloud_name].concat(encoded_path).join("/");
|
|
47697
47697
|
};
|
|
47698
47698
|
}
|
|
@@ -49595,19 +49595,19 @@ var require_uploader = __commonJS({
|
|
|
49595
49595
|
return isRemoteUrl(file6) ? [params, { file: file6 }] : [params, {}, file6];
|
|
49596
49596
|
});
|
|
49597
49597
|
};
|
|
49598
|
-
exports.upload_large = function upload_large(
|
|
49599
|
-
if (
|
|
49600
|
-
return exports.upload(
|
|
49598
|
+
exports.upload_large = function upload_large(path15, callback, options3 = {}) {
|
|
49599
|
+
if (path15 != null && isRemoteUrl(path15)) {
|
|
49600
|
+
return exports.upload(path15, callback, options3);
|
|
49601
49601
|
}
|
|
49602
|
-
if (
|
|
49603
|
-
options3.filename =
|
|
49602
|
+
if (path15 != null && !options3.filename) {
|
|
49603
|
+
options3.filename = path15.split(/(\\|\/)/g).pop().replace(/\.[^/.]+$/, "");
|
|
49604
49604
|
}
|
|
49605
|
-
return exports.upload_chunked(
|
|
49605
|
+
return exports.upload_chunked(path15, callback, extend5({
|
|
49606
49606
|
resource_type: "raw"
|
|
49607
49607
|
}, options3));
|
|
49608
49608
|
};
|
|
49609
|
-
exports.upload_chunked = function upload_chunked(
|
|
49610
|
-
let file_reader = fs.createReadStream(
|
|
49609
|
+
exports.upload_chunked = function upload_chunked(path15, callback, options3) {
|
|
49610
|
+
let file_reader = fs.createReadStream(path15);
|
|
49611
49611
|
let out_stream = exports.upload_chunked_stream(callback, options3);
|
|
49612
49612
|
return file_reader.pipe(out_stream);
|
|
49613
49613
|
};
|
|
@@ -50586,20 +50586,20 @@ var require_api2 = __commonJS({
|
|
|
50586
50586
|
params = pickOnlyExistingValues(options3, "next_cursor", "max_results");
|
|
50587
50587
|
return call_api("get", uri, params, callback, options3);
|
|
50588
50588
|
};
|
|
50589
|
-
exports.sub_folders = function sub_folders(
|
|
50589
|
+
exports.sub_folders = function sub_folders(path15, callback, options3 = {}) {
|
|
50590
50590
|
let uri, params;
|
|
50591
|
-
uri = ["folders",
|
|
50591
|
+
uri = ["folders", path15];
|
|
50592
50592
|
params = pickOnlyExistingValues(options3, "next_cursor", "max_results");
|
|
50593
50593
|
return call_api("get", uri, params, callback, options3);
|
|
50594
50594
|
};
|
|
50595
|
-
exports.create_folder = function create_folder(
|
|
50595
|
+
exports.create_folder = function create_folder(path15, callback, options3 = {}) {
|
|
50596
50596
|
let uri;
|
|
50597
|
-
uri = ["folders",
|
|
50597
|
+
uri = ["folders", path15];
|
|
50598
50598
|
return call_api("post", uri, {}, callback, options3);
|
|
50599
50599
|
};
|
|
50600
|
-
exports.delete_folder = function delete_folder(
|
|
50600
|
+
exports.delete_folder = function delete_folder(path15, callback, options3 = {}) {
|
|
50601
50601
|
let uri;
|
|
50602
|
-
uri = ["folders",
|
|
50602
|
+
uri = ["folders", path15];
|
|
50603
50603
|
return call_api("delete", uri, {}, callback, options3);
|
|
50604
50604
|
};
|
|
50605
50605
|
exports.rename_folder = function rename_folder(old_path, new_path, callback, options3 = {}) {
|
|
@@ -51776,7 +51776,7 @@ var require_package2 = __commonJS({
|
|
|
51776
51776
|
var require_main = __commonJS({
|
|
51777
51777
|
"node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports, module) {
|
|
51778
51778
|
var fs = __require("fs");
|
|
51779
|
-
var
|
|
51779
|
+
var path15 = __require("path");
|
|
51780
51780
|
var os = __require("os");
|
|
51781
51781
|
var crypto = __require("crypto");
|
|
51782
51782
|
var packageJson = require_package2();
|
|
@@ -51925,7 +51925,7 @@ var require_main = __commonJS({
|
|
|
51925
51925
|
possibleVaultPath = options3.path.endsWith(".vault") ? options3.path : `${options3.path}.vault`;
|
|
51926
51926
|
}
|
|
51927
51927
|
} else {
|
|
51928
|
-
possibleVaultPath =
|
|
51928
|
+
possibleVaultPath = path15.resolve(process.cwd(), ".env.vault");
|
|
51929
51929
|
}
|
|
51930
51930
|
if (fs.existsSync(possibleVaultPath)) {
|
|
51931
51931
|
return possibleVaultPath;
|
|
@@ -51933,7 +51933,7 @@ var require_main = __commonJS({
|
|
|
51933
51933
|
return null;
|
|
51934
51934
|
}
|
|
51935
51935
|
function _resolveHome(envPath) {
|
|
51936
|
-
return envPath[0] === "~" ?
|
|
51936
|
+
return envPath[0] === "~" ? path15.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
51937
51937
|
}
|
|
51938
51938
|
function _configVault(options3) {
|
|
51939
51939
|
const debug3 = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options3 && options3.debug);
|
|
@@ -51950,7 +51950,7 @@ var require_main = __commonJS({
|
|
|
51950
51950
|
return { parsed };
|
|
51951
51951
|
}
|
|
51952
51952
|
function configDotenv(options3) {
|
|
51953
|
-
const dotenvPath =
|
|
51953
|
+
const dotenvPath = path15.resolve(process.cwd(), ".env");
|
|
51954
51954
|
let encoding = "utf8";
|
|
51955
51955
|
let processEnv = process.env;
|
|
51956
51956
|
if (options3 && options3.processEnv != null) {
|
|
@@ -51978,13 +51978,13 @@ var require_main = __commonJS({
|
|
|
51978
51978
|
}
|
|
51979
51979
|
let lastError;
|
|
51980
51980
|
const parsedAll = {};
|
|
51981
|
-
for (const
|
|
51981
|
+
for (const path16 of optionPaths) {
|
|
51982
51982
|
try {
|
|
51983
|
-
const parsed = DotenvModule.parse(fs.readFileSync(
|
|
51983
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path16, { encoding }));
|
|
51984
51984
|
DotenvModule.populate(parsedAll, parsed, options3);
|
|
51985
51985
|
} catch (e) {
|
|
51986
51986
|
if (debug3) {
|
|
51987
|
-
_debug(`Failed to load ${
|
|
51987
|
+
_debug(`Failed to load ${path16} ${e.message}`);
|
|
51988
51988
|
}
|
|
51989
51989
|
lastError = e;
|
|
51990
51990
|
}
|
|
@@ -51997,7 +51997,7 @@ var require_main = __commonJS({
|
|
|
51997
51997
|
const shortPaths = [];
|
|
51998
51998
|
for (const filePath of optionPaths) {
|
|
51999
51999
|
try {
|
|
52000
|
-
const relative3 =
|
|
52000
|
+
const relative3 = path15.relative(process.cwd(), filePath);
|
|
52001
52001
|
shortPaths.push(relative3);
|
|
52002
52002
|
} catch (e) {
|
|
52003
52003
|
if (debug3) {
|
|
@@ -59079,67 +59079,67 @@ var Or = (self2, that) => {
|
|
|
59079
59079
|
});
|
|
59080
59080
|
return error4;
|
|
59081
59081
|
};
|
|
59082
|
-
var InvalidData = (
|
|
59082
|
+
var InvalidData = (path15, message, options3 = {
|
|
59083
59083
|
pathDelim: "."
|
|
59084
59084
|
}) => {
|
|
59085
59085
|
const error4 = Object.create(proto2);
|
|
59086
59086
|
error4._op = OP_INVALID_DATA;
|
|
59087
|
-
error4.path =
|
|
59087
|
+
error4.path = path15;
|
|
59088
59088
|
error4.message = message;
|
|
59089
59089
|
Object.defineProperty(error4, "toString", {
|
|
59090
59090
|
enumerable: false,
|
|
59091
59091
|
value() {
|
|
59092
|
-
const
|
|
59093
|
-
return `(Invalid data at ${
|
|
59092
|
+
const path16 = pipe(this.path, join(options3.pathDelim));
|
|
59093
|
+
return `(Invalid data at ${path16}: "${this.message}")`;
|
|
59094
59094
|
}
|
|
59095
59095
|
});
|
|
59096
59096
|
return error4;
|
|
59097
59097
|
};
|
|
59098
|
-
var MissingData = (
|
|
59098
|
+
var MissingData = (path15, message, options3 = {
|
|
59099
59099
|
pathDelim: "."
|
|
59100
59100
|
}) => {
|
|
59101
59101
|
const error4 = Object.create(proto2);
|
|
59102
59102
|
error4._op = OP_MISSING_DATA;
|
|
59103
|
-
error4.path =
|
|
59103
|
+
error4.path = path15;
|
|
59104
59104
|
error4.message = message;
|
|
59105
59105
|
Object.defineProperty(error4, "toString", {
|
|
59106
59106
|
enumerable: false,
|
|
59107
59107
|
value() {
|
|
59108
|
-
const
|
|
59109
|
-
return `(Missing data at ${
|
|
59108
|
+
const path16 = pipe(this.path, join(options3.pathDelim));
|
|
59109
|
+
return `(Missing data at ${path16}: "${this.message}")`;
|
|
59110
59110
|
}
|
|
59111
59111
|
});
|
|
59112
59112
|
return error4;
|
|
59113
59113
|
};
|
|
59114
|
-
var SourceUnavailable = (
|
|
59114
|
+
var SourceUnavailable = (path15, message, cause3, options3 = {
|
|
59115
59115
|
pathDelim: "."
|
|
59116
59116
|
}) => {
|
|
59117
59117
|
const error4 = Object.create(proto2);
|
|
59118
59118
|
error4._op = OP_SOURCE_UNAVAILABLE;
|
|
59119
|
-
error4.path =
|
|
59119
|
+
error4.path = path15;
|
|
59120
59120
|
error4.message = message;
|
|
59121
59121
|
error4.cause = cause3;
|
|
59122
59122
|
Object.defineProperty(error4, "toString", {
|
|
59123
59123
|
enumerable: false,
|
|
59124
59124
|
value() {
|
|
59125
|
-
const
|
|
59126
|
-
return `(Source unavailable at ${
|
|
59125
|
+
const path16 = pipe(this.path, join(options3.pathDelim));
|
|
59126
|
+
return `(Source unavailable at ${path16}: "${this.message}")`;
|
|
59127
59127
|
}
|
|
59128
59128
|
});
|
|
59129
59129
|
return error4;
|
|
59130
59130
|
};
|
|
59131
|
-
var Unsupported = (
|
|
59131
|
+
var Unsupported = (path15, message, options3 = {
|
|
59132
59132
|
pathDelim: "."
|
|
59133
59133
|
}) => {
|
|
59134
59134
|
const error4 = Object.create(proto2);
|
|
59135
59135
|
error4._op = OP_UNSUPPORTED;
|
|
59136
|
-
error4.path =
|
|
59136
|
+
error4.path = path15;
|
|
59137
59137
|
error4.message = message;
|
|
59138
59138
|
Object.defineProperty(error4, "toString", {
|
|
59139
59139
|
enumerable: false,
|
|
59140
59140
|
value() {
|
|
59141
|
-
const
|
|
59142
|
-
return `(Unsupported operation at ${
|
|
59141
|
+
const path16 = pipe(this.path, join(options3.pathDelim));
|
|
59142
|
+
return `(Unsupported operation at ${path16}: "${this.message}")`;
|
|
59143
59143
|
}
|
|
59144
59144
|
});
|
|
59145
59145
|
return error4;
|
|
@@ -59272,9 +59272,9 @@ var unnested = /* @__PURE__ */ dual(2, (self2, name) => andThen5(self2, {
|
|
|
59272
59272
|
_tag: "Unnested",
|
|
59273
59273
|
name
|
|
59274
59274
|
}));
|
|
59275
|
-
var patch5 = /* @__PURE__ */ dual(2, (
|
|
59275
|
+
var patch5 = /* @__PURE__ */ dual(2, (path15, patch9) => {
|
|
59276
59276
|
let input = of3(patch9);
|
|
59277
|
-
let output =
|
|
59277
|
+
let output = path15;
|
|
59278
59278
|
while (isCons(input)) {
|
|
59279
59279
|
const patch10 = input.head;
|
|
59280
59280
|
switch (patch10._tag) {
|
|
@@ -59379,7 +59379,7 @@ var make21 = (options3) => ({
|
|
|
59379
59379
|
var makeFlat = (options3) => ({
|
|
59380
59380
|
[FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
|
|
59381
59381
|
patch: options3.patch,
|
|
59382
|
-
load: (
|
|
59382
|
+
load: (path15, config3, split3 = true) => options3.load(path15, config3, split3),
|
|
59383
59383
|
enumerateChildren: options3.enumerateChildren
|
|
59384
59384
|
});
|
|
59385
59385
|
var fromFlat = (flat) => make21({
|
|
@@ -59397,29 +59397,29 @@ var fromEnv = (options3) => {
|
|
|
59397
59397
|
pathDelim: "_",
|
|
59398
59398
|
seqDelim: ","
|
|
59399
59399
|
}, options3);
|
|
59400
|
-
const makePathString = (
|
|
59400
|
+
const makePathString = (path15) => pipe(path15, join(pathDelim));
|
|
59401
59401
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
59402
59402
|
const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
|
|
59403
|
-
const load = (
|
|
59404
|
-
const pathString = makePathString(
|
|
59403
|
+
const load = (path15, primitive3, split3 = true) => {
|
|
59404
|
+
const pathString = makePathString(path15);
|
|
59405
59405
|
const current = getEnv();
|
|
59406
59406
|
const valueOpt = pathString in current ? some2(current[pathString]) : none2();
|
|
59407
|
-
return pipe(valueOpt, mapError(() => MissingData(
|
|
59407
|
+
return pipe(valueOpt, mapError(() => MissingData(path15, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path15, primitive3, seqDelim, split3)));
|
|
59408
59408
|
};
|
|
59409
|
-
const enumerateChildren = (
|
|
59409
|
+
const enumerateChildren = (path15) => sync(() => {
|
|
59410
59410
|
const current = getEnv();
|
|
59411
59411
|
const keys6 = Object.keys(current);
|
|
59412
59412
|
const keyPaths = keys6.map((value5) => unmakePathString(value5.toUpperCase()));
|
|
59413
59413
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
59414
|
-
for (let i = 0; i <
|
|
59415
|
-
const pathComponent = pipe(
|
|
59414
|
+
for (let i = 0; i < path15.length; i++) {
|
|
59415
|
+
const pathComponent = pipe(path15, unsafeGet(i));
|
|
59416
59416
|
const currentElement = keyPath[i];
|
|
59417
59417
|
if (currentElement === void 0 || pathComponent !== currentElement) {
|
|
59418
59418
|
return false;
|
|
59419
59419
|
}
|
|
59420
59420
|
}
|
|
59421
59421
|
return true;
|
|
59422
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
59422
|
+
}).flatMap((keyPath) => keyPath.slice(path15.length, path15.length + 1));
|
|
59423
59423
|
return fromIterable6(filteredKeyPaths);
|
|
59424
59424
|
});
|
|
59425
59425
|
return fromFlat(makeFlat({
|
|
@@ -59436,26 +59436,26 @@ var fromMap = (map38, config3) => {
|
|
|
59436
59436
|
seqDelim: ",",
|
|
59437
59437
|
pathDelim: "."
|
|
59438
59438
|
}, config3);
|
|
59439
|
-
const makePathString = (
|
|
59439
|
+
const makePathString = (path15) => pipe(path15, join(pathDelim));
|
|
59440
59440
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
59441
59441
|
const mapWithIndexSplit = splitIndexInKeys(map38, (str) => unmakePathString(str), makePathString);
|
|
59442
|
-
const load = (
|
|
59443
|
-
const pathString = makePathString(
|
|
59442
|
+
const load = (path15, primitive3, split3 = true) => {
|
|
59443
|
+
const pathString = makePathString(path15);
|
|
59444
59444
|
const valueOpt = mapWithIndexSplit.has(pathString) ? some2(mapWithIndexSplit.get(pathString)) : none2();
|
|
59445
|
-
return pipe(valueOpt, mapError(() => MissingData(
|
|
59445
|
+
return pipe(valueOpt, mapError(() => MissingData(path15, `Expected ${pathString} to exist in the provided map`)), flatMap7((value5) => parsePrimitive(value5, path15, primitive3, seqDelim, split3)));
|
|
59446
59446
|
};
|
|
59447
|
-
const enumerateChildren = (
|
|
59447
|
+
const enumerateChildren = (path15) => sync(() => {
|
|
59448
59448
|
const keyPaths = fromIterable2(mapWithIndexSplit.keys()).map(unmakePathString);
|
|
59449
59449
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
59450
|
-
for (let i = 0; i <
|
|
59451
|
-
const pathComponent = pipe(
|
|
59450
|
+
for (let i = 0; i < path15.length; i++) {
|
|
59451
|
+
const pathComponent = pipe(path15, unsafeGet(i));
|
|
59452
59452
|
const currentElement = keyPath[i];
|
|
59453
59453
|
if (currentElement === void 0 || pathComponent !== currentElement) {
|
|
59454
59454
|
return false;
|
|
59455
59455
|
}
|
|
59456
59456
|
}
|
|
59457
59457
|
return true;
|
|
59458
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
59458
|
+
}).flatMap((keyPath) => keyPath.slice(path15.length, path15.length + 1));
|
|
59459
59459
|
return fromIterable6(filteredKeyPaths);
|
|
59460
59460
|
});
|
|
59461
59461
|
return fromFlat(makeFlat({
|
|
@@ -59471,17 +59471,17 @@ var extend2 = (leftDef, rightDef, left3, right3) => {
|
|
|
59471
59471
|
const rightExtension = concat(right3, rightPad);
|
|
59472
59472
|
return [leftExtension, rightExtension];
|
|
59473
59473
|
};
|
|
59474
|
-
var appendConfigPath = (
|
|
59474
|
+
var appendConfigPath = (path15, config3) => {
|
|
59475
59475
|
let op = config3;
|
|
59476
59476
|
if (op._tag === "Nested") {
|
|
59477
|
-
const out =
|
|
59477
|
+
const out = path15.slice();
|
|
59478
59478
|
while (op._tag === "Nested") {
|
|
59479
59479
|
out.push(op.name);
|
|
59480
59480
|
op = op.config;
|
|
59481
59481
|
}
|
|
59482
59482
|
return out;
|
|
59483
59483
|
}
|
|
59484
|
-
return
|
|
59484
|
+
return path15;
|
|
59485
59485
|
};
|
|
59486
59486
|
var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
59487
59487
|
const op = config3;
|
|
@@ -59557,8 +59557,8 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
|
59557
59557
|
return fail2(right3.left);
|
|
59558
59558
|
}
|
|
59559
59559
|
if (isRight2(left3) && isRight2(right3)) {
|
|
59560
|
-
const
|
|
59561
|
-
const fail21 = fromFlatLoopFail(prefix,
|
|
59560
|
+
const path15 = pipe(prefix, join("."));
|
|
59561
|
+
const fail21 = fromFlatLoopFail(prefix, path15);
|
|
59562
59562
|
const [lefts, rights] = extend2(fail21, fail21, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
|
|
59563
59563
|
return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
|
|
59564
59564
|
}
|
|
@@ -59567,27 +59567,27 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
|
59567
59567
|
}
|
|
59568
59568
|
}
|
|
59569
59569
|
};
|
|
59570
|
-
var fromFlatLoopFail = (prefix,
|
|
59570
|
+
var fromFlatLoopFail = (prefix, path15) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path15}" was missing`));
|
|
59571
59571
|
var mapInputPath = /* @__PURE__ */ dual(2, (self2, f) => fromFlat(mapInputPathFlat(self2.flattened, f)));
|
|
59572
59572
|
var mapInputPathFlat = (self2, f) => makeFlat({
|
|
59573
|
-
load: (
|
|
59574
|
-
enumerateChildren: (
|
|
59573
|
+
load: (path15, config3, split3 = true) => self2.load(path15, config3, split3),
|
|
59574
|
+
enumerateChildren: (path15) => self2.enumerateChildren(path15),
|
|
59575
59575
|
patch: mapName(self2.patch, f)
|
|
59576
59576
|
});
|
|
59577
59577
|
var nested2 = /* @__PURE__ */ dual(2, (self2, name) => fromFlat(makeFlat({
|
|
59578
|
-
load: (
|
|
59579
|
-
enumerateChildren: (
|
|
59578
|
+
load: (path15, config3) => self2.flattened.load(path15, config3, true),
|
|
59579
|
+
enumerateChildren: (path15) => self2.flattened.enumerateChildren(path15),
|
|
59580
59580
|
patch: nested(self2.flattened.patch, name)
|
|
59581
59581
|
})));
|
|
59582
59582
|
var unnested2 = /* @__PURE__ */ dual(2, (self2, name) => fromFlat(makeFlat({
|
|
59583
|
-
load: (
|
|
59584
|
-
enumerateChildren: (
|
|
59583
|
+
load: (path15, config3) => self2.flattened.load(path15, config3, true),
|
|
59584
|
+
enumerateChildren: (path15) => self2.flattened.enumerateChildren(path15),
|
|
59585
59585
|
patch: unnested(self2.flattened.patch, name)
|
|
59586
59586
|
})));
|
|
59587
59587
|
var orElse3 = /* @__PURE__ */ dual(2, (self2, that) => fromFlat(orElseFlat(self2.flattened, () => that().flattened)));
|
|
59588
59588
|
var orElseFlat = (self2, that) => makeFlat({
|
|
59589
|
-
load: (
|
|
59590
|
-
enumerateChildren: (
|
|
59589
|
+
load: (path15, config3, split3) => pipe(patch5(path15, self2.patch), flatMap7((patch9) => self2.load(patch9, config3, split3)), catchAll((error1) => pipe(sync(that), flatMap7((that2) => pipe(patch5(path15, that2.patch), flatMap7((patch9) => that2.load(patch9, config3, split3)), catchAll((error22) => fail2(Or(error1, error22)))))))),
|
|
59590
|
+
enumerateChildren: (path15) => pipe(patch5(path15, self2.patch), flatMap7((patch9) => self2.enumerateChildren(patch9)), either2, flatMap7((left3) => pipe(sync(that), flatMap7((that2) => pipe(patch5(path15, that2.patch), flatMap7((patch9) => that2.enumerateChildren(patch9)), either2, flatMap7((right3) => {
|
|
59591
59591
|
if (isLeft2(left3) && isLeft2(right3)) {
|
|
59592
59592
|
return fail2(And(left3.left, right3.left));
|
|
59593
59593
|
}
|
|
@@ -59609,23 +59609,23 @@ var kebabCase2 = (self2) => mapInputPath(self2, kebabCase);
|
|
|
59609
59609
|
var lowerCase2 = (self2) => mapInputPath(self2, lowerCase);
|
|
59610
59610
|
var snakeCase2 = (self2) => mapInputPath(self2, snakeCase);
|
|
59611
59611
|
var upperCase2 = (self2) => mapInputPath(self2, upperCase);
|
|
59612
|
-
var within = /* @__PURE__ */ dual(3, (self2,
|
|
59613
|
-
const unnest = reduce(
|
|
59614
|
-
const nest3 = reduceRight(
|
|
59612
|
+
var within = /* @__PURE__ */ dual(3, (self2, path15, f) => {
|
|
59613
|
+
const unnest = reduce(path15, self2, (provider, name) => unnested2(provider, name));
|
|
59614
|
+
const nest3 = reduceRight(path15, f(unnest), (provider, name) => nested2(provider, name));
|
|
59615
59615
|
return orElse3(nest3, () => self2);
|
|
59616
59616
|
});
|
|
59617
59617
|
var splitPathString = (text11, delim) => {
|
|
59618
59618
|
const split3 = text11.split(new RegExp(`\\s*${escape(delim)}\\s*`));
|
|
59619
59619
|
return split3;
|
|
59620
59620
|
};
|
|
59621
|
-
var parsePrimitive = (text11,
|
|
59621
|
+
var parsePrimitive = (text11, path15, primitive3, delimiter, split3) => {
|
|
59622
59622
|
if (!split3) {
|
|
59623
59623
|
return pipe(primitive3.parse(text11), mapBoth2({
|
|
59624
|
-
onFailure: prefixed(
|
|
59624
|
+
onFailure: prefixed(path15),
|
|
59625
59625
|
onSuccess: of
|
|
59626
59626
|
}));
|
|
59627
59627
|
}
|
|
59628
|
-
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive3.parse(char4.trim())), mapError(prefixed(
|
|
59628
|
+
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive3.parse(char4.trim())), mapError(prefixed(path15)));
|
|
59629
59629
|
};
|
|
59630
59630
|
var transpose = (array9) => {
|
|
59631
59631
|
return Object.keys(array9[0]).map((column3) => array9.map((row) => row[column3]));
|
|
@@ -59686,14 +59686,14 @@ var fromJson = (json2) => {
|
|
|
59686
59686
|
seqDelim: hiddenDelimiter
|
|
59687
59687
|
});
|
|
59688
59688
|
};
|
|
59689
|
-
var configPathToString = (
|
|
59689
|
+
var configPathToString = (path15) => {
|
|
59690
59690
|
const output = [];
|
|
59691
59691
|
let i = 0;
|
|
59692
|
-
while (i <
|
|
59693
|
-
const component =
|
|
59692
|
+
while (i < path15.length) {
|
|
59693
|
+
const component = path15[i];
|
|
59694
59694
|
if (component._tag === "KeyName") {
|
|
59695
|
-
if (i + 1 <
|
|
59696
|
-
const nextComponent =
|
|
59695
|
+
if (i + 1 < path15.length) {
|
|
59696
|
+
const nextComponent = path15[i + 1];
|
|
59697
59697
|
if (nextComponent._tag === "KeyIndex") {
|
|
59698
59698
|
output.push(`${component.name}[${nextComponent.index}]`);
|
|
59699
59699
|
i += 2;
|
|
@@ -59710,27 +59710,27 @@ var configPathToString = (path14) => {
|
|
|
59710
59710
|
return output;
|
|
59711
59711
|
};
|
|
59712
59712
|
var getIndexedEntries = (config3) => {
|
|
59713
|
-
const loopAny = (
|
|
59713
|
+
const loopAny = (path15, value5) => {
|
|
59714
59714
|
if (typeof value5 === "string") {
|
|
59715
|
-
return make4([
|
|
59715
|
+
return make4([path15, value5]);
|
|
59716
59716
|
}
|
|
59717
59717
|
if (typeof value5 === "number" || typeof value5 === "boolean") {
|
|
59718
|
-
return make4([
|
|
59718
|
+
return make4([path15, String(value5)]);
|
|
59719
59719
|
}
|
|
59720
59720
|
if (isArray(value5)) {
|
|
59721
|
-
return loopArray(
|
|
59721
|
+
return loopArray(path15, value5);
|
|
59722
59722
|
}
|
|
59723
59723
|
if (typeof value5 === "object" && value5 !== null) {
|
|
59724
|
-
return loopObject(
|
|
59724
|
+
return loopObject(path15, value5);
|
|
59725
59725
|
}
|
|
59726
59726
|
return empty3();
|
|
59727
59727
|
};
|
|
59728
|
-
const loopArray = (
|
|
59729
|
-
onEmpty: () => make4([
|
|
59730
|
-
onNonEmpty: flatMap2((value5, index) => loopAny(append(
|
|
59728
|
+
const loopArray = (path15, values3) => match3(values3, {
|
|
59729
|
+
onEmpty: () => make4([path15, "<nil>"]),
|
|
59730
|
+
onNonEmpty: flatMap2((value5, index) => loopAny(append(path15, keyIndex(index)), value5))
|
|
59731
59731
|
});
|
|
59732
|
-
const loopObject = (
|
|
59733
|
-
const newPath = append(
|
|
59732
|
+
const loopObject = (path15, value5) => Object.entries(value5).filter(([, value6]) => isNotNullable(value6)).flatMap(([key, value6]) => {
|
|
59733
|
+
const newPath = append(path15, keyName(key));
|
|
59734
59734
|
const result = loopAny(newPath, value6);
|
|
59735
59735
|
if (isEmptyReadonlyArray(result)) {
|
|
59736
59736
|
return make4([newPath, ""]);
|
|
@@ -68434,14 +68434,14 @@ var formatPropertyKey = (name) => typeof name === "string" ? JSON.stringify(name
|
|
|
68434
68434
|
var isNonEmpty5 = (x) => Array.isArray(x);
|
|
68435
68435
|
var isSingle = (x) => !Array.isArray(x);
|
|
68436
68436
|
var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
|
|
68437
|
-
var formatPath = (
|
|
68437
|
+
var formatPath = (path15) => isNonEmpty5(path15) ? path15.map(formatPathKey).join("") : formatPathKey(path15);
|
|
68438
68438
|
|
|
68439
68439
|
// node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/internal/schema/errors.js
|
|
68440
|
-
var getErrorMessage = (reason, details,
|
|
68440
|
+
var getErrorMessage = (reason, details, path15, ast) => {
|
|
68441
68441
|
let out = reason;
|
|
68442
|
-
if (
|
|
68442
|
+
if (path15 && isNonEmptyReadonlyArray(path15)) {
|
|
68443
68443
|
out += `
|
|
68444
|
-
at path: ${formatPath(
|
|
68444
|
+
at path: ${formatPath(path15)}`;
|
|
68445
68445
|
}
|
|
68446
68446
|
if (details !== void 0) {
|
|
68447
68447
|
out += `
|
|
@@ -68453,7 +68453,7 @@ schema (${ast._tag}): ${ast}`;
|
|
|
68453
68453
|
}
|
|
68454
68454
|
return out;
|
|
68455
68455
|
};
|
|
68456
|
-
var getSchemaExtendErrorMessage = (x, y,
|
|
68456
|
+
var getSchemaExtendErrorMessage = (x, y, path15) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path15);
|
|
68457
68457
|
var getASTUnsupportedKeySchemaErrorMessage = (ast) => getErrorMessage("Unsupported key schema", void 0, void 0, ast);
|
|
68458
68458
|
var getASTUnsupportedLiteralErrorMessage = (literal3) => getErrorMessage("Unsupported literal", `literal value: ${formatUnknown(literal3)}`);
|
|
68459
68459
|
var getASTDuplicateIndexSignatureErrorMessage = (type2) => getErrorMessage("Duplicate index signature", `${type2} index signature`);
|
|
@@ -69638,8 +69638,8 @@ var Pointer = class {
|
|
|
69638
69638
|
* @since 3.10.0
|
|
69639
69639
|
*/
|
|
69640
69640
|
_tag = "Pointer";
|
|
69641
|
-
constructor(
|
|
69642
|
-
this.path =
|
|
69641
|
+
constructor(path15, actual, issue) {
|
|
69642
|
+
this.path = path15;
|
|
69643
69643
|
this.actual = actual;
|
|
69644
69644
|
this.issue = issue;
|
|
69645
69645
|
}
|
|
@@ -74319,7 +74319,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
74319
74319
|
function Struct(fields, ...records) {
|
|
74320
74320
|
return makeTypeLiteralClass(fields, records);
|
|
74321
74321
|
}
|
|
74322
|
-
var intersectTypeLiterals = (x, y,
|
|
74322
|
+
var intersectTypeLiterals = (x, y, path15) => {
|
|
74323
74323
|
if (isTypeLiteral(x) && isTypeLiteral(y)) {
|
|
74324
74324
|
const propertySignatures = [...x.propertySignatures];
|
|
74325
74325
|
for (const ps of y.propertySignatures) {
|
|
@@ -74332,18 +74332,18 @@ var intersectTypeLiterals = (x, y, path14) => {
|
|
|
74332
74332
|
isOptional,
|
|
74333
74333
|
type: type2
|
|
74334
74334
|
} = propertySignatures[i];
|
|
74335
|
-
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type,
|
|
74335
|
+
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path15.concat(name)), isOptional, true);
|
|
74336
74336
|
}
|
|
74337
74337
|
}
|
|
74338
74338
|
return new TypeLiteral(propertySignatures, x.indexSignatures.concat(y.indexSignatures));
|
|
74339
74339
|
}
|
|
74340
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
74340
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path15));
|
|
74341
74341
|
};
|
|
74342
74342
|
var preserveRefinementAnnotations = /* @__PURE__ */ omitAnnotations([IdentifierAnnotationId]);
|
|
74343
74343
|
var addRefinementToMembers = (refinement, asts) => asts.map((ast) => new Refinement(ast, refinement.filter, preserveRefinementAnnotations(refinement)));
|
|
74344
|
-
var extendAST = (x, y,
|
|
74344
|
+
var extendAST = (x, y, path15) => Union.make(intersectUnionMembers([x], [y], path15));
|
|
74345
74345
|
var getTypes = (ast) => isUnion(ast) ? ast.types : [ast];
|
|
74346
|
-
var intersectUnionMembers = (xs, ys,
|
|
74346
|
+
var intersectUnionMembers = (xs, ys, path15) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
|
|
74347
74347
|
switch (y._tag) {
|
|
74348
74348
|
case "Literal": {
|
|
74349
74349
|
if (isString(y.literal) && isStringKeyword(x) || isNumber(y.literal) && isNumberKeyword(x) || isBoolean(y.literal) && isBooleanKeyword(x)) {
|
|
@@ -74356,7 +74356,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
74356
74356
|
if (isStringKeyword(x) || isLiteral(x) && isString(x.literal)) {
|
|
74357
74357
|
return [x];
|
|
74358
74358
|
} else if (isRefinement(x)) {
|
|
74359
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
74359
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
|
|
74360
74360
|
}
|
|
74361
74361
|
} else if (x === stringKeyword) {
|
|
74362
74362
|
return [y];
|
|
@@ -74368,7 +74368,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
74368
74368
|
if (isNumberKeyword(x) || isLiteral(x) && isNumber(x.literal)) {
|
|
74369
74369
|
return [x];
|
|
74370
74370
|
} else if (isRefinement(x)) {
|
|
74371
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
74371
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
|
|
74372
74372
|
}
|
|
74373
74373
|
} else if (x === numberKeyword) {
|
|
74374
74374
|
return [y];
|
|
@@ -74380,7 +74380,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
74380
74380
|
if (isBooleanKeyword(x) || isLiteral(x) && isBoolean(x.literal)) {
|
|
74381
74381
|
return [x];
|
|
74382
74382
|
} else if (isRefinement(x)) {
|
|
74383
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
74383
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
|
|
74384
74384
|
}
|
|
74385
74385
|
} else if (x === booleanKeyword) {
|
|
74386
74386
|
return [y];
|
|
@@ -74388,25 +74388,25 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
74388
74388
|
break;
|
|
74389
74389
|
}
|
|
74390
74390
|
case "Union":
|
|
74391
|
-
return intersectUnionMembers(getTypes(x), y.types,
|
|
74391
|
+
return intersectUnionMembers(getTypes(x), y.types, path15);
|
|
74392
74392
|
case "Suspend":
|
|
74393
|
-
return [new Suspend(() => extendAST(x, y.f(),
|
|
74393
|
+
return [new Suspend(() => extendAST(x, y.f(), path15))];
|
|
74394
74394
|
case "Refinement":
|
|
74395
|
-
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from),
|
|
74395
|
+
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path15));
|
|
74396
74396
|
case "TypeLiteral": {
|
|
74397
74397
|
switch (x._tag) {
|
|
74398
74398
|
case "Union":
|
|
74399
|
-
return intersectUnionMembers(x.types, [y],
|
|
74399
|
+
return intersectUnionMembers(x.types, [y], path15);
|
|
74400
74400
|
case "Suspend":
|
|
74401
|
-
return [new Suspend(() => extendAST(x.f(), y,
|
|
74401
|
+
return [new Suspend(() => extendAST(x.f(), y, path15))];
|
|
74402
74402
|
case "Refinement":
|
|
74403
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
74403
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
|
|
74404
74404
|
case "TypeLiteral":
|
|
74405
|
-
return [intersectTypeLiterals(x, y,
|
|
74405
|
+
return [intersectTypeLiterals(x, y, path15)];
|
|
74406
74406
|
case "Transformation": {
|
|
74407
74407
|
const transformation = x.transformation;
|
|
74408
|
-
const from = intersectTypeLiterals(x.from, y,
|
|
74409
|
-
const to = intersectTypeLiterals(x.to, typeAST(y),
|
|
74408
|
+
const from = intersectTypeLiterals(x.from, y, path15);
|
|
74409
|
+
const to = intersectTypeLiterals(x.to, typeAST(y), path15);
|
|
74410
74410
|
switch (transformation._tag) {
|
|
74411
74411
|
case "TypeLiteralTransformation":
|
|
74412
74412
|
return [new Transformation(from, to, new TypeLiteralTransformation(transformation.propertySignatureTransformations))];
|
|
@@ -74428,15 +74428,15 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
74428
74428
|
case "Transformation": {
|
|
74429
74429
|
if (isTransformation(x)) {
|
|
74430
74430
|
if (isTypeLiteralTransformation(y.transformation) && isTypeLiteralTransformation(x.transformation)) {
|
|
74431
|
-
return [new Transformation(intersectTypeLiterals(x.from, y.from,
|
|
74431
|
+
return [new Transformation(intersectTypeLiterals(x.from, y.from, path15), intersectTypeLiterals(x.to, y.to, path15), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
|
|
74432
74432
|
}
|
|
74433
74433
|
} else {
|
|
74434
|
-
return intersectUnionMembers([y], [x],
|
|
74434
|
+
return intersectUnionMembers([y], [x], path15);
|
|
74435
74435
|
}
|
|
74436
74436
|
break;
|
|
74437
74437
|
}
|
|
74438
74438
|
}
|
|
74439
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
74439
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path15));
|
|
74440
74440
|
}));
|
|
74441
74441
|
var extend4 = /* @__PURE__ */ dual(2, (self2, that) => make53(extendAST(self2.ast, that.ast, [])));
|
|
74442
74442
|
var compose3 = /* @__PURE__ */ dual((args2) => isSchema(args2[1]), (from, to) => makeTransformationClass(from, to, compose(from.ast, to.ast)));
|
|
@@ -75106,8 +75106,8 @@ var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
|
75106
75106
|
var make54 = (impl) => {
|
|
75107
75107
|
return tag.of({
|
|
75108
75108
|
...impl,
|
|
75109
|
-
exists: (
|
|
75110
|
-
readFileString: (
|
|
75109
|
+
exists: (path15) => pipe(impl.access(path15), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed9(false) : fail9(e))),
|
|
75110
|
+
readFileString: (path15, encoding) => tryMap2(impl.readFile(path15), {
|
|
75111
75111
|
try: (_) => new TextDecoder(encoding).decode(_),
|
|
75112
75112
|
catch: (cause3) => new BadArgument({
|
|
75113
75113
|
module: "FileSystem",
|
|
@@ -75116,14 +75116,14 @@ var make54 = (impl) => {
|
|
|
75116
75116
|
cause: cause3
|
|
75117
75117
|
})
|
|
75118
75118
|
}),
|
|
75119
|
-
stream: (
|
|
75119
|
+
stream: (path15, options3) => pipe(impl.open(path15, {
|
|
75120
75120
|
flag: "r"
|
|
75121
75121
|
}), options3?.offset ? tap4((file6) => file6.seek(options3.offset, "start")) : identity, map18((file6) => stream(file6, options3)), unwrapScoped7),
|
|
75122
|
-
sink: (
|
|
75122
|
+
sink: (path15, options3) => pipe(impl.open(path15, {
|
|
75123
75123
|
flag: "w",
|
|
75124
75124
|
...options3
|
|
75125
75125
|
}), map18((file6) => forEach11((_) => file6.writeAll(_))), unwrapScoped6),
|
|
75126
|
-
writeFileString: (
|
|
75126
|
+
writeFileString: (path15, data, options3) => flatMap10(try_3({
|
|
75127
75127
|
try: () => new TextEncoder().encode(data),
|
|
75128
75128
|
catch: (cause3) => new BadArgument({
|
|
75129
75129
|
module: "FileSystem",
|
|
@@ -75131,38 +75131,38 @@ var make54 = (impl) => {
|
|
|
75131
75131
|
description: "could not encode string",
|
|
75132
75132
|
cause: cause3
|
|
75133
75133
|
})
|
|
75134
|
-
}), (_) => impl.writeFile(
|
|
75134
|
+
}), (_) => impl.writeFile(path15, _, options3))
|
|
75135
75135
|
});
|
|
75136
75136
|
};
|
|
75137
|
-
var notFound = (method,
|
|
75137
|
+
var notFound = (method, path15) => new SystemError({
|
|
75138
75138
|
module: "FileSystem",
|
|
75139
75139
|
method,
|
|
75140
75140
|
reason: "NotFound",
|
|
75141
75141
|
description: "No such file or directory",
|
|
75142
|
-
pathOrDescriptor:
|
|
75142
|
+
pathOrDescriptor: path15
|
|
75143
75143
|
});
|
|
75144
75144
|
var makeNoop = (fileSystem) => {
|
|
75145
75145
|
return {
|
|
75146
|
-
access(
|
|
75147
|
-
return fail9(notFound("access",
|
|
75146
|
+
access(path15) {
|
|
75147
|
+
return fail9(notFound("access", path15));
|
|
75148
75148
|
},
|
|
75149
|
-
chmod(
|
|
75150
|
-
return fail9(notFound("chmod",
|
|
75149
|
+
chmod(path15) {
|
|
75150
|
+
return fail9(notFound("chmod", path15));
|
|
75151
75151
|
},
|
|
75152
|
-
chown(
|
|
75153
|
-
return fail9(notFound("chown",
|
|
75152
|
+
chown(path15) {
|
|
75153
|
+
return fail9(notFound("chown", path15));
|
|
75154
75154
|
},
|
|
75155
|
-
copy(
|
|
75156
|
-
return fail9(notFound("copy",
|
|
75155
|
+
copy(path15) {
|
|
75156
|
+
return fail9(notFound("copy", path15));
|
|
75157
75157
|
},
|
|
75158
|
-
copyFile(
|
|
75159
|
-
return fail9(notFound("copyFile",
|
|
75158
|
+
copyFile(path15) {
|
|
75159
|
+
return fail9(notFound("copyFile", path15));
|
|
75160
75160
|
},
|
|
75161
75161
|
exists() {
|
|
75162
75162
|
return succeed9(false);
|
|
75163
75163
|
},
|
|
75164
|
-
link(
|
|
75165
|
-
return fail9(notFound("link",
|
|
75164
|
+
link(path15) {
|
|
75165
|
+
return fail9(notFound("link", path15));
|
|
75166
75166
|
},
|
|
75167
75167
|
makeDirectory() {
|
|
75168
75168
|
return die6("not implemented");
|
|
@@ -75179,23 +75179,23 @@ var makeNoop = (fileSystem) => {
|
|
|
75179
75179
|
makeTempFileScoped() {
|
|
75180
75180
|
return die6("not implemented");
|
|
75181
75181
|
},
|
|
75182
|
-
open(
|
|
75183
|
-
return fail9(notFound("open",
|
|
75182
|
+
open(path15) {
|
|
75183
|
+
return fail9(notFound("open", path15));
|
|
75184
75184
|
},
|
|
75185
|
-
readDirectory(
|
|
75186
|
-
return fail9(notFound("readDirectory",
|
|
75185
|
+
readDirectory(path15) {
|
|
75186
|
+
return fail9(notFound("readDirectory", path15));
|
|
75187
75187
|
},
|
|
75188
|
-
readFile(
|
|
75189
|
-
return fail9(notFound("readFile",
|
|
75188
|
+
readFile(path15) {
|
|
75189
|
+
return fail9(notFound("readFile", path15));
|
|
75190
75190
|
},
|
|
75191
|
-
readFileString(
|
|
75192
|
-
return fail9(notFound("readFileString",
|
|
75191
|
+
readFileString(path15) {
|
|
75192
|
+
return fail9(notFound("readFileString", path15));
|
|
75193
75193
|
},
|
|
75194
|
-
readLink(
|
|
75195
|
-
return fail9(notFound("readLink",
|
|
75194
|
+
readLink(path15) {
|
|
75195
|
+
return fail9(notFound("readLink", path15));
|
|
75196
75196
|
},
|
|
75197
|
-
realPath(
|
|
75198
|
-
return fail9(notFound("realPath",
|
|
75197
|
+
realPath(path15) {
|
|
75198
|
+
return fail9(notFound("realPath", path15));
|
|
75199
75199
|
},
|
|
75200
75200
|
remove() {
|
|
75201
75201
|
return _void;
|
|
@@ -75203,32 +75203,32 @@ var makeNoop = (fileSystem) => {
|
|
|
75203
75203
|
rename(oldPath) {
|
|
75204
75204
|
return fail9(notFound("rename", oldPath));
|
|
75205
75205
|
},
|
|
75206
|
-
sink(
|
|
75207
|
-
return fail15(notFound("sink",
|
|
75206
|
+
sink(path15) {
|
|
75207
|
+
return fail15(notFound("sink", path15));
|
|
75208
75208
|
},
|
|
75209
|
-
stat(
|
|
75210
|
-
return fail9(notFound("stat",
|
|
75209
|
+
stat(path15) {
|
|
75210
|
+
return fail9(notFound("stat", path15));
|
|
75211
75211
|
},
|
|
75212
|
-
stream(
|
|
75213
|
-
return fail16(notFound("stream",
|
|
75212
|
+
stream(path15) {
|
|
75213
|
+
return fail16(notFound("stream", path15));
|
|
75214
75214
|
},
|
|
75215
75215
|
symlink(fromPath) {
|
|
75216
75216
|
return fail9(notFound("symlink", fromPath));
|
|
75217
75217
|
},
|
|
75218
|
-
truncate(
|
|
75219
|
-
return fail9(notFound("truncate",
|
|
75218
|
+
truncate(path15) {
|
|
75219
|
+
return fail9(notFound("truncate", path15));
|
|
75220
75220
|
},
|
|
75221
|
-
utimes(
|
|
75222
|
-
return fail9(notFound("utimes",
|
|
75221
|
+
utimes(path15) {
|
|
75222
|
+
return fail9(notFound("utimes", path15));
|
|
75223
75223
|
},
|
|
75224
|
-
watch(
|
|
75225
|
-
return fail16(notFound("watch",
|
|
75224
|
+
watch(path15) {
|
|
75225
|
+
return fail16(notFound("watch", path15));
|
|
75226
75226
|
},
|
|
75227
|
-
writeFile(
|
|
75228
|
-
return fail9(notFound("writeFile",
|
|
75227
|
+
writeFile(path15) {
|
|
75228
|
+
return fail9(notFound("writeFile", path15));
|
|
75229
75229
|
},
|
|
75230
|
-
writeFileString(
|
|
75231
|
-
return fail9(notFound("writeFileString",
|
|
75230
|
+
writeFileString(path15) {
|
|
75231
|
+
return fail9(notFound("writeFileString", path15));
|
|
75232
75232
|
},
|
|
75233
75233
|
...fileSystem
|
|
75234
75234
|
};
|
|
@@ -75288,22 +75288,22 @@ var fileParsers = {
|
|
|
75288
75288
|
toml: (content) => Toml.parse(content),
|
|
75289
75289
|
tml: (content) => Toml.parse(content)
|
|
75290
75290
|
};
|
|
75291
|
-
var read2 = (
|
|
75292
|
-
onFailure: (error4) => fail9(`Could not read file (${
|
|
75293
|
-
onSuccess: (content) => succeed9([
|
|
75291
|
+
var read2 = (path15) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFile(path15), {
|
|
75292
|
+
onFailure: (error4) => fail9(`Could not read file (${path15}): ${error4}`),
|
|
75293
|
+
onSuccess: (content) => succeed9([path15, content])
|
|
75294
75294
|
}));
|
|
75295
|
-
var readString = (
|
|
75296
|
-
onFailure: (error4) => fail9(`Could not read file (${
|
|
75297
|
-
onSuccess: (content) => succeed9([
|
|
75295
|
+
var readString = (path15) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFileString(path15), {
|
|
75296
|
+
onFailure: (error4) => fail9(`Could not read file (${path15}): ${error4}`),
|
|
75297
|
+
onSuccess: (content) => succeed9([path15, content])
|
|
75298
75298
|
}));
|
|
75299
|
-
var parse5 = (
|
|
75300
|
-
const parser = fileParsers[format6 ??
|
|
75299
|
+
var parse5 = (path15, content, format6) => {
|
|
75300
|
+
const parser = fileParsers[format6 ?? path15.split(".").pop()];
|
|
75301
75301
|
if (parser === void 0) {
|
|
75302
75302
|
return fail9(`Unsupported file format: ${format6}`);
|
|
75303
75303
|
}
|
|
75304
75304
|
return try_3({
|
|
75305
75305
|
try: () => parser(content),
|
|
75306
|
-
catch: (e) => `Could not parse ${format6} file (${
|
|
75306
|
+
catch: (e) => `Could not parse ${format6} file (${path15}): ${e}`
|
|
75307
75307
|
});
|
|
75308
75308
|
};
|
|
75309
75309
|
|
|
@@ -76896,8 +76896,8 @@ var run5 = /* @__PURE__ */ fnUntraced2(function* (self2) {
|
|
|
76896
76896
|
const input = yield* terminal.readInput;
|
|
76897
76897
|
return yield* runWithInput(self2, terminal, input);
|
|
76898
76898
|
}, /* @__PURE__ */ mapError3(() => new QuitException()), scoped2);
|
|
76899
|
-
var runWithInput = (
|
|
76900
|
-
const op =
|
|
76899
|
+
var runWithInput = (prompt10, terminal, input) => suspend4(() => {
|
|
76900
|
+
const op = prompt10;
|
|
76901
76901
|
switch (op._tag) {
|
|
76902
76902
|
case "Loop": {
|
|
76903
76903
|
return runLoop(op, terminal, input);
|
|
@@ -77110,8 +77110,8 @@ function eraseText(text11, columns) {
|
|
|
77110
77110
|
}
|
|
77111
77111
|
return eraseLines3(rows);
|
|
77112
77112
|
}
|
|
77113
|
-
function lines(
|
|
77114
|
-
const lines4 =
|
|
77113
|
+
function lines(prompt10, columns) {
|
|
77114
|
+
const lines4 = prompt10.split(/\r?\n/);
|
|
77115
77115
|
return columns === 0 ? lines4.length : pipe(map3(lines4, (line4) => Math.ceil(line4.length / columns)), reduce(0, (left3, right3) => left3 + right3));
|
|
77116
77116
|
}
|
|
77117
77117
|
|
|
@@ -77621,22 +77621,22 @@ var showConfirmation = /* @__PURE__ */ Confirm.$is("Show");
|
|
|
77621
77621
|
var renderBeep2 = /* @__PURE__ */ render3(beep3, {
|
|
77622
77622
|
style: "pretty"
|
|
77623
77623
|
});
|
|
77624
|
-
function resolveCurrentPath(
|
|
77625
|
-
return match2(
|
|
77624
|
+
function resolveCurrentPath(path15, options3) {
|
|
77625
|
+
return match2(path15, {
|
|
77626
77626
|
onNone: () => match2(options3.startingPath, {
|
|
77627
77627
|
onNone: () => sync5(() => process.cwd()),
|
|
77628
|
-
onSome: (
|
|
77628
|
+
onSome: (path16) => flatMap10(FileSystem, (fs) => (
|
|
77629
77629
|
// Ensure the user provided starting path exists
|
|
77630
|
-
orDie3(fs.exists(
|
|
77630
|
+
orDie3(fs.exists(path16)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path16}' does not exist`), as5(path16))
|
|
77631
77631
|
))
|
|
77632
77632
|
}),
|
|
77633
|
-
onSome: (
|
|
77633
|
+
onSome: (path16) => succeed9(path16)
|
|
77634
77634
|
});
|
|
77635
77635
|
}
|
|
77636
77636
|
function getFileList(directory5, options3) {
|
|
77637
77637
|
return gen3(function* () {
|
|
77638
77638
|
const fs = yield* FileSystem;
|
|
77639
|
-
const
|
|
77639
|
+
const path15 = yield* Path2;
|
|
77640
77640
|
const files = yield* orDie3(fs.readDirectory(directory5)).pipe(
|
|
77641
77641
|
// Always prepend the `".."` option to the file list but allow it
|
|
77642
77642
|
// to be filtered out if the user so desires
|
|
@@ -77645,7 +77645,7 @@ function getFileList(directory5, options3) {
|
|
|
77645
77645
|
return yield* filter8(files, (file6) => {
|
|
77646
77646
|
const result = options3.filter(file6);
|
|
77647
77647
|
const userDefinedFilter = isEffect2(result) ? result : succeed9(result);
|
|
77648
|
-
const directoryFilter = options3.type === "directory" ? map18(orDie3(fs.stat(
|
|
77648
|
+
const directoryFilter = options3.type === "directory" ? map18(orDie3(fs.stat(path15.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed9(true);
|
|
77649
77649
|
return zipWith5(userDefinedFilter, directoryFilter, (a, b) => a && b);
|
|
77650
77650
|
}, {
|
|
77651
77651
|
concurrency: files.length
|
|
@@ -77711,13 +77711,13 @@ function renderFiles(state, files, figures2, options3) {
|
|
|
77711
77711
|
}
|
|
77712
77712
|
function renderNextFrame2(state, options3) {
|
|
77713
77713
|
return gen3(function* () {
|
|
77714
|
-
const
|
|
77714
|
+
const path15 = yield* Path2;
|
|
77715
77715
|
const terminal = yield* Terminal;
|
|
77716
77716
|
const columns = yield* terminal.columns;
|
|
77717
77717
|
const figures2 = yield* figures;
|
|
77718
77718
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
77719
77719
|
const selectedPath = state.files[state.cursor];
|
|
77720
|
-
const resolvedPath =
|
|
77720
|
+
const resolvedPath = path15.resolve(currentPath, selectedPath);
|
|
77721
77721
|
const resolvedPathMsg = figures2.pointerSmall.pipe(cat2(space2), cat2(text3(resolvedPath)), annotate2(blackBright2));
|
|
77722
77722
|
if (showConfirmation(state.confirm)) {
|
|
77723
77723
|
const leadingSymbol2 = annotate2(text3("?"), cyanBright2);
|
|
@@ -77792,10 +77792,10 @@ function processCursorDown(state) {
|
|
|
77792
77792
|
function processSelection(state, options3) {
|
|
77793
77793
|
return gen3(function* () {
|
|
77794
77794
|
const fs = yield* FileSystem;
|
|
77795
|
-
const
|
|
77795
|
+
const path15 = yield* Path2;
|
|
77796
77796
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
77797
77797
|
const selectedPath = state.files[state.cursor];
|
|
77798
|
-
const resolvedPath =
|
|
77798
|
+
const resolvedPath = path15.resolve(currentPath, selectedPath);
|
|
77799
77799
|
const info3 = yield* orDie3(fs.stat(resolvedPath));
|
|
77800
77800
|
if (info3.type === "Directory") {
|
|
77801
77801
|
const files = yield* getFileList(resolvedPath, options3);
|
|
@@ -77843,10 +77843,10 @@ function handleProcess2(options3) {
|
|
|
77843
77843
|
case "y":
|
|
77844
77844
|
case "t": {
|
|
77845
77845
|
if (showConfirmation(state.confirm)) {
|
|
77846
|
-
const
|
|
77846
|
+
const path15 = yield* Path2;
|
|
77847
77847
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
77848
77848
|
const selectedPath = state.files[state.cursor];
|
|
77849
|
-
const resolvedPath =
|
|
77849
|
+
const resolvedPath = path15.resolve(currentPath, selectedPath);
|
|
77850
77850
|
const files = yield* getFileList(resolvedPath, options3);
|
|
77851
77851
|
return Action.NextFrame({
|
|
77852
77852
|
state: {
|
|
@@ -77862,10 +77862,10 @@ function handleProcess2(options3) {
|
|
|
77862
77862
|
case "n":
|
|
77863
77863
|
case "f": {
|
|
77864
77864
|
if (showConfirmation(state.confirm)) {
|
|
77865
|
-
const
|
|
77865
|
+
const path15 = yield* Path2;
|
|
77866
77866
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
77867
77867
|
const selectedPath = state.files[state.cursor];
|
|
77868
|
-
const resolvedPath =
|
|
77868
|
+
const resolvedPath = path15.resolve(currentPath, selectedPath);
|
|
77869
77869
|
return Action.Submit({
|
|
77870
77870
|
value: resolvedPath
|
|
77871
77871
|
});
|
|
@@ -77887,14 +77887,14 @@ var file = (options3 = {}) => {
|
|
|
77887
77887
|
filter: options3.filter ?? (() => succeed9(true))
|
|
77888
77888
|
};
|
|
77889
77889
|
const initialState3 = gen3(function* () {
|
|
77890
|
-
const
|
|
77891
|
-
const currentPath = yield* resolveCurrentPath(
|
|
77890
|
+
const path15 = none2();
|
|
77891
|
+
const currentPath = yield* resolveCurrentPath(path15, opts);
|
|
77892
77892
|
const files = yield* getFileList(currentPath, opts);
|
|
77893
77893
|
const confirm = Confirm.Hide();
|
|
77894
77894
|
return {
|
|
77895
77895
|
cursor: 0,
|
|
77896
77896
|
files,
|
|
77897
|
-
path:
|
|
77897
|
+
path: path15,
|
|
77898
77898
|
confirm
|
|
77899
77899
|
};
|
|
77900
77900
|
});
|
|
@@ -79039,7 +79039,7 @@ var validateInternal = (self2, value5, config3) => {
|
|
|
79039
79039
|
case "Path": {
|
|
79040
79040
|
return flatMap10(FileSystem, (fileSystem) => {
|
|
79041
79041
|
const errorMsg = "Path options do not have a default value";
|
|
79042
|
-
return orElseFail2(value5, () => errorMsg).pipe(tap4((
|
|
79042
|
+
return orElseFail2(value5, () => errorMsg).pipe(tap4((path15) => orDie3(fileSystem.exists(path15)).pipe(tap4((pathExists) => validatePathExistence(path15, self2.pathExists, pathExists).pipe(zipRight5(validatePathType(path15, self2.pathType, fileSystem).pipe(when2(() => self2.pathExists !== "no" && pathExists))))))));
|
|
79043
79043
|
});
|
|
79044
79044
|
}
|
|
79045
79045
|
case "Redacted": {
|
|
@@ -79054,24 +79054,24 @@ var validateInternal = (self2, value5, config3) => {
|
|
|
79054
79054
|
}
|
|
79055
79055
|
};
|
|
79056
79056
|
var attempt = (option6, typeName, parse9) => orElseFail2(option6, () => `${typeName} options do not have a default value`).pipe(flatMap10((value5) => orElseFail2(parse9(value5), () => `'${value5}' is not a ${typeName}`)));
|
|
79057
|
-
var validatePathExistence = (
|
|
79057
|
+
var validatePathExistence = (path15, shouldPathExist, pathExists) => {
|
|
79058
79058
|
if (shouldPathExist === "no" && pathExists) {
|
|
79059
|
-
return fail9(`Path '${
|
|
79059
|
+
return fail9(`Path '${path15}' must not exist`);
|
|
79060
79060
|
}
|
|
79061
79061
|
if (shouldPathExist === "yes" && !pathExists) {
|
|
79062
|
-
return fail9(`Path '${
|
|
79062
|
+
return fail9(`Path '${path15}' must exist`);
|
|
79063
79063
|
}
|
|
79064
79064
|
return _void;
|
|
79065
79065
|
};
|
|
79066
|
-
var validatePathType = (
|
|
79066
|
+
var validatePathType = (path15, pathType, fileSystem) => {
|
|
79067
79067
|
switch (pathType) {
|
|
79068
79068
|
case "file": {
|
|
79069
|
-
const checkIsFile = fileSystem.stat(
|
|
79070
|
-
return fail9(`Expected path '${
|
|
79069
|
+
const checkIsFile = fileSystem.stat(path15).pipe(map18((info3) => info3.type === "File"), orDie3);
|
|
79070
|
+
return fail9(`Expected path '${path15}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
|
|
79071
79071
|
}
|
|
79072
79072
|
case "directory": {
|
|
79073
|
-
const checkIsDirectory = fileSystem.stat(
|
|
79074
|
-
return fail9(`Expected path '${
|
|
79073
|
+
const checkIsDirectory = fileSystem.stat(path15).pipe(map18((info3) => info3.type === "Directory"), orDie3);
|
|
79074
|
+
return fail9(`Expected path '${path15}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
|
|
79075
79075
|
}
|
|
79076
79076
|
case "either": {
|
|
79077
79077
|
return _void;
|
|
@@ -79493,13 +79493,13 @@ var file2 = (config3) => makeSingle(fromNullable(config3?.name), path("file", co
|
|
|
79493
79493
|
var fileContent = (config3) => mapEffect5(file2({
|
|
79494
79494
|
...config3,
|
|
79495
79495
|
exists: "yes"
|
|
79496
|
-
}), (
|
|
79497
|
-
var fileParse = (config3) => mapEffect5(fileText(config3), ([
|
|
79496
|
+
}), (path15) => mapError3(read2(path15), (e) => p(e)));
|
|
79497
|
+
var fileParse = (config3) => mapEffect5(fileText(config3), ([path15, content]) => mapError3(parse5(path15, content, config3?.format), (e) => p(e)));
|
|
79498
79498
|
var fileSchema = (schema, config3) => withSchema(fileParse(config3), schema);
|
|
79499
79499
|
var fileText = (config3) => mapEffect5(file2({
|
|
79500
79500
|
...config3,
|
|
79501
79501
|
exists: "yes"
|
|
79502
|
-
}), (
|
|
79502
|
+
}), (path15) => mapError3(readString(path15), (e) => p(e)));
|
|
79503
79503
|
var float3 = (config3) => makeSingle(fromNullable(config3?.name), float2);
|
|
79504
79504
|
var integer5 = (config3) => makeSingle(fromNullable(config3?.name), integer4);
|
|
79505
79505
|
var none12 = /* @__PURE__ */ (() => {
|
|
@@ -80115,12 +80115,12 @@ var directory3 = (name, config3) => makeSingle2(name, empty3(), path("directory"
|
|
|
80115
80115
|
var file4 = (name, config3) => makeSingle2(name, empty3(), path("file", config3?.exists ?? "either"));
|
|
80116
80116
|
var fileContent3 = (name) => mapEffect7(file4(name, {
|
|
80117
80117
|
exists: "yes"
|
|
80118
|
-
}), (
|
|
80119
|
-
var fileParse3 = (name, format6) => mapEffect7(fileText3(name), ([
|
|
80118
|
+
}), (path15) => mapError3(read2(path15), (msg) => invalidValue(p(msg))));
|
|
80119
|
+
var fileParse3 = (name, format6) => mapEffect7(fileText3(name), ([path15, content]) => mapError3(parse5(path15, content, format6), (error4) => invalidValue(p(error4))));
|
|
80120
80120
|
var fileSchema3 = (name, schema, format6) => withSchema3(fileParse3(name, format6), schema);
|
|
80121
80121
|
var fileText3 = (name) => mapEffect7(file4(name, {
|
|
80122
80122
|
exists: "yes"
|
|
80123
|
-
}), (
|
|
80123
|
+
}), (path15) => mapError3(readString(path15), (error4) => invalidValue(p(error4))));
|
|
80124
80124
|
var filterMap8 = /* @__PURE__ */ dual(3, (self2, f, message) => mapEffect7(self2, (a) => match2(f(a), {
|
|
80125
80125
|
onNone: () => left2(invalidValue(p(message))),
|
|
80126
80126
|
onSome: right2
|
|
@@ -80182,11 +80182,11 @@ var withFallbackConfig3 = /* @__PURE__ */ dual(2, (self2, config3) => {
|
|
|
80182
80182
|
}
|
|
80183
80183
|
return makeWithFallback(self2, config3);
|
|
80184
80184
|
});
|
|
80185
|
-
var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2,
|
|
80185
|
+
var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2, prompt10) => {
|
|
80186
80186
|
if (isInstruction2(self2) && isWithDefault2(self2)) {
|
|
80187
|
-
return makeWithDefault2(withFallbackPrompt(self2.options,
|
|
80187
|
+
return makeWithDefault2(withFallbackPrompt(self2.options, prompt10), self2.fallback);
|
|
80188
80188
|
}
|
|
80189
|
-
return makeWithFallback(self2,
|
|
80189
|
+
return makeWithFallback(self2, prompt10);
|
|
80190
80190
|
});
|
|
80191
80191
|
var withDescription5 = /* @__PURE__ */ dual(2, (self2, desc) => modifySingle(self2, (single2) => {
|
|
80192
80192
|
const description = sequence(single2.description, p(desc));
|
|
@@ -81329,12 +81329,12 @@ var make59 = (name, options3 = none14, args2 = none12) => {
|
|
|
81329
81329
|
op.args = args2;
|
|
81330
81330
|
return op;
|
|
81331
81331
|
};
|
|
81332
|
-
var prompt = (name,
|
|
81332
|
+
var prompt = (name, prompt10) => {
|
|
81333
81333
|
const op = Object.create(proto23);
|
|
81334
81334
|
op._tag = "GetUserInput";
|
|
81335
81335
|
op.name = name;
|
|
81336
81336
|
op.description = empty39;
|
|
81337
|
-
op.prompt =
|
|
81337
|
+
op.prompt = prompt10;
|
|
81338
81338
|
return op;
|
|
81339
81339
|
};
|
|
81340
81340
|
var getHelp7 = (self2, config3) => getHelpInternal4(self2, config3);
|
|
@@ -82175,7 +82175,7 @@ var getUsage6 = (self2) => getUsage5(self2.descriptor);
|
|
|
82175
82175
|
var mapDescriptor = /* @__PURE__ */ dual(2, (self2, f) => makeDerive(self2, {
|
|
82176
82176
|
descriptor: f(self2.descriptor)
|
|
82177
82177
|
}));
|
|
82178
|
-
var prompt2 = (name,
|
|
82178
|
+
var prompt2 = (name, prompt10, handler) => makeProto(map37(prompt(name, prompt10), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
|
|
82179
82179
|
var withHandler = /* @__PURE__ */ dual(2, (self2, handler) => makeDerive(self2, {
|
|
82180
82180
|
handler,
|
|
82181
82181
|
transform: identity
|
|
@@ -83316,9 +83316,10 @@ var makeCacheStats2 = makeCacheStats;
|
|
|
83316
83316
|
var makeEntryStats2 = makeEntryStats;
|
|
83317
83317
|
|
|
83318
83318
|
// src/commit-utils.ts
|
|
83319
|
-
var
|
|
83319
|
+
var import_prompts2 = __toESM(require_prompts3());
|
|
83320
83320
|
|
|
83321
83321
|
// src/prompt-utils.ts
|
|
83322
|
+
var import_prompts = __toESM(require_prompts3());
|
|
83322
83323
|
var PromptCancelledError = class extends Data_exports.TaggedError(
|
|
83323
83324
|
"PromptCancelledError"
|
|
83324
83325
|
) {
|
|
@@ -83332,6 +83333,23 @@ var runPrompt = (promptFn) => {
|
|
|
83332
83333
|
return result;
|
|
83333
83334
|
});
|
|
83334
83335
|
};
|
|
83336
|
+
var confirmContinue = Effect_exports.fn("confirmContinue")(
|
|
83337
|
+
function* (message, defaultToContinue = true) {
|
|
83338
|
+
const { confirm } = yield* runPrompt(
|
|
83339
|
+
() => (0, import_prompts.prompt)([
|
|
83340
|
+
{
|
|
83341
|
+
type: "confirm",
|
|
83342
|
+
name: "confirm",
|
|
83343
|
+
message,
|
|
83344
|
+
initial: defaultToContinue
|
|
83345
|
+
}
|
|
83346
|
+
])
|
|
83347
|
+
);
|
|
83348
|
+
if (!confirm) {
|
|
83349
|
+
return yield* new PromptCancelledError();
|
|
83350
|
+
}
|
|
83351
|
+
}
|
|
83352
|
+
);
|
|
83335
83353
|
|
|
83336
83354
|
// src/commit-utils.ts
|
|
83337
83355
|
var CommitNotFoundError = class extends Data_exports.TaggedError(
|
|
@@ -83433,7 +83451,7 @@ var selectLessonCommit = ({
|
|
|
83433
83451
|
return a.lessonId.localeCompare(b.lessonId);
|
|
83434
83452
|
});
|
|
83435
83453
|
const { lesson } = yield* runPrompt(
|
|
83436
|
-
() => (0,
|
|
83454
|
+
() => (0, import_prompts2.default)([
|
|
83437
83455
|
{
|
|
83438
83456
|
type: "autocomplete",
|
|
83439
83457
|
name: "lesson",
|
|
@@ -83608,7 +83626,7 @@ __export(NodeContext_exports, {
|
|
|
83608
83626
|
});
|
|
83609
83627
|
|
|
83610
83628
|
// node_modules/.pnpm/@effect+platform-node-shared@0.48.0_@effect+cluster@0.47.0_@effect+platform@0.90.2_effe_c51441e982837e38e66e4ef8533c2d61/node_modules/@effect/platform-node-shared/dist/esm/internal/error.js
|
|
83611
|
-
var handleErrnoException = (module, method) => (err, [
|
|
83629
|
+
var handleErrnoException = (module, method) => (err, [path15]) => {
|
|
83612
83630
|
let reason = "Unknown";
|
|
83613
83631
|
switch (err.code) {
|
|
83614
83632
|
case "ENOENT":
|
|
@@ -83637,7 +83655,7 @@ var handleErrnoException = (module, method) => (err, [path14]) => {
|
|
|
83637
83655
|
reason,
|
|
83638
83656
|
module,
|
|
83639
83657
|
method,
|
|
83640
|
-
pathOrDescriptor:
|
|
83658
|
+
pathOrDescriptor: path15,
|
|
83641
83659
|
syscall: err.syscall,
|
|
83642
83660
|
description: err.message,
|
|
83643
83661
|
cause: err
|
|
@@ -83779,7 +83797,7 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
|
|
|
83779
83797
|
});
|
|
83780
83798
|
var access2 = /* @__PURE__ */ (() => {
|
|
83781
83799
|
const nodeAccess = /* @__PURE__ */ effectify2(NFS__namespace.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
83782
|
-
return (
|
|
83800
|
+
return (path15, options3) => {
|
|
83783
83801
|
let mode = NFS__namespace.constants.F_OK;
|
|
83784
83802
|
if (options3?.readable) {
|
|
83785
83803
|
mode |= NFS__namespace.constants.R_OK;
|
|
@@ -83787,7 +83805,7 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
83787
83805
|
if (options3?.writable) {
|
|
83788
83806
|
mode |= NFS__namespace.constants.W_OK;
|
|
83789
83807
|
}
|
|
83790
|
-
return nodeAccess(
|
|
83808
|
+
return nodeAccess(path15, mode);
|
|
83791
83809
|
};
|
|
83792
83810
|
})();
|
|
83793
83811
|
var copy3 = /* @__PURE__ */ (() => {
|
|
@@ -83804,11 +83822,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
|
|
|
83804
83822
|
})();
|
|
83805
83823
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
83806
83824
|
const nodeChmod = /* @__PURE__ */ effectify2(NFS__namespace.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
83807
|
-
return (
|
|
83825
|
+
return (path15, mode) => nodeChmod(path15, mode);
|
|
83808
83826
|
})();
|
|
83809
83827
|
var chown2 = /* @__PURE__ */ (() => {
|
|
83810
83828
|
const nodeChown = /* @__PURE__ */ effectify2(NFS__namespace.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
83811
|
-
return (
|
|
83829
|
+
return (path15, uid, gid) => nodeChown(path15, uid, gid);
|
|
83812
83830
|
})();
|
|
83813
83831
|
var link2 = /* @__PURE__ */ (() => {
|
|
83814
83832
|
const nodeLink = /* @__PURE__ */ effectify2(NFS__namespace.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
|
|
@@ -83816,7 +83834,7 @@ var link2 = /* @__PURE__ */ (() => {
|
|
|
83816
83834
|
})();
|
|
83817
83835
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
83818
83836
|
const nodeMkdir = /* @__PURE__ */ effectify2(NFS__namespace.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
83819
|
-
return (
|
|
83837
|
+
return (path15, options3) => nodeMkdir(path15, {
|
|
83820
83838
|
recursive: options3?.recursive ?? false,
|
|
83821
83839
|
mode: options3?.mode
|
|
83822
83840
|
});
|
|
@@ -83832,7 +83850,7 @@ var makeTempDirectoryFactory = (method) => {
|
|
|
83832
83850
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
83833
83851
|
var removeFactory = (method) => {
|
|
83834
83852
|
const nodeRm = effectify2(NFS__namespace.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
83835
|
-
return (
|
|
83853
|
+
return (path15, options3) => nodeRm(path15, {
|
|
83836
83854
|
recursive: options3?.recursive ?? false,
|
|
83837
83855
|
force: options3?.force ?? false
|
|
83838
83856
|
});
|
|
@@ -83848,7 +83866,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
83848
83866
|
var openFactory = (method) => {
|
|
83849
83867
|
const nodeOpen = effectify2(NFS__namespace.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
83850
83868
|
const nodeClose = effectify2(NFS__namespace.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
83851
|
-
return (
|
|
83869
|
+
return (path15, options3) => pipe(acquireRelease2(nodeOpen(path15, options3?.flag ?? "r", options3?.mode), (fd) => orDie3(nodeClose(fd))), map18((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
|
|
83852
83870
|
};
|
|
83853
83871
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
83854
83872
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -83963,7 +83981,7 @@ var makeTempFileFactory = (method) => {
|
|
|
83963
83981
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
83964
83982
|
const open3 = openFactory(method);
|
|
83965
83983
|
const randomHexString2 = (bytes) => sync5(() => Crypto__namespace.randomBytes(bytes).toString("hex"));
|
|
83966
|
-
return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map18(([directory5, random4]) => path5__namespace.join(directory5, random4)), tap4((
|
|
83984
|
+
return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map18(([directory5, random4]) => path5__namespace.join(directory5, random4)), tap4((path15) => scoped2(open3(path15, {
|
|
83967
83985
|
flag: "w+"
|
|
83968
83986
|
}))));
|
|
83969
83987
|
};
|
|
@@ -83975,17 +83993,17 @@ var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
|
83975
83993
|
recursive: true
|
|
83976
83994
|
})));
|
|
83977
83995
|
})();
|
|
83978
|
-
var readDirectory = (
|
|
83979
|
-
try: () => NFS__namespace.promises.readdir(
|
|
83980
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
83996
|
+
var readDirectory = (path15, options3) => tryPromise2({
|
|
83997
|
+
try: () => NFS__namespace.promises.readdir(path15, options3),
|
|
83998
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path15])
|
|
83981
83999
|
});
|
|
83982
|
-
var readFile2 = (
|
|
84000
|
+
var readFile2 = (path15) => async2((resume2, signal) => {
|
|
83983
84001
|
try {
|
|
83984
|
-
NFS__namespace.readFile(
|
|
84002
|
+
NFS__namespace.readFile(path15, {
|
|
83985
84003
|
signal
|
|
83986
84004
|
}, (err, data) => {
|
|
83987
84005
|
if (err) {
|
|
83988
|
-
resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [
|
|
84006
|
+
resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [path15])));
|
|
83989
84007
|
} else {
|
|
83990
84008
|
resume2(succeed9(data));
|
|
83991
84009
|
}
|
|
@@ -83996,11 +84014,11 @@ var readFile2 = (path14) => async2((resume2, signal) => {
|
|
|
83996
84014
|
});
|
|
83997
84015
|
var readLink = /* @__PURE__ */ (() => {
|
|
83998
84016
|
const nodeReadLink = /* @__PURE__ */ effectify2(NFS__namespace.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
83999
|
-
return (
|
|
84017
|
+
return (path15) => nodeReadLink(path15);
|
|
84000
84018
|
})();
|
|
84001
84019
|
var realPath = /* @__PURE__ */ (() => {
|
|
84002
84020
|
const nodeRealPath = /* @__PURE__ */ effectify2(NFS__namespace.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
84003
|
-
return (
|
|
84021
|
+
return (path15) => nodeRealPath(path15);
|
|
84004
84022
|
})();
|
|
84005
84023
|
var rename3 = /* @__PURE__ */ (() => {
|
|
84006
84024
|
const nodeRename = /* @__PURE__ */ effectify2(NFS__namespace.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
@@ -84024,40 +84042,40 @@ var makeFileInfo = (stat3) => ({
|
|
|
84024
84042
|
});
|
|
84025
84043
|
var stat2 = /* @__PURE__ */ (() => {
|
|
84026
84044
|
const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
84027
|
-
return (
|
|
84045
|
+
return (path15) => map18(nodeStat(path15), makeFileInfo);
|
|
84028
84046
|
})();
|
|
84029
84047
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
84030
84048
|
const nodeSymlink = /* @__PURE__ */ effectify2(NFS__namespace.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
84031
|
-
return (target,
|
|
84049
|
+
return (target, path15) => nodeSymlink(target, path15);
|
|
84032
84050
|
})();
|
|
84033
84051
|
var truncate2 = /* @__PURE__ */ (() => {
|
|
84034
84052
|
const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
84035
|
-
return (
|
|
84053
|
+
return (path15, length4) => nodeTruncate(path15, length4 !== void 0 ? Number(length4) : void 0);
|
|
84036
84054
|
})();
|
|
84037
84055
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
84038
84056
|
const nodeUtimes = /* @__PURE__ */ effectify2(NFS__namespace.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
84039
|
-
return (
|
|
84057
|
+
return (path15, atime, mtime) => nodeUtimes(path15, atime, mtime);
|
|
84040
84058
|
})();
|
|
84041
|
-
var watchNode = (
|
|
84042
|
-
const watcher = NFS__namespace.watch(
|
|
84059
|
+
var watchNode = (path15, options3) => asyncScoped2((emit) => acquireRelease2(sync5(() => {
|
|
84060
|
+
const watcher = NFS__namespace.watch(path15, {
|
|
84043
84061
|
recursive: options3?.recursive
|
|
84044
|
-
}, (event,
|
|
84045
|
-
if (!
|
|
84062
|
+
}, (event, path16) => {
|
|
84063
|
+
if (!path16) return;
|
|
84046
84064
|
switch (event) {
|
|
84047
84065
|
case "rename": {
|
|
84048
|
-
emit.fromEffect(matchEffect2(stat2(
|
|
84066
|
+
emit.fromEffect(matchEffect2(stat2(path16), {
|
|
84049
84067
|
onSuccess: (_) => succeed9(WatchEventCreate({
|
|
84050
|
-
path:
|
|
84068
|
+
path: path16
|
|
84051
84069
|
})),
|
|
84052
84070
|
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed9(WatchEventRemove({
|
|
84053
|
-
path:
|
|
84071
|
+
path: path16
|
|
84054
84072
|
})) : fail9(err)
|
|
84055
84073
|
}));
|
|
84056
84074
|
return;
|
|
84057
84075
|
}
|
|
84058
84076
|
case "change": {
|
|
84059
84077
|
emit.single(WatchEventUpdate({
|
|
84060
|
-
path:
|
|
84078
|
+
path: path16
|
|
84061
84079
|
}));
|
|
84062
84080
|
return;
|
|
84063
84081
|
}
|
|
@@ -84068,7 +84086,7 @@ var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(syn
|
|
|
84068
84086
|
module: "FileSystem",
|
|
84069
84087
|
reason: "Unknown",
|
|
84070
84088
|
method: "watch",
|
|
84071
|
-
pathOrDescriptor:
|
|
84089
|
+
pathOrDescriptor: path15,
|
|
84072
84090
|
cause: error4
|
|
84073
84091
|
}));
|
|
84074
84092
|
});
|
|
@@ -84077,16 +84095,16 @@ var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(syn
|
|
|
84077
84095
|
});
|
|
84078
84096
|
return watcher;
|
|
84079
84097
|
}), (watcher) => sync5(() => watcher.close())));
|
|
84080
|
-
var watch2 = (backend,
|
|
84081
|
-
var writeFile2 = (
|
|
84098
|
+
var watch2 = (backend, path15, options3) => stat2(path15).pipe(map18((stat3) => backend.pipe(flatMap((_) => _.register(path15, stat3, options3)), getOrElse(() => watchNode(path15, options3)))), unwrap4);
|
|
84099
|
+
var writeFile2 = (path15, data, options3) => async2((resume2, signal) => {
|
|
84082
84100
|
try {
|
|
84083
|
-
NFS__namespace.writeFile(
|
|
84101
|
+
NFS__namespace.writeFile(path15, data, {
|
|
84084
84102
|
signal,
|
|
84085
84103
|
flag: options3?.flag,
|
|
84086
84104
|
mode: options3?.mode
|
|
84087
84105
|
}, (err) => {
|
|
84088
84106
|
if (err) {
|
|
84089
|
-
resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
84107
|
+
resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path15])));
|
|
84090
84108
|
} else {
|
|
84091
84109
|
resume2(_void);
|
|
84092
84110
|
}
|
|
@@ -84118,8 +84136,8 @@ var makeFileSystem = /* @__PURE__ */ map18(/* @__PURE__ */ serviceOption2(WatchB
|
|
|
84118
84136
|
symlink: symlink2,
|
|
84119
84137
|
truncate: truncate2,
|
|
84120
84138
|
utimes: utimes2,
|
|
84121
|
-
watch(
|
|
84122
|
-
return watch2(backend,
|
|
84139
|
+
watch(path15, options3) {
|
|
84140
|
+
return watch2(backend, path15, options3);
|
|
84123
84141
|
},
|
|
84124
84142
|
writeFile: writeFile2
|
|
84125
84143
|
}));
|
|
@@ -84136,12 +84154,12 @@ var fromFileUrl2 = (url3) => try_3({
|
|
|
84136
84154
|
cause: error4
|
|
84137
84155
|
})
|
|
84138
84156
|
});
|
|
84139
|
-
var toFileUrl2 = (
|
|
84140
|
-
try: () => NodeUrl__namespace.pathToFileURL(
|
|
84157
|
+
var toFileUrl2 = (path15) => try_3({
|
|
84158
|
+
try: () => NodeUrl__namespace.pathToFileURL(path15),
|
|
84141
84159
|
catch: (error4) => new BadArgument({
|
|
84142
84160
|
module: "Path",
|
|
84143
84161
|
method: "toFileUrl",
|
|
84144
|
-
description: `Invalid path: ${
|
|
84162
|
+
description: `Invalid path: ${path15}`,
|
|
84145
84163
|
cause: error4
|
|
84146
84164
|
})
|
|
84147
84165
|
});
|
|
@@ -84205,8 +84223,8 @@ var make70 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
84205
84223
|
readlineInterface.once("line", onLine);
|
|
84206
84224
|
return sync5(() => readlineInterface.off("line", onLine));
|
|
84207
84225
|
})), scoped2);
|
|
84208
|
-
const display = (
|
|
84209
|
-
stdout3.write(
|
|
84226
|
+
const display = (prompt10) => uninterruptible2(async2((resume2) => {
|
|
84227
|
+
stdout3.write(prompt10, (err) => err ? resume2(fail9(new BadArgument({
|
|
84210
84228
|
module: "Terminal",
|
|
84211
84229
|
method: "display",
|
|
84212
84230
|
description: "Failed to write prompt to stdout",
|
|
@@ -84315,6 +84333,15 @@ var GitService = class extends Effect_exports.Service()(
|
|
|
84315
84333
|
{
|
|
84316
84334
|
effect: Effect_exports.gen(function* () {
|
|
84317
84335
|
const fs = yield* FileSystem_exports.FileSystem;
|
|
84336
|
+
const runCommandWithString = Effect_exports.fn(
|
|
84337
|
+
"runCommandWithString"
|
|
84338
|
+
)(function* (...commandArgs) {
|
|
84339
|
+
const cwd = yield* Config_exports.string("cwd");
|
|
84340
|
+
const command2 = Command_exports2.make(...commandArgs).pipe(
|
|
84341
|
+
Command_exports2.workingDirectory(cwd)
|
|
84342
|
+
);
|
|
84343
|
+
return (yield* Command_exports2.string(command2)).trim();
|
|
84344
|
+
});
|
|
84318
84345
|
return {
|
|
84319
84346
|
ensureIsGitRepo: Effect_exports.fn("ensureIsGitRepo")(
|
|
84320
84347
|
function* () {
|
|
@@ -84329,6 +84356,19 @@ var GitService = class extends Effect_exports.Service()(
|
|
|
84329
84356
|
}
|
|
84330
84357
|
}
|
|
84331
84358
|
),
|
|
84359
|
+
getUncommittedChanges: Effect_exports.fn(
|
|
84360
|
+
"getUncommittedChanges"
|
|
84361
|
+
)(function* () {
|
|
84362
|
+
const statusOutput = yield* runCommandWithString(
|
|
84363
|
+
"git",
|
|
84364
|
+
"status",
|
|
84365
|
+
"--porcelain"
|
|
84366
|
+
);
|
|
84367
|
+
return {
|
|
84368
|
+
hasUncommittedChanges: statusOutput !== "",
|
|
84369
|
+
statusOutput
|
|
84370
|
+
};
|
|
84371
|
+
}),
|
|
84332
84372
|
ensureBranchConnected: Effect_exports.fn(
|
|
84333
84373
|
"ensureBranchConnected"
|
|
84334
84374
|
)(function* (targetBranch) {
|
|
@@ -84387,15 +84427,7 @@ var GitService = class extends Effect_exports.Service()(
|
|
|
84387
84427
|
);
|
|
84388
84428
|
return yield* Command_exports2.exitCode(command2);
|
|
84389
84429
|
}),
|
|
84390
|
-
runCommandWithString
|
|
84391
|
-
function* (...commandArgs) {
|
|
84392
|
-
const cwd = yield* Config_exports.string("cwd");
|
|
84393
|
-
const command2 = Command_exports2.make(...commandArgs).pipe(
|
|
84394
|
-
Command_exports2.workingDirectory(cwd)
|
|
84395
|
-
);
|
|
84396
|
-
return (yield* Command_exports2.string(command2)).trim();
|
|
84397
|
-
}
|
|
84398
|
-
)
|
|
84430
|
+
runCommandWithString
|
|
84399
84431
|
};
|
|
84400
84432
|
}),
|
|
84401
84433
|
dependencies: [NodeContext_exports.layer]
|
|
@@ -84529,7 +84561,7 @@ var cherryPick = Command_exports.make(
|
|
|
84529
84561
|
);
|
|
84530
84562
|
|
|
84531
84563
|
// src/exercise.ts
|
|
84532
|
-
var
|
|
84564
|
+
var import_prompts3 = __toESM(require_prompts3());
|
|
84533
84565
|
var InvalidPathError = class extends Data_exports.TaggedError(
|
|
84534
84566
|
"InvalidPathError"
|
|
84535
84567
|
) {
|
|
@@ -84610,13 +84642,13 @@ var Lesson = class {
|
|
|
84610
84642
|
});
|
|
84611
84643
|
}
|
|
84612
84644
|
};
|
|
84613
|
-
var getNameAndNumberFromPath = (
|
|
84614
|
-
const numSection =
|
|
84645
|
+
var getNameAndNumberFromPath = (path15) => {
|
|
84646
|
+
const numSection = path15.split("-")[0];
|
|
84615
84647
|
if (typeof numSection === "undefined") {
|
|
84616
84648
|
return Effect_exports.fail(
|
|
84617
84649
|
new InvalidPathError({
|
|
84618
|
-
path:
|
|
84619
|
-
message: `Could not retrieve number from path: ${
|
|
84650
|
+
path: path15,
|
|
84651
|
+
message: `Could not retrieve number from path: ${path15}`
|
|
84620
84652
|
})
|
|
84621
84653
|
);
|
|
84622
84654
|
}
|
|
@@ -84624,18 +84656,18 @@ var getNameAndNumberFromPath = (path14) => {
|
|
|
84624
84656
|
if (Number.isNaN(num)) {
|
|
84625
84657
|
return Effect_exports.fail(
|
|
84626
84658
|
new PathNumberIsNaNError({
|
|
84627
|
-
path:
|
|
84659
|
+
path: path15,
|
|
84628
84660
|
numSection,
|
|
84629
|
-
message: `Could not retrieve number from path: ${
|
|
84661
|
+
message: `Could not retrieve number from path: ${path15}`
|
|
84630
84662
|
})
|
|
84631
84663
|
);
|
|
84632
84664
|
}
|
|
84633
|
-
const name =
|
|
84665
|
+
const name = path15.split("-").slice(1).join("-");
|
|
84634
84666
|
if (!name) {
|
|
84635
84667
|
return Effect_exports.fail(
|
|
84636
84668
|
new InvalidPathError({
|
|
84637
|
-
path:
|
|
84638
|
-
message: `Could not retrieve name from path: ${
|
|
84669
|
+
path: path15,
|
|
84670
|
+
message: `Could not retrieve name from path: ${path15}`
|
|
84639
84671
|
})
|
|
84640
84672
|
);
|
|
84641
84673
|
}
|
|
@@ -84644,12 +84676,12 @@ var getNameAndNumberFromPath = (path14) => {
|
|
|
84644
84676
|
num
|
|
84645
84677
|
});
|
|
84646
84678
|
};
|
|
84647
|
-
var parseSection = Effect_exports.fn("parseSection")(function* (
|
|
84648
|
-
const { name, num } = yield* getNameAndNumberFromPath(
|
|
84679
|
+
var parseSection = Effect_exports.fn("parseSection")(function* (path15) {
|
|
84680
|
+
const { name, num } = yield* getNameAndNumberFromPath(path15);
|
|
84649
84681
|
return {
|
|
84650
84682
|
name,
|
|
84651
84683
|
num,
|
|
84652
|
-
path:
|
|
84684
|
+
path: path15
|
|
84653
84685
|
};
|
|
84654
84686
|
});
|
|
84655
84687
|
var filterMeOut = Symbol("filterMeOut");
|
|
@@ -84887,7 +84919,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
84887
84919
|
readmeMessage: "Once you've read the readme, you can go to the next exercise."
|
|
84888
84920
|
};
|
|
84889
84921
|
const { choice: choice6 } = yield* runPrompt(
|
|
84890
|
-
() => (0,
|
|
84922
|
+
() => (0, import_prompts3.default)([
|
|
84891
84923
|
{
|
|
84892
84924
|
type: "select",
|
|
84893
84925
|
name: "choice",
|
|
@@ -84978,7 +85010,7 @@ var chooseLessonAndRunIt = (opts) => Effect_exports.gen(function* () {
|
|
|
84978
85010
|
);
|
|
84979
85011
|
yield* Console_exports.clear;
|
|
84980
85012
|
const { lesson: lessonNumber } = yield* runPrompt(
|
|
84981
|
-
() => (0,
|
|
85013
|
+
() => (0, import_prompts3.default)([
|
|
84982
85014
|
{
|
|
84983
85015
|
type: "autocomplete",
|
|
84984
85016
|
name: "lesson",
|
|
@@ -85086,7 +85118,7 @@ var selectSubfolderIndex = Effect_exports.fn("selectSubfolder")(
|
|
|
85086
85118
|
});
|
|
85087
85119
|
}
|
|
85088
85120
|
const result = yield* runPrompt(
|
|
85089
|
-
() => (0,
|
|
85121
|
+
() => (0, import_prompts3.default)([
|
|
85090
85122
|
{
|
|
85091
85123
|
type: "select",
|
|
85092
85124
|
name: "subfolderIndex",
|
|
@@ -85137,8 +85169,8 @@ var RunLessonSimpleError = class extends Data_exports.TaggedError(
|
|
|
85137
85169
|
) {
|
|
85138
85170
|
};
|
|
85139
85171
|
var notFound2 = Symbol("notFound");
|
|
85140
|
-
var getNumberFromPathSegment = (
|
|
85141
|
-
const numberSegment =
|
|
85172
|
+
var getNumberFromPathSegment = (path15) => {
|
|
85173
|
+
const numberSegment = path15.split("-")[0];
|
|
85142
85174
|
return Number.isNaN(Number(numberSegment)) ? notFound2 : Number(numberSegment);
|
|
85143
85175
|
};
|
|
85144
85176
|
var startsWithNumber = (segment) => {
|
|
@@ -85278,6 +85310,7 @@ var updateCVM = Command_exports.make(
|
|
|
85278
85310
|
yield* Effect_exports.logError(
|
|
85279
85311
|
"[update-cvm] Failed to update the CVM: " + output
|
|
85280
85312
|
);
|
|
85313
|
+
process.exitCode = 1;
|
|
85281
85314
|
return;
|
|
85282
85315
|
}
|
|
85283
85316
|
yield* Effect_exports.log(
|
|
@@ -85792,6 +85825,8 @@ var getDiffs = Command_exports.make(
|
|
|
85792
85825
|
)
|
|
85793
85826
|
},
|
|
85794
85827
|
({ branch, projectRepo, root }) => Effect_exports.gen(function* () {
|
|
85828
|
+
const git = yield* GitService;
|
|
85829
|
+
yield* git.ensureIsGitRepo();
|
|
85795
85830
|
yield* Console_exports.log("Starting get-diffs command...");
|
|
85796
85831
|
if (!NFS.existsSync(projectRepo)) {
|
|
85797
85832
|
return yield* Effect_exports.fail(
|
|
@@ -86032,6 +86067,11 @@ var getDiffs = Command_exports.make(
|
|
|
86032
86067
|
}
|
|
86033
86068
|
yield* Console_exports.log("=".repeat(50));
|
|
86034
86069
|
}).pipe(
|
|
86070
|
+
Effect_exports.withConfigProvider(
|
|
86071
|
+
ConfigProvider_exports.fromJson({
|
|
86072
|
+
cwd: projectRepo
|
|
86073
|
+
})
|
|
86074
|
+
),
|
|
86035
86075
|
Effect_exports.catchTags({
|
|
86036
86076
|
InvalidProjectRepoError: (error4) => {
|
|
86037
86077
|
return Effect_exports.gen(function* () {
|
|
@@ -86060,9 +86100,220 @@ var getDiffs = Command_exports.make(
|
|
|
86060
86100
|
"Get commit diffs from a project repo and save to exercise folders"
|
|
86061
86101
|
)
|
|
86062
86102
|
);
|
|
86103
|
+
var InvalidProjectRepoError2 = class extends Data_exports.TaggedError(
|
|
86104
|
+
"InvalidProjectRepoError"
|
|
86105
|
+
) {
|
|
86106
|
+
};
|
|
86107
|
+
(class extends Data_exports.TaggedError(
|
|
86108
|
+
"DiffGenerationError"
|
|
86109
|
+
) {
|
|
86110
|
+
});
|
|
86111
|
+
(class extends Data_exports.TaggedError(
|
|
86112
|
+
"DirtyWorkingTreeError"
|
|
86113
|
+
) {
|
|
86114
|
+
});
|
|
86115
|
+
var NoCommitsFoundError = class extends Data_exports.TaggedError(
|
|
86116
|
+
"NoCommitsFoundError"
|
|
86117
|
+
) {
|
|
86118
|
+
};
|
|
86119
|
+
var diffsToRepo = Command_exports.make(
|
|
86120
|
+
"diffs-to-repo",
|
|
86121
|
+
{
|
|
86122
|
+
projectRepo: Options_exports.text("project-repo").pipe(
|
|
86123
|
+
Options_exports.withDescription(
|
|
86124
|
+
"The path to the project repository"
|
|
86125
|
+
)
|
|
86126
|
+
),
|
|
86127
|
+
liveBranch: Options_exports.text("live-branch").pipe(
|
|
86128
|
+
Options_exports.withDescription("Branch to get diffs from"),
|
|
86129
|
+
Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
|
|
86130
|
+
),
|
|
86131
|
+
mainBranch: Options_exports.text("main-branch").pipe(
|
|
86132
|
+
Options_exports.withDescription("The main branch of the project"),
|
|
86133
|
+
Options_exports.withDefault("main")
|
|
86134
|
+
),
|
|
86135
|
+
targetDir: Options_exports.text("target-dir").pipe(
|
|
86136
|
+
Options_exports.withDescription(
|
|
86137
|
+
"Directory where lesson folders will be created"
|
|
86138
|
+
),
|
|
86139
|
+
Options_exports.withDefault(path5__namespace.join(process.cwd(), "lessons"))
|
|
86140
|
+
)
|
|
86141
|
+
},
|
|
86142
|
+
({ liveBranch, mainBranch, projectRepo, targetDir }) => Effect_exports.gen(function* () {
|
|
86143
|
+
const git = yield* GitService;
|
|
86144
|
+
yield* git.ensureIsGitRepo();
|
|
86145
|
+
yield* Console_exports.log("Starting get-diffs command...");
|
|
86146
|
+
if (!NFS.existsSync(projectRepo)) {
|
|
86147
|
+
return yield* Effect_exports.fail(
|
|
86148
|
+
new InvalidProjectRepoError2({
|
|
86149
|
+
path: projectRepo,
|
|
86150
|
+
message: `Project repo does not exist at path: ${projectRepo}`
|
|
86151
|
+
})
|
|
86152
|
+
);
|
|
86153
|
+
}
|
|
86154
|
+
const gitDirPath = path5__namespace.join(projectRepo, ".git");
|
|
86155
|
+
if (!NFS.existsSync(gitDirPath)) {
|
|
86156
|
+
return yield* Effect_exports.fail(
|
|
86157
|
+
new InvalidProjectRepoError2({
|
|
86158
|
+
path: projectRepo,
|
|
86159
|
+
message: `Project repo is not a git repository: ${projectRepo}`
|
|
86160
|
+
})
|
|
86161
|
+
);
|
|
86162
|
+
}
|
|
86163
|
+
yield* Console_exports.log("Fetching latest from origin...");
|
|
86164
|
+
const gitFetchCommand = Command_exports2.make(
|
|
86165
|
+
"git",
|
|
86166
|
+
"fetch",
|
|
86167
|
+
"origin"
|
|
86168
|
+
).pipe(Command_exports2.workingDirectory(projectRepo));
|
|
86169
|
+
const fetchExitCode = yield* Command_exports2.exitCode(
|
|
86170
|
+
gitFetchCommand
|
|
86171
|
+
).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
|
|
86172
|
+
if (fetchExitCode !== 0) {
|
|
86173
|
+
return yield* Effect_exports.fail(
|
|
86174
|
+
new InvalidProjectRepoError2({
|
|
86175
|
+
path: projectRepo,
|
|
86176
|
+
message: `Failed to fetch from origin`
|
|
86177
|
+
})
|
|
86178
|
+
);
|
|
86179
|
+
}
|
|
86180
|
+
yield* Console_exports.log(`\u2713 Fetched latest from origin`);
|
|
86181
|
+
yield* Console_exports.log(
|
|
86182
|
+
`\u2713 Validated project repo: ${projectRepo}`
|
|
86183
|
+
);
|
|
86184
|
+
yield* Console_exports.log(`\u2713 Target directory: ${targetDir}`);
|
|
86185
|
+
yield* Console_exports.log("\nRetrieving commit history...");
|
|
86186
|
+
const gitLogCommand = Command_exports2.make(
|
|
86187
|
+
"git",
|
|
86188
|
+
"log",
|
|
86189
|
+
"--oneline",
|
|
86190
|
+
"--reverse",
|
|
86191
|
+
// Chronological order (oldest first)
|
|
86192
|
+
`${mainBranch}..${liveBranch}`
|
|
86193
|
+
// Only commits on liveBranch not in mainBranch
|
|
86194
|
+
).pipe(Command_exports2.workingDirectory(projectRepo));
|
|
86195
|
+
const commitHistory = yield* Command_exports2.string(gitLogCommand);
|
|
86196
|
+
const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4, index) => {
|
|
86197
|
+
const [sha, ...messageParts] = line4.split(" ");
|
|
86198
|
+
const message = messageParts.join(" ");
|
|
86199
|
+
return {
|
|
86200
|
+
sha,
|
|
86201
|
+
message,
|
|
86202
|
+
sequence: index + 1
|
|
86203
|
+
// 1-based sequence
|
|
86204
|
+
};
|
|
86205
|
+
});
|
|
86206
|
+
if (commits.length === 0) {
|
|
86207
|
+
return yield* Effect_exports.fail(
|
|
86208
|
+
new NoCommitsFoundError({ mainBranch, liveBranch })
|
|
86209
|
+
);
|
|
86210
|
+
}
|
|
86211
|
+
yield* Console_exports.dir(commits, { depth: Infinity });
|
|
86212
|
+
yield* Console_exports.log(
|
|
86213
|
+
`\u2713 Found ${commits.length} commits to process`
|
|
86214
|
+
);
|
|
86215
|
+
yield* Console_exports.log("\nGenerating and saving diffs...");
|
|
86216
|
+
const fs = yield* FileSystem_exports.FileSystem;
|
|
86217
|
+
let savedCount = 0;
|
|
86218
|
+
let errorCount = 0;
|
|
86219
|
+
const errors = [];
|
|
86220
|
+
const toDashCase = (str) => {
|
|
86221
|
+
return str.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
86222
|
+
};
|
|
86223
|
+
const sectionDir = path5__namespace.join(targetDir, "01-first-section");
|
|
86224
|
+
yield* fs.makeDirectory(sectionDir, { recursive: true });
|
|
86225
|
+
for (const commit of commits) {
|
|
86226
|
+
const result = yield* Effect_exports.gen(function* () {
|
|
86227
|
+
const gitShowCommand = Command_exports2.make(
|
|
86228
|
+
"git",
|
|
86229
|
+
"show",
|
|
86230
|
+
"-W",
|
|
86231
|
+
commit.sha,
|
|
86232
|
+
"--",
|
|
86233
|
+
".",
|
|
86234
|
+
":!pnpm-lock.yaml",
|
|
86235
|
+
":!package-lock.json",
|
|
86236
|
+
":!yarn.lock",
|
|
86237
|
+
":!*.lock"
|
|
86238
|
+
).pipe(Command_exports2.workingDirectory(projectRepo));
|
|
86239
|
+
const diff8 = yield* Command_exports2.string(gitShowCommand);
|
|
86240
|
+
const lessonNumber = `01.${commit.sequence.toString().padStart(2, "0")}`;
|
|
86241
|
+
const lessonName = toDashCase(commit.message);
|
|
86242
|
+
const lessonFolderName = `${lessonNumber}-${lessonName}`;
|
|
86243
|
+
const lessonPath = path5__namespace.join(sectionDir, lessonFolderName);
|
|
86244
|
+
const explainerPath = path5__namespace.join(lessonPath, "explainer");
|
|
86245
|
+
yield* fs.makeDirectory(explainerPath, { recursive: true });
|
|
86246
|
+
const diffPath = path5__namespace.join(explainerPath, "solution.diff");
|
|
86247
|
+
yield* fs.writeFileString(diffPath, diff8);
|
|
86248
|
+
yield* Console_exports.log(` \u2713 Created: 01-first-section/${lessonFolderName}/explainer/solution.diff`);
|
|
86249
|
+
return { status: "saved" };
|
|
86250
|
+
}).pipe(
|
|
86251
|
+
Effect_exports.catchAll(
|
|
86252
|
+
(error4) => Effect_exports.gen(function* () {
|
|
86253
|
+
yield* Console_exports.log(` \u2717 Error processing commit ${commit.sha}: ${error4}`);
|
|
86254
|
+
errors.push(`${commit.sha}: ${error4}`);
|
|
86255
|
+
return { status: "error" };
|
|
86256
|
+
})
|
|
86257
|
+
)
|
|
86258
|
+
);
|
|
86259
|
+
if (result.status === "saved") {
|
|
86260
|
+
savedCount++;
|
|
86261
|
+
} else if (result.status === "error") {
|
|
86262
|
+
errorCount++;
|
|
86263
|
+
}
|
|
86264
|
+
}
|
|
86265
|
+
yield* Console_exports.log("\n" + "=".repeat(50));
|
|
86266
|
+
yield* Console_exports.log("Summary:");
|
|
86267
|
+
yield* Console_exports.log(
|
|
86268
|
+
` Total commits processed: ${commits.length}`
|
|
86269
|
+
);
|
|
86270
|
+
yield* Console_exports.log(` Lessons created: ${savedCount}`);
|
|
86271
|
+
yield* Console_exports.log(` Errors: ${errorCount}`);
|
|
86272
|
+
yield* Console_exports.log(` Target directory: ${targetDir}`);
|
|
86273
|
+
if (errors.length > 0) {
|
|
86274
|
+
yield* Console_exports.log("\nErrors encountered:");
|
|
86275
|
+
for (const error4 of errors) {
|
|
86276
|
+
yield* Console_exports.log(` - ${error4}`);
|
|
86277
|
+
}
|
|
86278
|
+
}
|
|
86279
|
+
yield* Console_exports.log("=".repeat(50));
|
|
86280
|
+
}).pipe(
|
|
86281
|
+
Effect_exports.withConfigProvider(
|
|
86282
|
+
ConfigProvider_exports.fromJson({
|
|
86283
|
+
cwd: projectRepo
|
|
86284
|
+
})
|
|
86285
|
+
),
|
|
86286
|
+
Effect_exports.catchTags({
|
|
86287
|
+
InvalidProjectRepoError: (error4) => {
|
|
86288
|
+
return Effect_exports.gen(function* () {
|
|
86289
|
+
yield* Console_exports.error(`Error: ${error4.message}`);
|
|
86290
|
+
process.exitCode = 1;
|
|
86291
|
+
});
|
|
86292
|
+
},
|
|
86293
|
+
NoCommitsFoundError: (error4) => {
|
|
86294
|
+
return Effect_exports.gen(function* () {
|
|
86295
|
+
yield* Console_exports.error(
|
|
86296
|
+
`Error: No commits found on ${error4.liveBranch} beyond ${error4.mainBranch}`
|
|
86297
|
+
);
|
|
86298
|
+
process.exitCode = 1;
|
|
86299
|
+
});
|
|
86300
|
+
}
|
|
86301
|
+
}),
|
|
86302
|
+
Effect_exports.catchAll((error4) => {
|
|
86303
|
+
return Effect_exports.gen(function* () {
|
|
86304
|
+
yield* Console_exports.error(`Unexpected error: ${error4}`);
|
|
86305
|
+
process.exitCode = 1;
|
|
86306
|
+
});
|
|
86307
|
+
})
|
|
86308
|
+
)
|
|
86309
|
+
).pipe(
|
|
86310
|
+
Command_exports.withDescription(
|
|
86311
|
+
"Generate sequential lesson folders from commits on live branch"
|
|
86312
|
+
)
|
|
86313
|
+
);
|
|
86063
86314
|
|
|
86064
86315
|
// src/internal/edit-commit.ts
|
|
86065
|
-
var
|
|
86316
|
+
var import_prompts4 = __toESM(require_prompts3());
|
|
86066
86317
|
var NotAGitRepoError3 = class extends Data_exports.TaggedError(
|
|
86067
86318
|
"NotAGitRepoError"
|
|
86068
86319
|
) {
|
|
@@ -86240,7 +86491,7 @@ var editCommit = Command_exports.make(
|
|
|
86240
86491
|
"\nSession active. Make your changes to the code. ALL unstaged changes will be added to the commit."
|
|
86241
86492
|
);
|
|
86242
86493
|
const { ready } = yield* runPrompt(
|
|
86243
|
-
() => (0,
|
|
86494
|
+
() => (0, import_prompts4.default)([
|
|
86244
86495
|
{
|
|
86245
86496
|
type: "confirm",
|
|
86246
86497
|
name: "ready",
|
|
@@ -86326,7 +86577,7 @@ Cherry-picking ${followingCommitCount} commit${followingCommitCount === 1 ? "" :
|
|
|
86326
86577
|
\u2713 Edit complete! Lesson ${selectedLessonId} updated.`
|
|
86327
86578
|
);
|
|
86328
86579
|
const { saveToTarget } = yield* runPrompt(
|
|
86329
|
-
() => (0,
|
|
86580
|
+
() => (0, import_prompts4.default)([
|
|
86330
86581
|
{
|
|
86331
86582
|
type: "confirm",
|
|
86332
86583
|
name: "saveToTarget",
|
|
@@ -86387,7 +86638,7 @@ Cherry-picking ${followingCommitCount} commit${followingCommitCount === 1 ? "" :
|
|
|
86387
86638
|
`\u2713 ${branch} updated with your changes`
|
|
86388
86639
|
);
|
|
86389
86640
|
const { forcePush } = yield* runPrompt(
|
|
86390
|
-
() => (0,
|
|
86641
|
+
() => (0, import_prompts4.default)([
|
|
86391
86642
|
{
|
|
86392
86643
|
type: "confirm",
|
|
86393
86644
|
name: "forcePush",
|
|
@@ -86491,7 +86742,7 @@ function resolveConflictLoop(cwd) {
|
|
|
86491
86742
|
);
|
|
86492
86743
|
yield* Command_exports2.exitCode(statusCommand);
|
|
86493
86744
|
const { action } = yield* runPrompt(
|
|
86494
|
-
() => (0,
|
|
86745
|
+
() => (0, import_prompts4.default)([
|
|
86495
86746
|
{
|
|
86496
86747
|
type: "select",
|
|
86497
86748
|
name: "action",
|
|
@@ -86560,6 +86811,382 @@ function resolveConflictLoop(cwd) {
|
|
|
86560
86811
|
});
|
|
86561
86812
|
}
|
|
86562
86813
|
|
|
86814
|
+
// src/internal/rebase-to-main.ts
|
|
86815
|
+
var rebaseToMain = Command_exports.make(
|
|
86816
|
+
"rebase-to-main",
|
|
86817
|
+
{
|
|
86818
|
+
cwd: Options_exports.text("cwd").pipe(
|
|
86819
|
+
Options_exports.withDescription(
|
|
86820
|
+
"The directory to run the rebase-to-main command in"
|
|
86821
|
+
),
|
|
86822
|
+
Options_exports.withDefault(process.cwd())
|
|
86823
|
+
),
|
|
86824
|
+
target: Options_exports.text("target").pipe(
|
|
86825
|
+
Options_exports.withDescription("The target branch to rebase to"),
|
|
86826
|
+
Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
|
|
86827
|
+
)
|
|
86828
|
+
},
|
|
86829
|
+
(opts) => Effect_exports.gen(function* () {
|
|
86830
|
+
const git = yield* GitService;
|
|
86831
|
+
yield* git.ensureIsGitRepo();
|
|
86832
|
+
const currentBranch = yield* git.getCurrentBranch();
|
|
86833
|
+
if (currentBranch !== "main") {
|
|
86834
|
+
return yield* Effect_exports.fail(
|
|
86835
|
+
new InvalidBranchOperationError({
|
|
86836
|
+
message: `Cannot rebase to main when not on main branch`
|
|
86837
|
+
})
|
|
86838
|
+
);
|
|
86839
|
+
}
|
|
86840
|
+
yield* git.ensureBranchConnected(opts.target);
|
|
86841
|
+
const { hasUncommittedChanges } = yield* git.getUncommittedChanges();
|
|
86842
|
+
if (hasUncommittedChanges) {
|
|
86843
|
+
return yield* Effect_exports.fail(
|
|
86844
|
+
new InvalidBranchOperationError({
|
|
86845
|
+
message: `Cannot rebase to main when there are uncommitted changes`
|
|
86846
|
+
})
|
|
86847
|
+
);
|
|
86848
|
+
}
|
|
86849
|
+
yield* confirmContinue(
|
|
86850
|
+
`Do you want to checkout ${opts.target}?`
|
|
86851
|
+
);
|
|
86852
|
+
const checkoutExitCode = yield* git.runCommandWithExitCode(
|
|
86853
|
+
"git",
|
|
86854
|
+
"checkout",
|
|
86855
|
+
opts.target
|
|
86856
|
+
);
|
|
86857
|
+
if (checkoutExitCode !== 0) {
|
|
86858
|
+
return yield* Effect_exports.fail(
|
|
86859
|
+
new InvalidBranchOperationError({
|
|
86860
|
+
message: `Failed to checkout ${opts.target}`
|
|
86861
|
+
})
|
|
86862
|
+
);
|
|
86863
|
+
}
|
|
86864
|
+
yield* confirmContinue(`Do you want to rebase to main?`);
|
|
86865
|
+
const rebaseExitCode = yield* git.runCommandWithExitCode(
|
|
86866
|
+
"git",
|
|
86867
|
+
"rebase",
|
|
86868
|
+
"main"
|
|
86869
|
+
);
|
|
86870
|
+
if (rebaseExitCode !== 0) {
|
|
86871
|
+
return yield* Effect_exports.fail(
|
|
86872
|
+
new InvalidBranchOperationError({
|
|
86873
|
+
message: `Failed to rebase to main`
|
|
86874
|
+
})
|
|
86875
|
+
);
|
|
86876
|
+
}
|
|
86877
|
+
yield* confirmContinue(
|
|
86878
|
+
`Do you want to force push to ${opts.target}?`
|
|
86879
|
+
);
|
|
86880
|
+
const forcePushExitCode = yield* git.runCommandWithExitCode(
|
|
86881
|
+
"git",
|
|
86882
|
+
"push",
|
|
86883
|
+
"origin",
|
|
86884
|
+
opts.target,
|
|
86885
|
+
"--force-with-lease"
|
|
86886
|
+
);
|
|
86887
|
+
if (forcePushExitCode !== 0) {
|
|
86888
|
+
return yield* Effect_exports.fail(
|
|
86889
|
+
new InvalidBranchOperationError({
|
|
86890
|
+
message: `Failed to force push to ${opts.target}`
|
|
86891
|
+
})
|
|
86892
|
+
);
|
|
86893
|
+
}
|
|
86894
|
+
yield* confirmContinue(`Do you want to checkout main?`);
|
|
86895
|
+
const backToMainExitCode = yield* git.runCommandWithExitCode(
|
|
86896
|
+
"git",
|
|
86897
|
+
"checkout",
|
|
86898
|
+
"main"
|
|
86899
|
+
);
|
|
86900
|
+
if (backToMainExitCode !== 0) {
|
|
86901
|
+
return yield* Effect_exports.fail(
|
|
86902
|
+
new InvalidBranchOperationError({
|
|
86903
|
+
message: `Failed to checkout main`
|
|
86904
|
+
})
|
|
86905
|
+
);
|
|
86906
|
+
}
|
|
86907
|
+
yield* Console_exports.log(
|
|
86908
|
+
`\u2713 Successfully rebased ${opts.target} to main and force pushed`
|
|
86909
|
+
);
|
|
86910
|
+
}).pipe(
|
|
86911
|
+
Effect_exports.withConfigProvider(
|
|
86912
|
+
ConfigProvider_exports.fromJson({
|
|
86913
|
+
cwd: opts.cwd
|
|
86914
|
+
})
|
|
86915
|
+
)
|
|
86916
|
+
)
|
|
86917
|
+
);
|
|
86918
|
+
|
|
86919
|
+
// src/internal/walk-through.ts
|
|
86920
|
+
var import_prompts5 = __toESM(require_prompts3());
|
|
86921
|
+
(class extends Data_exports.TaggedError(
|
|
86922
|
+
"NotAGitRepoError"
|
|
86923
|
+
) {
|
|
86924
|
+
});
|
|
86925
|
+
var InvalidBranchError = class extends Data_exports.TaggedError(
|
|
86926
|
+
"InvalidBranchError"
|
|
86927
|
+
) {
|
|
86928
|
+
};
|
|
86929
|
+
var NoCommitsFoundError2 = class extends Data_exports.TaggedError(
|
|
86930
|
+
"NoCommitsFoundError"
|
|
86931
|
+
) {
|
|
86932
|
+
};
|
|
86933
|
+
var WalkThroughCancelledError = class extends Data_exports.TaggedError(
|
|
86934
|
+
"WalkThroughCancelledError"
|
|
86935
|
+
) {
|
|
86936
|
+
};
|
|
86937
|
+
var HardResetFailedError = class extends Data_exports.TaggedError(
|
|
86938
|
+
"HardResetFailedError"
|
|
86939
|
+
) {
|
|
86940
|
+
};
|
|
86941
|
+
var UndoCommitFailedError = class extends Data_exports.TaggedError(
|
|
86942
|
+
"UndoCommitFailedError"
|
|
86943
|
+
) {
|
|
86944
|
+
};
|
|
86945
|
+
var UnstageFailedError = class extends Data_exports.TaggedError(
|
|
86946
|
+
"UnstageFailedError"
|
|
86947
|
+
) {
|
|
86948
|
+
};
|
|
86949
|
+
var applyDemoReset = (commitSha) => Effect_exports.gen(function* () {
|
|
86950
|
+
const git = yield* GitService;
|
|
86951
|
+
yield* Console_exports.log(`
|
|
86952
|
+
Resetting to ${commitSha}...`);
|
|
86953
|
+
const hardResetExitCode = yield* git.runCommandWithExitCode(
|
|
86954
|
+
"git",
|
|
86955
|
+
"reset",
|
|
86956
|
+
"--hard",
|
|
86957
|
+
commitSha
|
|
86958
|
+
);
|
|
86959
|
+
if (hardResetExitCode !== 0) {
|
|
86960
|
+
yield* Console_exports.error("Failed to reset to commit");
|
|
86961
|
+
process.exitCode = 1;
|
|
86962
|
+
return yield* Effect_exports.fail(
|
|
86963
|
+
new HardResetFailedError({
|
|
86964
|
+
commitSha,
|
|
86965
|
+
message: "Hard reset failed"
|
|
86966
|
+
})
|
|
86967
|
+
);
|
|
86968
|
+
}
|
|
86969
|
+
yield* Console_exports.log("Undoing commit...");
|
|
86970
|
+
const undoExitCode = yield* git.runCommandWithExitCode(
|
|
86971
|
+
"git",
|
|
86972
|
+
"reset",
|
|
86973
|
+
"HEAD^"
|
|
86974
|
+
);
|
|
86975
|
+
if (undoExitCode !== 0) {
|
|
86976
|
+
yield* Console_exports.error("Failed to undo commit");
|
|
86977
|
+
process.exitCode = 1;
|
|
86978
|
+
return yield* Effect_exports.fail(
|
|
86979
|
+
new UndoCommitFailedError({
|
|
86980
|
+
message: "Undo commit failed"
|
|
86981
|
+
})
|
|
86982
|
+
);
|
|
86983
|
+
}
|
|
86984
|
+
yield* Console_exports.log("Unstaging changes...");
|
|
86985
|
+
const unstageExitCode = yield* git.runCommandWithExitCode(
|
|
86986
|
+
"git",
|
|
86987
|
+
"restore",
|
|
86988
|
+
"--staged",
|
|
86989
|
+
"."
|
|
86990
|
+
);
|
|
86991
|
+
if (unstageExitCode !== 0) {
|
|
86992
|
+
yield* Console_exports.error("Failed to unstage changes");
|
|
86993
|
+
process.exitCode = 1;
|
|
86994
|
+
return yield* Effect_exports.fail(
|
|
86995
|
+
new UnstageFailedError({
|
|
86996
|
+
message: "Unstage failed"
|
|
86997
|
+
})
|
|
86998
|
+
);
|
|
86999
|
+
}
|
|
87000
|
+
yield* Console_exports.log(
|
|
87001
|
+
"\u2713 Commit applied with unstaged changes\n"
|
|
87002
|
+
);
|
|
87003
|
+
});
|
|
87004
|
+
var walkThrough = Command_exports.make(
|
|
87005
|
+
"walk-through",
|
|
87006
|
+
{
|
|
87007
|
+
mainBranch: Options_exports.text("main-branch").pipe(
|
|
87008
|
+
Options_exports.withDescription("Base branch to start from"),
|
|
87009
|
+
Options_exports.withDefault("main")
|
|
87010
|
+
),
|
|
87011
|
+
liveBranch: Options_exports.text("live-branch").pipe(
|
|
87012
|
+
Options_exports.withDescription(
|
|
87013
|
+
"Target branch with commits to walk through"
|
|
87014
|
+
),
|
|
87015
|
+
Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
|
|
87016
|
+
)
|
|
87017
|
+
},
|
|
87018
|
+
({ liveBranch, mainBranch }) => Effect_exports.gen(function* () {
|
|
87019
|
+
const git = yield* GitService;
|
|
87020
|
+
const cwd = yield* Config_exports.string("cwd");
|
|
87021
|
+
yield* git.ensureIsGitRepo();
|
|
87022
|
+
yield* git.ensureBranchConnected(liveBranch);
|
|
87023
|
+
const currentBranch = yield* git.getCurrentBranch();
|
|
87024
|
+
if (currentBranch === mainBranch || currentBranch === liveBranch) {
|
|
87025
|
+
yield* Console_exports.log(
|
|
87026
|
+
`You are on ${currentBranch}. Walk-through requires a working branch.`
|
|
87027
|
+
);
|
|
87028
|
+
const { branchName } = yield* runPrompt(
|
|
87029
|
+
() => (0, import_prompts5.default)([
|
|
87030
|
+
{
|
|
87031
|
+
type: "text",
|
|
87032
|
+
name: "branchName",
|
|
87033
|
+
message: "Enter name for new working branch:"
|
|
87034
|
+
}
|
|
87035
|
+
])
|
|
87036
|
+
);
|
|
87037
|
+
const createBranchExitCode = yield* git.runCommandWithExitCode(
|
|
87038
|
+
"git",
|
|
87039
|
+
"checkout",
|
|
87040
|
+
"-b",
|
|
87041
|
+
branchName
|
|
87042
|
+
);
|
|
87043
|
+
if (createBranchExitCode !== 0) {
|
|
87044
|
+
yield* Console_exports.error("Failed to create branch");
|
|
87045
|
+
process.exitCode = 1;
|
|
87046
|
+
return yield* Effect_exports.fail(
|
|
87047
|
+
new InvalidBranchError({
|
|
87048
|
+
branch: branchName,
|
|
87049
|
+
message: "Failed to create branch"
|
|
87050
|
+
})
|
|
87051
|
+
);
|
|
87052
|
+
}
|
|
87053
|
+
yield* Console_exports.log(
|
|
87054
|
+
`\u2713 Created and switched to ${branchName}`
|
|
87055
|
+
);
|
|
87056
|
+
} else {
|
|
87057
|
+
const { hasUncommittedChanges, statusOutput } = yield* git.getUncommittedChanges();
|
|
87058
|
+
if (hasUncommittedChanges) {
|
|
87059
|
+
yield* Console_exports.log(
|
|
87060
|
+
"\nWarning: You have uncommitted changes:"
|
|
87061
|
+
);
|
|
87062
|
+
yield* Console_exports.log(statusOutput);
|
|
87063
|
+
const { confirm } = yield* runPrompt(
|
|
87064
|
+
() => (0, import_prompts5.default)([
|
|
87065
|
+
{
|
|
87066
|
+
type: "confirm",
|
|
87067
|
+
name: "confirm",
|
|
87068
|
+
message: "This will lose all uncommitted work. Continue?",
|
|
87069
|
+
initial: false
|
|
87070
|
+
}
|
|
87071
|
+
])
|
|
87072
|
+
);
|
|
87073
|
+
if (!confirm) {
|
|
87074
|
+
return yield* Effect_exports.fail(
|
|
87075
|
+
new WalkThroughCancelledError()
|
|
87076
|
+
);
|
|
87077
|
+
}
|
|
87078
|
+
}
|
|
87079
|
+
}
|
|
87080
|
+
yield* Console_exports.log(
|
|
87081
|
+
`
|
|
87082
|
+
Retrieving commits between ${mainBranch} and ${liveBranch}...`
|
|
87083
|
+
);
|
|
87084
|
+
const gitLogCommand = Command_exports2.make(
|
|
87085
|
+
"git",
|
|
87086
|
+
"log",
|
|
87087
|
+
"--oneline",
|
|
87088
|
+
"--reverse",
|
|
87089
|
+
`${mainBranch}..${liveBranch}`
|
|
87090
|
+
).pipe(Command_exports2.workingDirectory(cwd));
|
|
87091
|
+
const commitHistory = yield* Command_exports2.string(gitLogCommand);
|
|
87092
|
+
const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4, index) => {
|
|
87093
|
+
const [sha, ...messageParts] = line4.split(" ");
|
|
87094
|
+
const message = messageParts.join(" ");
|
|
87095
|
+
return {
|
|
87096
|
+
sha,
|
|
87097
|
+
message,
|
|
87098
|
+
index
|
|
87099
|
+
};
|
|
87100
|
+
});
|
|
87101
|
+
if (commits.length === 0) {
|
|
87102
|
+
return yield* Effect_exports.fail(
|
|
87103
|
+
new NoCommitsFoundError2({ mainBranch, liveBranch })
|
|
87104
|
+
);
|
|
87105
|
+
}
|
|
87106
|
+
yield* Console_exports.log(
|
|
87107
|
+
`
|
|
87108
|
+
Found ${commits.length} commits to walk through
|
|
87109
|
+
`
|
|
87110
|
+
);
|
|
87111
|
+
let cancelled = false;
|
|
87112
|
+
for (const commit of commits) {
|
|
87113
|
+
const commitNumber = commit.index + 1;
|
|
87114
|
+
yield* Console_exports.log("=".repeat(60));
|
|
87115
|
+
yield* Console_exports.log(
|
|
87116
|
+
`Commit ${commitNumber}/${commits.length}: ${commit.sha}`
|
|
87117
|
+
);
|
|
87118
|
+
yield* Console_exports.log(`Message: ${commit.message}`);
|
|
87119
|
+
yield* Console_exports.log("=".repeat(60));
|
|
87120
|
+
yield* applyDemoReset(commit.sha);
|
|
87121
|
+
const { action } = yield* runPrompt(
|
|
87122
|
+
() => (0, import_prompts5.default)([
|
|
87123
|
+
{
|
|
87124
|
+
type: "select",
|
|
87125
|
+
name: "action",
|
|
87126
|
+
message: `Commit ${commitNumber}/${commits.length} applied. Next?`,
|
|
87127
|
+
choices: [
|
|
87128
|
+
{
|
|
87129
|
+
title: "Continue to next commit",
|
|
87130
|
+
value: "continue"
|
|
87131
|
+
},
|
|
87132
|
+
{
|
|
87133
|
+
title: "Cancel walk-through",
|
|
87134
|
+
value: "cancel"
|
|
87135
|
+
}
|
|
87136
|
+
]
|
|
87137
|
+
}
|
|
87138
|
+
])
|
|
87139
|
+
);
|
|
87140
|
+
if (action === "cancel") {
|
|
87141
|
+
cancelled = true;
|
|
87142
|
+
break;
|
|
87143
|
+
}
|
|
87144
|
+
}
|
|
87145
|
+
yield* Console_exports.log("\n" + "=".repeat(60));
|
|
87146
|
+
yield* Console_exports.log(
|
|
87147
|
+
cancelled ? "Walk-through cancelled" : "Walk-through completed!"
|
|
87148
|
+
);
|
|
87149
|
+
yield* Console_exports.log(`Returning to ${liveBranch}...`);
|
|
87150
|
+
const finalResetExitCode = yield* git.runCommandWithExitCode(
|
|
87151
|
+
"git",
|
|
87152
|
+
"reset",
|
|
87153
|
+
"--hard",
|
|
87154
|
+
liveBranch
|
|
87155
|
+
);
|
|
87156
|
+
if (finalResetExitCode !== 0) {
|
|
87157
|
+
yield* Console_exports.error(
|
|
87158
|
+
`Failed to return to ${liveBranch}`
|
|
87159
|
+
);
|
|
87160
|
+
process.exitCode = 1;
|
|
87161
|
+
return yield* Effect_exports.succeed(void 0);
|
|
87162
|
+
}
|
|
87163
|
+
yield* Console_exports.log(`\u2713 Returned to ${liveBranch}`);
|
|
87164
|
+
yield* Console_exports.log("=".repeat(60));
|
|
87165
|
+
}).pipe(
|
|
87166
|
+
Effect_exports.withConfigProvider(
|
|
87167
|
+
ConfigProvider_exports.fromJson({
|
|
87168
|
+
cwd: process.cwd()
|
|
87169
|
+
})
|
|
87170
|
+
),
|
|
87171
|
+
Effect_exports.catchTags({
|
|
87172
|
+
PromptCancelledError: () => {
|
|
87173
|
+
process.exitCode = 0;
|
|
87174
|
+
return Effect_exports.succeed(void 0);
|
|
87175
|
+
}
|
|
87176
|
+
}),
|
|
87177
|
+
Effect_exports.catchAll((error4) => {
|
|
87178
|
+
return Effect_exports.gen(function* () {
|
|
87179
|
+
yield* Console_exports.error(`Unexpected error: ${error4}`);
|
|
87180
|
+
process.exitCode = 1;
|
|
87181
|
+
});
|
|
87182
|
+
})
|
|
87183
|
+
)
|
|
87184
|
+
).pipe(
|
|
87185
|
+
Command_exports.withDescription(
|
|
87186
|
+
"Walk through commits between branches with demo-style resets"
|
|
87187
|
+
)
|
|
87188
|
+
);
|
|
87189
|
+
|
|
86563
87190
|
// src/internal/internal.ts
|
|
86564
87191
|
var upgradePackages = Command_exports.make(
|
|
86565
87192
|
"upgrade",
|
|
@@ -86612,13 +87239,16 @@ var internal = Command_exports.make("internal").pipe(
|
|
|
86612
87239
|
rename4,
|
|
86613
87240
|
uploadToCloudinary,
|
|
86614
87241
|
getDiffs,
|
|
86615
|
-
|
|
87242
|
+
diffsToRepo,
|
|
87243
|
+
editCommit,
|
|
87244
|
+
rebaseToMain,
|
|
87245
|
+
walkThrough
|
|
86616
87246
|
]),
|
|
86617
87247
|
Command_exports.withDescription("Internal commands for AI Hero")
|
|
86618
87248
|
);
|
|
86619
87249
|
|
|
86620
87250
|
// src/reset.ts
|
|
86621
|
-
var
|
|
87251
|
+
var import_prompts6 = __toESM(require_prompts3());
|
|
86622
87252
|
(class extends Data_exports.TaggedError(
|
|
86623
87253
|
"NotAGitRepoError"
|
|
86624
87254
|
) {
|
|
@@ -86686,7 +87316,7 @@ var reset2 = Command_exports.make(
|
|
|
86686
87316
|
}
|
|
86687
87317
|
if (!problem && !solution && !demo) {
|
|
86688
87318
|
const { state } = yield* runPrompt(
|
|
86689
|
-
() => (0,
|
|
87319
|
+
() => (0, import_prompts6.default)([
|
|
86690
87320
|
{
|
|
86691
87321
|
type: "select",
|
|
86692
87322
|
name: "state",
|
|
@@ -86731,7 +87361,7 @@ var reset2 = Command_exports.make(
|
|
|
86731
87361
|
action = "reset-current";
|
|
86732
87362
|
} else {
|
|
86733
87363
|
const result = yield* runPrompt(
|
|
86734
|
-
() => (0,
|
|
87364
|
+
() => (0, import_prompts6.default)([
|
|
86735
87365
|
{
|
|
86736
87366
|
type: "select",
|
|
86737
87367
|
name: "action",
|
|
@@ -86760,7 +87390,7 @@ var reset2 = Command_exports.make(
|
|
|
86760
87390
|
}
|
|
86761
87391
|
if (action === "create-branch") {
|
|
86762
87392
|
const { branchName } = yield* runPrompt(
|
|
86763
|
-
() => (0,
|
|
87393
|
+
() => (0, import_prompts6.default)([
|
|
86764
87394
|
{
|
|
86765
87395
|
type: "text",
|
|
86766
87396
|
name: "branchName",
|
|
@@ -86789,18 +87419,14 @@ var reset2 = Command_exports.make(
|
|
|
86789
87419
|
return;
|
|
86790
87420
|
}
|
|
86791
87421
|
if (!demo) {
|
|
86792
|
-
const statusOutput = yield* git.
|
|
86793
|
-
|
|
86794
|
-
"status",
|
|
86795
|
-
"--porcelain"
|
|
86796
|
-
);
|
|
86797
|
-
if (statusOutput !== "") {
|
|
87422
|
+
const { hasUncommittedChanges, statusOutput } = yield* git.getUncommittedChanges();
|
|
87423
|
+
if (hasUncommittedChanges) {
|
|
86798
87424
|
yield* Console_exports.log(
|
|
86799
87425
|
"\nWarning: You have uncommitted changes:"
|
|
86800
87426
|
);
|
|
86801
87427
|
yield* Console_exports.log(statusOutput);
|
|
86802
87428
|
const { confirm } = yield* runPrompt(
|
|
86803
|
-
() => (0,
|
|
87429
|
+
() => (0, import_prompts6.default)([
|
|
86804
87430
|
{
|
|
86805
87431
|
type: "confirm",
|
|
86806
87432
|
name: "confirm",
|