diff --git a/examples/simple_erc20/package-lock.json b/examples/simple_erc20/package-lock.json index 65bfda8c0f..1fce933a8f 100644 --- a/examples/simple_erc20/package-lock.json +++ b/examples/simple_erc20/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@dfinity/agent": "0.11.1", "ts-node": "10.7.0", - "typescript": "4.6.3" + "typescript": "^5.2.2" } }, "node_modules/@adraffy/ens-normalize": { @@ -953,18 +953,6 @@ } } }, - "node_modules/azle/node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/base-x": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", @@ -2142,15 +2130,15 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/universalify": { @@ -2760,11 +2748,6 @@ "make-error": "^1.1.1", "yn": "3.1.1" } - }, - "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" } } }, @@ -3724,9 +3707,9 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==" }, "universalify": { "version": "2.0.0", diff --git a/examples/simple_erc20/package.json b/examples/simple_erc20/package.json index 12850d628c..8136defd44 100644 --- a/examples/simple_erc20/package.json +++ b/examples/simple_erc20/package.json @@ -10,6 +10,6 @@ "devDependencies": { "@dfinity/agent": "0.11.1", "ts-node": "10.7.0", - "typescript": "4.6.3" + "typescript": "^5.2.2" } } diff --git a/examples/simple_erc20/test/tests.ts b/examples/simple_erc20/test/tests.ts index 0aa19a3541..5d27f017dd 100644 --- a/examples/simple_erc20/test/tests.ts +++ b/examples/simple_erc20/test/tests.ts @@ -1,9 +1,8 @@ import { ActorSubclass } from '@dfinity/agent'; import { Test } from 'azle/test'; +import { Service } from 'service'; -import { _SERVICE } from './dfx_generated/simple_erc20/simple_erc20.did'; - -export function getTests(simpleErc20Canister: ActorSubclass<_SERVICE>): Test[] { +export function getTests(simpleErc20Canister: ActorSubclass): Test[] { return [ { name: 'empty name', diff --git a/examples/simple_erc20/test/types.d.ts b/examples/simple_erc20/test/types.d.ts new file mode 100644 index 0000000000..6900780140 --- /dev/null +++ b/examples/simple_erc20/test/types.d.ts @@ -0,0 +1,5 @@ +import { _SERVICE } from './dfx_generated/simple_erc20/simple_erc20.did'; + +declare module 'service' { + export type Service = _SERVICE; +} diff --git a/examples/simple_erc20/tsconfig.json b/examples/simple_erc20/tsconfig.json index 2638f0d8bc..a13ea7385a 100644 --- a/examples/simple_erc20/tsconfig.json +++ b/examples/simple_erc20/tsconfig.json @@ -4,6 +4,9 @@ "target": "ES2020", "moduleResolution": "node", "allowJs": true, - "outDir": "HACK_BECAUSE_OF_ALLOW_JS" + "outDir": "HACK_BECAUSE_OF_ALLOW_JS", + "paths": { + "service": ["./test/types.d.ts"] + } } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package-lock.json b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package-lock.json index b6299c396c..d679f3b47f 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package-lock.json +++ b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package-lock.json @@ -5,16 +5,18 @@ "packages": { "": { "dependencies": { - "azle": "0.22.0", - "simple_erc20_end_to_end_test_canister_syntax": "file:../../../../../examples/simple_erc20" + "azle": "0.22.0" }, "devDependencies": { "@dfinity/agent": "0.11.1", + "simple_erc20_end_to_end_test_canister_syntax": "file:../../../../../examples/simple_erc20", "ts-node": "10.7.0", - "typescript": "4.6.3" + "typescript": "^5.2.2" } }, "../../../../../examples/simple_erc20": { + "name": "simple_erc20_end_to_end_test_canister_syntax", + "dev": true, "dependencies": { "azle": "0.22.0" }, @@ -963,18 +965,6 @@ } } }, - "node_modules/azle/node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "node_modules/base-x": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", @@ -2156,15 +2146,15 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/universalify": { @@ -2774,11 +2764,6 @@ "make-error": "^1.1.1", "yn": "3.1.1" } - }, - "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" } } }, @@ -3747,9 +3732,9 @@ "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==" }, "universalify": { "version": "2.0.0", diff --git a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package.json b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package.json index 2eead2c20a..ed78fa20ff 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package.json +++ b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/package.json @@ -10,6 +10,6 @@ "@dfinity/agent": "0.11.1", "simple_erc20_end_to_end_test_canister_syntax": "file:../../../../../examples/simple_erc20", "ts-node": "10.7.0", - "typescript": "4.6.3" + "typescript": "^5.2.2" } } diff --git a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/tsconfig.json b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/tsconfig.json index 9599134d91..30f304df17 100644 --- a/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/tsconfig.json +++ b/tests/end_to_end/candid_rpc/class_syntax/simple_erc20/tsconfig.json @@ -5,6 +5,9 @@ "moduleResolution": "node", "allowJs": true, "outDir": "HACK_BECAUSE_OF_ALLOW_JS", - "experimentalDecorators": true + "experimentalDecorators": true, + "paths": { + "service": ["../../../../types/service.d.ts"] + } } } diff --git a/tests/types/service.d.ts b/tests/types/service.d.ts new file mode 100644 index 0000000000..22f71f0f8f --- /dev/null +++ b/tests/types/service.d.ts @@ -0,0 +1,3 @@ +declare module 'service' { + export type Service = any; +}