@xyo-network/xl1-cli-lib 1.7.11 → 1.7.13
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/README.md +1 -1
- package/dist/node/index.mjs +32 -6
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/orchestration/services/implementation/account.d.ts.map +1 -1
- package/dist/node/runCLI.d.ts.map +1 -1
- package/dist/node/tryParseConfig.d.ts +6 -0
- package/dist/node/tryParseConfig.d.ts.map +1 -0
- package/dist/node/xl1.mjs +32 -6
- package/dist/node/xl1.mjs.map +1 -1
- package/package.json +35 -33
- package/src/orchestration/services/implementation/account.ts +5 -1
- package/src/runCLI.ts +18 -4
- package/src/tryParseConfig.ts +41 -0
- package/dist/node/initConfig.d.ts +0 -3
- package/dist/node/initConfig.d.ts.map +0 -1
- package/src/initConfig.ts +0 -6
package/README.md
CHANGED
package/dist/node/index.mjs
CHANGED
|
@@ -929,7 +929,11 @@ var initAccount = /* @__PURE__ */ __name(async ({ config: config3, logger }) =>
|
|
|
929
929
|
if (isUndefined3(walletPhrase)) {
|
|
930
930
|
logger?.warn("[Producer] No wallet mnemonic specified!");
|
|
931
931
|
const randomMnemonic = HDWallet.generateMnemonic();
|
|
932
|
-
logger?.warn(`[Producer] Using randomly generated mnemonic:
|
|
932
|
+
logger?.warn(`[Producer] Using randomly generated mnemonic:
|
|
933
|
+
|
|
934
|
+
${randomMnemonic}
|
|
935
|
+
|
|
936
|
+
`);
|
|
933
937
|
walletPhrase = randomMnemonic;
|
|
934
938
|
}
|
|
935
939
|
const wallet = await generateXyoBaseWalletFromPhrase(walletPhrase);
|
|
@@ -1447,7 +1451,8 @@ var initServices = /* @__PURE__ */ __name(async (context) => {
|
|
|
1447
1451
|
}, "initServices");
|
|
1448
1452
|
|
|
1449
1453
|
// src/runCLI.ts
|
|
1450
|
-
import {
|
|
1454
|
+
import { deepMerge } from "@xylabs/object";
|
|
1455
|
+
import { isDefined as isDefined13 } from "@xylabs/typeof";
|
|
1451
1456
|
import { ConfigSchema } from "@xyo-network/xl1-protocol-sdk";
|
|
1452
1457
|
import yargs from "yargs";
|
|
1453
1458
|
import { hideBin } from "yargs/helpers";
|
|
@@ -1573,6 +1578,23 @@ var optionsFromZodSchema = /* @__PURE__ */ __name((schema) => {
|
|
|
1573
1578
|
return opts;
|
|
1574
1579
|
}, "optionsFromZodSchema");
|
|
1575
1580
|
|
|
1581
|
+
// src/tryParseConfig.ts
|
|
1582
|
+
import { isDefined as isDefined12, isNull } from "@xylabs/typeof";
|
|
1583
|
+
import { cosmiconfigSync } from "cosmiconfig";
|
|
1584
|
+
var configName = "xyo";
|
|
1585
|
+
var configSection = "xl1";
|
|
1586
|
+
var tryParseConfig = /* @__PURE__ */ __name(() => {
|
|
1587
|
+
const explorer = cosmiconfigSync(configName);
|
|
1588
|
+
const result = explorer.search();
|
|
1589
|
+
if (!isNull(result)) {
|
|
1590
|
+
const section = result?.config?.[configSection];
|
|
1591
|
+
if (isDefined12(section) && typeof section === "object") {
|
|
1592
|
+
return section;
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
return {};
|
|
1596
|
+
}, "tryParseConfig");
|
|
1597
|
+
|
|
1576
1598
|
// src/waitForHostPort.ts
|
|
1577
1599
|
import net from "net";
|
|
1578
1600
|
var waitForHostPort = /* @__PURE__ */ __name((host, port) => {
|
|
@@ -1596,7 +1618,7 @@ var waitForHostPort = /* @__PURE__ */ __name((host, port) => {
|
|
|
1596
1618
|
|
|
1597
1619
|
// src/runCLI.ts
|
|
1598
1620
|
var config;
|
|
1599
|
-
var version =
|
|
1621
|
+
var version = isDefined13("1.7.12") ? "1.7.12" : "unknown";
|
|
1600
1622
|
var getContextFromConfig = /* @__PURE__ */ __name((config3) => {
|
|
1601
1623
|
const logger = initLogger(config3);
|
|
1602
1624
|
const orchestrator = new Orchestrator(logger);
|
|
@@ -1627,10 +1649,14 @@ Run various components of the XL1 ecosystem.
|
|
|
1627
1649
|
|
|
1628
1650
|
Usage:
|
|
1629
1651
|
$0 <command> [options]`).parserConfiguration({
|
|
1630
|
-
"dot-notation": true
|
|
1631
|
-
|
|
1652
|
+
"dot-notation": true,
|
|
1653
|
+
"populate--": true
|
|
1654
|
+
}).env("XL1").scriptName("xl1").version(version).middleware((argv2) => {
|
|
1632
1655
|
try {
|
|
1633
|
-
|
|
1656
|
+
const parsedConfigFile = tryParseConfig();
|
|
1657
|
+
const parsedConfigArgs = argv2;
|
|
1658
|
+
const mergedConfig = deepMerge(parsedConfigArgs, parsedConfigFile);
|
|
1659
|
+
config = ConfigSchema.parse(mergedConfig);
|
|
1634
1660
|
} catch (err) {
|
|
1635
1661
|
if (err instanceof ZodError) {
|
|
1636
1662
|
for (const issue of err.errors) {
|