mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
In Yeoman templates, stop restoring using Yarn, since it doesn't respect npm-shrinkwrap.json
This commit is contained in:
@@ -6,7 +6,6 @@ import * as glob from 'glob';
|
||||
import * as semver from 'semver';
|
||||
import * as chalk from 'chalk';
|
||||
import { execSync } from 'child_process';
|
||||
import npmWhich = require('npm-which');
|
||||
const yosay = require('yosay');
|
||||
const toPascalCase = require('to-pascal-case');
|
||||
const isWindows = /^win/.test(process.platform);
|
||||
@@ -165,15 +164,6 @@ class MyGenerator extends yeoman.Base {
|
||||
}
|
||||
|
||||
installingDeps() {
|
||||
// If available, restore dependencies using Yarn instead of NPM
|
||||
const yarnPath = getPathToExecutable('yarn');
|
||||
if (!!yarnPath) {
|
||||
this.log('Will restore NPM dependencies using \'yarn\' installed at ' + yarnPath);
|
||||
this.npmInstall = (pkgs, options, cb) => {
|
||||
return (this as any).runInstall(yarnPath, pkgs, options, cb);
|
||||
};
|
||||
}
|
||||
|
||||
this.installDependencies({
|
||||
npm: true,
|
||||
bower: false,
|
||||
@@ -186,14 +176,6 @@ class MyGenerator extends yeoman.Base {
|
||||
}
|
||||
}
|
||||
|
||||
function getPathToExecutable(executableName: string) {
|
||||
try {
|
||||
return npmWhich(__dirname).sync(executableName);
|
||||
} catch(ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function assertNpmVersionIsAtLeast(minVersion: string) {
|
||||
const runningVersion = execSync('npm -v').toString();
|
||||
if (!semver.gte(runningVersion, minVersion, /* loose */ true)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "generator-aspnetcore-spa",
|
||||
"version": "0.9.3",
|
||||
"version": "0.9.4",
|
||||
"description": "Single-Page App templates for ASP.NET Core",
|
||||
"author": "Microsoft",
|
||||
"license": "Apache-2.0",
|
||||
@@ -21,7 +21,6 @@
|
||||
"chalk": "^1.1.3",
|
||||
"glob": "^7.0.3",
|
||||
"node-uuid": "^1.4.7",
|
||||
"npm-which": "^3.0.1",
|
||||
"to-pascal-case": "^1.0.0",
|
||||
"yeoman-generator": "^0.20.2",
|
||||
"yeoman-option-or-prompt": "^1.0.2",
|
||||
|
||||
Reference in New Issue
Block a user