fix: symlink node_modules so squad scripts can resolve framework deps#624
fix: symlink node_modules so squad scripts can resolve framework deps#624andersnsouza wants to merge 2 commits intoSynkraAI:mainfrom
Conversation
Scripts in squads/ (e.g. squad-creator-pro) use `require('js-yaml')`
but Node.js module resolution never finds it because node_modules only
exists inside .aiox-core/. This creates a symlink from the project root
node_modules to .aiox-core/node_modules during `aiox init`, allowing
standard require() calls to work from any directory in the project.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@andersnsouza is attempting to deploy a commit to the SINKRA - AIOX Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdded a post- Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Welcome to aiox-core! Thanks for your first pull request.
What happens next?
- Automated checks will run on your PR
- A maintainer will review your changes
- Once approved, we'll merge your contribution!
PR Checklist:
- Tests pass (
npm test) - Linting passes (
npm run lint) - Commit messages follow Conventional Commits
Thanks for contributing!
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@bin/aiox-init.js`:
- Around line 178-197: The symlink creation checks frameworkNodeModules (vars:
projectNodeModules, frameworkNodeModules) before the framework files are copied,
so fresh installs never create the link; move the entire symlink block to run
immediately after the core is copied (i.e., after the fse.copy(sourceCoreDir,
targetCoreDir) operation completes) so .aiox-core/node_modules exists when you
create the junction and keep the same try/catch logging behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3f96499f-1770-49e6-a510-37c9c5a718ca
📒 Files selected for processing (1)
bin/aiox-init.js
Address CodeRabbit review: the symlink block was in checkPrerequisites() which runs before .aiox-core is copied, so fresh installs would skip it. Now runs immediately after fse.copy(sourceCoreDir, targetCoreDir) when .aiox-core/node_modules is guaranteed to exist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
squads/(e.g.squad-creator-pro) fail withCannot find module 'js-yaml'becausenode_modulesonly exists inside.aiox-core/squads/.../scripts/to the project root and never findsjs-yaml<project>/node_modules→.aiox-core/node_modules/duringaiox init, so standardrequire()calls work from any directory in the project treeRoot Cause
aiox-init.jscreates apackage.jsonat the project root but never installs dependencies or links to.aiox-core/node_modules/. Any script outside.aiox-core/that doesrequire('js-yaml')(or any other framework dependency) fails.Error Reproduced
Fix
After
package.jsoncreation incheckPrerequisites(), add a symlink step:<project>/node_modulesdoesn't exist AND.aiox-core/node_modulesexistsTest plan
aiox initon a fresh project — verify symlink is creatednode squads/squad-creator-pro/scripts/generate-squad-greeting.js— verify noCannot find moduleerroraiox initon existing project withnode_modules/— verify symlink is skipped (no overwrite).aiox-core/still work normally🤖 Generated with Claude Code
Summary by CodeRabbit