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

Should now install it globally if it is installed? #3

Open tunnckoCore opened 7 years ago

tunnckoCore commented 7 years ago

I think it should not install it again if it exists and is same version/range. Applies for global specifically.

I have verb and verb-generate-readme installed globally and have this front matter


---
install:
  global: [
    "verbose/verb#dev",
    "verb-generate-readme"
  ]
  dependencies: ["lazy-cache"]
  devDependencies: [
    "commitizen",
    "coveralls",
    "cz-conventional-changelog",
    "husky",
    "mukla",
    "nyc",
    "standard",
    "standard-version",
    "validate-commit-msg"
  ]

---
// package.json ...

and outputs

[00:12:02] starting default:install task 
/home/charlike/.nvm/versions/node/v6.3.0/bin/verb -> /home/charlike/.nvm/versions/node/v6.3.0/lib/node_modules/verb/bin/verb.js
/home/charlike/.nvm/versions/node/v6.3.0/lib
├─┬ verb@0.9.0  (git://github.com/verbose/verb.git#20f8a0d36e57a57a3b2faa7a6eea85e3aee4eaa0)
│ ├─┬ generate@0.9.8
│ │ └─┬ base-generators@0.4.5
│ │   └─┬ base-env@0.3.0
│ │     └── resolve-file@0.1.0  (git://github.com/jonschlinkert/resolve-file.git#261082c95a5f407c43d82797c13bae3527462842)
│ └─┬ gulp-reflinks@0.2.0
│   └─┬ verb-reflinks@0.1.4
│     └─┬ reflinks@0.3.4
│       └─┬ date-store@0.1.2
│         └── date.js@0.3.1  (git://github.com/matthewmueller/date.git#a495343a3bf38546978dfecafedbc78b9bf87573)
└─┬ verb-generate-readme@0.1.30 
  └─┬ gulp-reflinks@0.2.0
    └─┬ verb-reflinks@0.1.4
      └─┬ reflinks@0.3.4
        └─┬ date-store@0.1.2
          └── date.js@0.3.1  (git://github.com/matthewmueller/date.git#a495343a3bf38546978dfecafedbc78b9bf87573)

with highlighted date.js

jonschlinkert commented 7 years ago

Huh, I totally forgot we implemented global, nice.

I agree totally. That would be pretty frustrating, especially if it overwrote custom code. marking as a bug