@dedot/cli 0.0.1-alpha.0 → 0.0.1-alpha.26
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/cjs/commands/chaintypes.js +8 -9
- package/cjs/index.js +5 -0
- package/cjs/packageInfo.d.ts +4 -0
- package/cjs/packageInfo.js +5 -0
- package/package.json +4 -4
- package/packageInfo.js +1 -1
|
@@ -31,21 +31,20 @@ exports.chaintypes = {
|
|
|
31
31
|
describe: 'Generate chain types & APIs for a Substrate-based blockchain',
|
|
32
32
|
handler: async (yargs) => {
|
|
33
33
|
const { wsUrl, output = '', chain = '' } = yargs;
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
console.log(`- Generating chaintypes via endpoint ${wsUrl}`);
|
|
35
|
+
const outDir = path.resolve(output, './codegen');
|
|
36
|
+
await (0, codegen_1.generateTypesFromChain)({ chain }, wsUrl, outDir);
|
|
37
|
+
console.log(`- DONE! Output: ${outDir}`);
|
|
36
38
|
},
|
|
37
39
|
builder: (yargs) => {
|
|
38
|
-
return yargs
|
|
40
|
+
return (yargs
|
|
39
41
|
.option('wsUrl', {
|
|
40
42
|
type: 'string',
|
|
41
43
|
describe: 'Websocket Url to fetch metadata',
|
|
42
44
|
alias: 'w',
|
|
45
|
+
default: 'ws://127.0.0.1:9944',
|
|
43
46
|
})
|
|
44
|
-
|
|
45
|
-
type: 'string',
|
|
46
|
-
describe: 'Path to metadata file',
|
|
47
|
-
alias: 'f',
|
|
48
|
-
})
|
|
47
|
+
// TODO add file input
|
|
49
48
|
.option('output', {
|
|
50
49
|
type: 'string',
|
|
51
50
|
describe: 'Output folder to put generated files',
|
|
@@ -55,6 +54,6 @@ exports.chaintypes = {
|
|
|
55
54
|
type: 'string',
|
|
56
55
|
describe: 'Chain name',
|
|
57
56
|
alias: 'c',
|
|
58
|
-
}); // TODO check to verify inputs
|
|
57
|
+
})); // TODO check to verify inputs
|
|
59
58
|
},
|
|
60
59
|
};
|
package/cjs/index.js
CHANGED
|
@@ -3,3 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.dedot = void 0;
|
|
4
4
|
const dedot_1 = require("./dedot");
|
|
5
5
|
Object.defineProperty(exports, "dedot", { enumerable: true, get: function () { return dedot_1.dedot; } });
|
|
6
|
+
// We run this directly for development purpose via ts-node
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
if (process[Symbol.for('ts-node.register.instance')]) {
|
|
9
|
+
(0, dedot_1.dedot)();
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dedot/cli",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.26",
|
|
4
4
|
"author": "Thang X. Vu <thang@coongcrafts.io>",
|
|
5
5
|
"bin": {
|
|
6
6
|
"dedot": "./bin/dedot",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc --project tsconfig.build.cjs.json && cp -R ./bin ./dist",
|
|
12
12
|
"clean": "rm -rf ./dist && rm -rf ./tsconfig.tsbuildinfo ./tsconfig.build.cjs.tsbuildinfo && rm -rf ./src/codegen",
|
|
13
|
-
"
|
|
13
|
+
"start": "ts-node src/index.ts"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dedot/codegen": "0.0.1-alpha.
|
|
16
|
+
"@dedot/codegen": "0.0.1-alpha.26",
|
|
17
17
|
"yargs": "^17.7.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"directory": "dist"
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "5b114a0d2359316f07654915f3c03b44761cac73"
|
|
28
28
|
}
|
package/packageInfo.js
CHANGED