Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Switch to Yeoman instead of git clone for creating add-on template? #14

Closed
pdehaan opened this issue Oct 3, 2016 · 7 comments
Closed
Labels

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Oct 3, 2016

Not sure if it'd be better to use something like https://www.npmjs.com/package/yo and a custom generator to create a template rather than the current git clone approach, which brings in some unwanted keys and files.

I guess it'd depend on whether we could hide the "yo" and generator approach instead of expecting users to globally install a few more dependencies.
But the bright side is that we may be able to prompt users for information (such as versions, author name, repo, etc) rather than having convoluted global defaults.

@gregglind
Copy link
Contributor

Agreed thta something like yeoman is also possible. but if we are doing that, why not fix jpm init?

(If have tried yeoman in the past and not liked it very much. I am somewhat reliously against question wizards, and tend to yes my way out of them hating them the whole time. I might be weird in that. I would rather edit it all in the file.)

@pdehaan
Copy link
Contributor Author

pdehaan commented Oct 3, 2016

I like npm init behavior. I can say npm init and go through the wizard and answer questions, or just lazily do npm init -y (or maybe --yes even) and it will just use defaults.

@pdehaan
Copy link
Contributor Author

pdehaan commented Oct 4, 2016

Briefly looked into ember new last night (which @kumar303 recommends in mozilla/web-ext#540), and it doesn't seem to prompt at all for any user input, and just creates a scaffold (then runs npm install and bower install automatically to install sub-dependencies).

In fact, I ran tree after calling ember new pantsuit and got the following results:

  • 8,461 directories, 38,314 files (with ./bower_components/ and ./node_modules/ directories)
  • 44 directories, 155 files (after running rm -rf node_modules/)
  • 16 directories, 19 files (after running rm -rf bower_components/)

@kumar303
Copy link

kumar303 commented Oct 4, 2016

The main thing I dislike about npm init is it assumes your working directory is where you want all the new files which is a terrible assumption.

@gregglind
Copy link
Contributor

Peeps, I am still not convinced that all the machinery of either Yo or Ember new are worth it, but I will eat some project init's and see how it goes :)

I really like the desire here to make project init into an awesome process, but I am not sure what the solution to that is.

@gregglind
Copy link
Contributor

Would having a 'stable' tag or 'release' or something reduce the fear of getting random / bad versions of the tempate?

@pdehaan
Copy link
Contributor Author

pdehaan commented Oct 12, 2016

Another thing to potentially look at is create-react-app.

Notably:

  1. https://github.com/facebookincubator/create-react-app#creating-an-app

    $ create-react-app my-app
    $ cd my-app

    Inside that directory, it will generate the initial project structure and install the transitive dependencies.

  2. https://github.com/facebookincubator/create-react-app#converting-to-a-custom-setup

    Running npm run eject copies all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. Commands like npm start and npm run build will still work, but they will point to the copied scripts so you can tweak them. At this point, you’re on your own.

  3. https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-eject

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants