Skip to content

Commit 28f1f39

Browse files
committed
try tweaks to tsconfigs to allow typechecking dist-raw APIs
1 parent c00942f commit 28f1f39

5 files changed

+28
-20
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"rebuild": "npm run clean && npm run build",
6161
"build": "npm run build-nopack && npm run build-pack",
6262
"build-nopack": "npm run build-tsc && npm run build-configSchema",
63-
"build-tsc": "tsc --build ./tsconfig.build.json",
63+
"build-tsc": "tsc --build ./tsconfig.declarations.json && ( rm -r .tmp/declarations/src 2> /dev/null || true) && tsc --build ./tsconfig.build.json",
6464
"build-configSchema": "typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema",
6565
"build-pack": "node ./scripts/build-pack.js",
6666
"test-spec": "ava",

tsconfig.build-dist-raw.json

-16
This file was deleted.

tsconfig.build.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
// so that `src`->`dist` paths map correctly.
88

99
"extends": "./tsconfig.json",
10-
"references": [{
11-
"path": "./tsconfig.build-dist-raw.json"
12-
}],
1310
"compilerOptions": {
1411
"noEmit": false,
1512
"allowJs": false,
1613
"rootDir": "src",
14+
"rootDirs": [
15+
".",
16+
".tmp/declarations"
17+
],
1718
"outDir": "dist",
1819
"tsBuildInfoFile": ".tmp/tsconfig.build.tsbuildinfo",
1920
}

tsconfig.declarations.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// Purpose: to extract .d.ts declarations from dist-raw
3+
"extends": "./tsconfig.json",
4+
"include": [
5+
"src",
6+
"dist-raw"
7+
],
8+
"compilerOptions": {
9+
"incremental": true,
10+
"allowJs": true,
11+
"emitDeclarationOnly": true,
12+
"stripInternal": false,
13+
"noEmit": false,
14+
"rootDir": ".",
15+
"outDir": ".tmp/declarations",
16+
"tsBuildInfoFile": ".tmp/tsconfig.declarations.tsbuildinfo",
17+
}
18+
}

tsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
{
2+
// Role: support editor code intelligence
3+
4+
// Note: this tsconfig is not used for compiling.
5+
// See tsconfig.declarations.json and tsconfig.build.json
6+
27
"$schema": "./tsconfig.schemastore-schema.json",
38
"compilerOptions": {
49
"allowJs": true,

0 commit comments

Comments
 (0)