chore: replace yalc with pkglab for local package development#7850
chore: replace yalc with pkglab for local package development#7850nikosdouvlis wants to merge 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
📝 WalkthroughWalkthroughThe repo replaces yalc-based local publishing with pkglab. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 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 (3)
packages/tanstack-react-start/tsup.config.ts (1)
9-36:⚠️ Potential issue | 🟠 MajorAdd coverage for the publish-flag build path.
I didn’t see tests updated for the new
shouldPublish/onSuccessflow. If the full PR doesn’t include tests, please add at least a smoke test or script-level check that validatespkglab pub --pingruns when--env.publishis 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 | 🟠 MajorAdd 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 | 🔴 CriticalAdd
--to forward--env.publishto thedevscript.
pnpmrequires--before script arguments to forward them to the underlying command. Without it,--env.publishis interpreted bypnpmitself, 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",
6f1aa82 to
4275e38
Compare
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)
package.json (1)
1-167:⚠️ Potential issue | 🔴 CriticalCI is failing due to lockfile mismatch.
The pipeline reports a lockfile specifier mismatch for
astro: lockfile has^5.15.9but manifest has^5.17.1. Runpnpm install --lockfile-onlyto regenerate the lockfile after all manifest changes are finalized.
4275e38 to
b19bc43
Compare
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
| minimumReleaseAgeExclude: | ||
| - '@clerk/*' | ||
| - 'pkglab' |
There was a problem hiding this comment.
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.
b19bc43 to
8c03011
Compare
There was a problem hiding this comment.
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 | 🟠 MajorAdd 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", |
There was a problem hiding this comment.
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.
| "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.
Why
yalc injects
.yalcdirectories and modifiespackage.jsonwithfile: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
filesarray are all validated the same way npm would. Consumer repos install with a standardpnpm install, producing the samenode_modulestree your users will get. One copy of React. Correct peer dependency resolution. Real lock file entries.What changed
publish:localscripts^0.10.0) as a devDependency withminimumReleaseAgeExcludeentrypubscript (pkglab pub) for one-shot publishingdev:pubscript to 20 packages that firespkglab pub --pingon each successful rebuild, letting the pkglab listener coalesce rapid publishes into batched cyclesfile:.yalc/@clerk/*toworkspace:*More info
For full documentation on pkglab commands, workflow, and design decisions: https://github.com/nikosdouvlis/pkglab
Summary by CodeRabbit
Chores
Dependency
Documentation
Ignores