-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Core: Improve mono repo handling for JsPackageManager class and helpers #31553
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
base: valentin/monorepo-enhancements
Are you sure you want to change the base?
Core: Improve mono repo handling for JsPackageManager class and helpers #31553
Conversation
View your CI Pipeline Execution ↗ for commit ef8f4f2.
☁️ Nx Cloud last updated this comment at |
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.
68 file(s) reviewed, 24 comment(s)
Edit PR Review Bot Settings | Greptile
const babelCoreVersion = packageManager.getDependencyVersion('babel-core'); | ||
|
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.
style: Consider caching getDependencyVersion result since it's used multiple times for the same package
getInstalledVersion: async (pkg: string) => | ||
pkg === 'svelte' ? svelteVersion : undefined, | ||
getAllDependencies: async () => ({ svelte: `^${svelteVersion}` }), | ||
getAllDependencies: () => ({ svelte: `^${svelteVersion}` }), | ||
} as any as JsPackageManager; |
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.
logic: getAllDependencies is now synchronous but getInstalledVersion remains async - verify this is intentional
getRemoteRunCommand(pkg: string, args: string[], specifier?: string): string { | ||
return `bunx ${pkg}${specifier ? `@${specifier}` : ''} ${args.join(' ')}`; | ||
} |
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.
logic: getRemoteRunCommand signature changed but doesn't match parent class JsPackageManager - this will cause TypeScript errors
public getModulePackageJSON(packageName: string, basePath = this.cwd): PackageJson | null { | ||
const packageJsonPath = findUpSync( |
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.
logic: getModulePackageJSON is not defined in the parent JsPackageManager class and appears to replace getPackageJSON, which will break inheritance
async removeDependencies(dependencies: string[]): Promise<void> { | ||
for (const pjPath of this.packageJsonPaths) { | ||
try { | ||
await this.runRemoveDeps(dependencies); | ||
const currentPackageJson = JsPackageManager.getPackageJson(dirname(pjPath)); | ||
let modified = false; | ||
dependencies.forEach((dep) => { | ||
if (currentPackageJson.dependencies && currentPackageJson.dependencies[dep]) { | ||
delete currentPackageJson.dependencies[dep]; | ||
modified = true; | ||
} | ||
if (currentPackageJson.devDependencies && currentPackageJson.devDependencies[dep]) { | ||
delete currentPackageJson.devDependencies[dep]; | ||
modified = true; | ||
} | ||
if (currentPackageJson.peerDependencies && currentPackageJson.peerDependencies[dep]) { | ||
delete currentPackageJson.peerDependencies[dep]; | ||
modified = true; | ||
} | ||
}); | ||
if (modified) { | ||
this.writePackageJson(currentPackageJson, dirname(pjPath)); | ||
} | ||
} catch (e) { | ||
logger.error('An error occurred while removing dependencies.'); | ||
logger.log(String(e)); | ||
throw new HandledError(e); | ||
logger.warn(`Could not process ${pjPath} for dependency removal: ${String(e)}`); | ||
} | ||
} | ||
} |
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.
style: This method now modifies all package.json files without running package manager commands. Consider adding a warning log that users may need to run install manually after these changes.
async removeDependencies(dependencies: string[]): Promise<void> { | |
for (const pjPath of this.packageJsonPaths) { | |
try { | |
await this.runRemoveDeps(dependencies); | |
const currentPackageJson = JsPackageManager.getPackageJson(dirname(pjPath)); | |
let modified = false; | |
dependencies.forEach((dep) => { | |
if (currentPackageJson.dependencies && currentPackageJson.dependencies[dep]) { | |
delete currentPackageJson.dependencies[dep]; | |
modified = true; | |
} | |
if (currentPackageJson.devDependencies && currentPackageJson.devDependencies[dep]) { | |
delete currentPackageJson.devDependencies[dep]; | |
modified = true; | |
} | |
if (currentPackageJson.peerDependencies && currentPackageJson.peerDependencies[dep]) { | |
delete currentPackageJson.peerDependencies[dep]; | |
modified = true; | |
} | |
}); | |
if (modified) { | |
this.writePackageJson(currentPackageJson, dirname(pjPath)); | |
} | |
} catch (e) { | |
logger.error('An error occurred while removing dependencies.'); | |
logger.log(String(e)); | |
throw new HandledError(e); | |
logger.warn(`Could not process ${pjPath} for dependency removal: ${String(e)}`); | |
} | |
} | |
} | |
async removeDependencies(dependencies: string[]): Promise<void> { | |
logger.warn('Dependencies will be removed from package.json files. You may need to run install afterwards.'); | |
for (const pjPath of this.packageJsonPaths) { | |
try { | |
const currentPackageJson = JsPackageManager.getPackageJson(dirname(pjPath)); | |
let modified = false; | |
dependencies.forEach((dep) => { | |
if (currentPackageJson.dependencies && currentPackageJson.dependencies[dep]) { | |
delete currentPackageJson.dependencies[dep]; | |
modified = true; | |
} | |
if (currentPackageJson.devDependencies && currentPackageJson.devDependencies[dep]) { | |
delete currentPackageJson.devDependencies[dep]; | |
modified = true; | |
} | |
if (currentPackageJson.peerDependencies && currentPackageJson.peerDependencies[dep]) { | |
delete currentPackageJson.peerDependencies[dep]; | |
modified = true; | |
} | |
}); | |
if (modified) { | |
this.writePackageJson(currentPackageJson, dirname(pjPath)); | |
} | |
} catch (e) { | |
logger.warn(`Could not process ${pjPath} for dependency removal: ${String(e)}`); | |
} | |
} | |
} |
@@ -73,6 +73,7 @@ command('add <addon>') | |||
'Force package manager for installing dependencies' | |||
) | |||
.option('-c, --config-dir <dir-name>', 'Directory where to load Storybook configurations from') | |||
.option('--skip-install', 'Skip installing deps') |
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.
style: Consider using the same flag format as line 51 (-s) for consistency
let mainConfig; | ||
let storybookVersion: string | undefined; | ||
let mainConfig: StorybookConfigRaw | undefined; | ||
let packageManager!: JsPackageManager; |
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.
logic: Using definite assignment assertion (!) here could mask initialization errors if getStorybookData fails
migration: any, | ||
{ glob, dryRun, list, rename, parser, configDir: userSpecifiedConfigDir }: CLIOptions | ||
) { | ||
export async function migrate(migration: any, { glob, dryRun, list, rename, parser }: CLIOptions) { |
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.
style: Migration parameter should be typed more specifically than 'any'
export async function migrate(migration: any, { glob, dryRun, list, rename, parser }: CLIOptions) { | |
export async function migrate(migration: string, { glob, dryRun, list, rename, parser }: CLIOptions) { |
migration: any, | ||
{ glob, dryRun, list, rename, parser, configDir: userSpecifiedConfigDir }: CLIOptions | ||
) { | ||
export async function migrate(migration: any, { glob, dryRun, list, rename, parser }: CLIOptions) { | ||
if (list) { | ||
listCodemods().forEach((key: any) => logger.log(key)); |
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.
style: Key parameter in forEach callback should be typed more specifically than 'any'
listCodemods().forEach((key: any) => logger.log(key)); | |
listCodemods().forEach((key: string) => logger.log(key)); |
@@ -369,6 +369,7 @@ export const doUpgrade = async (allOptions: UpgradeOptions) => { | |||
// Users struggle to upgrade Storybook with npm because of conflicting peer-dependencies | |||
// GitHub Issue: https://github.com/storybookjs/storybook/issues/30306 | |||
// Solution: Remove all Storybook packages (except 'storybook') from the package.json and install them again | |||
// TODO: Check if this is still needed due to the resolution fix for the `storybook` package |
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.
style: Consider removing this TODO comment since the overrides fix is now implemented above
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 513 KB | 🚨 +513 KB 🚨 |
Dependency size | 0 B | 2.80 MB | 🚨 +2.80 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-actions
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 574 B | 🚨 +574 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-backgrounds
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 590 B | 🚨 +590 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-controls
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 578 B | 🚨 +578 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-docs
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 12 | 🚨 +12 🚨 |
Self size | 0 B | 2.42 MB | 🚨 +2.42 MB 🚨 |
Dependency size | 0 B | 8.92 MB | 🚨 +8.92 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-jest
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 38 KB | 🚨 +38 KB 🚨 |
Dependency size | 0 B | 53 KB | 🚨 +53 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-links
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 1 | 🚨 +1 🚨 |
Self size | 0 B | 20 KB | 🚨 +20 KB 🚨 |
Dependency size | 0 B | 5 KB | 🚨 +5 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-measure
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 574 B | 🚨 +574 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-onboarding
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 223 KB | 🚨 +223 KB 🚨 |
Dependency size | 0 B | 658 B | 🚨 +658 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-outline
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 574 B | 🚨 +574 B 🚨 |
Bundle Size Analyzer | Link | Link |
storybook-addon-pseudo-states
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 46 KB | 🚨 +46 KB 🚨 |
Dependency size | 0 B | 677 B | 🚨 +677 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-themes
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 1 | 🚨 +1 🚨 |
Self size | 0 B | 20 KB | 🚨 +20 KB 🚨 |
Dependency size | 0 B | 28 KB | 🚨 +28 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-toolbars
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 578 B | 🚨 +578 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-viewport
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 3 KB | 🚨 +3 KB 🚨 |
Dependency size | 0 B | 578 B | 🚨 +578 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-vitest
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 6 | 🚨 +6 🚨 |
Self size | 0 B | 629 KB | 🚨 +629 KB 🚨 |
Dependency size | 0 B | 1.49 MB | 🚨 +1.49 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/builder-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 5 | 🚨 +5 🚨 |
Self size | 0 B | 448 KB | 🚨 +448 KB 🚨 |
Dependency size | 0 B | 826 KB | 🚨 +826 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/builder-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 198 | 🚨 +198 🚨 |
Self size | 0 B | 80 KB | 🚨 +80 KB 🚨 |
Dependency size | 0 B | 31.25 MB | 🚨 +31.25 MB 🚨 |
Bundle Size Analyzer | Link | Link |
storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 49 | 🚨 +49 🚨 |
Self size | 0 B | 31.51 MB | 🚨 +31.51 MB 🚨 |
Dependency size | 0 B | 17.40 MB | 🚨 +17.40 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/angular
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 208 | 🚨 +208 🚨 |
Self size | 0 B | 606 KB | 🚨 +606 KB 🚨 |
Dependency size | 0 B | 29.54 MB | 🚨 +29.54 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/ember
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 208 | 🚨 +208 🚨 |
Self size | 0 B | 28 KB | 🚨 +28 KB 🚨 |
Dependency size | 0 B | 28.82 MB | 🚨 +28.82 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/html-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 8 | 🚨 +8 🚨 |
Self size | 0 B | 23 KB | 🚨 +23 KB 🚨 |
Dependency size | 0 B | 1.32 MB | 🚨 +1.32 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/nextjs
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 534 | 🚨 +534 🚨 |
Self size | 0 B | 216 KB | 🚨 +216 KB 🚨 |
Dependency size | 0 B | 58.69 MB | 🚨 +58.69 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/nextjs-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 127 | 🚨 +127 🚨 |
Self size | 0 B | 2.39 MB | 🚨 +2.39 MB 🚨 |
Dependency size | 0 B | 22.05 MB | 🚨 +22.05 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preact-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 8 | 🚨 +8 🚨 |
Self size | 0 B | 13 KB | 🚨 +13 KB 🚨 |
Dependency size | 0 B | 1.30 MB | 🚨 +1.30 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 160 | 🚨 +160 🚨 |
Self size | 0 B | 35 KB | 🚨 +35 KB 🚨 |
Dependency size | 0 B | 23.19 MB | 🚨 +23.19 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 120 | 🚨 +120 🚨 |
Self size | 0 B | 32 KB | 🚨 +32 KB 🚨 |
Dependency size | 0 B | 20.16 MB | 🚨 +20.16 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 284 | 🚨 +284 🚨 |
Self size | 0 B | 25 KB | 🚨 +25 KB 🚨 |
Dependency size | 0 B | 43.48 MB | 🚨 +43.48 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 210 | 🚨 +210 🚨 |
Self size | 0 B | 17 KB | 🚨 +17 KB 🚨 |
Dependency size | 0 B | 32.52 MB | 🚨 +32.52 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 17 | 🚨 +17 🚨 |
Self size | 0 B | 53 KB | 🚨 +53 KB 🚨 |
Dependency size | 0 B | 25.92 MB | 🚨 +25.92 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/sveltekit
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 18 | 🚨 +18 🚨 |
Self size | 0 B | 51 KB | 🚨 +51 KB 🚨 |
Dependency size | 0 B | 25.98 MB | 🚨 +25.98 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 103 | 🚨 +103 🚨 |
Self size | 0 B | 34 KB | 🚨 +34 KB 🚨 |
Dependency size | 0 B | 42.69 MB | 🚨 +42.69 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 9 | 🚨 +9 🚨 |
Self size | 0 B | 20 KB | 🚨 +20 KB 🚨 |
Dependency size | 0 B | 1.35 MB | 🚨 +1.35 MB 🚨 |
Bundle Size Analyzer | Link | Link |
sb
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 50 | 🚨 +50 🚨 |
Self size | 0 B | 1 KB | 🚨 +1 KB 🚨 |
Dependency size | 0 B | 48.91 MB | 🚨 +48.91 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 324 | 🚨 +324 🚨 |
Self size | 0 B | 173 KB | 🚨 +173 KB 🚨 |
Dependency size | 0 B | 97.58 MB | 🚨 +97.58 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 267 | 🚨 +267 🚨 |
Self size | 0 B | 31 KB | 🚨 +31 KB 🚨 |
Dependency size | 0 B | 81.93 MB | 🚨 +81.93 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/core-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 1 | 🚨 +1 🚨 |
Self size | 0 B | 16 KB | 🚨 +16 KB 🚨 |
Dependency size | 0 B | 28 KB | 🚨 +28 KB 🚨 |
Bundle Size Analyzer | Link | Link |
create-storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 1 | 🚨 +1 🚨 |
Self size | 0 B | 11.07 MB | 🚨 +11.07 MB 🚨 |
Dependency size | 0 B | 98 KB | 🚨 +98 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/csf-plugin
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 3 | 🚨 +3 🚨 |
Self size | 0 B | 10 KB | 🚨 +10 KB 🚨 |
Dependency size | 0 B | 788 KB | 🚨 +788 KB 🚨 |
Bundle Size Analyzer | Link | Link |
eslint-plugin-storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 33 | 🚨 +33 🚨 |
Self size | 0 B | 321 KB | 🚨 +321 KB 🚨 |
Dependency size | 0 B | 3.36 MB | 🚨 +3.36 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react-dom-shim
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 0 | 0 |
Self size | 0 B | 10 KB | 🚨 +10 KB 🚨 |
Dependency size | 0 B | 786 B | 🚨 +786 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-create-react-app
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 68 | 🚨 +68 🚨 |
Self size | 0 B | 18 KB | 🚨 +18 KB 🚨 |
Dependency size | 0 B | 5.89 MB | 🚨 +5.89 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 175 | 🚨 +175 🚨 |
Self size | 0 B | 24 KB | 🚨 +24 KB 🚨 |
Dependency size | 0 B | 30.32 MB | 🚨 +30.32 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-server-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 10 | 🚨 +10 🚨 |
Self size | 0 B | 10 KB | 🚨 +10 KB 🚨 |
Dependency size | 0 B | 1.20 MB | 🚨 +1.20 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/html
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 38 KB | 🚨 +38 KB 🚨 |
Dependency size | 0 B | 32 KB | 🚨 +32 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/preact
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 23 KB | 🚨 +23 KB 🚨 |
Dependency size | 0 B | 32 KB | 🚨 +32 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/react
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 1.66 MB | 🚨 +1.66 MB 🚨 |
Dependency size | 0 B | 16 KB | 🚨 +16 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/server
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 3 | 🚨 +3 🚨 |
Self size | 0 B | 13 KB | 🚨 +13 KB 🚨 |
Dependency size | 0 B | 716 KB | 🚨 +716 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 2 | 🚨 +2 🚨 |
Self size | 0 B | 64 KB | 🚨 +64 KB 🚨 |
Dependency size | 0 B | 230 KB | 🚨 +230 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/vue3
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 3 | 🚨 +3 🚨 |
Self size | 0 B | 83 KB | 🚨 +83 KB 🚨 |
Dependency size | 0 B | 212 KB | 🚨 +212 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/web-components
Before | After | Difference | |
---|---|---|---|
Dependency count | 0 | 3 | 🚨 +3 🚨 |
Self size | 0 B | 57 KB | 🚨 +57 KB 🚨 |
Dependency size | 0 B | 47 KB | 🚨 +47 KB 🚨 |
Bundle Size Analyzer | Link | Link |
Closes #
What I did
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.ts
Make sure this PR contains one of the labels below:
Available labels
bug
: Internal changes that fixes incorrect behavior.maintenance
: User-facing maintenance tasks.dependencies
: Upgrading (sometimes downgrading) dependencies.build
: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup
: Minor cleanup style change. Will not show up in release changelog.documentation
: Documentation only changes. Will not show up in release changelog.feature request
: Introducing a new feature.BREAKING CHANGE
: Changes that break compatibility in some way with current major version.other
: Changes that don't fit in the above categories.🦋 Canary release
This pull request has been released as version
0.0.0-pr-31553-sha-eac26474
. Try it out in a new sandbox by runningnpx [email protected] sandbox
or in an existing project withnpx [email protected] upgrade
.More information
0.0.0-pr-31553-sha-eac26474
valentin/improve-monorepo-support-for-js-package-manager
eac26474
1747951114
)To request a new release of this pull request, mention the
@storybookjs/core
team.core team members can create a new canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=31553
Greptile Summary
This PR significantly improves monorepo support in the JsPackageManager class and related helpers, focusing on package management operations and configuration handling across multiple package.json files.
primaryPackageJson
property to replaceretrievePackageJson()
, providing better monorepo-aware package.json handlinggetAllDependencies()
from async to sync for improved performance and simplified dependency lookupsgetModulePackageJSON()
method withstopAt
parameter to properly scope package searches in monorepos--skip-install
flag to CLI commands for better control over package installations in monorepo setups