fix(packages/core): use deep glob pattern for recursive workspace includes#69
fix(packages/core): use deep glob pattern for recursive workspace includes#69zrosenbauer merged 13 commits intomainfrom
Conversation
…ludes The default include pattern for workspace items was always `docs/*.md` regardless of the `recursive` flag. This meant recursive mode with no explicit `include` would only discover files at the top level of `docs/`, never in subdirectories like `docs/guides/setup.md`. Switch the default to `docs/**/*.md` when `recursive: true` so fast-glob discovers nested files as expected. Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 580e4b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/core/src/sync/workspace.ts (1)
384-387:⚠️ Potential issue | 🟡 MinorUpdate stale JSDoc to match the new conditional default.
Line 384 still says the default is always
"docs/*.md", but runtime behavior is now conditional onitem.recursive. Please update this comment to avoid config confusion.✏️ Suggested doc fix
- * (derived from `path`). Defaults to `"docs/*.md"` when omitted. + * (derived from `path`). Defaults to `"docs/**/*.md"` when `recursive: true`, + * otherwise defaults to `"docs/*.md"` when omitted.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/sync/workspace.ts` around lines 384 - 387, Update the stale JSDoc for the "include" default in workspace.ts to reflect the new conditional behavior: instead of saying the default is always "docs/*.md", note that the default is "docs/**/*.md" when item.recursive is true and "docs/*.md" when item.recursive is false (or when recursion is not enabled). Edit the JSDoc block that documents the `path` + `include` resolution so it explicitly states the conditional default based on `item.recursive` and references `item.recursive` and the `include` field so readers can find the related logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/core/src/sync/workspace.ts`:
- Around line 384-387: Update the stale JSDoc for the "include" default in
workspace.ts to reflect the new conditional behavior: instead of saying the
default is always "docs/*.md", note that the default is "docs/**/*.md" when
item.recursive is true and "docs/*.md" when item.recursive is false (or when
recursion is not enabled). Edit the JSDoc block that documents the `path` +
`include` resolution so it explicitly states the conditional default based on
`item.recursive` and references `item.recursive` and the `include` field so
readers can find the related logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 98842cc9-df98-45fd-88b3-9f9aa2d401d3
📒 Files selected for processing (1)
packages/core/src/sync/workspace.ts
Co-Authored-By: Claude <noreply@anthropic.com>
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 @.coderabbit.yaml:
- Line 14: The `walkthrough` key is invalid under the `reviews` object; remove
the `walkthrough: false` entry or replace it with supported flags—set
`high_level_summary: false` if you want to disable summaries while keeping
`collapse_walkthrough: true` (which is already present); update the `reviews`
block by removing the unsupported `walkthrough` property to satisfy the schema.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: d05cdb14-483b-4756-9ffc-765ddab806c2
📒 Files selected for processing (2)
.changeset/fix-recursive-workspace-glob.md.coderabbit.yaml
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Collapse walkthrough and disable all sub-features: changed files summary, sequence diagrams, linked issues, related issues/PRs, and review status messages. Co-Authored-By: Claude <noreply@anthropic.com>
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 @.coderabbit.yaml:
- Line 92: The file is missing a trailing newline at the end causing
POSIX/non-diff issues; update the file so that after the final line containing
"auto_reply: true" there is a single newline character (ensure EOF ends with
"\n") to restore the trailing newline.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 614183c3-cbed-4b81-a75f-fcd1f18ac779
📒 Files selected for processing (1)
.coderabbit.yaml
Disable every feature that populates the walkthrough comment: high_level_summary, review_status, review_details, changed_files_summary, sequence_diagrams, estimate_code_review_effort, assess_linked_issues, related_issues, related_prs. The walkthrough comment itself has no master toggle in the v2 schema — this is as close to off as it gets. Co-Authored-By: Claude <noreply@anthropic.com>
When a workspace item provides an explicit repo-relative include like `apps/api/docs/**/*.md`, `normalizeAndResolveInclude` was prepending the basePath derived from `path`, producing a broken double path: `apps/api/apps/api/docs/**/*.md`. The glob silently matched 0 files, so only landing pages appeared in the output. Skip the basePath prefix when the pattern already starts with it. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…orrecting Replace the silent auto-fix with a warning that tells the user their include pattern is already repo-relative and will be double-prefixed. Include is documented as relative to the workspace path — the user should fix their config. Co-Authored-By: Claude <noreply@anthropic.com>
Remove the log.warn from the sync hot path and add a proper config check that surfaces during `zpress check`. When a workspace include pattern already starts with the basePath derived from path, warn that the resolved glob will be double-prefixed and likely match zero files. - Add ConfigWarning type and configWarning factory to @zpress/config - Add checkWorkspaceIncludes to @zpress/core (exported) - Wire warnings into runConfigCheck and presentResults in @zpress/cli Co-Authored-By: Claude <noreply@anthropic.com>
Reflect that the default include pattern is now docs/**/*.md when recursive is true, otherwise docs/*.md. Co-Authored-By: Claude <noreply@anthropic.com>
…n emit TypeScript's declaration emitter interprets the sequence star-slash inside JSDoc backtick spans as end-of-comment, breaking the build. Remove glob examples from exported function JSDoc blocks. Co-Authored-By: Claude <noreply@anthropic.com>
The ConfigCheckResult interface gained a warnings field but existing test fixtures were not updated, causing presentResults to crash on configResult.warnings.length. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
apps/packages) setsrecursive: truewithout an explicitinclude, the default glob pattern wasdocs/*.md— a shallow pattern that only matches the top-level directorydocs/**/*.mdwhenrecursive: true, sofast-globdiscovers files in nested subdirectories as expectedChanges
packages/core/src/sync/workspace.ts—applyOptionalFields()now selects the default include pattern based onitem.recursiveTest plan
recursive: trueand noincludediscovers nested markdown files (e.g.docs/guides/setup.md)recursivestill defaults todocs/*.md(shallow)includealways takes precedence regardless ofrecursive