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

Commit 6ebddb0

Browse files
author
Caleb Wells
committed
Rebuilding the base solution to better integrate Angular CLI and Dotnet Runtime in Visual Studio.
1 parent c4c3f35 commit 6ebddb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+723
-540
lines changed

.angular-cli.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"project": {
4+
"name": "ng2-cli"
5+
},
6+
"apps": [
7+
{
8+
"root": "src",
9+
"outDir": "dist",
10+
"assets": [
11+
"assets",
12+
"favicon.ico"
13+
],
14+
"index": "index.html",
15+
"main": "main.ts",
16+
"polyfills": "polyfills.ts",
17+
"test": "test.ts",
18+
"tsconfig": "tsconfig.app.json",
19+
"testTsconfig": "tsconfig.spec.json",
20+
"prefix": "ng2cli",
21+
"styles": [
22+
"styles.css"
23+
],
24+
"scripts": [],
25+
"environmentSource": "environments/environment.ts",
26+
"environments": {
27+
"dev": "environments/environment.ts",
28+
"prod": "environments/environment.prod.ts"
29+
}
30+
}
31+
],
32+
"e2e": {
33+
"protractor": {
34+
"config": "./protractor.conf.js"
35+
}
36+
},
37+
"lint": [
38+
{
39+
"project": "src/tsconfig.app.json"
40+
},
41+
{
42+
"project": "src/tsconfig.spec.json"
43+
},
44+
{
45+
"project": "e2e/tsconfig.e2e.json"
46+
}
47+
],
48+
"test": {
49+
"karma": {
50+
"config": "./karma.conf.js"
51+
}
52+
},
53+
"defaults": {
54+
"styleExt": "css",
55+
"component": {}
56+
}
57+
}

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.gitignore

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
## Ignore compiled JavaScript
2-
*.js
3-
*.js.map
4-
!webpack*.js
5-
6-
## Ignore Visual Studio temporary files, build results, and
1+
## Ignore Visual Studio temporary files, build results, and
72
## files generated by popular Visual Studio add-ons.
83

94
# User-specific files
@@ -25,14 +20,12 @@ x86/
2520
bld/
2621
[Bb]in/
2722
[Oo]bj/
23+
[Ll]og/
2824

2925
# Visual Studio 2015 cache/options directory
3026
.vs/
31-
src/Properties/PublishProfiles
32-
src/wwwroot/*
33-
!src/wwwroot*
34-
!src/wwwroot/favicon.ico
35-
src/wwwroot/dist/
27+
Properties/out-tsc/
28+
wwwroot/
3629

3730
# MSTest test Results
3831
[Tt]est[Rr]esult*/
@@ -87,6 +80,8 @@ ipch/
8780
*.opensdf
8881
*.sdf
8982
*.cachefile
83+
*.VC.db
84+
*.VC.VC.opendb
9085

9186
# Visual Studio profiler
9287
*.psess
@@ -145,11 +140,16 @@ publish/
145140
# Publish Web Output
146141
*.[Pp]ublish.xml
147142
*.azurePubxml
148-
# TODO: Comment the next line if you want to checkin your web deploy settings
143+
# TODO: Comment the next line if you want to checkin your web deploy settings
149144
# but database connection strings (with potential passwords) will be unencrypted
150145
*.pubxml
151146
*.publishproj
152147

148+
# Microsoft Azure Web App publish settings. Comment the next line if you want to
149+
# checkin your Azure Web App publish settings, but sensitive information contained
150+
# in these scripts will be unencrypted
151+
PublishScripts/
152+
153153
# NuGet Packages
154154
*.nupkg
155155
# The packages folder can be ignored because of Package Restore
@@ -170,12 +170,11 @@ csx/
170170
ecf/
171171
rcf/
172172

173-
# Microsoft Azure ApplicationInsights config file
174-
ApplicationInsights.config
175-
176-
# Windows Store app package directory
173+
# Windows Store app package directories and files
177174
AppPackages/
178175
BundleArtifacts/
176+
Package.StoreAssociation.xml
177+
_pkginfo.txt
179178

180179
# Visual Studio cache files
181180
# files ending in .cache can be ignored
@@ -194,6 +193,10 @@ ClientBin/
194193
node_modules/
195194
orleans.codegen.cs
196195

196+
# Since there are multiple workflows, uncomment next line to ignore bower_components
197+
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198+
#bower_components/
199+
197200
# RIA/Silverlight projects
198201
Generated_Code/
199202

@@ -239,6 +242,11 @@ _Pvt_Extensions
239242

240243
# Paket dependency manager
241244
.paket/paket.exe
245+
paket-files/
242246

243247
# FAKE - F# Make
244248
.fake/
249+
250+
# JetBrains Rider
251+
.idea/
252+
*.sln.iml

Angular2CLI.sln

Lines changed: 0 additions & 22 deletions
This file was deleted.

Program.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Hosting;
7+
8+
namespace angular2_cli_visualstudio
9+
{
10+
public class Program
11+
{
12+
public static void Main(string[] args)
13+
{
14+
var host = new WebHostBuilder()
15+
.UseKestrel()
16+
.UseContentRoot(Directory.GetCurrentDirectory())
17+
.UseIISIntegration()
18+
.UseStartup<Startup>()
19+
.Build();
20+
21+
host.Run();
22+
}
23+
}
24+
}
Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
1-
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:5999/",
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-
"Angular2CLI": {
19-
"commandName": "Project",
20-
"launchBrowser": true,
21-
"launchUrl": "http://localhost:5000",
22-
"environmentVariables": {
23-
"ASPNETCORE_ENVIRONMENT": "Development"
24-
}
25-
}
26-
}
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:53013/",
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+
"angular2-cli-visualstudio": {
19+
"commandName": "Project"
20+
}
21+
}
2722
}

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Ng2Cli
2+
3+
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.0.0.
4+
5+
## Development server
6+
7+
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8+
9+
## Code scaffolding
10+
11+
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive/pipe/service/class/module`.
12+
13+
## Build
14+
15+
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16+
17+
## Running unit tests
18+
19+
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20+
21+
## Running end-to-end tests
22+
23+
Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24+
Before running the tests make sure you are serving the app via `ng serve`.
25+
26+
## Further help
27+
28+
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

Startup.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Builder;
6+
using Microsoft.AspNetCore.Hosting;
7+
using Microsoft.AspNetCore.Http;
8+
using Microsoft.Extensions.DependencyInjection;
9+
using Microsoft.Extensions.Logging;
10+
11+
namespace angular2_cli_visualstudio
12+
{
13+
public class Startup
14+
{
15+
// This method gets called by the runtime. Use this method to add services to the container.
16+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
17+
public void ConfigureServices(IServiceCollection services)
18+
{
19+
}
20+
21+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
22+
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
23+
{
24+
loggerFactory.AddConsole();
25+
26+
if (env.IsDevelopment())
27+
{
28+
app.UseDeveloperExceptionPage();
29+
}
30+
31+
app.Run(async (context) =>
32+
{
33+
await context.Response.WriteAsync("Hello World!");
34+
});
35+
}
36+
}
37+
}

angular2-cli-visualstudio.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp1.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Folder Include="wwwroot\" />
9+
</ItemGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
13+
</ItemGroup>
14+
15+
</Project>

e2e/app.e2e-spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Ng2CliPage } from './app.po';
2+
3+
describe('ng2-cli App', () => {
4+
let page: Ng2CliPage;
5+
6+
beforeEach(() => {
7+
page = new Ng2CliPage();
8+
});
9+
10+
it('should display message saying app works', () => {
11+
page.navigateTo();
12+
expect(page.getParagraphText()).toEqual('ng2cli works!');
13+
});
14+
});

e2e/app.po.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { browser, element, by } from 'protractor';
2+
3+
export class Ng2CliPage {
4+
navigateTo() {
5+
return browser.get('/');
6+
}
7+
8+
getParagraphText() {
9+
return element(by.css('ng2cli-root h1')).getText();
10+
}
11+
}

e2e/tsconfig.e2e.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/e2e",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types":[
8+
"jasmine",
9+
"node"
10+
]
11+
}
12+
}

global.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)