Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Dec 17, 2025

Summary

This PR adds full C# support to the lino-objects-codec library as requested in issue #9, along with complete CI/CD infrastructure following the patterns established for JS, Python, and Rust implementations.

Features Implemented:

  • ObjectCodec class with Encode() and Decode() methods
  • Basic types support: null, bool, int, long, float, double, string
  • Collection support: List<object?>, Dictionary<string, object?>
  • Circular reference support with preserved object identity
  • Base64 encoding for strings (full UTF-8 support)
  • Special float values: NaN, Infinity, -Infinity
  • Thread-safe static Codec class for easy access

Project Structure:

  • csharp/src/Lino.Objects.Codec/ - Main library
  • csharp/tests/Lino.Objects.Codec.Tests/ - Unit tests (69 tests)
  • csharp/examples/ - Usage example application
  • csharp/README.md - Documentation with API reference

CI/CD Infrastructure:

  • GitHub Workflow (csharp.yml):
    • Lint job with format checking and warnings-as-errors build
    • Multi-platform testing (Ubuntu, macOS, Windows)
    • NuGet package building and artifact upload
    • Changeset validation for PRs
    • Automatic release on main push (when version changes)
    • Manual release via workflow dispatch
  • Changeset System (csharp/.changeset/):
    • README with instructions
    • config.json for changeset configuration
  • Release Scripts (csharp/scripts/):
    • create-github-release.mjs - Creates GitHub releases from CHANGELOG.md
    • version-and-commit.mjs - Version bumping and commit automation
  • CHANGELOG.md for tracking version history

Repository-wide Updates:

  • Updated main README.md to include all 4 languages (Python, JavaScript, Rust, C#)
  • Merged changes from main branch including new JS/Python/Rust workflows
  • Removed old test.yml (replaced by language-specific workflows)
  • Now have 4 independent language workflows: js.yml, python.yml, rust.yml, csharp.yml

Test plan

  • All 69 C# unit tests pass locally
  • Example application runs without errors
  • Code formatting passes (dotnet format --verify-no-changes)
  • Build succeeds with warnings as errors
  • CI workflow runs successfully for C#
  • Documentation is complete and accurate

Changes from main branch merge

This PR incorporates changes from main including:

  • JavaScript CI/CD workflow and changeset infrastructure
  • Python CI/CD workflow and changelog.d infrastructure
  • Rust CI/CD workflow and changelog.d infrastructure
  • Various code quality improvements and formatting

🤖 Generated with Claude Code

Fixes #9

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #9
@konard konard self-assigned this Dec 17, 2025
This commit adds full C# support to the lino-objects-codec library:

- Implement ObjectCodec class with encode/decode methods
- Support for basic types: null, bool, int, long, float, double, string
- Support for collections: List<object?>, Dictionary<string, object?>
- Full circular reference support with shared object identity preservation
- Base64 encoding for strings (UTF-8 support)
- Handle special float values: NaN, Infinity, -Infinity
- Thread-safe Codec static class
- 69 unit tests covering all functionality
- Example application demonstrating usage
- Documentation with usage examples
- CI workflow for automated testing

Resolves #9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Support C# Add C# implementation Dec 17, 2025
@konard konard marked this pull request as ready for review December 17, 2025 18:16
@konard
Copy link
Member Author

konard commented Dec 17, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $11.209608 USD
  • Calculated by Anthropic: $8.084219 USD
  • Difference: $-3.125389 (-27.88%)
    📎 Log file uploaded as GitHub Gist (1151KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Member Author

konard commented Dec 31, 2025

Get latest changes from default branch. Resolve conflicts.

And also double check we fully support all best practices from templates:

Note that for each language we should have separate .changeset (or similar) folder.

But we can share .mjs scripts in root ./scripts folder if possible.

We should have no test.yml (it should be merged to the language versions), so end result would be 4 GitHub Workflows:

  • js.yml
  • python.yml
  • rust.yml
  • csharp.yml

@konard konard marked this pull request as draft December 31, 2025 09:18
@konard
Copy link
Member Author

konard commented Dec 31, 2025

🤖 AI Work Session Started

Starting automated work session at 2025-12-31T09:18:43.281Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait working session to finish, and provide your feedback.

konard and others added 2 commits December 31, 2025 10:21
- Merge changes from main including JS/Python/Rust workflows and scripts
- Resolve README.md conflict to include all 4 languages (Python, JS, Rust, C#)
- Remove test.yml (replaced by language-specific workflows)
- Update badges for all language workflows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add csharp.yml workflow with lint, test, build, and release jobs
- Multi-platform testing (Ubuntu, macOS, Windows)
- NuGet package publishing support
- Automatic and manual release modes
- Add .changeset folder with README and config for C#
- Add CHANGELOG.md for C# package
- Add release scripts (create-github-release.mjs, version-and-commit.mjs)

This follows the same patterns as JS, Python, and Rust workflows
for consistency across all four language implementations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@konard konard changed the title Add C# implementation Add C# implementation with CI/CD infrastructure Dec 31, 2025
@konard konard marked this pull request as ready for review December 31, 2025 09:31
@konard
Copy link
Member Author

konard commented Dec 31, 2025

🤖 Work Session Completed

I've addressed the feedback from the latest comments:

✅ Merge Conflicts Resolved

  • Merged the latest changes from the default branch (main)
  • Resolved README.md conflicts to include all 4 languages (Python, JavaScript, Rust, C#)
  • Properly handled test.yml deletion (now replaced by language-specific workflows)

✅ Best Practices Applied

Reviewed and applied patterns from the template repositories:

✅ CI/CD Infrastructure for C#

Created complete CI/CD infrastructure following the established patterns:

Workflow (csharp.yml):

  • Lint job with dotnet format and warnings-as-errors
  • Multi-platform testing (Ubuntu, macOS, Windows)
  • NuGet package building
  • Changeset validation for PRs
  • Automatic release on version change
  • Manual release via workflow dispatch

Changeset System (csharp/.changeset/):

  • README.md with instructions
  • config.json for configuration

Release Scripts (csharp/scripts/):

  • create-github-release.mjs - Creates GitHub releases
  • version-and-commit.mjs - Version bumping automation

✅ Four Language-Specific Workflows

The repository now has 4 independent CI/CD workflows:

  • js.yml - JavaScript CI/CD
  • python.yml - Python CI/CD
  • rust.yml - Rust CI/CD
  • csharp.yml - C# CI/CD

The test.yml has been removed as requested - tests are now integrated into each language-specific workflow.

✅ CI Status

  • C# CI/CD workflow: ✅ Passed

Test Results

  • All 69 C# unit tests pass
  • Example application runs successfully
  • Code formatting verified

PR is now marked as ready for review.

@konard
Copy link
Member Author

konard commented Dec 31, 2025

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit 6aeadee into main Dec 31, 2025
8 checks passed
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.

Support C#

2 participants