-
Notifications
You must be signed in to change notification settings - Fork 7
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
Proposal: use npm run instead of the donejs command #84
Comments
@chasenlehara We do it for uniformity. |
Sorry, I wasn’t clear in my original post; I’m not advocating for something like For me, it makes sense to differentiate between the commands that are special to our CLI vs. npm. For example, we show installing Bootstrap with |
I agree with @chasenlehara. When I first encountered |
Bumping this now that npx is a thing and I think you can run generators through npm? npx provides many of the same features that the donejs cli is used for. I'm not as familiar as some other people so I'd like to get their feedback. @BigAB @justinbmeyer have discussed the idea. Some of the commands we have:
I think that's it... can we provide all of this through Also, what does this mean for yarn projects, or do we just only support npm? |
I don't know enough about
In the project though, if There is also a new thing in You can also use the scopes so you could do something like With npx and npm offering these kinds of utilities, it's probably worth considering not only implementing these features, but maybe modifying our own donejs-cli api to be more friendly when using them. |
Yarn has a similar offering for |
Proposaltldr; Transition away from donejs-cli in favor of This proposal seeks to deprecate the donejs cli and instead use the built-in features of npm (and possibly) yarn to generate and control donejs applications.
The ProblemThe global We designed the donejs cli so that it is only a thin layer around a project's package.json scripts and binaries installed within Since the beginning we have had a problem with donejs apps taking a long time to install. We have improved this over time by deferring installing things until we need them, through generators such as FactorsSince donejs was first released, npm and yarn have created ways to generate new projects without needing a special global cli. Additionally The SolutionThis proposal seeks to do away with the donejs cli, and instead rely on npm/npx. This means that a basic donejs app could be installed with:
This will run create-donejs-app which will generate a new donejs app. The initial package.json will look something like this:
Notice that we only install It's likely we'll want a couple of more things, such as perhaps steal-qunit or another testing utilities. The point is that by default we only include what is minimally needed to get started. When you want server-side rendering you can install done-serve using
This will install the
When you want testing perhaps you run something like:
When will install testee and another other needed utilities. To generate a new component you can run:
Here donejs-add is a project that works the same way as our current The goals here are:
|
I like the above but I would suggest: The initial package.json will include a dev dependency of So that way when you |
Thanks @BigAB, the specifics are definitely something we can discuss, I just wanted to get the proposal ready for the survey. We could have |
Ok, |
I'm a bit uneasy about the lack of testing and ssr. A related concern is that we should probably setup people with pushstate, we'll need more that http-server for this. What versions of node is this all supported? |
@justinbmeyer You might have missed it, but the proposal mentions that likely something like Testee likely would not be included (it's one of the things that takes a long time to install), but there's less of a reason for Testee until you have CI. Installing testee and ssr takes away from the idea of a having a lightweight way to use steal and canjs together. Another option I thought of is having a "light" mode or something that works like the above. So basically:
Would include basically everything that gets installed today. But if you did:
Would be the slimmed down version like shown above. I prefer the install-as-you-go approach because I think having 2 modes will be harder to maintain. |
I would take it one step further than what @matthewp proposed. I would actually make the default installation NOT include Don't get wrong I 100% agree that SSR, and testing are important to an application, but they are furthest thing from my mind when I am developing a brand new application. I care about one thing when starting a new application, and that is getting into writing my specific application code as soon as possible. This includes not being distracted by a whole bunch of other concepts (or code or files) that I am just not ready to deal with at the start of a new application. |
@mjstahl We could make a |
One of the things that first confused me when building a DoneJS app was that the special commands, like
donejs develop
anddonejs build
, are just running npm scripts[1]. When I didn’t know about npm scripts, the donejs commands seemed like “magic” (something specific to using the donejs cli), and when I did learn about npm scripts, then it seemed unnecessary to have to install the DoneJS cli to work in a project that was generated with DoneJS.Is there a reason why we specifically encourage commands like
donejs develop
instead ofnpm run develop
?The text was updated successfully, but these errors were encountered: