@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,984 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const schematics_1 = require("@angular-devkit/schematics");
13
- const testing_1 = require("@angular-devkit/schematics/testing");
14
- const path = require("path");
15
- const rxjs_1 = require("rxjs");
16
- const dependencies_1 = require("../utility/dependencies");
17
- const test_1 = require("../utility/test");
18
- const util_1 = require("../utility/util");
19
- const index_1 = require("./index");
20
- const collectionPath = path.join(__dirname, '../collection.json');
21
- describe('update', () => {
22
- let appTree;
23
- let runner;
24
- let context;
25
- const testOptions = {};
26
- beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
27
- runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
28
- appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'workspace', test_1.workspaceOptions).toPromise();
29
- appTree = yield runner
30
- .runExternalSchematicAsync('@schematics/angular', 'application', test_1.appOptions, appTree)
31
- .toPromise();
32
- util_1.UtilConfig.defaultWaitMS = 0;
33
- const collection = runner.engine.createCollection(collectionPath);
34
- const schematic = runner.engine.createSchematic('update', collection);
35
- context = runner.engine.createContext(schematic);
36
- testOptions.project = test_1.appOptions.name;
37
- testOptions.path = test_1.workspaceOptions.newProjectRoot + '/' + test_1.appOptions.name;
38
- testOptions.verbose = true;
39
- }));
40
- describe('[Rule] addNg2PdfViewer', () => {
41
- it('Sollte Ng2PdfViewer hinzufügen', (done) => {
42
- appTree.overwrite('/angular.json', `
43
- {
44
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
45
- "version": 1,
46
- "newProjectRoot": "projects",
47
- "projects": {
48
- "bar": {
49
- "root": "",
50
- "sourceRoot": "src",
51
- "projectType": "application",
52
- "i18n": {
53
- "sourceLocale": {
54
- "code": "de",
55
- "baseHref": "/"
56
- },
57
- "locales": {
58
- "en": "src/locale/messages.en.xlf"
59
- }
60
- },
61
- "architect": {
62
- "build": {
63
- "builder": "ngx-build-plus:browser",
64
- "options": {
65
- "outputPath": "dist",
66
- "allowedCommonJsDependencies": [
67
- "hammerjs"
68
- ]
69
- }
70
- }
71
- }
72
- },
73
- },
74
- "defaultProject": "lux-components",
75
- "schematics": {
76
- "@schematics/angular:component": {
77
- "prefix": "lux",
78
- "style": "scss"
79
- },
80
- "@schematics/angular:directive": {
81
- "prefix": "lux"
82
- }
83
- }
84
- }
85
-
86
- `);
87
- schematics_1.callRule(index_1.addNg2PdfViewer(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
88
- var _a;
89
- const content = (_a = success.read('/angular.json')) === null || _a === void 0 ? void 0 : _a.toString();
90
- expect(content).toContain('"allowedCommonJsDependencies": [\n "ng2-pdf-viewer",\n "hammerjs"\n ]');
91
- done();
92
- }, (reason) => expect(reason).toBeUndefined());
93
- });
94
- it('Sollte Ng2PdfViewer nicht hinzufügen', (done) => {
95
- appTree.overwrite('/angular.json', `
96
- {
97
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
98
- "version": 1,
99
- "newProjectRoot": "projects",
100
- "projects": {
101
- "bar": {
102
- "root": "",
103
- "sourceRoot": "src",
104
- "projectType": "application",
105
- "i18n": {
106
- "sourceLocale": {
107
- "code": "de",
108
- "baseHref": "/"
109
- },
110
- "locales": {
111
- "en": "src/locale/messages.en.xlf"
112
- }
113
- },
114
- "architect": {
115
- "build": {
116
- "builder": "ngx-build-plus:browser",
117
- "options": {
118
- "outputPath": "dist",
119
- "allowedCommonJsDependencies": [
120
- "hammerjs",
121
- "ng2-pdf-viewer"
122
- ]
123
- }
124
- }
125
- }
126
- },
127
- },
128
- "defaultProject": "lux-components",
129
- "schematics": {
130
- "@schematics/angular:component": {
131
- "prefix": "lux",
132
- "style": "scss"
133
- },
134
- "@schematics/angular:directive": {
135
- "prefix": "lux"
136
- }
137
- }
138
- }
139
-
140
- `);
141
- schematics_1.callRule(index_1.addNg2PdfViewer(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
142
- var _a;
143
- const content = (_a = success.read('/angular.json')) === null || _a === void 0 ? void 0 : _a.toString();
144
- expect(content).toContain('"allowedCommonJsDependencies": [\n "hammerjs",\n "ng2-pdf-viewer"\n ]');
145
- done();
146
- }, (reason) => expect(reason).toBeUndefined());
147
- });
148
- });
149
- describe('[Rule] update', () => {
150
- it('Sollte einen Fehler werfen, wenn Version < n - 1', () => {
151
- dependencies_1.updatePackageJsonDependency(appTree, { type: dependencies_1.NodeDependencyType.Default, version: '1.9.3', name: '@ihk-gfi/lux-components' });
152
- Object.defineProperty(process.versions, 'node', {
153
- get: () => '12.16.3'
154
- });
155
- schematics_1.callRule(index_1.update(testOptions), rxjs_1.of(appTree), context).subscribe((success) => { }, (reason) => expect(reason.toString()).toContain('wird nicht unterstützt.'));
156
- });
157
- it('Sollte LUX-Components 10 einrichten', (done) => {
158
- appTree.overwrite('/package.json', `
159
- {
160
- "name": "Lorem ipsum",
161
- "version": "0.0.32",
162
- "scripts": {
163
- "build": "tsc -p tsconfig.json",
164
- "test": "npm run build && jasmine src/**/*_spec.js"
165
- },
166
- "keywords": [
167
- "schematics",
168
- "lux-components"
169
- ],
170
- "dependencies": {
171
- "@ihk-gfi/lux-components": "10.8.2"
172
- }
173
- }
174
- `);
175
- schematics_1.callRule(index_1.update(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
176
- expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('' + index_1.updateMajorVersion + '.0.0');
177
- done();
178
- }, (reason) => expect(reason).toBeUndefined());
179
- });
180
- });
181
- describe('[Rule] updateBrowserList', () => {
182
- it('Sollte die alten IE-Versionen (9 und 10) entfernt haben', (done) => {
183
- appTree.create('/.browserslistrc', `
184
- # This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
185
- # For additional information regarding the format and rule options, please see:
186
- # https://github.com/browserslist/browserslist#queries
187
-
188
- # You can see what browsers were selected by your queries by running:
189
- # npx browserslist
190
-
191
- > 0.5%
192
- last 2 versions
193
- Firefox ESR
194
- not dead
195
- IE 9-11 # For IE 9-11 support, remove 'not'.
196
-
197
- `);
198
- schematics_1.callRule(index_1.updateBrowserList(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
199
- const browserListContent = success.read('/.browserslistrc');
200
- expect(browserListContent).toBeDefined();
201
- const content = browserListContent === null || browserListContent === void 0 ? void 0 : browserListContent.toString();
202
- expect(content).toContain('not IE 9-10');
203
- expect(content).toContain('IE 11');
204
- done();
205
- }, (reason) => expect(reason).toBeNull());
206
- });
207
- });
208
- describe('[Rule] deleteOldThemeDir', () => {
209
- it('Sollte das alte Theming-Verzeichnis löschen.', (done) => {
210
- const oldThemePath = testOptions.path + '/src/theming/';
211
- appTree.create(oldThemePath + '_luxcommon.scss', `---`);
212
- appTree.create(oldThemePath + '_luxfocus.scss', `---`);
213
- appTree.create(oldThemePath + '_luxpalette.scss', `---`);
214
- appTree.create(oldThemePath + '_luxstyles.scss', `---`);
215
- appTree.create(oldThemePath + 'luxtheme.scss', `---`);
216
- expect(appTree.exists(oldThemePath + '_luxcommon.scss')).toBeTrue();
217
- expect(appTree.exists(oldThemePath + '_luxfocus.scss')).toBeTrue();
218
- expect(appTree.exists(oldThemePath + '_luxpalette.scss')).toBeTrue();
219
- expect(appTree.exists(oldThemePath + '_luxstyles.scss')).toBeTrue();
220
- expect(appTree.exists(oldThemePath + 'luxtheme.scss')).toBeTrue();
221
- schematics_1.callRule(index_1.deleteOldThemeDir(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
222
- expect(appTree.exists(oldThemePath + '_luxcommon.scss')).toBeFalse();
223
- expect(appTree.exists(oldThemePath + '_luxfocus.scss')).toBeFalse();
224
- expect(appTree.exists(oldThemePath + '_luxpalette.scss')).toBeFalse();
225
- expect(appTree.exists(oldThemePath + '_luxstyles.scss')).toBeFalse();
226
- expect(appTree.exists(oldThemePath + 'luxtheme.scss')).toBeFalse();
227
- done();
228
- }, (reason) => expect(reason).toBeNull());
229
- });
230
- });
231
- describe('[Rule] clearStylesScss', () => {
232
- it('Sollte die alten Styles aus der styles.scss entfernen.', (done) => {
233
- appTree.overwrite(testOptions.path + '/src/styles.scss', `
234
- /* You can add global styles to this file, and also import other style files */
235
- /* Themenamen: deeppurple-amber.css, indigo-pink.css, pink-bluegrey.css und purple-green.css */
236
- $fa-font-path: '~@fortawesome/fontawesome-free/webfonts';
237
- @import '~@fortawesome/fontawesome-free/scss/fontawesome';
238
- @import '~@fortawesome/fontawesome-free/scss/regular';
239
- @import '~@fortawesome/fontawesome-free/scss/solid';
240
- @import '~@fortawesome/fontawesome-free/scss/brands';
241
- @import '~material-design-icons-iconfont/dist/material-design-icons.css';
242
- @import '../node_modules/@angular/material/theming';
243
- @import './theming/luxtheme';
244
-
245
- @include mat-core();
246
-
247
- @include angular-material-theme($lux-theme);
248
-
249
- `);
250
- schematics_1.callRule(index_1.clearStylesScss(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
251
- var _a;
252
- const content = (_a = success.read(testOptions.path + '/src/styles.scss')) === null || _a === void 0 ? void 0 : _a.toString();
253
- expect(content).not.toContain('$fa-font-path: \'~@fortawesome/fontawesome-free/webfonts\';');
254
- expect(content).not.toContain('@import \'~@fortawesome/fontawesome-free/scss/fontawesome\';');
255
- expect(content).not.toContain('@import \'~@fortawesome/fontawesome-free/scss/regular\';');
256
- expect(content).not.toContain('@import \'~@fortawesome/fontawesome-free/scss/solid\';');
257
- expect(content).not.toContain('@import \'~@fortawesome/fontawesome-free/scss/brands\';');
258
- expect(content).not.toContain('@import \'~material-design-icons-iconfont/dist/material-design-icons.css\';');
259
- expect(content).not.toContain('@import \'../node_modules/@angular/material/theming\';');
260
- expect(content).not.toContain('@import \'./theming/luxtheme\';');
261
- expect(content).not.toContain('@include mat-core();');
262
- expect(content).not.toContain('@include angular-material-theme($lux-theme);');
263
- done();
264
- }, (reason) => expect(reason).toBeNull());
265
- });
266
- });
267
- describe('[Rule] addThemeAssets', () => {
268
- it('Sollte das Theme in das Assets-Array eintragen', (done) => {
269
- appTree.overwrite('/angular.json', `
270
- {
271
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
272
- "version": 1,
273
- "newProjectRoot": "projects",
274
- "projects": {
275
- "bar": {
276
- "projectType": "application",
277
- "schematics": {
278
- "@schematics/angular:component": {
279
- "style": "scss"
280
- }
281
- },
282
- "root": "projects/bar",
283
- "sourceRoot": "projects/bar/src",
284
- "prefix": "app",
285
- "architect": {
286
- "build": {
287
- "builder": "@angular-devkit/build-angular:browser",
288
- "options": {
289
- "assets": [
290
- "projects/bar/src/favicon.ico",
291
- "projects/bar/src/assets"
292
- ],
293
- "styles": [
294
- "projects/bar/src/styles.scss"
295
- ],
296
- "scripts": []
297
- }
298
- },
299
- "test": {
300
- "builder": "@angular-devkit/build-angular:karma",
301
- "options": {
302
- "main": "projects/bar/src/test.ts",
303
- "polyfills": "projects/bar/src/polyfills.ts",
304
- "tsConfig": "projects/bar/tsconfig.spec.json",
305
- "karmaConfig": "projects/bar/karma.conf.js",
306
- "assets": [
307
- "projects/bar/src/favicon.ico",
308
- "projects/bar/src/assets"
309
- ],
310
- "styles": [
311
- "projects/bar/src/styles.scss"
312
- ],
313
- "scripts": []
314
- }
315
- }
316
- }
317
- }
318
- },
319
- "defaultProject": "bar"
320
- }
321
- `);
322
- schematics_1.callRule(index_1.addThemeAssets(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
323
- var _a;
324
- const content = (_a = success.read('/angular.json')) === null || _a === void 0 ? void 0 : _a.toString();
325
- expect(content).toContain(`
326
- "options": {
327
- "assets": [
328
- {
329
- "glob": "*.css",
330
- "input": "./node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes",
331
- "output": "./assets/themes"
332
- },
333
- "projects/bar/src/favicon.ico",
334
- "projects/bar/src/assets"
335
- ],
336
- `);
337
- expect(content).toContain(`
338
- "karmaConfig": "projects/bar/karma.conf.js",
339
- "assets": [
340
- {
341
- "glob": "*.css",
342
- "input": "./node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes",
343
- "output": "./assets/themes"
344
- },
345
- "projects/bar/src/favicon.ico",
346
- "projects/bar/src/assets"
347
- ],
348
- `);
349
- done();
350
- }, (reason) => expect(reason).toBeUndefined());
351
- });
352
- });
353
- describe('[Rule] removeThemeAssets', () => {
354
- it('Sollte das Theme aus dem Assets-Array austragen', (done) => {
355
- appTree.overwrite('/angular.json', `
356
- {
357
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
358
- "version": 1,
359
- "newProjectRoot": "projects",
360
- "projects": {
361
- "bar": {
362
- "projectType": "application",
363
- "schematics": {
364
- "@schematics/angular:component": {
365
- "style": "scss"
366
- }
367
- },
368
- "root": "projects/bar",
369
- "sourceRoot": "projects/bar/src",
370
- "prefix": "app",
371
- "architect": {
372
- "build": {
373
- "builder": "@angular-devkit/build-angular:browser",
374
- "options": {
375
- "styles": [
376
- "projects/bar/src/styles.scss",
377
- "src/theming/luxtheme.scss"
378
- ],
379
- "scripts": []
380
- }
381
- },
382
- "test": {
383
- "builder": "@angular-devkit/build-angular:karma",
384
- "options": {
385
- "main": "projects/bar/src/test.ts",
386
- "polyfills": "projects/bar/src/polyfills.ts",
387
- "tsConfig": "projects/bar/tsconfig.spec.json",
388
- "karmaConfig": "projects/bar/karma.conf.js",
389
- "styles": [
390
- "src/theming/luxtheme.scss",
391
- "projects/bar/src/styles.scss"
392
- ],
393
- "scripts": []
394
- }
395
- }
396
- }
397
- }
398
- },
399
- "defaultProject": "bar"
400
- }
401
- `);
402
- schematics_1.callRule(index_1.removeThemeAssets(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
403
- var _a;
404
- const content = (_a = success.read('/angular.json')) === null || _a === void 0 ? void 0 : _a.toString();
405
- expect(content).toContain(`
406
- "options": {
407
- "styles": [
408
- "projects/bar/src/styles.scss"
409
- ],
410
- `);
411
- expect(content).toContain(`
412
- "karmaConfig": "projects/bar/karma.conf.js",
413
- "styles": [
414
- "projects/bar/src/styles.scss"
415
- ],
416
- `);
417
- done();
418
- }, (reason) => expect(reason).toBeUndefined());
419
- });
420
- });
421
- describe('[Rule] updateAppComponent', () => {
422
- it('Sollte die app.component.ts (mit Constructor) anpassen', (done) => {
423
- appTree.overwrite(testOptions.path + '/src/app/app.component.ts', `
424
- import { Component, OnInit } from '@angular/core';
425
- import { Router } from '@angular/router';
426
-
427
- @Component({
428
- selector: 'app-root',
429
- templateUrl: './app.component.html',
430
- styleUrls: ['./app.component.scss']
431
- })
432
- export class AppComponent implements OnInit {
433
- constructor(public router: Router) {}
434
-
435
- ngOnInit(): void {}
436
- }
437
- `);
438
- schematics_1.callRule(index_1.updateAppComponent(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
439
- var _a;
440
- const content = (_a = success.read(testOptions.path + '/src/app/app.component.ts')) === null || _a === void 0 ? void 0 : _a.toString();
441
- expect(content).toContain('import { LuxThemeService } from \'@ihk-gfi/lux-components\';');
442
- expect(content).toContain('constructor(public router: Router, private themeService: LuxThemeService)');
443
- expect(content).toContain('themeService.loadTheme();');
444
- done();
445
- }, (reason) => expect(reason).toBeUndefined());
446
- });
447
- it('Sollte die app.component.ts (leerer Constructor) anpassen', (done) => {
448
- appTree.overwrite(testOptions.path + '/src/app/app.component.ts', `
449
- import { Component, OnInit } from '@angular/core';
450
- import { Router } from '@angular/router';
451
-
452
- @Component({
453
- selector: 'app-root',
454
- templateUrl: './app.component.html',
455
- styleUrls: ['./app.component.scss']
456
- })
457
- export class AppComponent implements OnInit {
458
- constructor() {
459
- console.log('Test');
460
- }
461
-
462
- ngOnInit(): void {}
463
- }
464
- `);
465
- schematics_1.callRule(index_1.updateAppComponent(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
466
- var _a;
467
- const content = (_a = success.read(testOptions.path + '/src/app/app.component.ts')) === null || _a === void 0 ? void 0 : _a.toString();
468
- expect(content).toContain('import { LuxThemeService } from \'@ihk-gfi/lux-components\';');
469
- expect(content).toContain('constructor(private themeService: LuxThemeService)');
470
- expect(content).toContain('themeService.loadTheme();');
471
- done();
472
- }, (reason) => expect(reason).toBeUndefined());
473
- });
474
- it('Sollte die app.component.ts (ohne Constructor) anpassen', (done) => {
475
- appTree.overwrite(testOptions.path + '/src/app/app.component.ts', `
476
- import { Component, OnInit } from '@angular/core';
477
- import { Router } from '@angular/router';
478
-
479
- @Component({
480
- selector: 'app-root',
481
- templateUrl: './app.component.html',
482
- styleUrls: ['./app.component.scss']
483
- })
484
- export class AppComponent implements OnInit {
485
-
486
- ngOnInit(): void {}
487
- }
488
- `);
489
- schematics_1.callRule(index_1.updateAppComponent(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
490
- var _a;
491
- const content = (_a = success.read(testOptions.path + '/src/app/app.component.ts')) === null || _a === void 0 ? void 0 : _a.toString();
492
- expect(content).toContain('import { LuxThemeService } from \'@ihk-gfi/lux-components\';');
493
- expect(content).toContain('constructor(private themeService: LuxThemeService)');
494
- expect(content).toContain('themeService.loadTheme();');
495
- done();
496
- }, (reason) => expect(reason).toBeUndefined());
497
- });
498
- });
499
- describe('[Rule] updateAppModule', () => {
500
- it('Sollte die Root-Services aus den Providern entfernen', (done) => {
501
- appTree.overwrite(testOptions.path + '/src/app/app.module.ts', `
502
- import { BrowserModule } from '@angular/platform-browser';
503
- import { FlexLayoutModule } from '@angular/flex-layout';
504
- import {
505
- LuxActionModule,
506
- LuxAppFooterButtonService,
507
- LuxAppFooterLinkService,
508
- LuxCommonModule,
509
- LuxComponentsConfigModule,
510
- LuxComponentsConfigParameters,
511
- LuxConsoleService,
512
- LuxDirectivesModule,
513
- LuxErrorModule,
514
- LuxErrorService,
515
- LuxFormModule,
516
- LuxIconModule,
517
- LuxLayoutModule,
518
- LuxMasterDetailMobileHelperService,
519
- LuxPipesModule,
520
- LuxPopupsModule,
521
- LuxSnackbarService,
522
- LuxStepperHelperService
523
- } from '@ihk-gfi/lux-components';
524
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
525
-
526
- const luxComponentsConfig: LuxComponentsConfigParameters = {
527
- generateLuxTagIds: true,
528
- labelConfiguration: {
529
- allUppercase: true,
530
- notAppliedTo: ['lux-side-nav-item', 'lux-menu-item', 'lux-link']
531
- },
532
- lookupServiceUrl: '/lookup/'
533
- };
534
-
535
- @NgModule({
536
- declarations: [AppComponent, HomeComponent, ErrorComponent, ProfilComponent],
537
- imports: [
538
- BrowserModule,
539
- BrowserAnimationsModule,
540
- AppRoutingModule,
541
- LuxDirectivesModule,
542
- LuxIconModule,
543
- LuxLayoutModule,
544
- LuxActionModule,
545
- LuxFormModule,
546
- LuxCommonModule,
547
- LuxPipesModule,
548
- LuxPopupsModule,
549
- LuxErrorModule,
550
- FlexLayoutModule,
551
- LuxComponentsConfigModule.forRoot(luxComponentsConfig)
552
- ],
553
- providers: [
554
- LuxAppFooterButtonService,
555
- LuxAppFooterLinkService,
556
- LuxSnackbarService,
557
- LuxErrorService,
558
- LuxMasterDetailMobileHelperService,
559
- LuxStepperHelperService,
560
- LuxConsoleService
561
- ],
562
- bootstrap: [AppComponent]
563
- })
564
- export class AppModule {}
565
- `);
566
- schematics_1.callRule(index_1.updateAppModule(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
567
- var _a;
568
- const content = (_a = success.read(testOptions.path + '/src/app/app.module.ts')) === null || _a === void 0 ? void 0 : _a.toString();
569
- expect(content).not.toContain('LuxAppFooterButtonService,');
570
- expect(content).not.toContain('LuxAppFooterLinkService,');
571
- expect(content).not.toContain('LuxSnackbarService,');
572
- expect(content).not.toContain('LuxErrorService,');
573
- expect(content).not.toContain('LuxMasterDetailMobileHelperService,');
574
- expect(content).not.toContain('LuxStepperHelperService,');
575
- expect(content).not.toContain('LuxConsoleService,');
576
- expect(content).toContain('LuxIconModule,');
577
- expect(content).toContain('LuxCommonModule,');
578
- expect(content).not.toContain('displayBindingDebugHint');
579
- expect(content).toContain(`
580
- const luxComponentsConfig: LuxComponentsConfigParameters = {
581
- generateLuxTagIds: environment.generateLuxTagIds
582
- };`);
583
- done();
584
- }, (reason) => expect(reason).toBeUndefined());
585
- });
586
- });
587
- describe('[Rule] i18nUpdateAppModule', () => {
588
- it('Sollte die Datei "app.module.ts" (i18n) angepasst haben', (done) => {
589
- appTree.overwrite(testOptions.path + '/src/app/app.module.ts', `
590
- import '@angular/common/locales/global/de';
591
- import { Configuration, ConfigurationParameters } from './../../src-gen/bsclient/configuration';
592
- import { SDApiModule } from '@ihk-gfi/lux-stammdaten';
593
- import { BSApiModule } from './../../src-gen/bsclient/api.module';
594
- import {registerLocaleData, DatePipe} from '@angular/common';
595
- import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
596
- import {LOCALE_ID, NgModule, ErrorHandler} from '@angular/core';
597
- import {FlexLayoutModule} from '@angular/flex-layout';
598
- import {FormsModule, ReactiveFormsModule} from '@angular/forms';
599
- import {BrowserModule} from '@angular/platform-browser';
600
-
601
- import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
602
- import {
603
- LuxFilePreviewModule,
604
- LuxFilePreviewComponent
605
- } from '@ihk-gfi/lux-components';
606
-
607
- import { TimeoutComponent } from './components/basic/timeout/timeout.component';
608
- import {UnauthorizedComponent} from './components/basic/unauthorized/unauthorized.component';
609
- import {SharedService} from './services/shared.service';
610
-
611
- @NgModule({
612
- declarations : [
613
- AppComponent,
614
- DatenschutzComponent,
615
- ImpressumComponent,
616
- MaintenanceComponent,
617
- ErrorComponent,
618
- WelcomeComponent,
619
- UnauthorizedComponent,
620
- TimeoutComponent,
621
- ByeComponent
622
- ],
623
- imports : [
624
- HttpClientModule,
625
- BrowserModule,
626
- FormsModule,
627
- ReactiveFormsModule,
628
- AppRoutingModule,
629
- BrowserAnimationsModule,
630
- LuxDirectivesModule,
631
- LuxIconModule,
632
- LuxLayoutModule,
633
- LuxActionModule,
634
- LuxFormModule,
635
- LuxCommonModule,
636
- LuxPipesModule,
637
- LuxPopupsModule,
638
- LuxErrorModule,
639
- FlexLayoutModule,
640
- LuxFilePreviewModule,
641
- FeedbackModule,
642
- HomeModule,
643
- ConfigurationModule,
644
- SDApiModule.forRoot(apiSDConfigFactory),
645
- BSApiModule.forRoot(apiConfigFactory),
646
- LuxComponentsConfigModule.forRoot(luxComponentsConfig)
647
- ],
648
- entryComponents: [
649
- LuxSnackbarComponent,
650
- LuxFilePreviewComponent
651
- ],
652
- providers : [
653
- LuxConsoleService,
654
- {
655
- provide : HTTP_INTERCEPTORS,
656
- useClass: CSRFInterceptor,
657
- multi : true
658
- },
659
- {
660
- provide : HTTP_INTERCEPTORS,
661
- useClass: CorrelationInterceptor,
662
- multi : true
663
- },
664
- {
665
- provide : HTTP_INTERCEPTORS,
666
- useClass: UnauthorizedInterceptor,
667
- multi : true
668
- },
669
- {provide: LOCALE_ID, useValue: (document[ 'locale' ] ? document[ 'locale' ] : 'de-DE')},
670
- { provide: Window, useValue: window },
671
- ],
672
- bootstrap : [
673
- AppComponent
674
- ]
675
- })
676
- export class AppModule {
677
- }
678
- `);
679
- schematics_1.callRule(index_1.i18nUpdateAppModule(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
680
- var _a;
681
- const content = (_a = success.read(testOptions.path + '/src/app/app.module.ts')) === null || _a === void 0 ? void 0 : _a.toString();
682
- expect(content).not.toContain('import \'@angular/common/locales/global/de\';');
683
- expect(content).not.toContain('{provide: LOCALE_ID, useValue: (document[ \'locale\' ] ? document[ \'locale\' ] : \'de-DE\')},');
684
- expect(content).not.toContain('import {LOCALE_ID');
685
- expect(content).toContain('import { NgModule, ErrorHandler} from \'@angular/core\';');
686
- expect(content).not.toContain('import {registerLocaleData');
687
- expect(content).toContain('import { DatePipe} from \'@angular/common\';');
688
- done();
689
- }, (reason) => expect(reason).toBeUndefined());
690
- });
691
- });
692
- describe('[Rule] i18nCopyMessages', () => {
693
- it('Sollte die I18N-Dateien kopieren', (done) => {
694
- schematics_1.callRule(index_1.i18nCopyMessages(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
695
- expect(success.exists(testOptions.path + '/src/locale/messages.xlf')).toBeTrue();
696
- expect(success.exists(testOptions.path + '/src/locale/messages.en.xlf')).toBeTrue();
697
- expect(success.exists(testOptions.path + '/move-de-files.js')).toBeTrue();
698
- done();
699
- }, (reason) => expect(reason).toBeUndefined());
700
- });
701
- });
702
- describe('[Rule] i18nUpdateAngularJson', () => {
703
- it('Sollte die Datei "angular.json" (i18n) angepasst haben', (done) => {
704
- appTree.overwrite('/angular.json', `
705
- {
706
- "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
707
- "version": 1,
708
- "newProjectRoot": "projects",
709
- "projects": {
710
- "bar": {
711
- "root": "",
712
- "sourceRoot": "src",
713
- "projectType": "application",
714
- "architect": {
715
- "build": {
716
- "builder": "@angular-devkit/build-angular:browser",
717
- "options": {
718
- "outputPath": "dist",
719
- "index": "src/index.html",
720
- "main": "src/main.ts",
721
- "tsConfig": "src/tsconfig.app.json",
722
- "polyfills": "src/polyfills.ts",
723
- "assets": [
724
- "src/assets",
725
- \t\t\t { "glob": "**/*", "input": "./node_modules/pdfjs-dist/cmaps/", "output": "./assets/cmaps" }
726
- ],
727
- "styles": [
728
- "src/styles.scss",
729
- "src/theming/luxtheme.scss"
730
- ],
731
- "scripts": [],
732
- "allowedCommonJsDependencies": ["hammerjs", "ng2-pdf-viewer"]
733
- },
734
- "configurations": {
735
- "production": {
736
- "budgets": [
737
- {
738
- "type": "anyComponentStyle",
739
- "maximumWarning": "6kb"
740
- }
741
- ],
742
- "optimization": true,
743
- "outputHashing": "all",
744
- "sourceMap": false,
745
- "namedChunks": false,
746
- "aot": true,
747
- "extractLicenses": true,
748
- "vendorChunk": false,
749
- "buildOptimizer": true,
750
- "fileReplacements": [
751
- {
752
- "replace": "src/environments/environment.ts",
753
- "with": "src/environments/environment.prod.ts"
754
- }
755
- ]
756
- },
757
- "es5": {
758
- "budgets": [
759
- {
760
- "type": "anyComponentStyle",
761
- "maximumWarning": "6kb"
762
- }
763
- ],
764
- "tsConfig": "src/tsconfig.app.ie.json"
765
- }
766
- }
767
- },
768
- "serve": {
769
- "builder": "@angular-devkit/build-angular:dev-server",
770
- "options": {
771
- "browserTarget": "lux-bp:build"
772
- },
773
- "configurations": {
774
- "production": {
775
- "browserTarget": "lux-bp:build:production"
776
- },
777
- "es5": {
778
- "browserTarget": "lux-bp:build:es5"
779
- }
780
- }
781
- },
782
- "extract-i18n": {
783
- "builder": "@angular-devkit/build-angular:extract-i18n",
784
- "options": {
785
- "browserTarget": "lux-bp:build"
786
- }
787
- },
788
- "test": {
789
- "builder": "@angular-devkit/build-angular:karma",
790
- "options": {
791
- "main": "src/test.ts",
792
- "karmaConfig": "./karma.conf.js",
793
- "polyfills": "src/polyfills.ts",
794
- "tsConfig": "src/tsconfig.spec.json",
795
- "scripts": [],
796
- "styles": [
797
- "src/styles.scss",
798
- "src/theming/luxtheme.scss"
799
- ],
800
- "assets": [
801
- "src/assets",
802
- \t\t\t { "glob": "**/*", "input": "./node_modules/pdfjs-dist/cmaps/", "output": "./assets/cmaps" }
803
- ]
804
- }
805
- },
806
- "app-lint": {
807
- "builder": "@angular-devkit/build-angular:tslint",
808
- "options": {
809
- "tsConfig": [
810
- "src/tsconfig.app.json"
811
- ],
812
- "tslintConfig": "./tslint.json"
813
- }
814
- \t\t},
815
- "spec-lint": {
816
- "builder": "@angular-devkit/build-angular:tslint",
817
- "options": {
818
- "tsConfig": [
819
- "src/tsconfig.spec.json"
820
- ],
821
- "tslintConfig": "./tslint.spec.json"
822
- }
823
- \t\t}
824
- }
825
- },
826
- "lux-bp-e2e": {
827
- "root": "e2e",
828
- "sourceRoot": "e2e",
829
- "projectType": "application",
830
- "architect": {
831
- "e2e": {
832
- "builder": "@angular-devkit/build-angular:protractor",
833
- "options": {
834
- "protractorConfig": "./protractor.conf.js",
835
- "devServerTarget": "lux-bp:serve"
836
- }
837
- },
838
- "lint": {
839
- "builder": "@angular-devkit/build-angular:tslint",
840
- "options": {
841
- "tsConfig": [
842
- "e2e/tsconfig.e2e.json"
843
- ],
844
- "exclude": [
845
- "**/node_modules/**"
846
- ]
847
- }
848
- }
849
- }
850
- }
851
- },
852
- "defaultProject": "lux-bp",
853
- "schematics": {
854
- "@schematics/angular:component": {
855
- "prefix": "bp",
856
- "style": "scss"
857
- },
858
- "@schematics/angular:directive": {
859
- "prefix": "bp"
860
- }
861
- }
862
- }
863
-
864
- `);
865
- schematics_1.callRule(index_1.i18nUpdateAngularJson(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
866
- var _a;
867
- const content = (_a = success.read('angular.json')) === null || _a === void 0 ? void 0 : _a.toString();
868
- expect(content).toContain('"i18n": {\n' +
869
- ' "sourceLocale": {\n' +
870
- ' "code": "de",\n' +
871
- ' "baseHref": "/"\n' +
872
- ' }');
873
- expect(content).toContain(`"localize": [
874
- "de"
875
- ]`);
876
- expect(content).toContain('"i18nMissingTranslation": "error"');
877
- expect(content).toContain(`"en": {
878
- "localize": [
879
- "en"
880
- ],
881
- "aot": true,
882
- "outputPath": "dist/en",
883
- "i18nMissingTranslation": "error"
884
- }
885
- `);
886
- expect(content).toContain(`"en": {
887
- "browserTarget": "bar:build:en"
888
- }
889
- `);
890
- done();
891
- }, (reason) => expect(reason).toBeUndefined());
892
- });
893
- });
894
- describe('[Rule] i18nUpdatePackageJson', () => {
895
- it('Sollte die Datei "package.json" (i18n) angepasst haben', (done) => {
896
- appTree.overwrite('/package.json', `
897
- {
898
- "name": "BP",
899
- "version": "0.0.1",
900
- "license": "MIT",
901
- "scripts": {
902
- "ng": "ng",
903
- "start": "ng serve --public-host=http://localhost:4200",
904
- "start_en": "ng serve --public-host=http://localhost:4200 --configuration en",
905
- "build": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --source-map",
906
- "build-aot": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot",
907
- "buildzentral": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --prod",
908
- "start-ie": "ng serve --configuration es5 --public-host=http://localhost:4200",
909
- "test": "ng test",
910
- "test_no_sm": "ng test --no-sourceMap",
911
- "test_single_run": "ng test --watch=false --code-coverage=true --browsers=ChromeHeadless",
912
- "test_coverage": "ng test --watch=false --code-coverage=true",
913
- "lint": "ng run lux-bp:app-lint --format=stylish && ng run lux-bp:spec-lint --format=stylish",
914
- "e2e": "ng e2e",
915
- "compodoc": "./node_modules/.bin/compodoc -p tsconfig.json",
916
- "docStart": "compodoc src -s --port 8888",
917
- "security": "npm audit --registry=https://registry.npmjs.org --audit-level high",
918
- "smoketest": "npm run test_single_run && npm run build-aot && npm run lint --bailOnLintError true",
919
- "generate_bsclient": "openapi-generator generate -i http://localhost:8081/business-service/openapi/v3/api-docs -g typescript-angular -o src-gen/bsclient --additional-properties apiModulePrefix=BS",
920
- "generate_bsclient_zentral": "openapi-generator generate -i ../business-service/target/swagger.json -g typescript-angular -o src-gen/bsclient --additional-properties apiModulePrefix=BS"
921
- }
922
- }
923
-
924
- `);
925
- schematics_1.callRule(index_1.i18nUpdatePackageJson(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
926
- var _a;
927
- const content = (_a = success.read('package.json')) === null || _a === void 0 ? void 0 : _a.toString();
928
- expect(content).toContain('"xi18n": "ng extract-i18n --output-path src/locale --ivy"');
929
- expect(content).toContain('"build-aot": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --aot && npm run move-de-files"');
930
- expect(content).toContain('"buildzentral": "node --max_old_space_size=4024 ./node_modules/@angular/cli/bin/ng build --prod && npm run move-de-files"');
931
- expect(content).toContain('"start_en": "ng serve --public-host=http://localhost:4200 --configuration en"');
932
- done();
933
- }, (reason) => expect(reason).toBeUndefined());
934
- });
935
- });
936
- describe('[Rule] updateTsConfigJson', () => {
937
- it('Sollte die tsconfig.json anpassen', (done) => {
938
- appTree.overwrite('/tsconfig.json', `
939
- {
940
- "compileOnSave": false,
941
- "compilerOptions": {
942
- "downlevelIteration": true,
943
- "outDir": "./dist/out-tsc",
944
- "sourceMap": true,
945
- "declaration": false,
946
- "moduleResolution": "node",
947
- "emitDecoratorMetadata": true,
948
- "experimentalDecorators": true,
949
- "target": "es2015",
950
- "typeRoots": [
951
- "node_modules/@types"
952
- ],
953
- "lib": [
954
- "es2017",
955
- "dom"
956
- ],
957
- "module": "esnext",
958
- "baseUrl": "./"
959
- },
960
- "angularCompilerOptions": {
961
- "fullTemplateTypeCheck": true,
962
- "preserveWhiteSpace": false,
963
- "strictInjectionParameters": true,
964
- "enableIvy": true
965
- }
966
- }
967
- `);
968
- schematics_1.callRule(index_1.updateTsConfigJson(testOptions), rxjs_1.of(appTree), context).subscribe((success) => {
969
- var _a;
970
- const content = (_a = success.read('/tsconfig.json')) === null || _a === void 0 ? void 0 : _a.toString();
971
- expect(content).toContain('"strict": false');
972
- expect(content).toContain('"noImplicitReturns": true');
973
- expect(content).toContain('"noFallthroughCasesInSwitch": true');
974
- expect(content).toContain('"forceConsistentCasingInFileNames": true');
975
- expect(content).toContain('"lib": [\n "es2018",\n "dom"\n ]');
976
- expect(content).toContain('"module": "es2020"');
977
- expect(content).toContain('"strictInputAccessModifiers": true');
978
- expect(content).toContain('"strictTemplates": false');
979
- done();
980
- }, (reason) => expect(reason).toBeUndefined());
981
- });
982
- });
983
- });
984
- //# sourceMappingURL=index_spec.js.map