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
Conversation
…t directly edits package.json
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/bwp03e96x |
packageJson.devDependencies = { | ||
...packageJson.devDependencies, | ||
...dependencies.reduce((acc, i) => { | ||
const c = i.lastIndexOf('@'); |
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.
@ndelangen what kind of code is this???
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.
-
@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
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.
Yeah, and it's duplicated 5 lines below?
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.
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.
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.
🤦♂
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.
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.
Issue:
What I did
CHANGE cli so skipInstall also doesn't check against the registry, but directly edits package.json