Comments (7)
One of main thrusts here is really is "it's almost npm" for the scripts in the archetypes, etc. And we're trying to keep it simple, understandable, and potentially give a road "back" to NPM (remove builder without too much pain) if things don't totally work out.
The few things why there is I think a need for something beyond just package.json
and files in the repo is a use case we're hitting in our OSS and client work:
- You have multiple (10-40) component repos that all have basically the same
package.json
scripts + config files.
Managing that via each repo is a pain, particularly when you find that one of your package.json:scripts
commands has a bug and/or your config files need changes, etc.
Builder allows to you just take a dependency, manage expectations via semver and have "one source of truth" for common tasks across very common, but independent repositories.
Once you've got that use case, the things Builder offers are:
- Archetypes: The solution to the above problem. A way to define a specific set of tasks / configs / etc for one "type" of project. For us, that is the ever-expanding set of our https://github.com/FormidableLabs/?utf8=%E2%9C%93&query=victory repos (still have to roll this out, but it's our primary use case driver).
- Flexibility: Most of the meta tools I've used in the path are of the "buy the farm" nature. Work great when everything is within the workflow but fall apart once you want to be "just slightly" different. Builder solves this by allowing fine grain task overriding by name, where the larger composed tasks still stay the same and allow a specific repo's deviation from "completely off the shelf" to be painless.
It's also got the "nice to have" of a cross-OS compatible concurrent task runner (but you can get this as an independent node modules like concurrently
, so not the biggest "thing" for a runner).
I think you're right in that Builder doesn't perhaps shine and isn't perhaps the best solution for:
- One-off repos. The project is specific enough and is the only thing that a group of folks manage.
- Beginning / learning node projects. One of the things we've just admitted for our Victory components is that a modern, publishable React build for these components + supporting lots of workflows + having a test driver infrastructure is complicated. And our build for these is meant to be efficient, robust and unfortunately, is not necessarily accessible in the straight build itself to completely new folks. (It is expected that new folks / old folks / etc can easily use Victory components in their projects with very basic workflows and builds...)
from builder.
@ianobermiller ... thinking about this for a little bit longer, I guess the alternatives / refactors to builder
that would potentially suite our workflows:
npm
implements a plugin / module system to handle archetype-like scripts + dependencies. (But we're waiting on something in corenpm
...)- We refactor builder to instead of using installed archetypes in
node_modules/ARCHETYPE/package.json
to instead rewrite and mutate a project'spackage.json
and other various files. (I think capturing what you might favor?) However, this becomes really tough and complicated once a project goes "off script" and wants to override just onescripts
command when you consider the upgrade scenario for the archetype -- you're dealing with real code diffs + merges + potentially having an archetype upgrade blow away your customizations. Perhaps there is a sane way to manage the conflicts, but on first considering this approach this morning, seems... complicated and risky.
Put another way, I agree with the sentiment of not wanting "yet another task runner / meta tool", and this is the smallest / "least" task runner I could come up with to meet our use cases 😄
Love to hear your thoughts more, but perhaps you could aim to direct this issue into something actionable for builder (like a strawman refactor / rearchitecture) or close it?
Thanks!
from builder.
Apologies for the hit and run, I haven't taken the time to properly respond. I think I was not quite understanding the target use case of having an npm-installable set of common scripts for multiple projects that basically work the same (e.g. a bunch of plugins). I think that is the great sell for builder, and it is definitely missing in the first three introduction sentences, and only alluded to in the overview.
from builder.
+1 for capturing this in the readme
from builder.
I think that is the great sell for builder, and it is definitely missing in the first three introduction sentences, and only alluded to in the overview.
Great point. Thanks @ianobermiller !
from builder.
I just saw butter-run-npm
, which gave me a simple idea that you could keep the npm scrips, and just point them to builder:
"scripts": {
"dist": "node ./node_modules/builder run dist"
}
Builder could even add these shims for you automatically. This would solve the main problem of yet-another-tool for end users.
from builder.
@ianobermiller -- Yeah, the notion of doing environment variables + working with npm scripts
is something that needs to be outside NPM for cross-platform because of the differences in env variables.
We're still working out whether or not (and how) to mutate an underlying project, and we're actually retooling the relationship of archetype scripts
, dependencies
and devDependencies
to be more straightforward for consumers (#18, FormidableLabs/builder-react-component#6)
Also to hopefully fight the "yet another tool" issue, I'm currently writing up a section on "how to abandon Builder and go back to straight npm
" as a guiding principle to keep it simple and aligned with npm
from builder.
Related Issues (20)
- Implementing the module pattern with typescript? HOT 5
- [Feature,Discussion]: Use in monorepos HOT 3
- The hardest part about Builder is making an Archetype. HOT 4
- How to extend an archetype. HOT 2
- Alternatives to "the module pattern". HOT 2
- To shrinkwrap or not to shrinkwrap? HOT 3
- Not using a dev archetype, but builder throws errors about not finding one. HOT 1
- How to configure default log-level?
- Chore: Bump to node4+ and modernize code.
- CI: Empty environment parameters are super-flaky on Appveyor.
- Log: Add `debug` log level.
- Eslint: Update to modern configs
- builder and mono repos HOT 4
- Nested builder command doesn't work in Windows. HOT 4
- Why does Bolt have many more stars than Builder?
- CI/Appveyor: Appveyor breaks on old npm
- Node8: Update code to modern ES
- builder is unable to resolve archetypes when builder is symlinked in from external node_modules. HOT 2
- when builder is symlinked, environment causes TypeScript compiler to fork bomb HOT 3
- Running coverage with typescript support (bug?) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from builder.