-
Notifications
You must be signed in to change notification settings - Fork 682
Conversation
doing this to make way for a root tsconfig.json so we can build all projects via a root tsconfig
ed91003
to
660d7fb
Compare
660d7fb
to
e44f237
Compare
7545f0d
to
2988112
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things. It may also be good to add something in CONTRIBUTING.md
explaining that npm run tsc
will only compile dependencies/subdependencies of packages/ganache
. This is primarily useful for any newcomers adding a new package that hasn't yet hooked it all up
Alternatively, you can add all the leaf packages to the root tsconfig.json
's references
. It shouldn't compile them more than once, but it would create a design that suggests users need to add it there for their package to compile (despite, yes only having packages/ganache
would do anything that mattered for release at the very moment, but not always so in development)
@seesemichaelj Ah, that's a really good point. I've added a note to |
Each project extends the root tsconfig-base.json now. This file is now our centralized common compiler options.
We now have a "solution" tsconfig.json file that simply has a reference to our "leaf-node" project,
ganache
, with"files"
set to an empty array (otherwise the solution file will cause double compilation of files).This presents a simple entry point; e.g. we simply run
tsc --build
to build all endpoints because we list our "subproject" (ganache) as a reference in our "solution"tsconfig.json
You can find examples of this pattern in the typescript repo: src/tsconfig_base.json, src/tsconfig.json, and src/tsc/tsconfig.json.
TypeScript documentation outlines this project structure here: https://www.typescriptlang.org/docs/handbook/project-references.html#overall-structure