-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
30a4d91
commit 9341946
Showing
48 changed files
with
24,669 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
155 changes: 155 additions & 0 deletions
155
examples-standalone/kendoangular-aspnetcore-integration/ClientApp/angular.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"kendoangular_aspnetcore": { | ||
"projectType": "application", | ||
"schematics": { | ||
"@schematics/angular:application": { | ||
"strict": true | ||
} | ||
}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"progress": false, | ||
"outputPath": "dist", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"polyfills": [ | ||
"src/polyfills.ts", | ||
"@angular/localize/init" | ||
], | ||
"tsConfig": "tsconfig.app.json", | ||
"allowedCommonJsDependencies": [ | ||
"oidc-client" | ||
], | ||
"assets": [ | ||
"src/assets" | ||
], | ||
"styles": [ | ||
{ | ||
"input": "node_modules/@progress/kendo-theme-default/dist/all.css" | ||
}, | ||
"node_modules/bootstrap/dist/css/bootstrap.min.css", | ||
"src/styles.css" | ||
], | ||
"scripts": [] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "1mb", | ||
"maximumError": "2mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "2kb", | ||
"maximumError": "4kb" | ||
} | ||
], | ||
"fileReplacements": [ | ||
{ | ||
"replace": "src/environments/environment.ts", | ||
"with": "src/environments/environment.prod.ts" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"buildOptimizer": false, | ||
"optimization": false, | ||
"vendorChunk": true, | ||
"extractLicenses": false, | ||
"sourceMap": true, | ||
"namedChunks": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"buildTarget": "kendoangular_aspnetcore:build:production" | ||
}, | ||
"development": { | ||
"proxyConfig": "proxy.conf.js", | ||
"buildTarget": "kendoangular_aspnetcore:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"buildTarget": "kendoangular_aspnetcore:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"main": "src/test.ts", | ||
"polyfills": [ | ||
"src/polyfills.ts", | ||
"@angular/localize/init" | ||
], | ||
"tsConfig": "tsconfig.spec.json", | ||
"karmaConfig": "karma.conf.js", | ||
"assets": [ | ||
"src/assets" | ||
], | ||
"styles": [ | ||
{ | ||
"input": "node_modules/@progress/kendo-theme-default/dist/all.css" | ||
}, | ||
"src/styles.css" | ||
], | ||
"scripts": [] | ||
} | ||
}, | ||
"server": { | ||
"builder": "@angular-devkit/build-angular:server", | ||
"options": { | ||
"outputPath": "dist-server", | ||
"main": "src/main.ts", | ||
"tsConfig": "tsconfig.server.json", | ||
"polyfills": [ | ||
"@angular/localize/init" | ||
] | ||
}, | ||
"configurations": { | ||
"dev": { | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": true, | ||
"buildOptimizer": true | ||
}, | ||
"production": { | ||
"optimization": true, | ||
"outputHashing": "all", | ||
"sourceMap": false, | ||
"namedChunks": false, | ||
"extractLicenses": true, | ||
"vendorChunk": false, | ||
"buildOptimizer": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"cli": { | ||
"analytics": false | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
examples-standalone/kendoangular-aspnetcore-integration/ClientApp/aspnetcore-https.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// This script sets up HTTPS for the application using the ASP.NET Core HTTPS certificate | ||
const fs = require('fs'); | ||
const spawn = require('child_process').spawn; | ||
const path = require('path'); | ||
|
||
const baseFolder = | ||
process.env.APPDATA !== undefined && process.env.APPDATA !== '' | ||
? `${process.env.APPDATA}/ASP.NET/https` | ||
: `${process.env.HOME}/.aspnet/https`; | ||
|
||
const certificateArg = process.argv.map(arg => arg.match(/--name=(?<value>.+)/i)).filter(Boolean)[0]; | ||
const certificateName = certificateArg ? certificateArg.groups.value : process.env.npm_package_name; | ||
|
||
if (!certificateName) { | ||
console.error('Invalid certificate name. Run this script in the context of an npm/yarn script or pass --name=<<app>> explicitly.') | ||
process.exit(-1); | ||
} | ||
|
||
const certFilePath = path.join(baseFolder, `${certificateName}.pem`); | ||
const keyFilePath = path.join(baseFolder, `${certificateName}.key`); | ||
|
||
if (!fs.existsSync(certFilePath) || !fs.existsSync(keyFilePath)) { | ||
spawn('dotnet', [ | ||
'dev-certs', | ||
'https', | ||
'--export-path', | ||
certFilePath, | ||
'--format', | ||
'Pem', | ||
'--no-password', | ||
], { stdio: 'inherit', }) | ||
.on('exit', (code) => process.exit(code)); | ||
} |
44 changes: 44 additions & 0 deletions
44
examples-standalone/kendoangular-aspnetcore-integration/ClientApp/karma.conf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Karma configuration file, see link for more information | ||
// https://karma-runner.github.io/1.0/config/configuration-file.html | ||
|
||
module.exports = function (config) { | ||
config.set({ | ||
basePath: '', | ||
frameworks: ['jasmine', '@angular-devkit/build-angular'], | ||
plugins: [ | ||
require('karma-jasmine'), | ||
require('karma-chrome-launcher'), | ||
require('karma-jasmine-html-reporter'), | ||
require('karma-coverage'), | ||
require('@angular-devkit/build-angular/plugins/karma') | ||
], | ||
client: { | ||
jasmine: { | ||
// you can add configuration options for Jasmine here | ||
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html | ||
// for example, you can disable the random execution with `random: false` | ||
// or set a specific seed with `seed: 4321` | ||
}, | ||
clearContext: false // leave Jasmine Spec Runner output visible in browser | ||
}, | ||
jasmineHtmlReporter: { | ||
suppressAll: true // removes the duplicated traces | ||
}, | ||
coverageReporter: { | ||
dir: require('path').join(__dirname, './coverage/angularapp'), | ||
subdir: '.', | ||
reporters: [ | ||
{ type: 'html' }, | ||
{ type: 'text-summary' } | ||
] | ||
}, | ||
reporters: ['progress', 'kjhtml'], | ||
port: 9876, | ||
colors: true, | ||
logLevel: config.LOG_INFO, | ||
autoWatch: true, | ||
browsers: ['Chrome'], | ||
singleRun: false, | ||
restartOnFileChange: true | ||
}); | ||
}; |
Oops, something went wrong.