diff --git a/package-lock.json b/package-lock.json index 5c7c23d..7188c2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-motoko", - "version": "0.16.11", + "version": "0.16.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-motoko", - "version": "0.16.11", + "version": "0.16.12", "hasInstallScript": true, "dependencies": { "@wasmer/wasi": "1.2.2", @@ -14,9 +14,9 @@ "execa": "4.1.0", "fast-glob": "3.2.12", "ic-mops": "0.45.3", - "ic0": "0.2.7", + "ic0": "0.3.1", "mnemonist": "0.39.5", - "motoko": "3.8.4", + "motoko": "3.9.0", "prettier": "2.8.0", "prettier-plugin-motoko": "0.9.2", "semver": "7.6.3", @@ -591,6 +591,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "peer": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -602,6 +603,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "peer": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -611,6 +613,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.15.6.tgz", "integrity": "sha512-Ch+tXAszPap0zwRgr/oFEgJLDld4RDwBdFDqR1JUg38xhHWTFMrTkjMT6uQFvqf6d2wDXnh3zwhqbg5P7OCv7A==", + "peer": true, "dependencies": { "base64-arraybuffer": "^0.2.0", "bignumber.js": "^9.0.0", @@ -628,6 +631,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.15.6.tgz", "integrity": "sha512-Q9PGvhTE/1dTLfSo0pu0+ifzA7NA4X1rgSy9TE6O1Glk6Kl8Nf+Pg2sCHS2hWt0RAiKfR2glEVlbUAm6S8vRxA==", + "peer": true, "dependencies": { "ts-node": "^10.8.2" } @@ -636,6 +640,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-0.15.6.tgz", "integrity": "sha512-hzTyKXAWPHxkZkOWxGj4JUITwdv92VEKnh3l334Yk9h6aw3m7Gi/ujEBLfszsl0LUA82tV4W2MDIz99KMAuW+g==", + "peer": true, "dependencies": { "borc": "^2.1.1", "js-sha256": "^0.9.0", @@ -728,6 +733,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.15.6.tgz", "integrity": "sha512-eMsS5YofRk5Hm6LlhzyBvw1RzDxM5FWPtepQuYeZbZyD/ztq4TrUiScqoKBFw/LLODd0znt8rGnNgqtt+7JnQA==", + "peer": true, "dependencies": { "js-sha256": "^0.9.0", "ts-node": "^10.8.2" @@ -2424,22 +2430,26 @@ "node_modules/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "peer": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "peer": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "peer": true }, "node_modules/@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==" + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "peer": true }, "node_modules/@types/aws-lambda": { "version": "8.10.136", @@ -2871,6 +2881,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "peer": true, "engines": { "node": ">=0.4.0" } @@ -2958,7 +2969,8 @@ "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "peer": true }, "node_modules/argparse": { "version": "2.0.1", @@ -3940,7 +3952,8 @@ "node_modules/create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "peer": true }, "node_modules/cross-fetch": { "version": "3.1.5", @@ -4648,6 +4661,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "peer": true, "engines": { "node": ">=0.3.1" } @@ -4776,9 +4790,9 @@ "dev": true }, "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.0.tgz", + "integrity": "sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==", "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -6718,17 +6732,88 @@ } }, "node_modules/ic0": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/ic0/-/ic0-0.2.7.tgz", - "integrity": "sha512-RrFMH1YrWx//4VguTD7V51schSZxtJpooCwJ+q1GrlRPCkffDdxVXlwz3F1B/0OT7lSQ48NLa0NGzuL0tI9eRg==", - "dependencies": { - "@dfinity/agent": "^0.15.1", - "@dfinity/candid": "^0.15.1", - "@dfinity/identity": "^0.15.1", - "@dfinity/principal": "^0.15.1", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ic0/-/ic0-0.3.1.tgz", + "integrity": "sha512-jJ98/vQXJFbRRjq6BgN02lNAjsG7kCQbC/vX0oy4LvZtzO7WiDuu+OYmoKJuDUJwX7e6wOJ9aNBhs5L7jjhqXA==", + "dependencies": { + "@dfinity/agent": "^2.1.3", + "@dfinity/candid": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "cross-fetch": "^3.1.5" } }, + "node_modules/ic0/node_modules/@dfinity/agent": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-2.1.3.tgz", + "integrity": "sha512-4XmqhFR3GQSUrmx7lMFx7DyHEhFkM6nz4O9FeYJ/WpkmPe8tulKaAfgWbWdTSCjbd8meCgKVHo+QYj+JHXagcw==", + "dependencies": { + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.3.1", + "base64-arraybuffer": "^0.2.0", + "borc": "^2.1.1", + "buffer": "^6.0.3", + "simple-cbor": "^0.4.1" + }, + "peerDependencies": { + "@dfinity/candid": "^2.1.3", + "@dfinity/principal": "^2.1.3" + } + }, + "node_modules/ic0/node_modules/@dfinity/candid": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-2.1.3.tgz", + "integrity": "sha512-Asn7AfydLhhk7E5z9oW+5UL6ne11gxFlYTxHuhrIc7FdqYlM5Flcq1Wfg9EzRa6Btdol3w58Bcph7Brwh1bcIQ==", + "peerDependencies": { + "@dfinity/principal": "^2.1.3" + } + }, + "node_modules/ic0/node_modules/@dfinity/identity": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-2.1.3.tgz", + "integrity": "sha512-qII0V91S1YeIz5/XRHomwrUhTME+C3oqdTnb99tBitXA2Gq6LU2JaCLbKbN7ehhSyW6EjO4tySJxANz6hYENcQ==", + "dependencies": { + "@noble/curves": "^1.2.0", + "@noble/hashes": "^1.3.1", + "borc": "^2.1.1" + }, + "peerDependencies": { + "@dfinity/agent": "^2.1.3", + "@dfinity/principal": "^2.1.3", + "@peculiar/webcrypto": "^1.4.0" + } + }, + "node_modules/ic0/node_modules/@dfinity/principal": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-2.1.3.tgz", + "integrity": "sha512-HtiAfZcs+ToPYFepVJdFlorIfPA56KzC6J97ZuH2lGNMTAfJA+NEBzLe476B4wVCAwZ0TiGJ27J4ks9O79DFEg==", + "dependencies": { + "@noble/hashes": "^1.3.1" + } + }, + "node_modules/ic0/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", @@ -8887,7 +8972,8 @@ "node_modules/js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "peer": true }, "node_modules/js-tokens": { "version": "4.0.0", @@ -10416,9 +10502,9 @@ } }, "node_modules/motoko": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.8.4.tgz", - "integrity": "sha512-ujlGRdK7b6vrSvdd51U2kWCwizcfeL7z04wWR8yp/EcDBvLxlr7KPLUeydR8IsjkTMEOV+MtV+z9dypgX+t3jA==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.9.0.tgz", + "integrity": "sha512-BtDmAX4/9ydy6UFhbuqK4skW3iEMyVIVRJMFspDJQwjYe8ozB/Mqc1FYQ+JEJVH2sDjD9LvJNe8NRgBteLfxDg==", "dependencies": { "cross-fetch": "3.1.5", "debug": "4.3.4", @@ -12545,6 +12631,7 @@ "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "peer": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -12633,7 +12720,8 @@ "node_modules/tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "peer": true }, "node_modules/type-check": { "version": "0.4.0", @@ -12906,7 +12994,8 @@ "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "peer": true }, "node_modules/v8-to-istanbul": { "version": "9.0.1", @@ -13338,6 +13427,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "peer": true, "engines": { "node": ">=6" } @@ -13781,6 +13871,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "peer": true, "requires": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -13789,6 +13880,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "peer": true, "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -13800,6 +13892,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-0.15.6.tgz", "integrity": "sha512-Ch+tXAszPap0zwRgr/oFEgJLDld4RDwBdFDqR1JUg38xhHWTFMrTkjMT6uQFvqf6d2wDXnh3zwhqbg5P7OCv7A==", + "peer": true, "requires": { "base64-arraybuffer": "^0.2.0", "bignumber.js": "^9.0.0", @@ -13813,6 +13906,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-0.15.6.tgz", "integrity": "sha512-Q9PGvhTE/1dTLfSo0pu0+ifzA7NA4X1rgSy9TE6O1Glk6Kl8Nf+Pg2sCHS2hWt0RAiKfR2glEVlbUAm6S8vRxA==", + "peer": true, "requires": { "ts-node": "^10.8.2" } @@ -13821,6 +13915,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-0.15.6.tgz", "integrity": "sha512-hzTyKXAWPHxkZkOWxGj4JUITwdv92VEKnh3l334Yk9h6aw3m7Gi/ujEBLfszsl0LUA82tV4W2MDIz99KMAuW+g==", + "peer": true, "requires": { "borc": "^2.1.1", "js-sha256": "^0.9.0", @@ -13885,6 +13980,7 @@ "version": "0.15.6", "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-0.15.6.tgz", "integrity": "sha512-eMsS5YofRk5Hm6LlhzyBvw1RzDxM5FWPtepQuYeZbZyD/ztq4TrUiScqoKBFw/LLODd0znt8rGnNgqtt+7JnQA==", + "peer": true, "requires": { "js-sha256": "^0.9.0", "ts-node": "^10.8.2" @@ -15065,22 +15161,26 @@ "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", - "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==" + "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", + "peer": true }, "@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", - "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==" + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "peer": true }, "@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", - "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==" + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "peer": true }, "@tsconfig/node16": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.3.tgz", - "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==" + "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==", + "peer": true }, "@types/aws-lambda": { "version": "8.10.136", @@ -15407,7 +15507,8 @@ "acorn-walk": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "peer": true }, "aggregate-error": { "version": "3.1.0", @@ -15470,7 +15571,8 @@ "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==" + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "peer": true }, "argparse": { "version": "2.0.1", @@ -16218,7 +16320,8 @@ "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "peer": true }, "cross-fetch": { "version": "3.1.5", @@ -16712,7 +16815,8 @@ "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "peer": true }, "diff-sequences": { "version": "29.0.0", @@ -16810,9 +16914,9 @@ "dev": true }, "elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.0.tgz", + "integrity": "sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA==", "requires": { "bn.js": "^4.11.9", "brorand": "^1.1.0", @@ -18114,15 +18218,63 @@ } }, "ic0": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/ic0/-/ic0-0.2.7.tgz", - "integrity": "sha512-RrFMH1YrWx//4VguTD7V51schSZxtJpooCwJ+q1GrlRPCkffDdxVXlwz3F1B/0OT7lSQ48NLa0NGzuL0tI9eRg==", - "requires": { - "@dfinity/agent": "^0.15.1", - "@dfinity/candid": "^0.15.1", - "@dfinity/identity": "^0.15.1", - "@dfinity/principal": "^0.15.1", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/ic0/-/ic0-0.3.1.tgz", + "integrity": "sha512-jJ98/vQXJFbRRjq6BgN02lNAjsG7kCQbC/vX0oy4LvZtzO7WiDuu+OYmoKJuDUJwX7e6wOJ9aNBhs5L7jjhqXA==", + "requires": { + "@dfinity/agent": "^2.1.3", + "@dfinity/candid": "^2.1.3", + "@dfinity/identity": "^2.1.3", + "@dfinity/principal": "^2.1.3", "cross-fetch": "^3.1.5" + }, + "dependencies": { + "@dfinity/agent": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/agent/-/agent-2.1.3.tgz", + "integrity": "sha512-4XmqhFR3GQSUrmx7lMFx7DyHEhFkM6nz4O9FeYJ/WpkmPe8tulKaAfgWbWdTSCjbd8meCgKVHo+QYj+JHXagcw==", + "requires": { + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.3.1", + "base64-arraybuffer": "^0.2.0", + "borc": "^2.1.1", + "buffer": "^6.0.3", + "simple-cbor": "^0.4.1" + } + }, + "@dfinity/candid": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/candid/-/candid-2.1.3.tgz", + "integrity": "sha512-Asn7AfydLhhk7E5z9oW+5UL6ne11gxFlYTxHuhrIc7FdqYlM5Flcq1Wfg9EzRa6Btdol3w58Bcph7Brwh1bcIQ==", + "requires": {} + }, + "@dfinity/identity": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/identity/-/identity-2.1.3.tgz", + "integrity": "sha512-qII0V91S1YeIz5/XRHomwrUhTME+C3oqdTnb99tBitXA2Gq6LU2JaCLbKbN7ehhSyW6EjO4tySJxANz6hYENcQ==", + "requires": { + "@noble/curves": "^1.2.0", + "@noble/hashes": "^1.3.1", + "borc": "^2.1.1" + } + }, + "@dfinity/principal": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@dfinity/principal/-/principal-2.1.3.tgz", + "integrity": "sha512-HtiAfZcs+ToPYFepVJdFlorIfPA56KzC6J97ZuH2lGNMTAfJA+NEBzLe476B4wVCAwZ0TiGJ27J4ks9O79DFEg==", + "requires": { + "@noble/hashes": "^1.3.1" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + } } }, "ieee754": { @@ -19678,7 +19830,8 @@ "js-sha256": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/js-sha256/-/js-sha256-0.9.0.tgz", - "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==" + "integrity": "sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==", + "peer": true }, "js-tokens": { "version": "4.0.0", @@ -20692,9 +20845,9 @@ } }, "motoko": { - "version": "3.8.4", - "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.8.4.tgz", - "integrity": "sha512-ujlGRdK7b6vrSvdd51U2kWCwizcfeL7z04wWR8yp/EcDBvLxlr7KPLUeydR8IsjkTMEOV+MtV+z9dypgX+t3jA==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/motoko/-/motoko-3.9.0.tgz", + "integrity": "sha512-BtDmAX4/9ydy6UFhbuqK4skW3iEMyVIVRJMFspDJQwjYe8ozB/Mqc1FYQ+JEJVH2sDjD9LvJNe8NRgBteLfxDg==", "requires": { "cross-fetch": "3.1.5", "debug": "4.3.4", @@ -22220,6 +22373,7 @@ "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "peer": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -22276,7 +22430,8 @@ "tweetnacl": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "peer": true }, "type-check": { "version": "0.4.0", @@ -22483,7 +22638,8 @@ "v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==" + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "peer": true }, "v8-to-istanbul": { "version": "9.0.1", @@ -22823,7 +22979,8 @@ "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==" + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "peer": true }, "yocto-queue": { "version": "0.1.0", diff --git a/package.json b/package.json index 31b7e8a..8a37fdc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-motoko", "displayName": "Motoko", "description": "Motoko language support", - "version": "0.16.11", + "version": "0.16.12", "publisher": "dfinity-foundation", "repository": "https://github.com/dfinity/vscode-motoko", "engines": { @@ -171,9 +171,9 @@ "execa": "4.1.0", "fast-glob": "3.2.12", "ic-mops": "0.45.3", - "ic0": "0.2.7", + "ic0": "0.3.1", "mnemonist": "0.39.5", - "motoko": "3.8.4", + "motoko": "3.9.0", "prettier": "2.8.0", "prettier-plugin-motoko": "0.9.2", "semver": "7.6.3", diff --git a/src/server/context.ts b/src/server/context.ts index fe24858..0130997 100644 --- a/src/server/context.ts +++ b/src/server/context.ts @@ -71,6 +71,12 @@ function requestMotokoInstance(uri: string, version: Version): Motoko { motoko = require(motokoPath).default; } } + // Required for deploying to Motoko Playground + motoko.setPublicMetadata([ + 'candid:service', + 'candid:args', + 'motoko:stable-types', + ]); motoko.loadPackage(baseLibrary); return motoko; } diff --git a/src/server/playground.ts b/src/server/playground.ts index 7affc81..87e4147 100644 --- a/src/server/playground.ts +++ b/src/server/playground.ts @@ -98,41 +98,37 @@ export async function deployPlayground( wasm: Uint8Array, profiling: ProfilingConfig | null, ): Promise { - try { - let updatedState: CanisterInfo | null = null; - if (!canisterInfo) { - if (mode !== 'install') { - throw new Error(`Cannot '${mode}' for new canister`); - } - canisterInfo = await createCanister(); - notify('Deploying...'); - updatedState = await install( - canisterInfo, - wasm, - args, - 'install', - profiling, - ); - } else { - if (mode !== 'reinstall' && mode !== 'upgrade') { - throw new Error(`Unknown mode '${mode}'`); - } - notify('Deploying...'); - updatedState = await install( - canisterInfo, - wasm, - args, - mode, - profiling, - ); + let updatedState: CanisterInfo | null = null; + if (!canisterInfo) { + if (mode !== 'install') { + throw new Error(`Cannot '${mode}' for new canister`); + } + canisterInfo = await createCanister(); + notify(`Deploying ${canisterInfo.id}...`); + updatedState = await install( + canisterInfo, + wasm, + args, + 'install', + profiling, + ); + } else { + if (mode !== 'reinstall' && mode !== 'upgrade') { + throw new Error(`Unknown mode '${mode}'`); } - //updatedState.candid = candid_source; - updatedState.name = canisterName; - return updatedState; - } catch (err) { - // logger.log(err.message); - throw err; + notify(`Deploying ${canisterInfo.id}...`); + updatedState = await install( + canisterInfo, + wasm, + args, + mode, + profiling, + ); } + console.log('Finished deploying canister'); + //updatedState.candid = candid_source; + updatedState.name = canisterName; + return updatedState; } async function createCanister(): Promise { @@ -158,7 +154,7 @@ export async function deployPlayground( ): Promise { notify('Installing WebAssembly...'); if (!canisterInfo) { - throw new Error('No canister id'); + throw new Error('No canister ID'); } const canisterId = canisterInfo.id; const installArgs = { @@ -181,6 +177,7 @@ export async function deployPlayground( installConfig, ); canisterInfo = newInfo; + console.log(`Code installed at canister ID: ${canisterInfo.id}`); return canisterInfo; } diff --git a/src/server/server.ts b/src/server/server.ts index c969163..cbfb6ea 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -228,6 +228,7 @@ async function getPackageSources( let loadingPackages = false; let packageConfigChangeTimeout: ReturnType; function notifyPackageConfigChange(reuseCached = false) { + isWorkspaceReady = false; if (!reuseCached) { packageSourceCache.clear(); } @@ -363,6 +364,7 @@ function notifyPackageConfigChange(reuseCached = false) { let dfxResolver: DfxResolver | undefined; let dfxChangeTimeout: ReturnType; function notifyDfxChange() { + isWorkspaceReady = false; clearTimeout(dfxChangeTimeout); dfxChangeTimeout = setTimeout(async () => { try { @@ -751,6 +753,7 @@ function unscheduleCheck(uri: string) { } } +let isWorkspaceReady = false; let previousCheckedFiles: string[] = []; let checkWorkspaceTimeout: ReturnType; /** @@ -815,6 +818,7 @@ function checkWorkspace() { checkedFiles.forEach((uri) => notify(uri)); checkedFiles.forEach((uri) => scheduleCheck(uri)); previousCheckedFiles = checkedFiles; + isWorkspaceReady = true; } catch (err) { console.error('Error while finding dfx canister paths'); console.error(err); @@ -1449,7 +1453,7 @@ connection.onReferences( // Run a file which is recognized as a unit test connection.onRequest(TEST_FILE_REQUEST, async (event): Promise => { - while (loadingPackages) { + while (!isWorkspaceReady) { // Load all packages before running tests await new Promise((resolve) => setTimeout(resolve, 500)); } @@ -1521,11 +1525,24 @@ connection.onRequest(TEST_FILE_REQUEST, async (event): Promise => { }); // Deploy to Motoko Playground -connection.onRequest(DEPLOY_PLAYGROUND, (params) => - deployPlayground(params, (message) => - connection.sendNotification(DEPLOY_PLAYGROUND_MESSAGE, { message }), - ), -); +connection.onRequest(DEPLOY_PLAYGROUND, async (params) => { + const notify = (message: string) => { + console.log(message); + connection.sendNotification(DEPLOY_PLAYGROUND_MESSAGE, { message }); + }; + try { + if (!isWorkspaceReady) { + notify('Loading workspace...'); + while (!isWorkspaceReady) { + await new Promise((resolve) => setTimeout(resolve, 200)); + } + } + return deployPlayground(params, notify); + } catch (err) { + console.error(err); + throw err; + } +}); // Install and import mops package connection.onRequest(IMPORT_MOPS_PACKAGE, async (params) => {