Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabiangosebrink/adding schematics #876

Merged
merged 23 commits into from
Jan 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5d06239
first steps
FabianGosebrink Oct 6, 2020
76f23aa
Merge branch 'main' into fabiangosebrink/adding-schematics
FabianGosebrink Oct 15, 2020
f9b4bac
added schematics creation
FabianGosebrink Oct 15, 2020
6d27cd4
adding schematics
FabianGosebrink Oct 15, 2020
75dc31a
adding files and fixing build
FabianGosebrink Oct 16, 2020
f03a69e
adding more steps
FabianGosebrink Oct 16, 2020
724a3f8
first working version
FabianGosebrink Oct 18, 2020
f5d40c4
finishing touches
FabianGosebrink Oct 18, 2020
ec8d779
small cleanups
FabianGosebrink Oct 18, 2020
357194f
smol changes
FabianGosebrink Oct 18, 2020
b847eb9
adding new travis flow
FabianGosebrink Oct 18, 2020
709f3de
fixed build
FabianGosebrink Oct 18, 2020
6b1af90
Merge branch 'main' into fabiangosebrink/adding-schematics
damienbod Oct 23, 2020
1628a78
Merge branch 'main' into fabiangosebrink/adding-schematics
FabianGosebrink Dec 28, 2020
6cba0ae
Merge branch 'main' into fabiangosebrink/adding-schematics
FabianGosebrink Dec 28, 2020
6bca4b8
fixed imports
FabianGosebrink Dec 28, 2020
f45e6ad
fixed errors
FabianGosebrink Dec 28, 2020
b5bf394
corrected return type
FabianGosebrink Dec 28, 2020
9d3f225
removing whitespace in message
FabianGosebrink Dec 28, 2020
f41017a
adding schematics to build pipeline
FabianGosebrink Dec 28, 2020
6b98384
updated dependencies
FabianGosebrink Jan 2, 2021
4cbaa0d
Merge remote-tracking branch 'origin/main' into fabiangosebrink/addin…
FabianGosebrink Jan 2, 2021
0817dc6
fixed comments
FabianGosebrink Jan 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ jobs:
sudo npm install ../angular-auth-oidc-client/dist/angular-auth-oidc-client
npm test -- --watch=false --browsers=ChromeHeadless
sudo npm run build -- --prod

- name: Create new Angular Project and use the schematics to add a module
run: |
cd ..
echo '=== Current Directory ==='
ls
sudo npm install -g @angular/cli
echo 'Creating new angular project'
sudo ng new testProjectSchematic --skip-git
cd testProjectSchematic
echo '=== Current Directory ==='
ls
sudo ng add ../angular-auth-oidc-client/dist/angular-auth-oidc-client
npm test -- --watch=false --browsers=ChromeHeadless
sudo npm run build -- --prod
27,988 changes: 13,938 additions & 14,050 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"build": "npm run build-lib",
"build-app": "ng build sample-code-flow",
"watch-lib": "ng build angular-auth-oidc-client --watch",
"build-lib": "ng build angular-auth-oidc-client && npm run copy-readme-to-lib-folder && npm run copy-licence-to-lib-folder",
"build-lib-prod": "ng build angular-auth-oidc-client --prod && npm run copy-readme-to-lib-folder && npm run copy-licence-to-lib-folder",
"build-lib": "ng build angular-auth-oidc-client && npm run schematics-build && npm run copy",
"build-lib-prod": "ng build angular-auth-oidc-client --prod && npm run schematics-build && npm run copy",
"test-lib": "ng test angular-auth-oidc-client --code-coverage",
"test-lib-ci": "ng test angular-auth-oidc-client --watch=false --browsers=ChromeHeadlessNoSandbox --code-coverage",
"lint-lib": "ng lint angular-auth-oidc-client",
Expand All @@ -24,8 +24,8 @@
"publish-lib-next": "npm run build-lib && npm publish --tag next ./dist/angular-auth-oidc-client",
"compodoc": "compodoc -p tsconfig.json",
"compodoc:serve": "compodoc -s",
"copy-readme-to-lib-folder": "copyfiles README.md ./dist/angular-auth-oidc-client",
"copy-licence-to-lib-folder": "copyfiles LICENSE ./dist/angular-auth-oidc-client",
"copy-readme-to-lib-folder": "ncp README.md ./dist/angular-auth-oidc-client/README.md",
"copy-licence-to-lib-folder": "ncp LICENSE ./dist/angular-auth-oidc-client/LICENSE",
"check-prettier": "prettier --check \"projects/angular-auth-oidc-client/**/*.ts\"",
"fix-prettier": "prettier --write \"projects/angular-auth-oidc-client/**/*.ts\"",
"start": "ng serve sample-code-flow --ssl -o",
Expand All @@ -39,7 +39,11 @@
"start-sample-implicit-flow-google": "ng serve sample-implicit-flow-google --ssl -o",
"start-sample-implicit-flow-silent-renew": "ng serve sample-implicit-flow-silent-renew --ssl -o",
"start-sample-code-flow-lazy-loaded": "ng serve sample-code-flow-lazy-loaded --ssl --port=4204 -o",
"e2e": "ng e2e"
"e2e": "ng e2e",
"schematics-copy": "npm run schematics-ngadd-copy && ncp projects/schematics/src/collection.json ./dist/angular-auth-oidc-client/schematics/collection.json",
"schematics-ngadd-copy": "ncp projects/schematics/src/ng-add/files ./dist/angular-auth-oidc-client/schematics/ng-add/files",
"schematics-build": "tsc -p projects/schematics/tsconfig.json",
"copy": "npm run copy-readme-to-lib-folder && npm run copy-licence-to-lib-folder && npm run schematics-copy"
},
"private": true,
"dependencies": {
Expand All @@ -59,12 +63,13 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1100.5",
"@angular-devkit/core": "^11.0.5",
"@angular-devkit/schematics": "^11.0.5",
"@angular/cli": "~11.0.5",
"@angular/compiler-cli": "~11.0.5",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"copyfiles": "^2.2.0",
"coveralls": "^3.1.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
Expand All @@ -73,6 +78,7 @@
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ncp": "^2.0.0",
"ng-packagr": "^11.0.0",
"prettier": "^2.0.4",
"protractor": "~7.0.0",
Expand Down
3 changes: 2 additions & 1 deletion projects/angular-auth-oidc-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
],
"license": "MIT",
"version": "11.3.0",
"description": "Angular Lib for OpenID Connect & OAuth2"
"description": "Angular Lib for OpenID Connect & OAuth2",
"schematics": "./schematics/collection.json"
}
2 changes: 2 additions & 0 deletions projects/angular-auth-oidc-client/src/lib/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { NgModule } from '@angular/core';
import { DataService } from './api/data.service';
import { HttpBaseService } from './api/http-base.service';
import { AuthStateService } from './authState/auth-state.service';
import { ConfigValidationService } from './config-validation/config-validation.service';
import { AuthWellKnownDataService } from './config/auth-well-known-data.service';
import { AuthWellKnownService } from './config/auth-well-known.service';
import { ConfigurationProvider } from './config/config.provider';
Expand Down Expand Up @@ -70,6 +71,7 @@ export class AuthModule {
AuthWellKnownService,
DataService,
StateValidationService,
ConfigValidationService,
{
provide: AbstractSecurityStorage,
useClass: token.storage || BrowserStorageService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { LoggerService } from '../logging/logger.service';
import { Level, RuleValidationResult } from './rule';
import { allRules } from './rules';

@Injectable({ providedIn: 'root' })
@Injectable()
export class ConfigValidationService {
constructor(private loggerService: LoggerService) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function ensureClientId(passedConfig: OpenIdConfiguration): RuleValidatio
if (!passedConfig.clientId) {
return {
result: false,
messages: ['The clientId is required and missing from your config!'],
messages: ['The clientId is required and missing from your config!'],
level: 'error',
};
}
Expand Down
25 changes: 25 additions & 0 deletions projects/angular-auth-oidc-client/tsconfig.schematics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"baseUrl": ".",
"lib": ["es2018", "dom"],
"declaration": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"rootDir": "schematics",
"outDir": "../../dist/angular-auth-oidc-client/schematics",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "es6",
"types": ["jasmine", "node"]
},
"include": ["schematics/**/*"],
"exclude": ["schematics/*/files/**/*"]
}
Loading