@dedot/cli 0.0.1-alpha.398 → 0.0.1-alpha.403

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.
@@ -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
- const outputDir = path.resolve(output, './codegen');
35
- await (0, codegen_1.generateTypesFromChain)({ chain }, wsUrl, outputDir);
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
- .option('file', {
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.398+6fbf1fe",
3
+ "version": "0.0.1-alpha.403+b5ca298",
4
4
  "author": "Thang X. Vu <thang@coongcrafts.io>",
5
5
  "bin": {
6
6
  "dedot": "./bin/dedot",
@@ -10,10 +10,11 @@
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
- "test": "vitest --watch=false"
13
+ "test": "vitest --watch=false",
14
+ "start": "ts-node src/index.ts"
14
15
  },
15
16
  "dependencies": {
16
- "@dedot/codegen": "0.0.1-alpha.6+6fbf1fe",
17
+ "@dedot/codegen": "0.0.1-alpha.11+b5ca298",
17
18
  "yargs": "^17.7.2"
18
19
  },
19
20
  "devDependencies": {
@@ -24,5 +25,5 @@
24
25
  "directory": "dist"
25
26
  },
26
27
  "license": "Apache-2.0",
27
- "gitHead": "6fbf1fe509c7c07569adc4c1cced998c809458e0"
28
+ "gitHead": "b5ca298916c21e2e490bb121275eb49b4b247fd9"
28
29
  }