From 9485aa6f50e52336a6fb29b87529ff9b993221b1 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Wed, 28 Aug 2024 15:27:43 +0300 Subject: [PATCH] refactor(typescript): use node16 moduleResolution added missing project references worked around vlq having no "types" inside its "exports" --- packages/dom-test-kit/test/tsconfig.json | 1 + packages/runtime/src/tsconfig.esm.json | 3 ++- packages/uni-driver/test/tsconfig.json | 1 + tsconfig.base.json | 4 ++-- typings/externals/index.d.ts | 6 ++++++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/dom-test-kit/test/tsconfig.json b/packages/dom-test-kit/test/tsconfig.json index 8c8fe988a..79b26bd0c 100644 --- a/packages/dom-test-kit/test/tsconfig.json +++ b/packages/dom-test-kit/test/tsconfig.json @@ -7,6 +7,7 @@ "references": [ { "path": "../../runtime/src" }, { "path": "../../core-test-kit/src" }, + { "path": "../../e2e-test-kit/src" }, { "path": "../src" } ] } diff --git a/packages/runtime/src/tsconfig.esm.json b/packages/runtime/src/tsconfig.esm.json index fcbff8c92..2ef68c6dd 100644 --- a/packages/runtime/src/tsconfig.esm.json +++ b/packages/runtime/src/tsconfig.esm.json @@ -2,6 +2,7 @@ "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "../esm", - "module": "ESNext" + "module": "esnext", + "moduleResolution": "node" } } diff --git a/packages/uni-driver/test/tsconfig.json b/packages/uni-driver/test/tsconfig.json index 58c3843f3..c6a69f5b7 100644 --- a/packages/uni-driver/test/tsconfig.json +++ b/packages/uni-driver/test/tsconfig.json @@ -6,6 +6,7 @@ }, "references": [ { "path": "../../dom-test-kit/src" }, + { "path": "../../dom-test-kit/test" }, { "path": "../../core-test-kit/src" }, { "path": "../src" } ] diff --git a/tsconfig.base.json b/tsconfig.base.json index 733bb0c11..3d4978ecd 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -25,9 +25,9 @@ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ - "module": "commonjs", /* Specify what module code is generated. */ + "module": "node16", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + "moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ diff --git a/typings/externals/index.d.ts b/typings/externals/index.d.ts index 4c51f3a2b..9c5325c52 100644 --- a/typings/externals/index.d.ts +++ b/typings/externals/index.d.ts @@ -3,6 +3,12 @@ declare module 'enhanced-resolve/lib/ResolverFactory.js' { export = ResolverFactory; } +declare module 'vlq' { + // can be removed if https://github.com/Rich-Harris/vlq/pull/19 is merged/released + const VLQ: typeof import('../../node_modules/vlq/types'); + export = VLQ; +} + declare module 'is-vendor-prefixed' { function isVendorPrefixed(value: string): boolean; export = isVendorPrefixed;