-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: improve consistency This change is meant to fix the issue where dependencies may not be fully built when running `pnpm build` within a project. We used to be able to rely entirely on `tsc --build` to build transitive dependencies. Because `tsconfig.build.json` files all referenced the build configuration for the projects they needed, `tsc --build` would traverse the graph and ensure everything was built. Once we added our first Rust code, this was no longer true. Building `apps/scan/backend` would re-build the TypeScript code in `libs/ballot-interpreter`, but not the Rust code. We've lived with this mostly because that code doesn't change very often. However, it's never been a very good setup and has led to build caches being out of date and people getting fed up and running `pnpm -w clean-all` to start over, which is time-consuming. This change does the following: - ensure all `libs` and `apps` have both a `build` and `clean` script - make `build` and `clean` use `pnpm`'s recursive topologically-ordered script running to run `build:self` and `clean:self` for all dependencies, respectively - moves what used to be `build` and `clean` into `build:self` and `clean:self`, respectively - uses `tsc --build --clean` to remove `*.tsbuildinfo` files, but not to clear `build` (more on this below) - updates `cargo clean` calls to clean only files related to the current project Why remove `*.tsbuildinfo` files with `tsc --build --clean`? There are a couple reasons: - we use `noEmit: true` with `tsconfig.json` files because we only use those files for type checking (and so they include test files), so under normal circumstances we shouldn't have any `tsconfig.tsbuildinfo` files - the `tsconfig.build.tsbuildinfo` file associated with `tsconfig.build.json` is not necessarily adjacent to the file, for example if `rootDir` is set to `src/ts` and `outDir` is set to `build` then `tsconfig.build.tsbuildinfo` will actually be in the project's parent directory due to the way the path to the `*.tsbuildinfo` files are computed; using `tsc --build --clean` ensures the computed path matches that of `tsc --build` Related to the above, we don't rely on `tsc --build --clean` to clear `build` because it only removes files that would be output by `tsc --build`. If you rename a `.ts` file, you'll be stuck with its built `.js` file until you clear the `build` directory by some other means. There are further improvements I'd like to make, but this should at least ensure that running `pnpm build` in a project properly builds all of its dependencies, whether TypeScript or Rust. * build(admin): only build the frontend explicitly The backend will be built automatically. * build(admin): fix incorrect build directive * build: fix a couple remaining package scripts Missed a couple spots. * build: remove explicit `Makefile` dependency builds We no longer need these now that `pnpm build` knows how to build dependencies properly.
- Loading branch information
1 parent
4ed2678
commit 0f4c8ae
Showing
52 changed files
with
192 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,10 @@ | |
"author": "VotingWorks Eng <[email protected]>", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"build": "tsc --build tsconfig.build.json", | ||
"clean": "rm -rf build tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo", | ||
"build": "pnpm --filter $npm_package_name... build:self", | ||
"build:self": "tsc --build tsconfig.build.json", | ||
"clean": "pnpm --filter $npm_package_name... clean:self", | ||
"clean:self": "rm -rf build && tsc --build --clean tsconfig.build.json", | ||
"lint": "pnpm type-check && eslint .", | ||
"lint:fix": "pnpm type-check && eslint . --fix", | ||
"pre-commit": "lint-staged", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.