Skip to content

Commit

Permalink
chore(web): use a separate tsconfig for emitting declarations so that…
Browse files Browse the repository at this point in the history
… sandbox code is not included (#5341)
  • Loading branch information
gribnoysup committed Jan 15, 2024
1 parent 55852ca commit 6ca7de8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/compass-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
"compass:exports": {
".": "./src/index.tsx"
},
"types": "./dist/src/index.d.ts",
"types": "./dist/index.d.ts",
"scripts": {
"prepublishOnly": "npm run compile && compass-scripts check-exports-exist",
"compile": "npm run webpack -- --mode production",
"webpack": "webpack-compass",
"postcompile": "tsc --emitDeclarationOnly",
"postcompile": "tsc -p tsconfig-build.json --emitDeclarationOnly",
"start": "npm run webpack serve -- --mode development",
"analyze": "npm run webpack -- --mode production --analyze",
"typecheck": "tsc -p tsconfig-lint.json --noEmit",
Expand Down
8 changes: 8 additions & 0 deletions packages/compass-web/tsconfig-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// We include sandbox code in default tsconfig, but it affects emitted file
// paths. This is a special tsconfig for postcompile task so that the
// declarations emitted are only for files we actually want to publish
{
"extends": "./tsconfig.json",
"include": ["src/**/*"],
"exclude": ["./src/**/*.spec.*"]
}
8 changes: 7 additions & 1 deletion packages/compass-web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"compilerOptions": {
"outDir": "dist"
},
"include": ["src/**/*", "sandbox/**/*"],
"include": [
"src/**/*",
// Including sandbox so that ts check and editor intellisense can provide
// useful information when working in the sandbox. It needs to be in the
// default tsconfig file
"sandbox/**/*"
],
"exclude": ["./src/**/*.spec.*"]
}

0 comments on commit 6ca7de8

Please sign in to comment.