Skip to content

refactor: move C# SDK to src/, codegen tooling to codegen/, dedupe README - #316

Merged
razor-x merged 5 commits into
mainfrom
claude/csharp-codegen-output-paths-2zygfv
Aug 19, 2026
Merged

refactor: move C# SDK to src/, codegen tooling to codegen/, dedupe README#316
razor-x merged 5 commits into
mainfrom
claude/csharp-codegen-output-paths-2zygfv

Conversation

@razor-x

@razor-x razor-x commented Aug 19, 2026

Copy link
Copy Markdown
Member

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

claude added 5 commits August 19, 2026 06:21
…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
@razor-x
razor-x merged commit 24a990a into main Aug 19, 2026
14 checks passed
@razor-x
razor-x deleted the claude/csharp-codegen-output-paths-2zygfv branch August 19, 2026 17:03
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.

2 participants