Skip to content

Commit 6ca7de8

Browse files
authored
chore(web): use a separate tsconfig for emitting declarations so that sandbox code is not included (#5341)
1 parent 55852ca commit 6ca7de8

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

packages/compass-web/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
"compass:exports": {
3232
".": "./src/index.tsx"
3333
},
34-
"types": "./dist/src/index.d.ts",
34+
"types": "./dist/index.d.ts",
3535
"scripts": {
3636
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
3737
"compile": "npm run webpack -- --mode production",
3838
"webpack": "webpack-compass",
39-
"postcompile": "tsc --emitDeclarationOnly",
39+
"postcompile": "tsc -p tsconfig-build.json --emitDeclarationOnly",
4040
"start": "npm run webpack serve -- --mode development",
4141
"analyze": "npm run webpack -- --mode production --analyze",
4242
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// We include sandbox code in default tsconfig, but it affects emitted file
2+
// paths. This is a special tsconfig for postcompile task so that the
3+
// declarations emitted are only for files we actually want to publish
4+
{
5+
"extends": "./tsconfig.json",
6+
"include": ["src/**/*"],
7+
"exclude": ["./src/**/*.spec.*"]
8+
}

packages/compass-web/tsconfig.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
"compilerOptions": {
44
"outDir": "dist"
55
},
6-
"include": ["src/**/*", "sandbox/**/*"],
6+
"include": [
7+
"src/**/*",
8+
// Including sandbox so that ts check and editor intellisense can provide
9+
// useful information when working in the sandbox. It needs to be in the
10+
// default tsconfig file
11+
"sandbox/**/*"
12+
],
713
"exclude": ["./src/**/*.spec.*"]
814
}

0 commit comments

Comments
 (0)