Skip to content

refactor: migrate @rolldown/pluginutils package from rolldown repository#61

Merged
sapphi-red merged 10 commits into
mainfrom
05-07-feat_add_rolldown_pluginutils_package
May 13, 2026
Merged

refactor: migrate @rolldown/pluginutils package from rolldown repository#61
sapphi-red merged 10 commits into
mainfrom
05-07-feat_add_rolldown_pluginutils_package

Conversation

@shulaoda
Copy link
Copy Markdown
Member

@shulaoda shulaoda commented May 7, 2026

Description

Refs rolldown/rolldown#8653. Companion PR: rolldown/rolldown#9317.

Ports @rolldown/pluginutils from rolldown/rolldown so it follows its own release cadence rather than rolldown's.

Why

When @rolldown/pluginutils shipped from the rolldown repo, every rolldown release published a new pluginutils version. Plugins in this repo pin specific (often pre-release) versions, and prerelease semver semantics (^1.0.0-rc.16 does not match 1.0.0-rc.17) prevented node_modules dedupe — users with rolldown plus any plugin that uses pluginutils ended up with several copies side by side.

Releasing pluginutils from this repo lets it follow stable semver. Once rolldown's companion PR switches to depending on ^1.0.0, the package manager can dedupe across rolldown and any plugin author who later depends on pluginutils.

Changes

  • packages/pluginutils/: source ported from rolldown/rolldown at v1.0.0.
    • Build switched to tsdown (matches other packages in this repo). Output is .mjs with dist/index.mjs and dist/filter/index.mjs; tsdown auto-extracts the shared filter implementation into a single chunk so the two entries don't duplicate code.
    • exports-consistency.test.ts dropped (the dual exports + publishConfig.exports setup is gone — single exports map now).
    • Two oxlint-disable-next-line typescript/no-unsafe-type-assertion annotations added where the original casts are intentional: one workaround for microsoft/TypeScript#17002, one runtime probe on a generic.
    • Source reformatted with oxfmt to match repo style.
  • scripts/release.ts: register pluginutils for the existing @vitejs/release-scripts flow. The existing getPkgDir (packages/${pkgName.replace('plugin-', '')}) already resolves correctly for the bare name.
  • .github/workflows/publish.yml, .github/workflows/release-tag.yml: extend tag triggers to pluginutils@*. The existing tag-parsing shell expression handles the bare prefix.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 7, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtypescript@​5.9.3100100909890

View full report

@sapphi-red
Copy link
Copy Markdown
Member

sapphi-red commented May 11, 2026

Was this marked as draft because of the lack of github actions pinning?

@shulaoda shulaoda marked this pull request as ready for review May 12, 2026 11:00
@shulaoda
Copy link
Copy Markdown
Member Author

Was this marked as draft because of the lack of github actions pinning?

This is because the CI hadn’t passed before. I was planning to take a look into it.

@sapphi-red sapphi-red changed the title feat: add @rolldown/pluginutils package feat: add @rolldown/pluginutils packag May 12, 2026
@sapphi-red sapphi-red changed the title feat: add @rolldown/pluginutils packag feat: add @rolldown/pluginutils package May 12, 2026
@sapphi-red sapphi-red changed the title feat: add @rolldown/pluginutils package refactor: migrate @rolldown/pluginutils package from rolldown repository May 12, 2026
shulaoda added a commit to rolldown/rolldown that referenced this pull request May 12, 2026
## PR description

Closes #8653.

`@rolldown/pluginutils` has been moved to https://github.com/rolldown/plugins so it can be released independently from `rolldown`. Companion PR: rolldown/plugins#61.

### Why

Previously `@rolldown/pluginutils` shared rolldown's release cadence — every rolldown publish (`1.0.0-beta.53` … `1.0.0-rc.18` … `1.0.0`) produced a new pluginutils version. Because pnpm rewrites `workspace:*` to an **exact** version on publish and prerelease semver does not match across pre-releases (`^1.0.0-rc.16` does **not** match `1.0.0-rc.17`), every plugin pinned to an older rc forced an extra copy into `node_modules`. Users typically saw 3–4 copies of `@rolldown/pluginutils` resolved side by side.

Decoupling the release cadence and depending on `^1.0.0` lets pnpm/npm dedupe across rolldown and any plugin that depends on pluginutils.

### Changes

- `packages/rolldown/package.json`: dependency on `@rolldown/pluginutils` switched from `workspace:*` to `^1.0.0`.
- `packages/pluginutils/`: removed (source now lives in `rolldown/plugins`).
- `Justfile`: dropped the `build-pluginutils` target and removed it as a prereq from `build`, `build-rolldown`, `build-rolldown-wasi`, `build-rolldown-release`, `build-browser`, `build-browser-release`.
- `.github/workflows/`:
  - `ci.yml`: removed the `pluginutils-changes` paths-filter and the `pluginutils-test` job; removed `Build @rolldown/pluginutils` steps in `node-validation` and `docs-validation`.
  - `publish-to-npm.yml`: removed the pluginutils artifact download.
  - `reusable-release-build.yml`: removed the `build-rolldown-pluginutils` job and the dependent download steps in `build-node-packages` / `build-rolldown-browser`.
  - `reusable-native-build.yml`: dropped `packages/pluginutils/dist` from the artifact upload path.
  - `publish-to-pkg.pr.new.yml`: removed the pluginutils artifact download and dropped `./packages/pluginutils` from the `pkg-pr-new` publish list.
- `scripts/misc/published-package-check.mjs`: removed `packages/pluginutils` from `packagesNeedToPublish`.
@sapphi-red sapphi-red merged commit eca3d46 into main May 13, 2026
13 checks passed
@sapphi-red sapphi-red deleted the 05-07-feat_add_rolldown_pluginutils_package branch May 13, 2026 03:31
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.

2 participants