-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Core: Mark pnp support as deprecated #32645
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
Changes from all commits
d6f94a2
51c0518
8158942
a80203c
e055907
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,7 @@ import prompts from 'prompts'; | |
| import invariant from 'tiny-invariant'; | ||
| import { dedent } from 'ts-dedent'; | ||
|
|
||
| import { detectPnp } from '../cli/detect'; | ||
| import { resolvePackageDir } from '../shared/utils/module'; | ||
| import { storybookDevServer } from './dev-server'; | ||
| import { buildOrThrow } from './utils/build-or-throw'; | ||
|
|
@@ -94,6 +95,17 @@ export async function buildDevStandalone( | |
| options.outputDir = outputDir; | ||
| options.serverChannelUrl = getServerChannelUrl(port, options); | ||
|
|
||
| // TODO: Remove in SB11 | ||
| options.pnp = await detectPnp(); | ||
| if (options.pnp) { | ||
| deprecate(dedent` | ||
| As of Storybook 10.0, PnP is deprecated. | ||
| If you are using PnP, you can continue to use Storybook 10.0, but we recommend migrating to a different package manager or linker-mode. | ||
|
|
||
| In future versions, PnP compatibility will be removed. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's say version 11 here if that's what we're planning
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ndelangen ☝️
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| `); | ||
| } | ||
|
|
||
| const config = await loadMainConfig(options); | ||
| const { framework } = config; | ||
| const corePresets = []; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # TODO: Remove this whole test-storybooks/yarn-pnp directory in SB11 | ||
|
|
||
| yarnPath: ../../.yarn/releases/yarn-4.10.3.cjs | ||
|
|
||
| nodeLinker: pnp |
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.
Limit search scope to prevent false positives.
The
find.any()call searches without a boundary and may traverse parent directories beyond the project root. If a parent directory contains.pnp.jsor.pnp.cjs, this function will returntrueeven when the current project doesn't use PnP, triggering incorrect deprecation warnings.Apply this diff to limit the search to the project root, consistent with
detectBuilder(lines 115–116):// TODO: Remove in SB11 export async function detectPnp() { - return !!find.any(['.pnp.js', '.pnp.cjs']); + return !!find.any(['.pnp.js', '.pnp.cjs'], { last: getProjectRoot() }); }📝 Committable suggestion
🤖 Prompt for AI Agents