-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Core: Move CSF to monorepo #30488
Core: Move CSF to monorepo #30488
Conversation
types of csf properties
This reverts commit 3fd17a7, reversing changes made to 045f8e18202097b5508a15fdbd2d16ef6f3f9472.
Co-Authored-By: Michael Shilman <shilman@users.noreply.github.com>
View your CI Pipeline Execution ↗ for commit 43f0399.
☁️ 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.
60 file(s) reviewed, 17 comment(s)
Edit PR Review Bot Settings | Greptile
interface SBBaseType { | ||
required?: boolean; | ||
raw?: string; | ||
} |
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: SBBaseType interface should be exported since it's used by other exported types
interface SBBaseType { | |
required?: boolean; | |
raw?: string; | |
} | |
export interface SBBaseType { | |
required?: boolean; | |
raw?: string; | |
} |
['object true', { eq: { x: 1 } }, { x: 1 }, true], | ||
['object true', { eq: { x: 1 } }, { x: 2 }, false], |
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: Duplicate test case name 'object true' may cause confusion when debugging failures
const count = (vals: any[]) => vals.map((v) => typeof v !== 'undefined').filter(Boolean).length; | ||
|
||
export const testValue = (cond: Omit<Conditional, 'arg' | 'global'>, value: any) => { | ||
const { exists, eq, neq, truthy } = cond as any; |
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: casting to 'any' loses type safety - consider using a more specific type for destructured values
expectTypeOf<ArgsFromMeta<XRenderer, typeof meta>>().toEqualTypeOf<{ | ||
theme: string; | ||
decoratorArg: string; | ||
decoratorArg2: string; | ||
loaderArg: number; | ||
loaderArg2: number; | ||
}>(); |
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: ArgsFromMeta type test doesn't verify that the 'disabled' property from meta.args is included in the inferred type
/** @deprecated Project `globals` renamed to `initiaGlobals` */ | ||
globals?: Globals; | ||
initialGlobals?: Globals; |
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.
syntax: typo in deprecation message - 'initiaGlobals' should be 'initialGlobals'
/** @deprecated Project `globals` renamed to `initiaGlobals` */ | |
globals?: Globals; | |
initialGlobals?: Globals; | |
/** @deprecated Project `globals` renamed to `initialGlobals` */ | |
globals?: Globals; | |
initialGlobals?: Globals; |
.toLowerCase() | ||
|
||
.replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '-') | ||
.replace(/-+/g, '-') |
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: regex pattern includes redundant escape characters for characters that don't need escaping in character class
@@ -3,7 +3,7 @@ import { useEffect, useState } from 'react'; | |||
import { GLOBALS_UPDATED } from 'storybook/internal/core-events'; | |||
import type { DocsContextProps, PreparedStory } from 'storybook/internal/types'; | |||
|
|||
import type { Globals } from '@storybook/csf'; | |||
import type { Globals } from '@storybook/internal/csf'; | |||
|
|||
export const useGlobals = (story: PreparedStory, context: DocsContextProps): [Globals] => { |
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 adding return type documentation since this hook returns a tuple with a single element. The type signature could be clearer as [Globals, void] or just Globals.
@@ -0,0 +1,2 @@ | |||
export * from '@storybook/core/csf'; | |||
export type * from '@storybook/core/csf'; |
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.
syntax: The export type *
syntax is incorrect. TypeScript uses export type { ... }
with explicit type names. Consider using export * as type
or listing specific types to export.
export type * from '@storybook/core/csf'; | |
export * as type from '@storybook/core/csf'; |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 56 | 54 | 🎉 -2 🎉 |
Self size | 332 KB | 332 KB | 0 B |
Dependency size | 12.71 MB | 12.46 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-docs
Before | After | Difference | |
---|---|---|---|
Dependency count | 15 | 13 | 🎉 -2 🎉 |
Self size | 2.26 MB | 2.26 MB | 0 B |
Dependency size | 9.66 MB | 9.41 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-essentials
Before | After | Difference | |
---|---|---|---|
Dependency count | 34 | 32 | 🎉 -2 🎉 |
Self size | 12 KB | 12 KB | 0 B |
Dependency size | 15.68 MB | 15.43 MB | 🎉 -255 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-interactions
Before | After | Difference | |
---|---|---|---|
Dependency count | 56 | 54 | 🎉 -2 🎉 |
Self size | 128 KB | 128 KB | 0 B |
Dependency size | 12.74 MB | 12.48 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-links
Before | After | Difference | |
---|---|---|---|
Dependency count | 4 | 2 | 🎉 -2 🎉 |
Self size | 19 KB | 19 KB | 🚨 +8 B 🚨 |
Dependency size | 284 KB | 32 KB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/addon-storysource
Before | After | Difference | |
---|---|---|---|
Dependency count | 7 | 5 | 🎉 -2 🎉 |
Self size | 1.89 MB | 1.89 MB | 0 B |
Dependency size | 10.80 MB | 10.55 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/experimental-addon-test
Before | After | Difference | |
---|---|---|---|
Dependency count | 60 | 58 | 🎉 -2 🎉 |
Self size | 831 KB | 831 KB | 🎉 -32 B 🎉 |
Dependency size | 14.19 MB | 13.94 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/core
Before | After | Difference | |
---|---|---|---|
Dependency count | 54 | 52 | 🎉 -2 🎉 |
Self size | 19.22 MB | 19.26 MB | 🚨 +40 KB 🚨 |
Dependency size | 14.44 MB | 14.19 MB | 🎉 -253 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/experimental-nextjs-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 188 | 186 | 🎉 -2 🎉 |
Self size | 232 KB | 232 KB | 0 B |
Dependency size | 48.25 MB | 47.99 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/nextjs
Before | After | Difference | |
---|---|---|---|
Dependency count | 592 | 591 | 🎉 -1 🎉 |
Self size | 472 KB | 472 KB | 0 B |
Dependency size | 83.46 MB | 83.41 MB | 🎉 -50 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 255 | 253 | 🎉 -2 🎉 |
Self size | 14 KB | 14 KB | 0 B |
Dependency size | 32.69 MB | 32.44 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-vite
Before | After | Difference | |
---|---|---|---|
Dependency count | 134 | 135 | 🚨 +1 🚨 |
Self size | 22 KB | 22 KB | 0 B |
Dependency size | 36.38 MB | 36.43 MB | 🚨 +50 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte-webpack5
Before | After | Difference | |
---|---|---|---|
Dependency count | 310 | 311 | 🚨 +1 🚨 |
Self size | 6 KB | 6 KB | 0 B |
Dependency size | 39.28 MB | 39.33 MB | 🚨 +50 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/sveltekit
Before | After | Difference | |
---|---|---|---|
Dependency count | 142 | 143 | 🚨 +1 🚨 |
Self size | 47 KB | 47 KB | 0 B |
Dependency size | 39.68 MB | 39.73 MB | 🚨 +50 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/blocks
Before | After | Difference | |
---|---|---|---|
Dependency count | 4 | 2 | 🎉 -2 🎉 |
Self size | 607 KB | 607 KB | 🎉 -8 B 🎉 |
Dependency size | 1.53 MB | 1.28 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 55 | 53 | 🎉 -2 🎉 |
Self size | 22 KB | 23 KB | 🚨 +380 B 🚨 |
Dependency size | 33.66 MB | 33.45 MB | 🎉 -213 KB 🎉 |
Bundle Size Analyzer | Link | Link |
sb
Before | After | Difference | |
---|---|---|---|
Dependency count | 56 | 54 | 🎉 -2 🎉 |
Self size | 1 KB | 1 KB | 0 B |
Dependency size | 33.68 MB | 33.47 MB | 🎉 -213 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 388 | 386 | 🎉 -2 🎉 |
Self size | 503 KB | 503 KB | 0 B |
Dependency size | 75.54 MB | 75.33 MB | 🎉 -213 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 277 | 275 | 🎉 -2 🎉 |
Self size | 617 KB | 617 KB | 🚨 +130 B 🚨 |
Dependency size | 65.62 MB | 65.41 MB | 🎉 -213 KB 🎉 |
Bundle Size Analyzer | Link | Link |
create-storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 113 | 111 | 🎉 -2 🎉 |
Self size | 1.11 MB | 1.11 MB | 0 B |
Dependency size | 42.79 MB | 42.58 MB | 🎉 -213 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/source-loader
Before | After | Difference | |
---|---|---|---|
Dependency count | 5 | 3 | 🎉 -2 🎉 |
Self size | 41 KB | 41 KB | 0 B |
Dependency size | 10.75 MB | 10.49 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/test
Before | After | Difference | |
---|---|---|---|
Dependency count | 53 | 51 | 🎉 -2 🎉 |
Self size | 1.82 MB | 1.82 MB | 🎉 -27 B 🎉 |
Dependency size | 8.09 MB | 7.84 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/preset-server-webpack
Before | After | Difference | |
---|---|---|---|
Dependency count | 18 | 16 | 🎉 -2 🎉 |
Self size | 10 KB | 10 KB | 0 B |
Dependency size | 1.48 MB | 1.23 MB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/server
Before | After | Difference | |
---|---|---|---|
Dependency count | 9 | 7 | 🎉 -2 🎉 |
Self size | 13 KB | 13 KB | 🎉 -32 B 🎉 |
Dependency size | 974 KB | 722 KB | 🎉 -252 KB 🎉 |
Bundle Size Analyzer | Link | Link |
@storybook/svelte
Before | After | Difference | |
---|---|---|---|
Dependency count | 106 | 107 | 🚨 +1 🚨 |
Self size | 96 KB | 96 KB | 🚨 +32 B 🚨 |
Dependency size | 10.59 MB | 10.64 MB | 🚨 +50 KB 🚨 |
Bundle Size Analyzer | Link | Link |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
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.
Looks good!
efc364c
to
43f0399
Compare
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 PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
Greptile Summary
Moving CSF (Component Story Format) to a monorepo structure with significant changes across the codebase to consolidate and standardize CSF functionality.
/csf
directory in core package with key files likeSBType.ts
,story.ts
, andincludeConditionalArg.ts
for type definitions and core functionality@storybook/csf
to@storybook/core/csf
or@storybook/internal/csf