Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

chore: enabling building from root #777

Merged
merged 8 commits into from
Feb 15, 2021
Merged

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented Feb 8, 2021

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

doing this to make way for a root tsconfig.json so we can build all
projects via a root tsconfig
@mikeseese mikeseese self-requested a review February 10, 2021 16:30
@davidmurdoch davidmurdoch force-pushed the chore/build-process branch 2 times, most recently from ed91003 to 660d7fb Compare February 12, 2021 17:36
@davidmurdoch davidmurdoch marked this pull request as draft February 12, 2021 17:45
@davidmurdoch davidmurdoch removed the request for review from mikeseese February 12, 2021 17:45
@davidmurdoch davidmurdoch marked this pull request as ready for review February 12, 2021 19:02
.gitattributes Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Show resolved Hide resolved
scripts/create.ts Show resolved Hide resolved
scripts/create.ts Show resolved Hide resolved
Copy link
Contributor

@mikeseese mikeseese left a 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)

src/packages/flavors/tsconfig.json Show resolved Hide resolved
src/packages/options/tsconfig.json Show resolved Hide resolved
src/packages/utils/tsconfig.json Show resolved Hide resolved
src/tsconfig-base.json Outdated Show resolved Hide resolved
@davidmurdoch
Copy link
Member Author

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

@seesemichaelj Ah, that's a really good point. I've added a note to CONTRIBUTING.md.

@davidmurdoch davidmurdoch merged commit d9edb05 into develop Feb 15, 2021
@davidmurdoch davidmurdoch deleted the chore/build-process branch February 15, 2021 16:05
sambacha pushed a commit to contractshark/ganache-core that referenced this pull request Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants