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

Migrate to npm, upgrade dependencies #59

Merged
merged 22 commits into from Nov 17, 2023
Merged

Migrate to npm, upgrade dependencies #59

merged 22 commits into from Nov 17, 2023

Conversation

JReinhold
Copy link
Collaborator

@JReinhold JReinhold commented Nov 7, 2023

This PR does two things:

  1. Migrate from Yarn v1 to npm to make it easier for new addon authors to adopt. Yarn v1 is EOL, and any addon author that prefers Yarn/pnpm knows how to migrate to those, but the opposite is not always true.

  2. Upgrade all dependencies (except for @types/node). It fixed a couple of audits.

You could argue that we should stick Storybook to v7.0.0 to encourage addon authors to support the full range of 7.0-7.99 and test against the lowest possible number, instead of only testing against 7.5+. However if we think that's best, we should pin the dependencies completely and not use the caret range which we're doing currently anyway.

  1. Pin Storybook dependencies to 7.0.0 (without the caret) to encourage authors to test against the lowest version when building addons.

  2. Change React dependencies to v16, as that is what will eventually be used in the SB manager UI regardless of what an addon specifies.

@JReinhold JReinhold self-assigned this Nov 7, 2023
@JReinhold JReinhold added the enhancement New feature or request label Nov 7, 2023
Copy link

socket-security bot commented Nov 7, 2023

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
New author assert 2.1.0
New author @babel/plugin-syntax-import-meta 7.10.4
New author hasown 2.0.0
New author istanbul-lib-report 3.0.1
New author @babel/preset-modules 0.1.6
New author which 3.0.1
Uses eval @sinclair/typebox 0.27.8
Uses eval @storybook/manager 0.0.0-pr-24676-sha-214a6f84
Uses eval @storybook/preview 0.0.0-pr-24676-sha-214a6f84

Next steps

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What is eval?

Package uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Avoid packages that use eval, since this could potentially execute any code.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore @sinclair/typebox@0.27.8
  • @SocketSecurity ignore @storybook/manager@0.0.0-pr-24676-sha-214a6f84
  • @SocketSecurity ignore @storybook/preview@0.0.0-pr-24676-sha-214a6f84
  • @SocketSecurity ignore assert@2.1.0
  • @SocketSecurity ignore @babel/plugin-syntax-import-meta@7.10.4
  • @SocketSecurity ignore hasown@2.0.0
  • @SocketSecurity ignore istanbul-lib-report@3.0.1
  • @SocketSecurity ignore @babel/preset-modules@0.1.6
  • @SocketSecurity ignore which@3.0.1

package.json Outdated Show resolved Hide resolved
JReinhold and others added 2 commits November 7, 2023 16:06
package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@ShaunEvening ShaunEvening left a comment

Choose a reason for hiding this comment

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

Thank you for putting this together, @JReinhold

"@storybook/blocks": "7.0.0",
"@storybook/components": "7.0.0",
"@storybook/core-events": "7.0.0",
"@storybook/manager": "0.0.0-pr-24676-sha-214a6f84",
Copy link
Contributor

Choose a reason for hiding this comment

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

The version of this caught my eye. What are these new packages up to?

Copy link
Collaborator Author

@JReinhold JReinhold Nov 17, 2023

Choose a reason for hiding this comment

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

They are used in the tsup config, they now export a globalPackages list that the config use to mark the packages as externals.
https://github.com/storybookjs/addon-kit/pull/59/files#diff-fef3a6dda67c2301a9bd345eb8d60c3ffee2433242c7f45d55a03f2e7908be21R6-R7

None of these packages will make it into the final addon dist, they are of no use to the addon, which is why I think it's safe for them to be a completely different version.

Ideally we'll change this version to ^7.6.0 when that gets released

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, merge away, my friend :D

@JReinhold JReinhold merged commit af25db6 into main Nov 17, 2023
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants