-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: work-around for pnpm
catalog
support
#32
fix: work-around for pnpm
catalog
support
#32
Conversation
AriPerkkio
commented
Mar 9, 2025
•
edited
Loading
edited
- Latest run: https://github.com/AriPerkkio/vitest-ecosystem-ci/actions/runs/13751231941
|
9dd8ecd
to
118ba7a
Compare
Using |
How about using packed |
At least locally that seems to work. Though there are some peer dep warnings, but it should be fine.
|
118ba7a
to
ba48f6c
Compare
@@ -350,9 +350,12 @@ export async function buildVitest({ verify = false }) { | |||
cd(vitestPath) | |||
const frozenInstall = getCommand('pnpm', 'frozen') | |||
const runBuild = getCommand('pnpm', 'run', ['build']) | |||
const runPack = `pnpm -r --filter=./packages/** exec -- pnpm pack` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getCommand
from @antfu/ni
didn't support this so hardcoding the command here.
Agree with @hi-ogawa's suggestion to use Here's my explanation before I saw @hi-ogawa's message. Running a |
Using With {
- vitest: 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/vitest',
- 'vite-node': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/vite-node',
- '@vitest/browser': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/browser',
- '@vitest/coverage-istanbul': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/coverage-istanbul',
- '@vitest/expect': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/expect',
- '@vitest/snapshot': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/snapshot',
- '@vitest/ui': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/ui',
- '@vitest/web-worker': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/web-worker',
- '@vitest/coverage-v8': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/coverage-v8',
- '@vitest/runner': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/runner',
- '@vitest/spy': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/spy',
- '@vitest/utils': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/utils',
- '@vitest/ws-client': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/ws-client',
- '@vitest/pretty-format': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/pretty-format',
- '@vitest/mocker': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/mocker'
+ vitest: 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/vitest/vitest-3.0.8.tgz',
+ 'vite-node': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/vite-node/vite-node-3.0.8.tgz',
+ '@vitest/browser': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/browser/vitest-browser-3.0.8.tgz',
+ '@vitest/coverage-istanbul': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/coverage-istanbul/vitest-coverage-istanbul-3.0.8.tgz',
+ '@vitest/expect': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/expect/vitest-expect-3.0.8.tgz',
+ '@vitest/snapshot': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/snapshot/vitest-snapshot-3.0.8.tgz',
+ '@vitest/ui': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/ui/vitest-ui-3.0.8.tgz',
+ '@vitest/web-worker': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/web-worker/vitest-web-worker-3.0.8.tgz',
+ '@vitest/coverage-v8': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/coverage-v8/vitest-coverage-v8-3.0.8.tgz',
+ '@vitest/runner': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/runner/vitest-runner-3.0.8.tgz',
+ '@vitest/spy': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/spy/vitest-spy-3.0.8.tgz',
+ '@vitest/utils': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/utils/vitest-utils-3.0.8.tgz',
+ '@vitest/ws-client': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/ws-client/vitest-ws-client-3.0.8.tgz',
+ '@vitest/pretty-format': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/pretty-format/vitest-pretty-format-3.0.8.tgz',
+ '@vitest/mocker': 'file:/Users/x/vitest-ecosystem-ci/workspace/vitest/packages/mocker/vitest-mocker-3.0.8.tgz'
} |
Gotcha. The browser issues aren't too surprising when using I think you're trying to simulate what would happen if someone depended on |
if (pm === 'pnpm') { | ||
const version = parseVitestVersion(options.vitestPath) | ||
|
||
for (const key in overrides) { | ||
const tar = key.replace('@', '').replace('/', '-') | ||
overrides[key] = `${overrides[key]}/${tar}-${version}.tgz` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about other package managers? I'd assume they should also break when seeing catalog:
, but it's probably not tested right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Other packages managers would break when seeing catalog:
. I'd note that's not unique to the catalog:
protocol or pnpm. The file:
, link:
, and workspace:
protocols are also meant to be "local-only" and don't work across different repos. There's a requirement for a "portability" step (e.g. publish or pack) to remove protocols like workspace:
and catalog:
.
pnpm itself throws when encountering the catalog:
protocol in NPM packages since we don't want to encourage non-portable specifiers being published to the NPM registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the test setup doesn't contain other package managers. Otherwise we should already have run into issues with workspace:
protocol. 🤔
I think proper solution would be to use released packages from https://pkg.pr.new - I think Vite already has that kind of workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this to unblock CI 👍
I think I prefer this than reverting catalog entirely. Vite integrated https://pkg.pr.new, but I'm seeing quite a bit of flakiness there due to package download failure, so I'm not sure we should go setting up the same right now.