Skip to content

chore: replace yalc with pkglab for local package development#7850

Open
nikosdouvlis wants to merge 1 commit intomainfrom
nk/replace-yalc-with-pkglab
Open

chore: replace yalc with pkglab for local package development#7850
nikosdouvlis wants to merge 1 commit intomainfrom
nk/replace-yalc-with-pkglab

Conversation

@nikosdouvlis
Copy link
Member

@nikosdouvlis nikosdouvlis commented Feb 16, 2026

Why

yalc injects .yalc directories and modifies package.json with file: references that behave differently from real registry installs. Lock files end up with local paths instead of registry URLs, so the install you test against is structurally different from what your users will get.

pkglab solves this by publishing to a real npm registry running locally. Exports maps, bundled dependencies, the files array are all validated the same way npm would. Consumer repos install with a standard pnpm install, producing the same node_modules tree your users will get. One copy of React. Correct peer dependency resolution. Real lock file entries.

What changed

  • Removed yalc as a devDependency and all per-package publish:local scripts
  • Added pkglab (^0.10.0) as a devDependency with minimumReleaseAgeExclude entry
  • Added root pub script (pkglab pub) for one-shot publishing
  • Added dev:pub script to 20 packages that fires pkglab pub --ping on each successful rebuild, letting the pkglab listener coalesce rapid publishes into batched cycles
  • Changed playground dependencies from file:.yalc/@clerk/* to workspace:*
  • Cleaned up yalc references from .gitignore, .prettierignore, eslint config, nuke script, CONTRIBUTING docs

More info

For full documentation on pkglab commands, workflow, and design decisions: https://github.com/nikosdouvlis/pkglab

Summary by CodeRabbit

  • Chores

    • Replaced yalc with pkglab for local publish flows: added pkglab, new pub scripts, removed yalc-related scripts across packages and playgrounds.
    • Renamed dev:publish → dev:pub and updated post-build publish hooks to use pkglab.
    • Removed per-playground yalc cleanup code.
  • Dependency

    • Switched playground package refs from local file:.yalc links to workspace:*.
  • Documentation

    • Updated contributor and playground setup docs to remove yalc steps and reference pkglab workflows.
  • Ignores

    • Removed .yalc and yalc.lock from ignore lists so they are tracked/searchable.

@vercel
Copy link

vercel bot commented Feb 16, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 16, 2026 0:49am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

⚠️ No Changeset found

Latest commit: 8c03011

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 16, 2026

📝 Walkthrough

Walkthrough

The repo replaces yalc-based local publishing with pkglab. .yalc and yalc.lock were removed from ignore files and editor exclusions; pkglab was added as a devDependency and a root pub script added. Many package scripts were renamed from dev:publish to dev:pub and publish:local/yalc scripts were removed. Build configs (tsup/tsdown) now accept env.publish and conditionally run pkglab pub --ping on success. Playgrounds and README/setup steps were updated to use workspace dependency specifiers and remove yalc workflow and cleanup logic.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: replace yalc with pkglab for local package development' accurately reflects the primary change across the entire changeset—systematic replacement of the yalc development tool with pkglab.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/tanstack-react-start/tsup.config.ts (1)

9-36: ⚠️ Potential issue | 🟠 Major

Add coverage for the publish-flag build path.

I didn’t see tests updated for the new shouldPublish/onSuccess flow. If the full PR doesn’t include tests, please add at least a smoke test or script-level check that validates pkglab pub --ping runs when --env.publish is set.

As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

packages/agent-toolkit/tsup.config.ts (1)

5-27: ⚠️ Potential issue | 🟠 Major

Add tests for the new pkglab publish workflow.

No tests were added or modified to cover the new publish-on-success and dev:pub flow. Please add coverage or document why tests are not applicable before merging. As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

packages/react/package.json (1)

91-96: ⚠️ Potential issue | 🔴 Critical

Add -- to forward --env.publish to the dev script.

pnpm requires -- before script arguments to forward them to the underlying command. Without it, --env.publish is interpreted by pnpm itself, not passed to tsup, breaking the publish-on-success feature. All other packages in the monorepo already use the correct pattern.

✅ Proposed fix
-    "dev:pub": "pnpm dev --env.publish",
+    "dev:pub": "pnpm dev -- --env.publish",

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

1-167: ⚠️ Potential issue | 🔴 Critical

CI is failing due to lockfile mismatch.

The pipeline reports a lockfile specifier mismatch for astro: lockfile has ^5.15.9 but manifest has ^5.17.1. Run pnpm install --lockfile-only to regenerate the lockfile after all manifest changes are finalized.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 16, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7850

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7850

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7850

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7850

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7850

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7850

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7850

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7850

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7850

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7850

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@7850

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7850

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7850

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7850

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7850

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7850

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7850

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7850

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7850

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7850

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7850

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7850

commit: 8c03011

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/nextjs/package.json`:
- Line 77: The new npm script "dev:pub" was added to package.json to support the
local publish workflow but there are no tests covering this change; add
automated tests that exercise the new local publish flow (e.g., an integration
test that runs the "dev:pub" script or invokes the pkglab publish path and
asserts expected side-effects such as published package artifacts or updated
local registry entries). Update or add a test file (for example
tests/integration/dev-pub.spec.ts or a CI step named "local-publish") that calls
the dev:pub script via the project test harness, mocks external network calls if
needed, and verifies success and failure states; if adding tests is not
possible, include a CI smoke-check that runs "pnpm --filter ./packages/nextjs
run dev:pub -- --dry-run" to validate the workflow. Ensure the test name
references "dev:pub" and the pkglab/local publish behavior so it will catch
regressions to this script.

In `@pnpm-workspace.yaml`:
- Around line 35-37: The change adds 'pkglab' to minimumReleaseAgeExclude but no
tests were added; add unit or integration tests that cover the release-selection
logic to ensure entries under minimumReleaseAgeExclude (specifically the
'pkglab' pattern) are properly excluded — target the release decision code that
reads minimumReleaseAgeExclude (or the workflow that applies it) and create
tests asserting that packages matching 'pkglab' are skipped from minimum-age
gating; alternatively, if this change legitimately requires no tests, add a
short justification test/docs file referencing minimumReleaseAgeExclude and
'pkglab' to explain why no behavioral tests are necessary.

"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"dev:pub": "pnpm dev -- --env.publish",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add coverage for the new local publish workflow.

The switch to dev:pub/pkglab has no accompanying test updates; add tests (or equivalent automated verification) to ensure the new publish flow doesn’t regress local development.

As per coding guidelines, **/*: If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

🤖 Prompt for AI Agents
In `@packages/nextjs/package.json` at line 77, The new npm script "dev:pub" was
added to package.json to support the local publish workflow but there are no
tests covering this change; add automated tests that exercise the new local
publish flow (e.g., an integration test that runs the "dev:pub" script or
invokes the pkglab publish path and asserts expected side-effects such as
published package artifacts or updated local registry entries). Update or add a
test file (for example tests/integration/dev-pub.spec.ts or a CI step named
"local-publish") that calls the dev:pub script via the project test harness,
mocks external network calls if needed, and verifies success and failure states;
if adding tests is not possible, include a CI smoke-check that runs "pnpm
--filter ./packages/nextjs run dev:pub -- --dry-run" to validate the workflow.
Ensure the test name references "dev:pub" and the pkglab/local publish behavior
so it will catch regressions to this script.

Comment on lines 35 to +37
minimumReleaseAgeExclude:
- '@clerk/*'
- 'pkglab'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add tests for the pkglab workflow change.

No tests were added or modified alongside this tooling shift; please add coverage or justify why it isn't needed before merging. As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

🤖 Prompt for AI Agents
In `@pnpm-workspace.yaml` around lines 35 - 37, The change adds 'pkglab' to
minimumReleaseAgeExclude but no tests were added; add unit or integration tests
that cover the release-selection logic to ensure entries under
minimumReleaseAgeExclude (specifically the 'pkglab' pattern) are properly
excluded — target the release decision code that reads minimumReleaseAgeExclude
(or the workflow that applies it) and create tests asserting that packages
matching 'pkglab' are skipped from minimum-age gating; alternatively, if this
change legitimately requires no tests, add a short justification test/docs file
referencing minimumReleaseAgeExclude and 'pkglab' to explain why no behavioral
tests are necessary.

Removes yalc entirely and replaces it with pkglab, which publishes to a
real local Verdaccio registry for proper npm-like installs. Each package
now has a dev:pub script that runs the build in watch mode and fires
pkglab pub --ping on each rebuild, letting the listener coalesce rapid
publishes into batched cycles. Playground apps use workspace:* instead
of file:.yalc references.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/expo/tsup.config.ts (1)

8-29: ⚠️ Potential issue | 🟠 Major

Add tests for the new pkglab publish workflow.

No tests were added or modified; please add coverage for this behavior.

As per coding guidelines, "If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes."

🤖 Fix all issues with AI agents
In `@packages/react/package.json`:
- Line 95: The "dev:pub" npm script currently uses `pnpm dev --env.publish`
which lets pnpm interpret the flag instead of forwarding it to tsup; update the
"dev:pub" script so the flag is forwarded by inserting the `--` separator (i.e.,
run `pnpm dev -- --env.publish`) so tsup receives the `--env.publish` env flag
and the pkglab publish step runs as expected.

"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev --env.publish",
"dev:pub": "pnpm dev --env.publish",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing -- separator before --env.publish.

Other packages in this PR use pnpm dev -- --env.publish with the -- separator to ensure the flag is passed to tsup rather than interpreted by pnpm. Without it, tsup may not receive the publish env flag, causing the pkglab publish step to be skipped silently.

Proposed fix
-    "dev:pub": "pnpm dev --env.publish",
+    "dev:pub": "pnpm dev -- --env.publish",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dev:pub": "pnpm dev --env.publish",
"dev:pub": "pnpm dev -- --env.publish",
🤖 Prompt for AI Agents
In `@packages/react/package.json` at line 95, The "dev:pub" npm script currently
uses `pnpm dev --env.publish` which lets pnpm interpret the flag instead of
forwarding it to tsup; update the "dev:pub" script so the flag is forwarded by
inserting the `--` separator (i.e., run `pnpm dev -- --env.publish`) so tsup
receives the `--env.publish` env flag and the pkglab publish step runs as
expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants