@acorex/platform-generator 21.0.0-next.3 → 21.0.0-next.31

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.
Files changed (34) hide show
  1. package/README.md +67 -6
  2. package/package.json +9 -3
  3. package/src/bin/create-acorex-app.js +116 -0
  4. package/src/bin/standalone-scaffold.js +533 -0
  5. package/src/generators/app-module/files/project.json.template +194 -48
  6. package/src/generators/app-module/files/src/app/app.config.api.ts.template +145 -0
  7. package/src/generators/app-module/files/src/app/app.config.full.ts.template +216 -0
  8. package/src/generators/app-module/files/src/app/app.config.minimal.ts.template +162 -0
  9. package/src/generators/app-module/files/src/app/app.routes.ts.template +1 -1
  10. package/src/generators/app-module/files/src/app/modules/common/default-settings.providers.ts.template +16 -8
  11. package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +3 -6
  12. package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +1 -1
  13. package/src/generators/app-module/files/src/assets/i18n/en-US/activity-log.json +10 -1
  14. package/src/generators/app-module/files/src/assets/i18n/en-US/auth.json +12 -0
  15. package/src/generators/app-module/files/src/assets/i18n/en-US/data-management.json +4 -0
  16. package/src/generators/app-module/files/src/assets/i18n/en-US/general.json +5 -0
  17. package/src/generators/app-module/files/src/assets/i18n/en-US/questionnaire.json +77 -0
  18. package/src/generators/app-module/files/src/assets/i18n/fa-IR/activity-log.json +10 -1
  19. package/src/generators/app-module/files/src/assets/i18n/fa-IR/auth.json +12 -0
  20. package/src/generators/app-module/files/src/assets/i18n/fa-IR/data-management.json +5 -1
  21. package/src/generators/app-module/files/src/assets/i18n/fa-IR/general.json +7 -3
  22. package/src/generators/app-module/files/src/assets/i18n/fa-IR/human-capital-management.json +4 -7
  23. package/src/generators/app-module/files/src/assets/i18n/fa-IR/questionnaire.json +77 -0
  24. package/src/generators/app-module/files/src/environments/environment.dev.ts.template +45 -16
  25. package/src/generators/app-module/files/src/environments/environment.prod.ts.template +33 -0
  26. package/src/generators/app-module/files/src/environments/environment.ts.template +23 -7
  27. package/src/generators/app-module/files/src/main.ts.template +42 -2
  28. package/src/generators/app-module/generator.d.ts +10 -1
  29. package/src/generators/app-module/generator.js +100 -12
  30. package/src/generators/app-module/generator.js.map +1 -1
  31. package/src/generators/app-module/schema.d.ts +28 -0
  32. package/src/generators/app-module/schema.json +74 -5
  33. package/src/generators/standalone-workspace/versions.json +53 -0
  34. package/src/generators/app-module/files/src/app/app.config.ts.template +0 -158
@@ -8,32 +8,144 @@
8
8
  "targets": {
9
9
  "build": {
10
10
  "executor": "@angular-devkit/build-angular:browser",
11
- "outputs": [
12
- "{options.outputPath}"
13
- ],
11
+ "outputs": ["{options.outputPath}"],
14
12
  "options": {
15
13
  "outputPath": "dist/apps/<%= name %>",
16
14
  "index": "apps/<%= name %>/src/index.html",
17
15
  "main": "apps/<%= name %>/src/main.ts",
18
- "polyfills": [
19
- "zone.js"
20
- ],
16
+ "polyfills": ["zone.js"],
21
17
  "tsConfig": "apps/<%= name %>/tsconfig.app.json",
22
18
  "assets": [
19
+ {
20
+ "glob": "**/*",
21
+ "input": "libs/modules/assets",
22
+ "output": "/assets"
23
+ },
23
24
  "apps/<%= name %>/src/favicon.ico",
24
25
  "apps/<%= name %>/src/assets"
25
26
  ],
26
- "styles": [
27
- "apps/<%= name %>/src/styles.scss"
27
+ "styles": ["apps/<%= name %>/src/styles.scss"],
28
+ "scripts": [],
29
+ "allowedCommonJsDependencies": [
30
+ "html2canvas",
31
+ "dom-to-image",
32
+ "lodash",
33
+ "qrcode",
34
+ "leaflet",
35
+ "quill-delta-to-html",
36
+ "memoizee",
37
+ "quill-delta"
38
+ ]
39
+ },
40
+ "configurations": {
41
+ "production": {
42
+ "optimization": true,
43
+ "outputHashing": "all",
44
+ "sourceMap": false,
45
+ "extractLicenses": true
46
+ },
47
+ "build-prod": {
48
+ "fileReplacements": [],
49
+ "budgets": [
50
+ {
51
+ "type": "initial",
52
+ "maximumWarning": "500kb",
53
+ "maximumError": "100mb"
54
+ },
55
+ {
56
+ "type": "anyComponentStyle",
57
+ "maximumWarning": "200kb",
58
+ "maximumError": "100mb"
59
+ }
60
+ ],
61
+ "optimization": {
62
+ "scripts": true,
63
+ "styles": {
64
+ "minify": true,
65
+ "inlineCritical": true
66
+ },
67
+ "fonts": true
68
+ },
69
+ "sourceMap": false,
70
+ "namedChunks": false,
71
+ "extractLicenses": true,
72
+ "buildOptimizer": true,
73
+ "outputHashing": "all"
74
+ }
75
+ },
76
+ "defaultConfiguration": "build-prod"
77
+ },
78
+
79
+ "build-esbuild": {
80
+ "executor": "@angular-devkit/build-angular:application",
81
+ "outputs": ["{options.outputPath}"],
82
+ "options": {
83
+ "outputPath": "dist/apps/<%= name %>",
84
+ "index": "apps/<%= name %>/src/index.html",
85
+ "browser": "apps/<%= name %>/src/main.ts",
86
+ "polyfills": ["zone.js"],
87
+ "tsConfig": "apps/<%= name %>/tsconfig.app.json",
88
+ "assets": [
89
+ {
90
+ "glob": "**/*",
91
+ "input": "libs/modules/assets",
92
+ "output": "/assets"
93
+ },
94
+ "apps/<%= name %>/src/favicon.ico",
95
+ "apps/<%= name %>/src/assets"
28
96
  ],
29
- "scripts": []
97
+ "styles": ["apps/<%= name %>/src/styles.scss"],
98
+ "scripts": [],
99
+ "allowedCommonJsDependencies": [
100
+ "html2canvas",
101
+ "dom-to-image",
102
+ "lodash",
103
+ "qrcode",
104
+ "leaflet",
105
+ "quill-delta-to-html",
106
+ "memoizee",
107
+ "quill-delta"
108
+ ]
30
109
  },
31
110
  "configurations": {
111
+ "production": {
112
+ "optimization": true,
113
+ "outputHashing": "all",
114
+ "sourceMap": false,
115
+ "extractLicenses": true
116
+ },
32
117
  "build-prod": {
118
+ "fileReplacements": [],
119
+ "budgets": [
120
+ {
121
+ "type": "initial",
122
+ "maximumWarning": "500kb",
123
+ "maximumError": "100mb"
124
+ },
125
+ {
126
+ "type": "anyComponentStyle",
127
+ "maximumWarning": "200kb",
128
+ "maximumError": "100mb"
129
+ }
130
+ ],
131
+ "optimization": {
132
+ "scripts": true,
133
+ "styles": {
134
+ "minify": true,
135
+ "inlineCritical": true
136
+ },
137
+ "fonts": true
138
+ },
139
+ "sourceMap": false,
140
+ "namedChunks": false,
141
+ "extractLicenses": true,
142
+ "outputHashing": "all"
143
+ },
144
+ "build-dev": {
33
145
  "fileReplacements": [
34
146
  {
35
147
  "replace": "apps/<%= name %>/src/environments/environment.ts",
36
- "with": "apps/<%= name %>/src/environments/environment.prod.ts"
148
+ "with": "apps/<%= name %>/src/environments/environment.dev.ts"
37
149
  }
38
150
  ],
39
151
  "budgets": [
@@ -51,18 +163,18 @@
51
163
  "outputHashing": "all",
52
164
  "sourceMap": false,
53
165
  "optimization": true,
54
- "namedChunks": false,
55
- "vendorChunk": true,
56
- "buildOptimizer": true,
57
- "aot": true,
58
- "commonChunk": true,
59
- "extractLicenses": true
166
+ "namedChunks": false
60
167
  },
61
- "build-dev": {
168
+ <% if (includeApiConfig) { %>
169
+ "build-dev-api": {
62
170
  "fileReplacements": [
63
171
  {
64
172
  "replace": "apps/<%= name %>/src/environments/environment.ts",
65
173
  "with": "apps/<%= name %>/src/environments/environment.dev.ts"
174
+ },
175
+ {
176
+ "replace": "apps/<%= name %>/src/app/app.config.ts",
177
+ "with": "apps/<%= name %>/src/app/app.config.api.ts"
66
178
  }
67
179
  ],
68
180
  "budgets": [
@@ -80,13 +192,9 @@
80
192
  "outputHashing": "all",
81
193
  "sourceMap": false,
82
194
  "optimization": true,
83
- "namedChunks": false,
84
- "vendorChunk": true,
85
- "buildOptimizer": true,
86
- "aot": true,
87
- "commonChunk": true,
88
- "extractLicenses": true
195
+ "namedChunks": false
89
196
  },
197
+ <% } %>
90
198
  "serve-prod": {
91
199
  "fileReplacements": [
92
200
  {
@@ -106,10 +214,7 @@
106
214
  "maximumError": "400kb"
107
215
  }
108
216
  ],
109
- "buildOptimizer": false,
110
217
  "optimization": false,
111
- "vendorChunk": true,
112
- "extractLicenses": false,
113
218
  "sourceMap": true,
114
219
  "namedChunks": true
115
220
  },
@@ -120,6 +225,39 @@
120
225
  "with": "apps/<%= name %>/src/environments/environment.dev.ts"
121
226
  }
122
227
  ],
228
+ "budgets": [
229
+ {
230
+ "type": "initial",
231
+ "maximumWarning": "10mb",
232
+ "maximumError": "15mb"
233
+ },
234
+ {
235
+ "type": "anyComponentStyle",
236
+ "maximumWarning": "200kb",
237
+ "maximumError": "400kb"
238
+ }
239
+ ],
240
+ "optimization": false,
241
+ "sourceMap": {
242
+ "scripts": true,
243
+ "styles": false
244
+ },
245
+ "namedChunks": false,
246
+ "progress": false,
247
+ "watch": true,
248
+ "poll": 2000
249
+ }<% if (includeApiConfig) { %>,
250
+ "serve-dev-api": {
251
+ "fileReplacements": [
252
+ {
253
+ "replace": "apps/<%= name %>/src/environments/environment.ts",
254
+ "with": "apps/<%= name %>/src/environments/environment.dev.ts"
255
+ },
256
+ {
257
+ "replace": "apps/<%= name %>/src/app/app.config.ts",
258
+ "with": "apps/<%= name %>/src/app/app.config.api.ts"
259
+ }
260
+ ],
123
261
  "budgets": [
124
262
  {
125
263
  "type": "initial",
@@ -132,54 +270,62 @@
132
270
  "maximumError": "400kb"
133
271
  }
134
272
  ],
135
- "buildOptimizer": false,
136
273
  "optimization": false,
137
- "vendorChunk": true,
138
- "extractLicenses": false,
139
- "sourceMap": true,
140
- "namedChunks": true
141
- },
274
+ "sourceMap": false,
275
+ "namedChunks": false,
276
+ "progress": false,
277
+ "watch": true,
278
+ "poll": 2000
279
+ }<% } %>
142
280
  },
143
- "defaultConfiguration": "serve:prod"
281
+ "defaultConfiguration": "build-dev"
144
282
  },
283
+
145
284
  "serve": {
146
285
  "executor": "@angular-devkit/build-angular:dev-server",
286
+ "options": {
287
+ "buildTarget": "<%= name %>:build-esbuild:serve-dev",
288
+ "hmr": true,
289
+ "liveReload": true,
290
+ "poll": 2000
291
+ },
147
292
  "configurations": {
148
293
  "serve-prod": {
149
- "buildTarget": "<%= name %>:build:serve-prod"
294
+ "buildTarget": "<%= name %>:build-esbuild:serve-prod"
150
295
  },
151
296
  "serve-dev": {
152
- "buildTarget": "<%= name %>:build:serve-dev"
153
- },
297
+ "buildTarget": "<%= name %>:build-esbuild:serve-dev"
298
+ }<% if (includeApiConfig) { %>,
299
+ "serve-dev-api": {
300
+ "buildTarget": "<%= name %>:build-esbuild:serve-dev-api"
301
+ }<% } %>
154
302
  },
155
- "defaultConfiguration": "development"
303
+ "defaultConfiguration": "serve-dev",
304
+ "continuous": true
156
305
  },
306
+
157
307
  "extract-i18n": {
158
308
  "executor": "@angular-devkit/build-angular:extract-i18n",
159
309
  "options": {
160
310
  "buildTarget": "<%= name %>:build"
161
311
  }
162
312
  },
313
+
163
314
  "lint": {
164
315
  "executor": "@nx/linter:eslint",
165
- "outputs": [
166
- "{options.outputFile}"
167
- ],
316
+ "outputs": ["{options.outputFile}"],
168
317
  "options": {
169
- "lintFilePatterns": [
170
- "apps/<%= name %>/**/*.ts",
171
- "apps/<%= name %>/**/*.html"
172
- ]
318
+ "lintFilePatterns": ["apps/<%= name %>/**/*.ts", "apps/<%= name %>/**/*.html"]
173
319
  }
174
320
  },
321
+
175
322
  "test": {
176
323
  "executor": "@nx/jest:jest",
177
- "outputs": [
178
- "{workspaceRoot}/coverage/{projectRoot}"
179
- ],
324
+ "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
180
325
  "options": {
181
326
  "jestConfig": "apps/<%= name %>/jest.config.ts",
182
- "passWithNoTests": true
327
+ "passWithNoTests": true,
328
+ "tsConfig": "apps/<%= name %>/tsconfig.spec.json"
183
329
  },
184
330
  "configurations": {
185
331
  "ci": {
@@ -0,0 +1,145 @@
1
+ import { AXDialogModule } from '@acorex/components/dialog';
2
+ import { AXLoadingDialogModule } from '@acorex/components/loading-dialog';
3
+ import { AXCApiModule, AXCAPIOidcStrategy } from '@acorex/connectivity/api';
4
+ import { AXFormatModule } from '@acorex/core/format';
5
+ import { AXValidationModule } from '@acorex/core/validation';
6
+ import { AXMCalendarManagementModule } from '@acorex/modules/calendar-management';
7
+ import { AXMCommonModule } from '@acorex/modules/common';
8
+ import { AXMContentManagementModule } from '@acorex/modules/content-management';
9
+ import { AXMConversationModule } from '@acorex/modules/conversation';
10
+ import { AXMDashboardManagementModule } from '@acorex/modules/dashboard-management';
11
+ import { AXMDataManagementModule } from '@acorex/modules/data-management';
12
+ import { AXMDocumentManagementModule } from '@acorex/modules/document-management';
13
+ import { AXMFormTemplateManagementModule } from '@acorex/modules/form-template-management';
14
+ import { AXMHelpDeskModule } from '@acorex/modules/help-desk';
15
+ import { AXMLocaleManagementModule } from '@acorex/modules/locale-management';
16
+ import { AXMLocationManagementModule } from '@acorex/modules/location-management';
17
+ import { AXMSystemInsightModule } from '@acorex/modules/system-insight';
18
+ import { AXMNotificationManagementModule } from '@acorex/modules/notification-management';
19
+ import { AXMOrganizationManagementModule } from '@acorex/modules/organization-management';
20
+ import { AXMPlatformManagementModule } from '@acorex/modules/platform-management';
21
+ import { AXMProjectManagementModule } from '@acorex/modules/project-management';
22
+ import { AXMReportManagementModule } from '@acorex/modules/report-management';
23
+ import { AXMSecurityManagementModule } from '@acorex/modules/security-management';
24
+ import { AXMSettingsManagementModule } from '@acorex/modules/settings-management';
25
+ import { AXMTaskManagementModule } from '@acorex/modules/task-management';
26
+ import { AXMLearningManagementModule } from '@acorex/modules/learning-management';
27
+ import { AXMWorkflowManagementModule } from '@acorex/modules/workflow-management';
28
+ import { AXMMeetingManagementModule } from '@acorex/modules/meeting-management';
29
+ import { AXPAuthModule } from '@acorex/platform/auth';
30
+ import {
31
+ AXPHomePageModule,
32
+ AXP_APP_VERSION_PROVIDER,
33
+ AXP_PLATFORM_CONFIG_TOKEN,
34
+ AXP_ROOT_CONFIG_TOKEN,
35
+ ENVIRONMENT,
36
+ configPlatform,
37
+ provideDynamicHomePage,
38
+ } from '@acorex/platform/common';
39
+ import { AXPImageUrlLogoConfig } from '@acorex/platform/core';
40
+ import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
41
+ import { ApplicationConfig, importProvidersFrom } from '@angular/core';
42
+ import { BrowserModule } from '@angular/platform-browser';
43
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
44
+ import { provideRouter, withComponentInputBinding, withEnabledBlockingInitialNavigation } from '@angular/router';
45
+ import { environment } from '../environments/environment';
46
+ import { appRoutes } from './app.routes';
47
+ import { BasicInterceptor } from './basic-interceptor.interceptor';
48
+ import { <%= className %>AuthRootModule } from './modules/auth/auth-root.module';
49
+ import { AXPTranslationRootModule } from './modules/common/translation-root.module';
50
+ import { <%= className %>RootModule } from './modules/<%= name %>/<%= name %>-root.module';
51
+ import { AXPLayoutRootModule } from './modules/layout/layout-root.module';
52
+ import { AXMIdentifierManagementModule } from '@acorex/modules/identifier-management';
53
+ import { <%= constPrefix %>_DEFAULT_SETTINGS_PROVIDERS } from './modules/common/default-settings.providers';
54
+ import { <%= className %>AppVersionProvider } from './modules/common/app-version.provider';
55
+
56
+ export const appConfig: ApplicationConfig = {
57
+ providers: [
58
+ <%= constPrefix %>_DEFAULT_SETTINGS_PROVIDERS,
59
+ provideHttpClient(withInterceptorsFromDi()),
60
+ provideRouter(appRoutes, withEnabledBlockingInitialNavigation(), withComponentInputBinding()),
61
+ //
62
+ { provide: ENVIRONMENT, useValue: environment },
63
+ { provide: HTTP_INTERCEPTORS, useClass: BasicInterceptor, multi: true },
64
+ {
65
+ provide: AXP_ROOT_CONFIG_TOKEN,
66
+ useValue: {
67
+ baseUrl: environment.baseUrl,
68
+ },
69
+ },
70
+ {
71
+ provide: AXP_PLATFORM_CONFIG_TOKEN,
72
+ useValue: configPlatform({
73
+ logo: {
74
+ icon: {
75
+ dark: new AXPImageUrlLogoConfig('assets/images/logos/icon-dark.svg', 160),
76
+ light: new AXPImageUrlLogoConfig('assets/images/logos/icon-light.svg', 160),
77
+ },
78
+ text: {
79
+ dark: new AXPImageUrlLogoConfig('assets/images/logos/text-dark.svg', 80),
80
+ light: new AXPImageUrlLogoConfig('assets/images/logos/text-light.svg', 80),
81
+ },
82
+ full: {
83
+ dark: new AXPImageUrlLogoConfig('assets/images/logos/full-dark.svg', 160),
84
+ light: new AXPImageUrlLogoConfig('assets/images/logos/full-light.svg', 160),
85
+ },
86
+ },
87
+ title: '<%= title %>',
88
+ copyright: '<%= copyright %>',
89
+ }),
90
+ },
91
+ {
92
+ provide: AXP_APP_VERSION_PROVIDER,
93
+ useClass: <%= className %>AppVersionProvider,
94
+ },
95
+ provideDynamicHomePage(),
96
+ importProvidersFrom(
97
+ BrowserModule,
98
+ BrowserAnimationsModule,
99
+ //
100
+ AXDialogModule,
101
+ AXLoadingDialogModule,
102
+ AXFormatModule.forRoot(),
103
+ AXValidationModule.forRoot(),
104
+ //
105
+ //
106
+ AXPHomePageModule,
107
+ AXMCommonModule,
108
+ AXMSettingsManagementModule,
109
+ AXMHelpDeskModule,
110
+ AXMDashboardManagementModule,
111
+ AXMNotificationManagementModule,
112
+ AXMFormTemplateManagementModule,
113
+ AXMSecurityManagementModule,
114
+ AXMOrganizationManagementModule,
115
+ AXMSystemInsightModule,
116
+ AXMDocumentManagementModule,
117
+ AXMProjectManagementModule,
118
+ AXMLearningManagementModule,
119
+ AXMWorkflowManagementModule,
120
+ AXMContentManagementModule,
121
+ AXMConversationModule,
122
+ AXMPlatformManagementModule,
123
+ AXMDataManagementModule,
124
+ AXMReportManagementModule,
125
+ AXMCalendarManagementModule,
126
+ AXMLocationManagementModule,
127
+ AXMLocaleManagementModule,
128
+ AXMMeetingManagementModule,
129
+ AXMTaskManagementModule,
130
+ //
131
+ AXMIdentifierManagementModule,
132
+ //
133
+ AXPTranslationRootModule,
134
+ AXPLayoutRootModule,
135
+ //
136
+ AXCApiModule,
137
+ AXPAuthModule.forRoot({
138
+ strategies: [AXCAPIOidcStrategy],
139
+ }),
140
+ //
141
+ <%= className %>RootModule,
142
+ <%= className %>AuthRootModule,
143
+ ),
144
+ ],
145
+ };