refactor: move C# SDK to src/, codegen tooling to codegen/, dedupe README - #316
Merged
Merged
Conversation
…ADME Restructure the repository layout so the generated C# package lives at the repository root instead of a nested output/ tree, and consolidate the TypeScript codegen tooling. - Generate and keep the C# library at src/Seam and tests at src/Seam.Test (previously output/csharp/src/Seam and .../Seam.Test); move the solution file to the repository root as Seam.sln. - Point the codegen output root (codegen/lib/csharp.ts) at src/Seam. - Move the codegen-support scripts (generate-csproj.ts, postgenerate.ts, version.ts) from src/ into codegen/, where the rest of the codegen lives. - Stop maintaining a duplicate package README: pack the root README.md directly via the csproj instead of a hand-synced copy under the package. - Update all path references: justfile, setup action, automerge workflow, .gitattributes, package.json scripts, README, and codegen comments. - Drop the redundant output/csharp/.gitignore (root .gitignore ignores bin/ and obj/) and remove the now-empty output/ tree. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt
Follow the conventional .NET layout of shippable code under src/ and test projects under a sibling test/ directory, rather than nesting the test project inside src/. - Move src/Seam.Test to test/Seam.Test. - Fix the test project's ProjectReference to reach src/Seam across the new directory boundary. - Update Seam.sln: repoint the Seam.Test project path and group it under a new "test" solution folder instead of "src". - Point the csharpier lint/format tasks at both ./src and ./test so the test sources are still covered. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt
Align version injection with the sibling SDK repos (php, ruby, python), where the package manifest is a committed source file and the version is injected surgically at release time rather than by regenerating a file during postgenerate. Previously three scripts were entangled: postgenerate.ts and version.ts both regenerated the entire Seam.csproj via generate-csproj.ts to inject the version, folding a release-time concern into every codegen run. Following the php repo's pattern (its closest analog, sharing the npm version/postversion lifecycle scripts): - Rewrite codegen/version.ts to replace only the <Version> element of the committed Seam.csproj with a regex, then stage it. This runs from the npm version lifecycle script, so the bump lands in the tagged commit. - Treat Seam.csproj as committed static source: drop generate-csproj.ts and the generate:csproj script, and stop marking the csproj linguist-generated. Add a note on the <Version> element that it is injected, not hand-edited. - Make postgenerate format-only: "dotnet tool restore && just format", matching the python repo's "just format" postgenerate. The tool restore is retained because the generate workflow runs with dependency install disabled. Removes postgenerate.ts. - Update the README publishing note to describe the injection. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt
The version lifecycle script is the npm `version` hook, run by `npm version` from the repository root, so its script belongs at the root alongside package.json, matching the sibling SDK repos (php, ruby, python). - Move codegen/version.ts to version.ts and resolve package.json and the csproj relative to the repository root. - Point the npm `version` script at ./version.ts. - Add version.ts to the tsconfig include set, as the php repo does. - Update the README reference. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt
The earlier version-injection commit deleted codegen/postgenerate.ts and codegen/generate-csproj.ts but, due to a botched working-tree restore, left package.json still pointing its postgenerate and generate:csproj scripts at those now-deleted files, which would break `npm run generate`. Set postgenerate to `just format` and drop the generate:csproj script, matching the sibling repos where formatting is the npm postgenerate hook (python: `just format`) and the Smith pipeline stays codegen-only. Restore the formatter's tooling with an explicit `dotnet tool restore` step in the generate workflow, before `npm run generate`, mirroring the python repo's `uv sync` step. The generate workflow sets up .NET but runs with dependency install disabled, so the tools are otherwise unavailable to the postgenerate format step. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt
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.
Restructure the repository layout so the generated C# package lives at the
repository root instead of a nested output/ tree, and consolidate the
TypeScript codegen tooling.
(previously output/csharp/src/Seam and .../Seam.Test); move the solution
file to the repository root as Seam.sln.
version.ts) from src/ into codegen/, where the rest of the codegen lives.
directly via the csproj instead of a hand-synced copy under the package.
.gitattributes, package.json scripts, README, and codegen comments.
bin/ and obj/) and remove the now-empty output/ tree.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01BYTZ1b713smMtpQ5UHrrbt