storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
83.93k stars 9.21k forks source link

[Feature Request]: support pnpm `lockfileVersion` v6 #20673

Closed mcmxcdev closed 1 year ago

mcmxcdev commented 1 year ago

Is your feature request related to a problem? Please describe

We just attempted to opt-in to the new lockfile format which will become default with pnpm v8 and all works well, except for the storybook dev and prod builds:

nx run app:build-storybook --verbose

> nx run app:build-storybook

>  NX  ui framework: @storybook/react

>  NX  Storybook builder starting ...

info => Cleaning outputDir: /home/user/Webdevelopment/Freelancing/org/repo/dist/storybook/app

 >  NX   Cannot copy `/home/user/Webdevelopment/Freelancing/org/repo/node_modules/.pnpm/@storybook+core-server@6.5.15(@storybook+builder-w_2rbwioi6ggwys4pddb257x4q6a/node_modules/@storybook/core-server/public/favicon.ico`: the file doesn't exist

NestedError: Cannot copy `/home/user/Webdevelopment/Freelancing/org/repo/node_modules/.pnpm/@storybook+core-server@6.5.15(@storybook+builder-w_2rbwioi6ggwys4pddb257x4q6a/node_modules/@storybook/core-server/public/favicon.ico`: the file doesn't exist
    at /home/user/Webdevelopment/Freelancing/org/repo/node_modules/.pnpm/cpy@8.1.2/node_modules/cpy/index.js:96:10
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.buildStaticStandalone (/home/user/Webdevelopment/Freelancing/org/repo/node_modules/.pnpm/@storybook+core-server@6.5.15(@storybook+builder-w_2rbwioi6ggwys4pddb257x4q6a/node_modules/@storybook/core-server/dist/cjs/build-static.js:104:3)

Not sure what the exact problem is here but I can build storybook successfully again after revering to lockfile format v5.4

Describe the solution you'd like

Support pnpm lockfileVersion v6 which was introduced in https://github.com/pnpm/pnpm/releases/tag/v7.24.2

Describe alternatives you've considered

Stick to lockfileVersion v5.4 for now

Are you able to assist to bring the feature to reality?

no

Additional context

No response

mcmxcdev commented 1 year ago

In the end I was able to upgrade to storybook v7 beta and there it works without a problem.

Anyways, since not everyone will be able to do that, I have created a minimal repo: https://github.com/mcmxcdev/pnpm-nx-storybook-issue

nx run ui-design:storybook will work while the nx run ui-design:build-storybook should be breaking with the error message in the original issue description.

shilman commented 1 year ago

This is apparently fixed in the latest prerelease. Please upgrade to use the new lockfile format

Migration guide: https://storybook.js.org/migration-guides/7.0

Closing this since we probably won't fix in 6.5.