@xyo-network/xl1-cli-lib 1.19.13 → 1.19.15
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/node/commands/bridge/runBridge.d.ts +5 -3
- package/dist/node/commands/bridge/runBridge.d.ts.map +1 -1
- package/dist/node/commands/rewardRedemption/runRewardRedemptionApi.d.ts +5 -3
- package/dist/node/commands/rewardRedemption/runRewardRedemptionApi.d.ts.map +1 -1
- package/dist/node/commands/validator/runValidator.d.ts +5 -3
- package/dist/node/commands/validator/runValidator.d.ts.map +1 -1
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.mjs +111 -374
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/initLogger.d.ts +2 -2
- package/dist/node/initLogger.d.ts.map +1 -1
- package/dist/node/runCLI.d.ts.map +1 -1
- package/dist/node/xl1.mjs +92 -356
- package/dist/node/xl1.mjs.map +1 -1
- package/package.json +24 -26
- package/src/commands/bridge/runBridge.ts +18 -11
- package/src/commands/rewardRedemption/runRewardRedemptionApi.ts +20 -9
- package/src/commands/validator/runValidator.ts +17 -12
- package/src/index.ts +1 -0
- package/src/initLogger.ts +2 -2
- package/src/runCLI.ts +62 -78
- package/dist/node/locatorFromConfig.d.ts +0 -14
- package/dist/node/locatorFromConfig.d.ts.map +0 -1
- package/dist/node/tryParseConfig.d.ts +0 -431
- package/dist/node/tryParseConfig.d.ts.map +0 -1
- package/src/locatorFromConfig.ts +0 -326
- package/src/spec/MultiProducer.ChainOutput.json +0 -864
- package/src/tryParseConfig.ts +0 -42
package/src/tryParseConfig.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { isDefined, isNull } from '@xylabs/sdk-js'
|
|
2
|
-
import { ConfigZod } from '@xyo-network/xl1-sdk'
|
|
3
|
-
import { cosmiconfigSync } from 'cosmiconfig'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The name of the configuration file to search for.
|
|
7
|
-
*/
|
|
8
|
-
const configName = 'xyo'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The name of the section within the configuration file to parse.
|
|
12
|
-
*/
|
|
13
|
-
const configSection = 'xl1' // Default section in the config file
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Attempts to parse the configuration from a file using cosmiconfig.
|
|
17
|
-
* @returns The parsed configuration object if found and valid, otherwise undefined.
|
|
18
|
-
*/
|
|
19
|
-
export const tryParseConfig = () => {
|
|
20
|
-
const explorer = cosmiconfigSync(
|
|
21
|
-
configName,
|
|
22
|
-
/* {
|
|
23
|
-
searchPlaces: [
|
|
24
|
-
'package.json', // Looks under `xyo` key in package.json
|
|
25
|
-
'.xyorc.json', // Supports common dotfile format
|
|
26
|
-
'xyo.config.json', // Supports custom-named config file
|
|
27
|
-
],
|
|
28
|
-
loaders: {
|
|
29
|
-
'.json': defaultLoaders['.json'],
|
|
30
|
-
'noExt': defaultLoaders['.json'],
|
|
31
|
-
},
|
|
32
|
-
}, */
|
|
33
|
-
)
|
|
34
|
-
const result = explorer.search()
|
|
35
|
-
if (!isNull(result)) {
|
|
36
|
-
const section = result?.config?.[configSection]
|
|
37
|
-
if (isDefined(section) && typeof section === 'object') {
|
|
38
|
-
return ConfigZod.parse(section)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return ConfigZod.parse({})
|
|
42
|
-
}
|