Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

yeoman-environment

Package Overview
Dependencies
Maintainers
7
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yeoman-environment - npm Package Compare versions

Comparing version 2.0.6 to 2.1.0

50

lib/resolver.js
'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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc