@rockcarver/frodo-cli 5.0.0-15 → 5.0.0-16
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/CHANGELOG.md +24 -0
- package/dist/{DefaultsStore-RlEkAWqT.cjs → DefaultsStore-Cb7yMNHY.cjs} +131 -3
- package/dist/DefaultsStore-Cb7yMNHY.cjs.map +1 -0
- package/dist/{EntityPickers-NlzD18p4.cjs → EntityPickers-DTtIJ6xb.cjs} +16 -5
- package/dist/EntityPickers-DTtIJ6xb.cjs.map +1 -0
- package/dist/{EscapableSelectPrompt-Qp8BKiAa.cjs → EscapableSelectPrompt-DCkRKbxL.cjs} +196 -2
- package/dist/EscapableSelectPrompt-DCkRKbxL.cjs.map +1 -0
- package/dist/{FrodoCommand-Cs3PkII9.cjs → FrodoCommand-DV3xmgo5.cjs} +28 -85
- package/dist/FrodoCommand-DV3xmgo5.cjs.map +1 -0
- package/dist/{RealmPickers-egCrSB9q.cjs → RealmPickers-CU6P0yV8.cjs} +4 -4
- package/dist/{RealmPickers-egCrSB9q.cjs.map → RealmPickers-CU6P0yV8.cjs.map} +1 -1
- package/dist/{ResolveInteractiveInputs-BZUtDvaq.cjs → ResolveInteractiveInputs-up9YUHQr.cjs} +234 -25
- package/dist/ResolveInteractiveInputs-up9YUHQr.cjs.map +1 -0
- package/dist/app.cjs +26 -21
- package/dist/app.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/DefaultsStore-RlEkAWqT.cjs.map +0 -1
- package/dist/EntityPickers-NlzD18p4.cjs.map +0 -1
- package/dist/EscapableSelectPrompt-Qp8BKiAa.cjs.map +0 -1
- package/dist/FrodoCommand-Cs3PkII9.cjs.map +0 -1
- package/dist/ResolveInteractiveInputs-BZUtDvaq.cjs.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
|
|
2
2
|
const require_Console = require("./Console-BwGVpCp2.cjs");
|
|
3
|
-
const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-
|
|
3
|
+
const require_EscapableSelectPrompt = require("./EscapableSelectPrompt-DCkRKbxL.cjs");
|
|
4
|
+
const require_ResolveInteractiveInputs = require("./ResolveInteractiveInputs-up9YUHQr.cjs");
|
|
4
5
|
const require_AuthoringPrintState = require("./AuthoringPrintState-vyWOD1Wt.cjs");
|
|
5
|
-
const require_EntityPickers = require("./EntityPickers-
|
|
6
|
-
const
|
|
6
|
+
const require_EntityPickers = require("./EntityPickers-DTtIJ6xb.cjs");
|
|
7
|
+
const require_DefaultsStore = require("./DefaultsStore-Cb7yMNHY.cjs");
|
|
7
8
|
let path = require("path");
|
|
8
9
|
path = require_rolldown_runtime.__toESM(path, 1);
|
|
9
10
|
let fs = require("fs");
|
|
@@ -4872,78 +4873,6 @@ function getActiveActionCommand() {
|
|
|
4872
4873
|
return activeActionCommand;
|
|
4873
4874
|
}
|
|
4874
4875
|
//#endregion
|
|
4875
|
-
//#region src/utils/StdinSync.ts
|
|
4876
|
-
/**
|
|
4877
|
-
* The only place in the CLI that reads fd 0 synchronously (an ESLint rule
|
|
4878
|
-
* keeps it that way, see `eslint.config.mjs`).
|
|
4879
|
-
*
|
|
4880
|
-
* Why every synchronous read of standard input needs the same care: the
|
|
4881
|
-
* first access to the `process.stdin` getter anywhere in the process -- even
|
|
4882
|
-
* just `process.stdin.isTTY`, as `canPrompt()` and the terminal background
|
|
4883
|
-
* detection do -- makes libuv switch fd 0 to non-blocking mode. A plain
|
|
4884
|
-
* `readSync(0)` then throws EAGAIN whenever no data has arrived yet: at a
|
|
4885
|
-
* prompt because the user has not typed, on a pipe because the producer is
|
|
4886
|
-
* slower than the CLI (frodo-cli#887 and its sibling,
|
|
4887
|
-
* `config-manager push raw --stdin`). So EAGAIN is not an error here, it is
|
|
4888
|
-
* "no input yet": wait a moment and ask again. Any other error is real and
|
|
4889
|
-
* propagates.
|
|
4890
|
-
*
|
|
4891
|
-
* This is safe next to a resumed `process.stdin` too: the loops below never
|
|
4892
|
-
* yield to the event loop, so libuv cannot read the data away from us.
|
|
4893
|
-
*/
|
|
4894
|
-
/** How long to wait before asking fd 0 again after EAGAIN. */
|
|
4895
|
-
const RETRY_DELAY_MS = 20;
|
|
4896
|
-
/** How much of a pipe is read per call when reading it to its end. */
|
|
4897
|
-
const PIPE_CHUNK_BYTES = 65536;
|
|
4898
|
-
/** Blocks the thread for `ms` without spinning the CPU. */
|
|
4899
|
-
function sleepSync(ms) {
|
|
4900
|
-
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
4901
|
-
}
|
|
4902
|
-
/**
|
|
4903
|
-
* One read from fd 0 that waits for input: fills `buffer` with whatever
|
|
4904
|
-
* arrives first (a typed line at a prompt, the next piece of a pipe) and
|
|
4905
|
-
* returns the number of bytes read; 0 means end of input.
|
|
4906
|
-
*
|
|
4907
|
-
* Besides returning 0, end of input can surface as an error with code `EOF`
|
|
4908
|
-
* (what Node raises for a closed pipe on Windows, and what `readline-sync`
|
|
4909
|
-
* handled the same way): it is mapped to 0 here too. That mapping is not
|
|
4910
|
-
* exercised on a real Windows console by the tests.
|
|
4911
|
-
*
|
|
4912
|
-
* @param {Buffer} buffer where the bytes are put; its length is the most that is read
|
|
4913
|
-
* @returns {number} the number of bytes read, 0 at end of input
|
|
4914
|
-
*/
|
|
4915
|
-
function readStdinChunkSync(buffer) {
|
|
4916
|
-
for (;;) try {
|
|
4917
|
-
return (0, node_fs.readSync)(0, buffer, 0, buffer.length, null);
|
|
4918
|
-
} catch (error) {
|
|
4919
|
-
const code = error.code;
|
|
4920
|
-
if (code === "EAGAIN") {
|
|
4921
|
-
sleepSync(RETRY_DELAY_MS);
|
|
4922
|
-
continue;
|
|
4923
|
-
}
|
|
4924
|
-
if (code === "EOF") return 0;
|
|
4925
|
-
throw error;
|
|
4926
|
-
}
|
|
4927
|
-
}
|
|
4928
|
-
/**
|
|
4929
|
-
* Everything on standard input up to its end, as UTF-8 text. Waits for a
|
|
4930
|
-
* slow producer (EAGAIN between chunks is normal on a pipe), and decodes
|
|
4931
|
-
* once at the end so a multi-byte character split across two chunks stays
|
|
4932
|
-
* intact.
|
|
4933
|
-
*
|
|
4934
|
-
* @returns {string} all of stdin
|
|
4935
|
-
*/
|
|
4936
|
-
function readStdinToEndSync() {
|
|
4937
|
-
const chunks = [];
|
|
4938
|
-
for (;;) {
|
|
4939
|
-
const buffer = Buffer.alloc(PIPE_CHUNK_BYTES);
|
|
4940
|
-
const bytesRead = readStdinChunkSync(buffer);
|
|
4941
|
-
if (bytesRead === 0) break;
|
|
4942
|
-
chunks.push(buffer.subarray(0, bytesRead));
|
|
4943
|
-
}
|
|
4944
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
4945
|
-
}
|
|
4946
|
-
//#endregion
|
|
4947
4876
|
//#region src/utils/Prompt.ts
|
|
4948
4877
|
/**
|
|
4949
4878
|
* Prompt the user and return the line they typed. Synchronous, because the
|
|
@@ -4963,7 +4892,7 @@ function readStdinToEndSync() {
|
|
|
4963
4892
|
function question(question) {
|
|
4964
4893
|
process.stdout.write(question);
|
|
4965
4894
|
const buffer = Buffer.alloc(1024);
|
|
4966
|
-
const bytesRead = readStdinChunkSync(buffer);
|
|
4895
|
+
const bytesRead = require_ResolveInteractiveInputs.readStdinChunkSync(buffer);
|
|
4967
4896
|
return buffer.subarray(0, bytesRead).toString("utf8").replace(/\r?\n$/, "");
|
|
4968
4897
|
}
|
|
4969
4898
|
//#endregion
|
|
@@ -5094,7 +5023,7 @@ async function getTokens(forceLoginAsUser = false, autoRefresh = true, types = D
|
|
|
5094
5023
|
require_Console.verboseMessage(`Connected to ${require_Console.state.getHost()} [${require_Console.state.getRealm() ? require_Console.state.getRealm() : "root"}] as ${tokens.subject}`);
|
|
5095
5024
|
if (require_Console.state.getActiveCredentialSource() === "browser") require_Console.printMessage(browserLoginPrompted ? `Logged in as ${tokens.subject}` : `Using the saved browser login of ${tokens.subject}`, "info");
|
|
5096
5025
|
if (require_EscapableSelectPrompt.canPrompt()) {
|
|
5097
|
-
const { resolveRealmPick } = await Promise.resolve().then(() => require("./RealmPickers-
|
|
5026
|
+
const { resolveRealmPick } = await Promise.resolve().then(() => require("./RealmPickers-CU6P0yV8.cjs")).then((n) => n.RealmPickers_exports);
|
|
5098
5027
|
await resolveRealmPick(getActiveActionCommand());
|
|
5099
5028
|
}
|
|
5100
5029
|
{
|
|
@@ -5103,7 +5032,7 @@ async function getTokens(forceLoginAsUser = false, autoRefresh = true, types = D
|
|
|
5103
5032
|
const activeCommand = getActiveActionCommand();
|
|
5104
5033
|
if (!await (async () => {
|
|
5105
5034
|
if (!activeCommand) return false;
|
|
5106
|
-
const { getEntityPicks } = await Promise.resolve().then(() => require("./EntityPickers-
|
|
5035
|
+
const { getEntityPicks } = await Promise.resolve().then(() => require("./EntityPickers-DTtIJ6xb.cjs")).then((n) => n.EntityPickers_exports);
|
|
5107
5036
|
return getEntityPicks(activeCommand).some((pick) => !activeCommand.getOptionValue(pick.name));
|
|
5108
5037
|
})()) flushAuthoringPrint();
|
|
5109
5038
|
}
|
|
@@ -12425,6 +12354,7 @@ var FrodoCommand_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll(
|
|
|
12425
12354
|
ListOption: () => ListOption,
|
|
12426
12355
|
ObjectOption: () => ObjectOption,
|
|
12427
12356
|
STEP_BACK_FROM_ACTION: () => STEP_BACK_FROM_ACTION,
|
|
12357
|
+
SecretOption: () => SecretOption,
|
|
12428
12358
|
formatGlobalEnvironmentVariables: () => formatGlobalEnvironmentVariables,
|
|
12429
12359
|
hostArgument: () => hostArgument,
|
|
12430
12360
|
isFullHelpRequested: () => isFullHelpRequested,
|
|
@@ -12707,6 +12637,19 @@ var ListOption = class extends Option {
|
|
|
12707
12637
|
}
|
|
12708
12638
|
};
|
|
12709
12639
|
/**
|
|
12640
|
+
* Option whose value is a secret and that may be given without one: bare, it
|
|
12641
|
+
* is asked for with the input hidden, or read from stdin when input is piped.
|
|
12642
|
+
* Declare it with an optional value (`--password [password]`). See
|
|
12643
|
+
* src/utils/interactive/SecretOptions.ts for what the marker does.
|
|
12644
|
+
*/
|
|
12645
|
+
var SecretOption = class extends Option {
|
|
12646
|
+
constructor(flags, description) {
|
|
12647
|
+
super(flags, description ? `${description} ${require_DefaultsStore.SECRET_OPTION_HELP}` : require_DefaultsStore.SECRET_OPTION_HELP);
|
|
12648
|
+
if (!/\[[^\]]+\]/.test(flags)) throw new Error(`SecretOption ${flags} needs an optional value ([value]): a bare flag is how the user asks to be prompted.`);
|
|
12649
|
+
require_DefaultsStore.markSecret(this);
|
|
12650
|
+
}
|
|
12651
|
+
};
|
|
12652
|
+
/**
|
|
12710
12653
|
* Option that collects repeated values into an object using dot notation
|
|
12711
12654
|
*/
|
|
12712
12655
|
var ObjectOption = class extends Option {
|
|
@@ -14537,6 +14480,12 @@ Object.defineProperty(exports, "STEP_BACK_FROM_ACTION", {
|
|
|
14537
14480
|
return STEP_BACK_FROM_ACTION;
|
|
14538
14481
|
}
|
|
14539
14482
|
});
|
|
14483
|
+
Object.defineProperty(exports, "SecretOption", {
|
|
14484
|
+
enumerable: true,
|
|
14485
|
+
get: function() {
|
|
14486
|
+
return SecretOption;
|
|
14487
|
+
}
|
|
14488
|
+
});
|
|
14540
14489
|
Object.defineProperty(exports, "activatePersistedTheme", {
|
|
14541
14490
|
enumerable: true,
|
|
14542
14491
|
get: function() {
|
|
@@ -15455,12 +15404,6 @@ Object.defineProperty(exports, "publishWorkflow", {
|
|
|
15455
15404
|
return publishWorkflow;
|
|
15456
15405
|
}
|
|
15457
15406
|
});
|
|
15458
|
-
Object.defineProperty(exports, "readStdinToEndSync", {
|
|
15459
|
-
enumerable: true,
|
|
15460
|
-
get: function() {
|
|
15461
|
-
return readStdinToEndSync;
|
|
15462
|
-
}
|
|
15463
|
-
});
|
|
15464
15407
|
Object.defineProperty(exports, "renameMapping", {
|
|
15465
15408
|
enumerable: true,
|
|
15466
15409
|
get: function() {
|
|
@@ -15570,4 +15513,4 @@ Object.defineProperty(exports, "writeSyncJsonToDirectory", {
|
|
|
15570
15513
|
}
|
|
15571
15514
|
});
|
|
15572
15515
|
|
|
15573
|
-
//# sourceMappingURL=FrodoCommand-
|
|
15516
|
+
//# sourceMappingURL=FrodoCommand-DV3xmgo5.cjs.map
|