fix: ignore workspace pattern matching the project root - #702
Merged
Conversation
✅ Deploy Preview for nadle ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
create-nadle
eslint-plugin-nadle
@nadle/kernel
@nadle/language-server
nadle
@nadle/project-resolver
nadle-vscode-extension
commit: |
A workspace glob that matches the project root directory (e.g. a pnpm pattern of '.') made @manypkg return the root as a sub-package, which createProject turned into a degenerate empty-path workspace duplicating the root. That then failed label validation with a confusing 'conflicts with the ID of workspace ""' error. Filter packages whose dir equals the root dir before creating workspaces: the root is already represented by rootWorkspace, so the match is dropped and the project resolves cleanly. Implements the deferred workspaces-detection test. Spec 06-project gains the root-exclusion rule (4.1.0). Closes #699 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nam-hle
force-pushed
the
fix/699-root-matching-workspace
branch
from
June 21, 2026 06:27
5a4748c to
c4c0a87
Compare
nam-hle
enabled auto-merge (squash)
June 21, 2026 06:28
This was referenced Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Closes #699.
Problem
A workspace glob matching the project root (e.g. a pnpm
packages: ["."], or a broad./**that re-includes root) made@manypkgreturn the root as a sub-package.createProjectturned it into a degenerate empty-path workspace duplicating the root, which then failed label validation with a cryptic error:This was the
it.todo("single workspace in monorepo")case inworkspaces-detection.test.ts. (A genuine single sub-package monorepo already worked.)Fix
In
createProject, filter out any discovered package whose absolutedirequals the rootdirbefore mapping to workspaces. The root is alreadyrootWorkspace, so the match is dropped and the project resolves cleanly. One.filter; no API change.Tests
workspaces-detectiontest:pnpm-workspacematching.+ a real sub-package now resolves to root + the sub (snapshot confirms no empty workspace), exit 0.nadle checkpasses.Spec
spec/06-project.mdWorkspace Discovery gains the root-exclusion rule. Rebased on top of #698 (now merged); spec entry is 4.1.1 (PATCH — corrects detection behavior on top of #698's 4.1.0).🤖 Generated with Claude Code