wasm-ast-types 0.3.4 → 0.3.7

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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _generator = _interopRequireDefault(require("@babel/generator"));
6
+
7
+ var _query_msg = _interopRequireDefault(require("./../../../__fixtures__/daodao/cw-admin-factory/query_msg.json"));
8
+
9
+ var _wasm = require("./wasm");
10
+
11
+ var expectCode = function expectCode(ast) {
12
+ expect((0, _generator["default"])(ast).code).toMatchSnapshot();
13
+ };
14
+
15
+ var printCode = function printCode(ast) {
16
+ console.log((0, _generator["default"])(ast).code);
17
+ };
18
+
19
+ it('query classes', function () {
20
+ expectCode((0, _wasm.createQueryClass)('SG721QueryClient', 'SG721ReadOnlyInstance', _query_msg["default"]));
21
+ });
22
+ it('query interface', function () {
23
+ expectCode((0, _wasm.createQueryInterface)('ReadOnlyInstance', _query_msg["default"]));
24
+ });
package/main/wasm.spec.js CHANGED
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
 
5
5
  var _generator = _interopRequireDefault(require("@babel/generator"));
6
6
 
7
- var _execute_msg = _interopRequireDefault(require("./../../../__fixtures__/cw-named-groups/execute_msg.json"));
7
+ var _execute_msg = _interopRequireDefault(require("./../../../__fixtures__/daodao/cw-named-groups/execute_msg.json"));
8
8
 
9
9
  var _query_msg = _interopRequireDefault(require("./../../../__fixtures__/basic/query_msg.json"));
10
10
 
@@ -0,0 +1,18 @@
1
+ import generate from '@babel/generator';
2
+ import query_msg from './../../../__fixtures__/daodao/cw-admin-factory/query_msg.json';
3
+ import { createQueryClass, createQueryInterface } from './wasm';
4
+
5
+ const expectCode = ast => {
6
+ expect(generate(ast).code).toMatchSnapshot();
7
+ };
8
+
9
+ const printCode = ast => {
10
+ console.log(generate(ast).code);
11
+ };
12
+
13
+ it('query classes', () => {
14
+ expectCode(createQueryClass('SG721QueryClient', 'SG721ReadOnlyInstance', query_msg));
15
+ });
16
+ it('query interface', () => {
17
+ expectCode(createQueryInterface('ReadOnlyInstance', query_msg));
18
+ });
@@ -1,5 +1,5 @@
1
1
  import generate from '@babel/generator';
2
- import execute_msg_named_groups from './../../../__fixtures__/cw-named-groups/execute_msg.json';
2
+ import execute_msg_named_groups from './../../../__fixtures__/daodao/cw-named-groups/execute_msg.json';
3
3
  import query_msg from './../../../__fixtures__/basic/query_msg.json';
4
4
  import execute_msg from './../../../__fixtures__/basic/execute_msg_for__empty.json';
5
5
  import approval_response from './../../../__fixtures__/basic/approval_response.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-ast-types",
3
- "version": "0.3.4",
3
+ "version": "0.3.7",
4
4
  "description": "CosmWasm TypeScript AST generation",
5
5
  "author": "Dan Lynch <pyramation@gmail.com>",
6
6
  "homepage": "https://github.com/pyramation/cosmwasm-typescript-gen/tree/master/packages/wasm-ast-types#readme",
@@ -23,9 +23,8 @@
23
23
  "build": "npm run build:module && npm run build:main",
24
24
  "build:ts": "tsc --project ./tsconfig.json",
25
25
  "prepare": "npm run build",
26
- "dev": "cross-env NODE_ENV=development babel-node src/index",
27
- "watch": "cross-env NODE_ENV=development babel-watch src/index",
28
- "lint": "eslint src --fix",
26
+ "lint": "eslint .",
27
+ "format": "eslint . --fix",
29
28
  "test": "jest",
30
29
  "test:ast": "cross-env NODE_ENV=development babel-node scripts/test-ast.js",
31
30
  "test:watch": "jest --watch",
@@ -85,5 +84,5 @@
85
84
  "ast-stringify": "0.1.0",
86
85
  "case": "1.6.3"
87
86
  },
88
- "gitHead": "5222ebac8404ddceecad0156fc4a95a9356682cd"
87
+ "gitHead": "1f32ebfe7996630272adbbb54a324ea4a0699267"
89
88
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Dan Lynch <pyramation@gmail.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.