Skip to content

Commit 9341946

Browse files
add ASP.NET Core with Kendo Angular app (#4372)
* add ASP.NET Core with Kendo Angular app * remove readme from the client app * chore: add example to the build
1 parent 30a4d91 commit 9341946

Some content is hidden

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

48 files changed

+24669
-0
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ jobs:
7777
npm ci
7878
npm run build
7979
80+
- name: Build ASP.NET Core Integration app
81+
working-directory: ./examples-standalone/kendoangular-aspnetcore-integration/ClientApp
82+
run: |
83+
npm ci
84+
8085
standalone-examples-node14:
8186
runs-on: ubuntu-latest
8287

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"kendoangular_aspnetcore": {
7+
"projectType": "application",
8+
"schematics": {
9+
"@schematics/angular:application": {
10+
"strict": true
11+
}
12+
},
13+
"root": "",
14+
"sourceRoot": "src",
15+
"prefix": "app",
16+
"architect": {
17+
"build": {
18+
"builder": "@angular-devkit/build-angular:browser",
19+
"options": {
20+
"progress": false,
21+
"outputPath": "dist",
22+
"index": "src/index.html",
23+
"main": "src/main.ts",
24+
"polyfills": [
25+
"src/polyfills.ts",
26+
"@angular/localize/init"
27+
],
28+
"tsConfig": "tsconfig.app.json",
29+
"allowedCommonJsDependencies": [
30+
"oidc-client"
31+
],
32+
"assets": [
33+
"src/assets"
34+
],
35+
"styles": [
36+
{
37+
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
38+
},
39+
"node_modules/bootstrap/dist/css/bootstrap.min.css",
40+
"src/styles.css"
41+
],
42+
"scripts": []
43+
},
44+
"configurations": {
45+
"production": {
46+
"budgets": [
47+
{
48+
"type": "initial",
49+
"maximumWarning": "1mb",
50+
"maximumError": "2mb"
51+
},
52+
{
53+
"type": "anyComponentStyle",
54+
"maximumWarning": "2kb",
55+
"maximumError": "4kb"
56+
}
57+
],
58+
"fileReplacements": [
59+
{
60+
"replace": "src/environments/environment.ts",
61+
"with": "src/environments/environment.prod.ts"
62+
}
63+
],
64+
"outputHashing": "all"
65+
},
66+
"development": {
67+
"buildOptimizer": false,
68+
"optimization": false,
69+
"vendorChunk": true,
70+
"extractLicenses": false,
71+
"sourceMap": true,
72+
"namedChunks": true
73+
}
74+
},
75+
"defaultConfiguration": "production"
76+
},
77+
"serve": {
78+
"builder": "@angular-devkit/build-angular:dev-server",
79+
"configurations": {
80+
"production": {
81+
"buildTarget": "kendoangular_aspnetcore:build:production"
82+
},
83+
"development": {
84+
"proxyConfig": "proxy.conf.js",
85+
"buildTarget": "kendoangular_aspnetcore:build:development"
86+
}
87+
},
88+
"defaultConfiguration": "development"
89+
},
90+
"extract-i18n": {
91+
"builder": "@angular-devkit/build-angular:extract-i18n",
92+
"options": {
93+
"buildTarget": "kendoangular_aspnetcore:build"
94+
}
95+
},
96+
"test": {
97+
"builder": "@angular-devkit/build-angular:karma",
98+
"options": {
99+
"main": "src/test.ts",
100+
"polyfills": [
101+
"src/polyfills.ts",
102+
"@angular/localize/init"
103+
],
104+
"tsConfig": "tsconfig.spec.json",
105+
"karmaConfig": "karma.conf.js",
106+
"assets": [
107+
"src/assets"
108+
],
109+
"styles": [
110+
{
111+
"input": "node_modules/@progress/kendo-theme-default/dist/all.css"
112+
},
113+
"src/styles.css"
114+
],
115+
"scripts": []
116+
}
117+
},
118+
"server": {
119+
"builder": "@angular-devkit/build-angular:server",
120+
"options": {
121+
"outputPath": "dist-server",
122+
"main": "src/main.ts",
123+
"tsConfig": "tsconfig.server.json",
124+
"polyfills": [
125+
"@angular/localize/init"
126+
]
127+
},
128+
"configurations": {
129+
"dev": {
130+
"optimization": true,
131+
"outputHashing": "all",
132+
"sourceMap": false,
133+
"namedChunks": false,
134+
"extractLicenses": true,
135+
"vendorChunk": true,
136+
"buildOptimizer": true
137+
},
138+
"production": {
139+
"optimization": true,
140+
"outputHashing": "all",
141+
"sourceMap": false,
142+
"namedChunks": false,
143+
"extractLicenses": true,
144+
"vendorChunk": false,
145+
"buildOptimizer": true
146+
}
147+
}
148+
}
149+
}
150+
}
151+
},
152+
"cli": {
153+
"analytics": false
154+
}
155+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This script sets up HTTPS for the application using the ASP.NET Core HTTPS certificate
2+
const fs = require('fs');
3+
const spawn = require('child_process').spawn;
4+
const path = require('path');
5+
6+
const baseFolder =
7+
process.env.APPDATA !== undefined && process.env.APPDATA !== ''
8+
? `${process.env.APPDATA}/ASP.NET/https`
9+
: `${process.env.HOME}/.aspnet/https`;
10+
11+
const certificateArg = process.argv.map(arg => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0];
12+
const certificateName = certificateArg ? certificateArg.groups.value : process.env.npm_package_name;
13+
14+
if (!certificateName) {
15+
console.error('Invalid certificate name. Run this script in the context of an npm/yarn script or pass --name=<<app>> explicitly.')
16+
process.exit(-1);
17+
}
18+
19+
const certFilePath = path.join(baseFolder, `${certificateName}.pem`);
20+
const keyFilePath = path.join(baseFolder, `${certificateName}.key`);
21+
22+
if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) {
23+
spawn('dotnet', [
24+
'dev-certs',
25+
'https',
26+
'--export-path',
27+
certFilePath,
28+
'--format',
29+
'Pem',
30+
'--no-password',
31+
], { stdio: 'inherit', })
32+
.on('exit', (code) => process.exit(code));
33+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
module.exports = function (config) {
5+
config.set({
6+
basePath: '',
7+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
8+
plugins: [
9+
require('karma-jasmine'),
10+
require('karma-chrome-launcher'),
11+
require('karma-jasmine-html-reporter'),
12+
require('karma-coverage'),
13+
require('@angular-devkit/build-angular/plugins/karma')
14+
],
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
22+
clearContext: false // leave Jasmine Spec Runner output visible in browser
23+
},
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, './coverage/angularapp'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
34+
},
35+
reporters: ['progress', 'kjhtml'],
36+
port: 9876,
37+
colors: true,
38+
logLevel: config.LOG_INFO,
39+
autoWatch: true,
40+
browsers: ['Chrome'],
41+
singleRun: false,
42+
restartOnFileChange: true
43+
});
44+
};

0 commit comments

Comments
 (0)