ai-hero-cli 0.1.1 → 0.2.1
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 +1238 -564
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -5,7 +5,7 @@ var ChildProcess = require('child_process');
|
|
|
5
5
|
var Crypto = require('crypto');
|
|
6
6
|
var NFS = require('fs');
|
|
7
7
|
var OS = require('os');
|
|
8
|
-
var
|
|
8
|
+
var path5 = require('path');
|
|
9
9
|
var NodeUrl = require('url');
|
|
10
10
|
var readline = require('readline');
|
|
11
11
|
var util = require('util');
|
|
@@ -32,7 +32,7 @@ var ChildProcess__namespace = /*#__PURE__*/_interopNamespace(ChildProcess);
|
|
|
32
32
|
var Crypto__namespace = /*#__PURE__*/_interopNamespace(Crypto);
|
|
33
33
|
var NFS__namespace = /*#__PURE__*/_interopNamespace(NFS);
|
|
34
34
|
var OS__namespace = /*#__PURE__*/_interopNamespace(OS);
|
|
35
|
-
var
|
|
35
|
+
var path5__namespace = /*#__PURE__*/_interopNamespace(path5);
|
|
36
36
|
var NodeUrl__namespace = /*#__PURE__*/_interopNamespace(NodeUrl);
|
|
37
37
|
var readline__namespace = /*#__PURE__*/_interopNamespace(readline);
|
|
38
38
|
|
|
@@ -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(path14) {
|
|
3890
|
+
return assignedPaths.indexOf(path14) !== -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 path14 = node.value;
|
|
3915
|
+
var quotedPath = path14.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 '" + path14 + "'.", line4, column3);
|
|
3920
3920
|
}
|
|
3921
3921
|
assignedPaths.push(quotedPath);
|
|
3922
|
-
context7 = deepRef(data,
|
|
3923
|
-
currentPath =
|
|
3922
|
+
context7 = deepRef(data, path14, /* @__PURE__ */ Object.create(null), line4, column3);
|
|
3923
|
+
currentPath = path14;
|
|
3924
3924
|
}
|
|
3925
3925
|
function addTableArray(node) {
|
|
3926
|
-
var
|
|
3927
|
-
var quotedPath =
|
|
3926
|
+
var path14 = node.value;
|
|
3927
|
+
var quotedPath = path14.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
|
-
context7 = deepRef(data,
|
|
3937
|
+
context7 = deepRef(data, path14, [], line4, column3);
|
|
3938
3938
|
currentPath = quotedPath;
|
|
3939
3939
|
if (context7 instanceof Array) {
|
|
3940
3940
|
var newObj = /* @__PURE__ */ Object.create(null);
|
|
3941
3941
|
context7.push(newObj);
|
|
3942
3942
|
context7 = newObj;
|
|
3943
3943
|
} else {
|
|
3944
|
-
genError("Cannot redefine existing key '" +
|
|
3944
|
+
genError("Cannot redefine existing key '" + path14 + "'.", 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, path14) {
|
|
4090
|
+
const ctrl = callVisitor(key, node, visitor, path14);
|
|
4091
4091
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4092
|
-
replaceNode(key,
|
|
4093
|
-
return visit_(key, ctrl, visitor,
|
|
4092
|
+
replaceNode(key, path14, ctrl);
|
|
4093
|
+
return visit_(key, ctrl, visitor, path14);
|
|
4094
4094
|
}
|
|
4095
4095
|
if (typeof ctrl !== "symbol") {
|
|
4096
4096
|
if (identity3.isCollection(node)) {
|
|
4097
|
-
|
|
4097
|
+
path14 = Object.freeze(path14.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, path14);
|
|
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
|
+
path14 = Object.freeze(path14.concat(node));
|
|
4111
|
+
const ck = visit_("key", node.key, visitor, path14);
|
|
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, path14);
|
|
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, path14) {
|
|
4138
|
+
const ctrl = await callVisitor(key, node, visitor, path14);
|
|
4139
4139
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4140
|
-
replaceNode(key,
|
|
4141
|
-
return visitAsync_(key, ctrl, visitor,
|
|
4140
|
+
replaceNode(key, path14, ctrl);
|
|
4141
|
+
return visitAsync_(key, ctrl, visitor, path14);
|
|
4142
4142
|
}
|
|
4143
4143
|
if (typeof ctrl !== "symbol") {
|
|
4144
4144
|
if (identity3.isCollection(node)) {
|
|
4145
|
-
|
|
4145
|
+
path14 = Object.freeze(path14.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, path14);
|
|
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
|
+
path14 = Object.freeze(path14.concat(node));
|
|
4159
|
+
const ck = await visitAsync_("key", node.key, visitor, path14);
|
|
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, path14);
|
|
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, path14) {
|
|
4192
4192
|
if (typeof visitor === "function")
|
|
4193
|
-
return visitor(key, node,
|
|
4193
|
+
return visitor(key, node, path14);
|
|
4194
4194
|
if (identity3.isMap(node))
|
|
4195
|
-
return visitor.Map?.(key, node,
|
|
4195
|
+
return visitor.Map?.(key, node, path14);
|
|
4196
4196
|
if (identity3.isSeq(node))
|
|
4197
|
-
return visitor.Seq?.(key, node,
|
|
4197
|
+
return visitor.Seq?.(key, node, path14);
|
|
4198
4198
|
if (identity3.isPair(node))
|
|
4199
|
-
return visitor.Pair?.(key, node,
|
|
4199
|
+
return visitor.Pair?.(key, node, path14);
|
|
4200
4200
|
if (identity3.isScalar(node))
|
|
4201
|
-
return visitor.Scalar?.(key, node,
|
|
4201
|
+
return visitor.Scalar?.(key, node, path14);
|
|
4202
4202
|
if (identity3.isAlias(node))
|
|
4203
|
-
return visitor.Alias?.(key, node,
|
|
4203
|
+
return visitor.Alias?.(key, node, path14);
|
|
4204
4204
|
return void 0;
|
|
4205
4205
|
}
|
|
4206
|
-
function replaceNode(key,
|
|
4207
|
-
const parent =
|
|
4206
|
+
function replaceNode(key, path14, node) {
|
|
4207
|
+
const parent = path14[path14.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, path14, value5) {
|
|
4807
4807
|
let v = value5;
|
|
4808
|
-
for (let i =
|
|
4809
|
-
const k =
|
|
4808
|
+
for (let i = path14.length - 1; i >= 0; --i) {
|
|
4809
|
+
const k = path14[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 = (path14) => path14 == null || typeof path14 === "object" && !!path14[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(path14, value5) {
|
|
4859
|
+
if (isEmptyPath(path14))
|
|
4860
4860
|
this.add(value5);
|
|
4861
4861
|
else {
|
|
4862
|
-
const [key, ...rest] =
|
|
4862
|
+
const [key, ...rest] = path14;
|
|
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(path14) {
|
|
4877
|
+
const [key, ...rest] = path14;
|
|
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(path14, keepScalar) {
|
|
4892
|
+
const [key, ...rest] = path14;
|
|
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(path14) {
|
|
4911
|
+
const [key, ...rest] = path14;
|
|
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(path14, value5) {
|
|
4922
|
+
const [key, ...rest] = path14;
|
|
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(path14, value5) {
|
|
7392
7392
|
if (assertCollection(this.contents))
|
|
7393
|
-
this.contents.addIn(
|
|
7393
|
+
this.contents.addIn(path14, 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(path14) {
|
|
7469
|
+
if (Collection.isEmptyPath(path14)) {
|
|
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(path14) : 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(path14, keepScalar) {
|
|
7491
|
+
if (Collection.isEmptyPath(path14))
|
|
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(path14, 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(path14) {
|
|
7505
|
+
if (Collection.isEmptyPath(path14))
|
|
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(path14) : 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(path14, value5) {
|
|
7525
|
+
if (Collection.isEmptyPath(path14)) {
|
|
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(path14), value5);
|
|
7529
7529
|
} else if (assertCollection(this.contents)) {
|
|
7530
|
-
this.contents.setIn(
|
|
7530
|
+
this.contents.setIn(path14, 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, path14) => {
|
|
9463
9463
|
let item = cst;
|
|
9464
|
-
for (const [field, index] of
|
|
9464
|
+
for (const [field, index] of path14) {
|
|
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, path14) => {
|
|
9474
|
+
const parent = visit.itemAtPath(cst, path14.slice(0, -1));
|
|
9475
|
+
const field = path14[path14.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(path14, item, visitor) {
|
|
9482
|
+
let ctrl = visitor(item, path14);
|
|
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(path14.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, path14);
|
|
9501
9501
|
}
|
|
9502
9502
|
}
|
|
9503
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9503
|
+
return typeof ctrl === "function" ? ctrl(item, path14) : 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(prompt6, perLine) {
|
|
11486
11486
|
if (!perLine) return erase.line + cursor.to(0);
|
|
11487
11487
|
let rows = 0;
|
|
11488
|
-
const lines4 =
|
|
11488
|
+
const lines4 = prompt6.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 prompt6 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
13090
13090
|
if (this.showMinError) {
|
|
13091
|
-
|
|
13091
|
+
prompt6 += 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
|
+
prompt6 += this.renderOptions(this.value);
|
|
13095
|
+
this.out.write(this.clear + prompt6);
|
|
13096
|
+
this.clear = clear3(prompt6, 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 prompt6 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
13502
13502
|
if (this.showMinError) {
|
|
13503
|
-
|
|
13503
|
+
prompt6 += 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
|
+
prompt6 += this.renderOptions(this.filteredOptions);
|
|
13507
|
+
this.out.write(this.clear + prompt6);
|
|
13508
|
+
this.clear = clear3(prompt6, 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 prompt6() {
|
|
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 = prompt6._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 = prompt6._injected ? getInjectedAnswer(prompt6._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
|
+
prompt6._injected = (prompt6._injected || []).concat(answers);
|
|
13872
13872
|
}
|
|
13873
13873
|
function override(answers) {
|
|
13874
|
-
|
|
13874
|
+
prompt6._override = Object.assign({}, answers);
|
|
13875
13875
|
}
|
|
13876
|
-
module.exports = Object.assign(
|
|
13877
|
-
prompt:
|
|
13876
|
+
module.exports = Object.assign(prompt6, {
|
|
13877
|
+
prompt: prompt6,
|
|
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(prompt6, perLine) {
|
|
13942
13942
|
if (!perLine) return erase.line + cursor.to(0);
|
|
13943
13943
|
let rows = 0;
|
|
13944
|
-
const lines4 =
|
|
13944
|
+
const lines4 = prompt6.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 prompt6 = [
|
|
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
|
+
prompt6 += 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
|
+
prompt6 += this.renderOptions(this.value);
|
|
15394
|
+
this.out.write(this.clear + prompt6);
|
|
15395
|
+
this.clear = clear3(prompt6, 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 prompt6 = [
|
|
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
|
+
prompt6 += 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
|
+
prompt6 += this.renderOptions(this.filteredOptions);
|
|
15768
|
+
this.out.write(this.clear + prompt6);
|
|
15769
|
+
this.clear = clear3(prompt6, 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 prompt6(questions = [], { onSubmit = noop, onCancel = noop } = {}) {
|
|
15938
15938
|
const answers = {};
|
|
15939
|
-
const override2 =
|
|
15939
|
+
const override2 = prompt6._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 = prompt6._injected ? getInjectedAnswer(prompt6._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
|
+
prompt6._injected = (prompt6._injected || []).concat(answers);
|
|
15995
15995
|
}
|
|
15996
15996
|
function override(answers) {
|
|
15997
|
-
|
|
15997
|
+
prompt6._override = Object.assign({}, answers);
|
|
15998
15998
|
}
|
|
15999
|
-
module.exports = Object.assign(
|
|
15999
|
+
module.exports = Object.assign(prompt6, { prompt: prompt6, prompts, inject, override });
|
|
16000
16000
|
}
|
|
16001
16001
|
});
|
|
16002
16002
|
|
|
@@ -16923,14 +16923,14 @@ var require_util3 = __commonJS({
|
|
|
16923
16923
|
}
|
|
16924
16924
|
const port2 = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
16925
16925
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port2}`;
|
|
16926
|
-
let
|
|
16926
|
+
let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
16927
16927
|
if (origin[origin.length - 1] === "/") {
|
|
16928
16928
|
origin = origin.slice(0, origin.length - 1);
|
|
16929
16929
|
}
|
|
16930
|
-
if (
|
|
16931
|
-
|
|
16930
|
+
if (path14 && path14[0] !== "/") {
|
|
16931
|
+
path14 = `/${path14}`;
|
|
16932
16932
|
}
|
|
16933
|
-
return new URL(`${origin}${
|
|
16933
|
+
return new URL(`${origin}${path14}`);
|
|
16934
16934
|
}
|
|
16935
16935
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.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: path14, origin }
|
|
17480
17480
|
} = evt;
|
|
17481
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
17481
|
+
debugLog("sending request to %s %s%s", method, origin, path14);
|
|
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: path14, 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
|
+
path14,
|
|
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: path14, origin }
|
|
17512
17512
|
} = evt;
|
|
17513
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
17513
|
+
debugLog("trailers received from %s %s%s", method, origin, path14);
|
|
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: path14, 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
|
+
path14,
|
|
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: path14,
|
|
17622
17622
|
method,
|
|
17623
17623
|
body,
|
|
17624
17624
|
headers,
|
|
@@ -17628,17 +17628,17 @@ var require_request = __commonJS({
|
|
|
17628
17628
|
upgrade,
|
|
17629
17629
|
headersTimeout,
|
|
17630
17630
|
bodyTimeout,
|
|
17631
|
-
reset:
|
|
17631
|
+
reset: reset3,
|
|
17632
17632
|
expectContinue,
|
|
17633
17633
|
servername,
|
|
17634
17634
|
throwOnError,
|
|
17635
17635
|
maxRedirections
|
|
17636
17636
|
}, handler) {
|
|
17637
|
-
if (typeof
|
|
17637
|
+
if (typeof path14 !== "string") {
|
|
17638
17638
|
throw new InvalidArgumentError("path must be a string");
|
|
17639
|
-
} else if (
|
|
17639
|
+
} else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.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(path14)) {
|
|
17642
17642
|
throw new InvalidArgumentError("invalid request path");
|
|
17643
17643
|
}
|
|
17644
17644
|
if (typeof method !== "string") {
|
|
@@ -17655,7 +17655,7 @@ var require_request = __commonJS({
|
|
|
17655
17655
|
if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {
|
|
17656
17656
|
throw new InvalidArgumentError("invalid bodyTimeout");
|
|
17657
17657
|
}
|
|
17658
|
-
if (
|
|
17658
|
+
if (reset3 != null && typeof reset3 !== "boolean") {
|
|
17659
17659
|
throw new InvalidArgumentError("invalid reset");
|
|
17660
17660
|
}
|
|
17661
17661
|
if (expectContinue != null && typeof expectContinue !== "boolean") {
|
|
@@ -17706,11 +17706,11 @@ 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(path14, query) : path14;
|
|
17710
17710
|
this.origin = origin;
|
|
17711
17711
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
17712
17712
|
this.blocking = blocking ?? this.method !== "HEAD";
|
|
17713
|
-
this.reset =
|
|
17713
|
+
this.reset = reset3 == null ? null : reset3;
|
|
17714
17714
|
this.host = null;
|
|
17715
17715
|
this.contentLength = null;
|
|
17716
17716
|
this.contentType = null;
|
|
@@ -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: path14, 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)) {
|
|
@@ -22506,8 +22506,8 @@ var require_client_h1 = __commonJS({
|
|
|
22506
22506
|
if (upgrade || method === "CONNECT") {
|
|
22507
22507
|
socket[kReset] = true;
|
|
22508
22508
|
}
|
|
22509
|
-
if (
|
|
22510
|
-
socket[kReset] =
|
|
22509
|
+
if (reset3 != null) {
|
|
22510
|
+
socket[kReset] = reset3;
|
|
22511
22511
|
}
|
|
22512
22512
|
if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
|
|
22513
22513
|
socket[kReset] = true;
|
|
@@ -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} ${path14} 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: path14, 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] = path14;
|
|
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: path14 = "/",
|
|
24585
24585
|
headers = {}
|
|
24586
24586
|
} = opts;
|
|
24587
|
-
opts.path = origin +
|
|
24587
|
+
opts.path = origin + path14;
|
|
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(path14) {
|
|
26642
|
+
if (typeof path14 !== "string") {
|
|
26643
|
+
return path14;
|
|
26644
26644
|
}
|
|
26645
|
-
const pathSegments =
|
|
26645
|
+
const pathSegments = path14.split("?", 3);
|
|
26646
26646
|
if (pathSegments.length !== 2) {
|
|
26647
|
-
return
|
|
26647
|
+
return path14;
|
|
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: path14, method, body, headers }) {
|
|
26654
|
+
const pathMatch = matchValue(mockDispatch2.path, path14);
|
|
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: path14, ignoreTrailingSlash }) => {
|
|
26680
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path14)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path14), 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(path14) {
|
|
26719
|
+
while (path14.endsWith("/")) {
|
|
26720
|
+
path14 = path14.slice(0, -1);
|
|
26721
26721
|
}
|
|
26722
|
-
if (
|
|
26723
|
-
|
|
26722
|
+
if (path14.length === 0) {
|
|
26723
|
+
path14 = "/";
|
|
26724
26724
|
}
|
|
26725
|
-
return
|
|
26725
|
+
return path14;
|
|
26726
26726
|
}
|
|
26727
26727
|
function buildKey(opts) {
|
|
26728
|
-
const { path:
|
|
26728
|
+
const { path: path14, method, body, headers, query } = opts;
|
|
26729
26729
|
return {
|
|
26730
|
-
path:
|
|
26730
|
+
path: path14,
|
|
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: path14, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
|
|
27383
27383
|
Method: method,
|
|
27384
27384
|
Origin: origin,
|
|
27385
|
-
Path:
|
|
27385
|
+
Path: path14,
|
|
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 [path14, searchParams] = dispatchOpts.path.split("?");
|
|
27465
27465
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
27466
|
-
dispatchOpts.path = `${
|
|
27466
|
+
dispatchOpts.path = `${path14}?${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 path14 = filePath || this.snapshotPath;
|
|
27805
|
+
if (!path14) {
|
|
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(path14), "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 ${path14}`, { 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 path14 = filePath || this.snapshotPath;
|
|
27834
|
+
if (!path14) {
|
|
27835
27835
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27836
27836
|
}
|
|
27837
|
-
const resolvedPath = resolve7(
|
|
27837
|
+
const resolvedPath = resolve7(path14);
|
|
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 path14 = search ? `${pathname}${search}` : pathname;
|
|
28415
|
+
const redirectUrlString = `${origin}${path14}`;
|
|
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 = path14;
|
|
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(path14) {
|
|
34047
|
+
for (let i = 0; i < path14.length; ++i) {
|
|
34048
|
+
const code2 = path14.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 path14 = opts.path;
|
|
37106
37106
|
if (!opts.path.startsWith("/")) {
|
|
37107
|
-
|
|
37107
|
+
path14 = `/${path14}`;
|
|
37108
37108
|
}
|
|
37109
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
37109
|
+
url2 = new URL(util.parseOrigin(url2).origin + path14);
|
|
37110
37110
|
} else {
|
|
37111
37111
|
if (!opts) {
|
|
37112
37112
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -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, path14) {
|
|
38530
|
+
path14 = castPath(path14, object);
|
|
38531
|
+
var index = 0, length4 = path14.length;
|
|
38532
38532
|
while (object != null && index < length4) {
|
|
38533
|
-
object = object[toKey(
|
|
38533
|
+
object = object[toKey(path14[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, path14, args2) {
|
|
38598
|
+
path14 = castPath(path14, object);
|
|
38599
|
+
object = parent(object, path14);
|
|
38600
|
+
var func = object == null ? object : object[toKey(last5(path14))];
|
|
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(path14, srcValue) {
|
|
38757
|
+
if (isKey(path14) && isStrictComparable(srcValue)) {
|
|
38758
|
+
return matchesStrictComparable(toKey(path14), 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, path14);
|
|
38762
|
+
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path14) : 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, path14) {
|
|
38860
|
+
return hasIn(object, path14);
|
|
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 path14 = paths[index], value5 = baseGet(object, path14);
|
|
38867
|
+
if (predicate(value5, path14)) {
|
|
38868
|
+
baseSet(result2, castPath(path14, object), value5);
|
|
38869
38869
|
}
|
|
38870
38870
|
}
|
|
38871
38871
|
return result2;
|
|
38872
38872
|
}
|
|
38873
|
-
function basePropertyDeep(
|
|
38873
|
+
function basePropertyDeep(path14) {
|
|
38874
38874
|
return function(object) {
|
|
38875
|
-
return baseGet(object,
|
|
38875
|
+
return baseGet(object, path14);
|
|
38876
38876
|
};
|
|
38877
38877
|
}
|
|
38878
38878
|
function basePullAll(array8, values4, iteratee2, comparator) {
|
|
@@ -38946,14 +38946,14 @@ var require_lodash = __commonJS({
|
|
|
38946
38946
|
var array8 = values3(collection);
|
|
38947
38947
|
return shuffleSelf(array8, baseClamp(n, 0, array8.length));
|
|
38948
38948
|
}
|
|
38949
|
-
function baseSet(object,
|
|
38949
|
+
function baseSet(object, path14, value5, customizer) {
|
|
38950
38950
|
if (!isObject2(object)) {
|
|
38951
38951
|
return object;
|
|
38952
38952
|
}
|
|
38953
|
-
|
|
38954
|
-
var index = -1, length4 =
|
|
38953
|
+
path14 = castPath(path14, object);
|
|
38954
|
+
var index = -1, length4 = path14.length, lastIndex = length4 - 1, nested3 = object;
|
|
38955
38955
|
while (nested3 != null && ++index < length4) {
|
|
38956
|
-
var key = toKey(
|
|
38956
|
+
var key = toKey(path14[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 = nested3[key];
|
|
38962
38962
|
newValue = customizer ? customizer(objValue, key, nested3) : undefined2;
|
|
38963
38963
|
if (newValue === undefined2) {
|
|
38964
|
-
newValue = isObject2(objValue) ? objValue : isIndex(
|
|
38964
|
+
newValue = isObject2(objValue) ? objValue : isIndex(path14[index + 1]) ? [] : {};
|
|
38965
38965
|
}
|
|
38966
38966
|
}
|
|
38967
38967
|
assignValue(nested3, 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, path14) {
|
|
39131
|
+
path14 = castPath(path14, object);
|
|
39132
|
+
object = parent(object, path14);
|
|
39133
|
+
return object == null || delete object[toKey(last5(path14))];
|
|
39134
39134
|
}
|
|
39135
|
-
function baseUpdate(object,
|
|
39136
|
-
return baseSet(object,
|
|
39135
|
+
function baseUpdate(object, path14, updater, customizer) {
|
|
39136
|
+
return baseSet(object, path14, updater(baseGet(object, path14)), customizer);
|
|
39137
39137
|
}
|
|
39138
39138
|
function baseWhile(array8, predicate, isDrop, fromRight) {
|
|
39139
39139
|
var length4 = array8.length, index = fromRight ? length4 : -1;
|
|
@@ -40016,11 +40016,11 @@ var require_lodash = __commonJS({
|
|
|
40016
40016
|
var match17 = source.match(reWrapDetails);
|
|
40017
40017
|
return match17 ? match17[1].split(reSplitDetails) : [];
|
|
40018
40018
|
}
|
|
40019
|
-
function hasPath(object,
|
|
40020
|
-
|
|
40021
|
-
var index = -1, length4 =
|
|
40019
|
+
function hasPath(object, path14, hasFunc) {
|
|
40020
|
+
path14 = castPath(path14, object);
|
|
40021
|
+
var index = -1, length4 = path14.length, result2 = false;
|
|
40022
40022
|
while (++index < length4) {
|
|
40023
|
-
var key = toKey(
|
|
40023
|
+
var key = toKey(path14[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, path14) {
|
|
40226
|
+
return path14.length < 2 ? object : baseGet(object, baseSlice(path14, 0, -1));
|
|
40227
40227
|
}
|
|
40228
40228
|
function reorder(array8, indexes) {
|
|
40229
40229
|
var arrLength = array8.length, length4 = nativeMin(indexes.length, arrLength), oldArray = copyArray(array8);
|
|
@@ -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 join15(array8, separator) {
|
|
40504
40504
|
return array8 == null ? "" : nativeJoin.call(array8, separator);
|
|
40505
40505
|
}
|
|
40506
40506
|
function last5(array8) {
|
|
@@ -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, path14, args2) {
|
|
40862
|
+
var index = -1, isFunc = typeof path14 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
40863
40863
|
baseEach(collection, function(value5) {
|
|
40864
|
-
result2[++index] = isFunc ? apply(
|
|
40864
|
+
result2[++index] = isFunc ? apply(path14, value5, args2) : baseInvoke(value5, path14, 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, path14, defaultValue) {
|
|
41517
|
+
var result2 = object == null ? undefined2 : baseGet(object, path14);
|
|
41518
41518
|
return result2 === undefined2 ? defaultValue : result2;
|
|
41519
41519
|
}
|
|
41520
|
-
function has8(object,
|
|
41521
|
-
return object != null && hasPath(object,
|
|
41520
|
+
function has8(object, path14) {
|
|
41521
|
+
return object != null && hasPath(object, path14, baseHas);
|
|
41522
41522
|
}
|
|
41523
|
-
function hasIn(object,
|
|
41524
|
-
return object != null && hasPath(object,
|
|
41523
|
+
function hasIn(object, path14) {
|
|
41524
|
+
return object != null && hasPath(object, path14, 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(path14) {
|
|
41578
|
+
path14 = castPath(path14, object);
|
|
41579
|
+
isDeep || (isDeep = path14.length > 1);
|
|
41580
|
+
return path14;
|
|
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, path14) {
|
|
41607
|
+
return predicate(value5, path14[0]);
|
|
41608
41608
|
});
|
|
41609
41609
|
}
|
|
41610
|
-
function result(object,
|
|
41611
|
-
|
|
41612
|
-
var index = -1, length4 =
|
|
41610
|
+
function result(object, path14, defaultValue) {
|
|
41611
|
+
path14 = castPath(path14, object);
|
|
41612
|
+
var index = -1, length4 = path14.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(path14[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, path14, value5) {
|
|
41628
|
+
return object == null ? object : baseSet(object, path14, value5);
|
|
41629
41629
|
}
|
|
41630
|
-
function setWith(object,
|
|
41630
|
+
function setWith(object, path14, value5, customizer) {
|
|
41631
41631
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
41632
|
-
return object == null ? object : baseSet(object,
|
|
41632
|
+
return object == null ? object : baseSet(object, path14, 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, path14) {
|
|
41655
|
+
return object == null ? true : baseUnset(object, path14);
|
|
41656
41656
|
}
|
|
41657
|
-
function update5(object,
|
|
41658
|
-
return object == null ? object : baseUpdate(object,
|
|
41657
|
+
function update5(object, path14, updater) {
|
|
41658
|
+
return object == null ? object : baseUpdate(object, path14, castFunction(updater));
|
|
41659
41659
|
}
|
|
41660
|
-
function updateWith2(object,
|
|
41660
|
+
function updateWith2(object, path14, updater, customizer) {
|
|
41661
41661
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
41662
|
-
return object == null ? object : baseUpdate(object,
|
|
41662
|
+
return object == null ? object : baseUpdate(object, path14, 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(path14, srcValue) {
|
|
42044
|
+
return baseMatchesProperty(path14, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
42045
42045
|
}
|
|
42046
|
-
var method = baseRest(function(
|
|
42046
|
+
var method = baseRest(function(path14, args2) {
|
|
42047
42047
|
return function(object) {
|
|
42048
|
-
return baseInvoke(object,
|
|
42048
|
+
return baseInvoke(object, path14, args2);
|
|
42049
42049
|
};
|
|
42050
42050
|
});
|
|
42051
42051
|
var methodOf = baseRest(function(object, args2) {
|
|
42052
|
-
return function(
|
|
42053
|
-
return baseInvoke(object,
|
|
42052
|
+
return function(path14) {
|
|
42053
|
+
return baseInvoke(object, path14, 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(path14) {
|
|
42101
|
+
return isKey(path14) ? baseProperty(toKey(path14)) : basePropertyDeep(path14);
|
|
42102
42102
|
}
|
|
42103
42103
|
function propertyOf(object) {
|
|
42104
|
-
return function(
|
|
42105
|
-
return object == null ? undefined2 : baseGet(object,
|
|
42104
|
+
return function(path14) {
|
|
42105
|
+
return object == null ? undefined2 : baseGet(object, path14);
|
|
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 = join15;
|
|
42423
42423
|
lodash.kebabCase = kebabCase;
|
|
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(path14, args2) {
|
|
42559
|
+
if (typeof path14 == "function") {
|
|
42560
42560
|
return new LazyWrapper(this);
|
|
42561
42561
|
}
|
|
42562
42562
|
return this.map(function(value5) {
|
|
42563
|
-
return baseInvoke(value5,
|
|
42563
|
+
return baseInvoke(value5, path14, 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, path14) {
|
|
45065
|
+
path14 = castPath(path14, object);
|
|
45066
|
+
var index = 0, length4 = path14.length;
|
|
45067
45067
|
while (object != null && index < length4) {
|
|
45068
|
-
object = object[toKey(
|
|
45068
|
+
object = object[toKey(path14[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, path14, defaultValue) {
|
|
45081
|
+
var result = object == null ? void 0 : baseGet(object, path14);
|
|
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, path14, hasFunc) {
|
|
45108
|
+
path14 = castPath(path14, object);
|
|
45109
|
+
var index = -1, length4 = path14.length, result = false;
|
|
45110
45110
|
while (++index < length4) {
|
|
45111
|
-
var key = toKey(
|
|
45111
|
+
var key = toKey(path14[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, path14) {
|
|
45133
|
+
return object != null && hasPath(object, path14, 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(path14, srcValue) {
|
|
45152
|
+
if (isKey(path14) && isStrictComparable(srcValue)) {
|
|
45153
|
+
return matchesStrictComparable(toKey(path14), 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, path14);
|
|
45157
|
+
return objValue === void 0 && objValue === srcValue ? hasIn(object, path14) : 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(path14) {
|
|
45181
45181
|
return function(object) {
|
|
45182
|
-
return baseGet(object,
|
|
45182
|
+
return baseGet(object, path14);
|
|
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(path14) {
|
|
45197
|
+
return isKey(path14) ? baseProperty(toKey(path14)) : basePropertyDeep(path14);
|
|
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 path14 = __require("path");
|
|
46471
46471
|
var sdkCode = "M";
|
|
46472
46472
|
function readSdkSemver() {
|
|
46473
|
-
const pkgJsonPath =
|
|
46473
|
+
const pkgJsonPath = path14.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 (path14 = [], 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(path14) ? path14.map(encode_path) : encode_path(path14);
|
|
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(path14, callback, options3 = {}) {
|
|
49599
|
+
if (path14 != null && isRemoteUrl(path14)) {
|
|
49600
|
+
return exports.upload(path14, callback, options3);
|
|
49601
49601
|
}
|
|
49602
|
-
if (
|
|
49603
|
-
options3.filename =
|
|
49602
|
+
if (path14 != null && !options3.filename) {
|
|
49603
|
+
options3.filename = path14.split(/(\\|\/)/g).pop().replace(/\.[^/.]+$/, "");
|
|
49604
49604
|
}
|
|
49605
|
-
return exports.upload_chunked(
|
|
49605
|
+
return exports.upload_chunked(path14, 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(path14, callback, options3) {
|
|
49610
|
+
let file_reader = fs.createReadStream(path14);
|
|
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(path14, callback, options3 = {}) {
|
|
50590
50590
|
let uri, params;
|
|
50591
|
-
uri = ["folders",
|
|
50591
|
+
uri = ["folders", path14];
|
|
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(path14, callback, options3 = {}) {
|
|
50596
50596
|
let uri;
|
|
50597
|
-
uri = ["folders",
|
|
50597
|
+
uri = ["folders", path14];
|
|
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(path14, callback, options3 = {}) {
|
|
50601
50601
|
let uri;
|
|
50602
|
-
uri = ["folders",
|
|
50602
|
+
uri = ["folders", path14];
|
|
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 path14 = __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 = path14.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] === "~" ? path14.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 = path14.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 path15 of optionPaths) {
|
|
51982
51982
|
try {
|
|
51983
|
-
const parsed = DotenvModule.parse(fs.readFileSync(
|
|
51983
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path15, { 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 ${path15} ${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 = path14.relative(process.cwd(), filePath);
|
|
52001
52001
|
shortPaths.push(relative3);
|
|
52002
52002
|
} catch (e) {
|
|
52003
52003
|
if (debug3) {
|
|
@@ -59065,67 +59065,67 @@ var Or = (self2, that) => {
|
|
|
59065
59065
|
});
|
|
59066
59066
|
return error4;
|
|
59067
59067
|
};
|
|
59068
|
-
var InvalidData = (
|
|
59068
|
+
var InvalidData = (path14, message, options3 = {
|
|
59069
59069
|
pathDelim: "."
|
|
59070
59070
|
}) => {
|
|
59071
59071
|
const error4 = Object.create(proto2);
|
|
59072
59072
|
error4._op = OP_INVALID_DATA;
|
|
59073
|
-
error4.path =
|
|
59073
|
+
error4.path = path14;
|
|
59074
59074
|
error4.message = message;
|
|
59075
59075
|
Object.defineProperty(error4, "toString", {
|
|
59076
59076
|
enumerable: false,
|
|
59077
59077
|
value() {
|
|
59078
|
-
const
|
|
59079
|
-
return `(Invalid data at ${
|
|
59078
|
+
const path15 = pipe(this.path, join(options3.pathDelim));
|
|
59079
|
+
return `(Invalid data at ${path15}: "${this.message}")`;
|
|
59080
59080
|
}
|
|
59081
59081
|
});
|
|
59082
59082
|
return error4;
|
|
59083
59083
|
};
|
|
59084
|
-
var MissingData = (
|
|
59084
|
+
var MissingData = (path14, message, options3 = {
|
|
59085
59085
|
pathDelim: "."
|
|
59086
59086
|
}) => {
|
|
59087
59087
|
const error4 = Object.create(proto2);
|
|
59088
59088
|
error4._op = OP_MISSING_DATA;
|
|
59089
|
-
error4.path =
|
|
59089
|
+
error4.path = path14;
|
|
59090
59090
|
error4.message = message;
|
|
59091
59091
|
Object.defineProperty(error4, "toString", {
|
|
59092
59092
|
enumerable: false,
|
|
59093
59093
|
value() {
|
|
59094
|
-
const
|
|
59095
|
-
return `(Missing data at ${
|
|
59094
|
+
const path15 = pipe(this.path, join(options3.pathDelim));
|
|
59095
|
+
return `(Missing data at ${path15}: "${this.message}")`;
|
|
59096
59096
|
}
|
|
59097
59097
|
});
|
|
59098
59098
|
return error4;
|
|
59099
59099
|
};
|
|
59100
|
-
var SourceUnavailable = (
|
|
59100
|
+
var SourceUnavailable = (path14, message, cause3, options3 = {
|
|
59101
59101
|
pathDelim: "."
|
|
59102
59102
|
}) => {
|
|
59103
59103
|
const error4 = Object.create(proto2);
|
|
59104
59104
|
error4._op = OP_SOURCE_UNAVAILABLE;
|
|
59105
|
-
error4.path =
|
|
59105
|
+
error4.path = path14;
|
|
59106
59106
|
error4.message = message;
|
|
59107
59107
|
error4.cause = cause3;
|
|
59108
59108
|
Object.defineProperty(error4, "toString", {
|
|
59109
59109
|
enumerable: false,
|
|
59110
59110
|
value() {
|
|
59111
|
-
const
|
|
59112
|
-
return `(Source unavailable at ${
|
|
59111
|
+
const path15 = pipe(this.path, join(options3.pathDelim));
|
|
59112
|
+
return `(Source unavailable at ${path15}: "${this.message}")`;
|
|
59113
59113
|
}
|
|
59114
59114
|
});
|
|
59115
59115
|
return error4;
|
|
59116
59116
|
};
|
|
59117
|
-
var Unsupported = (
|
|
59117
|
+
var Unsupported = (path14, message, options3 = {
|
|
59118
59118
|
pathDelim: "."
|
|
59119
59119
|
}) => {
|
|
59120
59120
|
const error4 = Object.create(proto2);
|
|
59121
59121
|
error4._op = OP_UNSUPPORTED;
|
|
59122
|
-
error4.path =
|
|
59122
|
+
error4.path = path14;
|
|
59123
59123
|
error4.message = message;
|
|
59124
59124
|
Object.defineProperty(error4, "toString", {
|
|
59125
59125
|
enumerable: false,
|
|
59126
59126
|
value() {
|
|
59127
|
-
const
|
|
59128
|
-
return `(Unsupported operation at ${
|
|
59127
|
+
const path15 = pipe(this.path, join(options3.pathDelim));
|
|
59128
|
+
return `(Unsupported operation at ${path15}: "${this.message}")`;
|
|
59129
59129
|
}
|
|
59130
59130
|
});
|
|
59131
59131
|
return error4;
|
|
@@ -59241,9 +59241,9 @@ var isMissingDataOnly = (self2) => reduceWithContext2(self2, void 0, IsMissingDa
|
|
|
59241
59241
|
var empty19 = {
|
|
59242
59242
|
_tag: "Empty"
|
|
59243
59243
|
};
|
|
59244
|
-
var patch5 = /* @__PURE__ */ dual(2, (
|
|
59244
|
+
var patch5 = /* @__PURE__ */ dual(2, (path14, patch9) => {
|
|
59245
59245
|
let input = of3(patch9);
|
|
59246
|
-
let output =
|
|
59246
|
+
let output = path14;
|
|
59247
59247
|
while (isCons(input)) {
|
|
59248
59248
|
const patch10 = input.head;
|
|
59249
59249
|
switch (patch10._tag) {
|
|
@@ -59310,7 +59310,7 @@ var make21 = (options3) => ({
|
|
|
59310
59310
|
var makeFlat = (options3) => ({
|
|
59311
59311
|
[FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
|
|
59312
59312
|
patch: options3.patch,
|
|
59313
|
-
load: (
|
|
59313
|
+
load: (path14, config3, split3 = true) => options3.load(path14, config3, split3),
|
|
59314
59314
|
enumerateChildren: options3.enumerateChildren
|
|
59315
59315
|
});
|
|
59316
59316
|
var fromFlat = (flat) => make21({
|
|
@@ -59328,29 +59328,29 @@ var fromEnv = (options3) => {
|
|
|
59328
59328
|
pathDelim: "_",
|
|
59329
59329
|
seqDelim: ","
|
|
59330
59330
|
}, options3);
|
|
59331
|
-
const makePathString = (
|
|
59331
|
+
const makePathString = (path14) => pipe(path14, join(pathDelim));
|
|
59332
59332
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
59333
59333
|
const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
|
|
59334
|
-
const load = (
|
|
59335
|
-
const pathString = makePathString(
|
|
59334
|
+
const load = (path14, primitive2, split3 = true) => {
|
|
59335
|
+
const pathString = makePathString(path14);
|
|
59336
59336
|
const current = getEnv();
|
|
59337
59337
|
const valueOpt = pathString in current ? some2(current[pathString]) : none2();
|
|
59338
|
-
return pipe(valueOpt, mapError(() => MissingData(
|
|
59338
|
+
return pipe(valueOpt, mapError(() => MissingData(path14, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path14, primitive2, seqDelim, split3)));
|
|
59339
59339
|
};
|
|
59340
|
-
const enumerateChildren = (
|
|
59340
|
+
const enumerateChildren = (path14) => sync(() => {
|
|
59341
59341
|
const current = getEnv();
|
|
59342
59342
|
const keys6 = Object.keys(current);
|
|
59343
59343
|
const keyPaths = keys6.map((value5) => unmakePathString(value5.toUpperCase()));
|
|
59344
59344
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
59345
|
-
for (let i = 0; i <
|
|
59346
|
-
const pathComponent = pipe(
|
|
59345
|
+
for (let i = 0; i < path14.length; i++) {
|
|
59346
|
+
const pathComponent = pipe(path14, unsafeGet(i));
|
|
59347
59347
|
const currentElement = keyPath[i];
|
|
59348
59348
|
if (currentElement === void 0 || pathComponent !== currentElement) {
|
|
59349
59349
|
return false;
|
|
59350
59350
|
}
|
|
59351
59351
|
}
|
|
59352
59352
|
return true;
|
|
59353
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
59353
|
+
}).flatMap((keyPath) => keyPath.slice(path14.length, path14.length + 1));
|
|
59354
59354
|
return fromIterable6(filteredKeyPaths);
|
|
59355
59355
|
});
|
|
59356
59356
|
return fromFlat(makeFlat({
|
|
@@ -59366,17 +59366,17 @@ var extend2 = (leftDef, rightDef, left3, right3) => {
|
|
|
59366
59366
|
const rightExtension = concat(right3, rightPad);
|
|
59367
59367
|
return [leftExtension, rightExtension];
|
|
59368
59368
|
};
|
|
59369
|
-
var appendConfigPath = (
|
|
59369
|
+
var appendConfigPath = (path14, config3) => {
|
|
59370
59370
|
let op = config3;
|
|
59371
59371
|
if (op._tag === "Nested") {
|
|
59372
|
-
const out =
|
|
59372
|
+
const out = path14.slice();
|
|
59373
59373
|
while (op._tag === "Nested") {
|
|
59374
59374
|
out.push(op.name);
|
|
59375
59375
|
op = op.config;
|
|
59376
59376
|
}
|
|
59377
59377
|
return out;
|
|
59378
59378
|
}
|
|
59379
|
-
return
|
|
59379
|
+
return path14;
|
|
59380
59380
|
};
|
|
59381
59381
|
var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
59382
59382
|
const op = config3;
|
|
@@ -59452,8 +59452,8 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
|
59452
59452
|
return fail2(right3.left);
|
|
59453
59453
|
}
|
|
59454
59454
|
if (isRight2(left3) && isRight2(right3)) {
|
|
59455
|
-
const
|
|
59456
|
-
const fail19 = fromFlatLoopFail(prefix,
|
|
59455
|
+
const path14 = pipe(prefix, join("."));
|
|
59456
|
+
const fail19 = fromFlatLoopFail(prefix, path14);
|
|
59457
59457
|
const [lefts, rights] = extend2(fail19, fail19, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
|
|
59458
59458
|
return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
|
|
59459
59459
|
}
|
|
@@ -59462,19 +59462,19 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
|
|
|
59462
59462
|
}
|
|
59463
59463
|
}
|
|
59464
59464
|
};
|
|
59465
|
-
var fromFlatLoopFail = (prefix,
|
|
59465
|
+
var fromFlatLoopFail = (prefix, path14) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path14}" was missing`));
|
|
59466
59466
|
var splitPathString = (text11, delim) => {
|
|
59467
59467
|
const split3 = text11.split(new RegExp(`\\s*${escape(delim)}\\s*`));
|
|
59468
59468
|
return split3;
|
|
59469
59469
|
};
|
|
59470
|
-
var parsePrimitive = (text11,
|
|
59470
|
+
var parsePrimitive = (text11, path14, primitive2, delimiter, split3) => {
|
|
59471
59471
|
if (!split3) {
|
|
59472
59472
|
return pipe(primitive2.parse(text11), mapBoth2({
|
|
59473
|
-
onFailure: prefixed(
|
|
59473
|
+
onFailure: prefixed(path14),
|
|
59474
59474
|
onSuccess: of
|
|
59475
59475
|
}));
|
|
59476
59476
|
}
|
|
59477
|
-
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(
|
|
59477
|
+
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(path14)));
|
|
59478
59478
|
};
|
|
59479
59479
|
var transpose = (array8) => {
|
|
59480
59480
|
return Object.keys(array8[0]).map((column3) => array8.map((row) => row[column3]));
|
|
@@ -70680,14 +70680,14 @@ var formatPropertyKey = (name) => typeof name === "string" ? JSON.stringify(name
|
|
|
70680
70680
|
var isNonEmpty5 = (x) => Array.isArray(x);
|
|
70681
70681
|
var isSingle = (x) => !Array.isArray(x);
|
|
70682
70682
|
var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
|
|
70683
|
-
var formatPath = (
|
|
70683
|
+
var formatPath = (path14) => isNonEmpty5(path14) ? path14.map(formatPathKey).join("") : formatPathKey(path14);
|
|
70684
70684
|
|
|
70685
70685
|
// node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/internal/schema/errors.js
|
|
70686
|
-
var getErrorMessage = (reason, details,
|
|
70686
|
+
var getErrorMessage = (reason, details, path14, ast) => {
|
|
70687
70687
|
let out = reason;
|
|
70688
|
-
if (
|
|
70688
|
+
if (path14 && isNonEmptyReadonlyArray(path14)) {
|
|
70689
70689
|
out += `
|
|
70690
|
-
at path: ${formatPath(
|
|
70690
|
+
at path: ${formatPath(path14)}`;
|
|
70691
70691
|
}
|
|
70692
70692
|
if (details !== void 0) {
|
|
70693
70693
|
out += `
|
|
@@ -70699,7 +70699,7 @@ schema (${ast._tag}): ${ast}`;
|
|
|
70699
70699
|
}
|
|
70700
70700
|
return out;
|
|
70701
70701
|
};
|
|
70702
|
-
var getSchemaExtendErrorMessage = (x, y,
|
|
70702
|
+
var getSchemaExtendErrorMessage = (x, y, path14) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path14);
|
|
70703
70703
|
var getASTUnsupportedKeySchemaErrorMessage = (ast) => getErrorMessage("Unsupported key schema", void 0, void 0, ast);
|
|
70704
70704
|
var getASTUnsupportedLiteralErrorMessage = (literal2) => getErrorMessage("Unsupported literal", `literal value: ${formatUnknown(literal2)}`);
|
|
70705
70705
|
var getASTDuplicateIndexSignatureErrorMessage = (type2) => getErrorMessage("Duplicate index signature", `${type2} index signature`);
|
|
@@ -71888,8 +71888,8 @@ var Pointer = class {
|
|
|
71888
71888
|
* @since 3.10.0
|
|
71889
71889
|
*/
|
|
71890
71890
|
_tag = "Pointer";
|
|
71891
|
-
constructor(
|
|
71892
|
-
this.path =
|
|
71891
|
+
constructor(path14, actual, issue) {
|
|
71892
|
+
this.path = path14;
|
|
71893
71893
|
this.actual = actual;
|
|
71894
71894
|
this.issue = issue;
|
|
71895
71895
|
}
|
|
@@ -73379,7 +73379,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
73379
73379
|
function Struct(fields, ...records) {
|
|
73380
73380
|
return makeTypeLiteralClass(fields, records);
|
|
73381
73381
|
}
|
|
73382
|
-
var intersectTypeLiterals = (x, y,
|
|
73382
|
+
var intersectTypeLiterals = (x, y, path14) => {
|
|
73383
73383
|
if (isTypeLiteral(x) && isTypeLiteral(y)) {
|
|
73384
73384
|
const propertySignatures = [...x.propertySignatures];
|
|
73385
73385
|
for (const ps of y.propertySignatures) {
|
|
@@ -73392,18 +73392,18 @@ var intersectTypeLiterals = (x, y, path11) => {
|
|
|
73392
73392
|
isOptional,
|
|
73393
73393
|
type: type2
|
|
73394
73394
|
} = propertySignatures[i];
|
|
73395
|
-
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type,
|
|
73395
|
+
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path14.concat(name)), isOptional, true);
|
|
73396
73396
|
}
|
|
73397
73397
|
}
|
|
73398
73398
|
return new TypeLiteral(propertySignatures, x.indexSignatures.concat(y.indexSignatures));
|
|
73399
73399
|
}
|
|
73400
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
73400
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path14));
|
|
73401
73401
|
};
|
|
73402
73402
|
var preserveRefinementAnnotations = /* @__PURE__ */ omitAnnotations([IdentifierAnnotationId]);
|
|
73403
73403
|
var addRefinementToMembers = (refinement, asts) => asts.map((ast) => new Refinement(ast, refinement.filter, preserveRefinementAnnotations(refinement)));
|
|
73404
|
-
var extendAST = (x, y,
|
|
73404
|
+
var extendAST = (x, y, path14) => Union.make(intersectUnionMembers([x], [y], path14));
|
|
73405
73405
|
var getTypes = (ast) => isUnion(ast) ? ast.types : [ast];
|
|
73406
|
-
var intersectUnionMembers = (xs, ys,
|
|
73406
|
+
var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
|
|
73407
73407
|
switch (y._tag) {
|
|
73408
73408
|
case "Literal": {
|
|
73409
73409
|
if (isString(y.literal) && isStringKeyword(x) || isNumber(y.literal) && isNumberKeyword(x) || isBoolean(y.literal) && isBooleanKeyword(x)) {
|
|
@@ -73416,7 +73416,7 @@ var intersectUnionMembers = (xs, ys, path11) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
73416
73416
|
if (isStringKeyword(x) || isLiteral(x) && isString(x.literal)) {
|
|
73417
73417
|
return [x];
|
|
73418
73418
|
} else if (isRefinement(x)) {
|
|
73419
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
73419
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
|
|
73420
73420
|
}
|
|
73421
73421
|
} else if (x === stringKeyword) {
|
|
73422
73422
|
return [y];
|
|
@@ -73428,7 +73428,7 @@ var intersectUnionMembers = (xs, ys, path11) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
73428
73428
|
if (isNumberKeyword(x) || isLiteral(x) && isNumber(x.literal)) {
|
|
73429
73429
|
return [x];
|
|
73430
73430
|
} else if (isRefinement(x)) {
|
|
73431
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
73431
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
|
|
73432
73432
|
}
|
|
73433
73433
|
} else if (x === numberKeyword) {
|
|
73434
73434
|
return [y];
|
|
@@ -73440,7 +73440,7 @@ var intersectUnionMembers = (xs, ys, path11) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
73440
73440
|
if (isBooleanKeyword(x) || isLiteral(x) && isBoolean(x.literal)) {
|
|
73441
73441
|
return [x];
|
|
73442
73442
|
} else if (isRefinement(x)) {
|
|
73443
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
73443
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
|
|
73444
73444
|
}
|
|
73445
73445
|
} else if (x === booleanKeyword) {
|
|
73446
73446
|
return [y];
|
|
@@ -73448,25 +73448,25 @@ var intersectUnionMembers = (xs, ys, path11) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
73448
73448
|
break;
|
|
73449
73449
|
}
|
|
73450
73450
|
case "Union":
|
|
73451
|
-
return intersectUnionMembers(getTypes(x), y.types,
|
|
73451
|
+
return intersectUnionMembers(getTypes(x), y.types, path14);
|
|
73452
73452
|
case "Suspend":
|
|
73453
|
-
return [new Suspend(() => extendAST(x, y.f(),
|
|
73453
|
+
return [new Suspend(() => extendAST(x, y.f(), path14))];
|
|
73454
73454
|
case "Refinement":
|
|
73455
|
-
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from),
|
|
73455
|
+
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path14));
|
|
73456
73456
|
case "TypeLiteral": {
|
|
73457
73457
|
switch (x._tag) {
|
|
73458
73458
|
case "Union":
|
|
73459
|
-
return intersectUnionMembers(x.types, [y],
|
|
73459
|
+
return intersectUnionMembers(x.types, [y], path14);
|
|
73460
73460
|
case "Suspend":
|
|
73461
|
-
return [new Suspend(() => extendAST(x.f(), y,
|
|
73461
|
+
return [new Suspend(() => extendAST(x.f(), y, path14))];
|
|
73462
73462
|
case "Refinement":
|
|
73463
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
73463
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
|
|
73464
73464
|
case "TypeLiteral":
|
|
73465
|
-
return [intersectTypeLiterals(x, y,
|
|
73465
|
+
return [intersectTypeLiterals(x, y, path14)];
|
|
73466
73466
|
case "Transformation": {
|
|
73467
73467
|
const transformation = x.transformation;
|
|
73468
|
-
const from = intersectTypeLiterals(x.from, y,
|
|
73469
|
-
const to = intersectTypeLiterals(x.to, typeAST(y),
|
|
73468
|
+
const from = intersectTypeLiterals(x.from, y, path14);
|
|
73469
|
+
const to = intersectTypeLiterals(x.to, typeAST(y), path14);
|
|
73470
73470
|
switch (transformation._tag) {
|
|
73471
73471
|
case "TypeLiteralTransformation":
|
|
73472
73472
|
return [new Transformation(from, to, new TypeLiteralTransformation(transformation.propertySignatureTransformations))];
|
|
@@ -73488,15 +73488,15 @@ var intersectUnionMembers = (xs, ys, path11) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
73488
73488
|
case "Transformation": {
|
|
73489
73489
|
if (isTransformation(x)) {
|
|
73490
73490
|
if (isTypeLiteralTransformation(y.transformation) && isTypeLiteralTransformation(x.transformation)) {
|
|
73491
|
-
return [new Transformation(intersectTypeLiterals(x.from, y.from,
|
|
73491
|
+
return [new Transformation(intersectTypeLiterals(x.from, y.from, path14), intersectTypeLiterals(x.to, y.to, path14), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
|
|
73492
73492
|
}
|
|
73493
73493
|
} else {
|
|
73494
|
-
return intersectUnionMembers([y], [x],
|
|
73494
|
+
return intersectUnionMembers([y], [x], path14);
|
|
73495
73495
|
}
|
|
73496
73496
|
break;
|
|
73497
73497
|
}
|
|
73498
73498
|
}
|
|
73499
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
73499
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path14));
|
|
73500
73500
|
}));
|
|
73501
73501
|
var extend4 = /* @__PURE__ */ dual(2, (self2, that) => make54(extendAST(self2.ast, that.ast, [])));
|
|
73502
73502
|
var compose3 = /* @__PURE__ */ dual((args2) => isSchema(args2[1]), (from, to) => makeTransformationClass(from, to, compose2(from.ast, to.ast)));
|
|
@@ -74166,8 +74166,8 @@ var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
|
74166
74166
|
var make55 = (impl) => {
|
|
74167
74167
|
return tag.of({
|
|
74168
74168
|
...impl,
|
|
74169
|
-
exists: (
|
|
74170
|
-
readFileString: (
|
|
74169
|
+
exists: (path14) => pipe(impl.access(path14), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed9(false) : fail9(e))),
|
|
74170
|
+
readFileString: (path14, encoding) => tryMap2(impl.readFile(path14), {
|
|
74171
74171
|
try: (_) => new TextDecoder(encoding).decode(_),
|
|
74172
74172
|
catch: (cause3) => new BadArgument({
|
|
74173
74173
|
module: "FileSystem",
|
|
@@ -74176,14 +74176,14 @@ var make55 = (impl) => {
|
|
|
74176
74176
|
cause: cause3
|
|
74177
74177
|
})
|
|
74178
74178
|
}),
|
|
74179
|
-
stream: (
|
|
74179
|
+
stream: (path14, options3) => pipe(impl.open(path14, {
|
|
74180
74180
|
flag: "r"
|
|
74181
74181
|
}), options3?.offset ? tap3((file6) => file6.seek(options3.offset, "start")) : identity, map17((file6) => stream3(file6, options3)), unwrapScoped5),
|
|
74182
|
-
sink: (
|
|
74182
|
+
sink: (path14, options3) => pipe(impl.open(path14, {
|
|
74183
74183
|
flag: "w",
|
|
74184
74184
|
...options3
|
|
74185
74185
|
}), map17((file6) => forEach11((_) => file6.writeAll(_))), unwrapScoped6),
|
|
74186
|
-
writeFileString: (
|
|
74186
|
+
writeFileString: (path14, data, options3) => flatMap10(try_2({
|
|
74187
74187
|
try: () => new TextEncoder().encode(data),
|
|
74188
74188
|
catch: (cause3) => new BadArgument({
|
|
74189
74189
|
module: "FileSystem",
|
|
@@ -74191,38 +74191,38 @@ var make55 = (impl) => {
|
|
|
74191
74191
|
description: "could not encode string",
|
|
74192
74192
|
cause: cause3
|
|
74193
74193
|
})
|
|
74194
|
-
}), (_) => impl.writeFile(
|
|
74194
|
+
}), (_) => impl.writeFile(path14, _, options3))
|
|
74195
74195
|
});
|
|
74196
74196
|
};
|
|
74197
|
-
var notFound = (method,
|
|
74197
|
+
var notFound = (method, path14) => new SystemError({
|
|
74198
74198
|
module: "FileSystem",
|
|
74199
74199
|
method,
|
|
74200
74200
|
reason: "NotFound",
|
|
74201
74201
|
description: "No such file or directory",
|
|
74202
|
-
pathOrDescriptor:
|
|
74202
|
+
pathOrDescriptor: path14
|
|
74203
74203
|
});
|
|
74204
74204
|
var makeNoop = (fileSystem) => {
|
|
74205
74205
|
return {
|
|
74206
|
-
access(
|
|
74207
|
-
return fail9(notFound("access",
|
|
74206
|
+
access(path14) {
|
|
74207
|
+
return fail9(notFound("access", path14));
|
|
74208
74208
|
},
|
|
74209
|
-
chmod(
|
|
74210
|
-
return fail9(notFound("chmod",
|
|
74209
|
+
chmod(path14) {
|
|
74210
|
+
return fail9(notFound("chmod", path14));
|
|
74211
74211
|
},
|
|
74212
|
-
chown(
|
|
74213
|
-
return fail9(notFound("chown",
|
|
74212
|
+
chown(path14) {
|
|
74213
|
+
return fail9(notFound("chown", path14));
|
|
74214
74214
|
},
|
|
74215
|
-
copy(
|
|
74216
|
-
return fail9(notFound("copy",
|
|
74215
|
+
copy(path14) {
|
|
74216
|
+
return fail9(notFound("copy", path14));
|
|
74217
74217
|
},
|
|
74218
|
-
copyFile(
|
|
74219
|
-
return fail9(notFound("copyFile",
|
|
74218
|
+
copyFile(path14) {
|
|
74219
|
+
return fail9(notFound("copyFile", path14));
|
|
74220
74220
|
},
|
|
74221
74221
|
exists() {
|
|
74222
74222
|
return succeed9(false);
|
|
74223
74223
|
},
|
|
74224
|
-
link(
|
|
74225
|
-
return fail9(notFound("link",
|
|
74224
|
+
link(path14) {
|
|
74225
|
+
return fail9(notFound("link", path14));
|
|
74226
74226
|
},
|
|
74227
74227
|
makeDirectory() {
|
|
74228
74228
|
return die5("not implemented");
|
|
@@ -74239,23 +74239,23 @@ var makeNoop = (fileSystem) => {
|
|
|
74239
74239
|
makeTempFileScoped() {
|
|
74240
74240
|
return die5("not implemented");
|
|
74241
74241
|
},
|
|
74242
|
-
open(
|
|
74243
|
-
return fail9(notFound("open",
|
|
74242
|
+
open(path14) {
|
|
74243
|
+
return fail9(notFound("open", path14));
|
|
74244
74244
|
},
|
|
74245
|
-
readDirectory(
|
|
74246
|
-
return fail9(notFound("readDirectory",
|
|
74245
|
+
readDirectory(path14) {
|
|
74246
|
+
return fail9(notFound("readDirectory", path14));
|
|
74247
74247
|
},
|
|
74248
|
-
readFile(
|
|
74249
|
-
return fail9(notFound("readFile",
|
|
74248
|
+
readFile(path14) {
|
|
74249
|
+
return fail9(notFound("readFile", path14));
|
|
74250
74250
|
},
|
|
74251
|
-
readFileString(
|
|
74252
|
-
return fail9(notFound("readFileString",
|
|
74251
|
+
readFileString(path14) {
|
|
74252
|
+
return fail9(notFound("readFileString", path14));
|
|
74253
74253
|
},
|
|
74254
|
-
readLink(
|
|
74255
|
-
return fail9(notFound("readLink",
|
|
74254
|
+
readLink(path14) {
|
|
74255
|
+
return fail9(notFound("readLink", path14));
|
|
74256
74256
|
},
|
|
74257
|
-
realPath(
|
|
74258
|
-
return fail9(notFound("realPath",
|
|
74257
|
+
realPath(path14) {
|
|
74258
|
+
return fail9(notFound("realPath", path14));
|
|
74259
74259
|
},
|
|
74260
74260
|
remove() {
|
|
74261
74261
|
return _void;
|
|
@@ -74263,32 +74263,32 @@ var makeNoop = (fileSystem) => {
|
|
|
74263
74263
|
rename(oldPath) {
|
|
74264
74264
|
return fail9(notFound("rename", oldPath));
|
|
74265
74265
|
},
|
|
74266
|
-
sink(
|
|
74267
|
-
return fail14(notFound("sink",
|
|
74266
|
+
sink(path14) {
|
|
74267
|
+
return fail14(notFound("sink", path14));
|
|
74268
74268
|
},
|
|
74269
|
-
stat(
|
|
74270
|
-
return fail9(notFound("stat",
|
|
74269
|
+
stat(path14) {
|
|
74270
|
+
return fail9(notFound("stat", path14));
|
|
74271
74271
|
},
|
|
74272
|
-
stream(
|
|
74273
|
-
return fail13(notFound("stream",
|
|
74272
|
+
stream(path14) {
|
|
74273
|
+
return fail13(notFound("stream", path14));
|
|
74274
74274
|
},
|
|
74275
74275
|
symlink(fromPath) {
|
|
74276
74276
|
return fail9(notFound("symlink", fromPath));
|
|
74277
74277
|
},
|
|
74278
|
-
truncate(
|
|
74279
|
-
return fail9(notFound("truncate",
|
|
74278
|
+
truncate(path14) {
|
|
74279
|
+
return fail9(notFound("truncate", path14));
|
|
74280
74280
|
},
|
|
74281
|
-
utimes(
|
|
74282
|
-
return fail9(notFound("utimes",
|
|
74281
|
+
utimes(path14) {
|
|
74282
|
+
return fail9(notFound("utimes", path14));
|
|
74283
74283
|
},
|
|
74284
|
-
watch(
|
|
74285
|
-
return fail13(notFound("watch",
|
|
74284
|
+
watch(path14) {
|
|
74285
|
+
return fail13(notFound("watch", path14));
|
|
74286
74286
|
},
|
|
74287
|
-
writeFile(
|
|
74288
|
-
return fail9(notFound("writeFile",
|
|
74287
|
+
writeFile(path14) {
|
|
74288
|
+
return fail9(notFound("writeFile", path14));
|
|
74289
74289
|
},
|
|
74290
|
-
writeFileString(
|
|
74291
|
-
return fail9(notFound("writeFileString",
|
|
74290
|
+
writeFileString(path14) {
|
|
74291
|
+
return fail9(notFound("writeFileString", path14));
|
|
74292
74292
|
},
|
|
74293
74293
|
...fileSystem
|
|
74294
74294
|
};
|
|
@@ -74337,7 +74337,7 @@ var WatchBackend = class extends (/* @__PURE__ */ Tag2("@effect/platform/FileSys
|
|
|
74337
74337
|
};
|
|
74338
74338
|
|
|
74339
74339
|
// 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
|
|
74340
|
-
var handleErrnoException = (module, method) => (err, [
|
|
74340
|
+
var handleErrnoException = (module, method) => (err, [path14]) => {
|
|
74341
74341
|
let reason = "Unknown";
|
|
74342
74342
|
switch (err.code) {
|
|
74343
74343
|
case "ENOENT":
|
|
@@ -74366,7 +74366,7 @@ var handleErrnoException = (module, method) => (err, [path11]) => {
|
|
|
74366
74366
|
reason,
|
|
74367
74367
|
module,
|
|
74368
74368
|
method,
|
|
74369
|
-
pathOrDescriptor:
|
|
74369
|
+
pathOrDescriptor: path14,
|
|
74370
74370
|
syscall: err.syscall,
|
|
74371
74371
|
description: err.message,
|
|
74372
74372
|
cause: err
|
|
@@ -74625,7 +74625,7 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
|
|
|
74625
74625
|
});
|
|
74626
74626
|
var access2 = /* @__PURE__ */ (() => {
|
|
74627
74627
|
const nodeAccess = /* @__PURE__ */ effectify2(NFS__namespace.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
74628
|
-
return (
|
|
74628
|
+
return (path14, options3) => {
|
|
74629
74629
|
let mode = NFS__namespace.constants.F_OK;
|
|
74630
74630
|
if (options3?.readable) {
|
|
74631
74631
|
mode |= NFS__namespace.constants.R_OK;
|
|
@@ -74633,7 +74633,7 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
74633
74633
|
if (options3?.writable) {
|
|
74634
74634
|
mode |= NFS__namespace.constants.W_OK;
|
|
74635
74635
|
}
|
|
74636
|
-
return nodeAccess(
|
|
74636
|
+
return nodeAccess(path14, mode);
|
|
74637
74637
|
};
|
|
74638
74638
|
})();
|
|
74639
74639
|
var copy3 = /* @__PURE__ */ (() => {
|
|
@@ -74650,11 +74650,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
|
|
|
74650
74650
|
})();
|
|
74651
74651
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
74652
74652
|
const nodeChmod = /* @__PURE__ */ effectify2(NFS__namespace.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
74653
|
-
return (
|
|
74653
|
+
return (path14, mode) => nodeChmod(path14, mode);
|
|
74654
74654
|
})();
|
|
74655
74655
|
var chown2 = /* @__PURE__ */ (() => {
|
|
74656
74656
|
const nodeChown = /* @__PURE__ */ effectify2(NFS__namespace.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
74657
|
-
return (
|
|
74657
|
+
return (path14, uid, gid) => nodeChown(path14, uid, gid);
|
|
74658
74658
|
})();
|
|
74659
74659
|
var link2 = /* @__PURE__ */ (() => {
|
|
74660
74660
|
const nodeLink = /* @__PURE__ */ effectify2(NFS__namespace.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
|
|
@@ -74662,7 +74662,7 @@ var link2 = /* @__PURE__ */ (() => {
|
|
|
74662
74662
|
})();
|
|
74663
74663
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
74664
74664
|
const nodeMkdir = /* @__PURE__ */ effectify2(NFS__namespace.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
74665
|
-
return (
|
|
74665
|
+
return (path14, options3) => nodeMkdir(path14, {
|
|
74666
74666
|
recursive: options3?.recursive ?? false,
|
|
74667
74667
|
mode: options3?.mode
|
|
74668
74668
|
});
|
|
@@ -74671,14 +74671,14 @@ var makeTempDirectoryFactory = (method) => {
|
|
|
74671
74671
|
const nodeMkdtemp = effectify2(NFS__namespace.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
74672
74672
|
return (options3) => suspend4(() => {
|
|
74673
74673
|
const prefix = options3?.prefix ?? "";
|
|
74674
|
-
const directory5 = typeof options3?.directory === "string" ?
|
|
74675
|
-
return nodeMkdtemp(prefix ?
|
|
74674
|
+
const directory5 = typeof options3?.directory === "string" ? path5__namespace.join(options3.directory, ".") : OS__namespace.tmpdir();
|
|
74675
|
+
return nodeMkdtemp(prefix ? path5__namespace.join(directory5, prefix) : directory5 + "/");
|
|
74676
74676
|
});
|
|
74677
74677
|
};
|
|
74678
74678
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
74679
74679
|
var removeFactory = (method) => {
|
|
74680
74680
|
const nodeRm = effectify2(NFS__namespace.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
74681
|
-
return (
|
|
74681
|
+
return (path14, options3) => nodeRm(path14, {
|
|
74682
74682
|
recursive: options3?.recursive ?? false,
|
|
74683
74683
|
force: options3?.force ?? false
|
|
74684
74684
|
});
|
|
@@ -74694,7 +74694,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
74694
74694
|
var openFactory = (method) => {
|
|
74695
74695
|
const nodeOpen = effectify2(NFS__namespace.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
74696
74696
|
const nodeClose = effectify2(NFS__namespace.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
74697
|
-
return (
|
|
74697
|
+
return (path14, options3) => pipe(acquireRelease2(nodeOpen(path14, options3?.flag ?? "r", options3?.mode), (fd) => orDie2(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
|
|
74698
74698
|
};
|
|
74699
74699
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
74700
74700
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -74809,7 +74809,7 @@ var makeTempFileFactory = (method) => {
|
|
|
74809
74809
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
74810
74810
|
const open3 = openFactory(method);
|
|
74811
74811
|
const randomHexString2 = (bytes) => sync5(() => Crypto__namespace.randomBytes(bytes).toString("hex"));
|
|
74812
|
-
return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map17(([directory5, random4]) =>
|
|
74812
|
+
return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map17(([directory5, random4]) => path5__namespace.join(directory5, random4)), tap3((path14) => scoped2(open3(path14, {
|
|
74813
74813
|
flag: "w+"
|
|
74814
74814
|
}))));
|
|
74815
74815
|
};
|
|
@@ -74817,21 +74817,21 @@ var makeTempFile = /* @__PURE__ */ makeTempFileFactory("makeTempFile");
|
|
|
74817
74817
|
var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
74818
74818
|
const makeFile2 = /* @__PURE__ */ makeTempFileFactory("makeTempFileScoped");
|
|
74819
74819
|
const removeDirectory = /* @__PURE__ */ removeFactory("makeTempFileScoped");
|
|
74820
|
-
return (options3) => acquireRelease2(makeFile2(options3), (file6) => orDie2(removeDirectory(
|
|
74820
|
+
return (options3) => acquireRelease2(makeFile2(options3), (file6) => orDie2(removeDirectory(path5__namespace.dirname(file6), {
|
|
74821
74821
|
recursive: true
|
|
74822
74822
|
})));
|
|
74823
74823
|
})();
|
|
74824
|
-
var readDirectory = (
|
|
74825
|
-
try: () => NFS__namespace.promises.readdir(
|
|
74826
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
74824
|
+
var readDirectory = (path14, options3) => tryPromise2({
|
|
74825
|
+
try: () => NFS__namespace.promises.readdir(path14, options3),
|
|
74826
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path14])
|
|
74827
74827
|
});
|
|
74828
|
-
var readFile2 = (
|
|
74828
|
+
var readFile2 = (path14) => async2((resume2, signal) => {
|
|
74829
74829
|
try {
|
|
74830
|
-
NFS__namespace.readFile(
|
|
74830
|
+
NFS__namespace.readFile(path14, {
|
|
74831
74831
|
signal
|
|
74832
74832
|
}, (err, data) => {
|
|
74833
74833
|
if (err) {
|
|
74834
|
-
resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [
|
|
74834
|
+
resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [path14])));
|
|
74835
74835
|
} else {
|
|
74836
74836
|
resume2(succeed9(data));
|
|
74837
74837
|
}
|
|
@@ -74842,11 +74842,11 @@ var readFile2 = (path11) => async2((resume2, signal) => {
|
|
|
74842
74842
|
});
|
|
74843
74843
|
var readLink = /* @__PURE__ */ (() => {
|
|
74844
74844
|
const nodeReadLink = /* @__PURE__ */ effectify2(NFS__namespace.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
74845
|
-
return (
|
|
74845
|
+
return (path14) => nodeReadLink(path14);
|
|
74846
74846
|
})();
|
|
74847
74847
|
var realPath = /* @__PURE__ */ (() => {
|
|
74848
74848
|
const nodeRealPath = /* @__PURE__ */ effectify2(NFS__namespace.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
74849
|
-
return (
|
|
74849
|
+
return (path14) => nodeRealPath(path14);
|
|
74850
74850
|
})();
|
|
74851
74851
|
var rename3 = /* @__PURE__ */ (() => {
|
|
74852
74852
|
const nodeRename = /* @__PURE__ */ effectify2(NFS__namespace.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
@@ -74870,40 +74870,40 @@ var makeFileInfo = (stat3) => ({
|
|
|
74870
74870
|
});
|
|
74871
74871
|
var stat2 = /* @__PURE__ */ (() => {
|
|
74872
74872
|
const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
74873
|
-
return (
|
|
74873
|
+
return (path14) => map17(nodeStat(path14), makeFileInfo);
|
|
74874
74874
|
})();
|
|
74875
74875
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
74876
74876
|
const nodeSymlink = /* @__PURE__ */ effectify2(NFS__namespace.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
74877
|
-
return (target,
|
|
74877
|
+
return (target, path14) => nodeSymlink(target, path14);
|
|
74878
74878
|
})();
|
|
74879
74879
|
var truncate2 = /* @__PURE__ */ (() => {
|
|
74880
74880
|
const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
74881
|
-
return (
|
|
74881
|
+
return (path14, length4) => nodeTruncate(path14, length4 !== void 0 ? Number(length4) : void 0);
|
|
74882
74882
|
})();
|
|
74883
74883
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
74884
74884
|
const nodeUtimes = /* @__PURE__ */ effectify2(NFS__namespace.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
74885
|
-
return (
|
|
74885
|
+
return (path14, atime, mtime) => nodeUtimes(path14, atime, mtime);
|
|
74886
74886
|
})();
|
|
74887
|
-
var watchNode = (
|
|
74888
|
-
const watcher = NFS__namespace.watch(
|
|
74887
|
+
var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(sync5(() => {
|
|
74888
|
+
const watcher = NFS__namespace.watch(path14, {
|
|
74889
74889
|
recursive: options3?.recursive
|
|
74890
|
-
}, (event,
|
|
74891
|
-
if (!
|
|
74890
|
+
}, (event, path15) => {
|
|
74891
|
+
if (!path15) return;
|
|
74892
74892
|
switch (event) {
|
|
74893
74893
|
case "rename": {
|
|
74894
|
-
emit.fromEffect(matchEffect2(stat2(
|
|
74894
|
+
emit.fromEffect(matchEffect2(stat2(path15), {
|
|
74895
74895
|
onSuccess: (_) => succeed9(WatchEventCreate({
|
|
74896
|
-
path:
|
|
74896
|
+
path: path15
|
|
74897
74897
|
})),
|
|
74898
74898
|
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed9(WatchEventRemove({
|
|
74899
|
-
path:
|
|
74899
|
+
path: path15
|
|
74900
74900
|
})) : fail9(err)
|
|
74901
74901
|
}));
|
|
74902
74902
|
return;
|
|
74903
74903
|
}
|
|
74904
74904
|
case "change": {
|
|
74905
74905
|
emit.single(WatchEventUpdate({
|
|
74906
|
-
path:
|
|
74906
|
+
path: path15
|
|
74907
74907
|
}));
|
|
74908
74908
|
return;
|
|
74909
74909
|
}
|
|
@@ -74914,7 +74914,7 @@ var watchNode = (path11, options3) => asyncScoped2((emit) => acquireRelease2(syn
|
|
|
74914
74914
|
module: "FileSystem",
|
|
74915
74915
|
reason: "Unknown",
|
|
74916
74916
|
method: "watch",
|
|
74917
|
-
pathOrDescriptor:
|
|
74917
|
+
pathOrDescriptor: path14,
|
|
74918
74918
|
cause: error4
|
|
74919
74919
|
}));
|
|
74920
74920
|
});
|
|
@@ -74923,16 +74923,16 @@ var watchNode = (path11, options3) => asyncScoped2((emit) => acquireRelease2(syn
|
|
|
74923
74923
|
});
|
|
74924
74924
|
return watcher;
|
|
74925
74925
|
}), (watcher) => sync5(() => watcher.close())));
|
|
74926
|
-
var watch2 = (backend,
|
|
74927
|
-
var writeFile2 = (
|
|
74926
|
+
var watch2 = (backend, path14, options3) => stat2(path14).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path14, stat3, options3)), getOrElse(() => watchNode(path14, options3)))), unwrap3);
|
|
74927
|
+
var writeFile2 = (path14, data, options3) => async2((resume2, signal) => {
|
|
74928
74928
|
try {
|
|
74929
|
-
NFS__namespace.writeFile(
|
|
74929
|
+
NFS__namespace.writeFile(path14, data, {
|
|
74930
74930
|
signal,
|
|
74931
74931
|
flag: options3?.flag,
|
|
74932
74932
|
mode: options3?.mode
|
|
74933
74933
|
}, (err) => {
|
|
74934
74934
|
if (err) {
|
|
74935
|
-
resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
74935
|
+
resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path14])));
|
|
74936
74936
|
} else {
|
|
74937
74937
|
resume2(_void);
|
|
74938
74938
|
}
|
|
@@ -74964,8 +74964,8 @@ var makeFileSystem = /* @__PURE__ */ map17(/* @__PURE__ */ serviceOption2(WatchB
|
|
|
74964
74964
|
symlink: symlink2,
|
|
74965
74965
|
truncate: truncate2,
|
|
74966
74966
|
utimes: utimes2,
|
|
74967
|
-
watch(
|
|
74968
|
-
return watch2(backend,
|
|
74967
|
+
watch(path14, options3) {
|
|
74968
|
+
return watch2(backend, path14, options3);
|
|
74969
74969
|
},
|
|
74970
74970
|
writeFile: writeFile2
|
|
74971
74971
|
}));
|
|
@@ -74990,18 +74990,18 @@ var fromFileUrl2 = (url2) => try_2({
|
|
|
74990
74990
|
cause: error4
|
|
74991
74991
|
})
|
|
74992
74992
|
});
|
|
74993
|
-
var toFileUrl2 = (
|
|
74994
|
-
try: () => NodeUrl__namespace.pathToFileURL(
|
|
74993
|
+
var toFileUrl2 = (path14) => try_2({
|
|
74994
|
+
try: () => NodeUrl__namespace.pathToFileURL(path14),
|
|
74995
74995
|
catch: (error4) => new BadArgument({
|
|
74996
74996
|
module: "Path",
|
|
74997
74997
|
method: "toFileUrl",
|
|
74998
|
-
description: `Invalid path: ${
|
|
74998
|
+
description: `Invalid path: ${path14}`,
|
|
74999
74999
|
cause: error4
|
|
75000
75000
|
})
|
|
75001
75001
|
});
|
|
75002
75002
|
var layer6 = /* @__PURE__ */ succeed10(Path3, /* @__PURE__ */ Path3.of({
|
|
75003
75003
|
[TypeId22]: TypeId22,
|
|
75004
|
-
...
|
|
75004
|
+
...path5__namespace,
|
|
75005
75005
|
fromFileUrl: fromFileUrl2,
|
|
75006
75006
|
toFileUrl: toFileUrl2
|
|
75007
75007
|
}));
|
|
@@ -75481,8 +75481,8 @@ var make59 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
75481
75481
|
readlineInterface.once("line", onLine);
|
|
75482
75482
|
return sync5(() => readlineInterface.off("line", onLine));
|
|
75483
75483
|
})), scoped2);
|
|
75484
|
-
const display = (
|
|
75485
|
-
stdout3.write(
|
|
75484
|
+
const display = (prompt6) => uninterruptible2(async2((resume2) => {
|
|
75485
|
+
stdout3.write(prompt6, (err) => err ? resume2(fail9(new BadArgument({
|
|
75486
75486
|
module: "Terminal",
|
|
75487
75487
|
method: "display",
|
|
75488
75488
|
description: "Failed to write prompt to stdout",
|
|
@@ -76153,22 +76153,22 @@ var fileParsers = {
|
|
|
76153
76153
|
toml: (content) => Toml.parse(content),
|
|
76154
76154
|
tml: (content) => Toml.parse(content)
|
|
76155
76155
|
};
|
|
76156
|
-
var read3 = (
|
|
76157
|
-
onFailure: (error4) => fail9(`Could not read file (${
|
|
76158
|
-
onSuccess: (content) => succeed9([
|
|
76156
|
+
var read3 = (path14) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFile(path14), {
|
|
76157
|
+
onFailure: (error4) => fail9(`Could not read file (${path14}): ${error4}`),
|
|
76158
|
+
onSuccess: (content) => succeed9([path14, content])
|
|
76159
76159
|
}));
|
|
76160
|
-
var readString = (
|
|
76161
|
-
onFailure: (error4) => fail9(`Could not read file (${
|
|
76162
|
-
onSuccess: (content) => succeed9([
|
|
76160
|
+
var readString = (path14) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFileString(path14), {
|
|
76161
|
+
onFailure: (error4) => fail9(`Could not read file (${path14}): ${error4}`),
|
|
76162
|
+
onSuccess: (content) => succeed9([path14, content])
|
|
76163
76163
|
}));
|
|
76164
|
-
var parse5 = (
|
|
76165
|
-
const parser = fileParsers[format6 ??
|
|
76164
|
+
var parse5 = (path14, content, format6) => {
|
|
76165
|
+
const parser = fileParsers[format6 ?? path14.split(".").pop()];
|
|
76166
76166
|
if (parser === void 0) {
|
|
76167
76167
|
return fail9(`Unsupported file format: ${format6}`);
|
|
76168
76168
|
}
|
|
76169
76169
|
return try_2({
|
|
76170
76170
|
try: () => parser(content),
|
|
76171
|
-
catch: (e) => `Could not parse ${format6} file (${
|
|
76171
|
+
catch: (e) => `Could not parse ${format6} file (${path14}): ${e}`
|
|
76172
76172
|
});
|
|
76173
76173
|
};
|
|
76174
76174
|
|
|
@@ -77753,8 +77753,8 @@ var run5 = /* @__PURE__ */ fnUntraced2(function* (self2) {
|
|
|
77753
77753
|
const input = yield* terminal.readInput;
|
|
77754
77754
|
return yield* runWithInput(self2, terminal, input);
|
|
77755
77755
|
}, /* @__PURE__ */ mapError2(() => new QuitException()), scoped2);
|
|
77756
|
-
var runWithInput = (
|
|
77757
|
-
const op =
|
|
77756
|
+
var runWithInput = (prompt6, terminal, input) => suspend4(() => {
|
|
77757
|
+
const op = prompt6;
|
|
77758
77758
|
switch (op._tag) {
|
|
77759
77759
|
case "Loop": {
|
|
77760
77760
|
return runLoop(op, terminal, input);
|
|
@@ -77967,8 +77967,8 @@ function eraseText(text11, columns) {
|
|
|
77967
77967
|
}
|
|
77968
77968
|
return eraseLines3(rows);
|
|
77969
77969
|
}
|
|
77970
|
-
function lines3(
|
|
77971
|
-
const lines4 =
|
|
77970
|
+
function lines3(prompt6, columns) {
|
|
77971
|
+
const lines4 = prompt6.split(/\r?\n/);
|
|
77972
77972
|
return columns === 0 ? lines4.length : pipe(map3(lines4, (line4) => Math.ceil(line4.length / columns)), reduce(0, (left3, right3) => left3 + right3));
|
|
77973
77973
|
}
|
|
77974
77974
|
|
|
@@ -78470,22 +78470,22 @@ var showConfirmation = /* @__PURE__ */ Confirm.$is("Show");
|
|
|
78470
78470
|
var renderBeep2 = /* @__PURE__ */ render3(beep3, {
|
|
78471
78471
|
style: "pretty"
|
|
78472
78472
|
});
|
|
78473
|
-
function resolveCurrentPath(
|
|
78474
|
-
return match2(
|
|
78473
|
+
function resolveCurrentPath(path14, options3) {
|
|
78474
|
+
return match2(path14, {
|
|
78475
78475
|
onNone: () => match2(options3.startingPath, {
|
|
78476
78476
|
onNone: () => sync5(() => process.cwd()),
|
|
78477
|
-
onSome: (
|
|
78477
|
+
onSome: (path15) => flatMap10(FileSystem, (fs) => (
|
|
78478
78478
|
// Ensure the user provided starting path exists
|
|
78479
|
-
orDie2(fs.exists(
|
|
78479
|
+
orDie2(fs.exists(path15)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path15}' does not exist`), as5(path15))
|
|
78480
78480
|
))
|
|
78481
78481
|
}),
|
|
78482
|
-
onSome: (
|
|
78482
|
+
onSome: (path15) => succeed9(path15)
|
|
78483
78483
|
});
|
|
78484
78484
|
}
|
|
78485
78485
|
function getFileList(directory5, options3) {
|
|
78486
78486
|
return gen3(function* () {
|
|
78487
78487
|
const fs = yield* FileSystem;
|
|
78488
|
-
const
|
|
78488
|
+
const path14 = yield* Path3;
|
|
78489
78489
|
const files = yield* orDie2(fs.readDirectory(directory5)).pipe(
|
|
78490
78490
|
// Always prepend the `".."` option to the file list but allow it
|
|
78491
78491
|
// to be filtered out if the user so desires
|
|
@@ -78494,7 +78494,7 @@ function getFileList(directory5, options3) {
|
|
|
78494
78494
|
return yield* filter8(files, (file6) => {
|
|
78495
78495
|
const result = options3.filter(file6);
|
|
78496
78496
|
const userDefinedFilter = isEffect2(result) ? result : succeed9(result);
|
|
78497
|
-
const directoryFilter = options3.type === "directory" ? map17(orDie2(fs.stat(
|
|
78497
|
+
const directoryFilter = options3.type === "directory" ? map17(orDie2(fs.stat(path14.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed9(true);
|
|
78498
78498
|
return zipWith5(userDefinedFilter, directoryFilter, (a, b) => a && b);
|
|
78499
78499
|
}, {
|
|
78500
78500
|
concurrency: files.length
|
|
@@ -78560,13 +78560,13 @@ function renderFiles(state, files, figures2, options3) {
|
|
|
78560
78560
|
}
|
|
78561
78561
|
function renderNextFrame2(state, options3) {
|
|
78562
78562
|
return gen3(function* () {
|
|
78563
|
-
const
|
|
78563
|
+
const path14 = yield* Path3;
|
|
78564
78564
|
const terminal = yield* Terminal;
|
|
78565
78565
|
const columns = yield* terminal.columns;
|
|
78566
78566
|
const figures2 = yield* figures;
|
|
78567
78567
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
78568
78568
|
const selectedPath = state.files[state.cursor];
|
|
78569
|
-
const resolvedPath =
|
|
78569
|
+
const resolvedPath = path14.resolve(currentPath, selectedPath);
|
|
78570
78570
|
const resolvedPathMsg = figures2.pointerSmall.pipe(cat2(space2), cat2(text3(resolvedPath)), annotate2(blackBright2));
|
|
78571
78571
|
if (showConfirmation(state.confirm)) {
|
|
78572
78572
|
const leadingSymbol2 = annotate2(text3("?"), cyanBright2);
|
|
@@ -78641,10 +78641,10 @@ function processCursorDown(state) {
|
|
|
78641
78641
|
function processSelection(state, options3) {
|
|
78642
78642
|
return gen3(function* () {
|
|
78643
78643
|
const fs = yield* FileSystem;
|
|
78644
|
-
const
|
|
78644
|
+
const path14 = yield* Path3;
|
|
78645
78645
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
78646
78646
|
const selectedPath = state.files[state.cursor];
|
|
78647
|
-
const resolvedPath =
|
|
78647
|
+
const resolvedPath = path14.resolve(currentPath, selectedPath);
|
|
78648
78648
|
const info3 = yield* orDie2(fs.stat(resolvedPath));
|
|
78649
78649
|
if (info3.type === "Directory") {
|
|
78650
78650
|
const files = yield* getFileList(resolvedPath, options3);
|
|
@@ -78692,10 +78692,10 @@ function handleProcess2(options3) {
|
|
|
78692
78692
|
case "y":
|
|
78693
78693
|
case "t": {
|
|
78694
78694
|
if (showConfirmation(state.confirm)) {
|
|
78695
|
-
const
|
|
78695
|
+
const path14 = yield* Path3;
|
|
78696
78696
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
78697
78697
|
const selectedPath = state.files[state.cursor];
|
|
78698
|
-
const resolvedPath =
|
|
78698
|
+
const resolvedPath = path14.resolve(currentPath, selectedPath);
|
|
78699
78699
|
const files = yield* getFileList(resolvedPath, options3);
|
|
78700
78700
|
return Action.NextFrame({
|
|
78701
78701
|
state: {
|
|
@@ -78711,10 +78711,10 @@ function handleProcess2(options3) {
|
|
|
78711
78711
|
case "n":
|
|
78712
78712
|
case "f": {
|
|
78713
78713
|
if (showConfirmation(state.confirm)) {
|
|
78714
|
-
const
|
|
78714
|
+
const path14 = yield* Path3;
|
|
78715
78715
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
78716
78716
|
const selectedPath = state.files[state.cursor];
|
|
78717
|
-
const resolvedPath =
|
|
78717
|
+
const resolvedPath = path14.resolve(currentPath, selectedPath);
|
|
78718
78718
|
return Action.Submit({
|
|
78719
78719
|
value: resolvedPath
|
|
78720
78720
|
});
|
|
@@ -78736,14 +78736,14 @@ var file = (options3 = {}) => {
|
|
|
78736
78736
|
filter: options3.filter ?? (() => succeed9(true))
|
|
78737
78737
|
};
|
|
78738
78738
|
const initialState3 = gen3(function* () {
|
|
78739
|
-
const
|
|
78740
|
-
const currentPath = yield* resolveCurrentPath(
|
|
78739
|
+
const path14 = none2();
|
|
78740
|
+
const currentPath = yield* resolveCurrentPath(path14, opts);
|
|
78741
78741
|
const files = yield* getFileList(currentPath, opts);
|
|
78742
78742
|
const confirm = Confirm.Hide();
|
|
78743
78743
|
return {
|
|
78744
78744
|
cursor: 0,
|
|
78745
78745
|
files,
|
|
78746
|
-
path:
|
|
78746
|
+
path: path14,
|
|
78747
78747
|
confirm
|
|
78748
78748
|
};
|
|
78749
78749
|
});
|
|
@@ -79888,7 +79888,7 @@ var validateInternal = (self2, value5, config3) => {
|
|
|
79888
79888
|
case "Path": {
|
|
79889
79889
|
return flatMap10(FileSystem, (fileSystem) => {
|
|
79890
79890
|
const errorMsg = "Path options do not have a default value";
|
|
79891
|
-
return orElseFail2(value5, () => errorMsg).pipe(tap3((
|
|
79891
|
+
return orElseFail2(value5, () => errorMsg).pipe(tap3((path14) => orDie2(fileSystem.exists(path14)).pipe(tap3((pathExists) => validatePathExistence(path14, self2.pathExists, pathExists).pipe(zipRight5(validatePathType(path14, self2.pathType, fileSystem).pipe(when2(() => self2.pathExists !== "no" && pathExists))))))));
|
|
79892
79892
|
});
|
|
79893
79893
|
}
|
|
79894
79894
|
case "Redacted": {
|
|
@@ -79903,24 +79903,24 @@ var validateInternal = (self2, value5, config3) => {
|
|
|
79903
79903
|
}
|
|
79904
79904
|
};
|
|
79905
79905
|
var attempt = (option5, typeName, parse9) => orElseFail2(option5, () => `${typeName} options do not have a default value`).pipe(flatMap10((value5) => orElseFail2(parse9(value5), () => `'${value5}' is not a ${typeName}`)));
|
|
79906
|
-
var validatePathExistence = (
|
|
79906
|
+
var validatePathExistence = (path14, shouldPathExist, pathExists) => {
|
|
79907
79907
|
if (shouldPathExist === "no" && pathExists) {
|
|
79908
|
-
return fail9(`Path '${
|
|
79908
|
+
return fail9(`Path '${path14}' must not exist`);
|
|
79909
79909
|
}
|
|
79910
79910
|
if (shouldPathExist === "yes" && !pathExists) {
|
|
79911
|
-
return fail9(`Path '${
|
|
79911
|
+
return fail9(`Path '${path14}' must exist`);
|
|
79912
79912
|
}
|
|
79913
79913
|
return _void;
|
|
79914
79914
|
};
|
|
79915
|
-
var validatePathType = (
|
|
79915
|
+
var validatePathType = (path14, pathType, fileSystem) => {
|
|
79916
79916
|
switch (pathType) {
|
|
79917
79917
|
case "file": {
|
|
79918
|
-
const checkIsFile = fileSystem.stat(
|
|
79919
|
-
return fail9(`Expected path '${
|
|
79918
|
+
const checkIsFile = fileSystem.stat(path14).pipe(map17((info3) => info3.type === "File"), orDie2);
|
|
79919
|
+
return fail9(`Expected path '${path14}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
|
|
79920
79920
|
}
|
|
79921
79921
|
case "directory": {
|
|
79922
|
-
const checkIsDirectory = fileSystem.stat(
|
|
79923
|
-
return fail9(`Expected path '${
|
|
79922
|
+
const checkIsDirectory = fileSystem.stat(path14).pipe(map17((info3) => info3.type === "Directory"), orDie2);
|
|
79923
|
+
return fail9(`Expected path '${path14}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
|
|
79924
79924
|
}
|
|
79925
79925
|
case "either": {
|
|
79926
79926
|
return _void;
|
|
@@ -80342,13 +80342,13 @@ var file2 = (config3) => makeSingle(fromNullable(config3?.name), path("file", co
|
|
|
80342
80342
|
var fileContent = (config3) => mapEffect6(file2({
|
|
80343
80343
|
...config3,
|
|
80344
80344
|
exists: "yes"
|
|
80345
|
-
}), (
|
|
80346
|
-
var fileParse = (config3) => mapEffect6(fileText(config3), ([
|
|
80345
|
+
}), (path14) => mapError2(read3(path14), (e) => p(e)));
|
|
80346
|
+
var fileParse = (config3) => mapEffect6(fileText(config3), ([path14, content]) => mapError2(parse5(path14, content, config3?.format), (e) => p(e)));
|
|
80347
80347
|
var fileSchema = (schema, config3) => withSchema(fileParse(config3), schema);
|
|
80348
80348
|
var fileText = (config3) => mapEffect6(file2({
|
|
80349
80349
|
...config3,
|
|
80350
80350
|
exists: "yes"
|
|
80351
|
-
}), (
|
|
80351
|
+
}), (path14) => mapError2(readString(path14), (e) => p(e)));
|
|
80352
80352
|
var float3 = (config3) => makeSingle(fromNullable(config3?.name), float2);
|
|
80353
80353
|
var integer4 = (config3) => makeSingle(fromNullable(config3?.name), integer3);
|
|
80354
80354
|
var none12 = /* @__PURE__ */ (() => {
|
|
@@ -80964,12 +80964,12 @@ var directory3 = (name, config3) => makeSingle2(name, empty3(), path("directory"
|
|
|
80964
80964
|
var file4 = (name, config3) => makeSingle2(name, empty3(), path("file", config3?.exists ?? "either"));
|
|
80965
80965
|
var fileContent3 = (name) => mapEffect8(file4(name, {
|
|
80966
80966
|
exists: "yes"
|
|
80967
|
-
}), (
|
|
80968
|
-
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([
|
|
80967
|
+
}), (path14) => mapError2(read3(path14), (msg) => invalidValue(p(msg))));
|
|
80968
|
+
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([path14, content]) => mapError2(parse5(path14, content, format6), (error4) => invalidValue(p(error4))));
|
|
80969
80969
|
var fileSchema3 = (name, schema, format6) => withSchema3(fileParse3(name, format6), schema);
|
|
80970
80970
|
var fileText3 = (name) => mapEffect8(file4(name, {
|
|
80971
80971
|
exists: "yes"
|
|
80972
|
-
}), (
|
|
80972
|
+
}), (path14) => mapError2(readString(path14), (error4) => invalidValue(p(error4))));
|
|
80973
80973
|
var filterMap8 = /* @__PURE__ */ dual(3, (self2, f, message) => mapEffect8(self2, (a) => match2(f(a), {
|
|
80974
80974
|
onNone: () => left2(invalidValue(p(message))),
|
|
80975
80975
|
onSome: right2
|
|
@@ -81031,11 +81031,11 @@ var withFallbackConfig3 = /* @__PURE__ */ dual(2, (self2, config3) => {
|
|
|
81031
81031
|
}
|
|
81032
81032
|
return makeWithFallback(self2, config3);
|
|
81033
81033
|
});
|
|
81034
|
-
var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2,
|
|
81034
|
+
var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2, prompt6) => {
|
|
81035
81035
|
if (isInstruction2(self2) && isWithDefault2(self2)) {
|
|
81036
|
-
return makeWithDefault2(withFallbackPrompt(self2.options,
|
|
81036
|
+
return makeWithDefault2(withFallbackPrompt(self2.options, prompt6), self2.fallback);
|
|
81037
81037
|
}
|
|
81038
|
-
return makeWithFallback(self2,
|
|
81038
|
+
return makeWithFallback(self2, prompt6);
|
|
81039
81039
|
});
|
|
81040
81040
|
var withDescription4 = /* @__PURE__ */ dual(2, (self2, desc) => modifySingle(self2, (single2) => {
|
|
81041
81041
|
const description = sequence(single2.description, p(desc));
|
|
@@ -82178,12 +82178,12 @@ var make65 = (name, options3 = none14, args2 = none12) => {
|
|
|
82178
82178
|
op.args = args2;
|
|
82179
82179
|
return op;
|
|
82180
82180
|
};
|
|
82181
|
-
var prompt = (name,
|
|
82181
|
+
var prompt = (name, prompt6) => {
|
|
82182
82182
|
const op = Object.create(proto23);
|
|
82183
82183
|
op._tag = "GetUserInput";
|
|
82184
82184
|
op.name = name;
|
|
82185
82185
|
op.description = empty39;
|
|
82186
|
-
op.prompt =
|
|
82186
|
+
op.prompt = prompt6;
|
|
82187
82187
|
return op;
|
|
82188
82188
|
};
|
|
82189
82189
|
var getHelp7 = (self2, config3) => getHelpInternal4(self2, config3);
|
|
@@ -83024,7 +83024,7 @@ var getUsage6 = (self2) => getUsage5(self2.descriptor);
|
|
|
83024
83024
|
var mapDescriptor = /* @__PURE__ */ dual(2, (self2, f) => makeDerive(self2, {
|
|
83025
83025
|
descriptor: f(self2.descriptor)
|
|
83026
83026
|
}));
|
|
83027
|
-
var prompt2 = (name,
|
|
83027
|
+
var prompt2 = (name, prompt6, handler) => makeProto(map35(prompt(name, prompt6), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
|
|
83028
83028
|
var withHandler = /* @__PURE__ */ dual(2, (self2, handler) => makeDerive(self2, {
|
|
83029
83029
|
handler,
|
|
83030
83030
|
transform: identity
|
|
@@ -83125,6 +83125,132 @@ var make69 = make42;
|
|
|
83125
83125
|
var makeWith2 = makeWith;
|
|
83126
83126
|
var makeCacheStats2 = makeCacheStats;
|
|
83127
83127
|
var makeEntryStats2 = makeEntryStats;
|
|
83128
|
+
var NotAGitRepoError = class extends Data_exports.TaggedError(
|
|
83129
|
+
"NotAGitRepoError"
|
|
83130
|
+
) {
|
|
83131
|
+
};
|
|
83132
|
+
var CommitNotFoundError = class extends Data_exports.TaggedError(
|
|
83133
|
+
"CommitNotFoundError"
|
|
83134
|
+
) {
|
|
83135
|
+
};
|
|
83136
|
+
var cherryPick = Command_exports2.make(
|
|
83137
|
+
"cherry-pick",
|
|
83138
|
+
{
|
|
83139
|
+
lessonId: Args_exports.text({ name: "lesson-id" }),
|
|
83140
|
+
branch: Options_exports.text("branch").pipe(
|
|
83141
|
+
Options_exports.withDescription(
|
|
83142
|
+
"Branch to search for the lesson commit"
|
|
83143
|
+
)
|
|
83144
|
+
)
|
|
83145
|
+
},
|
|
83146
|
+
({ branch, lessonId }) => Effect_exports.gen(function* () {
|
|
83147
|
+
const cwd = process.cwd();
|
|
83148
|
+
const gitDirPath = path5__namespace.join(cwd, ".git");
|
|
83149
|
+
if (!NFS.existsSync(gitDirPath)) {
|
|
83150
|
+
return yield* Effect_exports.fail(
|
|
83151
|
+
new NotAGitRepoError({
|
|
83152
|
+
path: cwd,
|
|
83153
|
+
message: `Current directory is not a git repository: ${cwd}`
|
|
83154
|
+
})
|
|
83155
|
+
);
|
|
83156
|
+
}
|
|
83157
|
+
yield* Console_exports.log(
|
|
83158
|
+
`Searching for lesson ${lessonId} on branch ${branch}...`
|
|
83159
|
+
);
|
|
83160
|
+
const gitLogCommand = Command_exports.make(
|
|
83161
|
+
"git",
|
|
83162
|
+
"log",
|
|
83163
|
+
branch,
|
|
83164
|
+
"--oneline",
|
|
83165
|
+
"--all"
|
|
83166
|
+
).pipe(Command_exports.workingDirectory(cwd));
|
|
83167
|
+
const commitHistory = yield* Command_exports.string(gitLogCommand);
|
|
83168
|
+
const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
|
|
83169
|
+
const [sha, ...messageParts] = line4.split(" ");
|
|
83170
|
+
const message = messageParts.join(" ");
|
|
83171
|
+
const lessonMatch = message.match(
|
|
83172
|
+
/^(\d+)[.-](\d+)[.-](\d+)/
|
|
83173
|
+
);
|
|
83174
|
+
const extractedLessonId = lessonMatch ? `${lessonMatch[1].padStart(
|
|
83175
|
+
2,
|
|
83176
|
+
"0"
|
|
83177
|
+
)}.${lessonMatch[2].padStart(
|
|
83178
|
+
2,
|
|
83179
|
+
"0"
|
|
83180
|
+
)}.${lessonMatch[3].padStart(2, "0")}` : null;
|
|
83181
|
+
return {
|
|
83182
|
+
sha,
|
|
83183
|
+
message,
|
|
83184
|
+
lessonId: extractedLessonId
|
|
83185
|
+
};
|
|
83186
|
+
});
|
|
83187
|
+
const matchingCommits = commits.filter(
|
|
83188
|
+
(commit) => commit.lessonId === lessonId
|
|
83189
|
+
);
|
|
83190
|
+
if (matchingCommits.length === 0) {
|
|
83191
|
+
return yield* new CommitNotFoundError({
|
|
83192
|
+
lessonId,
|
|
83193
|
+
branch
|
|
83194
|
+
});
|
|
83195
|
+
}
|
|
83196
|
+
const targetCommit = matchingCommits[matchingCommits.length - 1];
|
|
83197
|
+
yield* Console_exports.log(
|
|
83198
|
+
`Found commit: ${targetCommit.sha} ${targetCommit.message}`
|
|
83199
|
+
);
|
|
83200
|
+
yield* Console_exports.log(
|
|
83201
|
+
`Cherry-picking ${targetCommit.sha} onto current branch...
|
|
83202
|
+
`
|
|
83203
|
+
);
|
|
83204
|
+
const cherryPickCommand = Command_exports.make(
|
|
83205
|
+
"git",
|
|
83206
|
+
"cherry-pick",
|
|
83207
|
+
targetCommit.sha
|
|
83208
|
+
).pipe(
|
|
83209
|
+
Command_exports.workingDirectory(cwd),
|
|
83210
|
+
Command_exports.stdout("inherit"),
|
|
83211
|
+
Command_exports.stderr("inherit"),
|
|
83212
|
+
Command_exports.stdin("inherit")
|
|
83213
|
+
);
|
|
83214
|
+
const exitCode3 = yield* Command_exports.exitCode(
|
|
83215
|
+
cherryPickCommand
|
|
83216
|
+
).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
|
|
83217
|
+
if (exitCode3 !== 0) {
|
|
83218
|
+
process.exitCode = 1;
|
|
83219
|
+
return;
|
|
83220
|
+
}
|
|
83221
|
+
yield* Console_exports.log(
|
|
83222
|
+
`
|
|
83223
|
+
\u2713 Successfully cherry-picked lesson ${lessonId}`
|
|
83224
|
+
);
|
|
83225
|
+
}).pipe(
|
|
83226
|
+
Effect_exports.catchTags({
|
|
83227
|
+
NotAGitRepoError: (error4) => {
|
|
83228
|
+
return Effect_exports.gen(function* () {
|
|
83229
|
+
yield* Console_exports.error(`Error: ${error4.message}`);
|
|
83230
|
+
process.exitCode = 1;
|
|
83231
|
+
});
|
|
83232
|
+
},
|
|
83233
|
+
CommitNotFoundError: (error4) => {
|
|
83234
|
+
return Effect_exports.gen(function* () {
|
|
83235
|
+
yield* Console_exports.error(
|
|
83236
|
+
`Error: No commit found for lesson ${error4.lessonId} on branch ${error4.branch}`
|
|
83237
|
+
);
|
|
83238
|
+
process.exitCode = 1;
|
|
83239
|
+
});
|
|
83240
|
+
}
|
|
83241
|
+
}),
|
|
83242
|
+
Effect_exports.catchAll((error4) => {
|
|
83243
|
+
return Effect_exports.gen(function* () {
|
|
83244
|
+
yield* Console_exports.error(`Unexpected error: ${error4}`);
|
|
83245
|
+
process.exitCode = 1;
|
|
83246
|
+
});
|
|
83247
|
+
})
|
|
83248
|
+
)
|
|
83249
|
+
).pipe(
|
|
83250
|
+
Command_exports2.withDescription(
|
|
83251
|
+
"Cherry-pick a specific lesson commit onto current branch"
|
|
83252
|
+
)
|
|
83253
|
+
);
|
|
83128
83254
|
|
|
83129
83255
|
// src/exercise.ts
|
|
83130
83256
|
var import_prompts = __toESM(require_prompts3());
|
|
@@ -83178,7 +83304,7 @@ var Lesson = class {
|
|
|
83178
83304
|
);
|
|
83179
83305
|
}
|
|
83180
83306
|
absolutePath() {
|
|
83181
|
-
return
|
|
83307
|
+
return path5__namespace.resolve(this.root, this.sectionPath, this.path);
|
|
83182
83308
|
}
|
|
83183
83309
|
allFiles() {
|
|
83184
83310
|
const absolutePath = this.absolutePath();
|
|
@@ -83187,7 +83313,7 @@ var Lesson = class {
|
|
|
83187
83313
|
const files = yield* fs.readDirectory(absolutePath, {
|
|
83188
83314
|
recursive: true
|
|
83189
83315
|
});
|
|
83190
|
-
return files.map((file6) =>
|
|
83316
|
+
return files.map((file6) => path5__namespace.join(absolutePath, file6));
|
|
83191
83317
|
});
|
|
83192
83318
|
}
|
|
83193
83319
|
subfolders() {
|
|
@@ -83196,14 +83322,14 @@ var Lesson = class {
|
|
|
83196
83322
|
return Effect_exports.gen(function* () {
|
|
83197
83323
|
const fs = yield* FileSystem_exports.FileSystem;
|
|
83198
83324
|
const allFiles = yield* allFilesEffect;
|
|
83199
|
-
const candidates = allFiles.map((folder) =>
|
|
83200
|
-
return folder.split(
|
|
83325
|
+
const candidates = allFiles.map((folder) => path5__namespace.relative(absolutePath, folder)).filter((folder) => {
|
|
83326
|
+
return folder.split(path5__namespace.sep).length === 1;
|
|
83201
83327
|
});
|
|
83202
83328
|
const folders = yield* Effect_exports.all(
|
|
83203
83329
|
candidates.map((candidateFolder) => {
|
|
83204
83330
|
return Effect_exports.gen(function* () {
|
|
83205
83331
|
const stat3 = yield* fs.stat(
|
|
83206
|
-
|
|
83332
|
+
path5__namespace.join(absolutePath, candidateFolder)
|
|
83207
83333
|
);
|
|
83208
83334
|
return {
|
|
83209
83335
|
folder: candidateFolder,
|
|
@@ -83223,13 +83349,13 @@ var Lesson = class {
|
|
|
83223
83349
|
});
|
|
83224
83350
|
}
|
|
83225
83351
|
};
|
|
83226
|
-
var getNameAndNumberFromPath = (
|
|
83227
|
-
const numSection =
|
|
83352
|
+
var getNameAndNumberFromPath = (path14) => {
|
|
83353
|
+
const numSection = path14.split("-")[0];
|
|
83228
83354
|
if (typeof numSection === "undefined") {
|
|
83229
83355
|
return Effect_exports.fail(
|
|
83230
83356
|
new InvalidPathError({
|
|
83231
|
-
path:
|
|
83232
|
-
message: `Could not retrieve number from path: ${
|
|
83357
|
+
path: path14,
|
|
83358
|
+
message: `Could not retrieve number from path: ${path14}`
|
|
83233
83359
|
})
|
|
83234
83360
|
);
|
|
83235
83361
|
}
|
|
@@ -83237,18 +83363,18 @@ var getNameAndNumberFromPath = (path11) => {
|
|
|
83237
83363
|
if (Number.isNaN(num)) {
|
|
83238
83364
|
return Effect_exports.fail(
|
|
83239
83365
|
new PathNumberIsNaNError({
|
|
83240
|
-
path:
|
|
83366
|
+
path: path14,
|
|
83241
83367
|
numSection,
|
|
83242
|
-
message: `Could not retrieve number from path: ${
|
|
83368
|
+
message: `Could not retrieve number from path: ${path14}`
|
|
83243
83369
|
})
|
|
83244
83370
|
);
|
|
83245
83371
|
}
|
|
83246
|
-
const name =
|
|
83372
|
+
const name = path14.split("-").slice(1).join("-");
|
|
83247
83373
|
if (!name) {
|
|
83248
83374
|
return Effect_exports.fail(
|
|
83249
83375
|
new InvalidPathError({
|
|
83250
|
-
path:
|
|
83251
|
-
message: `Could not retrieve name from path: ${
|
|
83376
|
+
path: path14,
|
|
83377
|
+
message: `Could not retrieve name from path: ${path14}`
|
|
83252
83378
|
})
|
|
83253
83379
|
);
|
|
83254
83380
|
}
|
|
@@ -83257,12 +83383,12 @@ var getNameAndNumberFromPath = (path11) => {
|
|
|
83257
83383
|
num
|
|
83258
83384
|
});
|
|
83259
83385
|
};
|
|
83260
|
-
var parseSection = Effect_exports.fn("parseSection")(function* (
|
|
83261
|
-
const { name, num } = yield* getNameAndNumberFromPath(
|
|
83386
|
+
var parseSection = Effect_exports.fn("parseSection")(function* (path14) {
|
|
83387
|
+
const { name, num } = yield* getNameAndNumberFromPath(path14);
|
|
83262
83388
|
return {
|
|
83263
83389
|
name,
|
|
83264
83390
|
num,
|
|
83265
|
-
path:
|
|
83391
|
+
path: path14
|
|
83266
83392
|
};
|
|
83267
83393
|
});
|
|
83268
83394
|
var filterMeOut = Symbol("filterMeOut");
|
|
@@ -83283,7 +83409,7 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
83283
83409
|
lessonPath: opts.lessonPath,
|
|
83284
83410
|
sectionNum,
|
|
83285
83411
|
sectionName,
|
|
83286
|
-
root:
|
|
83412
|
+
root: path5__namespace.resolve(opts.root),
|
|
83287
83413
|
sectionPath: opts.sectionPath
|
|
83288
83414
|
});
|
|
83289
83415
|
}
|
|
@@ -83294,7 +83420,7 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
83294
83420
|
const sections = yield* Effect_exports.all(
|
|
83295
83421
|
rawSections.map((section) => {
|
|
83296
83422
|
return Effect_exports.gen(function* () {
|
|
83297
|
-
const sectionPath =
|
|
83423
|
+
const sectionPath = path5__namespace.join(root, section);
|
|
83298
83424
|
const stat3 = yield* fs.stat(sectionPath);
|
|
83299
83425
|
if (stat3.type !== "Directory") {
|
|
83300
83426
|
return filterMeOut;
|
|
@@ -83313,10 +83439,10 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
83313
83439
|
yield* Effect_exports.forEach(sections, (section) => {
|
|
83314
83440
|
return Effect_exports.gen(function* () {
|
|
83315
83441
|
const rawLessons = yield* fs.readDirectory(
|
|
83316
|
-
|
|
83442
|
+
path5__namespace.join(root, section.path)
|
|
83317
83443
|
);
|
|
83318
83444
|
for (const lesson of rawLessons) {
|
|
83319
|
-
const lessonPath =
|
|
83445
|
+
const lessonPath = path5__namespace.join(
|
|
83320
83446
|
root,
|
|
83321
83447
|
section.path,
|
|
83322
83448
|
lesson
|
|
@@ -83347,7 +83473,7 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
83347
83473
|
};
|
|
83348
83474
|
var rootOption = Options_exports.text("root").pipe(
|
|
83349
83475
|
Options_exports.withDescription("The directory to look for lessons"),
|
|
83350
|
-
Options_exports.withDefault(
|
|
83476
|
+
Options_exports.withDefault(path5__namespace.join(process.cwd(), "exercises"))
|
|
83351
83477
|
);
|
|
83352
83478
|
var cwdOption = Options_exports.text("cwd").pipe(
|
|
83353
83479
|
Options_exports.withDescription(
|
|
@@ -83359,7 +83485,7 @@ var envFilePathOption = Options_exports.text("env-file").pipe(
|
|
|
83359
83485
|
Options_exports.withDescription(
|
|
83360
83486
|
"The path to the environment file to use"
|
|
83361
83487
|
),
|
|
83362
|
-
Options_exports.withDefault(
|
|
83488
|
+
Options_exports.withDefault(path5__namespace.join(process.cwd(), ".env"))
|
|
83363
83489
|
);
|
|
83364
83490
|
|
|
83365
83491
|
// src/exercise.ts
|
|
@@ -83367,9 +83493,9 @@ var PromptCancelledError = class extends Data_exports.TaggedError(
|
|
|
83367
83493
|
"PromptCancelledError"
|
|
83368
83494
|
) {
|
|
83369
83495
|
};
|
|
83370
|
-
var runPrompt = (
|
|
83496
|
+
var runPrompt = (prompt6) => {
|
|
83371
83497
|
return Effect_exports.gen(function* () {
|
|
83372
|
-
const result = yield* Effect_exports.promise(() =>
|
|
83498
|
+
const result = yield* Effect_exports.promise(() => prompt6());
|
|
83373
83499
|
if (!result) {
|
|
83374
83500
|
return yield* new PromptCancelledError();
|
|
83375
83501
|
}
|
|
@@ -83658,7 +83784,7 @@ var exercise = Command_exports2.make(
|
|
|
83658
83784
|
"Simple mode is now the default mode! No need to use the --simple flag."
|
|
83659
83785
|
);
|
|
83660
83786
|
}
|
|
83661
|
-
const resolvedEnvFilePath =
|
|
83787
|
+
const resolvedEnvFilePath = path5__namespace.relative(
|
|
83662
83788
|
cwd,
|
|
83663
83789
|
envFilePath
|
|
83664
83790
|
);
|
|
@@ -83720,7 +83846,7 @@ var getMainAndReadmeFiles = Effect_exports.fn("getMainAndReadmeFiles")(
|
|
|
83720
83846
|
const mainFile = yield* opts.lesson.allFiles().pipe(
|
|
83721
83847
|
Effect_exports.map(
|
|
83722
83848
|
(files) => files.find(
|
|
83723
|
-
(file6) => file6.includes(
|
|
83849
|
+
(file6) => file6.includes(path5__namespace.join(opts.subfolder, "main.ts"))
|
|
83724
83850
|
)
|
|
83725
83851
|
)
|
|
83726
83852
|
);
|
|
@@ -83733,7 +83859,7 @@ var getMainAndReadmeFiles = Effect_exports.fn("getMainAndReadmeFiles")(
|
|
|
83733
83859
|
const readmeFile = yield* opts.lesson.allFiles().pipe(
|
|
83734
83860
|
Effect_exports.map(
|
|
83735
83861
|
(files) => files.find(
|
|
83736
|
-
(file6) => file6.includes(
|
|
83862
|
+
(file6) => file6.includes(path5__namespace.join(opts.subfolder, "readme.md"))
|
|
83737
83863
|
)
|
|
83738
83864
|
)
|
|
83739
83865
|
);
|
|
@@ -83745,8 +83871,8 @@ var RunLessonSimpleError = class extends Data_exports.TaggedError(
|
|
|
83745
83871
|
) {
|
|
83746
83872
|
};
|
|
83747
83873
|
var notFound2 = Symbol("notFound");
|
|
83748
|
-
var getNumberFromPathSegment = (
|
|
83749
|
-
const numberSegment =
|
|
83874
|
+
var getNumberFromPathSegment = (path14) => {
|
|
83875
|
+
const numberSegment = path14.split("-")[0];
|
|
83750
83876
|
return Number.isNaN(Number(numberSegment)) ? notFound2 : Number(numberSegment);
|
|
83751
83877
|
};
|
|
83752
83878
|
var startsWithNumber = (segment) => {
|
|
@@ -83756,7 +83882,7 @@ var startsWithNumber = (segment) => {
|
|
|
83756
83882
|
}
|
|
83757
83883
|
return !Number.isNaN(Number(numberSegment));
|
|
83758
83884
|
};
|
|
83759
|
-
var splitFilePath = (filePath) => filePath.split(
|
|
83885
|
+
var splitFilePath = (filePath) => filePath.split(path5__namespace.sep);
|
|
83760
83886
|
var getSectionAndLessonNumberFromPath = (filePath) => {
|
|
83761
83887
|
const segments = splitFilePath(filePath);
|
|
83762
83888
|
const lastSegmentWithNumber = segments.findLastIndex(startsWithNumber);
|
|
@@ -83789,7 +83915,7 @@ var mapToLessonPath = (filePath) => {
|
|
|
83789
83915
|
if (sectionAndLessonNumber === notFound2) {
|
|
83790
83916
|
return notFound2;
|
|
83791
83917
|
}
|
|
83792
|
-
return `${sectionAndLessonNumber.sectionPathWithNumber}${
|
|
83918
|
+
return `${sectionAndLessonNumber.sectionPathWithNumber}${path5__namespace.sep}${sectionAndLessonNumber.lessonPathWithNumber}`;
|
|
83793
83919
|
};
|
|
83794
83920
|
var getChangedFiles = (rawDiffOutput) => {
|
|
83795
83921
|
const splitDiffOutput = rawDiffOutput.trim().split("\n").filter(Boolean);
|
|
@@ -83831,7 +83957,7 @@ var updateCVM = Command_exports2.make(
|
|
|
83831
83957
|
Options_exports.withDescription(
|
|
83832
83958
|
"The root directory of the exercises"
|
|
83833
83959
|
),
|
|
83834
|
-
Options_exports.withDefault(
|
|
83960
|
+
Options_exports.withDefault(path5__namespace.join(process.cwd(), "exercises"))
|
|
83835
83961
|
)
|
|
83836
83962
|
},
|
|
83837
83963
|
({ root }) => Effect_exports.gen(function* () {
|
|
@@ -83855,7 +83981,7 @@ var updateCVM = Command_exports2.make(
|
|
|
83855
83981
|
}
|
|
83856
83982
|
const filteredDeletedLessons = changedFiles.deleted.filter(
|
|
83857
83983
|
(lesson) => {
|
|
83858
|
-
const lessonPath =
|
|
83984
|
+
const lessonPath = path5__namespace.join(root, lesson);
|
|
83859
83985
|
return !NFS.existsSync(lessonPath);
|
|
83860
83986
|
}
|
|
83861
83987
|
);
|
|
@@ -83974,7 +84100,7 @@ var lint = Command_exports2.make(
|
|
|
83974
84100
|
);
|
|
83975
84101
|
continue;
|
|
83976
84102
|
}
|
|
83977
|
-
const readmePath =
|
|
84103
|
+
const readmePath = path5__namespace.join(
|
|
83978
84104
|
lesson.absolutePath(),
|
|
83979
84105
|
folderForReadme,
|
|
83980
84106
|
"readme.md"
|
|
@@ -84010,7 +84136,7 @@ var lint = Command_exports2.make(
|
|
|
84010
84136
|
const url2 = splitResult[1]?.slice(1, -1);
|
|
84011
84137
|
if (!url2) continue;
|
|
84012
84138
|
const linkExists = yield* existsCache.get(
|
|
84013
|
-
|
|
84139
|
+
path5__namespace.join(cwd, url2)
|
|
84014
84140
|
);
|
|
84015
84141
|
if (!linkExists) {
|
|
84016
84142
|
errorTracker.addError(
|
|
@@ -84025,7 +84151,7 @@ var lint = Command_exports2.make(
|
|
|
84025
84151
|
const url2 = splitResult[1]?.slice(0, -1);
|
|
84026
84152
|
if (!url2) continue;
|
|
84027
84153
|
const linkExists = yield* existsCache.get(
|
|
84028
|
-
|
|
84154
|
+
path5__namespace.resolve(
|
|
84029
84155
|
lesson.absolutePath(),
|
|
84030
84156
|
folderForReadme,
|
|
84031
84157
|
url2
|
|
@@ -84040,7 +84166,7 @@ var lint = Command_exports2.make(
|
|
|
84040
84166
|
}
|
|
84041
84167
|
}
|
|
84042
84168
|
for (const subfolder of subfolders) {
|
|
84043
|
-
const mainFilePath =
|
|
84169
|
+
const mainFilePath = path5__namespace.join(
|
|
84044
84170
|
lesson.absolutePath(),
|
|
84045
84171
|
subfolder,
|
|
84046
84172
|
"main.ts"
|
|
@@ -84136,7 +84262,7 @@ var rename4 = Command_exports2.make(
|
|
|
84136
84262
|
let totalLessonsRenamed = 0;
|
|
84137
84263
|
for (const section of sectionsAsArray) {
|
|
84138
84264
|
const lessonsInSection = lessons.filter((lesson) => lesson.sectionPath === section).sort((a, b) => a.num - b.num);
|
|
84139
|
-
const fullSectionPath =
|
|
84265
|
+
const fullSectionPath = path5__namespace.resolve(root, section);
|
|
84140
84266
|
yield* Effect_exports.forEach(
|
|
84141
84267
|
lessonsInSection,
|
|
84142
84268
|
(lesson, index) => {
|
|
@@ -84144,7 +84270,7 @@ var rename4 = Command_exports2.make(
|
|
|
84144
84270
|
const newLessonNum = (index + 1).toString().padStart(2, "0");
|
|
84145
84271
|
const sectionNum = lesson.sectionNum.toString().padStart(2, "0");
|
|
84146
84272
|
const newLessonDirname = `${sectionNum}.${newLessonNum}-${lesson.name}`;
|
|
84147
|
-
const newLessonPath =
|
|
84273
|
+
const newLessonPath = path5__namespace.join(
|
|
84148
84274
|
fullSectionPath,
|
|
84149
84275
|
newLessonDirname
|
|
84150
84276
|
);
|
|
@@ -84278,7 +84404,7 @@ var uploadToCloudinary = Command_exports2.make(
|
|
|
84278
84404
|
});
|
|
84279
84405
|
}
|
|
84280
84406
|
let updatedContent = fileContent5;
|
|
84281
|
-
const markdownDir =
|
|
84407
|
+
const markdownDir = path5__namespace.dirname(readmeFile);
|
|
84282
84408
|
for (const [
|
|
84283
84409
|
fullMatch,
|
|
84284
84410
|
altText,
|
|
@@ -84286,7 +84412,7 @@ var uploadToCloudinary = Command_exports2.make(
|
|
|
84286
84412
|
] of imageMatches) {
|
|
84287
84413
|
let resolvedImagePath;
|
|
84288
84414
|
if (imagePath.startsWith("/")) {
|
|
84289
|
-
resolvedImagePath =
|
|
84415
|
+
resolvedImagePath = path5__namespace.resolve(
|
|
84290
84416
|
cwd,
|
|
84291
84417
|
// Remove the leading slash
|
|
84292
84418
|
imagePath.slice(1)
|
|
@@ -84294,7 +84420,7 @@ var uploadToCloudinary = Command_exports2.make(
|
|
|
84294
84420
|
} else if (imagePath.startsWith("http")) {
|
|
84295
84421
|
continue;
|
|
84296
84422
|
} else {
|
|
84297
|
-
resolvedImagePath =
|
|
84423
|
+
resolvedImagePath = path5__namespace.resolve(
|
|
84298
84424
|
markdownDir,
|
|
84299
84425
|
imagePath
|
|
84300
84426
|
);
|
|
@@ -84357,6 +84483,336 @@ var parseCloudinaryUrl = (url2) => {
|
|
|
84357
84483
|
cloudName: match17[3]
|
|
84358
84484
|
});
|
|
84359
84485
|
};
|
|
84486
|
+
var InvalidProjectRepoError = class extends Data_exports.TaggedError(
|
|
84487
|
+
"InvalidProjectRepoError"
|
|
84488
|
+
) {
|
|
84489
|
+
};
|
|
84490
|
+
var MissingExerciseFolderError = class extends Data_exports.TaggedError(
|
|
84491
|
+
"MissingExerciseFolderError"
|
|
84492
|
+
) {
|
|
84493
|
+
};
|
|
84494
|
+
(class extends Data_exports.TaggedError(
|
|
84495
|
+
"DiffGenerationError"
|
|
84496
|
+
) {
|
|
84497
|
+
});
|
|
84498
|
+
var DirtyWorkingTreeError = class extends Data_exports.TaggedError(
|
|
84499
|
+
"DirtyWorkingTreeError"
|
|
84500
|
+
) {
|
|
84501
|
+
};
|
|
84502
|
+
var NoExerciseFoundError = class extends Data_exports.TaggedError(
|
|
84503
|
+
"NoExerciseFoundError"
|
|
84504
|
+
) {
|
|
84505
|
+
};
|
|
84506
|
+
var getDiffs = Command_exports2.make(
|
|
84507
|
+
"get-diffs",
|
|
84508
|
+
{
|
|
84509
|
+
projectRepo: Options_exports.text("project-repo").pipe(
|
|
84510
|
+
Options_exports.withDescription(
|
|
84511
|
+
"The path to the project repository"
|
|
84512
|
+
)
|
|
84513
|
+
),
|
|
84514
|
+
branch: Options_exports.text("branch").pipe(
|
|
84515
|
+
Options_exports.withDescription(
|
|
84516
|
+
"Branch to checkout before getting diffs"
|
|
84517
|
+
)
|
|
84518
|
+
),
|
|
84519
|
+
root: Options_exports.text("root").pipe(
|
|
84520
|
+
Options_exports.withDescription(
|
|
84521
|
+
"The root directory of the exercises"
|
|
84522
|
+
),
|
|
84523
|
+
Options_exports.withDefault(path5__namespace.join(process.cwd(), "exercises"))
|
|
84524
|
+
)
|
|
84525
|
+
},
|
|
84526
|
+
({ branch, projectRepo, root }) => Effect_exports.gen(function* () {
|
|
84527
|
+
yield* Console_exports.log("Starting get-diffs command...");
|
|
84528
|
+
if (!NFS.existsSync(projectRepo)) {
|
|
84529
|
+
return yield* Effect_exports.fail(
|
|
84530
|
+
new InvalidProjectRepoError({
|
|
84531
|
+
path: projectRepo,
|
|
84532
|
+
message: `Project repo does not exist at path: ${projectRepo}`
|
|
84533
|
+
})
|
|
84534
|
+
);
|
|
84535
|
+
}
|
|
84536
|
+
const gitDirPath = path5__namespace.join(projectRepo, ".git");
|
|
84537
|
+
if (!NFS.existsSync(gitDirPath)) {
|
|
84538
|
+
return yield* Effect_exports.fail(
|
|
84539
|
+
new InvalidProjectRepoError({
|
|
84540
|
+
path: projectRepo,
|
|
84541
|
+
message: `Project repo is not a git repository: ${projectRepo}`
|
|
84542
|
+
})
|
|
84543
|
+
);
|
|
84544
|
+
}
|
|
84545
|
+
const gitStatusCommand = Command_exports.make(
|
|
84546
|
+
"git",
|
|
84547
|
+
"status",
|
|
84548
|
+
"--porcelain"
|
|
84549
|
+
).pipe(Command_exports.workingDirectory(projectRepo));
|
|
84550
|
+
const statusOutput = yield* Command_exports.string(
|
|
84551
|
+
gitStatusCommand
|
|
84552
|
+
);
|
|
84553
|
+
if (statusOutput.trim() !== "") {
|
|
84554
|
+
return yield* Effect_exports.fail(
|
|
84555
|
+
new DirtyWorkingTreeError({
|
|
84556
|
+
path: projectRepo,
|
|
84557
|
+
message: `Working tree has uncommitted changes. Commit or stash changes before running get-diffs`
|
|
84558
|
+
})
|
|
84559
|
+
);
|
|
84560
|
+
}
|
|
84561
|
+
const gitCheckoutCommand = Command_exports.make(
|
|
84562
|
+
"git",
|
|
84563
|
+
"checkout",
|
|
84564
|
+
branch
|
|
84565
|
+
).pipe(Command_exports.workingDirectory(projectRepo));
|
|
84566
|
+
const checkoutExitCode = yield* Command_exports.exitCode(
|
|
84567
|
+
gitCheckoutCommand
|
|
84568
|
+
).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
|
|
84569
|
+
if (checkoutExitCode !== 0) {
|
|
84570
|
+
return yield* Effect_exports.fail(
|
|
84571
|
+
new InvalidProjectRepoError({
|
|
84572
|
+
path: projectRepo,
|
|
84573
|
+
message: `Failed to checkout branch: ${branch}`
|
|
84574
|
+
})
|
|
84575
|
+
);
|
|
84576
|
+
}
|
|
84577
|
+
yield* Console_exports.log(`\u2713 Checked out branch: ${branch}`);
|
|
84578
|
+
yield* Console_exports.log(
|
|
84579
|
+
`\u2713 Validated project repo: ${projectRepo}`
|
|
84580
|
+
);
|
|
84581
|
+
yield* Console_exports.log(`\u2713 Exercises root: ${root}`);
|
|
84582
|
+
yield* Console_exports.log("\nRetrieving commit history...");
|
|
84583
|
+
const gitLogCommand = Command_exports.make(
|
|
84584
|
+
"git",
|
|
84585
|
+
"log",
|
|
84586
|
+
"--oneline",
|
|
84587
|
+
"--reverse",
|
|
84588
|
+
// Chronological order (oldest first)
|
|
84589
|
+
"--all"
|
|
84590
|
+
).pipe(Command_exports.workingDirectory(projectRepo));
|
|
84591
|
+
const commitHistory = yield* Command_exports.string(gitLogCommand);
|
|
84592
|
+
const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
|
|
84593
|
+
const [sha, ...messageParts] = line4.split(" ");
|
|
84594
|
+
const message = messageParts.join(" ");
|
|
84595
|
+
const exerciseMatch = message.match(/^(\d+)[.-](\d+)/);
|
|
84596
|
+
const exerciseId = exerciseMatch ? `${exerciseMatch[1].padStart(
|
|
84597
|
+
2,
|
|
84598
|
+
"0"
|
|
84599
|
+
)}.${exerciseMatch[2].padStart(2, "0")}` : null;
|
|
84600
|
+
return {
|
|
84601
|
+
sha,
|
|
84602
|
+
message,
|
|
84603
|
+
exerciseId
|
|
84604
|
+
};
|
|
84605
|
+
});
|
|
84606
|
+
yield* Console_exports.dir(commits, { depth: Infinity });
|
|
84607
|
+
const commitsWithExercise = commits.filter(
|
|
84608
|
+
(commit) => commit.exerciseId !== null
|
|
84609
|
+
);
|
|
84610
|
+
yield* Console_exports.log(
|
|
84611
|
+
`\u2713 Found ${commits.length} total commits`
|
|
84612
|
+
);
|
|
84613
|
+
yield* Console_exports.log(
|
|
84614
|
+
`\u2713 Found ${commitsWithExercise.length} commits matching exercise format`
|
|
84615
|
+
);
|
|
84616
|
+
yield* Console_exports.log("\nMatching commits to exercises...");
|
|
84617
|
+
const lessonParser = yield* LessonParserService;
|
|
84618
|
+
const lessons = yield* lessonParser.getLessonsFromRepo(
|
|
84619
|
+
root
|
|
84620
|
+
);
|
|
84621
|
+
const exerciseMap = /* @__PURE__ */ new Map();
|
|
84622
|
+
for (const lesson of lessons) {
|
|
84623
|
+
const id2 = lesson.path.split("-")[0];
|
|
84624
|
+
exerciseMap.set(id2, lesson);
|
|
84625
|
+
}
|
|
84626
|
+
const exerciseCommitsMap = /* @__PURE__ */ new Map();
|
|
84627
|
+
for (const commit of commitsWithExercise) {
|
|
84628
|
+
const exerciseId = commit.exerciseId;
|
|
84629
|
+
const lesson = exerciseMap.get(exerciseId);
|
|
84630
|
+
if (!lesson) {
|
|
84631
|
+
return yield* Effect_exports.fail(
|
|
84632
|
+
new NoExerciseFoundError({
|
|
84633
|
+
exerciseId,
|
|
84634
|
+
commitSha: commit.sha
|
|
84635
|
+
})
|
|
84636
|
+
);
|
|
84637
|
+
}
|
|
84638
|
+
if (!exerciseCommitsMap.has(exerciseId)) {
|
|
84639
|
+
exerciseCommitsMap.set(exerciseId, {
|
|
84640
|
+
lesson,
|
|
84641
|
+
commits: []
|
|
84642
|
+
});
|
|
84643
|
+
}
|
|
84644
|
+
exerciseCommitsMap.get(exerciseId).commits.push(commit);
|
|
84645
|
+
}
|
|
84646
|
+
yield* Console_exports.log(
|
|
84647
|
+
`\u2713 Matched commits to ${exerciseCommitsMap.size} exercises`
|
|
84648
|
+
);
|
|
84649
|
+
yield* Console_exports.log("\nGenerating and saving diffs...");
|
|
84650
|
+
const fs = yield* FileSystem_exports.FileSystem;
|
|
84651
|
+
let processedCount = 0;
|
|
84652
|
+
let savedCount = 0;
|
|
84653
|
+
let skippedCount = 0;
|
|
84654
|
+
let errorCount = 0;
|
|
84655
|
+
const errors = [];
|
|
84656
|
+
const toDashCase = (str) => {
|
|
84657
|
+
return str.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
84658
|
+
};
|
|
84659
|
+
for (const [
|
|
84660
|
+
exerciseId,
|
|
84661
|
+
{ commits: commits2, lesson }
|
|
84662
|
+
] of exerciseCommitsMap) {
|
|
84663
|
+
yield* Console_exports.log(
|
|
84664
|
+
` Processing ${commits2.length} commits for ${exerciseId}...`
|
|
84665
|
+
);
|
|
84666
|
+
for (const commit of commits2) {
|
|
84667
|
+
processedCount++;
|
|
84668
|
+
const result = yield* Effect_exports.gen(function* () {
|
|
84669
|
+
const gitShowCommand = Command_exports.make(
|
|
84670
|
+
"git",
|
|
84671
|
+
"show",
|
|
84672
|
+
"-W",
|
|
84673
|
+
commit.sha,
|
|
84674
|
+
"--",
|
|
84675
|
+
".",
|
|
84676
|
+
":!pnpm-lock.yaml",
|
|
84677
|
+
":!package-lock.json",
|
|
84678
|
+
":!yarn.lock",
|
|
84679
|
+
":!*.lock"
|
|
84680
|
+
).pipe(Command_exports.workingDirectory(projectRepo));
|
|
84681
|
+
const diff8 = yield* Command_exports.string(gitShowCommand);
|
|
84682
|
+
const messageMatch = commit.message.match(
|
|
84683
|
+
/^\d+[.-]\d+[.-](\d+)\s+(.+)$/
|
|
84684
|
+
);
|
|
84685
|
+
if (!messageMatch) {
|
|
84686
|
+
yield* Console_exports.log(
|
|
84687
|
+
` \u2298 Skipped: Could not parse commit message: ${commit.message}`
|
|
84688
|
+
);
|
|
84689
|
+
return { status: "skipped" };
|
|
84690
|
+
}
|
|
84691
|
+
const [, sequenceStr, description] = messageMatch;
|
|
84692
|
+
const sequence2 = sequenceStr.padStart(2, "0");
|
|
84693
|
+
const isSolution = /^(solution|fix|complete|final)/i.test(
|
|
84694
|
+
description
|
|
84695
|
+
);
|
|
84696
|
+
const targetSubFolder = isSolution ? "solution" : "explainer";
|
|
84697
|
+
const targetDir = path5__namespace.join(
|
|
84698
|
+
lesson.absolutePath(),
|
|
84699
|
+
targetSubFolder,
|
|
84700
|
+
"diffs"
|
|
84701
|
+
);
|
|
84702
|
+
const exerciseFolderPath = path5__namespace.join(
|
|
84703
|
+
lesson.absolutePath(),
|
|
84704
|
+
targetSubFolder
|
|
84705
|
+
);
|
|
84706
|
+
const folderExists = yield* fs.exists(
|
|
84707
|
+
exerciseFolderPath
|
|
84708
|
+
);
|
|
84709
|
+
if (!folderExists) {
|
|
84710
|
+
return yield* Effect_exports.fail(
|
|
84711
|
+
new MissingExerciseFolderError({
|
|
84712
|
+
exerciseId,
|
|
84713
|
+
folderType: targetSubFolder,
|
|
84714
|
+
path: exerciseFolderPath
|
|
84715
|
+
})
|
|
84716
|
+
);
|
|
84717
|
+
}
|
|
84718
|
+
const filename = `${sequence2}-${toDashCase(
|
|
84719
|
+
description
|
|
84720
|
+
)}.diff`;
|
|
84721
|
+
yield* fs.makeDirectory(targetDir, {
|
|
84722
|
+
recursive: true
|
|
84723
|
+
});
|
|
84724
|
+
const targetPath = path5__namespace.join(targetDir, filename);
|
|
84725
|
+
yield* fs.writeFileString(targetPath, diff8);
|
|
84726
|
+
yield* Console_exports.log(
|
|
84727
|
+
` \u2713 Saved: ${targetSubFolder}/diffs/${filename}`
|
|
84728
|
+
);
|
|
84729
|
+
return { status: "saved" };
|
|
84730
|
+
}).pipe(
|
|
84731
|
+
Effect_exports.catchTags({
|
|
84732
|
+
MissingExerciseFolderError: (error4) => Effect_exports.gen(function* () {
|
|
84733
|
+
yield* Console_exports.log(
|
|
84734
|
+
` \u2717 Error: Missing ${error4.folderType} folder at ${error4.path}`
|
|
84735
|
+
);
|
|
84736
|
+
errors.push(
|
|
84737
|
+
`${exerciseId}: Missing ${error4.folderType} folder`
|
|
84738
|
+
);
|
|
84739
|
+
return { status: "error" };
|
|
84740
|
+
})
|
|
84741
|
+
}),
|
|
84742
|
+
Effect_exports.catchAll(
|
|
84743
|
+
(error4) => Effect_exports.gen(function* () {
|
|
84744
|
+
yield* Console_exports.log(
|
|
84745
|
+
` \u2717 Error processing commit ${commit.sha}: ${error4}`
|
|
84746
|
+
);
|
|
84747
|
+
errors.push(
|
|
84748
|
+
`${exerciseId} (${commit.sha}): ${error4}`
|
|
84749
|
+
);
|
|
84750
|
+
return { status: "error" };
|
|
84751
|
+
})
|
|
84752
|
+
)
|
|
84753
|
+
);
|
|
84754
|
+
if (result.status === "saved") {
|
|
84755
|
+
savedCount++;
|
|
84756
|
+
} else if (result.status === "skipped") {
|
|
84757
|
+
skippedCount++;
|
|
84758
|
+
} else if (result.status === "error") {
|
|
84759
|
+
errorCount++;
|
|
84760
|
+
}
|
|
84761
|
+
}
|
|
84762
|
+
}
|
|
84763
|
+
yield* Console_exports.log("\n" + "=".repeat(50));
|
|
84764
|
+
yield* Console_exports.log("Summary:");
|
|
84765
|
+
yield* Console_exports.log(
|
|
84766
|
+
` Total commits processed: ${processedCount}`
|
|
84767
|
+
);
|
|
84768
|
+
yield* Console_exports.log(` Diffs saved: ${savedCount}`);
|
|
84769
|
+
yield* Console_exports.log(` Commits skipped: ${skippedCount}`);
|
|
84770
|
+
yield* Console_exports.log(` Errors: ${errorCount}`);
|
|
84771
|
+
yield* Console_exports.log(
|
|
84772
|
+
` Exercises affected: ${exerciseCommitsMap.size}`
|
|
84773
|
+
);
|
|
84774
|
+
if (errors.length > 0) {
|
|
84775
|
+
yield* Console_exports.log("\nErrors encountered:");
|
|
84776
|
+
for (const error4 of errors) {
|
|
84777
|
+
yield* Console_exports.log(` - ${error4}`);
|
|
84778
|
+
}
|
|
84779
|
+
}
|
|
84780
|
+
yield* Console_exports.log("=".repeat(50));
|
|
84781
|
+
}).pipe(
|
|
84782
|
+
Effect_exports.catchTags({
|
|
84783
|
+
InvalidProjectRepoError: (error4) => {
|
|
84784
|
+
return Effect_exports.gen(function* () {
|
|
84785
|
+
yield* Console_exports.error(`Error: ${error4.message}`);
|
|
84786
|
+
process.exitCode = 1;
|
|
84787
|
+
});
|
|
84788
|
+
},
|
|
84789
|
+
DirtyWorkingTreeError: (error4) => {
|
|
84790
|
+
return Effect_exports.gen(function* () {
|
|
84791
|
+
yield* Console_exports.error(`Error: ${error4.message}`);
|
|
84792
|
+
process.exitCode = 1;
|
|
84793
|
+
});
|
|
84794
|
+
},
|
|
84795
|
+
NoExerciseFoundError: (error4) => {
|
|
84796
|
+
return Effect_exports.gen(function* () {
|
|
84797
|
+
yield* Console_exports.error(
|
|
84798
|
+
`Error: No exercise found for ${error4.exerciseId} (commit: ${error4.commitSha})`
|
|
84799
|
+
);
|
|
84800
|
+
process.exitCode = 1;
|
|
84801
|
+
});
|
|
84802
|
+
}
|
|
84803
|
+
}),
|
|
84804
|
+
Effect_exports.catchAll((error4) => {
|
|
84805
|
+
return Effect_exports.gen(function* () {
|
|
84806
|
+
yield* Console_exports.error(`Unexpected error: ${error4}`);
|
|
84807
|
+
process.exitCode = 1;
|
|
84808
|
+
});
|
|
84809
|
+
})
|
|
84810
|
+
)
|
|
84811
|
+
).pipe(
|
|
84812
|
+
Command_exports2.withDescription(
|
|
84813
|
+
"Get commit diffs from a project repo and save to exercise folders"
|
|
84814
|
+
)
|
|
84815
|
+
);
|
|
84360
84816
|
|
|
84361
84817
|
// src/internal/internal.ts
|
|
84362
84818
|
var upgradePackages = Command_exports2.make(
|
|
@@ -84408,14 +84864,232 @@ var internal = Command_exports2.make("internal").pipe(
|
|
|
84408
84864
|
updateCVM,
|
|
84409
84865
|
lint,
|
|
84410
84866
|
rename4,
|
|
84411
|
-
uploadToCloudinary
|
|
84867
|
+
uploadToCloudinary,
|
|
84868
|
+
getDiffs
|
|
84412
84869
|
]),
|
|
84413
84870
|
Command_exports2.withDescription("Internal commands for AI Hero")
|
|
84414
84871
|
);
|
|
84415
84872
|
|
|
84873
|
+
// src/reset.ts
|
|
84874
|
+
var import_prompts2 = __toESM(require_prompts3());
|
|
84875
|
+
var NotAGitRepoError2 = class extends Data_exports.TaggedError(
|
|
84876
|
+
"NotAGitRepoError"
|
|
84877
|
+
) {
|
|
84878
|
+
};
|
|
84879
|
+
var CommitNotFoundError2 = class extends Data_exports.TaggedError(
|
|
84880
|
+
"CommitNotFoundError"
|
|
84881
|
+
) {
|
|
84882
|
+
};
|
|
84883
|
+
var PromptCancelledError2 = class extends Data_exports.TaggedError(
|
|
84884
|
+
"PromptCancelledError"
|
|
84885
|
+
) {
|
|
84886
|
+
};
|
|
84887
|
+
var runPrompt2 = (promptFn) => {
|
|
84888
|
+
return Effect_exports.gen(function* () {
|
|
84889
|
+
const result = yield* Effect_exports.promise(() => promptFn());
|
|
84890
|
+
if (!result) {
|
|
84891
|
+
return yield* new PromptCancelledError2();
|
|
84892
|
+
}
|
|
84893
|
+
return result;
|
|
84894
|
+
});
|
|
84895
|
+
};
|
|
84896
|
+
var reset2 = Command_exports2.make(
|
|
84897
|
+
"reset",
|
|
84898
|
+
{
|
|
84899
|
+
lessonId: Args_exports.text({ name: "lesson-id" }),
|
|
84900
|
+
branch: Options_exports.text("branch").pipe(
|
|
84901
|
+
Options_exports.withDescription(
|
|
84902
|
+
"Branch to search for the lesson commit"
|
|
84903
|
+
)
|
|
84904
|
+
)
|
|
84905
|
+
},
|
|
84906
|
+
({ branch, lessonId }) => Effect_exports.gen(function* () {
|
|
84907
|
+
const cwd = process.cwd();
|
|
84908
|
+
const gitDirPath = path5__namespace.join(cwd, ".git");
|
|
84909
|
+
if (!NFS.existsSync(gitDirPath)) {
|
|
84910
|
+
return yield* Effect_exports.fail(
|
|
84911
|
+
new NotAGitRepoError2({
|
|
84912
|
+
path: cwd,
|
|
84913
|
+
message: `Current directory is not a git repository: ${cwd}`
|
|
84914
|
+
})
|
|
84915
|
+
);
|
|
84916
|
+
}
|
|
84917
|
+
yield* Console_exports.log(
|
|
84918
|
+
`Searching for lesson ${lessonId} on branch ${branch}...`
|
|
84919
|
+
);
|
|
84920
|
+
const gitLogCommand = Command_exports.make(
|
|
84921
|
+
"git",
|
|
84922
|
+
"log",
|
|
84923
|
+
branch,
|
|
84924
|
+
"--oneline",
|
|
84925
|
+
"--all"
|
|
84926
|
+
).pipe(Command_exports.workingDirectory(cwd));
|
|
84927
|
+
const commitHistory = yield* Command_exports.string(gitLogCommand);
|
|
84928
|
+
const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
|
|
84929
|
+
const [sha, ...messageParts] = line4.split(" ");
|
|
84930
|
+
const message = messageParts.join(" ");
|
|
84931
|
+
const lessonMatch = message.match(
|
|
84932
|
+
/^(\d+)[.-](\d+)[.-](\d+) /
|
|
84933
|
+
);
|
|
84934
|
+
const extractedLessonId = lessonMatch ? `${lessonMatch[1].padStart(
|
|
84935
|
+
2,
|
|
84936
|
+
"0"
|
|
84937
|
+
)}.${lessonMatch[2].padStart(
|
|
84938
|
+
2,
|
|
84939
|
+
"0"
|
|
84940
|
+
)}.${lessonMatch[3].padStart(2, "0")}` : null;
|
|
84941
|
+
return {
|
|
84942
|
+
sha,
|
|
84943
|
+
message,
|
|
84944
|
+
lessonId: extractedLessonId
|
|
84945
|
+
};
|
|
84946
|
+
});
|
|
84947
|
+
const matchingCommits = commits.filter(
|
|
84948
|
+
(commit) => commit.lessonId === lessonId
|
|
84949
|
+
);
|
|
84950
|
+
if (matchingCommits.length === 0) {
|
|
84951
|
+
return yield* new CommitNotFoundError2({
|
|
84952
|
+
lessonId,
|
|
84953
|
+
branch
|
|
84954
|
+
});
|
|
84955
|
+
}
|
|
84956
|
+
const targetCommit = matchingCommits[matchingCommits.length - 1];
|
|
84957
|
+
yield* Console_exports.log(
|
|
84958
|
+
`Found commit: ${targetCommit.sha} ${targetCommit.message}`
|
|
84959
|
+
);
|
|
84960
|
+
const { action } = yield* runPrompt2(
|
|
84961
|
+
() => (0, import_prompts2.default)([
|
|
84962
|
+
{
|
|
84963
|
+
type: "select",
|
|
84964
|
+
name: "action",
|
|
84965
|
+
message: "How would you like to proceed?",
|
|
84966
|
+
choices: [
|
|
84967
|
+
{
|
|
84968
|
+
title: "Reset current branch",
|
|
84969
|
+
value: "reset-current"
|
|
84970
|
+
},
|
|
84971
|
+
{
|
|
84972
|
+
title: "Create new branch from commit",
|
|
84973
|
+
value: "create-branch"
|
|
84974
|
+
}
|
|
84975
|
+
]
|
|
84976
|
+
}
|
|
84977
|
+
])
|
|
84978
|
+
);
|
|
84979
|
+
if (action === "create-branch") {
|
|
84980
|
+
const { branchName } = yield* runPrompt2(
|
|
84981
|
+
() => (0, import_prompts2.default)([
|
|
84982
|
+
{
|
|
84983
|
+
type: "text",
|
|
84984
|
+
name: "branchName",
|
|
84985
|
+
message: "Enter new branch name:"
|
|
84986
|
+
}
|
|
84987
|
+
])
|
|
84988
|
+
);
|
|
84989
|
+
yield* Console_exports.log(
|
|
84990
|
+
`Creating branch ${branchName} from ${targetCommit.sha}...`
|
|
84991
|
+
);
|
|
84992
|
+
const createBranchCommand = Command_exports.make(
|
|
84993
|
+
"git",
|
|
84994
|
+
"checkout",
|
|
84995
|
+
"-b",
|
|
84996
|
+
branchName,
|
|
84997
|
+
targetCommit.sha
|
|
84998
|
+
).pipe(Command_exports.workingDirectory(cwd));
|
|
84999
|
+
const exitCode4 = yield* Command_exports.exitCode(
|
|
85000
|
+
createBranchCommand
|
|
85001
|
+
).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
|
|
85002
|
+
if (exitCode4 !== 0) {
|
|
85003
|
+
yield* Console_exports.error("Failed to create branch");
|
|
85004
|
+
process.exitCode = 1;
|
|
85005
|
+
return;
|
|
85006
|
+
}
|
|
85007
|
+
yield* Console_exports.log(
|
|
85008
|
+
`\u2713 Created and checked out branch: ${branchName}`
|
|
85009
|
+
);
|
|
85010
|
+
return;
|
|
85011
|
+
}
|
|
85012
|
+
const gitStatusCommand = Command_exports.make(
|
|
85013
|
+
"git",
|
|
85014
|
+
"status",
|
|
85015
|
+
"--porcelain"
|
|
85016
|
+
).pipe(Command_exports.workingDirectory(cwd));
|
|
85017
|
+
const statusOutput = yield* Command_exports.string(
|
|
85018
|
+
gitStatusCommand
|
|
85019
|
+
);
|
|
85020
|
+
if (statusOutput.trim() !== "") {
|
|
85021
|
+
yield* Console_exports.log(
|
|
85022
|
+
"\nWarning: You have uncommitted changes:"
|
|
85023
|
+
);
|
|
85024
|
+
yield* Console_exports.log(statusOutput);
|
|
85025
|
+
const { confirm } = yield* runPrompt2(
|
|
85026
|
+
() => (0, import_prompts2.default)([
|
|
85027
|
+
{
|
|
85028
|
+
type: "confirm",
|
|
85029
|
+
name: "confirm",
|
|
85030
|
+
message: "This will lose all uncommitted work. Continue?",
|
|
85031
|
+
initial: false
|
|
85032
|
+
}
|
|
85033
|
+
])
|
|
85034
|
+
);
|
|
85035
|
+
if (!confirm) {
|
|
85036
|
+
yield* Console_exports.log("Reset cancelled");
|
|
85037
|
+
return;
|
|
85038
|
+
}
|
|
85039
|
+
}
|
|
85040
|
+
yield* Console_exports.log(`Resetting to ${targetCommit.sha}...`);
|
|
85041
|
+
const resetCommand = Command_exports.make(
|
|
85042
|
+
"git",
|
|
85043
|
+
"reset",
|
|
85044
|
+
"--hard",
|
|
85045
|
+
targetCommit.sha
|
|
85046
|
+
).pipe(Command_exports.workingDirectory(cwd));
|
|
85047
|
+
const exitCode3 = yield* Command_exports.exitCode(
|
|
85048
|
+
resetCommand
|
|
85049
|
+
).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
|
|
85050
|
+
if (exitCode3 !== 0) {
|
|
85051
|
+
yield* Console_exports.error("Failed to reset");
|
|
85052
|
+
process.exitCode = 1;
|
|
85053
|
+
return;
|
|
85054
|
+
}
|
|
85055
|
+
yield* Console_exports.log(`\u2713 Reset to lesson ${lessonId}`);
|
|
85056
|
+
}).pipe(
|
|
85057
|
+
Effect_exports.catchTags({
|
|
85058
|
+
NotAGitRepoError: (error4) => {
|
|
85059
|
+
return Effect_exports.gen(function* () {
|
|
85060
|
+
yield* Console_exports.error(`Error: ${error4.message}`);
|
|
85061
|
+
process.exitCode = 1;
|
|
85062
|
+
});
|
|
85063
|
+
},
|
|
85064
|
+
CommitNotFoundError: (error4) => {
|
|
85065
|
+
return Effect_exports.gen(function* () {
|
|
85066
|
+
yield* Console_exports.error(
|
|
85067
|
+
`Error: No commit found for lesson ${error4.lessonId} on branch ${error4.branch}`
|
|
85068
|
+
);
|
|
85069
|
+
process.exitCode = 1;
|
|
85070
|
+
});
|
|
85071
|
+
},
|
|
85072
|
+
PromptCancelledError: () => {
|
|
85073
|
+
return Effect_exports.gen(function* () {
|
|
85074
|
+
yield* Console_exports.log("Operation cancelled");
|
|
85075
|
+
process.exitCode = 0;
|
|
85076
|
+
});
|
|
85077
|
+
}
|
|
85078
|
+
}),
|
|
85079
|
+
Effect_exports.catchAll((error4) => {
|
|
85080
|
+
return Effect_exports.gen(function* () {
|
|
85081
|
+
yield* Console_exports.error(`Unexpected error: ${error4}`);
|
|
85082
|
+
process.exitCode = 1;
|
|
85083
|
+
});
|
|
85084
|
+
})
|
|
85085
|
+
)
|
|
85086
|
+
).pipe(
|
|
85087
|
+
Command_exports2.withDescription("Reset to a specific lesson commit")
|
|
85088
|
+
);
|
|
85089
|
+
|
|
84416
85090
|
// src/Cli.ts
|
|
84417
85091
|
var command = Command_exports2.make("ai-hero").pipe(
|
|
84418
|
-
Command_exports2.withSubcommands([internal, exercise])
|
|
85092
|
+
Command_exports2.withSubcommands([internal, exercise, reset2, cherryPick])
|
|
84419
85093
|
);
|
|
84420
85094
|
var run9 = Command_exports2.run(command, {
|
|
84421
85095
|
name: "AI Hero",
|