@cosmwasm/ts-codegen 0.10.0 → 0.11.1
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 +5 -0
- package/main/commands/generate.js +44 -7
- package/module/commands/generate.js +35 -1
- package/package.json +3 -3
package/README.md
CHANGED
@@ -450,3 +450,8 @@ See the [docs](https://github.com/CosmWasm/ts-codegen/blob/main/packages/wasm-as
|
|
450
450
|
Checkout these related projects:
|
451
451
|
|
452
452
|
* [@osmonauts/telescope](https://github.com/osmosis-labs/telescope) a "babel for the Cosmos", Telescope is a TypeScript Transpiler for Cosmos Protobufs.
|
453
|
+
|
454
|
+
## Credits
|
455
|
+
|
456
|
+
Built by Cosmology — if you like our tools, please consider delegating to [our validator](https://www.mintscan.io/juno/validators/junovaloper1pr5qgj4jg47lvsnejtfvk78090shvuctgdwdm5)
|
457
|
+
|
@@ -17,7 +17,7 @@ var _index = _interopRequireDefault(require("../index"));
|
|
17
17
|
|
18
18
|
var _default = /*#__PURE__*/function () {
|
19
19
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(argv) {
|
20
|
-
var questions, _yield$prompt, schema, out, name, plugin, questions2, _yield$prompt2, optionalClient, version, questions3, _yield$prompt3, mutations, options;
|
20
|
+
var questions, _yield$prompt, schema, out, name, plugin, bundle, questions2, _yield$prompt2, optionalClient, version, questions3, _yield$prompt3, mutations, questions4, _yield$prompt4, bundleFile, bundleScope, options;
|
21
21
|
|
22
22
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
23
23
|
while (1) {
|
@@ -45,6 +45,11 @@ var _default = /*#__PURE__*/function () {
|
|
45
45
|
name: 'plugin',
|
46
46
|
message: 'which plugins?',
|
47
47
|
choices: ['client', 'recoil', 'react-query', 'message-composer']
|
48
|
+
}, {
|
49
|
+
type: 'confirm',
|
50
|
+
name: 'bundle',
|
51
|
+
message: 'enable bundle?',
|
52
|
+
"default": true
|
48
53
|
}];
|
49
54
|
|
50
55
|
if (argv.typesOnly) {
|
@@ -60,6 +65,7 @@ var _default = /*#__PURE__*/function () {
|
|
60
65
|
out = _yield$prompt.out;
|
61
66
|
name = _yield$prompt.name;
|
62
67
|
plugin = _yield$prompt.plugin;
|
68
|
+
bundle = _yield$prompt.bundle;
|
63
69
|
if (!Array.isArray(plugin)) plugin = [plugin]; ///////// REACT QUERY
|
64
70
|
|
65
71
|
questions2 = [];
|
@@ -80,10 +86,10 @@ var _default = /*#__PURE__*/function () {
|
|
80
86
|
}
|
81
87
|
|
82
88
|
;
|
83
|
-
_context.next =
|
89
|
+
_context.next = 16;
|
84
90
|
return (0, _prompt.prompt)(questions2, argv);
|
85
91
|
|
86
|
-
case
|
92
|
+
case 16:
|
87
93
|
_yield$prompt2 = _context.sent;
|
88
94
|
optionalClient = _yield$prompt2.optionalClient;
|
89
95
|
version = _yield$prompt2.version;
|
@@ -100,13 +106,39 @@ var _default = /*#__PURE__*/function () {
|
|
100
106
|
}
|
101
107
|
|
102
108
|
;
|
103
|
-
_context.next =
|
109
|
+
_context.next = 24;
|
104
110
|
return (0, _prompt.prompt)(questions3, argv);
|
105
111
|
|
106
|
-
case
|
112
|
+
case 24:
|
107
113
|
_yield$prompt3 = _context.sent;
|
108
114
|
mutations = _yield$prompt3.mutations;
|
109
115
|
///////// END REACT QUERY
|
116
|
+
///////// BUNDLE
|
117
|
+
questions4 = [];
|
118
|
+
|
119
|
+
if (bundle) {
|
120
|
+
[].push.apply(questions4, [{
|
121
|
+
type: 'string',
|
122
|
+
name: 'bundleFile',
|
123
|
+
message: 'bundleFile?',
|
124
|
+
"default": 'bundle.ts'
|
125
|
+
}, {
|
126
|
+
type: 'string',
|
127
|
+
name: 'bundleScope',
|
128
|
+
message: 'bundleScope?',
|
129
|
+
"default": 'contracts'
|
130
|
+
}]);
|
131
|
+
}
|
132
|
+
|
133
|
+
;
|
134
|
+
_context.next = 31;
|
135
|
+
return (0, _prompt.prompt)(questions4, argv);
|
136
|
+
|
137
|
+
case 31:
|
138
|
+
_yield$prompt4 = _context.sent;
|
139
|
+
bundleFile = _yield$prompt4.bundleFile;
|
140
|
+
bundleScope = _yield$prompt4.bundleScope;
|
141
|
+
///////// END BUNDLE
|
110
142
|
options = {
|
111
143
|
types: {
|
112
144
|
enabled: true
|
@@ -125,9 +157,14 @@ var _default = /*#__PURE__*/function () {
|
|
125
157
|
},
|
126
158
|
messageComposer: {
|
127
159
|
enabled: plugin.includes('message-composer')
|
160
|
+
},
|
161
|
+
bundle: {
|
162
|
+
enabled: bundle,
|
163
|
+
scope: bundleScope,
|
164
|
+
bundleFile: bundleFile
|
128
165
|
}
|
129
166
|
};
|
130
|
-
_context.next =
|
167
|
+
_context.next = 37;
|
131
168
|
return (0, _index["default"])({
|
132
169
|
contracts: [{
|
133
170
|
name: name,
|
@@ -137,7 +174,7 @@ var _default = /*#__PURE__*/function () {
|
|
137
174
|
options: options
|
138
175
|
});
|
139
176
|
|
140
|
-
case
|
177
|
+
case 37:
|
141
178
|
case "end":
|
142
179
|
return _context.stop();
|
143
180
|
}
|
@@ -23,6 +23,11 @@ export default (async argv => {
|
|
23
23
|
name: 'plugin',
|
24
24
|
message: 'which plugins?',
|
25
25
|
choices: ['client', 'recoil', 'react-query', 'message-composer']
|
26
|
+
}, {
|
27
|
+
type: 'confirm',
|
28
|
+
name: 'bundle',
|
29
|
+
message: 'enable bundle?',
|
30
|
+
default: true
|
26
31
|
}];
|
27
32
|
|
28
33
|
if (argv.typesOnly) {
|
@@ -33,7 +38,8 @@ export default (async argv => {
|
|
33
38
|
schema,
|
34
39
|
out,
|
35
40
|
name,
|
36
|
-
plugin
|
41
|
+
plugin,
|
42
|
+
bundle
|
37
43
|
} = await prompt(questions, argv);
|
38
44
|
if (!Array.isArray(plugin)) plugin = [plugin]; ///////// REACT QUERY
|
39
45
|
|
@@ -75,6 +81,29 @@ export default (async argv => {
|
|
75
81
|
const {
|
76
82
|
mutations
|
77
83
|
} = await prompt(questions3, argv); ///////// END REACT QUERY
|
84
|
+
///////// BUNDLE
|
85
|
+
|
86
|
+
const questions4 = [];
|
87
|
+
|
88
|
+
if (bundle) {
|
89
|
+
[].push.apply(questions4, [{
|
90
|
+
type: 'string',
|
91
|
+
name: 'bundleFile',
|
92
|
+
message: 'bundleFile?',
|
93
|
+
default: 'bundle.ts'
|
94
|
+
}, {
|
95
|
+
type: 'string',
|
96
|
+
name: 'bundleScope',
|
97
|
+
message: 'bundleScope?',
|
98
|
+
default: 'contracts'
|
99
|
+
}]);
|
100
|
+
}
|
101
|
+
|
102
|
+
;
|
103
|
+
const {
|
104
|
+
bundleFile,
|
105
|
+
bundleScope
|
106
|
+
} = await prompt(questions4, argv); ///////// END BUNDLE
|
78
107
|
|
79
108
|
const options = {
|
80
109
|
types: {
|
@@ -94,6 +123,11 @@ export default (async argv => {
|
|
94
123
|
},
|
95
124
|
messageComposer: {
|
96
125
|
enabled: plugin.includes('message-composer')
|
126
|
+
},
|
127
|
+
bundle: {
|
128
|
+
enabled: bundle,
|
129
|
+
scope: bundleScope,
|
130
|
+
bundleFile
|
97
131
|
}
|
98
132
|
};
|
99
133
|
await codegen({
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cosmwasm/ts-codegen",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.11.1",
|
4
4
|
"description": "@cosmwasm/ts-codegen converts your CosmWasm smart contracts into dev-friendly TypeScript classes so you can focus on shipping code.",
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
6
6
|
"homepage": "https://github.com/cosmwasm/ts-codegen",
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"parse-package-name": "1.0.0",
|
94
94
|
"rimraf": "3.0.2",
|
95
95
|
"shelljs": "0.8.5",
|
96
|
-
"wasm-ast-types": "^0.8.
|
96
|
+
"wasm-ast-types": "^0.8.1"
|
97
97
|
},
|
98
|
-
"gitHead": "
|
98
|
+
"gitHead": "27d52cba2fb8e0509014885f001cdfed70f72aa7"
|
99
99
|
}
|