You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(compiler): add bin/, obj/ to tsp init .gitignore for C# server emitter - #12617
When you pick the C# server emitter in tsp init, the generated .gitignore now includes bin/ and obj/.
This doesn't matter if you scaffold into the default tsp-output folder, since that's already ignored. But if you scaffold somewhere else, for example {project-root}/server, git doesn't ignore the bin/ and obj/ folders from dotnet build, so they don't get ignored.
To avoid ignoring bin/ and obj/ in projects that don't use the C# server, I added an optional gitignorePatterns list to the emitters in the init template. tsp init adds the configured lines for each selected emitter.
The C# client emitter has the same issue. Happy to add bin/ and obj/ for it too (here or in a follow-up).
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The tests do not verify that unselected emitters’ patterns are excluded, leaving a key regression gap, and the changelog omits the required configuration example.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The scaffold’s pattern deduplication retains first occurrences, changing order-sensitive Git ignore behavior; it should retain last occurrences and include a regression test with a negated pattern.
Preserve last-occurrence order for duplicate ignore patterns
packages/compiler/src/init/scaffold.ts:240
The Set keeps the first occurrence of each pattern, which changes the meaning of order-sensitive Git ignore rules. For example, an emitter supplying ["*.log", "!keep.log", "*.log"] should ignore keep.log, but the generated file leaves it unignored. Retain the last occurrence of each pattern instead, and add a regression test with a negated pattern.
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
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.
When you pick the C# server emitter in
tsp init, the generated.gitignorenow includesbin/andobj/.This doesn't matter if you scaffold into the default
tsp-outputfolder, since that's already ignored. But if you scaffold somewhere else, for example{project-root}/server, git doesn't ignore thebin/andobj/folders fromdotnet build, so they don't get ignored.To avoid ignoring
bin/andobj/in projects that don't use the C# server, I added an optionalgitignorePatternslist to the emitters in the init template.tsp initadds the configured lines for each selected emitter.The C# client emitter has the same issue. Happy to add
bin/andobj/for it too (here or in a follow-up).Fixes #7336