├── .gitignore ├── LICENSE ├── README.md ├── generators └── app │ ├── index.js │ └── templates │ ├── advanced │ ├── WebApp.sln │ ├── global.json │ ├── ignorefile │ └── src │ │ └── WebApp │ │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ │ ├── Controllers │ │ ├── CharactersController.cs │ │ └── HomeController.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ │ ├── WebApp.xproj │ │ ├── appsettings.json │ │ ├── config │ │ ├── karma.conf.js │ │ ├── protractor.conf.js │ │ ├── test.js │ │ ├── webpack.common.js │ │ ├── webpack.dev.js │ │ ├── webpack.prod.js │ │ ├── webpack.test.js │ │ └── webpack.vendor.js │ │ ├── karma.conf.js │ │ ├── package.json │ │ ├── project.json │ │ ├── protractor.conf.js │ │ ├── tsconfig.json │ │ ├── tslint.json │ │ ├── web.config │ │ ├── webpack.config.js │ │ └── wwwroot │ │ ├── e2e │ │ └── home.component.e2e-spec.ts │ │ ├── favicon.ico │ │ └── src │ │ ├── app │ │ ├── about │ │ │ ├── about-routing.module.ts │ │ │ ├── about.component.html │ │ │ ├── about.component.ts │ │ │ └── about.module.ts │ │ ├── app-routing.module.ts │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── characters │ │ │ ├── character-list.component.html │ │ │ ├── character-list.component.ts │ │ │ ├── index.ts │ │ │ └── shared │ │ │ │ └── character.service.ts │ │ ├── home │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ ├── home.component.ts │ │ │ └── index.ts │ │ └── shared │ │ │ └── index.ts │ │ ├── main.ts │ │ ├── polyfills.ts │ │ ├── server.ts │ │ ├── styles.scss │ │ └── vendor.ts │ └── basic │ ├── WebApp.sln │ ├── global.json │ ├── ignorefile │ └── src │ └── WebApp │ ├── .vscode │ ├── launch.json │ └── tasks.json │ ├── Api │ └── CharactersController.cs │ ├── Controllers │ └── HomeController.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ └── Home │ │ └── Index.cshtml │ ├── WebApp.xproj │ ├── appsettings.json │ ├── package.json │ ├── project.json │ ├── tsconfig.json │ ├── typings.json │ ├── web.config │ └── wwwroot │ ├── app │ ├── about │ │ └── about.component.ts │ ├── app.component.html │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routing.ts │ ├── home │ │ ├── home.component.html │ │ └── home.component.ts │ ├── main.ts │ └── shared │ │ └── character.service.ts │ ├── styles.css │ └── systemjs.config.js ├── package.json └── screenshots ├── about.png ├── console.png └── home.png /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 sgbj 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # generator-aspnetcore-angular2 2 | > Generate a Visual Studio/Code project for ASP.NET Core, Angular 2, and TypeScript 2 using Webpack 3 | 4 | ## Two templates 5 | 1. Basic - nothing fancy, same as previous versions (doesn't use webpack) 6 | 2. Advanced - Angular Universal, webpack, Karma, Protractor, TS2, HMR 7 | 8 | ## Features 9 | * Visual Studio 2015 Update 3 10 | * Visual Studio Code 11 | * [ASP.NET Core 1.0.1](https://www.microsoft.com/net/core) 12 | * Angular 2.1.0 13 | * Angular Universal 14 | * Lazy routes 15 | * TypeScript 2 16 | * Webpack 17 | * Karma 18 | * Protractor 19 | * Bootstrap/Material Design Lite 20 | * Swagger via [Swashbuckle (Ahoy)](https://github.com/domaindrivendev/Ahoy) 21 | 22 | 23 | ## Installation 24 | 25 | First, install [Yeoman](http://yeoman.io) and generator-aspnetcore-angular2 using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)). 26 | 27 | ```bash 28 | npm install -g yo 29 | npm install -g generator-aspnetcore-angular2 30 | ``` 31 | 32 | Then generate your new project: 33 | 34 | ```bash 35 | yo aspnetcore-angular2 36 | ``` 37 | 38 | ## Command line 39 | 40 | From the root folder, type the following commands: 41 | 42 | ### Basic template 43 | ``` 44 | cd src/webapp 45 | tsc 46 | dotnet restore 47 | dotnet run 48 | ``` 49 | 50 | ### Advanced template 51 | 52 | ``` 53 | cd src/webapp 54 | dotnet restore 55 | npm run build:vendor 56 | set ASPNETCORE_ENVIRONMENT=Development 57 | npm start 58 | ``` 59 | 60 | Other commands: 61 | 62 | ``` 63 | npm run lint 64 | npm run test 65 | npm run e2e (while running the app) 66 | npm run clean:dist (cleanup dist directory) 67 | ``` 68 | 69 | ## Result 70 | 71 | What it looks like: 72 | 73 | ![Console](https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/master/screenshots/console.png) 74 | 75 | What you get: 76 | 77 | ![Home](https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/master/screenshots/home.png) 78 | 79 | ![About](https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/master/screenshots/about.png) 80 | 81 | ## Getting To Know Yeoman 82 | 83 | Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to [learn more about him](http://yeoman.io/). 84 | 85 | ## License 86 | 87 | MIT <3 [sgbj](https://github.com/sgbj) 88 | -------------------------------------------------------------------------------- /generators/app/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | var yeoman = require('yeoman-generator'); 3 | var chalk = require('chalk'); 4 | var yosay = require('yosay'); 5 | var fs = require('fs'); 6 | var path = require('path'); 7 | 8 | function exists(p) { 9 | try { 10 | fs.lstatSync(path.resolve(__dirname, 'templates', p)); 11 | console.log('exists: ' + path.resolve(__dirname, 'templates', p)); 12 | return true; 13 | } catch (e) { 14 | console.log('erro: ' + path.resolve(__dirname, 'templates', p)); 15 | return false; 16 | } 17 | } 18 | 19 | module.exports = yeoman.Base.extend({ 20 | prompting: function () { 21 | // Have Yeoman greet the user. 22 | this.log(yosay( 23 | 'Welcome to the stylish ' + chalk.red('aspnetcore-angular2') + ' generator!' 24 | )); 25 | 26 | var prompts = [{ 27 | name: 'appName', 28 | message: 'What\'s the project name ' + chalk.red('(this will also be your namespace name)') + '?' 29 | }, 30 | { 31 | type: 'list', 32 | name: 'template', 33 | message: 'Which template do you want to use?', 34 | choices: [ 35 | { name: 'Basic - nothing fancy, same as previous versions', value: 'basic' }, 36 | { name: 'Advanced (new) - Angular Universal, webpack, Karma, Protractor, TS2, HMR', value: 'advanced' } 37 | ] 38 | }, 39 | { 40 | type: 'confirm', 41 | name: 'createDir', 42 | message: 'Want me to create the directory for you?', 43 | default: true 44 | }, 45 | { 46 | type: 'confirm', 47 | name: 'vsCode', 48 | message: 'Want me to generate VS Code debug configuration?', 49 | default: true 50 | }, 51 | { 52 | type: 'confirm', 53 | name: 'swagger', 54 | message: 'Want me to include Swagger?', 55 | default: true 56 | }]; 57 | 58 | return this.prompt(prompts).then(function (props) { 59 | var safeName = props.appName.replace(/^[^a-zA-Z]+/, '').replace(/[^a-zA-Z0-9]/g, ''); 60 | 61 | if (safeName.length == 0) { 62 | safeName = 'WebApp'; 63 | } 64 | 65 | props.safeName = safeName; 66 | props.dir = props.createDir ? safeName : ''; 67 | 68 | this.props = props; 69 | }.bind(this)); 70 | }, 71 | 72 | writing: function () { 73 | this.log(chalk.red('\nCreating files...\n')); 74 | var basePath = this.props.template; 75 | 76 | this.fs.copy( 77 | this.templatePath(basePath, 'ignorefile'), 78 | this.destinationPath(this.props.dir, '.gitignore') 79 | ); 80 | this.fs.copy( 81 | this.templatePath(basePath, 'global.json'), 82 | this.destinationPath(this.props.dir, 'global.json') 83 | ); 84 | this.template( 85 | this.templatePath(basePath, 'WebApp.sln'), 86 | this.destinationPath(this.props.dir, this.props.safeName + '.sln'), 87 | this.props 88 | ); 89 | [ 90 | 'appsettings.json', 'package.json', 'project.json', 'Program.cs', 'Startup.cs', 'tsconfig.json', 'web.config', 'typings.json', 91 | 'karma.conf.js', 'protractor.conf.js', 'tslint.json', 'webpack.config.js' 92 | ].forEach(function (file) { 93 | if (!exists(basePath + '/src/WebApp/' + file)) return; 94 | this.template( 95 | this.templatePath(basePath, 'src/WebApp', file), 96 | this.destinationPath(this.props.dir, 'src', this.props.safeName, file), 97 | this.props 98 | ); 99 | }.bind(this)); 100 | if (this.props.vsCode) { 101 | this.template( 102 | this.templatePath(basePath, 'src/WebApp/.vscode'), 103 | this.destinationPath(this.props.dir, 'src', this.props.safeName, '.vscode'), 104 | this.props 105 | ); 106 | } 107 | this.template( 108 | this.templatePath(basePath, 'src/WebApp/WebApp.xproj'), 109 | this.destinationPath(this.props.dir, 'src', this.props.safeName, this.props.safeName + '.xproj'), 110 | this.props 111 | ); 112 | ['Api', 'Controllers', 'Properties', 'Views', 'wwwroot', 'config'].forEach(function (file) { 113 | if (!exists(basePath + '/src/WebApp/' + file)) return; 114 | this.template( 115 | this.templatePath(basePath, 'src/WebApp', file), 116 | this.destinationPath(this.props.dir, 'src', this.props.safeName, file), 117 | this.props 118 | ); 119 | }.bind(this)); 120 | }, 121 | 122 | 123 | install: function () { 124 | this.log('\n' + chalk.red('Installing npm dependencies...') + '\n'); 125 | if (this.props.createDir) { 126 | process.chdir(this.destinationPath(this.props.safeName, 'src', this.props.safeName)); 127 | } else { 128 | process.chdir(this.destinationPath('src', this.props.safeName)); 129 | } 130 | this.npmInstall('', function () { 131 | if (this.props.template == 'advanced') { 132 | this.spawnCommand('npm', ['run', 'build']); 133 | } 134 | this.log(chalk.red('\nHave fun working on ' + this.props.appName + '! <3')); 135 | }.bind(this)); 136 | } 137 | }); 138 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/WebApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{791D81BB-A1E5-41E5-8E78-5ED506D1D327}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1BFE7205-609B-4D43-A138-A11E295C9114}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "<%= safeName %>", "src\<%= safeName %>\<%= safeName %>.xproj", "{99E7C184-8A63-432F-9354-5394ED7E942A}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {99E7C184-8A63-432F-9354-5394ED7E942A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {99E7C184-8A63-432F-9354-5394ED7E942A}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {99E7C184-8A63-432F-9354-5394ED7E942A}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {99E7C184-8A63-432F-9354-5394ED7E942A}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {99E7C184-8A63-432F-9354-5394ED7E942A} = {791D81BB-A1E5-41E5-8E78-5ED506D1D327} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003131" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/ignorefile: -------------------------------------------------------------------------------- 1 | dist/ 2 | coverage/ 3 | npm-debug.log 4 | 5 | ## Ignore Visual Studio temporary files, build results, and 6 | ## files generated by popular Visual Studio add-ons. 7 | 8 | # User-specific files 9 | *.suo 10 | *.user 11 | *.userosscache 12 | *.sln.docstates 13 | 14 | # User-specific files (MonoDevelop/Xamarin Studio) 15 | *.userprefs 16 | 17 | # Build results 18 | [Dd]ebug/ 19 | [Dd]ebugPublic/ 20 | [Rr]elease/ 21 | [Rr]eleases/ 22 | x64/ 23 | x86/ 24 | bld/ 25 | [Bb]in/ 26 | [Oo]bj/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | artifacts/ 49 | 50 | *_i.c 51 | *_p.c 52 | *_i.h 53 | *.ilk 54 | *.meta 55 | *.obj 56 | *.pch 57 | *.pdb 58 | *.pgc 59 | *.pgd 60 | *.rsp 61 | *.sbr 62 | *.tlb 63 | *.tli 64 | *.tlh 65 | *.tmp 66 | *.tmp_proj 67 | *.log 68 | *.vspscc 69 | *.vssscc 70 | .builds 71 | *.pidb 72 | *.svclog 73 | *.scc 74 | 75 | # Chutzpah Test files 76 | _Chutzpah* 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opendb 83 | *.opensdf 84 | *.sdf 85 | *.cachefile 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | *.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Microsoft Azure ApplicationInsights config file 170 | ApplicationInsights.config 171 | 172 | # Windows Store app package directory 173 | AppPackages/ 174 | BundleArtifacts/ 175 | 176 | # Visual Studio cache files 177 | # files ending in .cache can be ignored 178 | *.[Cc]ache 179 | # but keep track of directories ending in .cache 180 | !*.[Cc]ache/ 181 | 182 | # Others 183 | ClientBin/ 184 | ~$* 185 | *~ 186 | *.dbmdl 187 | *.dbproj.schemaview 188 | *.pfx 189 | *.publishsettings 190 | node_modules/ 191 | orleans.codegen.cs 192 | 193 | # RIA/Silverlight projects 194 | Generated_Code/ 195 | 196 | # Backup & report files from converting an old project file 197 | # to a newer Visual Studio version. Backup files are not needed, 198 | # because we have git ;-) 199 | _UpgradeReport_Files/ 200 | Backup*/ 201 | UpgradeLog*.XML 202 | UpgradeLog*.htm 203 | 204 | # SQL Server files 205 | *.mdf 206 | *.ldf 207 | 208 | # Business Intelligence projects 209 | *.rdl.data 210 | *.bim.layout 211 | *.bim_*.settings 212 | 213 | # Microsoft Fakes 214 | FakesAssemblies/ 215 | 216 | # GhostDoc plugin setting file 217 | *.GhostDoc.xml 218 | 219 | # Node.js Tools for Visual Studio 220 | .ntvs_analysis.dat 221 | 222 | # Visual Studio 6 build log 223 | *.plg 224 | 225 | # Visual Studio 6 workspace options file 226 | *.opt 227 | 228 | # Visual Studio LightSwitch build output 229 | **/*.HTMLClient/GeneratedArtifacts 230 | **/*.DesktopClient/GeneratedArtifacts 231 | **/*.DesktopClient/ModelManifest.xml 232 | **/*.Server/GeneratedArtifacts 233 | **/*.Server/ModelManifest.xml 234 | _Pvt_Extensions 235 | 236 | # Paket dependency manager 237 | .paket/paket.exe 238 | 239 | # FAKE - F# Make 240 | .fake/ 241 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": ".NET Core Launch (web)", 6 | "type": "coreclr", 7 | "request": "launch", 8 | "preLaunchTask": "build", 9 | "program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/<%= safeName %>.dll", 10 | "args": [], 11 | "cwd": "${workspaceRoot}", 12 | "stopAtEntry": false, 13 | "launchBrowser": { 14 | "enabled": true, 15 | "args": "${auto-detect-url}", 16 | "windows": { 17 | "command": "cmd.exe", 18 | "args": "/C start ${auto-detect-url}" 19 | }, 20 | "osx": { 21 | "command": "open" 22 | }, 23 | "linux": { 24 | "command": "xdg-open" 25 | } 26 | }, 27 | "env": { 28 | "ASPNETCORE_ENVIRONMENT": "Development" 29 | } 30 | }, 31 | { 32 | "name": ".NET Core Attach", 33 | "type": "coreclr", 34 | "request": "attach", 35 | "processId": 0 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "dotnet", 4 | "isShellCommand": true, 5 | "args": [], 6 | "tasks": [ 7 | { 8 | "taskName": "build", 9 | "args": [], 10 | "isBuildCommand": true, 11 | "problemMatcher": "$msCompile" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Controllers/CharactersController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace <%= safeName %>.Controllers 4 | { 5 | [Route("api/[controller]")] 6 | [Produces("application/json")] 7 | public class CharactersController : Controller 8 | { 9 | [HttpGet] 10 | [Produces(typeof(string[]))] 11 | public IActionResult Get() 12 | { 13 | return Ok(new[] { 14 | "Gollum", 15 | "Gandalf", 16 | "Legolas", 17 | "Aragorn", 18 | "Frodo Baggins", 19 | "Bilbo Baggins", 20 | "Saruman", 21 | "Gimli", 22 | "Galadriel" 23 | }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace <%= safeName %>.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public IActionResult Index() 8 | { 9 | return View(); 10 | } 11 | 12 | public IActionResult Error() 13 | { 14 | return View(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using System.IO; 4 | 5 | namespace <%= safeName %> 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | var config = new ConfigurationBuilder() 12 | .AddCommandLine(args) 13 | .Build(); 14 | 15 | var host = new WebHostBuilder() 16 | .UseKestrel() 17 | .UseConfiguration(config) 18 | .UseContentRoot(Directory.GetCurrentDirectory()) 19 | .UseIISIntegration() 20 | .UseStartup() 21 | .Build(); 22 | 23 | host.Run(); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3000/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "<%= safeName %>": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:3000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.AspNetCore.NodeServices; 4 | using Microsoft.AspNetCore.SpaServices.Webpack; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.Logging; 8 | 9 | namespace <%= safeName %> 10 | { 11 | public class Startup 12 | { 13 | public Startup(IHostingEnvironment env) 14 | { 15 | var builder = new ConfigurationBuilder() 16 | .SetBasePath(env.ContentRootPath) 17 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 18 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) 19 | .AddEnvironmentVariables(); 20 | Configuration = builder.Build(); 21 | } 22 | 23 | public IConfigurationRoot Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | // Add framework services. 29 | services.AddMvc();<% if (swagger) { %> 30 | 31 | services.AddSwaggerGen();<% } %> 32 | } 33 | 34 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 35 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 36 | { 37 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 38 | loggerFactory.AddDebug(); 39 | 40 | if (env.IsDevelopment()) 41 | { 42 | app.UseDeveloperExceptionPage(); 43 | 44 | app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions 45 | { 46 | HotModuleReplacement = true 47 | });<% if (swagger) { %> 48 | 49 | app.UseSwagger(); 50 | app.UseSwaggerUi();<% } %> 51 | } 52 | else 53 | { 54 | app.UseExceptionHandler("/Home/Error"); 55 | } 56 | 57 | app.UseStaticFiles(); 58 | 59 | app.UseMvc(routes => 60 | { 61 | routes.MapRoute( 62 | name: "default", 63 | template: "{controller=Home}/{action=Index}/{id?}"); 64 | 65 | routes.MapSpaFallbackRoute( 66 | name: "spa-fallback", 67 | defaults: new { controller = "Home", action = "Index" }); 68 | }); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 | 6 | Loading... 7 | 8 | 9 | @section scripts { 10 | 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |

Error.

6 |

An error occurred while processing your request.

7 | 8 |

Development Mode

9 |

10 | Swapping to Development environment will display more detailed information about the error that occurred. 11 |

12 |

13 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 14 |

15 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | @ViewData["Title"] - <%= appName %> 8 | 9 | 10 | 11 | @RenderBody() 12 | @RenderSection("scripts", required: false) 13 | 14 | 15 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using <%= safeName %> 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | @addTagHelper *, Microsoft.AspNetCore.SpaServices -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/WebApp.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | true 7 | 8 | 9 | 10 | 99e7c184-8a63-432f-9354-5394ed7e942a 11 | <%= safeName %> 12 | .\obj 13 | .\bin\ 14 | v4.5.2 15 | 16 | 17 | 2.0 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | var webpackConfig = require('./webpack.test.js'); 3 | 4 | var configuration = { 5 | basePath: '', 6 | frameworks: ['jasmine'], 7 | exclude: [], 8 | files: [{ pattern: './config/test.js', watched: false }], 9 | preprocessors: { 10 | './config/test.js': ['coverage', 'webpack', 'sourcemap'] 11 | }, 12 | webpack: webpackConfig, 13 | coverageReporter: { 14 | type: 'in-memory' 15 | }, 16 | remapCoverageReporter: { 17 | 'text-summary': null, 18 | json: './coverage/coverage.json', 19 | html: './coverage/html' 20 | }, 21 | webpackMiddleware: { stats: 'errors-only', noInfo: true }, 22 | reporters: ['mocha', 'coverage', 'remap-coverage'], 23 | port: 9876, 24 | colors: true, 25 | logLevel: config.LOG_INFO, 26 | autoWatch: false, 27 | browsers: [ 28 | 'PhantomJS' 29 | ], 30 | customLaunchers: { 31 | ChromeTravisCi: { 32 | base: 'Chrome', 33 | flags: ['--no-sandbox'] 34 | } 35 | }, 36 | singleRun: true 37 | }; 38 | 39 | if (process.env.TRAVIS) { 40 | configuration.browsers = [ 41 | 'ChromeTravisCi', 42 | 'PhantomJS' 43 | ]; 44 | } 45 | 46 | config.set(configuration); 47 | }; -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/protractor.conf.js: -------------------------------------------------------------------------------- 1 | require('ts-node/register'); 2 | const path = require('path'); 3 | 4 | exports.config = { 5 | baseUrl: 'http://localhost:3000/', 6 | specs: [ 7 | path.resolve(__dirname, '../wwwroot/e2e/**/**.e2e-spec.ts'), 8 | path.resolve(__dirname, '../wwwroot/e2e/**/*.e2e-spec.ts') 9 | ], 10 | exclude: [], 11 | framework: 'jasmine2', 12 | allScriptsTimeout: 110000, 13 | jasmineNodeOpts: { 14 | showTiming: true, 15 | showColors: true, 16 | isVerbose: false, 17 | includeStackTrace: false, 18 | defaultTimeoutInterval: 400000 19 | }, 20 | directConnect: true, 21 | capabilities: { 22 | 'browserName': 'chrome', 23 | 'chromeOptions': { 24 | 'args': ['show-fps-counter=true'] 25 | } 26 | }, 27 | useAllAngular2AppRoots: true 28 | }; -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/test.js: -------------------------------------------------------------------------------- 1 | Error.stackTraceLimit = Infinity; 2 | 3 | require('core-js/es6'); 4 | require('core-js/es7/reflect'); 5 | 6 | require('ts-helpers'); 7 | 8 | require('zone.js/dist/zone'); 9 | require('zone.js/dist/long-stack-trace-zone'); 10 | require('zone.js/dist/proxy'); 11 | require('zone.js/dist/sync-test'); 12 | require('zone.js/dist/jasmine-patch'); 13 | require('zone.js/dist/async-test'); 14 | require('zone.js/dist/fake-async-test'); 15 | 16 | require('rxjs/Rx'); 17 | 18 | var testing = require('@angular/core/testing'); 19 | var browser = require('@angular/platform-browser-dynamic/testing'); 20 | 21 | testing.TestBed.initTestEnvironment( 22 | browser.BrowserDynamicTestingModule, 23 | browser.platformBrowserDynamicTesting() 24 | ); 25 | 26 | var testContext = require.context('../wwwroot/src', true, /\.spec\.ts/); 27 | 28 | function requireAll(requireContext) { 29 | return requireContext.keys().map(requireContext); 30 | } 31 | 32 | var modules = requireAll(testContext); -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/webpack.common.js: -------------------------------------------------------------------------------- 1 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 2 | const path = require('path'); 3 | const appRoot = path.resolve(__dirname, '../wwwroot/src/app'); 4 | 5 | module.exports = { 6 | devtool: 'source-map', 7 | resolve: { 8 | extensions: ['', '.ts', '.js'], 9 | root: '../wwwroot/src' 10 | }, 11 | context: path.resolve(__dirname, './'), 12 | module: { 13 | preLoaders: [ 14 | { 15 | test: /\.js$/, 16 | loader: 'source-map', 17 | exclude: [/node_modules/] 18 | }, { 19 | test: /\.ts$/, 20 | loader: 'tslint', 21 | exclude: [/node_modules/] 22 | } 23 | ], 24 | loaders: [ 25 | { 26 | test: /\.ts$/, 27 | exclude: [/\.(e2e\-spec|e2e)\.ts$/], 28 | loaders: ['angular2-template', 'awesome-typescript', 'angular2-router'] 29 | }, { 30 | include: appRoot, 31 | test: /\.css$/, 32 | loaders: ['raw', 'postcss'] 33 | }, { 34 | include: appRoot, 35 | test: /\.scss$|\.sass$/, 36 | loaders: ['raw', 'postcss', 'sass'] 37 | }, { 38 | exclude: appRoot, 39 | test: /\.css$/, 40 | loader: ExtractTextPlugin.extract({ fallbackLoader: 'style', loader: ['css', 'postcss'] }) 41 | }, { 42 | exclude: appRoot, 43 | test: /\.scss$|\.sass$/, 44 | loader: ExtractTextPlugin.extract({ fallbackLoader: 'style', loader: ['css', 'postcss', 'sass'] }) 45 | }, 46 | { test: /\.json$/, loader: 'json' }, 47 | { test: /\.(jpg|png|gif)$/, loader: 'url?limit=10000' }, 48 | { test: /\.html$/, loader: 'html' }, 49 | { test: /\.(otf|woff|ttf|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url?limit=10000' }, 50 | { test: /\.woff2(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url?limit=10000&mimetype=font/woff2' }, 51 | { test: /\.eot$/, loader: 'file' } 52 | ] 53 | }, 54 | node: { 55 | fs: 'empty', 56 | global: 'window', 57 | crypto: 'empty', 58 | process: true, 59 | module: false, 60 | clearImmediate: false, 61 | setImmediate: false 62 | } 63 | }; 64 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const merge = require('webpack-merge'); 3 | const atl = require('awesome-typescript-loader'); 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 | const path = require('path'); 6 | const common = require('./webpack.common'); 7 | 8 | module.exports = merge(common, { 9 | entry: { 10 | main: ['../wwwroot/src/main.ts'] 11 | }, 12 | output: { 13 | path: path.resolve(__dirname, '../wwwroot/dist'), 14 | filename: '[name].bundle.js', 15 | sourceMapFilename: '[name].map', 16 | publicPath: '/dist/' 17 | }, 18 | plugins: [ 19 | new ExtractTextPlugin('styles.css'), 20 | new atl.ForkCheckerPlugin(), 21 | new webpack.DllReferencePlugin({ 22 | context: __dirname, 23 | manifest: require('../wwwroot/dist/vendor-manifest.json') 24 | }), 25 | new webpack.DllReferencePlugin({ 26 | context: __dirname, 27 | manifest: require('../wwwroot/dist/polyfills-manifest.json') 28 | }) 29 | ] 30 | }); 31 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const merge = require('webpack-merge'); 3 | const atl = require('awesome-typescript-loader'); 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin'); 6 | const path = require('path'); 7 | const common = require('./webpack.common'); 8 | 9 | module.exports = merge(common, { 10 | entry: { 11 | main: ['../wwwroot/src/main.ts'] 12 | }, 13 | output: { 14 | path: path.resolve(__dirname, '../wwwroot/dist'), 15 | filename: '[name].bundle.js', 16 | sourceMapFilename: '[name].map', 17 | publicPath: '/dist/' 18 | }, 19 | plugins: [ 20 | new ExtractTextPlugin('styles.css'), 21 | new atl.ForkCheckerPlugin(), 22 | new webpack.DllReferencePlugin({ 23 | context: __dirname, 24 | manifest: require('../wwwroot/dist/vendor-manifest.json') 25 | }), 26 | new webpack.DllReferencePlugin({ 27 | context: __dirname, 28 | manifest: require('../wwwroot/dist/polyfills-manifest.json') 29 | }), 30 | new UglifyJsPlugin({ 31 | beautify: false, 32 | mangle: { screw_ie8: true, keep_fnames: true }, 33 | compress: { screw_ie8: true }, 34 | comments: false 35 | }) 36 | ], 37 | tslint: { 38 | emitErrors: true, 39 | failOnHint: true, 40 | resourcePath: path.resolve(__dirname, '../wwwroot/src') 41 | } 42 | }); 43 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/webpack.test.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const path = require('path'); 3 | 4 | module.exports = { 5 | devtool: 'inline-source-map', 6 | resolve: { 7 | extensions: ['', '.ts', '.js'], 8 | root: '../wwwroot/src', 9 | }, 10 | module: { 11 | preLoaders: [ 12 | { 13 | test: /\.js$/, 14 | loader: 'source-map', 15 | exclude: [/node_modules/] 16 | }, { 17 | test: /\.ts$/, 18 | loader: 'tslint', 19 | exclude: [/node_modules/] 20 | } 21 | ], 22 | loaders: [ 23 | { 24 | test: /\.ts$/, 25 | loader: 'awesome-typescript', 26 | query: { 27 | sourceMap: false, 28 | inlineSourceMap: true, 29 | compilerOptions: { 30 | removeComments: true 31 | } 32 | }, 33 | exclude: [/\.e2e\.ts$/] 34 | }, 35 | { test: /\.css$/, loaders: ['raw', 'css'] }, 36 | { test: /\.html$/, loader: 'raw' } 37 | ], 38 | postLoaders: [ 39 | { 40 | test: /\.(js|ts)$/, loader: 'istanbul-instrumenter-loader', 41 | include: path.resolve(__dirname, '../wwwroot/src'), 42 | exclude: [/\.(e2e\-spec|spec)\.ts$/, /node_modules/] 43 | } 44 | ] 45 | }, 46 | plugins: [ 47 | // https://github.com/angular/angular/issues/11580 48 | new webpack.ContextReplacementPlugin( 49 | /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 50 | path.resolve(__dirname, '../wwwroot/src') 51 | ) 52 | ] 53 | }; 54 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/config/webpack.vendor.js: -------------------------------------------------------------------------------- 1 | const webpack = require('webpack'); 2 | const merge = require('webpack-merge'); 3 | const atl = require('awesome-typescript-loader'); 4 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 5 | const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin'); 6 | const path = require('path'); 7 | const common = require('./webpack.common'); 8 | 9 | module.exports = merge(common, { 10 | entry: { 11 | polyfills: ['../wwwroot/src/polyfills.ts'], 12 | vendor: ['../wwwroot/src/vendor.ts'] 13 | }, 14 | output: { 15 | path: path.resolve(__dirname, '../wwwroot/dist'), 16 | filename: '[name].bundle.js', 17 | sourceMapFilename: '[name].map', 18 | publicPath: '/dist/', 19 | library: '[name]_lib' 20 | }, 21 | plugins: [ 22 | // https://github.com/angular/angular/issues/11580 23 | new webpack.ContextReplacementPlugin( 24 | /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 25 | path.resolve(__dirname, '../wwwroot/src') 26 | ), 27 | new ExtractTextPlugin('vendor.css'), 28 | new atl.ForkCheckerPlugin(), 29 | new webpack.DllPlugin({ 30 | path: path.resolve(__dirname, '../wwwroot/dist/[name]-manifest.json'), 31 | name: '[name]_lib' 32 | }), 33 | new UglifyJsPlugin({ 34 | beautify: false, 35 | mangle: { screw_ie8: true, keep_fnames: true }, 36 | compress: { screw_ie8: true, warnings: false }, 37 | comments: false 38 | }) 39 | ] 40 | }); 41 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./config/karma.conf.js'); -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "asp.net", 4 | "private": true, 5 | "scripts": { 6 | "start": "dotnet run server.urls=http://localhost:3000/", 7 | "test": "karma start", 8 | "protractor": "protractor", 9 | "e2e:live": "npm run e2e -- --elementExplorer", 10 | "e2e": "npm run protractor", 11 | "pree2e": "npm run webdriver:update -- --standalone", 12 | "webdriver-manager": "webdriver-manager", 13 | "webdriver:start": "npm run webdriver-manager start", 14 | "webdriver:update": "npm run webdriver-manager update", 15 | "tslint": "tslint", 16 | "lint": "tslint \"wwwroot/src/**/*.ts\"", 17 | "build": "webpack --config config/webpack.vendor.js && webpack --config webpack.config.js", 18 | "build:vendor": "webpack --config config/webpack.vendor.js", 19 | "build:dev": "webpack --config config/webpack.dev.js", 20 | "build:prod": "webpack --config config/webpack.prod.js", 21 | "webpack": "webpack", 22 | "rimraf": "rimraf", 23 | "clean:dist": "npm run rimraf -- wwwroot/dist", 24 | "rebuild-sass": "npm rebuild node-sass" 25 | }, 26 | "dependencies": { 27 | "@angular/common": "2.1.0", 28 | "@angular/compiler": "2.1.0", 29 | "@angular/core": "2.1.0", 30 | "@angular/forms": "2.1.0", 31 | "@angular/http": "2.1.0", 32 | "@angular/platform-browser": "2.1.0", 33 | "@angular/platform-browser-dynamic": "2.1.0", 34 | "@angular/platform-server": "2.1.0", 35 | "@angular/router": "3.1.0", 36 | "angular2-platform-node": "2.1.0-rc.1", 37 | "angular2-universal": "2.1.0-rc.1", 38 | "angular2-universal-polyfills": "2.1.0-rc.1", 39 | "aspnet-prerendering": "^1.0.6", 40 | "aspnet-webpack": "^1.0.11", 41 | "bootstrap": "^3.3.7", 42 | "core-js": "^2.4.1", 43 | "isomorphic-fetch": "^2.2.1", 44 | "ng2-bootstrap": "^1.1.14", 45 | "reflect-metadata": "^0.1.8", 46 | "rxjs": "5.0.0-beta.12", 47 | "zone.js": "^0.6.25" 48 | }, 49 | "devDependencies": { 50 | "@types/jasmine": "^2.2.34", 51 | "@types/karma": "^0.13.33", 52 | "@types/node": "^6.0.38", 53 | "@types/protractor": "^1.5.20", 54 | "@types/selenium-webdriver": "2.44.29", 55 | "@types/source-map": "^0.1.27", 56 | "@types/uglify-js": "^2.0.27", 57 | "@types/webpack": "^1.12.34", 58 | "angular2-router-loader": "^0.3.3", 59 | "angular2-template-loader": "^0.5.0", 60 | "awesome-typescript-loader": "^2.2.1", 61 | "codelyzer": "~0.0.28", 62 | "css": "^2.2.1", 63 | "css-loader": "^0.25.0", 64 | "extract-text-webpack-plugin": "2.0.0-beta.4", 65 | "file-loader": "^0.9.0", 66 | "html-loader": "^0.4.4", 67 | "istanbul-instrumenter-loader": "^0.2.0", 68 | "json-loader": "^0.5.4", 69 | "karma": "^1.2.0", 70 | "karma-chrome-launcher": "^2.0.0 ", 71 | "karma-coverage": "^1.1.1", 72 | "karma-jasmine": "^1.0.2", 73 | "karma-mocha-reporter": "^2.0.0", 74 | "karma-phantomjs-launcher": "^1.0.2", 75 | "karma-remap-coverage": "^0.1.1", 76 | "karma-sourcemap-loader": "^0.3.7", 77 | "karma-webpack": "1.8.0", 78 | "node-sass": "3.9.3", 79 | "parse5": "^2.2.2", 80 | "postcss-loader": "^0.13.0", 81 | "preboot": "^4.5.2", 82 | "protractor": "^3.2.2", 83 | "raw-loader": "0.5.1", 84 | "rimraf": "^2.5.2", 85 | "sass-loader": "4.0.2", 86 | "source-map-loader": "^0.1.5", 87 | "style-loader": "^0.13.1", 88 | "ts-helpers": "1.1.1", 89 | "ts-node": "^1.3.0", 90 | "tslint": "3.15.1", 91 | "tslint-loader": "^2.1.3", 92 | "typescript": "2.0.3", 93 | "url-loader": "^0.5.7", 94 | "webpack": "2.1.0-beta.22", 95 | "webpack-dev-middleware": "^1.6.1", 96 | "webpack-dev-server": "^2.1.0-beta.2", 97 | "webpack-externals-plugin": "^1.0.0", 98 | "webpack-hot-middleware": "^2.10.0", 99 | "webpack-md5-hash": "^0.0.5", 100 | "webpack-merge": "^0.14.1" 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.App": { 4 | "version": "1.0.1", 5 | "type": "platform" 6 | }, 7 | "Microsoft.AspNetCore.Diagnostics": "1.0.0", 8 | "Microsoft.AspNetCore.Mvc": "1.0.1", 9 | "Microsoft.AspNetCore.Razor.Tools": { 10 | "version": "1.0.0-preview2-final", 11 | "type": "build" 12 | }, 13 | "Microsoft.AspNetCore.Routing": "1.0.1", 14 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 15 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.1", 16 | "Microsoft.AspNetCore.StaticFiles": "1.0.0", 17 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 18 | "Microsoft.Extensions.Configuration.Json": "1.0.0", 19 | "Microsoft.Extensions.Logging": "1.0.0", 20 | "Microsoft.Extensions.Logging.Console": "1.0.0", 21 | "Microsoft.Extensions.Logging.Debug": "1.0.0", 22 | "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", 23 | "Microsoft.AspNetCore.AngularServices": "1.0.0-*", 24 | "Microsoft.Extensions.Configuration.CommandLine": "1.0.0"<% if (swagger) {%>, 25 | "Swashbuckle": "6.0.0-beta902"<% } %> 26 | }, 27 | 28 | "tools": { 29 | "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final", 30 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" 31 | }, 32 | 33 | "frameworks": { 34 | "netcoreapp1.0": { 35 | "imports": [ 36 | "dotnet5.6", 37 | "portable-net45+win8" 38 | ] 39 | } 40 | }, 41 | 42 | "buildOptions": { 43 | "emitEntryPoint": true, 44 | "preserveCompilationContext": true, 45 | "debugType": "portable", 46 | "compile": { 47 | "exclude": [ 48 | "node_modules" 49 | ] 50 | } 51 | }, 52 | 53 | "runtimeOptions": { 54 | "configProperties": { 55 | "System.GC.Server": true 56 | } 57 | }, 58 | 59 | "publishOptions": { 60 | "include": [ 61 | "wwwroot", 62 | "**/*.cshtml", 63 | "appsettings.json", 64 | "web.config" 65 | ], 66 | "exclude": [ 67 | "wwwroot/src", 68 | "wwwroot/e2e" 69 | ] 70 | }, 71 | 72 | "scripts": { 73 | "prepublish": [ "npm install", "npm run rebuild-sass", "npm run build" ], 74 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/protractor.conf.js: -------------------------------------------------------------------------------- 1 | exports.config = require('./config/protractor.conf.js').config; -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "moduleResolution": "node", 4 | "target": "es5", 5 | "sourceMap": true, 6 | "experimentalDecorators": true, 7 | "emitDecoratorMetadata": true, 8 | "skipDefaultLibCheck": true, 9 | "lib": [ "es6", "dom" ], 10 | "typeRoots": [ 11 | "./node_modules/@types" 12 | ] 13 | }, 14 | "exclude": [ "bin", "node_modules" ], 15 | "awesomeTypescriptLoaderOptions": { 16 | "forkChecker": true, 17 | "useWebpackText": true 18 | }, 19 | "compileOnSave": false, 20 | "buildOnSave": false, 21 | "atom": { 22 | "rewriteTsconfig": false 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "class-name": true, 7 | "comment-format": [ 8 | true, 9 | "check-space" 10 | ], 11 | "curly": true, 12 | "eofline": true, 13 | "forin": true, 14 | "indent": [ 15 | true, 16 | "spaces" 17 | ], 18 | "label-position": true, 19 | "label-undefined": true, 20 | "max-line-length": [ 21 | true, 22 | 140 23 | ], 24 | "member-access": false, 25 | "member-ordering": [ 26 | true, 27 | "static-before-instance", 28 | "variables-before-functions" 29 | ], 30 | "no-arg": true, 31 | "no-bitwise": true, 32 | "no-console": [ 33 | true, 34 | "debug", 35 | "info", 36 | "time", 37 | "timeEnd", 38 | "trace" 39 | ], 40 | "no-construct": true, 41 | "no-debugger": true, 42 | "no-duplicate-key": true, 43 | "no-duplicate-variable": true, 44 | "no-empty": false, 45 | "no-eval": true, 46 | "no-inferrable-types": true, 47 | "no-shadowed-variable": true, 48 | "no-string-literal": false, 49 | "no-switch-case-fall-through": true, 50 | "no-trailing-whitespace": true, 51 | "no-unused-expression": true, 52 | "no-unused-variable": true, 53 | "no-unreachable": true, 54 | "no-use-before-declare": true, 55 | "no-var-keyword": true, 56 | "object-literal-sort-keys": false, 57 | "one-line": [ 58 | true, 59 | "check-open-brace", 60 | "check-catch", 61 | "check-else", 62 | "check-whitespace" 63 | ], 64 | "quotemark": [ 65 | true, 66 | "single" 67 | ], 68 | "radix": true, 69 | "semicolon": [ 70 | "always" 71 | ], 72 | "triple-equals": [ 73 | true, 74 | "allow-null-check" 75 | ], 76 | "typedef-whitespace": [ 77 | true, 78 | { 79 | "call-signature": "nospace", 80 | "index-signature": "nospace", 81 | "parameter": "nospace", 82 | "property-declaration": "nospace", 83 | "variable-declaration": "nospace" 84 | } 85 | ], 86 | "variable-name": false, 87 | "whitespace": [ 88 | true, 89 | "check-branch", 90 | "check-decl", 91 | "check-operator", 92 | "check-separator", 93 | "check-type" 94 | ], 95 | 96 | "directive-selector-prefix": [ true, "app" ], 97 | "component-selector-prefix": [ true, "app" ], 98 | "directive-selector-name": [ true, "camelCase" ], 99 | "component-selector-name": [ true, "kebab-case" ], 100 | "directive-selector-type": [ true, "attribute" ], 101 | "component-selector-type": [ true, "element" ], 102 | "use-input-property-decorator": true, 103 | "use-output-property-decorator": true, 104 | "use-host-property-decorator": true, 105 | "no-input-rename": true, 106 | "no-output-rename": true, 107 | "use-life-cycle-interface": true, 108 | "use-pipe-transform-interface": true, 109 | "component-class-suffix": true, 110 | "directive-class-suffix": true 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/webpack.config.js: -------------------------------------------------------------------------------- 1 | switch (process.env.ASPNETCORE_ENVIRONMENT) { 2 | case 'Development': 3 | module.exports = require('./config/webpack.dev'); 4 | break; 5 | case 'Production': 6 | default: 7 | module.exports = require('./config/webpack.prod'); 8 | break; 9 | } -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/e2e/home.component.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | describe('AppComponent', () => { 2 | 3 | beforeEach(() => { 4 | browser.get('/'); 5 | }); 6 | 7 | it('should have a title', () => { 8 | let subject = browser.getTitle(); 9 | expect(subject).toEqual('Home Page - <%= appName %>'); 10 | }); 11 | 12 | it('should have header', () => { 13 | let subject = element(by.css('h1')).isPresent(); 14 | expect(subject).toEqual(true); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/3615719b1412292f47214fd85ae8adffde430ef8/generators/app/templates/advanced/src/WebApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/about/about-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { AboutComponent } from './about.component'; 5 | 6 | const routes: Routes = [ 7 | { path: '', component: AboutComponent } 8 | ]; 9 | 10 | @NgModule({ 11 | imports: [ 12 | RouterModule.forChild(routes) 13 | ], 14 | exports: [RouterModule] 15 | }) 16 | export class AboutRoutingModule { } 17 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/about/about.component.html: -------------------------------------------------------------------------------- 1 | 

About

2 |

This is a lazy loaded module.

-------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './about.component.html' 5 | }) 6 | export class AboutComponent { } 7 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/about/about.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { Ng2BootstrapModule } from 'ng2-bootstrap'; 4 | 5 | import { AboutRoutingModule } from './about-routing.module'; 6 | import { AboutComponent } from './about.component'; 7 | 8 | @NgModule({ 9 | declarations: [ 10 | AboutComponent 11 | ], 12 | imports: [ 13 | CommonModule, 14 | Ng2BootstrapModule, 15 | AboutRoutingModule 16 | ], 17 | providers: [ 18 | ] 19 | }) 20 | export class AboutModule { } 21 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { HomeComponent } from './home'; 5 | import { CharacterListComponent } from './characters'; 6 | 7 | const routes: Routes = [ 8 | { path: '', redirectTo: 'home', pathMatch: 'full' }, 9 | { path: 'home', component: HomeComponent }, 10 | { path: 'characters', component: CharacterListComponent }, 11 | { path: 'about', loadChildren: './about/about.module#AboutModule' }, 12 | { path: '**', redirectTo: 'home' } 13 | ]; 14 | 15 | @NgModule({ 16 | imports: [ 17 | RouterModule.forRoot(routes) 18 | ], 19 | exports: [RouterModule] 20 | }) 21 | export class AppRoutingModule { } 22 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |  29 | 30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html' 6 | }) 7 | export class AppComponent { } 8 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { UniversalModule } from 'angular2-universal'; 3 | import { Ng2BootstrapModule } from 'ng2-bootstrap'; 4 | 5 | import { AppRoutingModule } from './app-routing.module'; 6 | import { AppComponent } from './app.component'; 7 | import { HomeComponent } from './home'; 8 | import { CharacterListComponent, CharacterService } from './characters'; 9 | 10 | import '../styles.scss'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent, 15 | HomeComponent, 16 | CharacterListComponent 17 | ], 18 | imports: [ 19 | UniversalModule, 20 | Ng2BootstrapModule, 21 | AppRoutingModule 22 | ], 23 | providers: [ 24 | CharacterService 25 | ], 26 | bootstrap: [AppComponent] 27 | }) 28 | export class AppModule { } 29 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/characters/character-list.component.html: -------------------------------------------------------------------------------- 1 | 

Characters

2 | 5 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/characters/character-list.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { CharacterService } from './shared/character.service'; 4 | 5 | @Component({ 6 | templateUrl: 'character-list.component.html' 7 | }) 8 | export class CharacterListComponent implements OnInit { 9 | characters: string[]; 10 | 11 | constructor(private characterService: CharacterService) { } 12 | 13 | ngOnInit() { 14 | this.characterService.getCharacters() 15 | .subscribe(characters => this.characters = characters); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/characters/index.ts: -------------------------------------------------------------------------------- 1 | export * from './character-list.component'; 2 | export * from './shared/character.service'; 3 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/characters/shared/character.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http } from '@angular/http'; 3 | 4 | @Injectable() 5 | export class CharacterService { 6 | 7 | constructor(private http: Http) { } 8 | 9 | getCharacters() { 10 | return this.http.get('api/characters') 11 | .map(response => response.json()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 
2 |
3 |

Home

4 |

{{message}}

5 |

GitHub

6 |
7 |
-------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/home/home.component.scss: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | inject, 3 | TestBed 4 | } from '@angular/core/testing'; 5 | 6 | import { HomeComponent } from './home.component'; 7 | 8 | describe('HomeComponent', () => { 9 | beforeEach(() => TestBed.configureTestingModule({ 10 | providers: [ 11 | HomeComponent 12 | ] 13 | })); 14 | 15 | it('should have a message', inject([HomeComponent], (home: HomeComponent) => { 16 | expect(home.message).toEqual('Have fun working on <%= appName %>!'); 17 | })); 18 | }); 19 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | templateUrl: './home.component.html', 5 | styleUrls: ['./home.component.scss'] 6 | }) 7 | export class HomeComponent { 8 | message = 'Have fun working on <%= appName %>!'; 9 | } 10 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/home/index.ts: -------------------------------------------------------------------------------- 1 | export * from './home.component'; 2 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/app/shared/index.ts: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/main.ts: -------------------------------------------------------------------------------- 1 | import 'angular2-universal-polyfills/browser'; 2 | import { platformUniversalDynamic } from 'angular2-universal'; 3 | import { enableProdMode } from '@angular/core'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | 7 | const platform = platformUniversalDynamic(); 8 | 9 | if (module['hot']) { 10 | module['hot'].accept(); 11 | module['hot'].dispose(() => { platform.destroy(); }); 12 | } else { 13 | enableProdMode(); 14 | } 15 | 16 | const bootApplication = () => { platform.bootstrapModule(AppModule); }; 17 | if (document.readyState === 'complete') { 18 | bootApplication(); 19 | } else { 20 | document.addEventListener('DOMContentLoaded', bootApplication); 21 | } 22 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es6/symbol'; 2 | import 'core-js/es6/object'; 3 | import 'core-js/es6/function'; 4 | import 'core-js/es6/parse-int'; 5 | import 'core-js/es6/parse-float'; 6 | import 'core-js/es6/number'; 7 | import 'core-js/es6/math'; 8 | import 'core-js/es6/string'; 9 | import 'core-js/es6/date'; 10 | import 'core-js/es6/array'; 11 | import 'core-js/es6/regexp'; 12 | import 'core-js/es6/map'; 13 | import 'core-js/es6/set'; 14 | import 'core-js/es6/weak-map'; 15 | import 'core-js/es6/weak-set'; 16 | import 'core-js/es6/typed'; 17 | import 'core-js/es6/reflect'; 18 | 19 | import 'core-js/es7/reflect'; 20 | import 'zone.js/dist/zone'; 21 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/server.ts: -------------------------------------------------------------------------------- 1 | import 'angular2-universal-polyfills'; 2 | import { enableProdMode } from '@angular/core'; 3 | import { platformNodeDynamic } from 'angular2-universal'; 4 | 5 | import { AppModule } from './app/app.module'; 6 | 7 | enableProdMode(); 8 | 9 | const platform = platformNodeDynamic(); 10 | 11 | declare var Zone: any; 12 | 13 | export default function (params: any): Promise<{ html: string, globals?: any }> { 14 | return new Promise((resolve, reject) => { 15 | const requestZone = Zone.current.fork({ 16 | name: 'angular-universal request', 17 | properties: { 18 | baseUrl: '/', 19 | requestUrl: params.url, 20 | originUrl: params.origin, 21 | preboot: false, 22 | document: '' 23 | }, 24 | onHandleError: (parentZone, currentZone, targetZone, error) => { 25 | reject(error); 26 | return true; 27 | } 28 | }); 29 | return requestZone.run(() => platform.serializeModule(AppModule)).then(html => { 30 | resolve({ html: html }); 31 | }, reject); 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/styles.scss: -------------------------------------------------------------------------------- 1 | body { 2 | h1 { 3 | color: red; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /generators/app/templates/advanced/src/WebApp/wwwroot/src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import '@angular/platform-browser'; 3 | import '@angular/platform-browser-dynamic'; 4 | import '@angular/core'; 5 | import '@angular/common'; 6 | import '@angular/http'; 7 | import '@angular/router'; 8 | import '@angular/compiler'; 9 | import '@angular/platform-server'; 10 | 11 | // Angular Universal 12 | import 'angular2-universal'; 13 | import 'angular2-universal-polyfills'; 14 | 15 | // RxJS 16 | import 'rxjs'; 17 | 18 | // Other vendors 19 | import 'ng2-bootstrap'; 20 | import 'bootstrap/dist/css/bootstrap.css'; 21 | -------------------------------------------------------------------------------- /generators/app/templates/basic/WebApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25123.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7200B5EC-BD79-4C0F-BA39-F2A45B36AC17}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7361E831-AC07-4A8B-B70B-944F98050F50}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "<%= safeName %>", "src\<%= safeName %>\<%= safeName %>.xproj", "{B1D72989-8F5E-4F16-8D1D-B5D6DA215627}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {B1D72989-8F5E-4F16-8D1D-B5D6DA215627}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {B1D72989-8F5E-4F16-8D1D-B5D6DA215627}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {B1D72989-8F5E-4F16-8D1D-B5D6DA215627}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {B1D72989-8F5E-4F16-8D1D-B5D6DA215627}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {B1D72989-8F5E-4F16-8D1D-B5D6DA215627} = {7200B5EC-BD79-4C0F-BA39-F2A45B36AC17} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /generators/app/templates/basic/global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003121" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /generators/app/templates/basic/ignorefile: -------------------------------------------------------------------------------- 1 | typings/ 2 | 3 | ## Ignore Visual Studio temporary files, build results, and 4 | ## files generated by popular Visual Studio add-ons. 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | 26 | # Visual Studio 2015 cache/options directory 27 | .vs/ 28 | # Uncomment if you have tasks that create the project's static files in wwwroot 29 | #wwwroot/ 30 | 31 | # MSTest test Results 32 | [Tt]est[Rr]esult*/ 33 | [Bb]uild[Ll]og.* 34 | 35 | # NUNIT 36 | *.VisualState.xml 37 | TestResult.xml 38 | 39 | # Build Results of an ATL Project 40 | [Dd]ebugPS/ 41 | [Rr]eleasePS/ 42 | dlldata.c 43 | 44 | # DNX 45 | project.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | # TODO: Comment the next line if you want to checkin your web deploy settings 143 | # but database connection strings (with potential passwords) will be unencrypted 144 | *.pubxml 145 | *.publishproj 146 | 147 | # NuGet Packages 148 | *.nupkg 149 | # The packages folder can be ignored because of Package Restore 150 | **/packages/* 151 | # except build/, which is used as an MSBuild target. 152 | !**/packages/build/ 153 | # Uncomment if necessary however generally it will be regenerated when needed 154 | #!**/packages/repositories.config 155 | # NuGet v3's project.json files produces more ignoreable files 156 | *.nuget.props 157 | *.nuget.targets 158 | 159 | # Microsoft Azure Build Output 160 | csx/ 161 | *.build.csdef 162 | 163 | # Microsoft Azure Emulator 164 | ecf/ 165 | rcf/ 166 | 167 | # Microsoft Azure ApplicationInsights config file 168 | ApplicationInsights.config 169 | 170 | # Windows Store app package directory 171 | AppPackages/ 172 | BundleArtifacts/ 173 | 174 | # Visual Studio cache files 175 | # files ending in .cache can be ignored 176 | *.[Cc]ache 177 | # but keep track of directories ending in .cache 178 | !*.[Cc]ache/ 179 | 180 | # Others 181 | ClientBin/ 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # Paket dependency manager 235 | .paket/paket.exe 236 | 237 | # FAKE - F# Make 238 | .fake/ 239 | 240 | 241 | ### VisualStudioCode ### 242 | .vscode/* 243 | !.vscode/settings.json 244 | !.vscode/tasks.json 245 | !.vscode/launch.json 246 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": ".NET Core Launch (web)", 6 | "type": "coreclr", 7 | "request": "launch", 8 | "preLaunchTask": "build", 9 | "program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/<%= safeName %>.dll", 10 | "args": [], 11 | "cwd": "${workspaceRoot}", 12 | "stopAtEntry": false, 13 | "launchBrowser": { 14 | "enabled": true, 15 | "args": "${auto-detect-url}", 16 | "windows": { 17 | "command": "cmd.exe", 18 | "args": "/C start ${auto-detect-url}" 19 | }, 20 | "osx": { 21 | "command": "open" 22 | }, 23 | "linux": { 24 | "command": "xdg-open" 25 | } 26 | }, 27 | "env": { 28 | "ASPNETCORE_ENVIRONMENT": "Development" 29 | } 30 | }, 31 | { 32 | "name": ".NET Core Attach", 33 | "type": "coreclr", 34 | "request": "attach", 35 | "processId": 0 36 | } 37 | ] 38 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.1.0", 3 | "command": "dotnet", 4 | "isShellCommand": true, 5 | "args": [], 6 | "tasks": [ 7 | { 8 | "taskName": "build", 9 | "args": [], 10 | "isBuildCommand": true, 11 | "problemMatcher": "$msCompile" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Api/CharactersController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace <%= safeName %>.Api 4 | { 5 | [Route("api/[controller]")] 6 | [Produces("application/json")] 7 | public class CharactersController : Controller 8 | { 9 | [HttpGet] 10 | [Produces(typeof(string[]))] 11 | public IActionResult Get() 12 | { 13 | return Ok(new[] { 14 | "Gollum", 15 | "Gandalf", 16 | "Legolas", 17 | "Aragorn", 18 | "Frodo Baggins", 19 | "Bilbo Baggins", 20 | "Saruman", 21 | "Gimli", 22 | "Galadriel" 23 | }); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace <%= safeName %>.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public IActionResult Index() 8 | { 9 | return View(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using System.IO; 4 | 5 | namespace <%= safeName %> 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | var host = new WebHostBuilder() 12 | .UseKestrel() 13 | .UseContentRoot(Directory.GetCurrentDirectory()) 14 | .UseIISIntegration() 15 | .UseStartup() 16 | .Build(); 17 | 18 | host.Run(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51092/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "<%= safeName %>": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000/", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.FileProviders; 6 | using Microsoft.Extensions.Logging;<% if (swagger) { %> 7 | using Swashbuckle.Swagger.Model;<% } %> 8 | using System.IO; 9 | 10 | namespace <%= safeName %> 11 | { 12 | public class Startup 13 | { 14 | public Startup(IHostingEnvironment env) 15 | { 16 | var builder = new ConfigurationBuilder() 17 | .SetBasePath(env.ContentRootPath) 18 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 19 | .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) 20 | .AddEnvironmentVariables(); 21 | Configuration = builder.Build(); 22 | } 23 | 24 | public IConfigurationRoot Configuration { get; } 25 | 26 | // This method gets called by the runtime. Use this method to add services to the container. 27 | public void ConfigureServices(IServiceCollection services) 28 | {<% if (swagger) { %> 29 | services.AddSwaggerGen(options => 30 | { 31 | options.SingleApiVersion(new Info 32 | { 33 | Title = "<%= appName %> API", 34 | Version = "v1" 35 | }); 36 | }); 37 | <% } %> 38 | // Add framework services. 39 | services.AddMvc(); 40 | } 41 | 42 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 43 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 44 | { 45 | loggerFactory.AddConsole(Configuration.GetSection("Logging")); 46 | loggerFactory.AddDebug(); 47 | <% if (swagger) { %> 48 | app.UseSwagger(); 49 | app.UseSwaggerUi(); 50 | <% } %> 51 | app.UseStaticFiles(); 52 | 53 | app.UseStaticFiles(new StaticFileOptions 54 | { 55 | FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath, "node_modules")), 56 | RequestPath = "/node_modules" 57 | }); 58 | 59 | app.UseMvc(routes => 60 | { 61 | routes.MapSpaFallbackRoute("spa-fallback", new { controller = "home", action = "index" }); 62 | }); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | <%= appName %> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | Loading... 22 | 23 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/WebApp.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | b1d72989-8f5e-4f16-8d1d-b5d6da215627 10 | <%= safeName %> 11 | .\obj 12 | .\bin\ 13 | v4.5.2 14 | 15 | 16 | 2.0 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0.0", 3 | "name": "asp.net", 4 | "private": true, 5 | "scripts": { 6 | "postinstall": "typings install", 7 | "typings": "typings" 8 | }, 9 | "dependencies": { 10 | "@angular/common": "2.0.0", 11 | "@angular/compiler": "2.0.0", 12 | "@angular/core": "2.0.0", 13 | "@angular/forms": "2.0.0", 14 | "@angular/http": "2.0.0", 15 | "@angular/platform-browser": "2.0.0", 16 | "@angular/platform-browser-dynamic": "2.0.0", 17 | "@angular/router": "3.0.0", 18 | "@angular/upgrade": "2.0.0", 19 | "systemjs": "0.19.27", 20 | "core-js": "^2.4.1", 21 | "reflect-metadata": "^0.1.3", 22 | "rxjs": "5.0.0-beta.12", 23 | "zone.js": "^0.6.23", 24 | "material-design-lite": "1.1.3" 25 | }, 26 | "devDependencies": { 27 | "typescript": "^2.0.2", 28 | "typings": "^1.0.4" 29 | } 30 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.App": { 4 | "version": "1.0.0", 5 | "type": "platform" 6 | }, 7 | "Microsoft.AspNetCore.Mvc": "1.0.0", 8 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 9 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 10 | "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", 11 | "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", 12 | "Microsoft.Extensions.Configuration.Json": "1.0.0", 13 | "Microsoft.Extensions.Logging": "1.0.0", 14 | "Microsoft.Extensions.Logging.Console": "1.0.0", 15 | "Microsoft.Extensions.Logging.Debug": "1.0.0", 16 | "Microsoft.AspNetCore.StaticFiles": "1.0.0", 17 | "Microsoft.AspNetCore.SpaServices": "1.0.0-beta-000007"<% if (swagger) {%>, 18 | "Swashbuckle": "6.0.0-beta901"<% } %> 19 | }, 20 | 21 | "tools": { 22 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" 23 | }, 24 | 25 | "frameworks": { 26 | "netcoreapp1.0": { 27 | "imports": [ 28 | "dotnet5.6", 29 | "portable-net45+win8" 30 | ] 31 | } 32 | }, 33 | 34 | "buildOptions": { 35 | "emitEntryPoint": true, 36 | "preserveCompilationContext": true, 37 | "debugType": "portable" 38 | }, 39 | 40 | "runtimeOptions": { 41 | "configProperties": { 42 | "System.GC.Server": true 43 | } 44 | }, 45 | 46 | "publishOptions": { 47 | "include": [ 48 | "wwwroot", 49 | "Views", 50 | "Areas/**/Views", 51 | "appsettings.json", 52 | "web.config" 53 | ] 54 | }, 55 | 56 | "scripts": { 57 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 58 | } 59 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "target": "es5", 5 | "module": "commonjs", 6 | "moduleResolution": "node", 7 | "sourceMap": true, 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "removeComments": false, 11 | "noImplicitAny": false 12 | }, 13 | "exclude": [ 14 | "node_modules" 15 | ] 16 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "globalDependencies": { 3 | "core-js": "registry:dt/core-js#0.0.0+20160914114559", 4 | "node": "registry:dt/node#6.0.0+20160921192128" 5 | } 6 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | moduleId: module.id, 5 | template: ` 6 |
7 |
8 |

About

9 |
10 |
11 | You're ready to start working on <%= appName %> <3 12 |
13 |
14 | ` 15 | }) 16 | export class AboutComponent { } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | Home 5 | About 6 |
7 |
8 |
9 |
10 | 11 |
-------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | moduleId: module.id, 5 | selector: 'app-root', 6 | templateUrl: 'app.component.html' 7 | }) 8 | export class AppComponent { } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { BrowserModule } from '@angular/platform-browser'; 3 | import { FormsModule } from '@angular/forms'; 4 | import { HttpModule } from '@angular/http'; 5 | 6 | import { AppComponent } from './app.component'; 7 | import { HomeComponent } from './home/home.component'; 8 | import { AboutComponent } from './about/about.component'; 9 | import { routing, appRoutingProviders } from './app.routing'; 10 | import { CharacterService } from './shared/character.service'; 11 | 12 | @NgModule({ 13 | imports: [ 14 | BrowserModule, 15 | FormsModule, 16 | HttpModule, 17 | routing 18 | ], 19 | providers: [ 20 | appRoutingProviders, 21 | CharacterService 22 | ], 23 | declarations: [ 24 | AppComponent, 25 | HomeComponent, 26 | AboutComponent 27 | ], 28 | bootstrap: [AppComponent] 29 | }) 30 | export class AppModule { } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/app.routing.ts: -------------------------------------------------------------------------------- 1 | import { Routes, RouterModule } from '@angular/router'; 2 | 3 | import { HomeComponent } from './home/home.component'; 4 | import { AboutComponent } from './about/about.component'; 5 | 6 | const appRoutes: Routes = [ 7 | { path: '', component: HomeComponent }, 8 | { path: 'about', component: AboutComponent } 9 | ]; 10 | 11 | export const appRoutingProviders: any[] = [ 12 | 13 | ]; 14 | 15 | export const routing = RouterModule.forRoot(appRoutes); -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Home

4 |
5 |
6 |
7 | 8 | person 9 | {{character}} 10 | 11 | star 12 |
13 |
14 |
-------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { CharacterService } from '../shared/character.service'; 4 | 5 | @Component({ 6 | moduleId: module.id, 7 | templateUrl: 'home.component.html' 8 | }) 9 | export class HomeComponent implements OnInit { 10 | characters: string[]; 11 | 12 | constructor(private characterService: CharacterService) { } 13 | 14 | ngOnInit() { 15 | this.characterService.getCharacters() 16 | .subscribe(characters => this.characters = characters); 17 | } 18 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/main.ts: -------------------------------------------------------------------------------- 1 | //import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app.module'; 5 | 6 | // Extend Observable through the app 7 | import 'rxjs/Rx'; 8 | 9 | //enableProdMode(); 10 | 11 | 12 | platformBrowserDynamic().bootstrapModule(AppModule); -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/app/shared/character.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Http, Response } from '@angular/http'; 3 | 4 | @Injectable() 5 | export class CharacterService { 6 | 7 | constructor(private http: Http) { } 8 | 9 | getCharacters() { 10 | return this.http.get('api/characters') 11 | .map(response => response.json()); 12 | } 13 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/styles.css: -------------------------------------------------------------------------------- 1 | .mdl-tabs__tab-bar a { 2 | color: rgba(255, 255, 255, 0.8); 3 | } 4 | 5 | .mdl-tabs__tab-bar a.is-active { 6 | border-bottom: 2px solid #ff4081; 7 | color: #fff; 8 | } 9 | 10 | .mdl-tabs__tab-bar { 11 | display: inline; 12 | } 13 | 14 | header { 15 | background-color: #3f51b5; 16 | overflow: auto; 17 | } 18 | 19 | main { 20 | margin: 2em; 21 | } 22 | 23 | .card-wide { 24 | width: 100%; 25 | max-width: 500px; 26 | } 27 | 28 | .card-wide .mdl-card__title { 29 | background-color: #3f51b5; 30 | color: #fff; 31 | } 32 | 33 | .mdl-card { 34 | min-height: 0; 35 | } 36 | 37 | .mdl-card__supporting-text { 38 | color: rgba(0, 0, 0, 0.87); 39 | } -------------------------------------------------------------------------------- /generators/app/templates/basic/src/WebApp/wwwroot/systemjs.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * System configuration for Angular 2 3 | * Adjust as necessary for your application needs. 4 | */ 5 | (function (global) { 6 | System.config({ 7 | paths: { 8 | // paths serve as alias 9 | 'npm:': 'node_modules/' 10 | }, 11 | // map tells the System loader where to look for things 12 | map: { 13 | // our app is within the app folder 14 | app: 'app', 15 | // angular bundles 16 | '@angular/core': 'npm:@angular/core/bundles/core.umd.js', 17 | '@angular/common': 'npm:@angular/common/bundles/common.umd.js', 18 | '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', 19 | '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', 20 | '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', 21 | '@angular/http': 'npm:@angular/http/bundles/http.umd.js', 22 | '@angular/router': 'npm:@angular/router/bundles/router.umd.js', 23 | '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', 24 | // other libraries 25 | 'rxjs': 'npm:rxjs' 26 | }, 27 | // packages tells the System loader how to load when no filename and/or no extension 28 | packages: { 29 | app: { 30 | main: './main.js', 31 | defaultExtension: 'js' 32 | }, 33 | rxjs: { 34 | defaultExtension: 'js' 35 | } 36 | } 37 | }); 38 | })(this); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-aspnetcore-angular2", 3 | "version": "3.0.0", 4 | "description": "Generate a Visual Studio/Code project for ASP.NET Core, Angular 2, and TypeScript", 5 | "homepage": "https://github.com/sgbj/generator-aspnetcore-angular2", 6 | "author": { 7 | "name": "sgbj", 8 | "email": "", 9 | "url": "https://github.com/sgbj" 10 | }, 11 | "files": [ 12 | "generators" 13 | ], 14 | "main": "generators\\index.js", 15 | "keywords": [ 16 | "yeoman-generator", 17 | "app", 18 | "visual studio", 19 | "dotnet", 20 | "aspnet", 21 | "aspnet core", 22 | "angular", 23 | "angular2", 24 | "typescript", 25 | "swagger", 26 | "swashbuckle", 27 | "webpack", 28 | "karma", 29 | "protractor", 30 | "universal" 31 | ], 32 | "dependencies": { 33 | "yeoman-generator": "^0.23.0", 34 | "chalk": "^1.0.0", 35 | "yosay": "^1.0.0" 36 | }, 37 | "repository": "git@github.com:sgbj/generator-aspnetcore-angular2.git", 38 | "license": "MIT" 39 | } 40 | -------------------------------------------------------------------------------- /screenshots/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/3615719b1412292f47214fd85ae8adffde430ef8/screenshots/about.png -------------------------------------------------------------------------------- /screenshots/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/3615719b1412292f47214fd85ae8adffde430ef8/screenshots/console.png -------------------------------------------------------------------------------- /screenshots/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sgbj/generator-aspnetcore-angular2/3615719b1412292f47214fd85ae8adffde430ef8/screenshots/home.png --------------------------------------------------------------------------------