feat: resolve parent workspace in monorepos workspaces#118
Conversation
Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
…ix typo Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…ateWorkspaceRoot Remove the complex nested workspace detection logic as it's an edge case that can be added back if requested. This simplifies the code significantly by removing lib/utils.js and using resolve-workspace-root directly. Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
… logic - Add --no-parent-workspace flag to explicitly opt out of parent workspace detection - Only detect parent workspace when no incompatible flags are set: - Skip if user provided explicit workspace filters (--workspace) - Skip if user provided custom cwd path as argument - Skip if --no-parent-workspace flag is used - Update README with new flag documentation and conditions for automatic detection Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
- Log when attempting to resolve parent workspace root - Log whether a parent workspace was found and its path - Log when parent workspace detection is skipped and why - Fix parentWorkspace flag to work correctly with --no- prefix (changed from noParentWorkspace:false to parentWorkspace:true) Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
- Add Examples section to README.md with links to all example READMEs - Update basic example to demonstrate engine range validation error - Changed meow dependency to ^14.0.0 (requires Node >=20) - Package specifies >=18.6.0, creating intentional mismatch - Updated README with correct expected output - Update monorepo example with root-level dependency issue - Added meow@^14.0.0 to root package.json - Issue appears when running from monorepo root - Issue excluded when running from workspace-a (includeWorkspaceRoot: false) - Updated both READMEs with correct expected outputs - Refactor test/integration.js to use Node.js test runner - Replace custom assert/test functions with node:assert/strict and node:test - Wrap all tests in describe() and it() blocks - Extract run() helper to test/helpers.js for reuse - Update package.json scripts - Change test script to: "test": "run-s check test:**" - Update test:integration to use --test flag - Update test-ci to: "run-s test:**" Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
Change test:** to test:* to properly match test scripts like test:integration and test:examples:install
Explicitly list scripts in test-ci instead of using test:* pattern to prevent matching itself
- Use assert.ok(val !== undefined) instead of assert.notEqual(val, undefined) - Add .trim() to normalize whitespace in output comparisons - All integration tests now pass consistently Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
- basic: meow engine mismatch (requires Node >=20, package specifies >=18.6.0) - monorepo root: shows both root's meow issue AND workspace-a's knip issue - workspace-a: knip engine mismatch (requires Node >=18.18.0, package specifies >=18.6.0) - Demonstrates that parent's meow issue is excluded due to includeWorkspaceRoot: false All three examples now have non-empty, different outputs that demonstrate distinct aspects of the tool's functionality. Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
- Add test/helpers.js to tsconfig.json files array for type checking - Revert test script from wildcard "test:*" to explicit "test:examples:install test:integration" This ensures tests run in the correct order and are more explicit Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
|
@copilot Figure our why CI is failing :/ |
…ture - Normalize Windows CRLF line endings to Unix LF in test output comparison - Fix run() helper function to accept options object instead of string cwd This was causing tests to fail because the function signature didn't match usage These fixes resolve the Windows CI test failures where tests were failing due to: 1. Line ending differences between Windows (CRLF) and Unix (LF) 2. Incorrect function signature causing commands to fail silently Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
…ture - Normalize Windows CRLF line endings to Unix LF in test output comparison - Fix run() helper function to accept both string cwd and options object This was causing tests to fail because the function signature didn't match usage These fixes resolve the Windows CI test failures where tests were failing due to: 1. Line ending differences between Windows (CRLF) and Unix (LF) 2. Incorrect function signature causing commands to fail silently Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
Fixed in commit 463880e. The CI was failing on Windows due to:
All integration tests now pass on both Unix and Windows platforms. |
Implementation Plan for Monorepo Workspace Support
resolve-workspace-rootas the solutionresolve-workspace-rootdependencySummary
Successfully implemented support for running
installed-checkin a workspace that is part of a larger monorepo, with comprehensive examples demonstrating different validation scenarios and cross-platform test support.Key Features
resolve-workspace-rootpackage--no-parent-workspaceflag for explicit opt-outExamples
The
examples/folder contains three distinct demonstrations:Each example has distinct, non-empty output showcasing different aspects of the tool's functionality.
Tests
Integration tests use:
describe/itblockstest/helpers.jsandtest/test-readme.jsRun with:
npm testornpm run test:integrationSecurity Summary
CodeQL scan completed with no vulnerabilities found.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.