From efdfbf5dbbea7a730396dc9e55bae92b470c131a Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Fri, 7 Jul 2017 15:27:50 +0100 Subject: [PATCH] In Yeoman templates, stop restoring using Yarn, since it doesn't respect npm-shrinkwrap.json --- .../package-builder/src/yeoman/app/index.ts | 18 ------------------ .../package-builder/src/yeoman/package.json | 3 +-- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/templates/package-builder/src/yeoman/app/index.ts b/templates/package-builder/src/yeoman/app/index.ts index fadda58..709af7a 100644 --- a/templates/package-builder/src/yeoman/app/index.ts +++ b/templates/package-builder/src/yeoman/app/index.ts @@ -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)) { diff --git a/templates/package-builder/src/yeoman/package.json b/templates/package-builder/src/yeoman/package.json index efa503f..289adfd 100644 --- a/templates/package-builder/src/yeoman/package.json +++ b/templates/package-builder/src/yeoman/package.json @@ -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",