@settlemint/sdk-cli 1.2.2-pr65e8d754 → 1.2.2-pr66ec0d91
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 +321 -321
- package/dist/cli.js.map +12 -12
- 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 lines = body.split(/\r\n|[\n\r]/g);
|
14511
|
+
const locationLine = lines[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} |`, lines[lineIndex - 1]],
|
14528
14528
|
[`${lineNum} |`, locationLine],
|
14529
14529
|
["|", "^".padStart(columnNum)],
|
14530
|
-
[`${lineNum + 1} |`,
|
14530
|
+
[`${lineNum + 1} |`, lines[lineIndex + 1]]
|
14531
14531
|
]);
|
14532
14532
|
}
|
14533
|
-
function printPrefixedLines(
|
14534
|
-
const existingLines =
|
14533
|
+
function printPrefixedLines(lines) {
|
14534
|
+
const existingLines = lines.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(lines) {
|
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 < lines.length; ++i) {
|
14953
14953
|
var _firstNonEmptyLine;
|
14954
|
-
const line =
|
14954
|
+
const line = lines[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 lines.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 lines = escapedValue.split(/\r\n|[\n\r]/g);
|
15028
|
+
const isSingleLine = lines.length === 1;
|
15029
|
+
const forceLeadingNewLine = lines.length > 1 && lines.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 split = cwdPath.substring(this.rootPath.length).split(sep2);
|
34071
|
+
if (split.length === 1 && !split[0]) {
|
34072
|
+
split.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 = split.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 split) {
|
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 lines = str.split(/[\r\n]+/g);
|
36537
36537
|
const duplicates = {};
|
36538
|
-
for (const line of
|
36538
|
+
for (const line of lines) {
|
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 = (lines) => finish(lines.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 split = line.trim().split(/\s+/, 2);
|
38153
|
+
if (split.length < 2) {
|
38154
38154
|
return null;
|
38155
38155
|
}
|
38156
|
-
const sha =
|
38157
|
-
const rawRef =
|
38156
|
+
const sha = split[0].trim();
|
38157
|
+
const rawRef = split[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 lines = description.trim().split(`
|
40719
40719
|
`);
|
40720
40720
|
let start = 0;
|
40721
|
-
while (
|
40721
|
+
while (lines[start]?.trim().match(/^(#|$)/)) {
|
40722
40722
|
start++;
|
40723
40723
|
}
|
40724
40724
|
let end = start + 1;
|
40725
|
-
while (end <
|
40725
|
+
while (end < lines.length && lines[end].trim()) {
|
40726
40726
|
end++;
|
40727
40727
|
}
|
40728
|
-
return
|
40728
|
+
return lines.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(lines) {
|
59426
59426
|
let indentation = MAX_SMI_X86;
|
59427
|
-
for (const line of
|
59427
|
+
for (const line of lines) {
|
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 lines = text.split(/\r\n?|\n/);
|
147979
|
+
for (const line of lines) {
|
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 lines = getLinesBetweenNodes(parentNode, prevChildNode, nextChildNode);
|
148624
|
+
if (lines) {
|
148625
|
+
writeLine(lines);
|
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 lines = text.split(/\r\n?|\n/);
|
148635
|
+
const indentation = guessIndentation(lines);
|
148636
|
+
for (const lineText of lines) {
|
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 lines = getLineDifference(true);
|
148735
|
+
if (lines === 0) {
|
148736
148736
|
return getLineDifference(false);
|
148737
148737
|
}
|
148738
|
-
return
|
148738
|
+
return lines;
|
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 colors2 = 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(colors2.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 ? colors2.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 lines = [];
|
159160
159160
|
for (const option of optionsList) {
|
159161
159161
|
const tmp = generateOptionOutput(sys2, option, rightAlignOfLeftPart, leftAlignOfRightPart);
|
159162
|
-
|
159162
|
+
lines = [...lines, ...tmp];
|
159163
159163
|
}
|
159164
|
-
if (
|
159165
|
-
|
159164
|
+
if (lines[lines.length - 2] !== sys2.newLine) {
|
159165
|
+
lines.push(sys2.newLine);
|
159166
159166
|
}
|
159167
|
-
return
|
159167
|
+
return lines;
|
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 colors2 = 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(colors2.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(" " + colors2.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 colors2 = 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 = colors2.blueBackground("".padStart(tsIconLength));
|
159253
|
+
const tsIconSecondLine = colors2.blueBackground(colors2.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 lines = lm.lines;
|
210960
|
+
if (lines.length > 1 && lines[lines.length - 1] === "") {
|
210961
|
+
lines.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 (lines.length > 0) {
|
210981
|
+
leafNode.text = lines[0];
|
210982
|
+
if (lines.length > 1) {
|
210983
|
+
let insertedNodes = new Array(lines.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 < lines.length; i2++) {
|
210986
|
+
insertedNodes[i2 - 1] = new LineLeaf(lines[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(lines) {
|
211257
|
+
if (lines.length > 0) {
|
211258
211258
|
const leaves = [];
|
211259
|
-
for (let i2 = 0;i2 <
|
211260
|
-
leaves[i2] = new LineLeaf(
|
211259
|
+
for (let i2 = 0;i2 < lines.length; i2++) {
|
211260
|
+
leaves[i2] = new LineLeaf(lines[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 lines = new Array(lineMap.length);
|
211364
211364
|
const lc = lineMap.length - 1;
|
211365
211365
|
for (let lmi = 0;lmi < lc; lmi++) {
|
211366
|
-
|
211366
|
+
lines[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
|
+
lines[lc] = endText;
|
211371
211371
|
} else {
|
211372
|
-
|
211372
|
+
lines.pop();
|
211373
211373
|
}
|
211374
|
-
return { lines
|
211374
|
+
return { lines, 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* split(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 split(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 split(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-pr66ec0d91",
|
259521
259521
|
type: "module",
|
259522
259522
|
private: false,
|
259523
259523
|
license: "FSL-1.1-MIT",
|
@@ -259562,12 +259562,12 @@ var package_default = {
|
|
259562
259562
|
devDependencies: {
|
259563
259563
|
"@commander-js/extra-typings": "11.1.0",
|
259564
259564
|
commander: "11.1.0",
|
259565
|
-
"@inquirer/confirm": "5.1.
|
259565
|
+
"@inquirer/confirm": "5.1.8",
|
259566
259566
|
"@inquirer/input": "4.1.8",
|
259567
|
-
"@inquirer/password": "4.0.
|
259567
|
+
"@inquirer/password": "4.0.11",
|
259568
259568
|
"@inquirer/select": "4.0.10",
|
259569
|
-
"@settlemint/sdk-js": "1.2.2-
|
259570
|
-
"@settlemint/sdk-utils": "1.2.2-
|
259569
|
+
"@settlemint/sdk-js": "1.2.2-pr66ec0d91",
|
259570
|
+
"@settlemint/sdk-utils": "1.2.2-pr66ec0d91",
|
259571
259571
|
"@types/node": "22.13.10",
|
259572
259572
|
"@types/semver": "7.5.8",
|
259573
259573
|
"@types/which": "3.0.4",
|
@@ -259656,10 +259656,7 @@ 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";
|
259661
259659
|
var isBackspaceKey = (key) => key.name === "backspace";
|
259662
|
-
var isNumberKey = (key) => "123456789".includes(key.name);
|
259663
259660
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
259664
259661
|
// ../../node_modules/@inquirer/core/dist/esm/lib/errors.js
|
259665
259662
|
class AbortPromptError extends Error {
|
@@ -260193,22 +260190,11 @@ function usePrefix({ status = "idle", theme }) {
|
|
260193
260190
|
const iconName = status === "loading" ? "idle" : status;
|
260194
260191
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
260195
260192
|
}
|
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
|
-
}
|
260208
260193
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
260209
260194
|
function useRef(val) {
|
260210
260195
|
return useState({ current: val })[0];
|
260211
260196
|
}
|
260197
|
+
|
260212
260198
|
// ../../node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
260213
260199
|
function useKeypress(userHandler) {
|
260214
260200
|
const signal = useRef(userHandler);
|
@@ -260240,95 +260226,6 @@ function readlineWidth() {
|
|
260240
260226
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
260241
260227
|
}
|
260242
260228
|
|
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
|
-
}
|
260332
260229
|
// ../../node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
260333
260230
|
var import_mute_stream = __toESM(require_lib(), 1);
|
260334
260231
|
import * as readline2 from "node:readline";
|
@@ -260708,20 +260605,6 @@ function createPrompt(view) {
|
|
260708
260605
|
};
|
260709
260606
|
return prompt;
|
260710
260607
|
}
|
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
|
-
}
|
260725
260608
|
// ../utils/dist/terminal.mjs
|
260726
260609
|
import { spawn } from "node:child_process";
|
260727
260610
|
var import_console_table_printer2 = __toESM(require_dist2(), 1);
|
@@ -265042,10 +264925,97 @@ function sanitizeName(value4, length = 35) {
|
|
265042
264925
|
}).slice(0, length).replaceAll(/(^\d*)/g, "").replaceAll(/(-$)/g, "").replaceAll(/(^-)/g, "");
|
265043
264926
|
}
|
265044
264927
|
|
265045
|
-
// ../../node_modules/@inquirer/input/
|
264928
|
+
// ../../node_modules/@inquirer/input/dist/esm/index.js
|
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";
|
265046
265015
|
var isBackspaceKey2 = (key2) => key2.name === "backspace";
|
265016
|
+
var isNumberKey = (key2) => "123456789".includes(key2.name);
|
265047
265017
|
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
265048
|
-
// ../../node_modules/@inquirer/
|
265018
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
265049
265019
|
class AbortPromptError2 extends Error {
|
265050
265020
|
name = "AbortPromptError";
|
265051
265021
|
message = "Prompt was aborted";
|
@@ -265071,10 +265041,10 @@ class HookError2 extends Error {
|
|
265071
265041
|
class ValidationError2 extends Error {
|
265072
265042
|
name = "ValidationError";
|
265073
265043
|
}
|
265074
|
-
// ../../node_modules/@inquirer/
|
265044
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265075
265045
|
import { AsyncResource as AsyncResource5 } from "node:async_hooks";
|
265076
265046
|
|
265077
|
-
// ../../node_modules/@inquirer/
|
265047
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/hook-engine.js
|
265078
265048
|
import { AsyncLocalStorage as AsyncLocalStorage2, AsyncResource as AsyncResource4 } from "node:async_hooks";
|
265079
265049
|
var hookStorage2 = new AsyncLocalStorage2;
|
265080
265050
|
function createStore2(rl) {
|
@@ -265179,7 +265149,7 @@ var effectScheduler2 = {
|
|
265179
265149
|
}
|
265180
265150
|
};
|
265181
265151
|
|
265182
|
-
// ../../node_modules/@inquirer/
|
265152
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-state.js
|
265183
265153
|
function useState2(defaultValue) {
|
265184
265154
|
return withPointer2((pointer) => {
|
265185
265155
|
const setFn = (newValue) => {
|
@@ -265197,7 +265167,7 @@ function useState2(defaultValue) {
|
|
265197
265167
|
});
|
265198
265168
|
}
|
265199
265169
|
|
265200
|
-
// ../../node_modules/@inquirer/
|
265170
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-effect.js
|
265201
265171
|
function useEffect2(cb, depArray) {
|
265202
265172
|
withPointer2((pointer) => {
|
265203
265173
|
const oldDeps = pointer.get();
|
@@ -265209,29 +265179,29 @@ function useEffect2(cb, depArray) {
|
|
265209
265179
|
});
|
265210
265180
|
}
|
265211
265181
|
|
265212
|
-
// ../../node_modules/@inquirer/
|
265213
|
-
var
|
265182
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
265183
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
265214
265184
|
var defaultTheme2 = {
|
265215
265185
|
prefix: {
|
265216
|
-
idle:
|
265217
|
-
done:
|
265186
|
+
idle: import_yoctocolors_cjs2.default.blue("?"),
|
265187
|
+
done: import_yoctocolors_cjs2.default.green(esm_default.tick)
|
265218
265188
|
},
|
265219
265189
|
spinner: {
|
265220
265190
|
interval: 80,
|
265221
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
265191
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs2.default.yellow(frame))
|
265222
265192
|
},
|
265223
265193
|
style: {
|
265224
|
-
answer:
|
265225
|
-
message:
|
265226
|
-
error: (text2) =>
|
265227
|
-
defaultAnswer: (text2) =>
|
265228
|
-
help:
|
265229
|
-
highlight:
|
265230
|
-
key: (text2) =>
|
265194
|
+
answer: import_yoctocolors_cjs2.default.cyan,
|
265195
|
+
message: import_yoctocolors_cjs2.default.bold,
|
265196
|
+
error: (text2) => import_yoctocolors_cjs2.default.red(`> ${text2}`),
|
265197
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs2.default.dim(`(${text2})`),
|
265198
|
+
help: import_yoctocolors_cjs2.default.dim,
|
265199
|
+
highlight: import_yoctocolors_cjs2.default.cyan,
|
265200
|
+
key: (text2) => import_yoctocolors_cjs2.default.cyan(import_yoctocolors_cjs2.default.bold(`<${text2}>`))
|
265231
265201
|
}
|
265232
265202
|
};
|
265233
265203
|
|
265234
|
-
// ../../node_modules/@inquirer/
|
265204
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/make-theme.js
|
265235
265205
|
function isPlainObject3(value4) {
|
265236
265206
|
if (typeof value4 !== "object" || value4 === null)
|
265237
265207
|
return false;
|
@@ -265259,7 +265229,7 @@ function makeTheme2(...themes) {
|
|
265259
265229
|
return deepMerge3(...themesToMerge);
|
265260
265230
|
}
|
265261
265231
|
|
265262
|
-
// ../../node_modules/@inquirer/
|
265232
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-prefix.js
|
265263
265233
|
function usePrefix2({ status = "idle", theme }) {
|
265264
265234
|
const [showLoader, setShowLoader] = useState2(false);
|
265265
265235
|
const [tick, setTick] = useState2(0);
|
@@ -265289,12 +265259,23 @@ function usePrefix2({ status = "idle", theme }) {
|
|
265289
265259
|
const iconName = status === "loading" ? "idle" : status;
|
265290
265260
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
265291
265261
|
}
|
265292
|
-
// ../../node_modules/@inquirer/
|
265262
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
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
|
265293
265275
|
function useRef2(val) {
|
265294
265276
|
return useState2({ current: val })[0];
|
265295
265277
|
}
|
265296
|
-
|
265297
|
-
// ../../node_modules/@inquirer/input/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
265278
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
265298
265279
|
function useKeypress2(userHandler) {
|
265299
265280
|
const signal = useRef2(userHandler);
|
265300
265281
|
signal.current = userHandler;
|
@@ -265312,7 +265293,7 @@ function useKeypress2(userHandler) {
|
|
265312
265293
|
};
|
265313
265294
|
}, []);
|
265314
265295
|
}
|
265315
|
-
// ../../node_modules/@inquirer/
|
265296
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/utils.js
|
265316
265297
|
var import_cli_width2 = __toESM(require_cli_width(), 1);
|
265317
265298
|
var import_wrap_ansi2 = __toESM(require_wrap_ansi(), 1);
|
265318
265299
|
function breakLines2(content, width) {
|
@@ -265325,12 +265306,101 @@ function readlineWidth2() {
|
|
265325
265306
|
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
265326
265307
|
}
|
265327
265308
|
|
265328
|
-
// ../../node_modules/@inquirer/
|
265309
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/pagination/lines.js
|
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
|
265329
265399
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
265330
265400
|
import * as readline4 from "node:readline";
|
265331
265401
|
import { AsyncResource as AsyncResource6 } from "node:async_hooks";
|
265332
265402
|
|
265333
|
-
// ../../node_modules/@inquirer/
|
265403
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/screen-manager.js
|
265334
265404
|
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
265335
265405
|
import { stripVTControlCharacters as stripVTControlCharacters3 } from "node:util";
|
265336
265406
|
var height2 = (content) => content.split(`
|
@@ -265400,7 +265470,7 @@ class ScreenManager2 {
|
|
265400
265470
|
}
|
265401
265471
|
}
|
265402
265472
|
|
265403
|
-
// ../../node_modules/@inquirer/
|
265473
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/promise-polyfill.js
|
265404
265474
|
class PromisePolyfill2 extends Promise {
|
265405
265475
|
static withResolver() {
|
265406
265476
|
let resolve5;
|
@@ -265413,7 +265483,7 @@ class PromisePolyfill2 extends Promise {
|
|
265413
265483
|
}
|
265414
265484
|
}
|
265415
265485
|
|
265416
|
-
// ../../node_modules/@inquirer/
|
265486
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
265417
265487
|
function getCallSites2() {
|
265418
265488
|
const _prepareStackTrace = Error.prepareStackTrace;
|
265419
265489
|
let result = [];
|
@@ -265496,90 +265566,20 @@ function createPrompt2(view) {
|
|
265496
265566
|
};
|
265497
265567
|
return prompt;
|
265498
265568
|
}
|
265499
|
-
// ../../node_modules/@inquirer/
|
265500
|
-
var
|
265501
|
-
|
265502
|
-
};
|
265503
|
-
|
265504
|
-
|
265505
|
-
|
265506
|
-
|
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;
|
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);
|
265569
|
+
// ../../node_modules/@inquirer/select/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
265570
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
265571
|
+
class Separator {
|
265572
|
+
separator = import_yoctocolors_cjs3.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
265573
|
+
type = "separator";
|
265574
|
+
constructor(separator) {
|
265575
|
+
if (separator) {
|
265576
|
+
this.separator = separator;
|
265542
265577
|
}
|
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);
|
265550
|
-
}
|
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);
|
265558
265578
|
}
|
265559
|
-
|
265560
|
-
|
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;
|
265579
|
+
static isSeparator(choice) {
|
265580
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
265574
265581
|
}
|
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);
|
265581
265582
|
}
|
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);
|
@@ -265616,19 +265616,19 @@ function normalizeChoices(choices) {
|
|
265616
265616
|
};
|
265617
265617
|
});
|
265618
265618
|
}
|
265619
|
-
var esm_default3 =
|
265619
|
+
var esm_default3 = createPrompt2((config3, done) => {
|
265620
265620
|
const { loop = true, pageSize = 7 } = config3;
|
265621
|
-
const firstRender =
|
265622
|
-
const theme =
|
265623
|
-
const [status, setStatus] =
|
265624
|
-
const prefix =
|
265625
|
-
const searchTimeoutRef =
|
265621
|
+
const firstRender = useRef2(true);
|
265622
|
+
const theme = makeTheme2(selectTheme, config3.theme);
|
265623
|
+
const [status, setStatus] = useState2("idle");
|
265624
|
+
const prefix = usePrefix2({ status, theme });
|
265625
|
+
const searchTimeoutRef = useRef2();
|
265626
265626
|
const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
|
265627
265627
|
const bounds = useMemo(() => {
|
265628
265628
|
const first = items.findIndex(isSelectable);
|
265629
265629
|
const last = items.findLastIndex(isSelectable);
|
265630
265630
|
if (first === -1) {
|
265631
|
-
throw new
|
265631
|
+
throw new ValidationError2("[select prompt] No selectable choices. All choices are disabled.");
|
265632
265632
|
}
|
265633
265633
|
return { first, last };
|
265634
265634
|
}, [items]);
|
@@ -265637,11 +265637,11 @@ var esm_default3 = createPrompt((config3, done) => {
|
|
265637
265637
|
return -1;
|
265638
265638
|
return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
|
265639
265639
|
}, [config3.default, items]);
|
265640
|
-
const [active, setActive] =
|
265640
|
+
const [active, setActive] = useState2(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
265641
265641
|
const selectedChoice = items[active];
|
265642
|
-
|
265642
|
+
useKeypress2((key3, rl) => {
|
265643
265643
|
clearTimeout(searchTimeoutRef.current);
|
265644
|
-
if (
|
265644
|
+
if (isEnterKey2(key3)) {
|
265645
265645
|
setStatus("done");
|
265646
265646
|
done(selectedChoice.value);
|
265647
265647
|
} else if (isUpKey(key3) || isDownKey(key3)) {
|
@@ -265661,7 +265661,7 @@ var esm_default3 = createPrompt((config3, done) => {
|
|
265661
265661
|
if (item != null && isSelectable(item)) {
|
265662
265662
|
setActive(position);
|
265663
265663
|
}
|
265664
|
-
} else if (
|
265664
|
+
} else if (isBackspaceKey2(key3)) {
|
265665
265665
|
rl.clearLine(0);
|
265666
265666
|
} else {
|
265667
265667
|
const searchTerm = rl.line.toLowerCase();
|
@@ -265678,7 +265678,7 @@ var esm_default3 = createPrompt((config3, done) => {
|
|
265678
265678
|
}, 700);
|
265679
265679
|
}
|
265680
265680
|
});
|
265681
|
-
|
265681
|
+
useEffect2(() => () => {
|
265682
265682
|
clearTimeout(searchTimeoutRef.current);
|
265683
265683
|
}, []);
|
265684
265684
|
const message = theme.style.message(config3.message, status);
|
@@ -273876,4 +273876,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
273876
273876
|
// src/cli.ts
|
273877
273877
|
sdkCliCommand();
|
273878
273878
|
|
273879
|
-
//# debugId=
|
273879
|
+
//# debugId=EDF103800A76066E64756E2164756E21
|