-
-
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
CLI: Use ink
in CLI
#30202
base: next
Are you sure you want to change the base?
CLI: Use ink
in CLI
#30202
Conversation
View your CI Pipeline Execution ↗ for commit bbdae44.
☁️ Nx Cloud last updated this comment at |
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
Before | After | Difference | |
---|---|---|---|
Dependency count | 60 | 60 | 0 |
Self size | 762 KB | 776 KB | 🚨 +14 KB 🚨 |
Dependency size | 14.15 MB | 14.15 MB | 🚨 +49 B 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/core
Before | After | Difference | |
---|---|---|---|
Dependency count | 53 | 54 | 🚨 +1 🚨 |
Self size | 19.08 MB | 19.60 MB | 🚨 +519 KB 🚨 |
Dependency size | 14.43 MB | 14.72 MB | 🚨 +291 KB 🚨 |
Bundle Size Analyzer | Link | Link |
storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 54 | 55 | 🚨 +1 🚨 |
Self size | 22 KB | 24 KB | 🚨 +2 KB 🚨 |
Dependency size | 33.51 MB | 34.32 MB | 🚨 +809 KB 🚨 |
Bundle Size Analyzer | Link | Link |
sb
Before | After | Difference | |
---|---|---|---|
Dependency count | 55 | 56 | 🚨 +1 🚨 |
Self size | 1 KB | 1 KB | 🎉 -2 B 🎉 |
Dependency size | 33.54 MB | 34.35 MB | 🚨 +811 KB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/cli
Before | After | Difference | |
---|---|---|---|
Dependency count | 398 | 399 | 🚨 +1 🚨 |
Self size | 504 KB | 248 KB | 🎉 -256 KB 🎉 |
Dependency size | 75.55 MB | 76.92 MB | 🚨 +1.37 MB 🚨 |
Bundle Size Analyzer | Link | Link |
@storybook/codemod
Before | After | Difference | |
---|---|---|---|
Dependency count | 276 | 277 | 🚨 +1 🚨 |
Self size | 612 KB | 612 KB | 🎉 -8 B 🎉 |
Dependency size | 65.36 MB | 66.17 MB | 🚨 +809 KB 🚨 |
Bundle Size Analyzer | Link | Link |
create-storybook
Before | After | Difference | |
---|---|---|---|
Dependency count | 112 | 113 | 🚨 +1 🚨 |
Self size | 1.11 MB | 1.67 MB | 🚨 +556 KB 🚨 |
Dependency size | 42.65 MB | 43.46 MB | 🚨 +811 KB 🚨 |
Bundle Size Analyzer | Link | Link |
…t reproduce locally
…/storybook into norbert/cli-with-ink
…/storybook into norbert/cli-with-ink
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.
Can you avoid the dependency between modernProgram and legacyProgram somehow? Seems a bit convoluted and confusing.
.name('Initialize Storybook into your project.') | ||
const createStorybookProgram = program.name('Initialize Storybook into your project.'); | ||
|
||
const modernProgram = Object.entries(modernInputs.shape).reduce((acc, [key, schema]) => { |
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.
It's not immediately obvious what this reduce is for. Could you add a comment?
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.
This converts the zod runtime interface to a program.options()
-chain for commander
.
I added a comment higher up in the file.
if (typeName.match('String')) { | ||
acc.option(`--${flag} <option>`, description, value); | ||
} else if (typeName.match('Enum')) { | ||
acc.option(`--${flag} <option>`, description, value); | ||
} else if (typeName.match('Boolean')) { | ||
acc.option(`--${flag}`, description, value); | ||
if (value === true) { | ||
acc.option(`--no-${flag}`, `inverted --${flag}`); | ||
} | ||
} |
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.
Can't we extend modernInputs
to include the legacy formats, so we don't have to map them here?
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.
This makes it easier to remove the legacy options, keeping them separate.
The legacy options don't use zod
, and use the shorthand flags, which I'm not supporting here, since I don't deem it necessary.
I'm open to not using zod
though, but this ensures we don't have any flags that do not result in state, as well as verify the user is passing valid options.
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>