Skip to content

Commit 3f89dc6

Browse files
Fix import of typescript module from typescript worker (#413)
1 parent a16e91a commit 3f89dc6

File tree

7 files changed

+44
-28
lines changed

7 files changed

+44
-28
lines changed

.eslintrc.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@
3030
}
3131
},
3232
{
33-
"files": ["src/typescript-worker/**"],
33+
"files": [
34+
"src/typescript-worker/**",
35+
"src/playground-typescript-worker-entrypoint.ts"
36+
],
3437
"parserOptions": {
35-
"project": "./src/typescript-worker/tsconfig.json"
38+
"project": "./tsconfig-typescript-worker.json"
3639
}
3740
},
3841
{

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
],
6060
"files": [
6161
"tsconfig.json",
62+
"tsconfig-typescript-worker.json",
6263
"src/**/tsconfig.json",
6364
"src/**/*.ts"
6465
],

rollup.config.web-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as path from 'path';
1111
const internalTypescriptPath = path.resolve(process.cwd(), 'internal/typescript.js');
1212

1313
export default {
14-
input: 'typescript-worker/playground-typescript-worker.js',
14+
input: 'playground-typescript-worker-entrypoint.js',
1515
external(id, parentId, isResolved) {
1616
if (!isResolved && parentId !== undefined) {
1717
id = path.resolve(path.dirname(parentId), id);

src/typescript-worker/playground-typescript-worker.ts renamed to src/playground-typescript-worker-entrypoint.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@
55
*/
66

77
import {expose} from 'comlink';
8-
import {build} from './build.js';
9-
import {WorkerAPI} from '../shared/worker-api.js';
10-
import {getCompletionItemDetails, queryCompletions} from './completions.js';
8+
import {build} from './typescript-worker/build.js';
9+
import {WorkerAPI} from './shared/worker-api.js';
10+
import {
11+
getCompletionItemDetails,
12+
queryCompletions,
13+
} from './typescript-worker/completions.js';
1114

1215
const workerAPI: WorkerAPI = {
1316
compileProject: build,

src/typescript-worker/tsconfig.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

tsconfig-typescript-worker.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"composite": true,
5+
"outDir": "./",
6+
"rootDir": "./src",
7+
"tsBuildInfoFile": "./typescript-worker/.tsbuildinfo",
8+
"target": "es2019",
9+
"lib": ["ES2020", "WebWorker"],
10+
"skipLibCheck": true,
11+
"skipDefaultLibCheck": true
12+
},
13+
"include": [
14+
"src/typescript-worker/*.ts",
15+
"src/typescript-worker/**/*.ts",
16+
"src/playground-typescript-worker-entrypoint.ts"
17+
],
18+
"exclude": [],
19+
"references": [
20+
{
21+
"path": "./src/shared"
22+
}
23+
]
24+
}

tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@
3434
"src/internal/worker-api.ts",
3535
"src/shared/util.ts"
3636
],
37-
"exclude": ["src/service-worker", "src/shared", "src/typescript-worker"],
37+
"exclude": [
38+
"src/service-worker",
39+
"src/shared",
40+
"src/typescript-worker",
41+
"src/playground-typescript-worker-entrypoint.ts"
42+
],
3843
"references": [
3944
{
4045
"path": "src/service-worker"
@@ -43,7 +48,7 @@
4348
"path": "src/shared"
4449
},
4550
{
46-
"path": "src/typescript-worker"
51+
"path": "./tsconfig-typescript-worker.json"
4752
}
4853
]
4954
}

0 commit comments

Comments
 (0)