@ihk-gfi/lux-components-update 11.13.0 → 13.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.
Files changed (230) hide show
  1. package/README.md +2 -4
  2. package/package.json +14 -17
  3. package/src/add-lux-components/files/app/app.component.html +1 -1
  4. package/src/add-lux-components/files/app/app.component.ts +4 -1
  5. package/src/add-lux-components/files/locale/messages.en.xlf +489 -235
  6. package/src/add-lux-components/files/locale/messages.xlf +451 -218
  7. package/src/add-lux-components/files/scripts/.browserslistrc +10 -7
  8. package/src/add-lux-components/files/src/index.html +31 -0
  9. package/src/add-lux-components/index.js +151 -78
  10. package/src/add-lux-components/index.js.map +1 -1
  11. package/src/add-lux-components/index.ts +141 -66
  12. package/src/add-lux-components/index_spec.js +4 -4
  13. package/src/add-lux-components/index_spec.js.map +1 -1
  14. package/src/add-lux-components/index_spec.ts +1 -1
  15. package/src/add-lux-components/schema.json +1 -1
  16. package/src/collection.json +8 -88
  17. package/src/update-dependencies/index.d.ts +1 -1
  18. package/src/update-dependencies/index.js +82 -65
  19. package/src/update-dependencies/index.js.map +1 -1
  20. package/src/update-dependencies/index.ts +112 -95
  21. package/src/update-dependencies/schema.json +1 -1
  22. package/src/update-en-messages/index.d.ts +2 -0
  23. package/src/update-en-messages/index.js +75 -0
  24. package/src/update-en-messages/index.js.map +1 -0
  25. package/src/update-en-messages/index.ts +78 -0
  26. package/src/{update110100 → update-en-messages}/schema.json +3 -3
  27. package/src/updates/update130000/files/root/.browserslistrc +20 -0
  28. package/src/updates/update130000/index.d.ts +27 -0
  29. package/src/updates/update130000/index.js +296 -0
  30. package/src/updates/update130000/index.js.map +1 -0
  31. package/src/updates/update130000/index.ts +346 -0
  32. package/src/{migrate-to-eslint → updates/update130000}/index_spec.d.ts +0 -0
  33. package/src/updates/update130000/index_spec.js +574 -0
  34. package/src/updates/update130000/index_spec.js.map +1 -0
  35. package/src/updates/update130000/index_spec.ts +665 -0
  36. package/src/{update → updates/update130000}/schema.json +1 -1
  37. package/src/utility/dependencies.js +16 -14
  38. package/src/utility/dependencies.js.map +1 -1
  39. package/src/utility/dependencies.ts +6 -4
  40. package/src/utility/files.d.ts +5 -1
  41. package/src/utility/files.js +27 -16
  42. package/src/utility/files.js.map +1 -1
  43. package/src/utility/files.ts +16 -3
  44. package/src/utility/html.js +88 -25
  45. package/src/utility/html.js.map +1 -1
  46. package/src/utility/html.ts +105 -29
  47. package/src/{migrate-to-webcomponent/index_spec.d.ts → utility/html_spec.d.ts} +0 -0
  48. package/src/utility/html_spec.js +560 -0
  49. package/src/utility/html_spec.js.map +1 -0
  50. package/src/utility/html_spec.ts +575 -0
  51. package/src/utility/json.d.ts +46 -1
  52. package/src/utility/json.js +174 -4
  53. package/src/utility/json.js.map +1 -1
  54. package/src/utility/json.ts +198 -3
  55. package/src/{update/index_spec.d.ts → utility/json_spec.d.ts} +0 -0
  56. package/src/utility/json_spec.js +326 -0
  57. package/src/utility/json_spec.js.map +1 -0
  58. package/src/utility/json_spec.ts +376 -0
  59. package/src/utility/typescript.js +16 -16
  60. package/src/utility/typescript.js.map +1 -1
  61. package/src/utility/typescript_spec.js +36 -36
  62. package/src/utility/typescript_spec.js.map +1 -1
  63. package/src/utility/util.d.ts +2 -2
  64. package/src/utility/util.js +16 -14
  65. package/src/utility/util.js.map +1 -1
  66. package/src/utility/util.ts +7 -5
  67. package/src/utility/validation.js +11 -11
  68. package/src/utility/validation.js.map +1 -1
  69. package/src/migrate-to-eslint/files/.eslintrc.json +0 -68
  70. package/src/migrate-to-eslint/files/.prettierrc +0 -25
  71. package/src/migrate-to-eslint/index.d.ts +0 -6
  72. package/src/migrate-to-eslint/index.js +0 -149
  73. package/src/migrate-to-eslint/index.js.map +0 -1
  74. package/src/migrate-to-eslint/index.ts +0 -181
  75. package/src/migrate-to-eslint/index_spec.js +0 -129
  76. package/src/migrate-to-eslint/index_spec.js.map +0 -1
  77. package/src/migrate-to-eslint/index_spec.ts +0 -152
  78. package/src/migrate-to-eslint/schema.json +0 -23
  79. package/src/migrate-to-webcomponent/index.d.ts +0 -10
  80. package/src/migrate-to-webcomponent/index.js +0 -278
  81. package/src/migrate-to-webcomponent/index.js.map +0 -1
  82. package/src/migrate-to-webcomponent/index.ts +0 -331
  83. package/src/migrate-to-webcomponent/index_spec.js +0 -580
  84. package/src/migrate-to-webcomponent/index_spec.js.map +0 -1
  85. package/src/migrate-to-webcomponent/index_spec.ts +0 -703
  86. package/src/migrate-to-webcomponent/schema.json +0 -23
  87. package/src/update/files/locale/messages.en.xlf +0 -940
  88. package/src/update/files/locale/messages.xlf +0 -815
  89. package/src/update/files/scripts/move-de-files.js +0 -15
  90. package/src/update/index.d.ts +0 -23
  91. package/src/update/index.js +0 -635
  92. package/src/update/index.js.map +0 -1
  93. package/src/update/index.ts +0 -712
  94. package/src/update/index_spec.js +0 -984
  95. package/src/update/index_spec.js.map +0 -1
  96. package/src/update/index_spec.ts +0 -1139
  97. package/src/update110001/index.d.ts +0 -2
  98. package/src/update110001/index.js +0 -42
  99. package/src/update110001/index.js.map +0 -1
  100. package/src/update110001/index.ts +0 -40
  101. package/src/update110001/index_spec.d.ts +0 -1
  102. package/src/update110001/index_spec.js +0 -67
  103. package/src/update110001/index_spec.js.map +0 -1
  104. package/src/update110001/index_spec.ts +0 -72
  105. package/src/update110001/schema.json +0 -23
  106. package/src/update110100/index.d.ts +0 -2
  107. package/src/update110100/index.js +0 -27
  108. package/src/update110100/index.js.map +0 -1
  109. package/src/update110100/index.ts +0 -24
  110. package/src/update110100/index_spec.d.ts +0 -1
  111. package/src/update110100/index_spec.js +0 -69
  112. package/src/update110100/index_spec.js.map +0 -1
  113. package/src/update110100/index_spec.ts +0 -73
  114. package/src/update110101/index.d.ts +0 -2
  115. package/src/update110101/index.js +0 -24
  116. package/src/update110101/index.js.map +0 -1
  117. package/src/update110101/index.ts +0 -21
  118. package/src/update110101/index_spec.d.ts +0 -1
  119. package/src/update110101/index_spec.js +0 -65
  120. package/src/update110101/index_spec.js.map +0 -1
  121. package/src/update110101/index_spec.ts +0 -69
  122. package/src/update110101/schema.json +0 -23
  123. package/src/update110200/index.d.ts +0 -2
  124. package/src/update110200/index.js +0 -24
  125. package/src/update110200/index.js.map +0 -1
  126. package/src/update110200/index.ts +0 -21
  127. package/src/update110200/index_spec.d.ts +0 -1
  128. package/src/update110200/index_spec.js +0 -65
  129. package/src/update110200/index_spec.js.map +0 -1
  130. package/src/update110200/index_spec.ts +0 -69
  131. package/src/update110200/schema.json +0 -23
  132. package/src/update110300/index.d.ts +0 -2
  133. package/src/update110300/index.js +0 -133
  134. package/src/update110300/index.js.map +0 -1
  135. package/src/update110300/index.ts +0 -148
  136. package/src/update110300/index_spec.d.ts +0 -1
  137. package/src/update110300/index_spec.js +0 -121
  138. package/src/update110300/index_spec.js.map +0 -1
  139. package/src/update110300/index_spec.ts +0 -139
  140. package/src/update110300/schema.json +0 -23
  141. package/src/update110400/index.d.ts +0 -2
  142. package/src/update110400/index.js +0 -28
  143. package/src/update110400/index.js.map +0 -1
  144. package/src/update110400/index.ts +0 -28
  145. package/src/update110400/index_spec.d.ts +0 -1
  146. package/src/update110400/index_spec.js +0 -66
  147. package/src/update110400/index_spec.js.map +0 -1
  148. package/src/update110400/index_spec.ts +0 -70
  149. package/src/update110400/schema.json +0 -23
  150. package/src/update110500/index.d.ts +0 -2
  151. package/src/update110500/index.js +0 -28
  152. package/src/update110500/index.js.map +0 -1
  153. package/src/update110500/index.ts +0 -28
  154. package/src/update110500/index_spec.d.ts +0 -1
  155. package/src/update110500/index_spec.js +0 -66
  156. package/src/update110500/index_spec.js.map +0 -1
  157. package/src/update110500/index_spec.ts +0 -70
  158. package/src/update110500/schema.json +0 -23
  159. package/src/update110600/index.d.ts +0 -2
  160. package/src/update110600/index.js +0 -28
  161. package/src/update110600/index.js.map +0 -1
  162. package/src/update110600/index.ts +0 -28
  163. package/src/update110600/index_spec.d.ts +0 -1
  164. package/src/update110600/index_spec.js +0 -66
  165. package/src/update110600/index_spec.js.map +0 -1
  166. package/src/update110600/index_spec.ts +0 -70
  167. package/src/update110600/schema.json +0 -23
  168. package/src/update110700/index.d.ts +0 -2
  169. package/src/update110700/index.js +0 -45
  170. package/src/update110700/index.js.map +0 -1
  171. package/src/update110700/index.ts +0 -47
  172. package/src/update110700/index_spec.d.ts +0 -1
  173. package/src/update110700/index_spec.js +0 -108
  174. package/src/update110700/index_spec.js.map +0 -1
  175. package/src/update110700/index_spec.ts +0 -122
  176. package/src/update110700/schema.json +0 -23
  177. package/src/update110800/index.d.ts +0 -2
  178. package/src/update110800/index.js +0 -32
  179. package/src/update110800/index.js.map +0 -1
  180. package/src/update110800/index.ts +0 -33
  181. package/src/update110800/index_spec.d.ts +0 -1
  182. package/src/update110800/index_spec.js +0 -70
  183. package/src/update110800/index_spec.js.map +0 -1
  184. package/src/update110800/index_spec.ts +0 -75
  185. package/src/update110800/schema.json +0 -23
  186. package/src/update110900/index.d.ts +0 -4
  187. package/src/update110900/index.js +0 -111
  188. package/src/update110900/index.js.map +0 -1
  189. package/src/update110900/index.ts +0 -123
  190. package/src/update110900/index_spec.d.ts +0 -1
  191. package/src/update110900/index_spec.js +0 -311
  192. package/src/update110900/index_spec.js.map +0 -1
  193. package/src/update110900/index_spec.ts +0 -341
  194. package/src/update110900/schema.json +0 -23
  195. package/src/update111000/index.d.ts +0 -2
  196. package/src/update111000/index.js +0 -27
  197. package/src/update111000/index.js.map +0 -1
  198. package/src/update111000/index.ts +0 -27
  199. package/src/update111000/index_spec.d.ts +0 -1
  200. package/src/update111000/index_spec.js +0 -65
  201. package/src/update111000/index_spec.js.map +0 -1
  202. package/src/update111000/index_spec.ts +0 -70
  203. package/src/update111000/schema.json +0 -23
  204. package/src/update111100/index.d.ts +0 -2
  205. package/src/update111100/index.js +0 -389
  206. package/src/update111100/index.js.map +0 -1
  207. package/src/update111100/index.ts +0 -405
  208. package/src/update111100/index_spec.d.ts +0 -1
  209. package/src/update111100/index_spec.js +0 -66
  210. package/src/update111100/index_spec.js.map +0 -1
  211. package/src/update111100/index_spec.ts +0 -70
  212. package/src/update111100/schema.json +0 -23
  213. package/src/update111200/index.d.ts +0 -2
  214. package/src/update111200/index.js +0 -59
  215. package/src/update111200/index.js.map +0 -1
  216. package/src/update111200/index.ts +0 -75
  217. package/src/update111200/index_spec.d.ts +0 -1
  218. package/src/update111200/index_spec.js +0 -67
  219. package/src/update111200/index_spec.js.map +0 -1
  220. package/src/update111200/index_spec.ts +0 -71
  221. package/src/update111200/schema.json +0 -23
  222. package/src/update111300/index.d.ts +0 -2
  223. package/src/update111300/index.js +0 -27
  224. package/src/update111300/index.js.map +0 -1
  225. package/src/update111300/index.ts +0 -27
  226. package/src/update111300/index_spec.d.ts +0 -1
  227. package/src/update111300/index_spec.js +0 -65
  228. package/src/update111300/index_spec.js.map +0 -1
  229. package/src/update111300/index_spec.ts +0 -69
  230. package/src/update111300/schema.json +0 -23
@@ -1,703 +0,0 @@
1
- import { callRule, SchematicContext } from '@angular-devkit/schematics';
2
- import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
3
- import * as path from 'path';
4
- import { of as observableOf } from 'rxjs';
5
- import { appOptions, workspaceOptions } from '../utility/test';
6
- import { UtilConfig } from '../utility/util';
7
- import {
8
- createWebpackConfigJs,
9
- updateAngularJson,
10
- updateAppComponent,
11
- updateAppComponentHtml,
12
- updateAppModule,
13
- updateAppRoutingModule,
14
- updateIndexHtml,
15
- updatePackageJson
16
- } from './index';
17
-
18
- const collectionPath = path.join(__dirname, '../collection.json');
19
-
20
- describe('migrate-to-eslint', () => {
21
- let appTree: UnitTestTree;
22
- let runner: SchematicTestRunner;
23
- let context: SchematicContext;
24
-
25
- const testOptions: any = {};
26
-
27
- beforeEach(async () => {
28
- runner = new SchematicTestRunner('schematics', collectionPath);
29
-
30
- appTree = await runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
31
- appTree = await runner
32
- .runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
33
- .toPromise();
34
-
35
- UtilConfig.defaultWaitMS = 0;
36
-
37
- const collection = runner.engine.createCollection(collectionPath);
38
- const schematic = runner.engine.createSchematic('migrate-to-webcomponent', collection);
39
- context = runner.engine.createContext(schematic);
40
-
41
- testOptions.project = appOptions.name;
42
- testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
43
- testOptions.verbose = true;
44
- });
45
-
46
- describe('[Rule] updateAppComponent', () => {
47
- it('Sollte die Datei "app.component.ts" angepasst haben', (done) => {
48
- appTree.overwrite(
49
- (testOptions.path ? testOptions.path : '') + `/src/app/app.component.ts`,
50
- `
51
- import { Version } from './../../src-gen/bsclient/model/version';
52
- import { AccountFacadeService } from './../../src-gen/bsclient/api/accountFacade.service';
53
- import { Component, OnInit } from '@angular/core';
54
- import { Router } from '@angular/router';
55
- import { LuxAppFooterLinkService, LuxAppFooterLinkInfo, LuxThemeService } from '@ihk-gfi/lux-components';
56
- import { FeedbackService } from './components/feedback/feedback.service';
57
- import { SharedService } from './services/shared.service';
58
-
59
- @Component({
60
- selector : 'app-root',
61
- templateUrl: './app.component.html',
62
- styleUrls : [ './app.component.scss' ]
63
- })
64
- export class AppComponent implements OnInit {
65
-
66
- luxVersion = '';
67
- isMaintenanceOrUnauthorized = false;
68
-
69
- constructor(private readonly fachService: AccountFacadeService,
70
- public router: Router, public window: Window,
71
- public sharedService: SharedService,
72
- private linkService: LuxAppFooterLinkService,
73
- public feedbackService: FeedbackService, private themeService: LuxThemeService) {
74
- themeService.loadTheme();
75
- this.isMaintenanceOrUnauthorized = window.location.href.endsWith('/maintenance') || window.location.href.endsWith('/unauthorized');
76
- }
77
-
78
- }
79
-
80
- `
81
- );
82
-
83
- callRule(updateAppComponent(testOptions), observableOf(appTree), context).subscribe(
84
- (success) => {
85
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app.component.ts`)?.toString();
86
-
87
- expect(content).toContain('private themeService: LuxThemeService, private elementRef: ElementRef, private appService: LuxAppService)');
88
- expect(content).toContain('import { LuxAppFooterLinkService, LuxAppFooterLinkInfo, LuxThemeService, LuxAppService } from \'@ihk-gfi/lux-components\';');
89
- expect(content).toContain('import { Component, OnInit, ElementRef, Input } from \'@angular/core\';');
90
- expect(content).toContain('private elementRef: ElementRef, private appService: LuxAppService) {\n' +
91
- ' this.appService.appEl = elementRef.nativeElement;\n' +
92
- ' themeService.loadTheme();\n' +
93
- ' this.isMaintenanceOrUnauthorized = window.location.href.endsWith(\'/maintenance\') || window.location.href.endsWith(\'/unauthorized\');\n' +
94
- ' router.initialNavigation();\n' +
95
- ' }');
96
-
97
- expect(content).toContain('@Input() luxAppHeader: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
98
- expect(content).toContain('@Input() luxAppFooter: \'normal\' | \'minimal\' | \'none\' = \'normal\';');
99
- expect(content).toContain('@Input() luxMode: \'stand-alone\' | \'portal\' = \'stand-alone\';');
100
-
101
- done();
102
- },
103
- (reason) => expect(reason).toBeUndefined()
104
- );
105
- });
106
- });
107
-
108
- describe('[Rule] updatePackageJson', () => {
109
- it('Sollte die Datei "package.json" (ohne skripte) angepasst haben', (done) => {
110
- appTree.overwrite(
111
- `package.json`,
112
- `
113
-
114
- `
115
- );
116
-
117
- callRule(updatePackageJson(testOptions), observableOf(appTree), context).subscribe(
118
- (success) => {
119
- const content = success.read(`package.json`)?.toString();
120
-
121
- expect(content).toContain('"build-aot": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot --single-bundle --output-hashing none && npm run move-de-files"');
122
- expect(content).toContain('"buildzentral": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --prod --single-bundle --output-hashing none --plugin @ihk-gfi/lux-components/ie11-lazy-modules-plugin.js && npm run move-de-files"');
123
-
124
- expect(content).toContain('"@webcomponents/webcomponentsjs"');
125
- expect(content).toContain('"ngx-build-plus"');
126
- expect(content).toContain('"@angular/elements"');
127
- expect(content).toContain('"replace-in-file"');
128
- done();
129
- },
130
- (reason) => expect(reason).toBeUndefined()
131
- );
132
- });
133
-
134
- it('Sollte die Datei "package.json" (mit skripte) angepasst haben', (done) => {
135
- appTree.overwrite(
136
- `package.json`,
137
- `
138
- {
139
- "name": "bar",
140
- "version": "0.0.1",
141
- "license": "MIT",
142
- "scripts": {
143
- "ng": "ng",
144
- "start": "ng serve --public-host=http://localhost:4200",
145
- "build": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --source-map",
146
- "build-aot": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot && npm run move-de-files",
147
- "buildzentral": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --prod && npm run move-de-files",
148
- },
149
- "private": true,
150
- "dependencies": {
151
- },
152
- "devDependencies": {
153
- }
154
- }
155
-
156
- `
157
- );
158
-
159
- callRule(updatePackageJson(testOptions), observableOf(appTree), context).subscribe(
160
- (success) => {
161
- const content = success.read(`package.json`)?.toString();
162
-
163
- expect(content).toContain('"build-aot": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot --single-bundle --output-hashing none && npm run move-de-files"');
164
- expect(content).toContain('"buildzentral": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --prod --single-bundle --output-hashing none --plugin @ihk-gfi/lux-components/ie11-lazy-modules-plugin.js && npm run move-de-files"');
165
-
166
- expect(content).toContain('"@webcomponents/webcomponentsjs"');
167
- expect(content).toContain('"ngx-build-plus"');
168
- expect(content).toContain('"@angular/elements"');
169
- expect(content).toContain('"replace-in-file"');
170
- done();
171
- },
172
- (reason) => expect(reason).toBeUndefined()
173
- );
174
- });
175
- });
176
-
177
- describe('[Rule] updateAppRoutingModule', () => {
178
- it('Sollte die Datei "app-routing.module.ts" angepasst haben', (done) => {
179
- appTree.create(
180
- (testOptions.path ? testOptions.path : '') + `/src/app/app-routing.module.ts`,
181
- `
182
- const routes: Routes = [
183
- {path: '', component: HomeComponent},
184
- {path: 'impressum', component: ImpressumComponent},
185
- {path: 'anbindung', loadChildren: () => import('app/components/anbindung/anbindung.module').then(m => m.AnbindungModule)},
186
- {path: 'information', loadChildren: () => import('app/components/info/info.module').then(m => m.InfoModule)},
187
- {path: '**', component: ErrorComponent} // Immer als letzte Route !! -> 404!
188
- ];
189
-
190
- `
191
- );
192
-
193
- callRule(updateAppRoutingModule(testOptions), observableOf(appTree), context).subscribe(
194
- (success) => {
195
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app-routing.module.ts`)?.toString();
196
-
197
- expect(content).not.toContain('import(\'app/');
198
- expect(content).toContain('import(\'./');
199
-
200
- done();
201
- },
202
- (reason) => expect(reason).toBeUndefined()
203
- );
204
- });
205
-
206
- it('Sollte die Datei "app-routing.module.ts" (Doppelte Anführungszeichen) angepasst haben', (done) => {
207
- appTree.create(
208
- (testOptions.path ? testOptions.path : '') + `/src/app/app-routing.module.ts`,
209
- `
210
- const routes: Routes = [
211
- {path: '', component: HomeComponent},
212
- {path: 'impressum', component: ImpressumComponent},
213
- {path: 'anbindung', loadChildren: () => import("app/components/anbindung/anbindung.module").then(m => m.AnbindungModule)},
214
- {path: 'information', loadChildren: () => import("app/components/info/info.module").then(m => m.InfoModule)},
215
- {path: '**', component: ErrorComponent} // Immer als letzte Route !! -> 404!
216
- ];
217
-
218
- `
219
- );
220
-
221
- callRule(updateAppRoutingModule(testOptions), observableOf(appTree), context).subscribe(
222
- (success) => {
223
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app-routing.module.ts`)?.toString();
224
-
225
- expect(content).not.toContain('import("app/');
226
- expect(content).toContain('import("./');
227
-
228
- done();
229
- },
230
- (reason) => expect(reason).toBeUndefined()
231
- );
232
- });
233
- });
234
-
235
- describe('[Rule] updateAngularJson', () => {
236
- it('Sollte die Datei "angular.json" angepasst haben', (done) => {
237
- appTree.overwrite(
238
- `angular.json`,
239
- `
240
- {
241
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
242
- "version": 1,
243
- "newProjectRoot": "projects",
244
- "projects": {
245
- "bar": {
246
- "root": "",
247
- "sourceRoot": "src",
248
- "projectType": "application",
249
- "architect": {
250
- "build": {
251
- "builder": "@angular-devkit/build-angular:browser",
252
- "options": {
253
- "outputPath": "dist",
254
- "index": "src/index.html",
255
- "main": "src/main.ts",
256
- "tsConfig": "src/tsconfig.app.json",
257
- "polyfills": "src/polyfills.ts",
258
- "assets": [
259
- {
260
- "glob": "*.css",
261
- "input": "./node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes",
262
- "output": "./assets/themes"
263
- },
264
- "src/assets",
265
- {
266
- "glob": "**/*",
267
- "input": "./node_modules/pdfjs-dist/cmaps/",
268
- "output": "./assets/cmaps"
269
- }
270
- ],
271
- "styles": [
272
- "src/styles.scss"
273
- ],
274
- "scripts": [],
275
- "allowedCommonJsDependencies": [
276
- "hammerjs",
277
- "ng2-pdf-viewer"
278
- ],
279
- "localize": [
280
- "de"
281
- ],
282
- "i18nMissingTranslation": "error"
283
- },
284
- "configurations": {
285
- "production": {
286
- "budgets": [
287
- {
288
- "type": "anyComponentStyle",
289
- "maximumWarning": "6kb"
290
- }
291
- ],
292
- "optimization": true,
293
- "outputHashing": "all",
294
- "sourceMap": false,
295
- "namedChunks": false,
296
- "aot": true,
297
- "extractLicenses": true,
298
- "vendorChunk": false,
299
- "buildOptimizer": true,
300
- "fileReplacements": [
301
- {
302
- "replace": "src/environments/environment.ts",
303
- "with": "src/environments/environment.prod.ts"
304
- }
305
- ]
306
- },
307
- "es5": {
308
- "budgets": [
309
- {
310
- "type": "anyComponentStyle",
311
- "maximumWarning": "6kb"
312
- }
313
- ],
314
- "tsConfig": "src/tsconfig.app.ie.json"
315
- },
316
- "en": {
317
- "localize": [
318
- "en"
319
- ],
320
- "aot": true,
321
- "outputPath": "dist/en",
322
- "i18nMissingTranslation": "error"
323
- }
324
- }
325
- },
326
- "serve": {
327
- "builder": "@angular-devkit/build-angular:dev-server",
328
- "options": {
329
- "browserTarget": "lux-bp:build"
330
- },
331
- "configurations": {
332
- "production": {
333
- "browserTarget": "lux-bp:build:production"
334
- },
335
- "es5": {
336
- "browserTarget": "lux-bp:build:es5"
337
- },
338
- "en": {
339
- "browserTarget": "lux-bp:build:en"
340
- }
341
- }
342
- },
343
- "extract-i18n": {
344
- "builder": "@angular-devkit/build-angular:extract-i18n",
345
- "options": {
346
- "browserTarget": "lux-bp:build"
347
- }
348
- },
349
- "test": {
350
- "builder": "@angular-devkit/build-angular:karma",
351
- "options": {
352
- "main": "src/test.ts",
353
- "karmaConfig": "./karma.conf.js",
354
- "polyfills": "src/polyfills.ts",
355
- "tsConfig": "src/tsconfig.spec.json",
356
- "scripts": [],
357
- "styles": [
358
- "src/styles.scss"
359
- ],
360
- "assets": [
361
- {
362
- "glob": "*.css",
363
- "input": "./node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes",
364
- "output": "./assets/themes"
365
- },
366
- "src/assets",
367
- {
368
- "glob": "**/*",
369
- "input": "./node_modules/pdfjs-dist/cmaps/",
370
- "output": "./assets/cmaps"
371
- }
372
- ]
373
- }
374
- },
375
- "lint": {
376
- "builder": "@angular-eslint/builder:lint",
377
- "options": {
378
- "lintFilePatterns": [
379
- "src/**/*.ts",
380
- "src/**/*.html"
381
- ]
382
- }
383
- }
384
- },
385
- "i18n": {
386
- "sourceLocale": {
387
- "code": "de",
388
- "baseHref": "/"
389
- },
390
- "locales": {
391
- "en": "src/locale/messages.en.xlf"
392
- }
393
- }
394
- },
395
- "lux-bp-e2e": {
396
- "root": "e2e",
397
- "sourceRoot": "e2e",
398
- "projectType": "application",
399
- "architect": {
400
- "e2e": {
401
- "builder": "@angular-devkit/build-angular:protractor",
402
- "options": {
403
- "protractorConfig": "./protractor.conf.js",
404
- "devServerTarget": "lux-bp:serve"
405
- }
406
- }
407
- }
408
- }
409
- },
410
- "defaultProject": "lux-bp",
411
- "schematics": {
412
- "@schematics/angular:component": {
413
- "prefix": "bp",
414
- "style": "scss"
415
- },
416
- "@schematics/angular:directive": {
417
- "prefix": "bp"
418
- }
419
- },
420
- "cli": {
421
- "defaultCollection": "@angular-eslint/schematics"
422
- }
423
- }
424
-
425
- `
426
- );
427
-
428
- callRule(updateAngularJson(testOptions), observableOf(appTree), context).subscribe(
429
- (success) => {
430
- const content = success.read(`angular.json`)?.toString();
431
-
432
- expect(content).toContain('"scripts": [\n' +
433
- ' {\n' +
434
- ' "bundleName": "polyfill-webcomp",\n' +
435
- ' "input": "node_modules/@webcomponents/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js"\n' +
436
- ' },\n' +
437
- ' {\n' +
438
- ' "bundleName": "polyfill-webcomp-es5",\n' +
439
- ' "input": "node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"\n' +
440
- ' }\n' +
441
- ' ]');
442
-
443
- expect(content).not.toContain('@angular-devkit/build-angular:browser');
444
- expect(content).toContain('ngx-build-plus:browser');
445
- expect(content).not.toContain('@angular-devkit/build-angular:dev-server');
446
- expect(content).toContain('ngx-build-plus:dev-server');
447
- expect(content).not.toContain('@angular-devkit/build-angular:karma');
448
- expect(content).toContain('ngx-build-plus:karma');
449
-
450
- done();
451
- },
452
- (reason) => expect(reason).toBeUndefined()
453
- );
454
- });
455
- });
456
-
457
- describe('[Rule] updateAppModule', () => {
458
- it('Sollte die Datei "app.module.ts" (ohne Konstruktor) angepasst haben', (done) => {
459
- appTree.overwrite(
460
- (testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`,
461
- `
462
- import { AppRoutingModule } from './app-routing.module';
463
- import { NgModule, ErrorHandler } from '@angular/core';
464
- import { AppComponent } from './app.component';
465
-
466
- export class AppModule {
467
-
468
- }
469
- `
470
- );
471
-
472
- callRule(updateAppModule(testOptions), observableOf(appTree), context).subscribe(
473
- (success) => {
474
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`)?.toString();
475
-
476
- expect(content).toContain('import { createCustomElement } from \'@angular/elements\';');
477
- expect(content).toContain('export class AppModule implements DoBootstrap');
478
- expect(content).toContain('constructor(private injector: Injector) {}');
479
-
480
- done();
481
- },
482
- (reason) => expect(reason).toBeUndefined()
483
- );
484
- });
485
-
486
- it('Sollte die Datei "app.module.ts" (mit Konstruktor - ohne Parameter) angepasst haben', (done) => {
487
- appTree.overwrite(
488
- (testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`,
489
- `
490
- import { AppRoutingModule } from './app-routing.module';
491
- import { NgModule, ErrorHandler } from '@angular/core';
492
- import { AppComponent } from './app.component';
493
-
494
- export class AppModule {
495
-
496
- constructor() {}
497
-
498
- }
499
- `
500
- );
501
-
502
- callRule(updateAppModule(testOptions), observableOf(appTree), context).subscribe(
503
- (success) => {
504
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`)?.toString();
505
-
506
- expect(content).toContain('import { createCustomElement } from \'@angular/elements\';');
507
- expect(content).toContain('export class AppModule implements DoBootstrap');
508
- expect(content).toContain('constructor(private injector: Injector) {}');
509
-
510
- done();
511
- },
512
- (reason) => expect(reason).toBeUndefined()
513
- );
514
- });
515
-
516
- it('Sollte die Datei "app.module.ts" (mit Konstruktor - mit Parameter) angepasst haben', (done) => {
517
- appTree.overwrite(
518
- (testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`,
519
- `
520
- import { AppRoutingModule } from './app-routing.module';
521
- import { NgModule, ErrorHandler } from '@angular/core';
522
- import { AppComponent } from './app.component';
523
-
524
- export class AppModule {
525
-
526
- constructor(private aaa: Aaa) {}
527
-
528
- ngOnInit() {
529
- }
530
- }
531
- `
532
- );
533
-
534
- callRule(updateAppModule(testOptions), observableOf(appTree), context).subscribe(
535
- (success) => {
536
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`)?.toString();
537
-
538
- expect(content).toContain('import { createCustomElement } from \'@angular/elements\';');
539
- expect(content).toContain('export class AppModule implements DoBootstrap');
540
- expect(content).toContain('constructor(private aaa: Aaa, private injector: Injector) {}');
541
-
542
- done();
543
- },
544
- (reason) => expect(reason).toBeUndefined()
545
- );
546
- });
547
-
548
- it('Sollte die Datei "app.module.ts" (bootstrap entfernen - schema hinzufügen) angepasst haben', (done) => {
549
- appTree.overwrite(
550
- (testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`,
551
- `
552
- import { AppRoutingModule } from './app-routing.module';
553
- import { NgModule, ErrorHandler } from '@angular/core';
554
- import { AppComponent } from './app.component';
555
-
556
- @NgModule({
557
- declarations : [
558
- AppComponent
559
- ],
560
- imports : [
561
- HttpClientModule
562
- ],
563
- entryComponents: [
564
- LuxSnackbarComponent,
565
- LuxFilePreviewComponent
566
- ],
567
- providers : [
568
- LuxDialogService,
569
- DatePipe,
570
- { provide: Window, useValue: window }
571
- ],
572
- bootstrap : [
573
- AppComponent
574
- ]
575
- })
576
- export class AppModule {
577
-
578
- constructor(private aaa: Aaa) {}
579
-
580
- ngOnInit() {
581
- }
582
- }
583
- `
584
- );
585
-
586
- callRule(updateAppModule(testOptions), observableOf(appTree), context).subscribe(
587
- (success) => {
588
- const content = success.read((testOptions.path ? testOptions.path : '') + `/src/app/app.module.ts`)?.toString();
589
-
590
- expect(content).toContain('schemas: [CUSTOM_ELEMENTS_SCHEMA]');
591
- expect(content).not.toContain('bootstrap :');
592
-
593
- done();
594
- },
595
- (reason) => expect(reason).toBeUndefined()
596
- );
597
- });
598
- });
599
-
600
- describe('[Rule] updateIndexHtml', () => {
601
- it('Sollte die Datei "index.html" angepasst haben', (done) => {
602
- appTree.create(
603
- 'src/index.html',
604
- `
605
- <!doctype html>
606
- <html lang="de">
607
- <head>
608
- <meta charset="utf-8">
609
- <title>LUX Blueprint</title>
610
- <base href="/">
611
- <meta name="viewport" content="width=device-width, initial-scale=1">
612
- <link rel="icon" type="image/x-icon" href="favicon.ico">
613
- </head>
614
- <body style="margin: 0">
615
- <noscript>
616
- <div id="no-js" class="lux-no-js">
617
- <p><b>Achtung, Javascript ist deaktiviert.</b></p>
618
- <p>Bitte aktivieren Sie Javascript in Ihrem Browser, damit die Applikation funktionsf&auml;hig ist.</p>
619
- </div>
620
- </noscript>
621
- <app-root></app-root>
622
- </body>
623
- </html>
624
- `
625
- );
626
-
627
- const newTestOptions = JSON.parse(JSON.stringify(testOptions));
628
- newTestOptions.project = 'Ka-74öäü';
629
-
630
- callRule(updateIndexHtml(newTestOptions), observableOf(appTree), context).subscribe(
631
- (success) => {
632
- const content = success.read('src/index.html')?.toString();
633
-
634
- expect(content).not.toContain('<app-root></app-root>');
635
- expect(content).toContain('<lux-ka></lux-ka>');
636
-
637
- done();
638
- },
639
- (reason) => expect(reason).toBeUndefined()
640
- );
641
- });
642
- });
643
-
644
- describe('[Rule] updateAppComponentHtml', () => {
645
- it('Sollte die Datei "app.component.html" angepasst haben', (done) => {
646
- appTree.overwrite(
647
- testOptions.path + '/src/app/app.component.html',
648
- `
649
- <lux-app-header luxAppTitle="LUX Blueprint" luxAppTitleShort="LUX"
650
- luxUserName="{{sharedService.getBenutzernameAsObservable() | async}}">
651
- </lux-app-header>
652
-
653
- <lux-app-header-right-nav *ngIf="(sharedService.isLoggedInAsObservable() | async)">
654
- <lux-menu-item luxIconName="fa-power-off" luxLabel="Abmelden"
655
- (luxClicked)="sharedService.logout(true)"></lux-menu-item>
656
- </lux-app-header-right-nav>
657
-
658
- <lux-app-content></lux-app-content>
659
-
660
- <lux-app-footer *ngIf="this.luxAppFooter !== 'none'" luxVersion="{{luxVersion}}">
661
- </lux-app-footer>
662
- `
663
- );
664
-
665
- callRule(updateAppComponentHtml(testOptions), observableOf(appTree), context).subscribe(
666
- (success) => {
667
- const content = success.read(testOptions.path + '/src/app/app.component.html')?.toString();
668
-
669
- expect(content).toContain('*ngIf="this.luxAppHeader !== \'none\'"');
670
- expect(content).toContain('*ngIf="(sharedService.isLoggedInAsObservable() | async) && luxMode === \'stand-alone\'"');
671
- expect(content).toContain('*ngIf="this.luxAppFooter !== \'none\'"');
672
- expect(content).toContain('<lux-app-content></lux-app-content>');
673
- expect(content).not.toContain('<lux-app-content/>');
674
-
675
- done();
676
- },
677
- (reason) => expect(reason).toBeUndefined()
678
- );
679
- });
680
- });
681
-
682
- describe('[Rule] createWebpackConfigJs', () => {
683
- it('Sollte die Datei "webpack.config.js" angelegt haben', (done) => {
684
-
685
- callRule(createWebpackConfigJs(testOptions), observableOf(appTree), context).subscribe(
686
- (success) => {
687
- const content = success.read('webpack.config.js')?.toString();
688
-
689
- expect(content).toContain(`
690
- module.exports = {
691
- output: {
692
- jsonpFunction: 'jsonpFunctionBar'
693
- }
694
- };`);
695
-
696
- done();
697
- },
698
- (reason) => expect(reason).toBeUndefined()
699
- );
700
- });
701
- });
702
-
703
- });