Skip to content

Commit

Permalink
refactor(typescript): use node16 moduleResolution
Browse files Browse the repository at this point in the history
added missing project references
worked around vlq having no "types" inside its "exports"
  • Loading branch information
AviVahl committed Aug 28, 2024
1 parent 135229e commit 9485aa6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/dom-test-kit/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"references": [
{ "path": "../../runtime/src" },
{ "path": "../../core-test-kit/src" },
{ "path": "../../e2e-test-kit/src" },
{ "path": "../src" }
]
}
3 changes: 2 additions & 1 deletion packages/runtime/src/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../esm",
"module": "ESNext"
"module": "esnext",
"moduleResolution": "node"
}
}
1 change: 1 addition & 0 deletions packages/uni-driver/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
},
"references": [
{ "path": "../../dom-test-kit/src" },
{ "path": "../../dom-test-kit/test" },
{ "path": "../../core-test-kit/src" },
{ "path": "../src" }
]
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
6 changes: 6 additions & 0 deletions typings/externals/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9485aa6

Please sign in to comment.