@authing/ng-ui-components 4.3.4 → 4.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/authing-ng-ui-components.d.ts +4 -0
- package/authing-ng-ui-components.metadata.json +1 -0
- package/bundles/authing-ng-ui-components.umd.js +205 -0
- package/bundles/authing-ng-ui-components.umd.js.map +1 -0
- package/bundles/authing-ng-ui-components.umd.min.js +2 -0
- package/bundles/authing-ng-ui-components.umd.min.js.map +1 -0
- package/esm2015/authing-ng-ui-components.js +5 -0
- package/esm2015/lib/Guard/guard.component.js +84 -0
- package/esm2015/lib/Guard/guard.module.js +14 -0
- package/esm2015/lib/Guard/guard.service.js +13 -0
- package/esm2015/public-api.js +9 -0
- package/fesm2015/authing-ng-ui-components.js +119 -0
- package/fesm2015/authing-ng-ui-components.js.map +1 -0
- package/lib/Guard/guard.component.d.ts +28 -0
- package/lib/Guard/guard.module.d.ts +3 -0
- package/lib/Guard/guard.service.d.ts +3 -0
- package/package.json +11 -4
- package/{src/public-api.ts → public-api.d.ts} +1 -16
- package/karma.conf.js +0 -32
- package/ng-package.json +0 -8
- package/src/lib/Guard/guard.component.scss +0 -1
- package/src/lib/Guard/guard.component.spec.ts +0 -24
- package/src/lib/Guard/guard.component.ts +0 -115
- package/src/lib/Guard/guard.module.ts +0 -11
- package/src/lib/Guard/guard.service.spec.ts +0 -16
- package/src/lib/Guard/guard.service.ts +0 -8
- package/src/test.ts +0 -26
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -17
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authing-ng-ui-components.js","sources":["../../../projects/ng-ui-components/src/lib/Guard/guard.service.ts","../../../projects/ng-ui-components/src/lib/Guard/guard.component.ts","../../../projects/ng-ui-components/src/lib/Guard/guard.module.ts","../../../projects/ng-ui-components/src/public-api.ts","../../../projects/ng-ui-components/src/authing-ng-ui-components.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class GuardService {\n constructor() {}\n}\n","import {\n OnInit,\n Output,\n Component,\n EventEmitter,\n ViewEncapsulation,\n Input,\n OnChanges,\n} from '@angular/core';\n\nimport {\n AuthenticationClient,\n Guard as NativeGuard,\n GuardEvents,\n GuardLocalConfig,\n} from '@authing/native-js-ui-components';\n\n@Component({\n selector: 'guard',\n template: `<div id=\"guard_container\"></div>`,\n styles: [],\n styleUrls: ['./guard.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class GuardComponent implements OnInit, OnChanges {\n constructor() {}\n\n @Input() guard!: NativeGuard;\n @Input() appId?: string;\n @Input() visible?: boolean;\n @Input() tenantId?: string;\n @Input() authClient?: AuthenticationClient;\n @Input() config?: Partial<GuardLocalConfig>;\n\n @Output() onLoad = new EventEmitter<\n Parameters<Required<GuardEvents>['onLoad']>\n >();\n @Output() onLoadError = new EventEmitter<\n Parameters<Required<GuardEvents>['onLoadError']>\n >();\n @Output() onLogin = new EventEmitter<\n Parameters<Required<GuardEvents>['onLogin']>\n >();\n @Output() onLoginError = new EventEmitter<\n Parameters<Required<GuardEvents>['onLoginError']>\n >();\n @Output() onRegister = new EventEmitter<\n Parameters<Required<GuardEvents>['onRegister']>\n >();\n @Output() onRegisterError = new EventEmitter<\n Parameters<Required<GuardEvents>['onRegisterError']>\n >();\n @Output() onEmailSend = new EventEmitter<\n Parameters<Required<GuardEvents>['onEmailSend']>\n >();\n @Output() onEmailSendError = new EventEmitter<\n Parameters<Required<GuardEvents>['onEmailSendError']>\n >();\n @Output() onPhoneSend = new EventEmitter<\n Parameters<Required<GuardEvents>['onPhoneSend']>\n >();\n @Output() onPhoneSendError = new EventEmitter<\n Parameters<Required<GuardEvents>['onPhoneSendError']>\n >();\n @Output() onPwdReset = new EventEmitter<\n Parameters<Required<GuardEvents>['onPwdReset']>\n >();\n @Output() onPwdResetError = new EventEmitter<\n Parameters<Required<GuardEvents>['onPwdResetError']>\n >();\n @Output() onClose = new EventEmitter<\n Parameters<Required<GuardEvents>['onClose']>\n >();\n\n @Output() onLangChange = new EventEmitter<\n Parameters<Required<GuardEvents>['onLangChange']>\n >();\n ngAfterViewInit() {\n // @ts-ignore\n\n this.guard = new NativeGuard({\n appId: this.appId,\n config: this.config,\n tenantId: this.tenantId,\n authClient: this.authClient,\n });\n\n this.guard.on('load', (...rest) => this.onLoad.emit(rest));\n this.guard.on('load-error', (...rest) => this.onLoadError.emit(rest));\n this.guard.on('login', (...rest) => this.onLogin.emit(rest));\n this.guard.on('login-error', (...rest) => this.onLoginError.emit(rest));\n this.guard.on('register', (...rest) => this.onRegister.emit(rest));\n this.guard.on('register-error', (...rest) =>\n this.onRegisterError.emit(rest)\n );\n this.guard.on('close', (...rest) => this.onClose.emit(rest));\n this.guard.on('lang-change', (...rest) => this.onLangChange.emit(rest));\n\n if (this.visible === true) {\n this.guard.show();\n }\n }\n\n ngOnInit(): void {}\n\n ngOnChanges() {\n if (this.visible !== undefined && this.guard) {\n if (this.visible) {\n this.guard?.show();\n } else {\n this.guard?.hide();\n }\n }\n }\n}\n","import { NgModule } from '@angular/core';\nimport { GuardComponent } from './guard.component';\n\n@NgModule({\n declarations: [GuardComponent],\n imports: [],\n exports: [GuardComponent],\n})\nexport class GuardModule {\n constructor() {}\n}\n","/*\n * Public API Surface of authing-guard\n */\n\nimport {\n User,\n GuardMode,\n GuardModuleType,\n LoginMethods,\n CommonMessage,\n RegisterMethods,\n AuthenticationClient,\n} from '@authing/native-js-ui-components';\n\nexport * from './lib/Guard/guard.service';\nexport * from './lib/Guard/guard.component';\nexport * from './lib/Guard/guard.module';\n\nexport type { CommonMessage, AuthenticationClient, User };\n\nexport { GuardMode, GuardModuleType, LoginMethods, RegisterMethods };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["NativeGuard"],"mappings":";;;;MAKa,YAAY;IAC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BACjB,QAAQ,EAAE,kCAAkC;gBAG5C,aAAa,EAAE,iBAAiB,CAAC,IAAI;;aACtC;;;;oBAIE,KAAK;oBACL,KAAK;sBACL,KAAK;uBACL,KAAK;yBACL,KAAK;qBACL,KAAK;qBAEL,MAAM;0BAGN,MAAM;sBAGN,MAAM;2BAGN,MAAM;yBAGN,MAAM;8BAGN,MAAM;0BAGN,MAAM;+BAGN,MAAM;0BAGN,MAAM;+BAGN,MAAM;yBAGN,MAAM;8BAGN,MAAM;sBAGN,MAAM;2BAIN,MAAM;;;MClEI,WAAW;IACtB,iBAAgB;;;YANjB,QAAQ,SAAC;gBACR,YAAY,EAAE,CAAC,cAAc,CAAC;gBAC9B,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE,CAAC,cAAc,CAAC;aAC1B;;;;ACPD;;;;ACAA;;;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OnInit, EventEmitter, OnChanges } from '@angular/core';
|
|
2
|
+
import { AuthenticationClient, Guard as NativeGuard, GuardLocalConfig } from '@authing/native-js-ui-components';
|
|
3
|
+
export declare class GuardComponent implements OnInit, OnChanges {
|
|
4
|
+
constructor();
|
|
5
|
+
guard: NativeGuard;
|
|
6
|
+
appId?: string;
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
authClient?: AuthenticationClient;
|
|
10
|
+
config?: Partial<GuardLocalConfig>;
|
|
11
|
+
onLoad: EventEmitter<[authClient: AuthenticationClient]>;
|
|
12
|
+
onLoadError: EventEmitter<[error: any]>;
|
|
13
|
+
onLogin: EventEmitter<[user: import("@authing/native-js-ui-components").User, authClient: AuthenticationClient]>;
|
|
14
|
+
onLoginError: EventEmitter<[errorMessages: any]>;
|
|
15
|
+
onRegister: EventEmitter<[user: import("@authing/native-js-ui-components").User, authClient: AuthenticationClient]>;
|
|
16
|
+
onRegisterError: EventEmitter<[error: any]>;
|
|
17
|
+
onEmailSend: EventEmitter<[authClient: AuthenticationClient, sence?: import("@authing/react-ui-components").EmailScene]>;
|
|
18
|
+
onEmailSendError: EventEmitter<[error?: import("@authing/native-js-ui-components").CommonMessage, authClient?: AuthenticationClient, sence?: import("@authing/react-ui-components").EmailScene]>;
|
|
19
|
+
onPhoneSend: EventEmitter<[authClient: AuthenticationClient, sence?: import("authing-js-sdk").SceneType]>;
|
|
20
|
+
onPhoneSendError: EventEmitter<[error: import("@authing/native-js-ui-components").CommonMessage, authClient: AuthenticationClient, sence?: import("authing-js-sdk").SceneType]>;
|
|
21
|
+
onPwdReset: EventEmitter<[authClient: AuthenticationClient]>;
|
|
22
|
+
onPwdResetError: EventEmitter<[error: import("@authing/native-js-ui-components").CommonMessage, authClient: AuthenticationClient]>;
|
|
23
|
+
onClose: EventEmitter<[]>;
|
|
24
|
+
onLangChange: EventEmitter<[lang: import("@authing/react-ui-components").Lang]>;
|
|
25
|
+
ngAfterViewInit(): void;
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
ngOnChanges(): void;
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/ng-ui-components",
|
|
3
|
-
"version": "4.3.
|
|
4
|
-
"main": "
|
|
3
|
+
"version": "4.3.9",
|
|
4
|
+
"main": "bundles/authing-ng-ui-components.umd.js",
|
|
5
5
|
"types": "./authing-ng-ui-components.d.ts",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/common": ">=10.2.0",
|
|
8
8
|
"@angular/core": ">=10.2.0"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@authing/native-js-ui-components": "4.3.
|
|
11
|
+
"@authing/native-js-ui-components": "^4.3.9",
|
|
12
12
|
"tslib": "^2.0.0"
|
|
13
13
|
},
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public",
|
|
16
16
|
"directory": "../../dist/ng-ui-components",
|
|
17
17
|
"registry": "https://registry.npmjs.org"
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"module": "fesm2015/authing-ng-ui-components.js",
|
|
20
|
+
"es2015": "fesm2015/authing-ng-ui-components.js",
|
|
21
|
+
"esm2015": "esm2015/authing-ng-ui-components.js",
|
|
22
|
+
"fesm2015": "fesm2015/authing-ng-ui-components.js",
|
|
23
|
+
"typings": "authing-ng-ui-components.d.ts",
|
|
24
|
+
"metadata": "authing-ng-ui-components.metadata.json",
|
|
25
|
+
"sideEffects": false
|
|
19
26
|
}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* Public API Surface of authing-guard
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
User,
|
|
7
|
-
GuardMode,
|
|
8
|
-
GuardModuleType,
|
|
9
|
-
LoginMethods,
|
|
10
|
-
CommonMessage,
|
|
11
|
-
RegisterMethods,
|
|
12
|
-
AuthenticationClient,
|
|
13
|
-
} from '@authing/native-js-ui-components';
|
|
14
|
-
|
|
1
|
+
import { User, GuardMode, GuardModuleType, LoginMethods, CommonMessage, RegisterMethods, AuthenticationClient } from '@authing/native-js-ui-components';
|
|
15
2
|
export * from './lib/Guard/guard.service';
|
|
16
3
|
export * from './lib/Guard/guard.component';
|
|
17
4
|
export * from './lib/Guard/guard.module';
|
|
18
|
-
|
|
19
5
|
export type { CommonMessage, AuthenticationClient, User };
|
|
20
|
-
|
|
21
6
|
export { GuardMode, GuardModuleType, LoginMethods, RegisterMethods };
|
package/karma.conf.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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-istanbul-reporter'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma'),
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
17
|
-
},
|
|
18
|
-
coverageIstanbulReporter: {
|
|
19
|
-
dir: require('path').join(__dirname, '../../coverage/ng-ui-components'),
|
|
20
|
-
reports: ['html', 'lcovonly', 'text-summary'],
|
|
21
|
-
fixWebpackSourcePaths: true,
|
|
22
|
-
},
|
|
23
|
-
reporters: ['progress', 'kjhtml'],
|
|
24
|
-
port: 9876,
|
|
25
|
-
colors: true,
|
|
26
|
-
logLevel: config.LOG_INFO,
|
|
27
|
-
autoWatch: true,
|
|
28
|
-
browsers: ['Chrome'],
|
|
29
|
-
singleRun: false,
|
|
30
|
-
restartOnFileChange: true,
|
|
31
|
-
})
|
|
32
|
-
}
|
package/ng-package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import "~@authing/native-js-ui-components/lib/index.min";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { GuardComponent } from './guard.component';
|
|
4
|
-
|
|
5
|
-
describe('GuardComponent', () => {
|
|
6
|
-
let component: GuardComponent;
|
|
7
|
-
let fixture: ComponentFixture<GuardComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [GuardComponent],
|
|
12
|
-
}).compileComponents();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
fixture = TestBed.createComponent(GuardComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
fixture.detectChanges();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should create', () => {
|
|
22
|
-
expect(component).toBeTruthy();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
OnInit,
|
|
3
|
-
Output,
|
|
4
|
-
Component,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
ViewEncapsulation,
|
|
7
|
-
Input,
|
|
8
|
-
OnChanges,
|
|
9
|
-
} from '@angular/core';
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
AuthenticationClient,
|
|
13
|
-
Guard as NativeGuard,
|
|
14
|
-
GuardEvents,
|
|
15
|
-
GuardLocalConfig,
|
|
16
|
-
} from '@authing/native-js-ui-components';
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'guard',
|
|
20
|
-
template: `<div id="guard_container"></div>`,
|
|
21
|
-
styles: [],
|
|
22
|
-
styleUrls: ['./guard.component.scss'],
|
|
23
|
-
encapsulation: ViewEncapsulation.None,
|
|
24
|
-
})
|
|
25
|
-
export class GuardComponent implements OnInit, OnChanges {
|
|
26
|
-
constructor() {}
|
|
27
|
-
|
|
28
|
-
@Input() guard!: NativeGuard;
|
|
29
|
-
@Input() appId?: string;
|
|
30
|
-
@Input() visible?: boolean;
|
|
31
|
-
@Input() tenantId?: string;
|
|
32
|
-
@Input() authClient?: AuthenticationClient;
|
|
33
|
-
@Input() config?: Partial<GuardLocalConfig>;
|
|
34
|
-
|
|
35
|
-
@Output() onLoad = new EventEmitter<
|
|
36
|
-
Parameters<Required<GuardEvents>['onLoad']>
|
|
37
|
-
>();
|
|
38
|
-
@Output() onLoadError = new EventEmitter<
|
|
39
|
-
Parameters<Required<GuardEvents>['onLoadError']>
|
|
40
|
-
>();
|
|
41
|
-
@Output() onLogin = new EventEmitter<
|
|
42
|
-
Parameters<Required<GuardEvents>['onLogin']>
|
|
43
|
-
>();
|
|
44
|
-
@Output() onLoginError = new EventEmitter<
|
|
45
|
-
Parameters<Required<GuardEvents>['onLoginError']>
|
|
46
|
-
>();
|
|
47
|
-
@Output() onRegister = new EventEmitter<
|
|
48
|
-
Parameters<Required<GuardEvents>['onRegister']>
|
|
49
|
-
>();
|
|
50
|
-
@Output() onRegisterError = new EventEmitter<
|
|
51
|
-
Parameters<Required<GuardEvents>['onRegisterError']>
|
|
52
|
-
>();
|
|
53
|
-
@Output() onEmailSend = new EventEmitter<
|
|
54
|
-
Parameters<Required<GuardEvents>['onEmailSend']>
|
|
55
|
-
>();
|
|
56
|
-
@Output() onEmailSendError = new EventEmitter<
|
|
57
|
-
Parameters<Required<GuardEvents>['onEmailSendError']>
|
|
58
|
-
>();
|
|
59
|
-
@Output() onPhoneSend = new EventEmitter<
|
|
60
|
-
Parameters<Required<GuardEvents>['onPhoneSend']>
|
|
61
|
-
>();
|
|
62
|
-
@Output() onPhoneSendError = new EventEmitter<
|
|
63
|
-
Parameters<Required<GuardEvents>['onPhoneSendError']>
|
|
64
|
-
>();
|
|
65
|
-
@Output() onPwdReset = new EventEmitter<
|
|
66
|
-
Parameters<Required<GuardEvents>['onPwdReset']>
|
|
67
|
-
>();
|
|
68
|
-
@Output() onPwdResetError = new EventEmitter<
|
|
69
|
-
Parameters<Required<GuardEvents>['onPwdResetError']>
|
|
70
|
-
>();
|
|
71
|
-
@Output() onClose = new EventEmitter<
|
|
72
|
-
Parameters<Required<GuardEvents>['onClose']>
|
|
73
|
-
>();
|
|
74
|
-
|
|
75
|
-
@Output() onLangChange = new EventEmitter<
|
|
76
|
-
Parameters<Required<GuardEvents>['onLangChange']>
|
|
77
|
-
>();
|
|
78
|
-
ngAfterViewInit() {
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
|
|
81
|
-
this.guard = new NativeGuard({
|
|
82
|
-
appId: this.appId,
|
|
83
|
-
config: this.config,
|
|
84
|
-
tenantId: this.tenantId,
|
|
85
|
-
authClient: this.authClient,
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
this.guard.on('load', (...rest) => this.onLoad.emit(rest));
|
|
89
|
-
this.guard.on('load-error', (...rest) => this.onLoadError.emit(rest));
|
|
90
|
-
this.guard.on('login', (...rest) => this.onLogin.emit(rest));
|
|
91
|
-
this.guard.on('login-error', (...rest) => this.onLoginError.emit(rest));
|
|
92
|
-
this.guard.on('register', (...rest) => this.onRegister.emit(rest));
|
|
93
|
-
this.guard.on('register-error', (...rest) =>
|
|
94
|
-
this.onRegisterError.emit(rest)
|
|
95
|
-
);
|
|
96
|
-
this.guard.on('close', (...rest) => this.onClose.emit(rest));
|
|
97
|
-
this.guard.on('lang-change', (...rest) => this.onLangChange.emit(rest));
|
|
98
|
-
|
|
99
|
-
if (this.visible === true) {
|
|
100
|
-
this.guard.show();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
ngOnInit(): void {}
|
|
105
|
-
|
|
106
|
-
ngOnChanges() {
|
|
107
|
-
if (this.visible !== undefined && this.guard) {
|
|
108
|
-
if (this.visible) {
|
|
109
|
-
this.guard?.show();
|
|
110
|
-
} else {
|
|
111
|
-
this.guard?.hide();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { GuardService } from './guard.service';
|
|
4
|
-
|
|
5
|
-
describe('GuardService', () => {
|
|
6
|
-
let service: GuardService;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
TestBed.configureTestingModule({});
|
|
10
|
-
service = TestBed.inject(GuardService);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should be created', () => {
|
|
14
|
-
expect(service).toBeTruthy();
|
|
15
|
-
});
|
|
16
|
-
});
|
package/src/test.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
-
|
|
3
|
-
import 'zone.js/dist/zone';
|
|
4
|
-
import 'zone.js/dist/zone-testing';
|
|
5
|
-
import { getTestBed } from '@angular/core/testing';
|
|
6
|
-
import {
|
|
7
|
-
BrowserDynamicTestingModule,
|
|
8
|
-
platformBrowserDynamicTesting
|
|
9
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
-
|
|
11
|
-
declare const require: {
|
|
12
|
-
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
-
keys(): string[];
|
|
14
|
-
<T>(id: string): T;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// First, initialize the Angular testing environment.
|
|
19
|
-
getTestBed().initTestEnvironment(
|
|
20
|
-
BrowserDynamicTestingModule,
|
|
21
|
-
platformBrowserDynamicTesting()
|
|
22
|
-
);
|
|
23
|
-
// Then we find all the tests.
|
|
24
|
-
const context = require.context('./', true, /\.spec\.ts$/);
|
|
25
|
-
// And load the modules.
|
|
26
|
-
context.keys().map(context);
|
package/tsconfig.lib.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"target": "es2015",
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"declarationMap": true,
|
|
9
|
-
"inlineSources": true,
|
|
10
|
-
"types": [],
|
|
11
|
-
"lib": [
|
|
12
|
-
"dom",
|
|
13
|
-
"es2018"
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"angularCompilerOptions": {
|
|
17
|
-
"skipTemplateCodegen": true,
|
|
18
|
-
"strictMetadataEmit": true,
|
|
19
|
-
"enableResourceInlining": true
|
|
20
|
-
},
|
|
21
|
-
"exclude": [
|
|
22
|
-
"src/test.ts",
|
|
23
|
-
"**/*.spec.ts"
|
|
24
|
-
]
|
|
25
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/spec",
|
|
6
|
-
"types": [
|
|
7
|
-
"jasmine"
|
|
8
|
-
]
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"src/test.ts"
|
|
12
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|