@settlemint/sdk-cli 1.2.2-pr66ec0d91 → 1.2.2-pr89b39a3e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +332 -328
- package/dist/cli.js.map +11 -11
- package/package.json +5 -5
package/dist/cli.js
CHANGED
@@ -14507,8 +14507,8 @@ var require_printLocation = __commonJS((exports) => {
|
|
14507
14507
|
const columnNum = sourceLocation.column + columnOffset;
|
14508
14508
|
const locationStr = `${source.name}:${lineNum}:${columnNum}
|
14509
14509
|
`;
|
14510
|
-
const
|
14511
|
-
const locationLine =
|
14510
|
+
const lines2 = body.split(/\r\n|[\n\r]/g);
|
14511
|
+
const locationLine = lines2[lineIndex];
|
14512
14512
|
if (locationLine.length > 120) {
|
14513
14513
|
const subLineIndex = Math.floor(columnNum / 80);
|
14514
14514
|
const subLineColumnNum = columnNum % 80;
|
@@ -14524,14 +14524,14 @@ var require_printLocation = __commonJS((exports) => {
|
|
14524
14524
|
]);
|
14525
14525
|
}
|
14526
14526
|
return locationStr + printPrefixedLines([
|
14527
|
-
[`${lineNum - 1} |`,
|
14527
|
+
[`${lineNum - 1} |`, lines2[lineIndex - 1]],
|
14528
14528
|
[`${lineNum} |`, locationLine],
|
14529
14529
|
["|", "^".padStart(columnNum)],
|
14530
|
-
[`${lineNum + 1} |`,
|
14530
|
+
[`${lineNum + 1} |`, lines2[lineIndex + 1]]
|
14531
14531
|
]);
|
14532
14532
|
}
|
14533
|
-
function printPrefixedLines(
|
14534
|
-
const existingLines =
|
14533
|
+
function printPrefixedLines(lines2) {
|
14534
|
+
const existingLines = lines2.filter(([_, line]) => line !== undefined);
|
14535
14535
|
const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
|
14536
14536
|
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join(`
|
14537
14537
|
`);
|
@@ -14944,14 +14944,14 @@ var require_blockString = __commonJS((exports) => {
|
|
14944
14944
|
exports.isPrintableAsBlockString = isPrintableAsBlockString;
|
14945
14945
|
exports.printBlockString = printBlockString;
|
14946
14946
|
var _characterClasses = require_characterClasses();
|
14947
|
-
function dedentBlockStringLines(
|
14947
|
+
function dedentBlockStringLines(lines2) {
|
14948
14948
|
var _firstNonEmptyLine2;
|
14949
14949
|
let commonIndent = Number.MAX_SAFE_INTEGER;
|
14950
14950
|
let firstNonEmptyLine = null;
|
14951
14951
|
let lastNonEmptyLine = -1;
|
14952
|
-
for (let i = 0;i <
|
14952
|
+
for (let i = 0;i < lines2.length; ++i) {
|
14953
14953
|
var _firstNonEmptyLine;
|
14954
|
-
const line =
|
14954
|
+
const line = lines2[i];
|
14955
14955
|
const indent = leadingWhitespace(line);
|
14956
14956
|
if (indent === line.length) {
|
14957
14957
|
continue;
|
@@ -14962,7 +14962,7 @@ var require_blockString = __commonJS((exports) => {
|
|
14962
14962
|
commonIndent = indent;
|
14963
14963
|
}
|
14964
14964
|
}
|
14965
|
-
return
|
14965
|
+
return lines2.map((line, i) => i === 0 ? line : line.slice(commonIndent)).slice((_firstNonEmptyLine2 = firstNonEmptyLine) !== null && _firstNonEmptyLine2 !== undefined ? _firstNonEmptyLine2 : 0, lastNonEmptyLine + 1);
|
14966
14966
|
}
|
14967
14967
|
function leadingWhitespace(str) {
|
14968
14968
|
let i = 0;
|
@@ -15024,9 +15024,9 @@ var require_blockString = __commonJS((exports) => {
|
|
15024
15024
|
}
|
15025
15025
|
function printBlockString(value, options) {
|
15026
15026
|
const escapedValue = value.replace(/"""/g, '\\"""');
|
15027
|
-
const
|
15028
|
-
const isSingleLine =
|
15029
|
-
const forceLeadingNewLine =
|
15027
|
+
const lines2 = escapedValue.split(/\r\n|[\n\r]/g);
|
15028
|
+
const isSingleLine = lines2.length === 1;
|
15029
|
+
const forceLeadingNewLine = lines2.length > 1 && lines2.slice(1).every((line) => line.length === 0 || (0, _characterClasses.isWhiteSpace)(line.charCodeAt(0)));
|
15030
15030
|
const hasTrailingTripleQuotes = escapedValue.endsWith('\\"""');
|
15031
15031
|
const hasTrailingQuote = value.endsWith('"') && !hasTrailingTripleQuotes;
|
15032
15032
|
const hasTrailingSlash = value.endsWith("\\");
|
@@ -34067,9 +34067,9 @@ var require_commonjs4 = __commonJS((exports) => {
|
|
34067
34067
|
this.#resolveCache = new ResolveCache2;
|
34068
34068
|
this.#resolvePosixCache = new ResolveCache2;
|
34069
34069
|
this.#children = new ChildrenCache2(childrenCacheSize);
|
34070
|
-
const
|
34071
|
-
if (
|
34072
|
-
|
34070
|
+
const split2 = cwdPath.substring(this.rootPath.length).split(sep2);
|
34071
|
+
if (split2.length === 1 && !split2[0]) {
|
34072
|
+
split2.pop();
|
34073
34073
|
}
|
34074
34074
|
if (nocase === undefined) {
|
34075
34075
|
throw new TypeError("must provide nocase setting to PathScurryBase ctor");
|
@@ -34078,11 +34078,11 @@ var require_commonjs4 = __commonJS((exports) => {
|
|
34078
34078
|
this.root = this.newRoot(this.#fs);
|
34079
34079
|
this.roots[this.rootPath] = this.root;
|
34080
34080
|
let prev = this.root;
|
34081
|
-
let len =
|
34081
|
+
let len = split2.length - 1;
|
34082
34082
|
const joinSep = pathImpl.sep;
|
34083
34083
|
let abs = this.rootPath;
|
34084
34084
|
let sawFirst = false;
|
34085
|
-
for (const part of
|
34085
|
+
for (const part of split2) {
|
34086
34086
|
const l = len--;
|
34087
34087
|
prev = prev.child(part, {
|
34088
34088
|
relative: new Array(l).fill("..").join(joinSep),
|
@@ -36533,9 +36533,9 @@ var require_ini = __commonJS((exports, module) => {
|
|
36533
36533
|
let p = out;
|
36534
36534
|
let section = null;
|
36535
36535
|
const re = /^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i;
|
36536
|
-
const
|
36536
|
+
const lines2 = str.split(/[\r\n]+/g);
|
36537
36537
|
const duplicates = {};
|
36538
|
-
for (const line of
|
36538
|
+
for (const line of lines2) {
|
36539
36539
|
if (!line || line.match(/^\s*[;#]/) || line.match(/^\s*$/)) {
|
36540
36540
|
continue;
|
36541
36541
|
}
|
@@ -38088,7 +38088,7 @@ var require_semver2 = __commonJS((exports, module) => {
|
|
38088
38088
|
// ../../node_modules/@npmcli/git/lib/lines-to-revs.js
|
38089
38089
|
var require_lines_to_revs = __commonJS((exports, module) => {
|
38090
38090
|
var semver = require_semver2();
|
38091
|
-
module.exports = (
|
38091
|
+
module.exports = (lines2) => finish(lines2.reduce(linesToRevsReducer, {
|
38092
38092
|
versions: {},
|
38093
38093
|
"dist-tags": {},
|
38094
38094
|
refs: {},
|
@@ -38149,12 +38149,12 @@ var require_lines_to_revs = __commonJS((exports, module) => {
|
|
38149
38149
|
return "other";
|
38150
38150
|
};
|
38151
38151
|
var lineToRevDoc = (line) => {
|
38152
|
-
const
|
38153
|
-
if (
|
38152
|
+
const split2 = line.trim().split(/\s+/, 2);
|
38153
|
+
if (split2.length < 2) {
|
38154
38154
|
return null;
|
38155
38155
|
}
|
38156
|
-
const sha =
|
38157
|
-
const rawRef =
|
38156
|
+
const sha = split2[0].trim();
|
38157
|
+
const rawRef = split2[1].trim();
|
38158
38158
|
const type2 = refType(rawRef);
|
38159
38159
|
if (type2 === "tag") {
|
38160
38160
|
const ref = rawRef.slice("refs/tags/".length);
|
@@ -40715,17 +40715,17 @@ var require_normalize_data = __commonJS((exports, module) => {
|
|
40715
40715
|
};
|
40716
40716
|
var isEmail = (str) => str.includes("@") && str.indexOf("@") < str.lastIndexOf(".");
|
40717
40717
|
function extractDescription(description) {
|
40718
|
-
const
|
40718
|
+
const lines2 = description.trim().split(`
|
40719
40719
|
`);
|
40720
40720
|
let start = 0;
|
40721
|
-
while (
|
40721
|
+
while (lines2[start]?.trim().match(/^(#|$)/)) {
|
40722
40722
|
start++;
|
40723
40723
|
}
|
40724
40724
|
let end = start + 1;
|
40725
|
-
while (end <
|
40725
|
+
while (end < lines2.length && lines2[end].trim()) {
|
40726
40726
|
end++;
|
40727
40727
|
}
|
40728
|
-
return
|
40728
|
+
return lines2.slice(start, end).join(" ").trim();
|
40729
40729
|
}
|
40730
40730
|
function stringifyPerson(person) {
|
40731
40731
|
if (typeof person !== "string") {
|
@@ -59422,9 +59422,9 @@ ${lanes.join(`
|
|
59422
59422
|
return node.kind === 183 || node.kind === 233;
|
59423
59423
|
}
|
59424
59424
|
var MAX_SMI_X86 = 1073741823;
|
59425
|
-
function guessIndentation(
|
59425
|
+
function guessIndentation(lines2) {
|
59426
59426
|
let indentation = MAX_SMI_X86;
|
59427
|
-
for (const line of
|
59427
|
+
for (const line of lines2) {
|
59428
59428
|
if (!line.length) {
|
59429
59429
|
continue;
|
59430
59430
|
}
|
@@ -147975,8 +147975,8 @@ ${lanes.join(`
|
|
147975
147975
|
if (node.comment) {
|
147976
147976
|
const text = getTextOfJSDocComment(node.comment);
|
147977
147977
|
if (text) {
|
147978
|
-
const
|
147979
|
-
for (const line of
|
147978
|
+
const lines2 = text.split(/\r\n?|\n/);
|
147979
|
+
for (const line of lines2) {
|
147980
147980
|
writeLine();
|
147981
147981
|
writeSpace();
|
147982
147982
|
writePunctuation("*");
|
@@ -148620,9 +148620,9 @@ ${lanes.join(`
|
|
148620
148620
|
if (getEmitFlags(parentNode) & 1) {
|
148621
148621
|
writeSpace();
|
148622
148622
|
} else if (preserveSourceNewlines) {
|
148623
|
-
const
|
148624
|
-
if (
|
148625
|
-
writeLine(
|
148623
|
+
const lines2 = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);
|
148624
|
+
if (lines2) {
|
148625
|
+
writeLine(lines2);
|
148626
148626
|
} else {
|
148627
148627
|
writeSpace();
|
148628
148628
|
}
|
@@ -148631,9 +148631,9 @@ ${lanes.join(`
|
|
148631
148631
|
}
|
148632
148632
|
}
|
148633
148633
|
function writeLines(text) {
|
148634
|
-
const
|
148635
|
-
const indentation = guessIndentation(
|
148636
|
-
for (const lineText of
|
148634
|
+
const lines2 = text.split(/\r\n?|\n/);
|
148635
|
+
const indentation = guessIndentation(lines2);
|
148636
|
+
for (const lineText of lines2) {
|
148637
148637
|
const line = indentation ? lineText.slice(indentation) : lineText;
|
148638
148638
|
if (line.length) {
|
148639
148639
|
writeLine();
|
@@ -148731,11 +148731,11 @@ ${lanes.join(`
|
|
148731
148731
|
}
|
148732
148732
|
function getEffectiveLines(getLineDifference) {
|
148733
148733
|
Debug.assert(!!preserveSourceNewlines);
|
148734
|
-
const
|
148735
|
-
if (
|
148734
|
+
const lines2 = getLineDifference(true);
|
148735
|
+
if (lines2 === 0) {
|
148736
148736
|
return getLineDifference(false);
|
148737
148737
|
}
|
148738
|
-
return
|
148738
|
+
return lines2;
|
148739
148739
|
}
|
148740
148740
|
function writeLineSeparatorsAndIndentBefore(node, parent2) {
|
148741
148741
|
const leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent2, node, 0);
|
@@ -159021,7 +159021,7 @@ ${lanes.join(`
|
|
159021
159021
|
function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) {
|
159022
159022
|
var _a;
|
159023
159023
|
const text = [];
|
159024
|
-
const
|
159024
|
+
const colors3 = createColors(sys2);
|
159025
159025
|
const name2 = getDisplayNameTextOfOption(option);
|
159026
159026
|
const valueCandidates = getValueCandidate(option);
|
159027
159027
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(option.defaultValueDescription, option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type);
|
@@ -159042,7 +159042,7 @@ ${lanes.join(`
|
|
159042
159042
|
}
|
159043
159043
|
text.push(sys2.newLine);
|
159044
159044
|
} else {
|
159045
|
-
text.push(
|
159045
|
+
text.push(colors3.blue(name2), sys2.newLine);
|
159046
159046
|
if (option.description) {
|
159047
159047
|
const description3 = getDiagnosticText(option.description);
|
159048
159048
|
text.push(description3);
|
@@ -159087,7 +159087,7 @@ ${lanes.join(`
|
|
159087
159087
|
if (isFirstLine) {
|
159088
159088
|
curLeft = left.padStart(rightAlignOfLeft2);
|
159089
159089
|
curLeft = curLeft.padEnd(leftAlignOfRight2);
|
159090
|
-
curLeft = colorLeft ?
|
159090
|
+
curLeft = colorLeft ? colors3.blue(curLeft) : curLeft;
|
159091
159091
|
} else {
|
159092
159092
|
curLeft = "".padStart(leftAlignOfRight2);
|
159093
159093
|
}
|
@@ -159156,15 +159156,15 @@ ${lanes.join(`
|
|
159156
159156
|
}
|
159157
159157
|
const rightAlignOfLeftPart = maxLength2 + 2;
|
159158
159158
|
const leftAlignOfRightPart = rightAlignOfLeftPart + 2;
|
159159
|
-
let
|
159159
|
+
let lines2 = [];
|
159160
159160
|
for (const option of optionsList) {
|
159161
159161
|
const tmp = generateOptionOutput(sys2, option, rightAlignOfLeftPart, leftAlignOfRightPart);
|
159162
|
-
|
159162
|
+
lines2 = [...lines2, ...tmp];
|
159163
159163
|
}
|
159164
|
-
if (
|
159165
|
-
|
159164
|
+
if (lines2[lines2.length - 2] !== sys2.newLine) {
|
159165
|
+
lines2.push(sys2.newLine);
|
159166
159166
|
}
|
159167
|
-
return
|
159167
|
+
return lines2;
|
159168
159168
|
}
|
159169
159169
|
function generateSectionOptionsOutput(sys2, sectionName, options, subCategory, beforeOptionsDescription, afterOptionsDescription) {
|
159170
159170
|
let res = [];
|
@@ -159199,9 +159199,9 @@ ${lanes.join(`
|
|
159199
159199
|
return res;
|
159200
159200
|
}
|
159201
159201
|
function printEasyHelp(sys2, simpleOptions) {
|
159202
|
-
const
|
159202
|
+
const colors3 = createColors(sys2);
|
159203
159203
|
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version)}`)];
|
159204
|
-
output.push(
|
159204
|
+
output.push(colors3.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
|
159205
159205
|
example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
159206
159206
|
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
159207
159207
|
example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
|
@@ -159222,7 +159222,7 @@ ${lanes.join(`
|
|
159222
159222
|
function example(ex, desc) {
|
159223
159223
|
const examples = typeof ex === "string" ? [ex] : ex;
|
159224
159224
|
for (const example2 of examples) {
|
159225
|
-
output.push(" " +
|
159225
|
+
output.push(" " + colors3.blue(example2) + sys2.newLine);
|
159226
159226
|
}
|
159227
159227
|
output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine);
|
159228
159228
|
}
|
@@ -159245,12 +159245,12 @@ ${lanes.join(`
|
|
159245
159245
|
}
|
159246
159246
|
function getHeader(sys2, message) {
|
159247
159247
|
var _a;
|
159248
|
-
const
|
159248
|
+
const colors3 = createColors(sys2);
|
159249
159249
|
const header = [];
|
159250
159250
|
const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? undefined : _a.call(sys2)) ?? 0;
|
159251
159251
|
const tsIconLength = 5;
|
159252
|
-
const tsIconFirstLine =
|
159253
|
-
const tsIconSecondLine =
|
159252
|
+
const tsIconFirstLine = colors3.blueBackground("".padStart(tsIconLength));
|
159253
|
+
const tsIconSecondLine = colors3.blueBackground(colors3.brightWhite("TS ".padStart(tsIconLength)));
|
159254
159254
|
if (terminalWidth >= message.length + tsIconLength) {
|
159255
159255
|
const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
|
159256
159256
|
const leftAlign = rightAlign - tsIconLength;
|
@@ -210956,9 +210956,9 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
210956
210956
|
insertedText = this.initialText + this.trailingText;
|
210957
210957
|
}
|
210958
210958
|
const lm = LineIndex.linesFromText(insertedText);
|
210959
|
-
const
|
210960
|
-
if (
|
210961
|
-
|
210959
|
+
const lines2 = lm.lines;
|
210960
|
+
if (lines2.length > 1 && lines2[lines2.length - 1] === "") {
|
210961
|
+
lines2.pop();
|
210962
210962
|
}
|
210963
210963
|
let branchParent;
|
210964
210964
|
let lastZeroCount;
|
@@ -210977,13 +210977,13 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
210977
210977
|
branchParent.remove(lastZeroCount);
|
210978
210978
|
}
|
210979
210979
|
const leafNode = this.startPath[this.startPath.length - 1];
|
210980
|
-
if (
|
210981
|
-
leafNode.text =
|
210982
|
-
if (
|
210983
|
-
let insertedNodes = new Array(
|
210980
|
+
if (lines2.length > 0) {
|
210981
|
+
leafNode.text = lines2[0];
|
210982
|
+
if (lines2.length > 1) {
|
210983
|
+
let insertedNodes = new Array(lines2.length - 1);
|
210984
210984
|
let startNode2 = leafNode;
|
210985
|
-
for (let i2 = 1;i2 <
|
210986
|
-
insertedNodes[i2 - 1] = new LineLeaf(
|
210985
|
+
for (let i2 = 1;i2 < lines2.length; i2++) {
|
210986
|
+
insertedNodes[i2 - 1] = new LineLeaf(lines2[i2]);
|
210987
210987
|
}
|
210988
210988
|
let pathIndex = this.startPath.length - 2;
|
210989
210989
|
while (pathIndex >= 0) {
|
@@ -211253,11 +211253,11 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
211253
211253
|
return { absolutePosition: this.root.charCount(), lineText: undefined };
|
211254
211254
|
}
|
211255
211255
|
}
|
211256
|
-
load(
|
211257
|
-
if (
|
211256
|
+
load(lines2) {
|
211257
|
+
if (lines2.length > 0) {
|
211258
211258
|
const leaves = [];
|
211259
|
-
for (let i2 = 0;i2 <
|
211260
|
-
leaves[i2] = new LineLeaf(
|
211259
|
+
for (let i2 = 0;i2 < lines2.length; i2++) {
|
211260
|
+
leaves[i2] = new LineLeaf(lines2[i2]);
|
211261
211261
|
}
|
211262
211262
|
this.root = _LineIndex.buildTreeFromBottom(leaves);
|
211263
211263
|
} else {
|
@@ -211360,18 +211360,18 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
|
|
211360
211360
|
if (lineMap.length === 0) {
|
211361
211361
|
return { lines: [], lineMap };
|
211362
211362
|
}
|
211363
|
-
const
|
211363
|
+
const lines2 = new Array(lineMap.length);
|
211364
211364
|
const lc = lineMap.length - 1;
|
211365
211365
|
for (let lmi = 0;lmi < lc; lmi++) {
|
211366
|
-
|
211366
|
+
lines2[lmi] = text.substring(lineMap[lmi], lineMap[lmi + 1]);
|
211367
211367
|
}
|
211368
211368
|
const endText = text.substring(lineMap[lc]);
|
211369
211369
|
if (endText.length > 0) {
|
211370
|
-
|
211370
|
+
lines2[lc] = endText;
|
211371
211371
|
} else {
|
211372
|
-
|
211372
|
+
lines2.pop();
|
211373
211373
|
}
|
211374
|
-
return { lines, lineMap };
|
211374
|
+
return { lines: lines2, lineMap };
|
211375
211375
|
}
|
211376
211376
|
};
|
211377
211377
|
var LineNode = class _LineNode {
|
@@ -212442,7 +212442,7 @@ async function* streamBody(e4) {
|
|
212442
212442
|
}
|
212443
212443
|
}
|
212444
212444
|
}
|
212445
|
-
async function*
|
212445
|
+
async function* split2(e4, r3) {
|
212446
212446
|
var a4 = "";
|
212447
212447
|
var n3;
|
212448
212448
|
for await (var t4 of e4) {
|
@@ -212476,7 +212476,7 @@ function makeFetchSource(e4, r3, a4) {
|
|
212476
212476
|
var n5 = "--" + (a6 ? a6[1] : "-");
|
212477
212477
|
var t5 = true;
|
212478
212478
|
var i4;
|
212479
|
-
for await (var o4 of
|
212479
|
+
for await (var o4 of split2(streamBody(r5), `\r
|
212480
212480
|
` + n5)) {
|
212481
212481
|
if (t5) {
|
212482
212482
|
t5 = false;
|
@@ -212509,7 +212509,7 @@ function makeFetchSource(e4, r3, a4) {
|
|
212509
212509
|
} else if (/text\/event-stream/i.test(o3)) {
|
212510
212510
|
s2 = async function* parseEventStream(e6) {
|
212511
212511
|
var r5;
|
212512
|
-
for await (var a6 of
|
212512
|
+
for await (var a6 of split2(streamBody(e6), `
|
212513
212513
|
|
212514
212514
|
`)) {
|
212515
212515
|
var n5 = a6.match(S);
|
@@ -259517,7 +259517,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
259517
259517
|
var package_default = {
|
259518
259518
|
name: "@settlemint/sdk-cli",
|
259519
259519
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
259520
|
-
version: "1.2.2-
|
259520
|
+
version: "1.2.2-pr89b39a3e",
|
259521
259521
|
type: "module",
|
259522
259522
|
private: false,
|
259523
259523
|
license: "FSL-1.1-MIT",
|
@@ -259563,11 +259563,11 @@ var package_default = {
|
|
259563
259563
|
"@commander-js/extra-typings": "11.1.0",
|
259564
259564
|
commander: "11.1.0",
|
259565
259565
|
"@inquirer/confirm": "5.1.8",
|
259566
|
-
"@inquirer/input": "4.1.
|
259566
|
+
"@inquirer/input": "4.1.7",
|
259567
259567
|
"@inquirer/password": "4.0.11",
|
259568
|
-
"@inquirer/select": "4.0
|
259569
|
-
"@settlemint/sdk-js": "1.2.2-
|
259570
|
-
"@settlemint/sdk-utils": "1.2.2-
|
259568
|
+
"@inquirer/select": "4.1.0",
|
259569
|
+
"@settlemint/sdk-js": "1.2.2-pr89b39a3e",
|
259570
|
+
"@settlemint/sdk-utils": "1.2.2-pr89b39a3e",
|
259571
259571
|
"@types/node": "22.13.10",
|
259572
259572
|
"@types/semver": "7.5.8",
|
259573
259573
|
"@types/which": "3.0.4",
|
@@ -259656,7 +259656,10 @@ var {
|
|
259656
259656
|
} = import__.default;
|
259657
259657
|
|
259658
259658
|
// ../../node_modules/@inquirer/core/dist/esm/lib/key.js
|
259659
|
+
var isUpKey = (key) => key.name === "up" || key.name === "k" || key.ctrl && key.name === "p";
|
259660
|
+
var isDownKey = (key) => key.name === "down" || key.name === "j" || key.ctrl && key.name === "n";
|
259659
259661
|
var isBackspaceKey = (key) => key.name === "backspace";
|
259662
|
+
var isNumberKey = (key) => "1234567890".includes(key.name);
|
259660
259663
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
259661
259664
|
// ../../node_modules/@inquirer/core/dist/esm/lib/errors.js
|
259662
259665
|
class AbortPromptError extends Error {
|
@@ -260190,11 +260193,22 @@ function usePrefix({ status = "idle", theme }) {
|
|
260190
260193
|
const iconName = status === "loading" ? "idle" : status;
|
260191
260194
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
260192
260195
|
}
|
260196
|
+
// ../../node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
260197
|
+
function useMemo(fn, dependencies) {
|
260198
|
+
return withPointer((pointer) => {
|
260199
|
+
const prev = pointer.get();
|
260200
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
260201
|
+
const value = fn();
|
260202
|
+
pointer.set({ value, dependencies });
|
260203
|
+
return value;
|
260204
|
+
}
|
260205
|
+
return prev.value;
|
260206
|
+
});
|
260207
|
+
}
|
260193
260208
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
260194
260209
|
function useRef(val) {
|
260195
260210
|
return useState({ current: val })[0];
|
260196
260211
|
}
|
260197
|
-
|
260198
260212
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
260199
260213
|
function useKeypress(userHandler) {
|
260200
260214
|
const signal = useRef(userHandler);
|
@@ -260226,6 +260240,95 @@ function readlineWidth() {
|
|
260226
260240
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
260227
260241
|
}
|
260228
260242
|
|
260243
|
+
// ../../node_modules/@inquirer/core/dist/esm/lib/pagination/lines.js
|
260244
|
+
function split(content, width) {
|
260245
|
+
return breakLines(content, width).split(`
|
260246
|
+
`);
|
260247
|
+
}
|
260248
|
+
function rotate(count, items) {
|
260249
|
+
const max = items.length;
|
260250
|
+
const offset = (count % max + max) % max;
|
260251
|
+
return [...items.slice(offset), ...items.slice(0, offset)];
|
260252
|
+
}
|
260253
|
+
function lines({ items, width, renderItem, active, position: requested, pageSize }) {
|
260254
|
+
const layouts = items.map((item, index) => ({
|
260255
|
+
item,
|
260256
|
+
index,
|
260257
|
+
isActive: index === active
|
260258
|
+
}));
|
260259
|
+
const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
|
260260
|
+
const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split(renderItem(layoutsInPage[index]), width);
|
260261
|
+
const pageBuffer = Array.from({ length: pageSize });
|
260262
|
+
const activeItem = renderItemAt(requested).slice(0, pageSize);
|
260263
|
+
const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
|
260264
|
+
pageBuffer.splice(position, activeItem.length, ...activeItem);
|
260265
|
+
let bufferPointer = position + activeItem.length;
|
260266
|
+
let layoutPointer = requested + 1;
|
260267
|
+
while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
|
260268
|
+
for (const line of renderItemAt(layoutPointer)) {
|
260269
|
+
pageBuffer[bufferPointer++] = line;
|
260270
|
+
if (bufferPointer >= pageSize)
|
260271
|
+
break;
|
260272
|
+
}
|
260273
|
+
layoutPointer++;
|
260274
|
+
}
|
260275
|
+
bufferPointer = position - 1;
|
260276
|
+
layoutPointer = requested - 1;
|
260277
|
+
while (bufferPointer >= 0 && layoutPointer >= 0) {
|
260278
|
+
for (const line of renderItemAt(layoutPointer).reverse()) {
|
260279
|
+
pageBuffer[bufferPointer--] = line;
|
260280
|
+
if (bufferPointer < 0)
|
260281
|
+
break;
|
260282
|
+
}
|
260283
|
+
layoutPointer--;
|
260284
|
+
}
|
260285
|
+
return pageBuffer.filter((line) => typeof line === "string");
|
260286
|
+
}
|
260287
|
+
|
260288
|
+
// ../../node_modules/@inquirer/core/dist/esm/lib/pagination/position.js
|
260289
|
+
function finite({ active, pageSize, total }) {
|
260290
|
+
const middle = Math.floor(pageSize / 2);
|
260291
|
+
if (total <= pageSize || active < middle)
|
260292
|
+
return active;
|
260293
|
+
if (active >= total - middle)
|
260294
|
+
return active + pageSize - total;
|
260295
|
+
return middle;
|
260296
|
+
}
|
260297
|
+
function infinite({ active, lastActive, total, pageSize, pointer }) {
|
260298
|
+
if (total <= pageSize)
|
260299
|
+
return active;
|
260300
|
+
if (lastActive < active && active - lastActive < pageSize) {
|
260301
|
+
return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
|
260302
|
+
}
|
260303
|
+
return pointer;
|
260304
|
+
}
|
260305
|
+
|
260306
|
+
// ../../node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
260307
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
260308
|
+
const state = useRef({ position: 0, lastActive: 0 });
|
260309
|
+
const position = loop ? infinite({
|
260310
|
+
active,
|
260311
|
+
lastActive: state.current.lastActive,
|
260312
|
+
total: items.length,
|
260313
|
+
pageSize,
|
260314
|
+
pointer: state.current.position
|
260315
|
+
}) : finite({
|
260316
|
+
active,
|
260317
|
+
total: items.length,
|
260318
|
+
pageSize
|
260319
|
+
});
|
260320
|
+
state.current.position = position;
|
260321
|
+
state.current.lastActive = active;
|
260322
|
+
return lines({
|
260323
|
+
items,
|
260324
|
+
width: readlineWidth(),
|
260325
|
+
renderItem,
|
260326
|
+
active,
|
260327
|
+
position,
|
260328
|
+
pageSize
|
260329
|
+
}).join(`
|
260330
|
+
`);
|
260331
|
+
}
|
260229
260332
|
// ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
260230
260333
|
var import_mute_stream = __toESM(require_lib(), 1);
|
260231
260334
|
import * as readline2 from "node:readline";
|
@@ -260605,6 +260708,20 @@ function createPrompt(view) {
|
|
260605
260708
|
};
|
260606
260709
|
return prompt;
|
260607
260710
|
}
|
260711
|
+
// ../../node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
260712
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
260713
|
+
class Separator {
|
260714
|
+
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
260715
|
+
type = "separator";
|
260716
|
+
constructor(separator) {
|
260717
|
+
if (separator) {
|
260718
|
+
this.separator = separator;
|
260719
|
+
}
|
260720
|
+
}
|
260721
|
+
static isSeparator(choice) {
|
260722
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
260723
|
+
}
|
260724
|
+
}
|
260608
260725
|
// ../utils/dist/terminal.mjs
|
260609
260726
|
import { spawn } from "node:child_process";
|
260610
260727
|
var import_console_table_printer2 = __toESM(require_dist2(), 1);
|
@@ -264925,97 +265042,10 @@ function sanitizeName(value4, length = 35) {
|
|
264925
265042
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
264926
265043
|
}
|
264927
265044
|
|
264928
|
-
// ../../node_modules/@inquirer/input/dist/esm/
|
264929
|
-
var inputTheme = {
|
264930
|
-
validationFailureMode: "keep"
|
264931
|
-
};
|
264932
|
-
var esm_default2 = createPrompt((config3, done) => {
|
264933
|
-
const { required, validate: validate3 = () => true } = config3;
|
264934
|
-
const theme = makeTheme(inputTheme, config3.theme);
|
264935
|
-
const [status, setStatus] = useState("idle");
|
264936
|
-
const [defaultValue = "", setDefaultValue] = useState(config3.default);
|
264937
|
-
const [errorMsg, setError] = useState();
|
264938
|
-
const [value4, setValue] = useState("");
|
264939
|
-
const prefix = usePrefix({ status, theme });
|
264940
|
-
useKeypress(async (key2, rl) => {
|
264941
|
-
if (status !== "idle") {
|
264942
|
-
return;
|
264943
|
-
}
|
264944
|
-
if (isEnterKey(key2)) {
|
264945
|
-
const answer = value4 || defaultValue;
|
264946
|
-
setStatus("loading");
|
264947
|
-
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
264948
|
-
if (isValid2 === true) {
|
264949
|
-
setValue(answer);
|
264950
|
-
setStatus("done");
|
264951
|
-
done(answer);
|
264952
|
-
} else {
|
264953
|
-
if (theme.validationFailureMode === "clear") {
|
264954
|
-
setValue("");
|
264955
|
-
} else {
|
264956
|
-
rl.write(value4);
|
264957
|
-
}
|
264958
|
-
setError(isValid2 || "You must provide a valid value");
|
264959
|
-
setStatus("idle");
|
264960
|
-
}
|
264961
|
-
} else if (isBackspaceKey(key2) && !value4) {
|
264962
|
-
setDefaultValue(undefined);
|
264963
|
-
} else if (key2.name === "tab" && !value4) {
|
264964
|
-
setDefaultValue(undefined);
|
264965
|
-
rl.clearLine(0);
|
264966
|
-
rl.write(defaultValue);
|
264967
|
-
setValue(defaultValue);
|
264968
|
-
} else {
|
264969
|
-
setValue(rl.line);
|
264970
|
-
setError(undefined);
|
264971
|
-
}
|
264972
|
-
});
|
264973
|
-
const message = theme.style.message(config3.message, status);
|
264974
|
-
let formattedValue = value4;
|
264975
|
-
if (typeof config3.transformer === "function") {
|
264976
|
-
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
264977
|
-
} else if (status === "done") {
|
264978
|
-
formattedValue = theme.style.answer(value4);
|
264979
|
-
}
|
264980
|
-
let defaultStr;
|
264981
|
-
if (defaultValue && status !== "done" && !value4) {
|
264982
|
-
defaultStr = theme.style.defaultAnswer(defaultValue);
|
264983
|
-
}
|
264984
|
-
let error5 = "";
|
264985
|
-
if (errorMsg) {
|
264986
|
-
error5 = theme.style.error(errorMsg);
|
264987
|
-
}
|
264988
|
-
return [
|
264989
|
-
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
264990
|
-
error5
|
264991
|
-
];
|
264992
|
-
});
|
264993
|
-
|
264994
|
-
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
264995
|
-
async function subgraphNamePrompt({
|
264996
|
-
defaultName,
|
264997
|
-
env: env2,
|
264998
|
-
accept
|
264999
|
-
}) {
|
265000
|
-
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
265001
|
-
if (accept) {
|
265002
|
-
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
265003
|
-
}
|
265004
|
-
const subgraphName = await esm_default2({
|
265005
|
-
message: "What is the name of your subgraph?",
|
265006
|
-
default: defaultSubgraphName,
|
265007
|
-
required: true
|
265008
|
-
});
|
265009
|
-
return sanitizeName(subgraphName);
|
265010
|
-
}
|
265011
|
-
|
265012
|
-
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/key.js
|
265013
|
-
var isUpKey = (key2) => key2.name === "up" || key2.name === "k" || key2.ctrl && key2.name === "p";
|
265014
|
-
var isDownKey = (key2) => key2.name === "down" || key2.name === "j" || key2.ctrl && key2.name === "n";
|
265045
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/key.js
|
265015
265046
|
var isBackspaceKey2 = (key2) => key2.name === "backspace";
|
265016
|
-
var isNumberKey = (key2) => "123456789".includes(key2.name);
|
265017
265047
|
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
265018
|
-
// ../../node_modules/@inquirer/
|
265048
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
265019
265049
|
class AbortPromptError2 extends Error {
|
265020
265050
|
name = "AbortPromptError";
|
265021
265051
|
message = "Prompt was aborted";
|
@@ -265041,10 +265071,10 @@ class HookError2 extends Error {
|
|
265041
265071
|
class ValidationError2 extends Error {
|
265042
265072
|
name = "ValidationError";
|
265043
265073
|
}
|
265044
|
-
// ../../node_modules/@inquirer/
|
265074
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265045
265075
|
import { AsyncResource as AsyncResource5 } from "node:async_hooks";
|
265046
265076
|
|
265047
|
-
// ../../node_modules/@inquirer/
|
265077
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
265048
265078
|
import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
|
265049
265079
|
var hookStorage2 = new AsyncLocalStorage2;
|
265050
265080
|
function createStore2(rl) {
|
@@ -265149,7 +265179,7 @@ var effectScheduler2 = {
|
|
265149
265179
|
}
|
265150
265180
|
};
|
265151
265181
|
|
265152
|
-
// ../../node_modules/@inquirer/
|
265182
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
265153
265183
|
function useState2(defaultValue) {
|
265154
265184
|
return withPointer2((pointer) => {
|
265155
265185
|
const setFn = (newValue) => {
|
@@ -265167,7 +265197,7 @@ function useState2(defaultValue) {
|
|
265167
265197
|
});
|
265168
265198
|
}
|
265169
265199
|
|
265170
|
-
// ../../node_modules/@inquirer/
|
265200
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
265171
265201
|
function useEffect2(cb, depArray) {
|
265172
265202
|
withPointer2((pointer) => {
|
265173
265203
|
const oldDeps = pointer.get();
|
@@ -265179,29 +265209,29 @@ function useEffect2(cb, depArray) {
|
|
265179
265209
|
});
|
265180
265210
|
}
|
265181
265211
|
|
265182
|
-
// ../../node_modules/@inquirer/
|
265183
|
-
var
|
265212
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
265213
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
265184
265214
|
var defaultTheme2 = {
|
265185
265215
|
prefix: {
|
265186
|
-
idle:
|
265187
|
-
done:
|
265216
|
+
idle: import_yoctocolors_cjs3.default.blue("?"),
|
265217
|
+
done: import_yoctocolors_cjs3.default.green(esm_default.tick)
|
265188
265218
|
},
|
265189
265219
|
spinner: {
|
265190
265220
|
interval: 80,
|
265191
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
265221
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs3.default.yellow(frame))
|
265192
265222
|
},
|
265193
265223
|
style: {
|
265194
|
-
answer:
|
265195
|
-
message:
|
265196
|
-
error: (text2) =>
|
265197
|
-
defaultAnswer: (text2) =>
|
265198
|
-
help:
|
265199
|
-
highlight:
|
265200
|
-
key: (text2) =>
|
265224
|
+
answer: import_yoctocolors_cjs3.default.cyan,
|
265225
|
+
message: import_yoctocolors_cjs3.default.bold,
|
265226
|
+
error: (text2) => import_yoctocolors_cjs3.default.red(`> ${text2}`),
|
265227
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs3.default.dim(`(${text2})`),
|
265228
|
+
help: import_yoctocolors_cjs3.default.dim,
|
265229
|
+
highlight: import_yoctocolors_cjs3.default.cyan,
|
265230
|
+
key: (text2) => import_yoctocolors_cjs3.default.cyan(import_yoctocolors_cjs3.default.bold(`<${text2}>`))
|
265201
265231
|
}
|
265202
265232
|
};
|
265203
265233
|
|
265204
|
-
// ../../node_modules/@inquirer/
|
265234
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
265205
265235
|
function isPlainObject3(value4) {
|
265206
265236
|
if (typeof value4 !== "object" || value4 === null)
|
265207
265237
|
return false;
|
@@ -265229,7 +265259,7 @@ function makeTheme2(...themes) {
|
|
265229
265259
|
return deepMerge3(...themesToMerge);
|
265230
265260
|
}
|
265231
265261
|
|
265232
|
-
// ../../node_modules/@inquirer/
|
265262
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265233
265263
|
function usePrefix2({ status = "idle", theme }) {
|
265234
265264
|
const [showLoader, setShowLoader] = useState2(false);
|
265235
265265
|
const [tick, setTick] = useState2(0);
|
@@ -265259,23 +265289,12 @@ function usePrefix2({ status = "idle", theme }) {
|
|
265259
265289
|
const iconName = status === "loading" ? "idle" : status;
|
265260
265290
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
265261
265291
|
}
|
265262
|
-
// ../../node_modules/@inquirer/
|
265263
|
-
function useMemo(fn, dependencies) {
|
265264
|
-
return withPointer2((pointer) => {
|
265265
|
-
const prev = pointer.get();
|
265266
|
-
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i6) => dep !== dependencies[i6])) {
|
265267
|
-
const value4 = fn();
|
265268
|
-
pointer.set({ value: value4, dependencies });
|
265269
|
-
return value4;
|
265270
|
-
}
|
265271
|
-
return prev.value;
|
265272
|
-
});
|
265273
|
-
}
|
265274
|
-
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
265292
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
265275
265293
|
function useRef2(val) {
|
265276
265294
|
return useState2({ current: val })[0];
|
265277
265295
|
}
|
265278
|
-
|
265296
|
+
|
265297
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
265279
265298
|
function useKeypress2(userHandler) {
|
265280
265299
|
const signal = useRef2(userHandler);
|
265281
265300
|
signal.current = userHandler;
|
@@ -265293,7 +265312,7 @@ function useKeypress2(userHandler) {
|
|
265293
265312
|
};
|
265294
265313
|
}, []);
|
265295
265314
|
}
|
265296
|
-
// ../../node_modules/@inquirer/
|
265315
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
265297
265316
|
var import_cli_width2 = __toESM(require_cli_width(), 1);
|
265298
265317
|
var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
|
265299
265318
|
function breakLines2(content, width) {
|
@@ -265306,101 +265325,12 @@ function readlineWidth2() {
|
|
265306
265325
|
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
265307
265326
|
}
|
265308
265327
|
|
265309
|
-
// ../../node_modules/@inquirer/
|
265310
|
-
function split2(content, width) {
|
265311
|
-
return breakLines2(content, width).split(`
|
265312
|
-
`);
|
265313
|
-
}
|
265314
|
-
function rotate(count, items) {
|
265315
|
-
const max = items.length;
|
265316
|
-
const offset = (count % max + max) % max;
|
265317
|
-
return [...items.slice(offset), ...items.slice(0, offset)];
|
265318
|
-
}
|
265319
|
-
function lines({ items, width, renderItem, active, position: requested, pageSize }) {
|
265320
|
-
const layouts = items.map((item, index) => ({
|
265321
|
-
item,
|
265322
|
-
index,
|
265323
|
-
isActive: index === active
|
265324
|
-
}));
|
265325
|
-
const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
|
265326
|
-
const renderItemAt = (index) => layoutsInPage[index] == null ? [] : split2(renderItem(layoutsInPage[index]), width);
|
265327
|
-
const pageBuffer = Array.from({ length: pageSize });
|
265328
|
-
const activeItem = renderItemAt(requested).slice(0, pageSize);
|
265329
|
-
const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
|
265330
|
-
pageBuffer.splice(position, activeItem.length, ...activeItem);
|
265331
|
-
let bufferPointer = position + activeItem.length;
|
265332
|
-
let layoutPointer = requested + 1;
|
265333
|
-
while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
|
265334
|
-
for (const line of renderItemAt(layoutPointer)) {
|
265335
|
-
pageBuffer[bufferPointer++] = line;
|
265336
|
-
if (bufferPointer >= pageSize)
|
265337
|
-
break;
|
265338
|
-
}
|
265339
|
-
layoutPointer++;
|
265340
|
-
}
|
265341
|
-
bufferPointer = position - 1;
|
265342
|
-
layoutPointer = requested - 1;
|
265343
|
-
while (bufferPointer >= 0 && layoutPointer >= 0) {
|
265344
|
-
for (const line of renderItemAt(layoutPointer).reverse()) {
|
265345
|
-
pageBuffer[bufferPointer--] = line;
|
265346
|
-
if (bufferPointer < 0)
|
265347
|
-
break;
|
265348
|
-
}
|
265349
|
-
layoutPointer--;
|
265350
|
-
}
|
265351
|
-
return pageBuffer.filter((line) => typeof line === "string");
|
265352
|
-
}
|
265353
|
-
|
265354
|
-
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/position.js
|
265355
|
-
function finite({ active, pageSize, total }) {
|
265356
|
-
const middle = Math.floor(pageSize / 2);
|
265357
|
-
if (total <= pageSize || active < middle)
|
265358
|
-
return active;
|
265359
|
-
if (active >= total - middle)
|
265360
|
-
return active + pageSize - total;
|
265361
|
-
return middle;
|
265362
|
-
}
|
265363
|
-
function infinite({ active, lastActive, total, pageSize, pointer }) {
|
265364
|
-
if (total <= pageSize)
|
265365
|
-
return active;
|
265366
|
-
if (lastActive < active && active - lastActive < pageSize) {
|
265367
|
-
return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
|
265368
|
-
}
|
265369
|
-
return pointer;
|
265370
|
-
}
|
265371
|
-
|
265372
|
-
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
265373
|
-
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
265374
|
-
const state = useRef2({ position: 0, lastActive: 0 });
|
265375
|
-
const position = loop ? infinite({
|
265376
|
-
active,
|
265377
|
-
lastActive: state.current.lastActive,
|
265378
|
-
total: items.length,
|
265379
|
-
pageSize,
|
265380
|
-
pointer: state.current.position
|
265381
|
-
}) : finite({
|
265382
|
-
active,
|
265383
|
-
total: items.length,
|
265384
|
-
pageSize
|
265385
|
-
});
|
265386
|
-
state.current.position = position;
|
265387
|
-
state.current.lastActive = active;
|
265388
|
-
return lines({
|
265389
|
-
items,
|
265390
|
-
width: readlineWidth2(),
|
265391
|
-
renderItem,
|
265392
|
-
active,
|
265393
|
-
position,
|
265394
|
-
pageSize
|
265395
|
-
}).join(`
|
265396
|
-
`);
|
265397
|
-
}
|
265398
|
-
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265328
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265399
265329
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
265400
265330
|
import * as readline4 from "node:readline";
|
265401
265331
|
import { AsyncResource as AsyncResource6 } from "node:async_hooks";
|
265402
265332
|
|
265403
|
-
// ../../node_modules/@inquirer/
|
265333
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
265404
265334
|
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
265405
265335
|
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
265406
265336
|
var height2 = (content) => content.split(`
|
@@ -265470,7 +265400,7 @@ class ScreenManager2 {
|
|
265470
265400
|
}
|
265471
265401
|
}
|
265472
265402
|
|
265473
|
-
// ../../node_modules/@inquirer/
|
265403
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
265474
265404
|
class PromisePolyfill2 extends Promise {
|
265475
265405
|
static withResolver() {
|
265476
265406
|
let resolve5;
|
@@ -265483,7 +265413,7 @@ class PromisePolyfill2 extends Promise {
|
|
265483
265413
|
}
|
265484
265414
|
}
|
265485
265415
|
|
265486
|
-
// ../../node_modules/@inquirer/
|
265416
|
+
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265487
265417
|
function getCallSites2() {
|
265488
265418
|
const _prepareStackTrace = Error.prepareStackTrace;
|
265489
265419
|
let result = [];
|
@@ -265566,20 +265496,90 @@ function createPrompt2(view) {
|
|
265566
265496
|
};
|
265567
265497
|
return prompt;
|
265568
265498
|
}
|
265569
|
-
// ../../node_modules/@inquirer/
|
265570
|
-
var
|
265571
|
-
|
265572
|
-
|
265573
|
-
|
265574
|
-
|
265575
|
-
|
265576
|
-
|
265499
|
+
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
265500
|
+
var inputTheme = {
|
265501
|
+
validationFailureMode: "keep"
|
265502
|
+
};
|
265503
|
+
var esm_default2 = createPrompt2((config3, done) => {
|
265504
|
+
const { required, validate: validate3 = () => true } = config3;
|
265505
|
+
const theme = makeTheme2(inputTheme, config3.theme);
|
265506
|
+
const [status, setStatus] = useState2("idle");
|
265507
|
+
const [defaultValue = "", setDefaultValue] = useState2(config3.default);
|
265508
|
+
const [errorMsg, setError] = useState2();
|
265509
|
+
const [value4, setValue] = useState2("");
|
265510
|
+
const prefix = usePrefix2({ status, theme });
|
265511
|
+
useKeypress2(async (key3, rl) => {
|
265512
|
+
if (status !== "idle") {
|
265513
|
+
return;
|
265577
265514
|
}
|
265515
|
+
if (isEnterKey2(key3)) {
|
265516
|
+
const answer = value4 || defaultValue;
|
265517
|
+
setStatus("loading");
|
265518
|
+
const isValid2 = required && !answer ? "You must provide a value" : await validate3(answer);
|
265519
|
+
if (isValid2 === true) {
|
265520
|
+
setValue(answer);
|
265521
|
+
setStatus("done");
|
265522
|
+
done(answer);
|
265523
|
+
} else {
|
265524
|
+
if (theme.validationFailureMode === "clear") {
|
265525
|
+
setValue("");
|
265526
|
+
} else {
|
265527
|
+
rl.write(value4);
|
265528
|
+
}
|
265529
|
+
setError(isValid2 || "You must provide a valid value");
|
265530
|
+
setStatus("idle");
|
265531
|
+
}
|
265532
|
+
} else if (isBackspaceKey2(key3) && !value4) {
|
265533
|
+
setDefaultValue(undefined);
|
265534
|
+
} else if (key3.name === "tab" && !value4) {
|
265535
|
+
setDefaultValue(undefined);
|
265536
|
+
rl.clearLine(0);
|
265537
|
+
rl.write(defaultValue);
|
265538
|
+
setValue(defaultValue);
|
265539
|
+
} else {
|
265540
|
+
setValue(rl.line);
|
265541
|
+
setError(undefined);
|
265542
|
+
}
|
265543
|
+
});
|
265544
|
+
const message = theme.style.message(config3.message, status);
|
265545
|
+
let formattedValue = value4;
|
265546
|
+
if (typeof config3.transformer === "function") {
|
265547
|
+
formattedValue = config3.transformer(value4, { isFinal: status === "done" });
|
265548
|
+
} else if (status === "done") {
|
265549
|
+
formattedValue = theme.style.answer(value4);
|
265578
265550
|
}
|
265579
|
-
|
265580
|
-
|
265551
|
+
let defaultStr;
|
265552
|
+
if (defaultValue && status !== "done" && !value4) {
|
265553
|
+
defaultStr = theme.style.defaultAnswer(defaultValue);
|
265554
|
+
}
|
265555
|
+
let error5 = "";
|
265556
|
+
if (errorMsg) {
|
265557
|
+
error5 = theme.style.error(errorMsg);
|
265581
265558
|
}
|
265559
|
+
return [
|
265560
|
+
[prefix, message, defaultStr, formattedValue].filter((v6) => v6 !== undefined).join(" "),
|
265561
|
+
error5
|
265562
|
+
];
|
265563
|
+
});
|
265564
|
+
|
265565
|
+
// src/prompts/smart-contract-set/subgraph-name.prompt.ts
|
265566
|
+
async function subgraphNamePrompt({
|
265567
|
+
defaultName,
|
265568
|
+
env: env2,
|
265569
|
+
accept
|
265570
|
+
}) {
|
265571
|
+
const defaultSubgraphName = defaultName ? sanitizeName(defaultName) : undefined;
|
265572
|
+
if (accept) {
|
265573
|
+
return defaultSubgraphName ?? env2.SETTLEMINT_THEGRAPH_DEFAULT_SUBGRAPH;
|
265574
|
+
}
|
265575
|
+
const subgraphName = await esm_default2({
|
265576
|
+
message: "What is the name of your subgraph?",
|
265577
|
+
default: defaultSubgraphName,
|
265578
|
+
required: true
|
265579
|
+
});
|
265580
|
+
return sanitizeName(subgraphName);
|
265582
265581
|
}
|
265582
|
+
|
265583
265583
|
// ../../node_modules/@inquirer/select/dist/esm/index.js
|
265584
265584
|
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
265585
265585
|
var import_ansi_escapes3 = __toESM(require_ansi_escapes(), 1);
|
@@ -265589,7 +265589,8 @@ var selectTheme = {
|
|
265589
265589
|
disabled: (text2) => import_yoctocolors_cjs4.default.dim(`- ${text2}`),
|
265590
265590
|
description: (text2) => import_yoctocolors_cjs4.default.cyan(text2)
|
265591
265591
|
},
|
265592
|
-
helpMode: "auto"
|
265592
|
+
helpMode: "auto",
|
265593
|
+
indexMode: "hidden"
|
265593
265594
|
};
|
265594
265595
|
function isSelectable(item) {
|
265595
265596
|
return !Separator.isSeparator(item) && !item.disabled;
|
@@ -265616,19 +265617,19 @@ function normalizeChoices(choices) {
|
|
265616
265617
|
};
|
265617
265618
|
});
|
265618
265619
|
}
|
265619
|
-
var esm_default3 =
|
265620
|
+
var esm_default3 = createPrompt((config3, done) => {
|
265620
265621
|
const { loop = true, pageSize = 7 } = config3;
|
265621
|
-
const firstRender =
|
265622
|
-
const theme =
|
265623
|
-
const [status, setStatus] =
|
265624
|
-
const prefix =
|
265625
|
-
const searchTimeoutRef =
|
265622
|
+
const firstRender = useRef(true);
|
265623
|
+
const theme = makeTheme(selectTheme, config3.theme);
|
265624
|
+
const [status, setStatus] = useState("idle");
|
265625
|
+
const prefix = usePrefix({ status, theme });
|
265626
|
+
const searchTimeoutRef = useRef();
|
265626
265627
|
const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
|
265627
265628
|
const bounds = useMemo(() => {
|
265628
265629
|
const first = items.findIndex(isSelectable);
|
265629
265630
|
const last = items.findLastIndex(isSelectable);
|
265630
265631
|
if (first === -1) {
|
265631
|
-
throw new
|
265632
|
+
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
265632
265633
|
}
|
265633
265634
|
return { first, last };
|
265634
265635
|
}, [items]);
|
@@ -265637,11 +265638,11 @@ var esm_default3 = createPrompt2((config3, done) => {
|
|
265637
265638
|
return -1;
|
265638
265639
|
return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
|
265639
265640
|
}, [config3.default, items]);
|
265640
|
-
const [active, setActive] =
|
265641
|
+
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
265641
265642
|
const selectedChoice = items[active];
|
265642
|
-
|
265643
|
+
useKeypress((key3, rl) => {
|
265643
265644
|
clearTimeout(searchTimeoutRef.current);
|
265644
|
-
if (
|
265645
|
+
if (isEnterKey(key3)) {
|
265645
265646
|
setStatus("done");
|
265646
265647
|
done(selectedChoice.value);
|
265647
265648
|
} else if (isUpKey(key3) || isDownKey(key3)) {
|
@@ -265654,14 +265655,16 @@ var esm_default3 = createPrompt2((config3, done) => {
|
|
265654
265655
|
} while (!isSelectable(items[next]));
|
265655
265656
|
setActive(next);
|
265656
265657
|
}
|
265657
|
-
} else if (isNumberKey(key3)) {
|
265658
|
-
rl.
|
265659
|
-
const position = Number(key3.name) - 1;
|
265658
|
+
} else if (isNumberKey(key3) && !Number.isNaN(Number(rl.line))) {
|
265659
|
+
const position = Number(rl.line) - 1;
|
265660
265660
|
const item = items[position];
|
265661
265661
|
if (item != null && isSelectable(item)) {
|
265662
265662
|
setActive(position);
|
265663
265663
|
}
|
265664
|
-
|
265664
|
+
searchTimeoutRef.current = setTimeout(() => {
|
265665
|
+
rl.clearLine(0);
|
265666
|
+
}, 700);
|
265667
|
+
} else if (isBackspaceKey(key3)) {
|
265665
265668
|
rl.clearLine(0);
|
265666
265669
|
} else {
|
265667
265670
|
const searchTerm = rl.line.toLowerCase();
|
@@ -265678,7 +265681,7 @@ var esm_default3 = createPrompt2((config3, done) => {
|
|
265678
265681
|
}, 700);
|
265679
265682
|
}
|
265680
265683
|
});
|
265681
|
-
|
265684
|
+
useEffect(() => () => {
|
265682
265685
|
clearTimeout(searchTimeoutRef.current);
|
265683
265686
|
}, []);
|
265684
265687
|
const message = theme.style.message(config3.message, status);
|
@@ -265696,17 +265699,18 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
|
|
265696
265699
|
const page = usePagination({
|
265697
265700
|
items,
|
265698
265701
|
active,
|
265699
|
-
renderItem({ item, isActive }) {
|
265702
|
+
renderItem({ item, isActive, index }) {
|
265700
265703
|
if (Separator.isSeparator(item)) {
|
265701
265704
|
return ` ${item.separator}`;
|
265702
265705
|
}
|
265706
|
+
const indexLabel = theme.indexMode === "number" ? `${index + 1}. ` : "";
|
265703
265707
|
if (item.disabled) {
|
265704
265708
|
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
265705
|
-
return theme.style.disabled(`${item.name} ${disabledLabel}`);
|
265709
|
+
return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
|
265706
265710
|
}
|
265707
265711
|
const color = isActive ? theme.style.highlight : (x6) => x6;
|
265708
265712
|
const cursor = isActive ? theme.icon.cursor : ` `;
|
265709
|
-
return color(`${cursor} ${item.name}`);
|
265713
|
+
return color(`${cursor} ${indexLabel}${item.name}`);
|
265710
265714
|
},
|
265711
265715
|
pageSize,
|
265712
265716
|
loop
|
@@ -273876,4 +273880,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
273876
273880
|
// src/cli.ts
|
273877
273881
|
sdkCliCommand();
|
273878
273882
|
|
273879
|
-
//# debugId=
|
273883
|
+
//# debugId=9F4AF293CF4F293564756E2164756E21
|