generate / generate-install

Generator that automatically detects the dependencies or devDependencies to install based on the templates or includes used. This can be used as a sub-generator or plugin in your own generator.
MIT License
7 stars 0 forks source link

Installs deps and devDeps to upper node_modules dir if it exists #4

Open tunnckoCore opened 8 years ago

tunnckoCore commented 8 years ago

And it didn't create node_modules directory in the dest at all. Maybe related to #2 and #1.

~/dev/generate-charlike-templates master ✓ ✗  
% 1 ❯ ls                                                                                              September 12, 00:09:49
node_modules/  templates/  CHANGELOG.md  CONTRIBUTING.md  generator.js  index.js  LICENSE  package.json  test.js
~/dev/generate-charlike-templates master ✓ ✗  
% ❯ gen dest ch                                                                                       September 12, 00:09:50
[00:09:58] starting generate
[00:09:58] using generator ~/dev/generate-charlike-templates/generator.js
[00:09:59] ✔ running tasks: [ 'dest', 'ch' ]
[00:09:59] starting dest 
[00:10:00] starting dest:prompt-dest task 
? Destination directory? npm-hooks
[00:11:51] finished dest:prompt-dest task 2m
[00:11:51] finished dest ✔ 2m
[00:11:51] starting default 
[00:11:51] starting default:ch task 
[00:11:51] starting default:default task 
[00:11:51] starting default:package task 
? Project name? npm-hooks
? Project version? 0.0.0
? Project description? Elegant npm scripts and git hooks manager with shareable presets.
? Project owner (GitHub username)? tunnckoCore
[00:12:01] finished default:package task 9s
[00:12:01] starting default:editorconfig task 
[00:12:01] finished default:editorconfig task 54ms
[00:12:01] starting default:contributing task 
[00:12:01] finished default:contributing task 81ms
? Author full name? Charlike Mike Reagent
[00:12:02] starting default:install task
[00:17:32] finished default:install task 6m
? File exists, want to overwrite .gitignore? yes, overwrite this file
✔ overwriting .gitignore
? File exists, want to overwrite .travis.yml? yes, overwrite this file
✔ overwriting .travis.yml
[00:22:33] finished default:default task 11m
[00:22:33] finished default:ch task 11m
[00:22:33] finished default ✔ 11m
~/dev/generate-charlike-templates master ✓ ✗  
% ❯ ls                                                                                                September 12, 00:22:33
node_modules/  npm-hooks/  templates/  CHANGELOG.md  CONTRIBUTING.md  generator.js  index.js  LICENSE  package.json  test.js
~/dev/generate-charlike-templates master ✓ ✗  
% ❯ ls npm-hooks                                                                                      September 12, 00:26:54
CONTRIBUTING.md  index.js  LICENSE  package.json  test.js  utils.js
~/dev/generate-charlike-templates master ✓ ✗  
% ❯

skipped the output of installs. Main point is that there's no node_modules directory in npm-hooks and it installs its deps/devDeps to ~/dev/generate-charlike-templates/node_modules.


offtopic

And btw, notice the ~15mins time for generating project (yes, it includes the devDeps, but the biggest time was for verb and readme; from devDeps the problem comes from coveralls and in parts nyc and standard), with great internet, hance Bulgaria is in top 3-5 in the world for great internet and networks.

All this was the reason that i choose different approach for last year, which kills me now - greenkeeper updates standard to 8 and these packages that travis badge does not points to master are failing, which makes users think package is broken - but it isn't, build fails from push/pr.

Thought that it's enough (and partially still thinking) that almost everybody have them globally and one good CONTRIBUTING will guide them.

But in anyway, there's still totally stable packages without pushes from 1 year+ and all is green.


ontopic

It also did not adds the deps to package.json, how can do --save and --save-dev from front-matter?

tunnckoCore commented 8 years ago

Actually, just noticed, that it saves them, but to ~/dev/generate-charlike-templates/package.json, not to dest one. https://github.com/tunnckoCore/generate-charlike-templates/commit/5feb5f29006230497023f6b40ab7d6ff9b61fe3c

edit: try installing 0.3.1.

jonschlinkert commented 8 years ago

I might be mistaken, but I think this is already a known issue - was this related to the flag that @doowb was going to implement a week or two ago? If he doesn't have time I can try to get it patched

tunnckoCore commented 8 years ago

going to implement a week or two ago

I think so, but not sure, that's why I opened this issue for any case.

doowb commented 8 years ago

Try getting the latest and running now. This should be fixed in base-npm@0.4.1.

I had fixed this locally and forgot to push it up.

tunnckoCore commented 8 years ago

yea, i seen that and i'll try.