@settlemint/sdk-cli 2.6.2-pr03ff968b → 2.6.2-pr09addbf0
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 +142 -142
- package/dist/cli.js.map +7 -7
- package/package.json +7 -7
package/dist/cli.js
CHANGED
@@ -161542,7 +161542,7 @@ ${lanes.join(`
|
|
161542
161542
|
function generateOptionOutput(sys2, option, rightAlignOfLeft, leftAlignOfRight) {
|
161543
161543
|
var _a;
|
161544
161544
|
const text = [];
|
161545
|
-
const
|
161545
|
+
const colors3 = createColors(sys2);
|
161546
161546
|
const name2 = getDisplayNameTextOfOption(option);
|
161547
161547
|
const valueCandidates = getValueCandidate(option);
|
161548
161548
|
const defaultValueDescription = typeof option.defaultValueDescription === "object" ? getDiagnosticText(option.defaultValueDescription) : formatDefaultValue(option.defaultValueDescription, option.type === "list" || option.type === "listOrElement" ? option.element.type : option.type);
|
@@ -161563,7 +161563,7 @@ ${lanes.join(`
|
|
161563
161563
|
}
|
161564
161564
|
text.push(sys2.newLine);
|
161565
161565
|
} else {
|
161566
|
-
text.push(
|
161566
|
+
text.push(colors3.blue(name2), sys2.newLine);
|
161567
161567
|
if (option.description) {
|
161568
161568
|
const description3 = getDiagnosticText(option.description);
|
161569
161569
|
text.push(description3);
|
@@ -161608,7 +161608,7 @@ ${lanes.join(`
|
|
161608
161608
|
if (isFirstLine) {
|
161609
161609
|
curLeft = left.padStart(rightAlignOfLeft2);
|
161610
161610
|
curLeft = curLeft.padEnd(leftAlignOfRight2);
|
161611
|
-
curLeft = colorLeft ?
|
161611
|
+
curLeft = colorLeft ? colors3.blue(curLeft) : curLeft;
|
161612
161612
|
} else {
|
161613
161613
|
curLeft = "".padStart(leftAlignOfRight2);
|
161614
161614
|
}
|
@@ -161720,9 +161720,9 @@ ${lanes.join(`
|
|
161720
161720
|
return res;
|
161721
161721
|
}
|
161722
161722
|
function printEasyHelp(sys2, simpleOptions) {
|
161723
|
-
const
|
161723
|
+
const colors3 = createColors(sys2);
|
161724
161724
|
let output = [...getHeader(sys2, `${getDiagnosticText(Diagnostics.tsc_Colon_The_TypeScript_Compiler)} - ${getDiagnosticText(Diagnostics.Version_0, version2)}`)];
|
161725
|
-
output.push(
|
161725
|
+
output.push(colors3.bold(getDiagnosticText(Diagnostics.COMMON_COMMANDS)) + sys2.newLine + sys2.newLine);
|
161726
161726
|
example("tsc", Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
161727
161727
|
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
161728
161728
|
example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
|
@@ -161743,7 +161743,7 @@ ${lanes.join(`
|
|
161743
161743
|
function example(ex, desc) {
|
161744
161744
|
const examples = typeof ex === "string" ? [ex] : ex;
|
161745
161745
|
for (const example2 of examples) {
|
161746
|
-
output.push(" " +
|
161746
|
+
output.push(" " + colors3.blue(example2) + sys2.newLine);
|
161747
161747
|
}
|
161748
161748
|
output.push(" " + getDiagnosticText(desc) + sys2.newLine + sys2.newLine);
|
161749
161749
|
}
|
@@ -161766,12 +161766,12 @@ ${lanes.join(`
|
|
161766
161766
|
}
|
161767
161767
|
function getHeader(sys2, message) {
|
161768
161768
|
var _a;
|
161769
|
-
const
|
161769
|
+
const colors3 = createColors(sys2);
|
161770
161770
|
const header = [];
|
161771
161771
|
const terminalWidth = ((_a = sys2.getWidthOfTerminal) == null ? undefined : _a.call(sys2)) ?? 0;
|
161772
161772
|
const tsIconLength = 5;
|
161773
|
-
const tsIconFirstLine =
|
161774
|
-
const tsIconSecondLine =
|
161773
|
+
const tsIconFirstLine = colors3.blueBackground("".padStart(tsIconLength));
|
161774
|
+
const tsIconSecondLine = colors3.blueBackground(colors3.brightWhite("TS ".padStart(tsIconLength)));
|
161775
161775
|
if (terminalWidth >= message.length + tsIconLength) {
|
161776
161776
|
const rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
|
161777
161777
|
const leftAlign = rightAlign - tsIconLength;
|
@@ -247511,7 +247511,11 @@ var {
|
|
247511
247511
|
} = import__.default;
|
247512
247512
|
|
247513
247513
|
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/key.js
|
247514
|
+
var isUpKey = (key) => key.name === "up";
|
247515
|
+
var isDownKey = (key) => key.name === "down";
|
247516
|
+
var isBackspaceKey = (key) => key.name === "backspace";
|
247514
247517
|
var isTabKey = (key) => key.name === "tab";
|
247518
|
+
var isNumberKey = (key) => "1234567890".includes(key.name);
|
247515
247519
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
247516
247520
|
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
247517
247521
|
class AbortPromptError extends Error {
|
@@ -248045,11 +248049,22 @@ function usePrefix({ status = "idle", theme }) {
|
|
248045
248049
|
const iconName = status === "loading" ? "idle" : status;
|
248046
248050
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
248047
248051
|
}
|
248052
|
+
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
248053
|
+
function useMemo(fn, dependencies) {
|
248054
|
+
return withPointer((pointer) => {
|
248055
|
+
const prev = pointer.get();
|
248056
|
+
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
248057
|
+
const value = fn();
|
248058
|
+
pointer.set({ value, dependencies });
|
248059
|
+
return value;
|
248060
|
+
}
|
248061
|
+
return prev.value;
|
248062
|
+
});
|
248063
|
+
}
|
248048
248064
|
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
248049
248065
|
function useRef(val) {
|
248050
248066
|
return useState({ current: val })[0];
|
248051
248067
|
}
|
248052
|
-
|
248053
248068
|
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
248054
248069
|
function useKeypress(userHandler) {
|
248055
248070
|
const signal = useRef(userHandler);
|
@@ -248081,6 +248096,72 @@ function readlineWidth() {
|
|
248081
248096
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
248082
248097
|
}
|
248083
248098
|
|
248099
|
+
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
248100
|
+
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
248101
|
+
const state = useRef({
|
248102
|
+
lastPointer: active,
|
248103
|
+
lastActive: undefined
|
248104
|
+
});
|
248105
|
+
const { lastPointer, lastActive } = state.current;
|
248106
|
+
const middle = Math.floor(pageSize / 2);
|
248107
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
248108
|
+
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
248109
|
+
let pointer = defaultPointerPosition;
|
248110
|
+
if (renderedLength > pageSize) {
|
248111
|
+
if (loop) {
|
248112
|
+
pointer = lastPointer;
|
248113
|
+
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
248114
|
+
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
248115
|
+
}
|
248116
|
+
} else {
|
248117
|
+
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
248118
|
+
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
248119
|
+
}
|
248120
|
+
}
|
248121
|
+
state.current.lastPointer = pointer;
|
248122
|
+
state.current.lastActive = active;
|
248123
|
+
return pointer;
|
248124
|
+
}
|
248125
|
+
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
248126
|
+
const width = readlineWidth();
|
248127
|
+
const bound = (num) => (num % items.length + items.length) % items.length;
|
248128
|
+
const renderedItems = items.map((item, index) => {
|
248129
|
+
if (item == null)
|
248130
|
+
return [];
|
248131
|
+
return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
|
248132
|
+
`);
|
248133
|
+
});
|
248134
|
+
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
248135
|
+
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
248136
|
+
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
248137
|
+
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
248138
|
+
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
248139
|
+
const pageBuffer = Array.from({ length: pageSize });
|
248140
|
+
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
248141
|
+
const itemVisited = new Set([active]);
|
248142
|
+
let bufferPointer = activeItemPosition + activeItem.length;
|
248143
|
+
let itemPointer = bound(active + 1);
|
248144
|
+
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
248145
|
+
const lines = renderItemAtIndex(itemPointer);
|
248146
|
+
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
248147
|
+
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
248148
|
+
itemVisited.add(itemPointer);
|
248149
|
+
bufferPointer += linesToAdd.length;
|
248150
|
+
itemPointer = bound(itemPointer + 1);
|
248151
|
+
}
|
248152
|
+
bufferPointer = activeItemPosition - 1;
|
248153
|
+
itemPointer = bound(active - 1);
|
248154
|
+
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
248155
|
+
const lines = renderItemAtIndex(itemPointer);
|
248156
|
+
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
248157
|
+
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
248158
|
+
itemVisited.add(itemPointer);
|
248159
|
+
bufferPointer -= linesToAdd.length;
|
248160
|
+
itemPointer = bound(itemPointer - 1);
|
248161
|
+
}
|
248162
|
+
return pageBuffer.filter((line) => typeof line === "string").join(`
|
248163
|
+
`);
|
248164
|
+
}
|
248084
248165
|
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
248085
248166
|
var import_mute_stream = __toESM(require_lib(), 1);
|
248086
248167
|
import * as readline2 from "node:readline";
|
@@ -248477,6 +248558,20 @@ function createPrompt(view) {
|
|
248477
248558
|
};
|
248478
248559
|
return prompt;
|
248479
248560
|
}
|
248561
|
+
// ../../node_modules/.bun/@inquirer+core@10.2.2+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
248562
|
+
var import_yoctocolors_cjs2 = __toESM(require_yoctocolors_cjs(), 1);
|
248563
|
+
class Separator {
|
248564
|
+
separator = import_yoctocolors_cjs2.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
248565
|
+
type = "separator";
|
248566
|
+
constructor(separator) {
|
248567
|
+
if (separator) {
|
248568
|
+
this.separator = separator;
|
248569
|
+
}
|
248570
|
+
}
|
248571
|
+
static isSeparator(choice) {
|
248572
|
+
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
248573
|
+
}
|
248574
|
+
}
|
248480
248575
|
// ../../node_modules/.bun/yoctocolors@2.1.2/node_modules/yoctocolors/base.js
|
248481
248576
|
var exports_base = {};
|
248482
248577
|
__export(exports_base, {
|
@@ -267134,7 +267229,7 @@ function pruneCurrentEnv(currentEnv, env2) {
|
|
267134
267229
|
var package_default = {
|
267135
267230
|
name: "@settlemint/sdk-cli",
|
267136
267231
|
description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
|
267137
|
-
version: "2.6.2-
|
267232
|
+
version: "2.6.2-pr09addbf0",
|
267138
267233
|
type: "module",
|
267139
267234
|
private: false,
|
267140
267235
|
license: "FSL-1.1-MIT",
|
@@ -267187,11 +267282,11 @@ var package_default = {
|
|
267187
267282
|
"@inquirer/confirm": "5.1.18",
|
267188
267283
|
"@inquirer/input": "4.2.2",
|
267189
267284
|
"@inquirer/password": "4.0.18",
|
267190
|
-
"@inquirer/select": "4.3.
|
267191
|
-
"@settlemint/sdk-hasura": "2.6.2-
|
267192
|
-
"@settlemint/sdk-js": "2.6.2-
|
267193
|
-
"@settlemint/sdk-utils": "2.6.2-
|
267194
|
-
"@settlemint/sdk-viem": "2.6.2-
|
267285
|
+
"@inquirer/select": "4.3.4",
|
267286
|
+
"@settlemint/sdk-hasura": "2.6.2-pr09addbf0",
|
267287
|
+
"@settlemint/sdk-js": "2.6.2-pr09addbf0",
|
267288
|
+
"@settlemint/sdk-utils": "2.6.2-pr09addbf0",
|
267289
|
+
"@settlemint/sdk-viem": "2.6.2-pr09addbf0",
|
267195
267290
|
"@types/node": "24.4.0",
|
267196
267291
|
"@types/semver": "7.7.1",
|
267197
267292
|
"@types/which": "3.0.4",
|
@@ -267208,7 +267303,7 @@ var package_default = {
|
|
267208
267303
|
},
|
267209
267304
|
peerDependencies: {
|
267210
267305
|
hardhat: "<= 4",
|
267211
|
-
"@settlemint/sdk-js": "2.6.2-
|
267306
|
+
"@settlemint/sdk-js": "2.6.2-pr09addbf0"
|
267212
267307
|
},
|
267213
267308
|
peerDependenciesMeta: {
|
267214
267309
|
hardhat: {
|
@@ -273027,11 +273122,8 @@ function sanitizeName(value5, length = 35) {
|
|
273027
273122
|
}
|
273028
273123
|
|
273029
273124
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/key.js
|
273030
|
-
var
|
273031
|
-
var isDownKey = (key2) => key2.name === "down";
|
273032
|
-
var isBackspaceKey = (key2) => key2.name === "backspace";
|
273125
|
+
var isBackspaceKey2 = (key2) => key2.name === "backspace";
|
273033
273126
|
var isTabKey2 = (key2) => key2.name === "tab";
|
273034
|
-
var isNumberKey = (key2) => "1234567890".includes(key2.name);
|
273035
273127
|
var isEnterKey2 = (key2) => key2.name === "enter" || key2.name === "return";
|
273036
273128
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/errors.js
|
273037
273129
|
class AbortPromptError2 extends Error {
|
@@ -273198,24 +273290,24 @@ function useEffect2(cb, depArray) {
|
|
273198
273290
|
}
|
273199
273291
|
|
273200
273292
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/theme.js
|
273201
|
-
var
|
273293
|
+
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
273202
273294
|
var defaultTheme2 = {
|
273203
273295
|
prefix: {
|
273204
|
-
idle:
|
273205
|
-
done:
|
273296
|
+
idle: import_yoctocolors_cjs3.default.blue("?"),
|
273297
|
+
done: import_yoctocolors_cjs3.default.green(esm_default.tick)
|
273206
273298
|
},
|
273207
273299
|
spinner: {
|
273208
273300
|
interval: 80,
|
273209
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
273301
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => import_yoctocolors_cjs3.default.yellow(frame))
|
273210
273302
|
},
|
273211
273303
|
style: {
|
273212
|
-
answer:
|
273213
|
-
message:
|
273214
|
-
error: (text2) =>
|
273215
|
-
defaultAnswer: (text2) =>
|
273216
|
-
help:
|
273217
|
-
highlight:
|
273218
|
-
key: (text2) =>
|
273304
|
+
answer: import_yoctocolors_cjs3.default.cyan,
|
273305
|
+
message: import_yoctocolors_cjs3.default.bold,
|
273306
|
+
error: (text2) => import_yoctocolors_cjs3.default.red(`> ${text2}`),
|
273307
|
+
defaultAnswer: (text2) => import_yoctocolors_cjs3.default.dim(`(${text2})`),
|
273308
|
+
help: import_yoctocolors_cjs3.default.dim,
|
273309
|
+
highlight: import_yoctocolors_cjs3.default.cyan,
|
273310
|
+
key: (text2) => import_yoctocolors_cjs3.default.cyan(import_yoctocolors_cjs3.default.bold(`<${text2}>`))
|
273219
273311
|
}
|
273220
273312
|
};
|
273221
273313
|
|
@@ -273277,22 +273369,11 @@ function usePrefix2({ status = "idle", theme }) {
|
|
273277
273369
|
const iconName = status === "loading" ? "idle" : status;
|
273278
273370
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
273279
273371
|
}
|
273280
|
-
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-memo.js
|
273281
|
-
function useMemo(fn, dependencies) {
|
273282
|
-
return withPointer2((pointer) => {
|
273283
|
-
const prev = pointer.get();
|
273284
|
-
if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i7) => dep !== dependencies[i7])) {
|
273285
|
-
const value5 = fn();
|
273286
|
-
pointer.set({ value: value5, dependencies });
|
273287
|
-
return value5;
|
273288
|
-
}
|
273289
|
-
return prev.value;
|
273290
|
-
});
|
273291
|
-
}
|
273292
273372
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-ref.js
|
273293
273373
|
function useRef2(val) {
|
273294
273374
|
return useState2({ current: val })[0];
|
273295
273375
|
}
|
273376
|
+
|
273296
273377
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/use-keypress.js
|
273297
273378
|
function useKeypress2(userHandler) {
|
273298
273379
|
const signal = useRef2(userHandler);
|
@@ -273324,72 +273405,6 @@ function readlineWidth2() {
|
|
273324
273405
|
return import_cli_width2.default({ defaultWidth: 80, output: readline3().output });
|
273325
273406
|
}
|
273326
273407
|
|
273327
|
-
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/pagination/use-pagination.js
|
273328
|
-
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
273329
|
-
const state = useRef2({
|
273330
|
-
lastPointer: active,
|
273331
|
-
lastActive: undefined
|
273332
|
-
});
|
273333
|
-
const { lastPointer, lastActive } = state.current;
|
273334
|
-
const middle = Math.floor(pageSize / 2);
|
273335
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
273336
|
-
const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
|
273337
|
-
let pointer = defaultPointerPosition;
|
273338
|
-
if (renderedLength > pageSize) {
|
273339
|
-
if (loop) {
|
273340
|
-
pointer = lastPointer;
|
273341
|
-
if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
|
273342
|
-
pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
|
273343
|
-
}
|
273344
|
-
} else {
|
273345
|
-
const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
|
273346
|
-
pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
|
273347
|
-
}
|
273348
|
-
}
|
273349
|
-
state.current.lastPointer = pointer;
|
273350
|
-
state.current.lastActive = active;
|
273351
|
-
return pointer;
|
273352
|
-
}
|
273353
|
-
function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
273354
|
-
const width = readlineWidth2();
|
273355
|
-
const bound = (num) => (num % items.length + items.length) % items.length;
|
273356
|
-
const renderedItems = items.map((item, index) => {
|
273357
|
-
if (item == null)
|
273358
|
-
return [];
|
273359
|
-
return breakLines2(renderItem({ item, index, isActive: index === active }), width).split(`
|
273360
|
-
`);
|
273361
|
-
});
|
273362
|
-
const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
|
273363
|
-
const renderItemAtIndex = (index) => renderedItems[index] ?? [];
|
273364
|
-
const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
|
273365
|
-
const activeItem = renderItemAtIndex(active).slice(0, pageSize);
|
273366
|
-
const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
|
273367
|
-
const pageBuffer = Array.from({ length: pageSize });
|
273368
|
-
pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
|
273369
|
-
const itemVisited = new Set([active]);
|
273370
|
-
let bufferPointer = activeItemPosition + activeItem.length;
|
273371
|
-
let itemPointer = bound(active + 1);
|
273372
|
-
while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
|
273373
|
-
const lines = renderItemAtIndex(itemPointer);
|
273374
|
-
const linesToAdd = lines.slice(0, pageSize - bufferPointer);
|
273375
|
-
pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
|
273376
|
-
itemVisited.add(itemPointer);
|
273377
|
-
bufferPointer += linesToAdd.length;
|
273378
|
-
itemPointer = bound(itemPointer + 1);
|
273379
|
-
}
|
273380
|
-
bufferPointer = activeItemPosition - 1;
|
273381
|
-
itemPointer = bound(active - 1);
|
273382
|
-
while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
|
273383
|
-
const lines = renderItemAtIndex(itemPointer);
|
273384
|
-
const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
|
273385
|
-
pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
|
273386
|
-
itemVisited.add(itemPointer);
|
273387
|
-
bufferPointer -= linesToAdd.length;
|
273388
|
-
itemPointer = bound(itemPointer - 1);
|
273389
|
-
}
|
273390
|
-
return pageBuffer.filter((line) => typeof line === "string").join(`
|
273391
|
-
`);
|
273392
|
-
}
|
273393
273408
|
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
|
273394
273409
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
273395
273410
|
import * as readline4 from "node:readline";
|
@@ -273564,20 +273579,6 @@ function createPrompt2(view) {
|
|
273564
273579
|
};
|
273565
273580
|
return prompt;
|
273566
273581
|
}
|
273567
|
-
// ../../node_modules/.bun/@inquirer+core@10.2.0+e9dc26b4af2fda18/node_modules/@inquirer/core/dist/esm/lib/Separator.js
|
273568
|
-
var import_yoctocolors_cjs3 = __toESM(require_yoctocolors_cjs(), 1);
|
273569
|
-
class Separator {
|
273570
|
-
separator = import_yoctocolors_cjs3.default.dim(Array.from({ length: 15 }).join(esm_default.line));
|
273571
|
-
type = "separator";
|
273572
|
-
constructor(separator) {
|
273573
|
-
if (separator) {
|
273574
|
-
this.separator = separator;
|
273575
|
-
}
|
273576
|
-
}
|
273577
|
-
static isSeparator(choice) {
|
273578
|
-
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
273579
|
-
}
|
273580
|
-
}
|
273581
273582
|
// ../../node_modules/.bun/@inquirer+input@4.2.2+e9dc26b4af2fda18/node_modules/@inquirer/input/dist/esm/index.js
|
273582
273583
|
var inputTheme = {
|
273583
273584
|
validationFailureMode: "keep"
|
@@ -273611,7 +273612,7 @@ var esm_default2 = createPrompt2((config3, done) => {
|
|
273611
273612
|
setError(isValid || "You must provide a valid value");
|
273612
273613
|
setStatus("idle");
|
273613
273614
|
}
|
273614
|
-
} else if (
|
273615
|
+
} else if (isBackspaceKey2(key3) && !value5) {
|
273615
273616
|
setDefaultValue(undefined);
|
273616
273617
|
} else if (isTabKey2(key3) && !value5) {
|
273617
273618
|
setDefaultValue(undefined);
|
@@ -273668,9 +273669,8 @@ async function subgraphNamePrompt({
|
|
273668
273669
|
return sanitizeName(subgraphName);
|
273669
273670
|
}
|
273670
273671
|
|
273671
|
-
// ../../node_modules/.bun/@inquirer+select@4.3.
|
273672
|
+
// ../../node_modules/.bun/@inquirer+select@4.3.4+e9dc26b4af2fda18/node_modules/@inquirer/select/dist/esm/index.js
|
273672
273673
|
var import_yoctocolors_cjs4 = __toESM(require_yoctocolors_cjs(), 1);
|
273673
|
-
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
273674
273674
|
var selectTheme = {
|
273675
273675
|
icon: { cursor: esm_default.pointer },
|
273676
273676
|
style: {
|
@@ -273708,19 +273708,19 @@ function normalizeChoices(choices) {
|
|
273708
273708
|
return normalizedChoice;
|
273709
273709
|
});
|
273710
273710
|
}
|
273711
|
-
var esm_default3 =
|
273711
|
+
var esm_default3 = createPrompt((config3, done) => {
|
273712
273712
|
const { loop = true, pageSize = 7 } = config3;
|
273713
|
-
const firstRender =
|
273714
|
-
const theme =
|
273715
|
-
const [status, setStatus] =
|
273716
|
-
const prefix =
|
273717
|
-
const searchTimeoutRef =
|
273713
|
+
const firstRender = useRef(true);
|
273714
|
+
const theme = makeTheme(selectTheme, config3.theme);
|
273715
|
+
const [status, setStatus] = useState("idle");
|
273716
|
+
const prefix = usePrefix({ status, theme });
|
273717
|
+
const searchTimeoutRef = useRef();
|
273718
273718
|
const items = useMemo(() => normalizeChoices(config3.choices), [config3.choices]);
|
273719
273719
|
const bounds = useMemo(() => {
|
273720
273720
|
const first = items.findIndex(isSelectable);
|
273721
273721
|
const last = items.findLastIndex(isSelectable);
|
273722
273722
|
if (first === -1) {
|
273723
|
-
throw new
|
273723
|
+
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
273724
273724
|
}
|
273725
273725
|
return { first, last };
|
273726
273726
|
}, [items]);
|
@@ -273729,11 +273729,11 @@ var esm_default3 = createPrompt2((config3, done) => {
|
|
273729
273729
|
return -1;
|
273730
273730
|
return items.findIndex((item) => isSelectable(item) && item.value === config3.default);
|
273731
273731
|
}, [config3.default, items]);
|
273732
|
-
const [active, setActive] =
|
273732
|
+
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
273733
273733
|
const selectedChoice = items[active];
|
273734
|
-
|
273734
|
+
useKeypress((key3, rl) => {
|
273735
273735
|
clearTimeout(searchTimeoutRef.current);
|
273736
|
-
if (
|
273736
|
+
if (isEnterKey(key3)) {
|
273737
273737
|
setStatus("done");
|
273738
273738
|
done(selectedChoice.value);
|
273739
273739
|
} else if (isUpKey(key3) || isDownKey(key3)) {
|
@@ -273779,7 +273779,7 @@ var esm_default3 = createPrompt2((config3, done) => {
|
|
273779
273779
|
}, 700);
|
273780
273780
|
}
|
273781
273781
|
});
|
273782
|
-
|
273782
|
+
useEffect(() => () => {
|
273783
273783
|
clearTimeout(searchTimeoutRef.current);
|
273784
273784
|
}, []);
|
273785
273785
|
const message = theme.style.message(config3.message, status);
|
@@ -273821,7 +273821,7 @@ ${theme.style.help(`(${config3.instructions?.pager ?? "Use arrow keys to reveal
|
|
273821
273821
|
const choiceDescription = selectedChoice.description ? `
|
273822
273822
|
${theme.style.description(selectedChoice.description)}` : ``;
|
273823
273823
|
return `${[prefix, message, helpTipTop].filter(Boolean).join(" ")}
|
273824
|
-
${page}${helpTipBottom}${choiceDescription}${
|
273824
|
+
${page}${helpTipBottom}${choiceDescription}${cursorHide}`;
|
273825
273825
|
});
|
273826
273826
|
|
273827
273827
|
// src/prompts/smart-contract-set/subgraph.prompt.ts
|
@@ -299454,7 +299454,7 @@ var esm_default4 = createPrompt((config3, done) => {
|
|
299454
299454
|
});
|
299455
299455
|
|
299456
299456
|
// ../../node_modules/.bun/@inquirer+password@4.0.18+e9dc26b4af2fda18/node_modules/@inquirer/password/dist/esm/index.js
|
299457
|
-
var
|
299457
|
+
var import_ansi_escapes2 = __toESM(require_ansi_escapes(), 1);
|
299458
299458
|
var esm_default5 = createPrompt2((config3, done) => {
|
299459
299459
|
const { validate: validate8 = () => true } = config3;
|
299460
299460
|
const theme = makeTheme2(config3.theme);
|
@@ -299491,7 +299491,7 @@ var esm_default5 = createPrompt2((config3, done) => {
|
|
299491
299491
|
const maskChar = typeof config3.mask === "string" ? config3.mask : "*";
|
299492
299492
|
formattedValue = maskChar.repeat(value5.length);
|
299493
299493
|
} else if (status !== "done") {
|
299494
|
-
helpTip = `${theme.style.help("[input is masked]")}${
|
299494
|
+
helpTip = `${theme.style.help("[input is masked]")}${import_ansi_escapes2.default.cursorHide}`;
|
299495
299495
|
}
|
299496
299496
|
if (status === "done") {
|
299497
299497
|
formattedValue = theme.style.answer(formattedValue);
|
@@ -309064,4 +309064,4 @@ async function sdkCliCommand(argv = process.argv) {
|
|
309064
309064
|
// src/cli.ts
|
309065
309065
|
sdkCliCommand();
|
309066
309066
|
|
309067
|
-
//# debugId=
|
309067
|
+
//# debugId=43EC4F8086B3DBBE64756E2164756E21
|