@acorex/platform-generator 1.0.1
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/README.md +11 -0
- package/generators.json +9 -0
- package/package.json +12 -0
- package/src/generators/app-module/files/.eslintrc.json.template +40 -0
- package/src/generators/app-module/files/jest.config.ts.template +22 -0
- package/src/generators/app-module/files/project.json.template +308 -0
- package/src/generators/app-module/files/src/app/app.component.ts.template +10 -0
- package/src/generators/app-module/files/src/app/app.module.ts.template +99 -0
- package/src/generators/app-module/files/src/app/app.routes.ts.template +26 -0
- package/src/generators/app-module/files/src/app/header-interceptor.interceptor.ts.template +33 -0
- package/src/generators/app-module/files/src/app/modules/auth/application.loader.ts.template +34 -0
- package/src/generators/app-module/files/src/app/modules/auth/auth-root.module.ts.template +52 -0
- package/src/generators/app-module/files/src/app/modules/auth/auth.strategy.ts.template +83 -0
- package/src/generators/app-module/files/src/app/modules/auth/feature.loader.ts.template +17 -0
- package/src/generators/app-module/files/src/app/modules/auth/permission.loader.ts.template +21 -0
- package/src/generators/app-module/files/src/app/modules/auth/tenant.loader.ts.template +32 -0
- package/src/generators/app-module/files/src/app/modules/common/translation-root.module.ts.template +45 -0
- package/src/generators/app-module/files/src/app/modules/layout/entity.loader.ts.template +21 -0
- package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +75 -0
- package/src/generators/app-module/files/src/app/modules/layout/menu.loader.ts.template +159 -0
- package/src/generators/app-module/files/src/app/modules/root/home/home.page.html.template +3 -0
- package/src/generators/app-module/files/src/app/modules/root/home/home.page.ts.template +10 -0
- package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +30 -0
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template +185 -0
- package/src/generators/app-module/files/src/assets/auth-background.svg +6 -0
- package/src/generators/app-module/files/src/assets/documents.svg +9 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/brands.min.css +1457 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/fontawesome.min.css +11291 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/light.min.css +22 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/regular.min.css +22 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/solid.min.css +6 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-brands-400.ttf +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-brands-400.woff2 +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-light-300.ttf +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-light-300.woff2 +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-regular-400.ttf +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-regular-400.woff2 +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-solid-900.ttf +0 -0
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/webfonts/fa-solid-900.woff2 +0 -0
- package/src/generators/app-module/files/src/assets/i18n/en/auth.json +49 -0
- package/src/generators/app-module/files/src/assets/i18n/en/common.json +179 -0
- package/src/generators/app-module/files/src/assets/images/error/error-401.svg +1 -0
- package/src/generators/app-module/files/src/assets/images/error/error-404.svg +336 -0
- package/src/generators/app-module/files/src/assets/images/error/error-offline.png +0 -0
- package/src/generators/app-module/files/src/assets/images/error/error-offline.svg +133 -0
- package/src/generators/app-module/files/src/assets/images/register/smart-phone.png +0 -0
- package/src/generators/app-module/files/src/assets/logos/logo-colored.svg +19 -0
- package/src/generators/app-module/files/src/assets/logos/logo-white.svg +18 -0
- package/src/generators/app-module/files/src/assets/logos/logo.png +0 -0
- package/src/generators/app-module/files/src/assets/themes/default/default.scss.template +141 -0
- package/src/generators/app-module/files/src/environments/environment.d.ts +19 -0
- package/src/generators/app-module/files/src/environments/environment.dev.d.ts +19 -0
- package/src/generators/app-module/files/src/environments/environment.dev.js +24 -0
- package/src/generators/app-module/files/src/environments/environment.dev.js.map +1 -0
- package/src/generators/app-module/files/src/environments/environment.js +24 -0
- package/src/generators/app-module/files/src/environments/environment.js.map +1 -0
- package/src/generators/app-module/files/src/environments/environment.local.d.ts +19 -0
- package/src/generators/app-module/files/src/environments/environment.local.js +24 -0
- package/src/generators/app-module/files/src/environments/environment.local.js.map +1 -0
- package/src/generators/app-module/files/src/environments/environment.prod.d.ts +19 -0
- package/src/generators/app-module/files/src/environments/environment.prod.js +24 -0
- package/src/generators/app-module/files/src/environments/environment.prod.js.map +1 -0
- package/src/generators/app-module/files/src/environments/environment.test.local.d.ts +19 -0
- package/src/generators/app-module/files/src/environments/environment.test.local.js +24 -0
- package/src/generators/app-module/files/src/environments/environment.test.local.js.map +1 -0
- package/src/generators/app-module/files/src/favicon.ico +0 -0
- package/src/generators/app-module/files/src/index.html.template +35 -0
- package/src/generators/app-module/files/src/main.ts.template +6 -0
- package/src/generators/app-module/files/src/styles.scss.template +188 -0
- package/src/generators/app-module/files/src/test-setup.ts.template +7 -0
- package/src/generators/app-module/files/tailwind.config.js.template +15 -0
- package/src/generators/app-module/files/tsconfig.app.json.template +10 -0
- package/src/generators/app-module/files/tsconfig.editor.json.template +7 -0
- package/src/generators/app-module/files/tsconfig.json.template +34 -0
- package/src/generators/app-module/files/tsconfig.spec.json.template +11 -0
- package/src/generators/app-module/generator.d.ts +5 -0
- package/src/generators/app-module/generator.js +31 -0
- package/src/generators/app-module/generator.js.map +1 -0
- package/src/generators/app-module/schema.d.ts +4 -0
- package/src/generators/app-module/schema.json +27 -0
- package/src/index.d.ts +0 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -0
package/README.md
ADDED
package/generators.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acorex/platform-generator",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"dependencies": {
|
|
5
|
+
"@nx/devkit": "19.2.2",
|
|
6
|
+
"tslib": "^2.3.0"
|
|
7
|
+
},
|
|
8
|
+
"type": "commonjs",
|
|
9
|
+
"main": "./src/index.js",
|
|
10
|
+
"typings": "./src/index.d.ts",
|
|
11
|
+
"generators": "./generators.json"
|
|
12
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": ["../../.eslintrc.json"],
|
|
3
|
+
"ignorePatterns": ["!**/*"],
|
|
4
|
+
"overrides": [
|
|
5
|
+
{
|
|
6
|
+
"files": ["*.ts"],
|
|
7
|
+
"rules": {
|
|
8
|
+
"@angular-eslint/directive-selector": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
"type": "attribute",
|
|
12
|
+
"prefix": "acorexPlatform",
|
|
13
|
+
"style": "camelCase"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"@angular-eslint/component-selector": [
|
|
17
|
+
"error",
|
|
18
|
+
{
|
|
19
|
+
"type": "element",
|
|
20
|
+
"prefix": "acorex-platform",
|
|
21
|
+
"style": "kebab-case"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"@angular-eslint/component-class-prefix": [
|
|
25
|
+
"error",
|
|
26
|
+
{
|
|
27
|
+
"prefixes": ["acorexPlatform"],
|
|
28
|
+
"style": "kebab-case"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"files": ["*.html"],
|
|
36
|
+
"extends": ["plugin:@nx/angular-template"],
|
|
37
|
+
"rules": {}
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export default {
|
|
3
|
+
displayName: '<%= name %>',
|
|
4
|
+
preset: '../../jest.preset.js',
|
|
5
|
+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
|
|
6
|
+
coverageDirectory: '../../coverage/apps/<%= name %>',
|
|
7
|
+
transform: {
|
|
8
|
+
'^.+\\.(ts|mjs|js|html)$': [
|
|
9
|
+
'jest-preset-angular',
|
|
10
|
+
{
|
|
11
|
+
tsconfig: '<rootDir>/tsconfig.spec.json',
|
|
12
|
+
stringifyContentPathRegex: '\\.(html|svg)$',
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
|
|
17
|
+
snapshotSerializers: [
|
|
18
|
+
'jest-preset-angular/build/serializers/no-ng-attributes',
|
|
19
|
+
'jest-preset-angular/build/serializers/ng-snapshot',
|
|
20
|
+
'jest-preset-angular/build/serializers/html-comment',
|
|
21
|
+
],
|
|
22
|
+
};
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= name %>",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"projectType": "application",
|
|
5
|
+
"prefix": "acorex-platform",
|
|
6
|
+
"sourceRoot": "apps/<%= name %>/src",
|
|
7
|
+
"tags": [],
|
|
8
|
+
"targets": {
|
|
9
|
+
"build": {
|
|
10
|
+
"executor": "@angular-devkit/build-angular:browser",
|
|
11
|
+
"outputs": [
|
|
12
|
+
"{options.outputPath}"
|
|
13
|
+
],
|
|
14
|
+
"options": {
|
|
15
|
+
"outputPath": "dist/apps/<%= name %>",
|
|
16
|
+
"index": "apps/<%= name %>/src/index.html",
|
|
17
|
+
"main": "apps/<%= name %>/src/main.ts",
|
|
18
|
+
"polyfills": [
|
|
19
|
+
"zone.js"
|
|
20
|
+
],
|
|
21
|
+
"tsConfig": "apps/<%= name %>/tsconfig.app.json",
|
|
22
|
+
"assets": [
|
|
23
|
+
"apps/<%= name %>/src/favicon.ico",
|
|
24
|
+
"apps/<%= name %>/src/assets"
|
|
25
|
+
],
|
|
26
|
+
"styles": [
|
|
27
|
+
"apps/<%= name %>/src/styles.scss"
|
|
28
|
+
],
|
|
29
|
+
"scripts": []
|
|
30
|
+
},
|
|
31
|
+
"configurations": {
|
|
32
|
+
"build-prod": {
|
|
33
|
+
"fileReplacements": [
|
|
34
|
+
{
|
|
35
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
36
|
+
"with": "apps/<%= name %>/src/environments/environment.prod.ts"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"budgets": [
|
|
40
|
+
{
|
|
41
|
+
"type": "initial",
|
|
42
|
+
"maximumWarning": "500kb",
|
|
43
|
+
"maximumError": "5mb"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "anyComponentStyle",
|
|
47
|
+
"maximumWarning": "200kb",
|
|
48
|
+
"maximumError": "400kb"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"outputHashing": "all",
|
|
52
|
+
"sourceMap": false,
|
|
53
|
+
"optimization": true,
|
|
54
|
+
"namedChunks": false,
|
|
55
|
+
"vendorChunk": true,
|
|
56
|
+
"buildOptimizer": true,
|
|
57
|
+
"aot": true,
|
|
58
|
+
"commonChunk": true,
|
|
59
|
+
"extractLicenses": true
|
|
60
|
+
},
|
|
61
|
+
"build-test": {
|
|
62
|
+
"fileReplacements": [
|
|
63
|
+
{
|
|
64
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
65
|
+
"with": "apps/<%= name %>/src/environments/environment.test.ts"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"budgets": [
|
|
69
|
+
{
|
|
70
|
+
"type": "initial",
|
|
71
|
+
"maximumWarning": "500kb",
|
|
72
|
+
"maximumError": "5mb"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "anyComponentStyle",
|
|
76
|
+
"maximumWarning": "200kb",
|
|
77
|
+
"maximumError": "400kb"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"outputHashing": "all",
|
|
81
|
+
"sourceMap": false,
|
|
82
|
+
"optimization": true,
|
|
83
|
+
"namedChunks": false,
|
|
84
|
+
"vendorChunk": true,
|
|
85
|
+
"buildOptimizer": true,
|
|
86
|
+
"aot": true,
|
|
87
|
+
"commonChunk": true,
|
|
88
|
+
"extractLicenses": true
|
|
89
|
+
},
|
|
90
|
+
"build-dev": {
|
|
91
|
+
"fileReplacements": [
|
|
92
|
+
{
|
|
93
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
94
|
+
"with": "apps/<%= name %>/src/environments/environment.dev.ts"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"budgets": [
|
|
98
|
+
{
|
|
99
|
+
"type": "initial",
|
|
100
|
+
"maximumWarning": "500kb",
|
|
101
|
+
"maximumError": "5mb"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"type": "anyComponentStyle",
|
|
105
|
+
"maximumWarning": "200kb",
|
|
106
|
+
"maximumError": "400kb"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"outputHashing": "all",
|
|
110
|
+
"sourceMap": false,
|
|
111
|
+
"optimization": true,
|
|
112
|
+
"namedChunks": false,
|
|
113
|
+
"vendorChunk": true,
|
|
114
|
+
"buildOptimizer": true,
|
|
115
|
+
"aot": true,
|
|
116
|
+
"commonChunk": true,
|
|
117
|
+
"extractLicenses": true
|
|
118
|
+
},
|
|
119
|
+
"serve-prod": {
|
|
120
|
+
"fileReplacements": [
|
|
121
|
+
{
|
|
122
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
123
|
+
"with": "apps/<%= name %>/src/environments/environment.prod.ts"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"budgets": [
|
|
127
|
+
{
|
|
128
|
+
"type": "initial",
|
|
129
|
+
"maximumWarning": "500kb",
|
|
130
|
+
"maximumError": "8mb"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "anyComponentStyle",
|
|
134
|
+
"maximumWarning": "200kb",
|
|
135
|
+
"maximumError": "400kb"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"buildOptimizer": false,
|
|
139
|
+
"optimization": false,
|
|
140
|
+
"vendorChunk": true,
|
|
141
|
+
"extractLicenses": false,
|
|
142
|
+
"sourceMap": true,
|
|
143
|
+
"namedChunks": true
|
|
144
|
+
},
|
|
145
|
+
"serve-test": {
|
|
146
|
+
"fileReplacements": [
|
|
147
|
+
{
|
|
148
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
149
|
+
"with": "apps/<%= name %>/src/environments/environment.test.ts"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"budgets": [
|
|
153
|
+
{
|
|
154
|
+
"type": "initial",
|
|
155
|
+
"maximumWarning": "500kb",
|
|
156
|
+
"maximumError": "8mb"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"type": "anyComponentStyle",
|
|
160
|
+
"maximumWarning": "200kb",
|
|
161
|
+
"maximumError": "400kb"
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
"buildOptimizer": false,
|
|
165
|
+
"optimization": false,
|
|
166
|
+
"vendorChunk": true,
|
|
167
|
+
"extractLicenses": false,
|
|
168
|
+
"sourceMap": true,
|
|
169
|
+
"namedChunks": true
|
|
170
|
+
},
|
|
171
|
+
"serve-dev": {
|
|
172
|
+
"fileReplacements": [
|
|
173
|
+
{
|
|
174
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
175
|
+
"with": "apps/<%= name %>/src/environments/environment.dev.ts"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"budgets": [
|
|
179
|
+
{
|
|
180
|
+
"type": "initial",
|
|
181
|
+
"maximumWarning": "500kb",
|
|
182
|
+
"maximumError": "8mb"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"type": "anyComponentStyle",
|
|
186
|
+
"maximumWarning": "200kb",
|
|
187
|
+
"maximumError": "400kb"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"buildOptimizer": false,
|
|
191
|
+
"optimization": false,
|
|
192
|
+
"vendorChunk": true,
|
|
193
|
+
"extractLicenses": false,
|
|
194
|
+
"sourceMap": true,
|
|
195
|
+
"namedChunks": true
|
|
196
|
+
},
|
|
197
|
+
"serve-local": {
|
|
198
|
+
"fileReplacements": [
|
|
199
|
+
{
|
|
200
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
201
|
+
"with": "apps/<%= name %>/src/environments/environment.local.ts"
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"budgets": [
|
|
205
|
+
{
|
|
206
|
+
"type": "initial",
|
|
207
|
+
"maximumWarning": "500kb",
|
|
208
|
+
"maximumError": "8mb"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"type": "anyComponentStyle",
|
|
212
|
+
"maximumWarning": "200kb",
|
|
213
|
+
"maximumError": "400kb"
|
|
214
|
+
}
|
|
215
|
+
],
|
|
216
|
+
"buildOptimizer": false,
|
|
217
|
+
"optimization": false,
|
|
218
|
+
"vendorChunk": true,
|
|
219
|
+
"extractLicenses": false,
|
|
220
|
+
"sourceMap": true,
|
|
221
|
+
"namedChunks": true
|
|
222
|
+
},
|
|
223
|
+
"serve-test-local": {
|
|
224
|
+
"fileReplacements": [
|
|
225
|
+
{
|
|
226
|
+
"replace": "apps/<%= name %>/src/environments/environment.ts",
|
|
227
|
+
"with": "apps/<%= name %>/src/environments/environment.test.local.ts"
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"budgets": [
|
|
231
|
+
{
|
|
232
|
+
"type": "initial",
|
|
233
|
+
"maximumWarning": "500kb",
|
|
234
|
+
"maximumError": "8mb"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "anyComponentStyle",
|
|
238
|
+
"maximumWarning": "200kb",
|
|
239
|
+
"maximumError": "400kb"
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"buildOptimizer": false,
|
|
243
|
+
"optimization": false,
|
|
244
|
+
"vendorChunk": true,
|
|
245
|
+
"extractLicenses": false,
|
|
246
|
+
"sourceMap": true,
|
|
247
|
+
"namedChunks": true
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"defaultConfiguration": "serve:prod"
|
|
251
|
+
},
|
|
252
|
+
"serve": {
|
|
253
|
+
"executor": "@angular-devkit/build-angular:dev-server",
|
|
254
|
+
"configurations": {
|
|
255
|
+
"serve-prod": {
|
|
256
|
+
"browserTarget": "<%= name %>:build:serve-prod"
|
|
257
|
+
},
|
|
258
|
+
"serve-test": {
|
|
259
|
+
"browserTarget": "<%= name %>:build:serve-test"
|
|
260
|
+
},
|
|
261
|
+
"serve-dev": {
|
|
262
|
+
"browserTarget": "<%= name %>:build:serve-dev"
|
|
263
|
+
},
|
|
264
|
+
"serve-local": {
|
|
265
|
+
"browserTarget": "<%= name %>:build:serve-local"
|
|
266
|
+
},
|
|
267
|
+
"serve-test-local": {
|
|
268
|
+
"browserTarget": "<%= name %>:build:serve-test-local"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"defaultConfiguration": "development"
|
|
272
|
+
},
|
|
273
|
+
"extract-i18n": {
|
|
274
|
+
"executor": "@angular-devkit/build-angular:extract-i18n",
|
|
275
|
+
"options": {
|
|
276
|
+
"browserTarget": "<%= name %>:build"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"lint": {
|
|
280
|
+
"executor": "@nx/linter:eslint",
|
|
281
|
+
"outputs": [
|
|
282
|
+
"{options.outputFile}"
|
|
283
|
+
],
|
|
284
|
+
"options": {
|
|
285
|
+
"lintFilePatterns": [
|
|
286
|
+
"apps/<%= name %>/**/*.ts",
|
|
287
|
+
"apps/<%= name %>/**/*.html"
|
|
288
|
+
]
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"test": {
|
|
292
|
+
"executor": "@nx/jest:jest",
|
|
293
|
+
"outputs": [
|
|
294
|
+
"{workspaceRoot}/coverage/{projectRoot}"
|
|
295
|
+
],
|
|
296
|
+
"options": {
|
|
297
|
+
"jestConfig": "apps/<%= name %>/jest.config.ts",
|
|
298
|
+
"passWithNoTests": true
|
|
299
|
+
},
|
|
300
|
+
"configurations": {
|
|
301
|
+
"ci": {
|
|
302
|
+
"ci": true,
|
|
303
|
+
"codeCoverage": true
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AXDialogModule } from '@acorex/components/dialog';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { HTTP_INTERCEPTORS, provideHttpClient } from '@angular/common/http';
|
|
4
|
+
import { APP_INITIALIZER, NgModule, isDevMode } from '@angular/core';
|
|
5
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
6
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
7
|
+
import { RouterModule, provideRouter, withEnabledBlockingInitialNavigation } from '@angular/router';
|
|
8
|
+
import { EffectsModule } from '@ngrx/effects';
|
|
9
|
+
import { StoreModule } from '@ngrx/store';
|
|
10
|
+
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
11
|
+
import { AppComponent } from './app.component';
|
|
12
|
+
import { appRoutes } from './app.routes';
|
|
13
|
+
import { headerInterceptorInterceptor } from './header-interceptor.interceptor';
|
|
14
|
+
|
|
15
|
+
import { AXFormatModule } from '@acorex/core/format';
|
|
16
|
+
import { AXValidationModule } from '@acorex/core/validation';
|
|
17
|
+
import {
|
|
18
|
+
AXPImageUrlLogoConfig,
|
|
19
|
+
AXPTextLogoConfig,
|
|
20
|
+
AXP_PLATFORM_CONFIG_TOKEN,
|
|
21
|
+
configPlatform,
|
|
22
|
+
} from '@acorex/platform/common';
|
|
23
|
+
import { AXPAuthRootModule } from './modules/auth/auth-root.module';
|
|
24
|
+
import { AXPTranslationRootModule } from './modules/common/translation-root.module';
|
|
25
|
+
import { AXPLayoutRootModule } from './modules/layout/layout-root.module';
|
|
26
|
+
|
|
27
|
+
import { AXLoadingDialogModule } from '@acorex/components/loading-dialog';
|
|
28
|
+
import { AXP_ROOT_CONFIG_TOKEN } from '@acorex/platform/core';
|
|
29
|
+
import { environment } from '../environments/environment';
|
|
30
|
+
|
|
31
|
+
export function initApp() {
|
|
32
|
+
return () => {
|
|
33
|
+
const loadingText = document.querySelector('#loadingText');
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
if (loadingText) loadingText.innerHTML = 'Initializing Modules...';
|
|
36
|
+
resolve(0);
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@NgModule({
|
|
43
|
+
imports: [
|
|
44
|
+
BrowserAnimationsModule,
|
|
45
|
+
BrowserModule,
|
|
46
|
+
CommonModule,
|
|
47
|
+
RouterModule.forRoot(appRoutes, {
|
|
48
|
+
bindToComponentInputs: true,
|
|
49
|
+
onSameUrlNavigation: 'reload',
|
|
50
|
+
}),
|
|
51
|
+
StoreModule.forRoot([]),
|
|
52
|
+
EffectsModule.forRoot(),
|
|
53
|
+
AXFormatModule.forRoot(),
|
|
54
|
+
AXValidationModule.forRoot(),
|
|
55
|
+
//
|
|
56
|
+
AXPTranslationRootModule,
|
|
57
|
+
AXPLayoutRootModule,
|
|
58
|
+
AXDialogModule,
|
|
59
|
+
AXLoadingDialogModule,
|
|
60
|
+
//
|
|
61
|
+
AXPAuthRootModule,
|
|
62
|
+
//
|
|
63
|
+
StoreDevtoolsModule.instrument({
|
|
64
|
+
maxAge: 25, // Retains last 25 states
|
|
65
|
+
logOnly: !isDevMode(), // Restrict extension to log-only mode
|
|
66
|
+
autoPause: true, // Pauses recording actions and state changes when the extension window is not open
|
|
67
|
+
trace: false, // If set to true, will include stack trace for every dispatched action, so you can see it in trace tab jumping directly to that part of code
|
|
68
|
+
traceLimit: 75, // maximum stack trace frames to be stored (in case trace option was provided as true)
|
|
69
|
+
connectInZone: false, // If set to true, the connection is established outside the Angular zone for better performance
|
|
70
|
+
}),
|
|
71
|
+
],
|
|
72
|
+
providers: [
|
|
73
|
+
provideHttpClient(),
|
|
74
|
+
provideRouter(appRoutes, withEnabledBlockingInitialNavigation()),
|
|
75
|
+
{ provide: APP_INITIALIZER, useFactory: initApp, multi: true, deps: [] },
|
|
76
|
+
{ provide: HTTP_INTERCEPTORS, useClass: headerInterceptorInterceptor, multi: true },
|
|
77
|
+
{
|
|
78
|
+
provide: AXP_ROOT_CONFIG_TOKEN, useValue: {
|
|
79
|
+
baseUrl: environment.baseUrl
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
provide: AXP_PLATFORM_CONFIG_TOKEN,
|
|
84
|
+
useValue: configPlatform({
|
|
85
|
+
logo: {
|
|
86
|
+
light: new AXPTextLogoConfig('<%= title %>'),
|
|
87
|
+
colored: new AXPImageUrlLogoConfig('assets/logos/logo.png'),
|
|
88
|
+
//colored: new AXPImageUrlLogoConfig('assets/logos/logo-colored.svg'),
|
|
89
|
+
},
|
|
90
|
+
title: '<%= title %>',
|
|
91
|
+
copyright:
|
|
92
|
+
'Copyright © 2024',
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
declarations: [AppComponent],
|
|
97
|
+
bootstrap: [AppComponent],
|
|
98
|
+
})
|
|
99
|
+
export class AppModule { }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AXPAdminLayoutComponent, AX_ADMIN_ROUTES } from '@acorex/platform/layouts';
|
|
2
|
+
import { Route } from '@angular/router';
|
|
3
|
+
|
|
4
|
+
export const appRoutes: Route[] = [
|
|
5
|
+
{
|
|
6
|
+
path: '',
|
|
7
|
+
pathMatch: 'full',
|
|
8
|
+
redirectTo: '<%= name %>'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
path: '',
|
|
12
|
+
component: AXPAdminLayoutComponent,
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
path: '<%= name %>',
|
|
16
|
+
loadChildren: () => import('./modules/<%= name %>/<%= name %>-root.module').then(c => c.<%= upperCase(name) %>RootModule)
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
path: '',
|
|
20
|
+
children: [
|
|
21
|
+
...AX_ADMIN_ROUTES
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AXPSessionService } from '@acorex/platform/auth';
|
|
2
|
+
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
|
3
|
+
import { Injectable, inject } from '@angular/core';
|
|
4
|
+
import { Observable, of, switchMap } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class headerInterceptorInterceptor implements HttpInterceptor {
|
|
8
|
+
private sessionService = inject(AXPSessionService);
|
|
9
|
+
|
|
10
|
+
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
|
11
|
+
return this.sessionService
|
|
12
|
+
.getToken()
|
|
13
|
+
.pipe(
|
|
14
|
+
switchMap((token) => {
|
|
15
|
+
let modifiedReq = req.clone();
|
|
16
|
+
if (!(req.body instanceof FormData) && !req.headers.has('Content-Type')) {
|
|
17
|
+
modifiedReq = modifiedReq.clone({ setHeaders: { 'Content-Type': 'application/json' } });
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (token) {
|
|
21
|
+
modifiedReq = modifiedReq.clone({ setHeaders: { Authorization: `Bearer ${token}` } });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return next.handle(modifiedReq);
|
|
25
|
+
})
|
|
26
|
+
)
|
|
27
|
+
.pipe(
|
|
28
|
+
switchMap((response: HttpEvent<any>) => {
|
|
29
|
+
return of(response);
|
|
30
|
+
})
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AXPApplication, AXPApplicationLoader, AXPSessionContext } from '@acorex/platform/auth';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { Observable, delay, of } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
@Injectable()
|
|
6
|
+
export class <%= upperCase(name) %>ApplicationLoader implements AXPApplicationLoader {
|
|
7
|
+
|
|
8
|
+
getList(context: AXPSessionContext): Observable < AXPApplication[] > {
|
|
9
|
+
const <%= name %>_app =
|
|
10
|
+
{
|
|
11
|
+
id: '1',
|
|
12
|
+
name: '<%= name %>',
|
|
13
|
+
title: '<%= upperCase(name) %> Application',
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
editionName: 'Standard',
|
|
16
|
+
};
|
|
17
|
+
const console_app =
|
|
18
|
+
{
|
|
19
|
+
id: '1',
|
|
20
|
+
name: 'platform',
|
|
21
|
+
title: 'Platform Console',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
editionName: 'Standard',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (context.user?.name == 'Root' && context.tenant?.id == '99') {
|
|
27
|
+
return of([<%= name %>_app, console_app]).pipe(delay(500));
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
return of([<%= name %>_app]).pipe(delay(500));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AXMAuthModule, AXMAuthenticationTypes, AXM_AUTH_CONFIG_TOKEN, configAuthModule } from '@acorex/modules/auth';
|
|
2
|
+
import { AXPAuthModule, AXP_APPLICATION_LOADER, AXP_FEATURE_LOADER, AXP_PERMISSION_LOADER, AXP_TENANT_LOADER } from '@acorex/platform/auth';
|
|
3
|
+
import { NgModule } from '@angular/core';
|
|
4
|
+
import { environment } from '../../../environments/environment';
|
|
5
|
+
import { <%= upperCase(name) %>TenantLoader } from './tenant.loader';
|
|
6
|
+
import { <%= upperCase(name) %>ApplicationLoader } from './application.loader';
|
|
7
|
+
import { <%= upperCase(name) %>PermissionLoader } from './permission.loader';
|
|
8
|
+
import { <%= upperCase(name) %>FeatureLoader } from './feature.loader';
|
|
9
|
+
import { <%= upperCase(name) %>Strategy } from './auth.strategy';
|
|
10
|
+
|
|
11
|
+
@NgModule({
|
|
12
|
+
imports: [
|
|
13
|
+
AXMAuthModule.forRoot(),
|
|
14
|
+
AXPAuthModule.forRoot({
|
|
15
|
+
strategies: [<%= upperCase(name) %>Strategy],
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
exports: [],
|
|
19
|
+
providers: [
|
|
20
|
+
{
|
|
21
|
+
provide: AXM_AUTH_CONFIG_TOKEN,
|
|
22
|
+
useValue: configAuthModule({
|
|
23
|
+
type: AXMAuthenticationTypes.UsernameEmailPassword,
|
|
24
|
+
oidc_settings: { ...environment.oidcConfig },
|
|
25
|
+
signinPage: {
|
|
26
|
+
description: `In this kind of post, the blogger introduces a person they’ve
|
|
27
|
+
interviewed and provides some background information about the
|
|
28
|
+
interviewee and their work following this is a transcript of the
|
|
29
|
+
interview.`,
|
|
30
|
+
slogan: 'Fast, Efficient and Productive',
|
|
31
|
+
},
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
provide: AXP_TENANT_LOADER,
|
|
36
|
+
useClass: <%= upperCase(name) %>TenantLoader,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
provide: AXP_APPLICATION_LOADER,
|
|
40
|
+
useClass: <%= upperCase(name) %>ApplicationLoader,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
provide: AXP_PERMISSION_LOADER,
|
|
44
|
+
useClass: <%= upperCase(name) %>PermissionLoader,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
provide: AXP_FEATURE_LOADER,
|
|
48
|
+
useClass: <%= upperCase(name) %>FeatureLoader,
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
})
|
|
52
|
+
export class AXPAuthRootModule { }
|