-
Notifications
You must be signed in to change notification settings - Fork 1
docs: Document Array.join() pitfall and add best practices (fixes #153) #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #153
This commit adds comprehensive documentation about the Array.join() pitfall
where calling .join(' ') before template interpolation causes all arguments
to be merged into a single shell argument.
Changes:
- Add BEST-PRACTICES.md with detailed usage patterns
- Add Common Pitfalls section to README.md explaining the issue
- Add docs/case-studies/issue-153/ with real-world investigation
- Add rust/BEST-PRACTICES.md for Rust-specific patterns
- Add js/tests/array-interpolation.test.mjs with 34 tests covering:
- Direct array passing (correct usage)
- Pre-joined array (anti-pattern demonstration)
- Mixed interpolation patterns
- Real-world use cases (git, npm, docker, rsync)
- Edge cases and documentation examples verification
- Bump version to 0.9.3
The bug was discovered in production (hive-mind#1096) where CLI arguments
were incorrectly merged into a file path, causing errors like:
"File does not exist: /path/to/file.txt --public --verbose"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit 5f78ead.
🤖 Solution Draft LogThis 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. |
|
I think we should not mix JavaScript and Rust docs together, all JavaScript related files and docs should be in ./js folder, and all Rust related docs and files should be in ./rust folder. We also should move package.json and other configuration file most JavaScript related files to its folder. So after this pull request file structure will be perfect. |
|
🤖 AI Work Session Started Starting automated work session at 2026-01-10T22:06:11.397Z 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. |
- Move BEST-PRACTICES.md to js/BEST-PRACTICES.md - Move docs/case-studies/ to js/docs/case-studies/ - Move docs/IMPLEMENTATION_NOTES.md to js/docs/ - Move docs/SHELL_OPERATORS_IMPLEMENTATION.md to js/docs/ - Update all cross-references in README.md, test files, and docs - Update changeset description to reflect new file locations This separates JavaScript documentation from the root level, keeping all JS-related files in the js/ folder and Rust-related files in rust/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
I've addressed the feedback about file structure reorganization: Changes Made:
Current Structure:All CI checks are passing ✅ |
🤖 Solution Draft LogThis 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. |
Summary
This PR documents the Array.join() pitfall discovered in production (hive-mind#1096) and adds comprehensive best practices documentation.
The Problem
When using
command-stream, calling.join(' ')on an array before template interpolation causes all arguments to be merged into a single shell argument:Changes
File Structure Reorganization
Per feedback, this PR also reorganizes the file structure to separate JavaScript and Rust documentation:
BEST-PRACTICES.md→js/BEST-PRACTICES.mddocs/case-studies/→js/docs/case-studies/docs/→js/docs/Test Plan
bun run lint)bun run format:check)Fixes #153
🤖 Generated with Claude Code