Skip to content

Commit 96b1871

Browse files
bajtosraymondfeng
authored andcommitted
feat: enable declarationMap, use .d.ts files in monorepo too
Configure TSC to emit declaration maps, providing information needed by IDEs like VSCode to jump from usage of a symbol to its definition in the original source code. Simplify layout of all packages, remove top-level `index.ts` and `index.d.ts` files in favor of a package.json entry "types": "dist/index.d.ts" Simplify layout of module packages (excluding example applications) and remove the top-level `index.js` file in favor of a package.json entry "main": "dist/index.js" Update developer documentation and project templates accordingly. Benefits of these changes: - It's a preparation step for TypeScript Project References - Build is consuming less CPU cycles now. User time used to be 5m21 before, it's 1m48s now. Real time went down from 0m49s to 0m37s. - Simpler project setup in our packages, we no longer need to maintain dummy index files at the top level. Drawbacks: - Refactor-rename does not work across packagas. I believe this is a limitation of TypeScript, hopefully it will be eventually fixed. - Navigation across packages may not work until the monorepo is built.
1 parent 202b2c7 commit 96b1871

100 files changed

Lines changed: 75 additions & 473 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

benchmark/index.ts

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

benchmark/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"benchmark"
1010
],
1111
"main": "index.js",
12+
"types:": "dist/index.d.ts",
1213
"engines": {
1314
"node": ">=8.9"
1415
},

docs/site/DEVELOPING.md

Lines changed: 0 additions & 5 deletions

docs/site/VSCODE.md

Lines changed: 17 additions & 3 deletions

examples/express-composition/index.d.ts

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

examples/express-composition/index.ts

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

examples/express-composition/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"express"
1111
],
1212
"main": "index.js",
13+
"types": "dist/index.d.ts",
1314
"engines": {
1415
"node": ">=8.9"
1516
},

examples/hello-world/index.d.ts

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

examples/hello-world/index.ts

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

examples/hello-world/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.1.20",
44
"description": "A simple hello-world Application using LoopBack 4",
55
"main": "index.js",
6+
"types": "dist/index.d.ts",
67
"engines": {
78
"node": ">=8.9"
89
},

0 commit comments

Comments
 (0)