From 54f222e88fb21dba2fad696647f604e66930a22b Mon Sep 17 00:00:00 2001 From: SteveSandersonMS Date: Fri, 28 Oct 2016 17:36:55 +0100 Subject: [PATCH] Update templates for Yarn compatibility --- .gitignore | 1 + templates/Angular2Spa/template_gitignore | 2 ++ templates/AureliaSpa/template_gitignore | 1 + .../KnockoutSpa/ClientApp/components/app-root/app-root.ts | 1 + templates/KnockoutSpa/ClientApp/router.ts | 1 + templates/KnockoutSpa/template_gitignore | 2 ++ templates/ReactReduxSpa/template_gitignore | 1 + templates/ReactReduxSpa/tsconfig.json | 7 ++++++- templates/ReactSpa/template_gitignore | 2 ++ templates/WebApplicationBasic/template_gitignore | 2 ++ templates/package-builder/src/yeoman/package.json | 2 +- 11 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9f1553e..6453872 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,5 @@ npm-debug.log /templates/*/node_modules/ /templates/*/wwwroot/dist/ /templates/*/ClientApp/dist/ +/templates/*/yarn.lock .vscode/ diff --git a/templates/Angular2Spa/template_gitignore b/templates/Angular2Spa/template_gitignore index f8bf5e9..ded4b28 100644 --- a/templates/Angular2Spa/template_gitignore +++ b/templates/Angular2Spa/template_gitignore @@ -196,6 +196,8 @@ orleans.codegen.cs /node_modules/** !/node_modules/_placeholder.txt +/yarn.lock + # RIA/Silverlight projects Generated_Code/ diff --git a/templates/AureliaSpa/template_gitignore b/templates/AureliaSpa/template_gitignore index f8bf5e9..bc5a6f3 100644 --- a/templates/AureliaSpa/template_gitignore +++ b/templates/AureliaSpa/template_gitignore @@ -35,6 +35,7 @@ Obj/ !/wwwroot/dist/_placeholder.txt !/ClientApp/dist/_placeholder.txt +/yarn.lock # MSTest test Results [Tt]est[Rr]esult*/ diff --git a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts b/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts index 108d8ad..011a220 100644 --- a/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts +++ b/templates/KnockoutSpa/ClientApp/components/app-root/app-root.ts @@ -1,4 +1,5 @@ import * as ko from 'knockout'; +import * as History from 'history'; import { Route, Router } from '../../router'; import navMenu from '../nav-menu/nav-menu'; diff --git a/templates/KnockoutSpa/ClientApp/router.ts b/templates/KnockoutSpa/ClientApp/router.ts index 9fa5e9b..d3ac749 100644 --- a/templates/KnockoutSpa/ClientApp/router.ts +++ b/templates/KnockoutSpa/ClientApp/router.ts @@ -1,5 +1,6 @@ import * as ko from 'knockout'; import * as $ from 'jquery'; +import * as History from 'history'; import crossroads = require('crossroads'); // This module configures crossroads.js, a routing library. If you prefer, you diff --git a/templates/KnockoutSpa/template_gitignore b/templates/KnockoutSpa/template_gitignore index dacd256..893db26 100644 --- a/templates/KnockoutSpa/template_gitignore +++ b/templates/KnockoutSpa/template_gitignore @@ -33,6 +33,8 @@ Obj/ # Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 !/wwwroot/dist/_placeholder.txt +/yarn.lock + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* diff --git a/templates/ReactReduxSpa/template_gitignore b/templates/ReactReduxSpa/template_gitignore index f8bf5e9..bc5a6f3 100644 --- a/templates/ReactReduxSpa/template_gitignore +++ b/templates/ReactReduxSpa/template_gitignore @@ -35,6 +35,7 @@ Obj/ !/wwwroot/dist/_placeholder.txt !/ClientApp/dist/_placeholder.txt +/yarn.lock # MSTest test Results [Tt]est[Rr]esult*/ diff --git a/templates/ReactReduxSpa/tsconfig.json b/templates/ReactReduxSpa/tsconfig.json index 3d39f6e..960a981 100644 --- a/templates/ReactReduxSpa/tsconfig.json +++ b/templates/ReactReduxSpa/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "baseUrl": ".", "moduleResolution": "node", "target": "es6", "jsx": "preserve", @@ -7,7 +8,11 @@ "sourceMap": true, "skipDefaultLibCheck": true, "lib": ["es6", "dom"], - "types": [ "webpack-env", "whatwg-fetch" ] + "types": [ "webpack-env", "whatwg-fetch" ], + "paths": { + // Fixes "Duplicate identifier 'Redux'" error when packages were installed via Yarn (by specifying which .d.ts file is authoritative) + "redux": ["./node_modules/@types/redux/index"] + } }, "exclude": [ "bin", diff --git a/templates/ReactSpa/template_gitignore b/templates/ReactSpa/template_gitignore index dacd256..893db26 100644 --- a/templates/ReactSpa/template_gitignore +++ b/templates/ReactSpa/template_gitignore @@ -33,6 +33,8 @@ Obj/ # Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 !/wwwroot/dist/_placeholder.txt +/yarn.lock + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* diff --git a/templates/WebApplicationBasic/template_gitignore b/templates/WebApplicationBasic/template_gitignore index 2ee8e59..e12e5da 100644 --- a/templates/WebApplicationBasic/template_gitignore +++ b/templates/WebApplicationBasic/template_gitignore @@ -30,6 +30,8 @@ Obj/ .vs/ /wwwroot/dist/ +/yarn.lock + # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* diff --git a/templates/package-builder/src/yeoman/package.json b/templates/package-builder/src/yeoman/package.json index 10a7b7a..fc9ac7d 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.4.1", + "version": "0.4.2", "description": "Single-Page App templates for ASP.NET Core", "author": "Microsoft", "license": "Apache-2.0",