Skip to content

Conversation

ItsHarper
Copy link
Contributor

@ItsHarper ItsHarper commented Aug 15, 2025

Context

Step 4 for #928. View isolated diff and CI results here: ItsHarper#7

At time of writing, the isolated diff has +112, -128 lines added/removed.

This change is ready-to-go, but I'm marking it as a draft until #929 has been merged, as it is relatively difficult to review in this context until that happens.

Description

This PR has two main effects:

  • Uses a single tsc instance to build every package in the workspace instead of using pnpm to call the build script on each package individually

    • This brings the no-changes, disk-cache-warm, incremental, whole-project build time down to about 650ms on my computer (from about 1.5-1.8 seconds in chore: update typescript #931 and about 2.4 seconds in Ensure local deps are up-to-date when testing or running the CLI locally #930).
    • This was accomplished using root-level tsconfig-workspace-analyze.json and tsconfig-workspace-build.json files, which merely reference all of the packages so that they can be built or analyzed together.
    • There's also a symlink at the root tsconfig.json that points to ts-config-workspace-analyze.json.
  • Consolidates all of the shared tsconfig.json and tsconfig.build.json options into tsconfig-base-analyze.json and tsconfig-base-build.json files located at the root

    • I used tsc --showConfig to verify that I wasn't changing any important compilation options.
    • The only meaningful difference should be that all packages are now compiled with "lib": ["es2015", "es2016"].
    • I discovered that cli/tsconfig.json was missing a reference to util (which was present in cli/tsconfig.build.json). Both of cli's tsconfig.json files now have the util reference.
Note for Windows users about the root `tsconfig.json` symlink

Symlinks on Windows

If you're using Windows, that likely won't work correctly (you'll end up with a useless text file instead of a symlink), and you'll have to either point your IDE at tsconfig-workspace-analyze.json manually, or enable symlinks using dev mode and set core.symlinks to true in your git config.


I added settings for the zed editor to make it recognize all of the new tsconfig files as such. I do not know if the same would be needed for VS Code.

While jest can run a package and its tests without needing a full build
step, it will use the last-built version of the other packages for its
dependencies, so we're not actually guaranteed to be testing the latest
state unless we build all of a package's local dependencies before we
start testing it.

The `test:watch` scripts have been removed, as a watch mode that tests
without building the dependencies is not reliable.

I don't think any local packages are getting injected, but I added
`syncInjectedDepsAfterScripts` to `pnpm-workspace.yaml` to be safe.

Since we're running tests in parallel, individual tests run slower, so
I had to increase some timeouts.
Replaces `codemod-dev` shell script with a new `cli` pnpm script in
the top-level package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant