Repository navigation
chore: fix build for checkouts under a dot-directory - #2893
Merged
Merged
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With the repo checked out under a dot-directory (for example a worktree in
~/.t3/worktrees/...or~/.worktrees/...),yarn buildproduced broken output and tests and lint failed:babel.config.jsapplied@babel/preset-typescriptthrough a**/*.tsglob, which doesn't match paths with a dot segment. TypeScript went through untranspiled, sobuild/*.jscontained type annotations.scripts/build.jsmatched**/*.js,**/*.tsand**/__{tests,mocks,fixtures}__/**against absolute paths, so.tsfiles were copied as-is instead of compiled, and test folders ended up inbuild/.Changes:
babel.config.js: the TypeScript override uses/\.ts$/instead of the glob.scripts/build.js: globs are matched against the path relative topackages/, so the checkout location no longer matters.Test Plan
Fresh checkout of
mainunder a dot-directory:packages/cli-tools/build/logger.js__tests__folders inbuild/yarn jest packagescli-config-applealoneyarn lintimport/namespaceerrorsA build of the same commit from a path without a dot segment produces byte-identical
build/**/*.js.