yeoman-environment
Advanced tools
Comparing version 2.0.6 to 2.1.0
'use strict'; | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const os = require('os'); | ||
const _ = require('lodash'); | ||
const globby = require('globby'); | ||
const debug = require('debug')('yeoman:environment'); | ||
const spawn = require('cross-spawn'); | ||
@@ -35,3 +35,3 @@ const win32 = process.platform === 'win32'; | ||
resolver.lookup = function (cb) { | ||
const generatorsModules = this.findGeneratorsIn(this.getNpmPaths()); | ||
const generatorsModules = this.findGeneratorsIn(this.getNpmPaths().reverse()); | ||
const patterns = []; | ||
@@ -46,4 +46,4 @@ | ||
for (const pattern of patterns) { | ||
for (const filename of globby.sync('*/index.js', {cwd: pattern})) { | ||
this._tryRegistering(path.join(pattern, filename)); | ||
for (const filename of globby.sync('*/index.js', {cwd: pattern, absolute: true})) { | ||
this._tryRegistering(filename); | ||
} | ||
@@ -70,11 +70,9 @@ } | ||
if (!root) { | ||
return; | ||
continue; | ||
} | ||
modules = globby.sync([ | ||
'generator-*', | ||
'@*/generator-*' | ||
], {cwd: root}) | ||
.map(match => path.join(root, match)) | ||
.concat(modules); | ||
modules = modules.concat(globby.sync( | ||
['generator-*', '@*/generator-*'], | ||
{cwd: root, onlyFiles: false, absolute: true} | ||
)); | ||
} | ||
@@ -141,17 +139,17 @@ | ||
// Yarn's file structure looks like this: | ||
// | ||
// ~/.config/yarn/global/node_modules/yo/ | ||
// ~/.config/yarn/link/generator-i-made | ||
// | ||
// win32: | ||
// %LOCALAPPDATA%\Yarn\config\global\node_modules\yo\ | ||
// %LOCALAPPDATA%\Yarn\config\link\generator-i-made | ||
// | ||
if (win32) { | ||
paths.push(path.join(process.env.LOCALAPPDATA, 'Yarn/config/link/')); | ||
} else { | ||
paths.push(path.join(os.homedir(), '.config/yarn/link/')); | ||
// Get yarn global directory and infer the module paths from there | ||
const testYarn = spawn.sync('yarn', ['global', 'dir'], {encoding: 'utf8'}); | ||
if (!testYarn.error) { | ||
const yarnBase = testYarn.stdout.trim(); | ||
paths.push(path.resolve(yarnBase, 'node_modules')); | ||
paths.push(path.resolve(yarnBase, '../link/')); | ||
} | ||
// Get npm global prefix and infer the module paths from there | ||
const testNpm = spawn.sync('npm', ['-g', 'prefix'], {encoding: 'utf8'}); | ||
if (!testNpm.error) { | ||
const npmBase = testNpm.stdout.trim(); | ||
paths.push(path.resolve(npmBase, 'lib/node_modules')); | ||
} | ||
// Adds support for generator resolving when yeoman-generator has been linked | ||
@@ -164,3 +162,3 @@ if (process.argv[1]) { | ||
process.cwd().split(path.sep).forEach((part, i, parts) => { | ||
let lookup = path.join.apply(path, parts.slice(0, i + 1).concat(['node_modules'])); | ||
let lookup = path.join(...parts.slice(0, i + 1), 'node_modules'); | ||
@@ -174,3 +172,3 @@ if (!win32) { | ||
return paths.reverse(); | ||
return _.uniq(paths.reverse()); | ||
}; | ||
@@ -177,0 +175,0 @@ |
{ | ||
"name": "yeoman-environment", | ||
"version": "2.0.6", | ||
"version": "2.1.0", | ||
"description": "Handles the lifecyle and bootstrapping of generators in a specific environment", | ||
@@ -36,12 +36,14 @@ "homepage": "http://yeoman.io", | ||
"chalk": "^2.1.0", | ||
"cross-spawn": "^6.0.5", | ||
"debug": "^3.1.0", | ||
"diff": "^3.3.1", | ||
"escape-string-regexp": "^1.0.2", | ||
"globby": "^6.1.0", | ||
"globby": "^8.0.1", | ||
"grouped-queue": "^0.3.3", | ||
"inquirer": "^3.3.0", | ||
"inquirer": "^5.2.0", | ||
"is-scoped": "^1.0.0", | ||
"lodash": "^4.17.4", | ||
"lodash": "^4.17.10", | ||
"log-symbols": "^2.1.0", | ||
"mem-fs": "^1.1.0", | ||
"strip-ansi": "^4.0.0", | ||
"text-table": "^0.2.0", | ||
@@ -51,14 +53,13 @@ "untildify": "^3.0.2" | ||
"devDependencies": { | ||
"coveralls": "^2.13.3", | ||
"coveralls": "^3.0.1", | ||
"jsdoc": "^3.5.5", | ||
"matcha": "^0.7.0", | ||
"mocha": "^3.5.3", | ||
"nsp": "^2.8.1", | ||
"nyc": "^11.2.1", | ||
"shelljs": "^0.7.8", | ||
"sinon": "^2.1.0", | ||
"sinon-test": "^1.0.1", | ||
"mocha": "^5.1.1", | ||
"nsp": "^3.2.1", | ||
"nyc": "^11.7.3", | ||
"sinon": "^5.0.7", | ||
"sinon-test": "^2.1.3", | ||
"xo": "^0.18.1", | ||
"yeoman-assert": "^3.0.0", | ||
"yeoman-generator": "^1.1.1" | ||
"yeoman-generator": "^2.0.5" | ||
}, | ||
@@ -65,0 +66,0 @@ "xo": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
35948
11
12
15
979
+ Addedcross-spawn@^6.0.5
+ Addedstrip-ansi@^4.0.0
+ Added@mrmlnc/readdir-enhanced@2.2.1(transitive)
+ Added@nodelib/fs.stat@1.1.3(transitive)
+ Addedarr-diff@4.0.0(transitive)
+ Addedarr-flatten@1.1.0(transitive)
+ Addedarr-union@3.1.0(transitive)
+ Addedarray-unique@0.3.2(transitive)
+ Addedarrify@1.0.1(transitive)
+ Addedassign-symbols@1.0.0(transitive)
+ Addedatob@2.1.2(transitive)
+ Addedbase@0.11.2(transitive)
+ Addedbraces@2.3.2(transitive)
+ Addedcache-base@1.0.1(transitive)
+ Addedcall-me-maybe@1.0.2(transitive)
+ Addedclass-utils@0.3.6(transitive)
+ Addedcollection-visit@1.0.0(transitive)
+ Addedcomponent-emitter@1.3.1(transitive)
+ Addedcopy-descriptor@0.1.1(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddefine-property@0.2.51.0.02.0.2(transitive)
+ Addeddir-glob@2.0.0(transitive)
+ Addedexpand-brackets@2.1.4(transitive)
+ Addedextend-shallow@2.0.13.0.2(transitive)
+ Addedextglob@2.0.4(transitive)
+ Addedfast-glob@2.2.7(transitive)
+ Addedfill-range@4.0.0(transitive)
+ Addedfor-in@1.0.2(transitive)
+ Addedfragment-cache@0.2.1(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-value@2.0.6(transitive)
+ Addedglob-parent@3.1.0(transitive)
+ Addedglob-to-regexp@0.3.0(transitive)
+ Addedglobby@8.0.2(transitive)
+ Addedhas-value@0.3.11.0.0(transitive)
+ Addedhas-values@0.1.41.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedignore@3.3.10(transitive)
+ Addedinquirer@5.2.0(transitive)
+ Addedis-accessor-descriptor@1.0.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedis-data-descriptor@1.0.1(transitive)
+ Addedis-descriptor@0.1.71.0.3(transitive)
+ Addedis-extendable@0.1.11.0.1(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@3.1.04.0.3(transitive)
+ Addedis-number@3.0.0(transitive)
+ Addedis-plain-object@2.0.4(transitive)
+ Addedis-windows@1.0.2(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisobject@2.1.03.0.1(transitive)
+ Addedkind-of@3.2.24.0.06.0.3(transitive)
+ Addedmap-cache@0.2.2(transitive)
+ Addedmap-visit@1.0.0(transitive)
+ Addedmerge2@1.4.1(transitive)
+ Addedmicromatch@3.1.10(transitive)
+ Addedmixin-deep@1.3.2(transitive)
+ Addedms@2.0.0(transitive)
+ Addednanomatch@1.2.13(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addedobject-copy@0.1.0(transitive)
+ Addedobject-visit@1.0.1(transitive)
+ Addedobject.pick@1.3.0(transitive)
+ Addedpascalcase@0.1.1(transitive)
+ Addedpath-dirname@1.0.2(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpath-type@3.0.0(transitive)
+ Addedpify@3.0.0(transitive)
+ Addedposix-character-classes@0.1.1(transitive)
+ Addedregex-not@1.0.2(transitive)
+ Addedrepeat-element@1.1.4(transitive)
+ Addedrepeat-string@1.6.1(transitive)
+ Addedresolve-url@0.2.1(transitive)
+ Addedret@0.1.15(transitive)
+ Addedrxjs@5.5.12(transitive)
+ Addedsafe-regex@1.1.0(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedset-value@2.0.1(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedslash@1.0.0(transitive)
+ Addedsnapdragon@0.8.2(transitive)
+ Addedsnapdragon-node@2.1.1(transitive)
+ Addedsnapdragon-util@3.0.1(transitive)
+ Addedsource-map@0.5.7(transitive)
+ Addedsource-map-resolve@0.5.3(transitive)
+ Addedsource-map-url@0.4.1(transitive)
+ Addedsplit-string@3.1.0(transitive)
+ Addedstatic-extend@0.1.2(transitive)
+ Addedsymbol-observable@1.0.1(transitive)
+ Addedto-object-path@0.3.0(transitive)
+ Addedto-regex@3.0.2(transitive)
+ Addedto-regex-range@2.1.1(transitive)
+ Addedunion-value@1.0.1(transitive)
+ Addedunset-value@1.0.0(transitive)
+ Addedurix@0.1.0(transitive)
+ Addeduse@3.1.1(transitive)
+ Addedwhich@1.3.1(transitive)
- Removedglobby@6.1.0(transitive)
- Removedinquirer@3.3.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedrx-lite@4.0.8(transitive)
- Removedrx-lite-aggregates@4.0.8(transitive)
Updatedglobby@^8.0.1
Updatedinquirer@^5.2.0
Updatedlodash@^4.17.10