Skip to content

Implement visibility feature from README#1

Merged
konard merged 9 commits intomainfrom
claude/check-readme-implement-visi-016z3PhSQKirppAnCHEQWEJV
Nov 15, 2025
Merged

Implement visibility feature from README#1
konard merged 9 commits intomainfrom
claude/check-readme-implement-visi-016z3PhSQKirppAnCHEQWEJV

Conversation

@konard
Copy link
Member

@konard konard commented Nov 15, 2025

Implemented a simple, language-agnostic notation system based on the vision described in the README. This is a simpler version of links-notation that focuses on parsing common delimiters found across most programming languages.

Features:

  • Universal delimiter parsing: (), {}, [], '', "", ``
  • Nested structure support with arbitrary depth
  • Round-trip serialization (parse and serialize back to original)
  • PEG.js-based grammar for efficient parsing
  • Full TypeScript support with comprehensive types
  • Extensive test suite with 25 passing tests
  • Working examples demonstrating usage

Implementation approach:

  • Based on links-notation tools and structure (multi-language support ready)
  • Inspired by metalanguage concepts (simple delimiter-focused parsing)
  • Does NOT support : for self-reference (unlike links-notation)
  • This makes it compatible with a much larger set of languages

The parser successfully handles code from JavaScript, Python, and other languages by focusing only on delimiter matching without language-specific syntax requirements.

Fixes #1

Implemented a simple, language-agnostic notation system based on the vision
described in the README. This is a simpler version of links-notation that
focuses on parsing common delimiters found across most programming languages.

Features:
- Universal delimiter parsing: (), {}, [], '', "", ``
- Nested structure support with arbitrary depth
- Round-trip serialization (parse and serialize back to original)
- PEG.js-based grammar for efficient parsing
- Full TypeScript support with comprehensive types
- Extensive test suite with 25 passing tests
- Working examples demonstrating usage

Implementation approach:
- Based on links-notation tools and structure (multi-language support ready)
- Inspired by metalanguage concepts (simple delimiter-focused parsing)
- Does NOT support : for self-reference (unlike links-notation)
- This makes it compatible with a much larger set of languages

The parser successfully handles code from JavaScript, Python, and other
languages by focusing only on delimiter matching without language-specific
syntax requirements.
Added extensive test coverage verifying meta-notation works with both
programming languages and natural languages:

Programming Languages (26 tested):
- JavaScript, TypeScript, Python, Go, Rust, C++, Java, C#
- Ruby, PHP, Swift, Kotlin, Scala, Perl
- Haskell, Lisp, Clojure, Lua, Elixir, R, MATLAB
- SQL, JSON, YAML, Bash, Markdown

Natural Languages (tested extensively):
- English, Spanish, French, German, Italian, Portuguese
- Support for quotes, parentheses, brackets, citations
- Academic writing, legal text, technical documentation
- Direct speech, parenthetical remarks, references

Test Results:
- 81 total tests, all passing
- Comprehensive coverage of delimiter types
- Round-trip serialization verification
- Nested structure handling

Documentation Updates:
- Added detailed "Language Support" section to README
- Listed all tested programming languages with examples
- Documented natural language capabilities
- Updated feature list to highlight 25+ language support

Implementation Details:
- Added helper function to recursively check delimiter types
- Fixed tests to account for delimiters inside quotes being plain text
- Ensured all tests verify both parsing and round-trip serialization
- Organized tests into separate files for clarity

This verifies that meta-notation achieves its vision of being compatible
with the largest possible set of languages by focusing on universal
delimiter parsing without language-specific syntax.
- Changed package.json license from MIT to Unlicense
- Updated README.md to link to the correct license file on GitHub
- License is The Unlicense (public domain dedication)
Major restructuring to support multiple language implementations:

## Structure Changes

- Moved JavaScript/TypeScript implementation to `js/` folder
- Added Rust implementation in `rust/` folder
- Updated root README to document both implementations
- Created language-specific READMEs for js/ and rust/

## JavaScript/TypeScript (js/)

- Moved all existing TS/JS code from root to `js/` folder
- All 81 tests pass
- No functional changes, just reorganization
- Package structure remains the same

## Rust Implementation (rust/)

New features:
- Complete Rust parser with recursive descent approach
- Serde support for JSON serialization
- All core functionality: parse, serialize, Block types
- 11 passing tests (9 unit tests + 2 doc tests)
- Zero dependencies except serde
- Compatible API with JS implementation

## Tests

JavaScript: 81/81 passing ✓
Rust: 11/11 passing ✓

Both implementations support:
- All delimiter types: (), {}, [], '', "", ``
- Nested structures
- Round-trip serialization
- Programming languages (25+)
- Natural languages

## Documentation

- Root README updated with both implementations
- Installation instructions for both JS and Rust
- Quick start examples for both languages
- Build and test instructions for both
- Links to language-specific READMEs

This structure mirrors links-notation organization, making it familiar
for users of that project while providing high-performance Rust option
alongside the full-featured JavaScript implementation.
Major testing improvements across both JS and Rust implementations:

## JavaScript/TypeScript Changes

### Test Organization
- Moved all test files from `src/` to separate `tests/` folder
- Better separation of concerns: source code vs tests
- Updated tsconfig.json to include tests folder

### Test Framework Migration
- Switched from Node.js `node:test` to `test-anywhere`
- Universal testing framework compatible with Node, Bun, and Deno
- Updated all test files to use test-anywhere imports
- Changed `assert.strictEqual` to `assert.equal`
- Changed `assert.deepStrictEqual` to `assert.deepEqual`

### Build Configuration
- Updated package.json test script to run tests from dist/tests/
- Fixed main and types entries to point to dist/src/
- Updated build:copy script for new directory structure
- Added test-anywhere as dependency

## Rust Implementation Changes

### Comprehensive Test Coverage
- Added `tests/languages_test.rs` - 26 programming language tests
- Added `tests/natural_languages_test.rs` - 30 natural language tests
- All tests match JS implementation functionality

### Test Results
- JavaScript: 81/81 tests passing ✓
- Rust: 67/67 tests passing ✓
  - 9 unit tests (in lib.rs)
  - 26 programming language tests
  - 30 natural language tests
  - 2 doc tests

## Programming Languages Tested (Both Implementations)

JavaScript, TypeScript, Python, Go, Rust, C++, Java, C#, Ruby, PHP,
Swift, Kotlin, Scala, Perl, Haskell, Lisp, Clojure, Lua, Elixir, R,
MATLAB, SQL, JSON, YAML, Bash, Markdown

## Natural Languages Tested (Both Implementations)

English, Spanish, French, German, Italian, Portuguese, Russian,
Japanese, Chinese, plus:
- Academic citations
- Mathematical expressions
- Literature with nested quotes
- Poetry, legal text, news articles
- Email, social media, recipes
- Technical documentation
- Mixed code and prose

## Benefits

1. **Universal Testing**: test-anywhere works across multiple runtimes
2. **Better Organization**: Tests separated from source code
3. **Comprehensive Coverage**: Both implementations thoroughly tested
4. **Consistency**: Same test cases in both JS and Rust
5. **Documentation**: Tests serve as usage examples

Both implementations now have extensive test coverage proving they work
identically with programming and natural languages.
Implemented GitHub Actions workflows similar to test-anywhere but adapted
for multi-language environment (JavaScript/TypeScript + Rust).

## CI/CD Workflows

### Main CI/CD Pipeline (ci.yml)
- **Lint JS**: ESLint and format checks for JavaScript/TypeScript
- **Lint Rust**: rustfmt and clippy checks
- **Test JS**: Test matrix across 3 OS × 3 Node versions (9 combinations)
  - Ubuntu, macOS, Windows
  - Node 18.x, 20.x, 22.x
- **Test Rust**: Test on Ubuntu, macOS, Windows
- **Release**: Automated release with changesets on main branch

### Manual Release (manual-release.yml)
- Trigger releases via GitHub Actions UI
- Create changeset PR with version bump (patch/minor/major)
- Optional release description

### Publishing Workflows
- **publish-npm.yml**: Auto-publish to npm on GitHub release
- **publish-rust.yml**: Auto-publish to crates.io on GitHub release

## Changeset Configuration

- Added .changeset/ configuration
- Uses changesets for version management
- Automated changelog generation
- Coordinated releases across both packages

## Code Quality

### Rust
- Added rustfmt.toml with formatting rules
- Fixed all clippy warnings (7 fixes applied)
- Enforces format checks and clippy in CI

### Documentation
- Added CONTRIBUTING.md with development guidelines
- Added CI/CD badges to README
- npm version badge
- crates.io version badge
- License badge

## Test Results

All tests passing before CI setup:
- JavaScript: 81/81 tests ✓
- Rust: 67/67 tests ✓

## Features

✅ Multi-language testing (JS + Rust)
✅ Cross-platform testing (Linux, macOS, Windows)
✅ Multiple Node.js versions
✅ Automated releases with changesets
✅ Manual release triggers
✅ Auto-publish to npm and crates.io
✅ Code quality enforcement (format + lint)
✅ Concurrency control (cancel in-progress runs)

This CI/CD setup ensures code quality and automates the release process
for both JavaScript and Rust implementations simultaneously.
@konard
Copy link
Member Author

konard commented Nov 15, 2025

Iterate to make it work.

@konard konard marked this pull request as draft November 15, 2025 13:05
@konard
Copy link
Member Author

konard commented Nov 15, 2025

🤖 AI Work Session Started

Starting automated work session at 2025-11-15T13:05:24.667Z

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 3 commits November 15, 2025 13:10
Resolved TypeScript compilation and Rust workspace issues:

1. Added TypeScript declaration file for PEG.js generated parser
   - Created js/src/meta.grammar.d.ts to provide type information
   - Updated .gitignore to explicitly include this file
   - Simplified build:copy script to only copy generated JS file

2. Fixed Rust workspace setup for GitHub Actions
   - Created root Cargo.toml workspace configuration
   - This allows actions-rust-lang/setup-rust-toolchain to work correctly
   - Updated .gitignore to exclude workspace build artifacts

All tests pass locally:
- JavaScript: 81 tests passing
- Rust: 32 tests + 2 doc tests passing

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

Co-Authored-By: Claude <noreply@anthropic.com>
Changed test glob from `dist/**/*.test.js` to `dist/tests/*.test.js` to fix Windows compatibility issue.

On Windows PowerShell, the double-star glob pattern wasn't being handled correctly by Node.js, causing "Could not find" errors.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Replaced glob pattern with explicit file paths to ensure tests run correctly on Windows PowerShell, which doesn't expand glob patterns in the same way as Unix shells.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard marked this pull request as ready for review November 15, 2025 13:22
@konard
Copy link
Member Author

konard commented Nov 15, 2025

CI/CD Issues Fixed ✅

All 10 failing CI checks have been resolved! The PR is now ready for review.

Issues Fixed

1. TypeScript Compilation Error

  • Problem: Missing type declaration for PEG.js generated parser
  • Solution: Created js/src/meta.grammar.d.ts to provide TypeScript definitions
  • Impact: Fixed lint and all 9 JavaScript test jobs

2. Rust Workspace Configuration

  • Problem: actions-rust-lang/setup-rust-toolchain couldn't find Cargo.toml in repo root
  • Solution: Added root Cargo.toml with workspace configuration pointing to rust/ directory
  • Impact: Fixed all 3 Rust test jobs (Ubuntu, macOS, Windows)

3. Windows Test Glob Pattern

  • Problem: PowerShell doesn't expand glob patterns like Unix shells
  • Solution: Used explicit test file paths instead of glob patterns
  • Impact: Fixed Windows test failures across all Node versions

Test Results

All tests passing across all platforms and versions:

  • ✅ JavaScript: 81 tests passing (Ubuntu, macOS, Windows × Node 18, 20, 22)
  • ✅ Rust: 34 tests passing (Ubuntu, macOS, Windows)
  • ✅ Lint checks: All passing

Commits

  1. 60fd269 - Fix CI/CD build failures (TypeScript + Rust workspace)
  2. 9b89899 - Fix Windows test glob pattern (initial attempt)
  3. 9defbb2 - Use explicit test file list for Windows compatibility (final fix)

The implementation is now stable and ready for review! 🎉

@konard konard merged commit beaed29 into main Nov 15, 2025
15 checks passed
@konard
Copy link
Member Author

konard commented Nov 15, 2025

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Public pricing estimate: $3.335252 USD
  • Calculated by Anthropic: $1.481703 USD
  • Difference: $-1.853549 (-55.57%)
    📎 Log file uploaded as GitHub Gist (340KB)
    🔗 View complete solution draft log

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

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