diff --git a/build.js b/build.js index 19a0dfb..edcb865 100755 --- a/build.js +++ b/build.js @@ -21,7 +21,7 @@ await build({ // The file monaco-yaml/lib/esm/schemaSelectionHandlers.js imports code from the language // server part that we don’t want. onResolve({ filter: /\/schemaSelectionHandlers$/ }, () => ({ - path: fileURLToPath(new URL('src/fillers/schemaSelectionHandlers.ts', import.meta.url)) + path: fileURLToPath(new URL('fillers/schemaSelectionHandlers.ts', import.meta.url)) })) // The yaml language service only imports re-exports of vscode-languageserver-types from // vscode-languageserver. @@ -32,11 +32,11 @@ await build({ })) // Ajv would significantly increase bundle size. onResolve({ filter: /^ajv$/ }, () => ({ - path: fileURLToPath(new URL('src/fillers/ajv.ts', import.meta.url)) + path: fileURLToPath(new URL('fillers/ajv.ts', import.meta.url)) })) // We only need cloneDeep from lodash. This can be replaced with structuredClone. onResolve({ filter: /^lodash$/ }, () => ({ - path: fileURLToPath(new URL('src/fillers/lodash.ts', import.meta.url)) + path: fileURLToPath(new URL('fillers/lodash.ts', import.meta.url)) })) // The yaml language service uses path. We can stub it using path-browserify. onResolve({ filter: /^path$/ }, () => ({ @@ -53,7 +53,7 @@ await build({ })) // This tiny filler implementation serves all our needs. onResolve({ filter: /vscode-nls/ }, () => ({ - path: fileURLToPath(new URL('src/fillers/vscode-nls.ts', import.meta.url)), + path: fileURLToPath(new URL('fillers/vscode-nls.ts', import.meta.url)), sideEffects: false })) // The language server dependencies tend to write both ESM and UMD output alongside each diff --git a/examples/demo/tsconfig.json b/examples/demo/tsconfig.json new file mode 100644 index 0000000..9536a0f --- /dev/null +++ b/examples/demo/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} diff --git a/src/fillers/ajv.ts b/fillers/ajv.ts similarity index 100% rename from src/fillers/ajv.ts rename to fillers/ajv.ts diff --git a/src/fillers/lodash.ts b/fillers/lodash.ts similarity index 100% rename from src/fillers/lodash.ts rename to fillers/lodash.ts diff --git a/src/fillers/schemaSelectionHandlers.ts b/fillers/schemaSelectionHandlers.ts similarity index 100% rename from src/fillers/schemaSelectionHandlers.ts rename to fillers/schemaSelectionHandlers.ts diff --git a/fillers/tsconfig.json b/fillers/tsconfig.json new file mode 100644 index 0000000..4eb37fe --- /dev/null +++ b/fillers/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.base.json" +} diff --git a/src/fillers/vscode-nls.ts b/fillers/vscode-nls.ts similarity index 100% rename from src/fillers/vscode-nls.ts rename to fillers/vscode-nls.ts diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 0000000..4eb37fe --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.base.json" +} diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..a3f1ffa --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "nodenext", + "noEmit": true, + "resolveJsonModule": true, + "skipLibCheck": true, + "strict": true, + "types": [] + } +} diff --git a/tsconfig.json b/tsconfig.json index 0586f52..4c98438 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,8 @@ { - "compilerOptions": { - "module": "nodenext", - "noEmit": true, - "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true, - "target": "es2017", - "types": [] - } + "files": [], + "references": [ + { "path": "./fillers/tsconfig.json" }, + { "path": "./src/tsconfig.json" }, + { "path": "./examples/demo/tsconfig.json" } + ] }