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

fix: remove unused dependencies from core-common #20994

Merged
merged 6 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/core": "^7.20.2",
"@storybook/node-logger": "7.0.0-beta.44",
"@storybook/types": "7.0.0-beta.44",
"@types/babel__core": "^7.1.20",
"@types/express": "^4.7.0",
"@types/node": "^16.0.0",
"@types/pretty-hrtime": "^1.0.0",
"chalk": "^4.1.0",
"esbuild": "^0.16.4",
"esbuild-register": "^3.3.3",
"express": "^4.17.3",
"file-system-cache": "^2.0.0",
"find-up": "^5.0.0",
"fs-extra": "^11.1.0",
Expand Down
6 changes: 1 addition & 5 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6067,19 +6067,15 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/core-common@workspace:lib/core-common"
dependencies:
"@babel/core": ^7.20.2
"@storybook/node-logger": 7.0.0-beta.44
"@storybook/types": 7.0.0-beta.44
"@types/babel__core": ^7.1.20
"@types/express": ^4.7.0
"@types/mock-fs": ^4.13.1
"@types/node": ^16.0.0
"@types/picomatch": ^2.3.0
"@types/pretty-hrtime": ^1.0.0
chalk: ^4.1.0
esbuild: ^0.16.4
Copy link
Member

Choose a reason for hiding this comment

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

esbuild is a peerDependency of esbuild-register

I recon the above is likely the reason some of those exists, though there's no doubt in my mind, some of them are likely unused.

Copy link
Member

Choose a reason for hiding this comment

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

with a simple search

This does not tell the whole story, and consider we do not have good tests in place to check for pnp/pnpm compatibility / package conformance.. removing dependencies is a risky business, and can cause old bugs to re-appear.

Thread carefully

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yes, thank you. I see now that yarn had a warning I overlooked:

➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code

Running that command showed:

➤ YN0000: p174e8 → @storybook/core-common@workspace:lib/core-common doesn't provide @types/esbuild to esbuild-register
➤ YN0000: p9d342 → @storybook/core-common@workspace:lib/core-common doesn't provide esbuild to esbuild-register

I added back esbuild. As far as I can see @types/esbuild does not exist, so that seems like a bug in esbuild-register specifying a package that doesn't exist. I'll just leave that as is since that's how it was before so should not cause any new issues.

I much prefer pnpm which would make this much easier to find 😄

Copy link
Member

Choose a reason for hiding this comment

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

I much prefer pnpm which would make this much easier to find 😄

some day..

esbuild-register: ^3.3.3
express: ^4.17.3
file-system-cache: ^2.0.0
find-up: ^5.0.0
fs-extra: ^11.1.0
Expand Down Expand Up @@ -7877,7 +7873,7 @@ __metadata:
languageName: node
linkType: hard

"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:^7.1.20":
"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14":
version: 7.20.0
resolution: "@types/babel__core@npm:7.20.0"
dependencies:
Expand Down