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

CHANGE cli to not check registry when --no-install #8948

Merged
merged 1 commit into from Nov 25, 2019

Conversation

ndelangen
Copy link
Member

Issue:

What I did

CHANGE cli so skipInstall also doesn't check against the registry, but directly edits package.json

@vercel
Copy link

vercel bot commented Nov 25, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/storybook/monorepo/bwp03e96x
🌍 Preview: https://monorepo-git-tech-cli-noinstall-noregistryhit.storybook.now.sh

@ndelangen ndelangen removed the request for review from stijnkoopal November 25, 2019 19:25
@ndelangen ndelangen merged commit 9af24c0 into next Nov 25, 2019
@ndelangen ndelangen deleted the tech/cli-noinstall-noregistryhit branch November 25, 2019 19:41
packageJson.devDependencies = {
...packageJson.devDependencies,
...dependencies.reduce((acc, i) => {
const c = i.lastIndexOf('@');
Copy link
Member

Choose a reason for hiding this comment

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

@ndelangen what kind of code is this???

Copy link
Member Author

Choose a reason for hiding this comment

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

  • @storybook/addons@^5.3.0

  • find the last occurring '@'

  • split the string on that char

  • first part is the package name, second part is the version

  • if version is undefined make it '*'

  • add this to package.json, either in dependencies or devDependencies

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, and it's duplicated 5 lines below?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes. This solved a major blocker and I didn't mind some duplication as long as we were able to actually test the CLI again.

I'm sorry about some code-duplication. I'll get around to extracting it into a function some day.

Copy link
Member

Choose a reason for hiding this comment

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

🤦‍♂

Copy link
Member

Choose a reason for hiding this comment

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

#9004

Please get your code reviewed. I appreciate that it's useful to be able to self-merge, especially in the face of deployment issues where you need to iterate. In that case, please feel free to @ me (or anybody else on the project) to do a review after the fact. Also, go back and clean up after a fire has been put out, or at the very least please be open to doing that when somebody calls you out on it.

Flaunting contribution guidelines and littering the codebase with temporary hacks--especially ones that take just a few seconds to fix--doesn't set a good example for anybody involved in the project.

@shilman shilman mentioned this pull request Nov 29, 2019
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.

None yet

2 participants