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

Use publishr to move all build dependencies to devDependencies #186

Closed
4 tasks done
coopy opened this issue Feb 2, 2016 · 6 comments
Closed
4 tasks done

Use publishr to move all build dependencies to devDependencies #186

coopy opened this issue Feb 2, 2016 · 6 comments
Labels
Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release

Comments

@coopy
Copy link
Contributor

coopy commented Feb 2, 2016

Current task

  • Implement publishr workflow in the builder-victory-component archetype.
  • Make sure neither dist nor lib are in git source.
  • Build both dist and lib only for git installs
  • Publish both dist and lib and ensure that builder and builder-victory-component are devDependencies in "from npm" version.

Original Issue

npm install victory ends up installing webpack, builder babel-* etc.
These dependencies are required to support building lib/ in the postinstall phase when depending on Victory via a git or github URL.

If we change the postinstall script from cd lib || builder run npm:postinstall to cd lib || (npm i --development && builder run npm:postinstall), we may be able to move all these dependencies to devDependencies, to avoid punishing the majority of users who install from npm (where lib/ is already built).

@ryan-roemer
Copy link
Member

We ideally would make this more nuanced as karma + all it's deps + phantom is a huge install...

@exogen
Copy link
Contributor

exogen commented Feb 2, 2016

Word of warning, if you try npm i --development in postinstall that npm i triggers another postinstall – ad infinitum. When we were exploring this solution a few months ago I made a project postinstall-build that handles exactly this use case.

(another note, I don't think npm i --development is a thing, but npm i --only=development is)

@coopy
Copy link
Contributor Author

coopy commented Feb 2, 2016

Thanks @exogen, postinstall-build is promising.

We ideally would make this more nuanced as karma + all it's deps + phantom is a huge install...

You're right, @ryan-roemer. Perhaps we could modify postinstall-build to take a blacklist argument.

@ryan-roemer
Copy link
Member

ryan-roemer commented Jun 6, 2016

Here's a smaller change for just swapping the two packages we care about:

  • On npm publish before actual publish:
    • Move builder + builder-victory-component to devDependencies in package.json. This means package.json is dirty git-wise.
    • (OPTIONAL) Consider mutations to .npmignore. This is more critical in projects like Radium that don't publish src/, etc. to npm. The .npmignore file does control what's available even through a git install...
    • Publish to npm
    • Revert changes to package.json in git
  • This is a little complicated to orchestrate with git workflows, but one strawman for an npm version workflow that should work:
    • postversion: Make dirty changes to package.json
    • postpublish: Revert dirty changes

Here's a POC for a victory component: FormidableLabs/victory-label#39 with a corresponding script / tasks in the archetype: https://github.com/FormidableLabs/builder-victory-component/compare/feature-npm-package-swapping

@ryan-roemer
Copy link
Member

We now have https://github.com/FormidableLabs/publishr for this and should move along with that if we want to advance this ticket.

@ryan-roemer ryan-roemer changed the title Consider moving all build dependencies to devDependencies Use publishr to move all build dependencies to devDependencies Oct 27, 2016
@ryan-roemer ryan-roemer added help wanted Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release and removed discussion labels Oct 27, 2016
@boygirl
Copy link
Contributor

boygirl commented Oct 28, 2016

closed by #415

@boygirl boygirl closed this as completed Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement ✏️ An enhancement or feature proposal that will be addressed after the next release
Projects
None yet
Development

No branches or pull requests

4 participants