Skip to content

Add Rust version of the code and restructure monorepo#21

Merged
konard merged 8 commits intomainfrom
issue-20-ddbf322acde7
Dec 31, 2025
Merged

Add Rust version of the code and restructure monorepo#21
konard merged 8 commits intomainfrom
issue-20-ddbf322acde7

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Dec 31, 2025

Summary

This PR restructures the lino-env repository as a monorepo with separate JavaScript and Rust implementations, following the patterns from the AI-driven development pipeline templates.

Changes

  • Restructured as monorepo: Moved all JavaScript code to ./js folder and created new Rust implementation in ./rust folder
  • Added Rust implementation: Complete lino-env crate with full API matching the JavaScript version
    • LinoEnv struct for reading and writing .lenv files
    • Support for : (colon-space) separator per links-notation spec
    • Support for multiple values per key (duplicates allowed)
    • Convenience functions read_lino_env and write_lino_env
    • Full test coverage and documentation
  • Updated CI workflows:
    • Replaced single release.yml with js.yml and rust.yml workflows
    • Each workflow has path-based triggers for its respective folder
    • Added cross-platform testing (Ubuntu, macOS, Windows)
    • JS: Tests with Node.js, Bun, and Deno
    • Rust: Tests with cargo test and doc tests
  • Shared scripts: Updated detect-code-changes.mjs to support both JS and Rust
  • Updated documentation: Root README now covers both implementations
  • Clean root directory: Removed all JS-specific files from root (package.json, package-lock.json, .husky, .prettierrc, .prettierignore) - these are now only in the js/ folder

Repository Structure

lino-env/
├── .github/workflows/
│   ├── js.yml           # JS CI/CD workflow
│   └── rust.yml         # Rust CI/CD workflow
├── js/                  # JavaScript package
│   ├── .changeset/      # JS changesets
│   ├── .husky/          # JS git hooks
│   ├── .prettierrc      # JS prettier config
│   ├── .prettierignore  # JS prettier ignore
│   ├── src/             # JS source code
│   ├── tests/           # JS tests
│   ├── package.json     # JS package config
│   └── package-lock.json # JS lockfile
├── rust/                # Rust crate
│   ├── changelog.d/     # Rust changelog fragments
│   ├── src/             # Rust source code
│   ├── Cargo.toml
│   └── CHANGELOG.md
├── scripts/             # Shared scripts
│   └── detect-code-changes.mjs
├── .gitignore           # Shared gitignore
├── LICENSE              # Shared license
└── README.md            # Multi-language docs

Test Plan

  • All JavaScript tests pass (22 tests across Node.js, Bun, Deno)
  • All Rust tests pass (20 unit tests + 14 doc tests)
  • CI workflows pass on all platforms (Ubuntu, macOS, Windows)
  • Clippy lints pass with pedantic warnings
  • Cross-platform temp directory handling verified
  • Root directory contains only language-neutral files

🤖 Generated with Claude Code

Fixes #20

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

Issue: #20
@konard konard self-assigned this Dec 31, 2025
This commit restructures the repository to support both JavaScript and
Rust implementations of lino-env, following the templates from:
- js-ai-driven-development-pipeline-template
- rust-ai-driven-development-pipeline-template

Changes:
- Move all JS-specific code to ./js folder (src, tests, .changeset, etc.)
- Add new Rust implementation in ./rust folder with full test coverage
- Create separate CI/CD workflows: js.yml and rust.yml
- Remove the old release.yml workflow
- Update root package.json as monorepo workspace root
- Add shared detect-code-changes.mjs script supporting both languages
- Update README to document multi-language support
- Update .gitignore for both JS and Rust

The JS package (npm: lino-env) remains unchanged in functionality.
The Rust package (crates.io: lino-env) is a new addition with
equivalent functionality.

Fixes #20

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard changed the title [WIP] Add rust version of the code Add Rust version of the code and restructure monorepo Dec 31, 2025
@konard konard marked this pull request as ready for review December 31, 2025 10:32
konard and others added 5 commits December 31, 2025 11:32
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing 'deno install' step before running Deno tests
- Fix Rust tests to use cross-platform temp directories via std::env::temp_dir()
- Run cargo fmt for proper formatting

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add backticks around LinoEnv and HashMap in doc comments
- Allow implicit_hasher lint for write_lino_env function

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use inlined format args in test_file helper (clippy::uninlined_format_args)
- Update doc examples to use std::env::temp_dir() for Windows compatibility

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard
Copy link
Copy Markdown
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:

  • Public pricing estimate: $16.559504 USD
  • Calculated by Anthropic: $11.362282 USD
  • Difference: $-5.197222 (-31.39%)
    📎 Log file uploaded as GitHub Gist (1965KB)
    🔗 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
Copy Markdown
Member Author

konard commented Dec 31, 2025

Package.json in the root and other files are js only related, check other files in root of repository.

@konard konard marked this pull request as draft December 31, 2025 11:15
@konard
Copy link
Copy Markdown
Member Author

konard commented Dec 31, 2025

🤖 AI Work Session Started

Starting automated work session at 2025-12-31T11:15:38.233Z

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.

Following the monorepo structure requirement, this commit removes all
JavaScript-specific files from the repository root:

- Removed .husky/pre-commit from root (js/.husky/ already has one)
- Removed .prettierrc from root (js/.prettierrc already has one)
- Removed .prettierignore from root (js/.prettierignore already has one)
- Removed root package.json (husky, lint-staged, etc. are JS-specific)
- Moved package-lock.json to js/ folder

The repository root now only contains language-neutral files:
- .github/ (shared CI/CD workflows)
- .gitignore
- LICENSE
- README.md (multi-language documentation)
- scripts/ (shared scripts like detect-code-changes.mjs)
- js/ folder (complete JavaScript package)
- rust/ folder (complete Rust crate)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review December 31, 2025 11:23
@konard
Copy link
Copy Markdown
Member Author

konard commented Dec 31, 2025

✅ Changes Applied

Based on the feedback, I've moved all JS-specific files from the repository root to the js/ folder:

Files Removed from Root

  • .husky/pre-commit - JS-specific git hook
  • .prettierrc - JS prettier config (already in js/)
  • .prettierignore - JS prettier ignore (already in js/)
  • package.json - JS-specific config with husky/lint-staged
  • package-lock.json - moved to js/package-lock.json

Root Directory Now Contains (Language-Neutral Only)

lino-env/
├── .github/           # Shared CI/CD workflows
├── .gitignore         # Shared gitignore
├── LICENSE            # Shared license
├── README.md          # Multi-language documentation
├── scripts/           # Shared scripts (detect-code-changes.mjs)
├── js/                # Complete JavaScript package
└── rust/              # Complete Rust crate

Verification

  • ✅ All JS tests pass locally (22 tests)
  • ✅ All Rust tests pass locally (20 unit + 14 doc tests)
  • ✅ Both CI workflows passed (JS and Rust)
  • ✅ PR marked as ready for review

Now working session is ended, feel free to review and add any feedback.

@konard
Copy link
Copy Markdown
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:

  • Public pricing estimate: $3.102548 USD
  • Calculated by Anthropic: $1.889831 USD
  • Difference: $-1.212716 (-39.09%)
    📎 Log file uploaded as GitHub Gist (363KB)
    🔗 View complete solution draft log

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

@konard konard merged commit 090f956 into main Dec 31, 2025
24 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.

Add rust version of the code

1 participant