Skip to content
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

Bun: Add support for text lock file #30160

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Arctomachine
Copy link

@Arctomachine Arctomachine commented Dec 31, 2024

Closes #

What I did

Recently bun added support for text lock files, so now project with bun can have bun.lock and/or bun.lockb.
I updated checks to include both options.

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

I did not test it because I have no idea how to test installer scripts. It would not hurt if somebody could test it, but currently changes are so minor and follow existing code letter to letter that I most likely broke nothing.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/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>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.9 MB 77.9 MB 0 B 1.01 0%
initSize 131 MB 133 MB 2.39 MB 178.19 1.8%
diffSize 52.9 MB 55.3 MB 2.39 MB 327.67 4.3%
buildSize 7.19 MB 7.19 MB -212 B -5.92 0%
buildSbAddonsSize 1.85 MB 1.85 MB 30 B 1.73 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB -48 B -0.49 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB -18 B 0.3 0%
buildPreviewSize 3.28 MB 3.28 MB -194 B -32.39 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 7.4s 8.3s 871ms -0.71 10.4%
generateTime 21.4s 23s 1.6s 1.37 🔺7%
initTime 14.8s 15.6s 767ms 1.01 4.9%
buildTime 11s 9.2s -1s -760ms -0.49 -19%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.6s 4.8s 204ms -0.48 4.2%
devManagerResponsive 3.5s 3.6s 161ms -0.19 4.4%
devManagerHeaderVisible 593ms 1.4s 841ms 7.29 🔺58.6%
devManagerIndexVisible 651ms 1.5s 868ms 7.7 🔺57.1%
devStoryVisibleUncached 1.9s 1.7s -193ms -0.32 -11.1%
devStoryVisible 652ms 1.4s 760ms 6.68 🔺53.8%
devAutodocsVisible 519ms 945ms 426ms 3.39 🔺45.1%
devMDXVisible 549ms 1s 454ms 5.01 🔺45.3%
buildManagerHeaderVisible 584ms 800ms 216ms 3.13 🔺27%
buildManagerIndexVisible 676ms 908ms 232ms 3.96 🔺25.6%
buildStoryVisible 567ms 755ms 188ms 2.81 🔺24.9%
buildAutodocsVisible 458ms 706ms 248ms 4.63 🔺35.1%
buildMDXVisible 446ms 694ms 248ms 4.13 🔺35.7%

Greptile Summary

Added support for Bun's text-based lock files in package manager detection, allowing both bun.lock and bun.lockb formats in Storybook's package manager factory.

  • Added BUN_LOCKFILE constant for text lock file in code/core/src/common/js-package-manager/JsPackageManagerFactory.ts
  • Renamed existing constant to BUN_LOCKFILE_BINARY for binary format
  • Updated lock file detection to check for both formats in package manager resolution
  • Note: Changes lack automated tests but follow existing patterns closely

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

nx-cloud bot commented Dec 31, 2024

View your CI Pipeline Execution ↗ for commit 6ec9fbd.

Command Status Duration Result
nx run-many -t build -c production --parallel=3 ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-18 07:17:23 UTC

@valentinpalkovic valentinpalkovic self-assigned this Jan 6, 2025
@valentinpalkovic valentinpalkovic changed the title add support for bun with text lock file Bun: Add support for text lock file Jan 6, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@storybook-pr-benchmarking
Copy link

Package Benchmarks

Commit: 6ec9fbd, ran on 16 January 2025 at 09:22:37 UTC

The following packages have significant changes to their size or dependencies:

@storybook/addon-a11y

Before After Difference
Dependency count 59 59 0
Self size 228 KB 410 KB 🚨 +183 KB 🚨
Dependency size 13.46 MB 13.46 MB 🎉 -22 B 🎉
Bundle Size Analyzer Link Link

@storybook/addon-essentials

Before After Difference
Dependency count 36 36 0
Self size 12 KB 17 KB 🚨 +4 KB 🚨
Dependency size 13.83 MB 13.83 MB 🚨 +77 B 🚨
Bundle Size Analyzer Link Link

@storybook/addon-mdx-gfm

Before After Difference
Dependency count 69 69 0
Self size 3 KB 4 KB 🚨 +1 KB 🚨
Dependency size 2.41 MB 2.41 MB 🎉 -3 B 🎉
Bundle Size Analyzer Link Link

@storybook/experimental-addon-test

Before After Difference
Dependency count 60 60 0
Self size 832 KB 974 KB 🚨 +142 KB 🚨
Dependency size 14.15 MB 14.15 MB 🎉 -47 B 🎉
Bundle Size Analyzer Link Link

@storybook/core

Before After Difference
Dependency count 53 53 0
Self size 19.08 MB 21.45 MB 🚨 +2.37 MB 🚨
Dependency size 14.43 MB 14.43 MB 🎉 -2 B 🎉
Bundle Size Analyzer Link Link

@storybook/react-native-web-vite

Before After Difference
Dependency count 114 105 🎉 -9 🎉
Self size 43 KB 42 KB 🎉 -1 KB 🎉
Dependency size 18.25 MB 18.06 MB 🎉 -186 KB 🎉
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 54 54 0
Self size 22 KB 22 KB 🎉 -2 B 🎉
Dependency size 33.51 MB 35.88 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 55 55 0
Self size 1 KB 1 KB 🎉 -2 B 🎉
Dependency size 33.54 MB 35.90 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 398 398 0
Self size 503 KB 496 KB 🎉 -7 KB 🎉
Dependency size 75.56 MB 77.93 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 276 276 0
Self size 612 KB 612 KB 🎉 -2 B 🎉
Dependency size 65.36 MB 67.73 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/core-webpack

Before After Difference
Dependency count 1 3 🚨 +2 🚨
Self size 16 KB 16 KB 🎉 -2 B 🎉
Dependency size 28 KB 2.40 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 112 112 0
Self size 1.11 MB 1.11 MB 🎉 -2 B 🎉
Dependency size 42.65 MB 45.02 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/preset-preact-webpack

Before After Difference
Dependency count 2 4 🚨 +2 🚨
Self size 5 KB 5 KB 🎉 -3 B 🎉
Dependency size 44 KB 2.42 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/preset-server-webpack

Before After Difference
Dependency count 18 20 🚨 +2 🚨
Self size 10 KB 10 KB 🎉 -4 B 🎉
Dependency size 1.48 MB 3.85 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

@storybook/preset-svelte-webpack

Before After Difference
Dependency count 101 103 🚨 +2 🚨
Self size 14 KB 14 KB 🎉 -3 B 🎉
Dependency size 10.40 MB 12.77 MB 🚨 +2.37 MB 🚨
Bundle Size Analyzer Link Link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants