From b64aec5587bb4e774ada445df06fef73afbdac22 Mon Sep 17 00:00:00 2001 From: Kepler Vital Date: Wed, 23 Oct 2024 11:56:59 +0200 Subject: [PATCH] update build --- tools/didc-js/LICENSE | 2 +- tools/didc-js/README.md | 20 ++-- tools/didc-js/package.json | 4 +- tools/didc-js/pnpm-lock.yaml | 149 +++++++++--------------- tools/didc-js/wasm-package/Cargo.toml | 3 + tools/didc-js/wasm-package/LICENSE | 2 +- tools/didc-js/wasm-package/build.sh | 5 - tools/didc-js/wasm-package/package.json | 1 - tools/didc-js/wasm-package/src/utils.rs | 7 +- tools/didc-js/wasm-tests/package.json | 4 +- 10 files changed, 75 insertions(+), 122 deletions(-) diff --git a/tools/didc-js/LICENSE b/tools/didc-js/LICENSE index 06c5e1ff..ecc50baa 100644 --- a/tools/didc-js/LICENSE +++ b/tools/didc-js/LICENSE @@ -192,7 +192,7 @@ recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 DFINITY Foundation +Copyright 2024 DFINITY Stiftung Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the diff --git a/tools/didc-js/README.md b/tools/didc-js/README.md index cc3d2b37..b7cd542c 100644 --- a/tools/didc-js/README.md +++ b/tools/didc-js/README.md @@ -25,7 +25,7 @@ export const IDL = ` // Gets the service methods from the IDL and returns an array of the methods. // // Example returned value: ['store_number', 'get_number'] -const methods = get_service_methods(IDL); +const methods = getServiceMethods(IDL); // Encodes a candid text representation of a value to a hex representation. // @@ -56,15 +56,13 @@ For web usage, you need to initialize the async wasm module before using the fun ```javascript import init, { encode } from "@dfinity/didc"; -(async function() { - await init(); +await init(); - // then you can use the functions - const encoded = encode({ - idl: IDL, - input: "(record { number=90; })", - serviceMethod: "store_number", - targetFormat: "hex", - }); -})(); +// then you can use the functions because the wasm will be initialized +const encoded = encode({ + idl: IDL, + input: "(record { number=90; })", + serviceMethod: "store_number", + targetFormat: "hex", +}); ``` diff --git a/tools/didc-js/package.json b/tools/didc-js/package.json index 57b7a895..351e731c 100644 --- a/tools/didc-js/package.json +++ b/tools/didc-js/package.json @@ -16,8 +16,8 @@ "test": "pnpm run -r test" }, "devDependencies": { - "@types/jest": "29.5.13", - "@types/node": "22.7.6", + "@types/jest": "29.5.14", + "@types/node": "22.7.9", "jest": "29.7.0", "terser": "5.36.0", "ts-jest": "29.2.5", diff --git a/tools/didc-js/pnpm-lock.yaml b/tools/didc-js/pnpm-lock.yaml index 5b3af37e..9d262f4e 100644 --- a/tools/didc-js/pnpm-lock.yaml +++ b/tools/didc-js/pnpm-lock.yaml @@ -9,23 +9,23 @@ importers: .: devDependencies: '@types/jest': - specifier: 29.5.13 - version: 29.5.13 + specifier: 29.5.14 + version: 29.5.14 '@types/node': - specifier: 22.7.6 - version: 22.7.6 + specifier: 22.7.9 + version: 22.7.9 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + version: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) terser: specifier: 5.36.0 version: 5.36.0 ts-jest: specifier: 29.2.5 - version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)))(typescript@5.6.3) ts-node: specifier: 10.9.2 - version: 10.9.2(@types/node@22.7.6)(typescript@5.6.3) + version: 10.9.2(@types/node@22.7.9)(typescript@5.6.3) tslib: specifier: 2.8.0 version: 2.8.0 @@ -38,9 +38,6 @@ importers: wasm-package: devDependencies: - terser: - specifier: 5.36.0 - version: 5.36.0 wasm-pack: specifier: 0.13.0 version: 0.13.0 @@ -51,20 +48,20 @@ importers: specifier: workspace:* version: link:../wasm-package '@types/jest': - specifier: 29.5.13 - version: 29.5.13 + specifier: 29.5.14 + version: 29.5.14 '@types/node': - specifier: 22.7.6 - version: 22.7.6 + specifier: 22.7.9 + version: 22.7.9 jest: specifier: 29.7.0 - version: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + version: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) ts-jest: specifier: 29.2.5 - version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)))(typescript@5.6.3) + version: 29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)))(typescript@5.6.3) ts-node: specifier: 10.9.2 - version: 10.9.2(@types/node@22.7.6)(typescript@5.6.3) + version: 10.9.2(@types/node@22.7.9)(typescript@5.6.3) tslib: specifier: 2.8.0 version: 2.8.0 @@ -394,14 +391,11 @@ packages: '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/jest@29.5.13': - resolution: {integrity: sha512-wd+MVEZCHt23V0/L642O5APvspWply/rGY5BcW4SUETo2UzPU3Z26qr8jC2qxpimI2jjx9h7+2cj2FwIr01bXg==} + '@types/jest@29.5.14': + resolution: {integrity: sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==} - '@types/node@22.7.6': - resolution: {integrity: sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==} - - '@types/node@22.7.7': - resolution: {integrity: sha512-SRxCrrg9CL/y54aiMCG3edPKdprgMVGDXjA3gB8UmmBW5TcXzRUYAh8EWzTnSJFAd1rgImPELza+A3bJ+qxz8Q==} + '@types/node@22.7.9': + resolution: {integrity: sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==} '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} @@ -1618,27 +1612,27 @@ snapshots: '@jest/console@29.7.0': dependencies: '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 jest-message-util: 29.7.0 jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3))': + '@jest/core@29.7.0(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.9.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@22.7.7)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -1663,7 +1657,7 @@ snapshots: dependencies: '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 jest-mock: 29.7.0 '@jest/expect-utils@29.7.0': @@ -1681,7 +1675,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 22.7.7 + '@types/node': 22.7.9 jest-message-util: 29.7.0 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -1703,7 +1697,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -1773,7 +1767,7 @@ snapshots: '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 22.7.7 + '@types/node': 22.7.9 '@types/yargs': 17.0.33 chalk: 4.1.2 @@ -1845,7 +1839,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 22.7.7 + '@types/node': 22.7.9 '@types/istanbul-lib-coverage@2.0.6': {} @@ -1857,16 +1851,12 @@ snapshots: dependencies: '@types/istanbul-lib-report': 3.0.3 - '@types/jest@29.5.13': + '@types/jest@29.5.14': dependencies: expect: 29.7.0 pretty-format: 29.7.0 - '@types/node@22.7.6': - dependencies: - undici-types: 6.19.8 - - '@types/node@22.7.7': + '@types/node@22.7.9': dependencies: undici-types: 6.19.8 @@ -2069,13 +2059,13 @@ snapshots: convert-source-map@2.0.0: {} - create-jest@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)): + create-jest@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -2305,7 +2295,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3 @@ -2325,16 +2315,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)): + jest-cli@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + create-jest: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) exit: 0.1.2 import-local: 3.2.0 - jest-config: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + jest-config: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -2344,38 +2334,7 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)): - dependencies: - '@babel/core': 7.25.8 - '@jest/test-sequencer': 29.7.0 - '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.25.8) - chalk: 4.1.2 - ci-info: 3.9.0 - deepmerge: 4.3.1 - glob: 7.2.3 - graceful-fs: 4.2.11 - jest-circus: 29.7.0 - jest-environment-node: 29.7.0 - jest-get-type: 29.6.3 - jest-regex-util: 29.6.3 - jest-resolve: 29.7.0 - jest-runner: 29.7.0 - jest-util: 29.7.0 - jest-validate: 29.7.0 - micromatch: 4.0.8 - parse-json: 5.2.0 - pretty-format: 29.7.0 - slash: 3.0.0 - strip-json-comments: 3.1.1 - optionalDependencies: - '@types/node': 22.7.6 - ts-node: 10.9.2(@types/node@22.7.6)(typescript@5.6.3) - transitivePeerDependencies: - - babel-plugin-macros - - supports-color - - jest-config@29.7.0(@types/node@22.7.7)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)): + jest-config@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)): dependencies: '@babel/core': 7.25.8 '@jest/test-sequencer': 29.7.0 @@ -2400,8 +2359,8 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - '@types/node': 22.7.7 - ts-node: 10.9.2(@types/node@22.7.6)(typescript@5.6.3) + '@types/node': 22.7.9 + ts-node: 10.9.2(@types/node@22.7.9)(typescript@5.6.3) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -2430,7 +2389,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -2440,7 +2399,7 @@ snapshots: dependencies: '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.9 - '@types/node': 22.7.7 + '@types/node': 22.7.9 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -2479,7 +2438,7 @@ snapshots: jest-mock@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 jest-util: 29.7.0 jest-pnp-resolver@1.2.3(jest-resolve@29.7.0): @@ -2514,7 +2473,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -2542,7 +2501,7 @@ snapshots: '@jest/test-result': 29.7.0 '@jest/transform': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 cjs-module-lexer: 1.4.1 collect-v8-coverage: 1.0.2 @@ -2588,7 +2547,7 @@ snapshots: jest-util@29.7.0: dependencies: '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -2607,7 +2566,7 @@ snapshots: dependencies: '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 22.7.7 + '@types/node': 22.7.9 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -2616,17 +2575,17 @@ snapshots: jest-worker@29.7.0: dependencies: - '@types/node': 22.7.7 + '@types/node': 22.7.9 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)): + jest@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)): dependencies: - '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + '@jest/core': 29.7.0(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) '@jest/types': 29.6.3 import-local: 3.2.0 - jest-cli: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + jest-cli: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -2897,12 +2856,12 @@ snapshots: dependencies: is-number: 7.0.0 - ts-jest@29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)))(typescript@5.6.3): + ts-jest@29.2.5(@babel/core@7.25.8)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.8))(jest@29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)))(typescript@5.6.3): dependencies: bs-logger: 0.2.6 ejs: 3.1.10 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@22.7.6)(ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3)) + jest: 29.7.0(@types/node@22.7.9)(ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -2916,14 +2875,14 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.8) - ts-node@10.9.2(@types/node@22.7.6)(typescript@5.6.3): + ts-node@10.9.2(@types/node@22.7.9)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 22.7.6 + '@types/node': 22.7.9 acorn: 8.13.0 acorn-walk: 8.3.4 arg: 4.1.3 diff --git a/tools/didc-js/wasm-package/Cargo.toml b/tools/didc-js/wasm-package/Cargo.toml index e3af6619..a31c4c10 100644 --- a/tools/didc-js/wasm-package/Cargo.toml +++ b/tools/didc-js/wasm-package/Cargo.toml @@ -12,6 +12,9 @@ license = "Apache-2.0" path = "./src/lib.rs" crate-type = ["cdylib"] +[package.metadata.wasm-pack.profile.release] +wasm-opt = ["-Oz", "--enable-mutable-globals"] + [dependencies] candid = "0.10" candid_parser = "0.1" diff --git a/tools/didc-js/wasm-package/LICENSE b/tools/didc-js/wasm-package/LICENSE index 06c5e1ff..ecc50baa 100644 --- a/tools/didc-js/wasm-package/LICENSE +++ b/tools/didc-js/wasm-package/LICENSE @@ -192,7 +192,7 @@ recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. -Copyright 2024 DFINITY Foundation +Copyright 2024 DFINITY Stiftung Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the diff --git a/tools/didc-js/wasm-package/build.sh b/tools/didc-js/wasm-package/build.sh index 63125f74..53f5a509 100755 --- a/tools/didc-js/wasm-package/build.sh +++ b/tools/didc-js/wasm-package/build.sh @@ -122,8 +122,3 @@ else ./node_modules/wasm-pack/run.js build --target $BUILD_TARGET --out-name $LIBRARY_NAME --out-dir $OUT_DIR $RUST_BUILD_MODE --no-pack fi - -if [[ "$BUILD_MODE" == "production" ]]; then - echo "Minifying the js files..." - npx terser $OUT_DIR/$LIBRARY_NAME.js --compress --mangle --output $OUT_DIR/$LIBRARY_NAME.js -fi diff --git a/tools/didc-js/wasm-package/package.json b/tools/didc-js/wasm-package/package.json index bc3ca648..9c10d252 100644 --- a/tools/didc-js/wasm-package/package.json +++ b/tools/didc-js/wasm-package/package.json @@ -32,7 +32,6 @@ "lint": "cargo clippy --locked --verbose --tests -- -D clippy::all && cargo fmt" }, "devDependencies": { - "terser": "5.36.0", "wasm-pack": "0.13.0" } } diff --git a/tools/didc-js/wasm-package/src/utils.rs b/tools/didc-js/wasm-package/src/utils.rs index 9ce19875..3da835cd 100644 --- a/tools/didc-js/wasm-package/src/utils.rs +++ b/tools/didc-js/wasm-package/src/utils.rs @@ -25,13 +25,12 @@ pub fn parse_idl_args(args: &str) -> Result { #[derive(Debug)] pub struct ParsedIDL { pub env: TypeEnv, - pub prog: IDLProg, pub actor: Option, } impl ParsedIDL { - pub fn new(env: TypeEnv, prog: IDLProg, actor: Option) -> Self { - Self { env, prog, actor } + pub fn new(env: TypeEnv, actor: Option) -> Self { + Self { env, actor } } } @@ -44,7 +43,7 @@ pub fn parse_idl(idl: &str) -> Result { reason: e.to_string(), })?; - Ok(ParsedIDL::new(env, ast, actor)) + Ok(ParsedIDL::new(env, actor)) } /// Decode the provided hex input from text to bytes. diff --git a/tools/didc-js/wasm-tests/package.json b/tools/didc-js/wasm-tests/package.json index aa4642c5..ba34dbab 100644 --- a/tools/didc-js/wasm-tests/package.json +++ b/tools/didc-js/wasm-tests/package.json @@ -8,8 +8,8 @@ }, "devDependencies": { "@dfinity/didc": "workspace:*", - "@types/jest": "29.5.13", - "@types/node": "22.7.6", + "@types/jest": "29.5.14", + "@types/node": "22.7.9", "jest": "29.7.0", "ts-jest": "29.2.5", "ts-node": "10.9.2",