Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit efdfbf5

Browse files
In Yeoman templates, stop restoring using Yarn, since it doesn't respect npm-shrinkwrap.json
1 parent 6f2e408 commit efdfbf5

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

templates/package-builder/src/yeoman/app/index.ts

-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import * as glob from 'glob';
66
import * as semver from 'semver';
77
import * as chalk from 'chalk';
88
import { execSync } from 'child_process';
9-
import npmWhich = require('npm-which');
109
const yosay = require('yosay');
1110
const toPascalCase = require('to-pascal-case');
1211
const isWindows = /^win/.test(process.platform);
@@ -165,15 +164,6 @@ class MyGenerator extends yeoman.Base {
165164
}
166165

167166
installingDeps() {
168-
// If available, restore dependencies using Yarn instead of NPM
169-
const yarnPath = getPathToExecutable('yarn');
170-
if (!!yarnPath) {
171-
this.log('Will restore NPM dependencies using \'yarn\' installed at ' + yarnPath);
172-
this.npmInstall = (pkgs, options, cb) => {
173-
return (this as any).runInstall(yarnPath, pkgs, options, cb);
174-
};
175-
}
176-
177167
this.installDependencies({
178168
npm: true,
179169
bower: false,
@@ -186,14 +176,6 @@ class MyGenerator extends yeoman.Base {
186176
}
187177
}
188178

189-
function getPathToExecutable(executableName: string) {
190-
try {
191-
return npmWhich(__dirname).sync(executableName);
192-
} catch(ex) {
193-
return null;
194-
}
195-
}
196-
197179
function assertNpmVersionIsAtLeast(minVersion: string) {
198180
const runningVersion = execSync('npm -v').toString();
199181
if (!semver.gte(runningVersion, minVersion, /* loose */ true)) {

templates/package-builder/src/yeoman/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-aspnetcore-spa",
3-
"version": "0.9.3",
3+
"version": "0.9.4",
44
"description": "Single-Page App templates for ASP.NET Core",
55
"author": "Microsoft",
66
"license": "Apache-2.0",
@@ -21,7 +21,6 @@
2121
"chalk": "^1.1.3",
2222
"glob": "^7.0.3",
2323
"node-uuid": "^1.4.7",
24-
"npm-which": "^3.0.1",
2524
"to-pascal-case": "^1.0.0",
2625
"yeoman-generator": "^0.20.2",
2726
"yeoman-option-or-prompt": "^1.0.2",

0 commit comments

Comments
 (0)