Skip to content

Commit

Permalink
Fix import of typescript module from typescript worker
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfagnani committed Aug 19, 2024
1 parent a16e91a commit 2df8848
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 26 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
],
"files": [
"tsconfig.json",
"tsconfig-typescript-worker.json",
"src/**/tsconfig.json",
"src/**/*.ts"
],
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.web-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as path from 'path';
const internalTypescriptPath = path.resolve(process.cwd(), 'internal/typescript.js');

export default {
input: 'typescript-worker/playground-typescript-worker.js',
input: 'playground-typescript-worker-entrypoint.js',
external(id, parentId, isResolved) {
if (!isResolved && parentId !== undefined) {
id = path.resolve(path.dirname(parentId), id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
*/

import {expose} from 'comlink';
import {build} from './build.js';
import {WorkerAPI} from '../shared/worker-api.js';
import {getCompletionItemDetails, queryCompletions} from './completions.js';
import {build} from './typescript-worker/build.js';
import {WorkerAPI} from './shared/worker-api.js';
import {
getCompletionItemDetails,
queryCompletions,
} from './typescript-worker/completions.js';

const workerAPI: WorkerAPI = {
compileProject: build,
Expand Down
20 changes: 0 additions & 20 deletions src/typescript-worker/tsconfig.json

This file was deleted.

24 changes: 24 additions & 0 deletions tsconfig-typescript-worker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "./",
"rootDir": "./src",
"tsBuildInfoFile": "./typescript-worker/.tsbuildinfo",
"target": "es2019",
"lib": ["ES2020", "WebWorker"],
"skipLibCheck": true,
"skipDefaultLibCheck": true
},
"include": [
"src/typescript-worker/*.ts",
"src/typescript-worker/**/*.ts",
"src/playground-typescript-worker-entrypoint.ts"
],
"exclude": [],
"references": [
{
"path": "./src/shared"
}
]
}
9 changes: 7 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@
"src/internal/worker-api.ts",
"src/shared/util.ts"
],
"exclude": ["src/service-worker", "src/shared", "src/typescript-worker"],
"exclude": [
"src/service-worker",
"src/shared",
"src/typescript-worker",
"src/playground-typescript-worker-entrypoint.ts"
],
"references": [
{
"path": "src/service-worker"
Expand All @@ -43,7 +48,7 @@
"path": "src/shared"
},
{
"path": "src/typescript-worker"
"path": "./tsconfig-typescript-worker.json"
}
]
}

0 comments on commit 2df8848

Please sign in to comment.