diff --git a/templates/package-builder/src/yeoman/.gitignore b/templates/package-builder/src/yeoman/.gitignore new file mode 100644 index 0000000000..07e6e472cc --- /dev/null +++ b/templates/package-builder/src/yeoman/.gitignore @@ -0,0 +1 @@ +/node_modules diff --git a/templates/package-builder/src/yeoman/README.md b/templates/package-builder/src/yeoman/README.md index a64e1f90ac..549f7cf01e 100644 --- a/templates/package-builder/src/yeoman/README.md +++ b/templates/package-builder/src/yeoman/README.md @@ -1,4 +1,4 @@ -# Please use "dotnet new" templates instead +## Please use "dotnet new" templates instead As of .NET Core 2.0, it's no longer necessary to use Yeoman to create new Single-Page Application projects. @@ -10,6 +10,6 @@ Using the .NET Core 2.0 SDK, you can run any of the following commands in an emp Or, if you want to create an Aurelia, Knockout, or Vue application, you should run `dotnet new --install Microsoft.AspNetCore.SpaTemplates::*` first. This will add `aurelia`, `knockout`, and `vue` templates to `dotnet new`. -#### This Yeoman generator is DEPRECATED +### This Yeoman generator is DEPRECATED Please don't use `generator-aspnetcore-spa` to create new projects. Its output is outdated and no longer maintained. Instead, use `dotnet new` as described above (or if you're on Windows and use Visual Studio, you can just use *File->New Project* to create Angular, React, or React+Redux projects). diff --git a/templates/package-builder/src/yeoman/app/index.js b/templates/package-builder/src/yeoman/app/index.js new file mode 100644 index 0000000000..bcddcc5fa2 --- /dev/null +++ b/templates/package-builder/src/yeoman/app/index.js @@ -0,0 +1,15 @@ +var Generator = require('yeoman-generator'); +var fs = require('fs'); +var path = require('path'); +var marked = require('marked'); +var TerminalRenderer = require('marked-terminal'); + +marked.setOptions({ renderer: new TerminalRenderer() }); + +module.exports = class extends Generator { + run() { + // Just display deprecation notice from README.md + const readmePath = path.join(__dirname, '../README.md'); + console.log(marked(fs.readFileSync(readmePath, 'utf8'))); + } +}; diff --git a/templates/package-builder/src/yeoman/package.json b/templates/package-builder/src/yeoman/package.json index 7cbccd537d..252f1aec52 100644 --- a/templates/package-builder/src/yeoman/package.json +++ b/templates/package-builder/src/yeoman/package.json @@ -4,6 +4,10 @@ "description": "DEPRECATED. Do not use. Use 'dotnet new' to create ASP.NET Core Single-Page Application projects instead.", "author": "Microsoft", "license": "Apache-2.0", + "files": [ + "app", + "README.md" + ], "keywords": [ "yeoman-generator" ], @@ -15,5 +19,8 @@ "url": "https://github.com/aspnet/JavaScriptServices.git" }, "dependencies": { + "marked": "^0.3.6", + "marked-terminal": "^2.0.0", + "yeoman-generator": "^1.0.0" } }