Skip to content

fix(cli): match tag.skipPackages as glob patterns - #529

Merged
thevuong merged 2 commits into
mainfrom
fix/start-demo-not-found
Jun 28, 2026
Merged

fix(cli): match tag.skipPackages as glob patterns#529
thevuong merged 2 commits into
mainfrom
fix/start-demo-not-found

Conversation

@thevuong

Copy link
Copy Markdown
Contributor

Why

The release Publish packages → Version and publish step (failed run) on main:

- Missing or invalid version in .../apps/start-demo/package.json
[tag] Skipped: 1 package(s)
[ELIFECYCLE] Command failed with exit code 1.

version-packages runs changeset version && codefast tag. codefast tag scans every workspace package to add @since JSDoc tags. After #528 added apps/start-demo — a private, version-less app — the command treated it as a target, resolveNearestPackageVersion threw Missing or invalid version, and the publish job exited non-zero.

tag.skipPackages already excluded @apps/web (same kind of private app), but only via exact-name matching, so every new app had to be listed by hand.

What changed

  • tag.skipPackages now matches entries as glob patterns (picomatch). A single @apps/* skips every private app under the scope; exact names like @apps/web still work unchanged (backward compatible).
  • DRY: the "compile a pattern list, match any" logic was duplicated between workspace-package discovery (resolver.ts) and the new tag skip-list. Extracted into one shared helper createAnyGlobMatcher in packages/cli/src/core/glob.ts; both call sites now use it. (No throwaway wrapper — the helper is the single source of truth.)
  • codefast.config.js: skipPackages: ["@apps/web", "@apps/start-demo"]["@apps/*"].
  • .changeset/config.json: ignore simplified to ["@apps/*"] (Changesets 3.1.4 matches ignore entries via micromatch — verified).
  • Added a @codefast/cli patch changeset.

Verification

  • pnpm --filter @codefast/cli build + tsgo --noEmit + oxlint --deny-warnings + oxfmt: pass.
  • @codefast/cli unit tests 27/27 pass (new tests/unit/core/glob.test.ts covers exact / @apps/* scope / no-cross-/ / multi-pattern / dot option).
  • End-to-end codefast tag --dry-run: resolved targets 11 → 10, Skipped: 2 (both @apps/* apps), exit 0 (was exit 1).

Note for reviewer

@since tags are intentionally omitted from the new core/glob.ts exports — the release pipeline (codefast tag) stamps them automatically at version time.

The release `Publish packages` step failed because `codefast tag` tried to
tag `@apps/start-demo` — a private, version-less app added in #528 — and threw
"Missing or invalid version", exiting non-zero.

Make `tag.skipPackages` entries match package names as glob patterns
(picomatch), so a single `@apps/*` skips every private app instead of naming
each one. The "compile a pattern list, match any" logic, previously duplicated
in workspace-package discovery, is extracted to a shared `createAnyGlobMatcher`
helper in `core/glob.ts`; both the resolver excludes and tag skip-list now use
it. `.changeset/config.json` ignore is simplified to `@apps/*` too (Changesets
matches it via micromatch).
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
codefastlabs Skipped Skipped Jun 28, 2026 9:06am

@codecov

codecov Bot commented Jun 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/cli/src/core/workspace/resolver.ts 0.00% 2 Missing ⚠️
Files with missing lines Coverage Δ
packages/cli/src/core/glob.ts 100.00% <100.00%> (ø)
packages/cli/src/tag/sync.ts 16.43% <100.00%> (+16.43%) ⬆️
packages/cli/src/core/workspace/resolver.ts 2.77% <0.00%> (+2.77%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Export and directly unit-test filterSkippedCandidates: scope-glob skipping
(`@apps/*`), backward-compatible exact-name matching, and that candidates
without a package name (explicit targets) are never skipped. Covers the tag
skip-list call site flagged by patch coverage.
@thevuong
thevuong merged commit c01400d into main Jun 28, 2026
8 checks passed
@thevuong
thevuong deleted the fix/start-demo-not-found branch June 28, 2026 09:23
thevuong added a commit that referenced this pull request Jun 28, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @codefast/theme@0.5.0-canary.0

### Minor Changes

- [#526](#526)
[`fad5a21`](fad5a21)
Thanks [@thevuong](https://github.com/thevuong)! - Add the
`@codefast/theme/vite` plugin. TanStack Start registers the server
functions shipped in `@codefast/theme/start` at the consumer's build
time, so the package must not be externalized for SSR nor pre-bundled
for the client. The new `codefastTheme()` plugin applies that
configuration automatically, so consumers no longer need to hand-write
`ssr.noExternal` / `optimizeDeps.exclude`.

## @codefast/cli@0.5.0-canary.0

### Patch Changes

- [#529](#529)
[`ca90f1c`](ca90f1c)
Thanks [@thevuong](https://github.com/thevuong)! - `codefast tag` now
matches `tag.skipPackages` entries as glob patterns (picomatch), so a
single `@apps/*` entry skips every private app instead of listing each
by name. This fixes the release `Publish packages` step failing on
`@apps/start-demo` (a private, version-less app the command tried to
tag). The compile-patterns-then-match-any logic is now shared via a
single `createAnyGlobMatcher` helper, also used by workspace-package
discovery.

## @codefast/ui@0.5.0-canary.0

### Patch Changes

-   Updated dependencies \[]:
    -   @codefast/tailwind-variants@0.5.0-canary.0

## @codefast/di@0.5.0-canary.0



## @codefast/tailwind-variants@0.5.0-canary.0



## @codefast/typescript-config@0.5.0-canary.0



## @codefast/benchmark-di-inversify@0.5.0-canary.0

### Patch Changes

-   Updated dependencies \[]:
    -   @codefast/benchmark-harness@0.5.0-canary.0
    -   @codefast/benchmark-viewer@0.5.0-canary.0
    -   @codefast/di@0.5.0-canary.0

## @codefast/benchmark-tailwind-variants@0.5.0-canary.0

### Patch Changes

-   Updated dependencies \[]:
    -   @codefast/benchmark-harness@0.5.0-canary.0
    -   @codefast/benchmark-viewer@0.5.0-canary.0
    -   @codefast/tailwind-variants@0.5.0-canary.0

## @codefast/benchmark-viewer@0.5.0-canary.0

### Patch Changes

-   Updated dependencies \[]:
    -   @codefast/benchmark-harness@0.5.0-canary.0
    -   @codefast/tailwind-variants@0.5.0-canary.0

## @codefast/benchmark-harness@0.5.0-canary.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant