@ihk-gfi/lux-components-update 16.6.1 → 18.0.0

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 (44) hide show
  1. package/README.md +3 -3
  2. package/add-lux-components/files/src/main.ts +0 -5
  3. package/add-lux-components/index.js +9 -19
  4. package/collection.json +4 -49
  5. package/package.json +10 -10
  6. package/update-dependencies/index.js +45 -46
  7. package/updates/18.0.0/index.d.ts +13 -0
  8. package/updates/18.0.0/index.js +125 -0
  9. package/utility/files.d.ts +2 -0
  10. package/utility/files.js +26 -2
  11. package/utility/replace-item.d.ts +18 -0
  12. package/utility/replace-item.js +35 -0
  13. package/utility/util.d.ts +2 -0
  14. package/utility/util.js +8 -0
  15. package/updates/16.0.0/index.d.ts +0 -9
  16. package/updates/16.0.0/index.js +0 -66
  17. package/updates/16.0.1/index.d.ts +0 -2
  18. package/updates/16.0.1/index.js +0 -18
  19. package/updates/16.0.1/schema.json +0 -23
  20. package/updates/16.1.0/index.d.ts +0 -2
  21. package/updates/16.1.0/index.js +0 -19
  22. package/updates/16.1.0/schema.json +0 -23
  23. package/updates/16.2.0/index.d.ts +0 -2
  24. package/updates/16.2.0/index.js +0 -21
  25. package/updates/16.2.0/schema.json +0 -23
  26. package/updates/16.3.0/index.d.ts +0 -2
  27. package/updates/16.3.0/index.js +0 -19
  28. package/updates/16.3.0/schema.json +0 -23
  29. package/updates/16.4.0/index.d.ts +0 -2
  30. package/updates/16.4.0/index.js +0 -19
  31. package/updates/16.4.0/schema.json +0 -23
  32. package/updates/16.4.1/index.d.ts +0 -2
  33. package/updates/16.4.1/index.js +0 -18
  34. package/updates/16.4.1/schema.json +0 -23
  35. package/updates/16.4.2/index.d.ts +0 -2
  36. package/updates/16.4.2/index.js +0 -18
  37. package/updates/16.4.2/schema.json +0 -23
  38. package/updates/16.5.0/index.d.ts +0 -4
  39. package/updates/16.5.0/index.js +0 -59
  40. package/updates/16.5.0/schema.json +0 -23
  41. package/updates/16.6.0/index.d.ts +0 -4
  42. package/updates/16.6.0/index.js +0 -55
  43. package/updates/16.6.0/schema.json +0 -23
  44. /package/updates/{16.0.0 → 18.0.0}/schema.json +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ Dieses Projekt enthält alle Updateskripte (umgesetzt mit Angular Schematics) f
4
4
 
5
5
  Updateskripte:
6
6
 
7
- - `update-16.x.x` (aktualisiert das Projekt auf die Version 16.x.x)
7
+ - `update-18.x.x` (aktualisiert das Projekt auf die Version 18.x.x)
8
8
  - `add-lux-components` (fügt die LUX-Components zu einem Angular-Projekt hinzu)
9
9
 
10
10
  ## Voraussetzungen
@@ -20,14 +20,14 @@ npm install -g @angular-devkit/schematics-cli
20
20
  Um ein Updateskript zu starten, kann der folgende Befehl verwendet werden:
21
21
 
22
22
  ```bash
23
- ng generate @ihk-gfi/lux-components-update:update-16.x.x
23
+ ng generate @ihk-gfi/lux-components-update:update-18.x.x
24
24
  ```
25
25
 
26
26
  Falls erst einmal ein Testdurchlauf ohne persistente Änderungen gewünscht ist,
27
27
  ist es möglich den Aufruf mit dem Flag "--dry-run" zu versehen:
28
28
 
29
29
  ```bash
30
- ng generate @ihk-gfi/lux-components-update:update-16.x.x --dry-run
30
+ ng generate @ihk-gfi/lux-components-update:update-18.x.x --dry-run
31
31
  ```
32
32
 
33
33
  ## LUX-Components im Projekt einrichten
@@ -1,8 +1,3 @@
1
- /***************************************************************************************************
2
- * Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
3
- */
4
- import '@angular/localize/init';
5
-
6
1
  import { enableProdMode } from '@angular/core';
7
2
  import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
8
3
  import { AppModule } from './app/app.module';
@@ -10,16 +10,7 @@ const schematics_1 = require("@angular-devkit/schematics");
10
10
  const chalk = require("chalk");
11
11
  const jsonc_parser_1 = require("jsonc-parser");
12
12
  const index_1 = require("../update-dependencies/index");
13
- const index_2 = require("../updates/16.0.0/index");
14
- const index_3 = require("../updates/16.0.1/index");
15
- const index_4 = require("../updates/16.1.0/index");
16
- const index_5 = require("../updates/16.2.0/index");
17
- const index_6 = require("../updates/16.3.0/index");
18
- const index_7 = require("../updates/16.4.0/index");
19
- const index_8 = require("../updates/16.4.1/index");
20
- const index_9 = require("../updates/16.4.2/index");
21
- const index_10 = require("../updates/16.5.0/index");
22
- const index_11 = require("../updates/16.6.0/index");
13
+ const index_2 = require("../updates/18.0.0/index");
23
14
  const files_1 = require("../utility/files");
24
15
  const json_1 = require("../utility/json");
25
16
  const logging_1 = require("../utility/logging");
@@ -35,9 +26,13 @@ function addLuxComponents(options) {
35
26
  maximumWarning: '1mb',
36
27
  maximumError: '2mb'
37
28
  };
29
+ const jsonPathPolyfillsBuild = ['projects', options.project, 'architect', 'build', 'options', 'polyfills'];
30
+ const jsonPathPolyfillsTest = ['projects', options.project, 'architect', 'test', 'options', 'polyfills'];
31
+ const polyfillsValue = '@angular/localize/init';
38
32
  const jsonPathAssetsBuild = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
39
33
  const jsonPathAssetsTest = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
40
34
  const assetsValues = [
35
+ 'src/assets',
41
36
  {
42
37
  glob: '*(*min.css|*min.css.map)',
43
38
  input: './node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes',
@@ -84,20 +79,15 @@ function addLuxComponents(options) {
84
79
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAssetsTest, assetsValues[0]),
85
80
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAssetsBuild, assetsValues[1]),
86
81
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAssetsTest, assetsValues[1]),
82
+ (0, json_1.updateJsonArray)('/angular.json', jsonPathAssetsBuild, assetsValues[2]),
83
+ (0, json_1.updateJsonArray)('/angular.json', jsonPathAssetsTest, assetsValues[2]),
84
+ (0, json_1.updateJsonArray)('/angular.json', jsonPathPolyfillsBuild, polyfillsValue),
85
+ (0, json_1.updateJsonArray)('/angular.json', jsonPathPolyfillsTest, polyfillsValue),
87
86
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAllowedCommonJS, 'hammerjs'),
88
87
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAllowedCommonJS, 'ng2-pdf-viewer'),
89
88
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAllowedCommonJS, 'pdfjs-dist'),
90
89
  (0, json_1.updateJsonArray)('/angular.json', jsonPathAllowedCommonJS, 'dompurify'),
91
90
  (0, files_1.deleteFile)(options, ((_a = options.path) !== null && _a !== void 0 ? _a : '') + '/package-lock.json'),
92
- (0, index_3.update160001)(options, false),
93
- (0, index_4.update160100)(options, false),
94
- (0, index_5.update160200)(options, false),
95
- (0, index_6.update160300)(options, false),
96
- (0, index_7.update160400)(options, false),
97
- (0, index_8.update160401)(options, false),
98
- (0, index_9.update160402)(options, false),
99
- (0, index_10.update160500)(options, false),
100
- (0, index_11.update160600)(options, false),
101
91
  (0, util_1.finish)(true, `Die LUX-Components ${index_2.updateMajorVersion} wurden erfolgreich eingerichtet.`, `${chalk.yellowBright('Fertig!')}`)
102
92
  ]);
103
93
  };
package/collection.json CHANGED
@@ -1,55 +1,10 @@
1
1
  {
2
2
  "$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3
3
  "schematics": {
4
- "update-16.6.0": {
5
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.6.0",
6
- "factory": "./updates/16.6.0/index#update160600",
7
- "schema": "./updates/16.6.0/schema.json"
8
- },
9
- "update-16.5.0": {
10
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.5.0",
11
- "factory": "./updates/16.5.0/index#update160500",
12
- "schema": "./updates/16.5.0/schema.json"
13
- },
14
- "update-16.4.2": {
15
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.4.2",
16
- "factory": "./updates/16.4.2/index#update160402",
17
- "schema": "./updates/16.4.2/schema.json"
18
- },
19
- "update-16.4.1": {
20
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.4.1",
21
- "factory": "./updates/16.4.1/index#update160401",
22
- "schema": "./updates/16.4.1/schema.json"
23
- },
24
- "update-16.4.0": {
25
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.4.0",
26
- "factory": "./updates/16.4.0/index#update160400",
27
- "schema": "./updates/16.4.0/schema.json"
28
- },
29
- "update-16.3.0": {
30
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.3.0",
31
- "factory": "./updates/16.3.0/index#update160300",
32
- "schema": "./updates/16.3.0/schema.json"
33
- },
34
- "update-16.2.0": {
35
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.2.0",
36
- "factory": "./updates/16.2.0/index#update160200",
37
- "schema": "./updates/16.2.0/schema.json"
38
- },
39
- "update-16.1.0": {
40
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.1.0",
41
- "factory": "./updates/16.1.0/index#update160100",
42
- "schema": "./updates/16.1.0/schema.json"
43
- },
44
- "update-16.0.1": {
45
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.0.1",
46
- "factory": "./updates/16.0.1/index#update160001",
47
- "schema": "./updates/16.0.1/schema.json"
48
- },
49
- "update-16.0.0": {
50
- "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 16.0.0",
51
- "factory": "./updates/16.0.0/index#update160000",
52
- "schema": "./updates/16.0.0/schema.json"
4
+ "update-18.0.0": {
5
+ "description": "Aktualisiert das LUX-Componentsprojekt auf die Version 18.0.0",
6
+ "factory": "./updates/18.0.0/index#update180000",
7
+ "schema": "./updates/18.0.0/schema.json"
53
8
  },
54
9
  "update-dependencies": {
55
10
  "description": "Aktualisiert die Abhängigkeiten im LUX-Componentsprojekt",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihk-gfi/lux-components-update",
3
- "version": "16.6.1",
3
+ "version": "18.0.0",
4
4
  "description": "Schematics für die Aktualisierung von LUX-Applikationen",
5
5
  "scripts": {
6
6
  "build": "npm run clean && tsc -p tsconfig.json",
@@ -30,28 +30,28 @@
30
30
  },
31
31
  "schematics": "./collection.json",
32
32
  "dependencies": {
33
- "@angular-devkit/core": "^16.2.12",
34
- "@angular-devkit/schematics": "^16.2.12",
35
- "@angular-devkit/schematics-cli": "^16.2.12",
36
- "@angular/cli": "^16.2.12",
33
+ "@angular-devkit/core": "^18.2.4",
34
+ "@angular-devkit/schematics": "^18.2.4",
35
+ "@angular-devkit/schematics-cli": "^18.2.4",
36
+ "@angular/cli": "^18.2.4",
37
37
  "@types/node": "^18.11.9",
38
38
  "@types/semver": "^7.5.8",
39
- "@types/jsdom": "^21.1.6",
39
+ "@types/jsdom": "^21.1.7",
40
40
  "chalk": "^4.1.2",
41
41
  "cheerio": "1.0.0-rc.12",
42
42
  "htmlparser2": "^9.1.0",
43
43
  "jsdom": "^24.0.0",
44
44
  "jsonc-parser": "^3.2.1",
45
45
  "semver": "^7.6.0",
46
- "typescript": "^5.3.3"
46
+ "typescript": "^5.6.2"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/jasmine": "^5.1.4",
50
- "jasmine": "4.6.0",
50
+ "jasmine": "~5.1.0",
51
51
  "copyfiles": "^2.4.1",
52
52
  "del-cli": "^5.1.0",
53
- "prettier": "^3.2.5",
54
- "husky": "^9.0.11",
53
+ "prettier": "^3.3.3",
54
+ "husky": "^9.1.6",
55
55
  "pretty-quick": "^4.0.0",
56
56
  "replace": "^1.2.2"
57
57
  }
@@ -17,60 +17,59 @@ function updateDependencies() {
17
17
  deleteDep('@ihk-gfi/lux-stammdaten'),
18
18
  deleteDep('@angular/flex-layout'),
19
19
  deleteDevDep('node-sass'),
20
- updateDep('@ihk-gfi/lux-components', '16.0.0', addOrUpdate),
21
- updateDep('@ihk-gfi/lux-components-theme', '16.0.0', addOrUpdate),
20
+ updateDep('@ihk-gfi/lux-components', '18.0.0', addOrUpdate),
21
+ updateDep('@ihk-gfi/lux-components-theme', '18.0.0', addOrUpdate),
22
22
  updateDep('@ihk-gfi/lux-components-icons-and-fonts', '1.8.0', addOrUpdate),
23
- updateDep('@angular/animations', '16.2.12', addOrUpdate),
24
- updateDep('@angular/common', '16.2.12', addOrUpdate),
25
- updateDep('@angular/core', '16.2.12', addOrUpdate),
26
- updateDep('@angular/compiler', '16.2.12', addOrUpdate),
27
- updateDep('@angular/localize', '16.2.12', addOrUpdate),
28
- updateDep('@angular/forms', '16.2.12', addOrUpdate),
29
- updateDep('@angular/platform-browser', '16.2.12', addOrUpdate),
30
- updateDep('@angular/platform-browser-dynamic', '16.2.12', addOrUpdate),
31
- updateDep('@angular/router', '16.2.12', addOrUpdate),
32
- updateDep('@angular/cdk', '16.2.14', addOrUpdate),
33
- updateDep('@angular/material', '16.2.14', addOrUpdate),
34
- updateDep('rxjs', '7.8.1', addOrUpdate),
35
- updateDep('dompurify', '2.3.7', addOrUpdate),
23
+ updateDep('@angular/animations', '^18.2.6', addOrUpdate),
24
+ updateDep('@angular/common', '^18.2.6', addOrUpdate),
25
+ updateDep('@angular/core', '^18.2.6', addOrUpdate),
26
+ updateDep('@angular/compiler', '^18.2.6', addOrUpdate),
27
+ updateDep('@angular/localize', '^18.2.6', addOrUpdate),
28
+ updateDep('@angular/forms', '^18.2.6', addOrUpdate),
29
+ updateDep('@angular/platform-browser', '^18.2.6', addOrUpdate),
30
+ updateDep('@angular/platform-browser-dynamic', '^18.2.6', addOrUpdate),
31
+ updateDep('@angular/router', '^18.2.6', addOrUpdate),
32
+ updateDep('@angular/cdk', '^18.2.6', addOrUpdate),
33
+ updateDep('@angular/material', '^18.2.6', addOrUpdate),
34
+ updateDep('rxjs', '~7.8.1', addOrUpdate),
35
+ updateDep('dompurify', '3.1.6', addOrUpdate),
36
36
  updateDep('marked', '4.0.15', addOrUpdate),
37
- updateDep('zone.js', '0.13.3', addOrUpdate),
38
- updateDep('tslib', '2.6.2', updateIfExists),
37
+ updateDep('zone.js', '~0.14.10', addOrUpdate),
38
+ updateDep('tslib', '^2.3.0', updateIfExists),
39
39
  updateDep('hammerjs', '2.0.8', addOrUpdate),
40
- updateDep('ng2-pdf-viewer', '8.0.1', addOrUpdate),
41
- updateDep('pdfjs-dist', '2.13.216', addOrUpdate),
42
- updateDep('ngx-cookie-service', '16.0.0', addOrUpdate),
43
- updateDep('ngx-build-plus', '16.0.0', addOrUpdate),
44
- updateDevDep('@ihk-gfi/lux-components-update', '^16.0.0', addOrUpdate),
45
- updateDevDep('@angular-eslint/builder', '16.3.1', updateIfExists),
46
- updateDevDep('@angular-eslint/eslint-plugin', '16.3.1', updateIfExists),
47
- updateDevDep('@angular-eslint/eslint-plugin-template', '16.3.1', updateIfExists),
48
- updateDevDep('@angular-eslint/schematics', '16.3.1', updateIfExists),
49
- updateDevDep('@angular-eslint/template-parser', '16.3.1', updateIfExists),
50
- updateDevDep('@typescript-eslint/eslint-plugin', '7.5.0', updateIfExists),
51
- updateDevDep('@typescript-eslint/parser', '7.5.0', updateIfExists),
52
- updateDevDep('eslint', '8.57.0', updateIfExists),
40
+ updateDep('ng2-pdf-viewer', '10.3.1', addOrUpdate),
41
+ updateDep('ngx-cookie-service', '^18.0.0', addOrUpdate),
42
+ updateDep('ngx-build-plus', '^18.0.0', addOrUpdate),
43
+ updateDevDep('@ihk-gfi/lux-components-update', '^18.0.0', addOrUpdate),
44
+ updateDevDep('@angular-eslint/builder', '^18.3.1', updateIfExists),
45
+ updateDevDep('@angular-eslint/eslint-plugin', '^18.3.1', updateIfExists),
46
+ updateDevDep('@angular-eslint/eslint-plugin-template', '^18.3.1', updateIfExists),
47
+ updateDevDep('@angular-eslint/schematics', '^18.3.1', updateIfExists),
48
+ updateDevDep('@angular-eslint/template-parser', '^18.3.1', updateIfExists),
49
+ updateDevDep('@typescript-eslint/eslint-plugin', '^7.2.0', updateIfExists),
50
+ updateDevDep('@typescript-eslint/parser', '^7.2.0', updateIfExists),
51
+ updateDevDep('eslint', '^8.57.0', updateIfExists),
53
52
  updateDevDep('eslint-plugin-import', '2.29.1', updateIfExists),
54
53
  updateDevDep('eslint-plugin-jsdoc', '48.2.2', updateIfExists),
55
54
  updateDevDep('eslint-plugin-prefer-arrow', '1.2.3', updateIfExists),
56
- updateDevDep('@angular-devkit/build-angular', '16.2.13', addOrUpdate),
57
- updateDevDep('@angular/compiler-cli', '16.2.12', addOrUpdate),
58
- updateDevDep('@angular/cli', '16.2.13', addOrUpdate),
59
- updateDevDep('@angular/language-service', '16.2.12', addOrUpdate),
60
- updateDevDep('@angular/elements', '16.2.12', addOrUpdate),
61
- updateDevDep('@compodoc/compodoc', '1.1.19', updateIfExists),
62
- updateDevDep('@types/jasmine', '4.3.1', addOrUpdate),
55
+ updateDevDep('@angular-devkit/build-angular', '^18.2.4', addOrUpdate),
56
+ updateDevDep('@angular/compiler-cli', '^18.2.6', addOrUpdate),
57
+ updateDevDep('@angular/cli', '^18.2.6', addOrUpdate),
58
+ updateDevDep('@angular/language-service', '^18.2.6', addOrUpdate),
59
+ updateDevDep('@angular/elements', '^18.2.6', addOrUpdate),
60
+ updateDevDep('@compodoc/compodoc', '^1.1.25', updateIfExists),
61
+ updateDevDep('@types/jasmine', '~5.1.0', addOrUpdate),
63
62
  updateDevDep('@types/marked', '4.0.3', addOrUpdate),
64
- updateDevDep('jasmine-core', '4.6.0', addOrUpdate),
65
- updateDevDep('karma', '6.4.1', addOrUpdate),
66
- updateDevDep('karma-coverage', '2.2.1', addOrUpdate),
67
- updateDevDep('karma-chrome-launcher', '3.2.0', addOrUpdate),
68
- updateDevDep('karma-firefox-launcher', '2.1.2', updateIfExists),
69
- updateDevDep('karma-jasmine', '5.1.0', addOrUpdate),
70
- updateDevDep('karma-jasmine-html-reporter', '2.1.0', addOrUpdate),
63
+ updateDevDep('jasmine-core', '~5.2.0', addOrUpdate),
64
+ updateDevDep('karma', '~6.4.0', addOrUpdate),
65
+ updateDevDep('karma-coverage', '~2.2.0', addOrUpdate),
66
+ updateDevDep('karma-chrome-launcher', '~3.2.0', addOrUpdate),
67
+ updateDevDep('karma-firefox-launcher', '2.1.3', updateIfExists),
68
+ updateDevDep('karma-jasmine', '~5.1.0', addOrUpdate),
69
+ updateDevDep('karma-jasmine-html-reporter', '~2.1.0', addOrUpdate),
71
70
  updateDevDep('karma-safari-launcher', '1.0.0', updateIfExists),
72
- updateDevDep('typescript', '5.1.3', addOrUpdate),
73
- updateDevDep('fs-extra', '10.1.0', updateIfExists),
71
+ updateDevDep('typescript', '~5.5.2', addOrUpdate),
72
+ updateDevDep('fs-extra', '11.2.0', updateIfExists),
74
73
  updateDevDep('del', '6.0.0', updateIfExists),
75
74
  (0, util_1.messageSuccessRule)(`Abhängigkeiten in der Datei "package.json" wurden aktualisiert.`)
76
75
  ]);
@@ -0,0 +1,13 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ export declare const updateMajorVersion = "18";
3
+ export declare const updateMinVersion = "16.6.0";
4
+ export declare const updateNodeMinVersion = "18.0.0";
5
+ export declare function update180000(options: any): Rule;
6
+ export declare function updateProject(options: any): Rule;
7
+ export declare function updateFormControls(options: any): Rule;
8
+ export declare function updateTabs(options: any): Rule;
9
+ export declare function updateChips(options: any): Rule;
10
+ export declare function updateSlider(options: any): Rule;
11
+ export declare function updateAngularJson(options: any): Rule;
12
+ export declare function updateStylesScss(options: any): Rule;
13
+ export declare function updateStylesCss(options: any): Rule;
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateNodeMinVersion = exports.updateMinVersion = exports.updateMajorVersion = void 0;
4
+ exports.update180000 = update180000;
5
+ exports.updateProject = updateProject;
6
+ exports.updateFormControls = updateFormControls;
7
+ exports.updateTabs = updateTabs;
8
+ exports.updateChips = updateChips;
9
+ exports.updateSlider = updateSlider;
10
+ exports.updateAngularJson = updateAngularJson;
11
+ exports.updateStylesScss = updateStylesScss;
12
+ exports.updateStylesCss = updateStylesCss;
13
+ const schematics_1 = require("@angular-devkit/schematics");
14
+ const chalk = require("chalk");
15
+ const index_1 = require("../../update-dependencies/index");
16
+ const logging_1 = require("../../utility/logging");
17
+ const util_1 = require("../../utility/util");
18
+ const validation_1 = require("../../utility/validation");
19
+ const files_1 = require("../../utility/files");
20
+ const replace_item_1 = require("../../utility/replace-item");
21
+ exports.updateMajorVersion = '18';
22
+ exports.updateMinVersion = '16.6.0';
23
+ exports.updateNodeMinVersion = '18.0.0';
24
+ function update180000(options) {
25
+ return (_tree, _context) => {
26
+ return (0, schematics_1.chain)([
27
+ check(options),
28
+ (0, util_1.applyRuleIf)(exports.updateMinVersion, updateProject(options)),
29
+ (0, util_1.finish)(false, `${chalk.yellowBright('Wichtig!!!')} Hinweise im Update Guide beachten -> https://github.com/IHK-GfI/lux-components/wiki/update-guide-v${exports.updateMajorVersion}`)
30
+ ]);
31
+ };
32
+ }
33
+ function updateProject(options) {
34
+ return (_tree, _context) => {
35
+ return (0, schematics_1.chain)([
36
+ (0, util_1.messageInfoRule)(`LUX-Components ${exports.updateMajorVersion} werden aktualisiert...`),
37
+ (0, index_1.updateDependencies)(),
38
+ updateFormControls(options),
39
+ updateTabs(options),
40
+ updateChips(options),
41
+ updateSlider(options),
42
+ updateAngularJson(options),
43
+ updateStylesScss(options),
44
+ updateStylesCss(options),
45
+ (0, util_1.messageSuccessRule)(`LUX-Components ${exports.updateMajorVersion} wurden aktualisiert.`)
46
+ ]);
47
+ };
48
+ }
49
+ function check(_options) {
50
+ return (tree, _context) => {
51
+ (0, logging_1.logInfoWithDescriptor)(`Vorbedingungen werden geprüft...`);
52
+ (0, validation_1.validateNodeVersion)(_context, exports.updateNodeMinVersion);
53
+ (0, validation_1.validateLuxComponentsVersion)(tree, `${exports.updateMinVersion} || ^${exports.updateMajorVersion}.0.0`);
54
+ (0, logging_1.logSuccess)(`Vorbedingungen wurden geprüft.`);
55
+ return tree;
56
+ };
57
+ }
58
+ function updateFormControls(options) {
59
+ return (_tree, _context) => {
60
+ return (0, schematics_1.chain)([
61
+ (0, util_1.messageInfoRule)(`FormControls werden angepasst...`),
62
+ (0, files_1.replaceRule)(options, 'Attribut "luxOptionMultiline" wird entfernt...', 'Attribut "luxOptionMultiline" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlAttributeItem('luxOptionMultiline')),
63
+ (0, util_1.messageSuccessRule)(`FormControls wurden angepasst.`)
64
+ ]);
65
+ };
66
+ }
67
+ function updateTabs(options) {
68
+ return (_tree, _context) => {
69
+ return (0, schematics_1.chain)([
70
+ (0, util_1.messageInfoRule)(`Tabs werden angepasst...`),
71
+ (0, files_1.replaceRule)(options, 'Attribut "luxTabAnimationActive" wird entfernt...', 'Attribut "luxTabAnimationActive" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-tabs', 'luxTabAnimationActive')),
72
+ (0, util_1.messageSuccessRule)(`Tabs wurden angepasst.`)
73
+ ]);
74
+ };
75
+ }
76
+ function updateChips(options) {
77
+ return (_tree, _context) => {
78
+ return (0, schematics_1.chain)([
79
+ (0, util_1.messageInfoRule)(`Chips werden angepasst...`),
80
+ (0, files_1.replaceRule)(options, 'Attribut "luxMultiple" wird entfernt...', 'Attribut "luxMultiple" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-chips-ac', 'luxMultiple')),
81
+ (0, files_1.replaceRule)(options, 'Attribut "luxSelected" wird entfernt...', 'Attribut "luxSelected" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-chip-ac-group', 'luxSelected')),
82
+ (0, files_1.replaceRule)(options, 'Attribut "luxChipSelected" wird entfernt...', 'Attribut "luxChipSelected" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-chip-ac-group', 'luxChipSelected')),
83
+ (0, util_1.messageSuccessRule)(`Chips wurden angepasst.`)
84
+ ]);
85
+ };
86
+ }
87
+ function updateSlider(options) {
88
+ return (_tree, _context) => {
89
+ return (0, schematics_1.chain)([
90
+ (0, util_1.messageInfoRule)(`Slider werden angepasst...`),
91
+ (0, files_1.replaceRule)(options, 'Attribut "luxShowThumbLabelAlways" wird entfernt...', 'Attribut "luxShowThumbLabelAlways" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-slider-ac', 'luxShowThumbLabelAlways')),
92
+ (0, files_1.replaceRule)(options, 'Attribut "luxVertical" wird entfernt...', 'Attribut "luxVertical" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-slider-ac', 'luxVertical')),
93
+ (0, files_1.replaceRule)(options, 'Attribut "luxInvert" wird entfernt...', 'Attribut "luxInvert" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-slider-ac', 'luxInvert')),
94
+ (0, files_1.replaceRule)(options, 'Attribut "luxTickInterval" wird entfernt...', 'Attribut "luxTickInterval" wurde entfernt.', '.html', new replace_item_1.RemoveHtmlTagAttributeItem('lux-slider-ac', 'luxTickInterval')),
95
+ (0, util_1.messageSuccessRule)(`Slider wurden angepasst.`)
96
+ ]);
97
+ };
98
+ }
99
+ function updateAngularJson(options) {
100
+ return (_tree, _context) => {
101
+ return (0, schematics_1.chain)([
102
+ (0, util_1.messageInfoRule)(`angular.json wird angepasst...`),
103
+ (0, files_1.replaceRule)(options, 'Attribut "browserTarget" wird umbenannt in "buildTarget"...', 'Attribut "luxOptionMultiline" wurde entfernt.', 'angular.json', new replace_item_1.ReplaceItem('browserTarget', 'buildTarget', true)),
104
+ (0, util_1.messageSuccessRule)(`angular.json wurde angepasst.`)
105
+ ]);
106
+ };
107
+ }
108
+ function updateStylesScss(options) {
109
+ return (_tree, _context) => {
110
+ return (0, schematics_1.chain)([
111
+ (0, util_1.messageInfoRule)(`styles.scss wird angepasst...`),
112
+ (0, files_1.replaceRule)(options, 'Import wird geprüft...', 'Import wurde geprüft.', 'styles.scss', new replace_item_1.ReplaceItem(`@import '@ihk-gfi`, `@import '../node_modules/@ihk-gfi`, true), new replace_item_1.ReplaceItem(`@import "@ihk-gfi`, `@import "../node_modules/@ihk-gfi`, true)),
113
+ (0, util_1.messageSuccessRule)(`styles.scss wurde angepasst.`)
114
+ ]);
115
+ };
116
+ }
117
+ function updateStylesCss(options) {
118
+ return (_tree, _context) => {
119
+ return (0, schematics_1.chain)([
120
+ (0, util_1.messageInfoRule)(`styles.css wird angepasst...`),
121
+ (0, files_1.replaceRule)(options, 'Import wird geprüft...', 'Import wurde geprüft.', 'styles.css', new replace_item_1.ReplaceItem(`@import '@ihk-gfi`, `@import '../node_modules/@ihk-gfi`, true), new replace_item_1.ReplaceItem(`@import "@ihk-gfi`, `@import "../node_modules/@ihk-gfi`, true)),
122
+ (0, util_1.messageSuccessRule)(`styles.css wurde angepasst.`)
123
+ ]);
124
+ };
125
+ }
@@ -1,5 +1,6 @@
1
1
  import { Path } from '@angular-devkit/core';
2
2
  import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
3
+ import { ReplaceItem } from './replace-item';
3
4
  /**
4
5
  * Entfernt eine Zeile aus der Datei, die den searchString beinhaltet.
5
6
  * Gibt eine Log-Ausgabe aus, wenn die Datei nicht gefunden werden konnte.
@@ -62,3 +63,4 @@ export declare function findModule(host: Tree, generateDir: string, moduleExt?:
62
63
  * @param targetPath
63
64
  */
64
65
  export declare function deleteFile(options: any, targetPath: string): Rule;
66
+ export declare function replaceRule(options: any, startMsg: string, endMsg: string, filePattern: string, ...replaceItems: ReplaceItem[]): Rule;
package/utility/files.js CHANGED
@@ -8,9 +8,11 @@ exports.deleteFilesInDirectory = deleteFilesInDirectory;
8
8
  exports.searchInComponentAndModifyModule = searchInComponentAndModifyModule;
9
9
  exports.findModule = findModule;
10
10
  exports.deleteFile = deleteFile;
11
+ exports.replaceRule = replaceRule;
11
12
  const core_1 = require("@angular-devkit/core");
12
13
  const schematics_1 = require("@angular-devkit/schematics");
13
14
  const logging_1 = require("./logging");
15
+ const util_1 = require("./util");
14
16
  /**
15
17
  * Entfernt eine Zeile aus der Datei, die den searchString beinhaltet.
16
18
  * Gibt eine Log-Ausgabe aus, wenn die Datei nicht gefunden werden konnte.
@@ -272,8 +274,7 @@ function findModule(host, generateDir, moduleExt = '.module.ts', routingModuleEx
272
274
  return (0, core_1.join)(dir.path, filteredMatches[0]);
273
275
  }
274
276
  else if (filteredMatches.length > 1) {
275
- throw new Error('More than one module matches. Use skip-import option to skip importing ' +
276
- 'the component into the closest module.');
277
+ throw new Error('More than one module matches. Use skip-import option to skip importing ' + 'the component into the closest module.');
277
278
  }
278
279
  dir = dir.parent;
279
280
  }
@@ -306,3 +307,26 @@ function deleteFile(options, targetPath) {
306
307
  return tree;
307
308
  };
308
309
  }
310
+ function replaceRule(options, startMsg, endMsg, filePattern, ...replaceItems) {
311
+ return (0, schematics_1.chain)([
312
+ (0, util_1.messageInfoRule)(startMsg),
313
+ (tree, _context) => {
314
+ iterateFilesAndModifyContent(tree, options.path, (filePath, content) => {
315
+ let result = content;
316
+ replaceItems.forEach((item) => {
317
+ if (typeof item.find === 'string') {
318
+ result = (0, util_1.replaceString)(result, item.find, item.replacement, item.replaceAll);
319
+ }
320
+ else {
321
+ result = (0, util_1.replaceRegEx)(result, item.find, item.replacement);
322
+ }
323
+ });
324
+ if (content !== result) {
325
+ (0, logging_1.logInfo)(filePath + ' wurde angepasst.');
326
+ tree.overwrite(filePath, result);
327
+ }
328
+ }, filePattern);
329
+ },
330
+ (0, util_1.messageSuccessRule)(endMsg)
331
+ ]);
332
+ }
@@ -0,0 +1,18 @@
1
+ export declare class ReplaceItem {
2
+ find: string | RegExp;
3
+ replacement: string;
4
+ replaceAll: boolean;
5
+ constructor(find: string | RegExp, replace: string, replaceAll?: boolean);
6
+ }
7
+ export declare class ReplaceHtmlTagAttributeItem extends ReplaceItem {
8
+ constructor(tagName: string, attributeName: string, replaceName: string, replaceValue: string);
9
+ }
10
+ export declare class RemoveHtmlTagAttributeItem extends ReplaceItem {
11
+ constructor(tagName: string, attributeName: string);
12
+ }
13
+ export declare class ReplaceHtmlAttributeItem extends ReplaceItem {
14
+ constructor(attributeName: string, replace: string);
15
+ }
16
+ export declare class RemoveHtmlAttributeItem extends ReplaceItem {
17
+ constructor(attributeName: string);
18
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RemoveHtmlAttributeItem = exports.ReplaceHtmlAttributeItem = exports.RemoveHtmlTagAttributeItem = exports.ReplaceHtmlTagAttributeItem = exports.ReplaceItem = void 0;
4
+ class ReplaceItem {
5
+ constructor(find, replace, replaceAll) {
6
+ this.find = find;
7
+ this.replacement = replace;
8
+ this.replaceAll = replaceAll !== null && replaceAll !== void 0 ? replaceAll : true;
9
+ }
10
+ }
11
+ exports.ReplaceItem = ReplaceItem;
12
+ class ReplaceHtmlTagAttributeItem extends ReplaceItem {
13
+ constructor(tagName, attributeName, replaceName, replaceValue) {
14
+ super(new RegExp(String.raw `(<${tagName}\s?[^>]*?\[?\(?)${attributeName}(\)?\]?)\s?=\s?"[^"]*"([^>]*>)`, 'gm'), `$1${replaceName}$2="${replaceValue}"$3`, true);
15
+ }
16
+ }
17
+ exports.ReplaceHtmlTagAttributeItem = ReplaceHtmlTagAttributeItem;
18
+ class RemoveHtmlTagAttributeItem extends ReplaceItem {
19
+ constructor(tagName, attributeName) {
20
+ super(new RegExp(String.raw `(<${tagName}\s?[^>]*?)\[?\(?${attributeName}\)?\]?\s?=\s?"[^"]*"([^>]*>)`, 'gm'), '$1$2', true);
21
+ }
22
+ }
23
+ exports.RemoveHtmlTagAttributeItem = RemoveHtmlTagAttributeItem;
24
+ class ReplaceHtmlAttributeItem extends ReplaceItem {
25
+ constructor(attributeName, replace) {
26
+ super(new RegExp(String.raw `(\[?\(?${attributeName}\)?\]?)\s?=\s?"[^"]*"`, 'gm'), replace, true);
27
+ }
28
+ }
29
+ exports.ReplaceHtmlAttributeItem = ReplaceHtmlAttributeItem;
30
+ class RemoveHtmlAttributeItem extends ReplaceItem {
31
+ constructor(attributeName) {
32
+ super(new RegExp(String.raw `(\[?\(?${attributeName}\)?\]?)\s?=\s?"[^"]*"`, 'gm'), '', true);
33
+ }
34
+ }
35
+ exports.RemoveHtmlAttributeItem = RemoveHtmlAttributeItem;
package/utility/util.d.ts CHANGED
@@ -8,6 +8,8 @@ export declare const UtilConfig: {
8
8
  defaultWaitMS: number;
9
9
  };
10
10
  export declare function escapeRegExp(str: string): string;
11
+ export declare function replaceRegEx(str: string, expression: RegExp, replace: string): string;
12
+ export declare function replaceString(str: string, find: string, replace: string, isReplaceAll?: boolean): string;
11
13
  export declare function replaceFirst(str: string, find: string, replace: string): string;
12
14
  export declare function replaceAll(str: string, find: string, replace: string): string;
13
15
  /**
package/utility/util.js CHANGED
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runInstallAndLogToDos = exports.waitForTreeCallback = exports.UtilConfig = void 0;
4
4
  exports.escapeRegExp = escapeRegExp;
5
+ exports.replaceRegEx = replaceRegEx;
6
+ exports.replaceString = replaceString;
5
7
  exports.replaceFirst = replaceFirst;
6
8
  exports.replaceAll = replaceAll;
7
9
  exports.updateI18nFile = updateI18nFile;
@@ -28,6 +30,12 @@ exports.UtilConfig = {
28
30
  function escapeRegExp(str) {
29
31
  return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
30
32
  }
33
+ function replaceRegEx(str, expression, replace) {
34
+ return str.replace(expression, replace);
35
+ }
36
+ function replaceString(str, find, replace, isReplaceAll = true) {
37
+ return isReplaceAll ? replaceAll(str, find, replace) : replaceFirst(str, find, replace);
38
+ }
31
39
  function replaceFirst(str, find, replace) {
32
40
  return str.replace(new RegExp(escapeRegExp(find), 'm'), replace);
33
41
  }
@@ -1,9 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- export declare const updateMajorVersion = "16";
3
- export declare const updateMinVersion = "15.5.1";
4
- export declare const updateNodeMinVersion = "18.0.0";
5
- export declare function update160000(options: any): Rule;
6
- export declare function updateProject(_options: any): Rule;
7
- export declare function updateI18NFiles(): Rule;
8
- export declare const i18nDe = "<trans-unit id=\"luxc.dialog.btn.close.arialabel\" datatype=\"html\">\n <source>Dialog schlie\u00DFen</source>\n <context-group purpose=\"location\">\n <context context-type=\"sourcefile\">src/app/modules/lux-popups/lux-dialog/lux-dialog-structure/lux-dialog-structure.component.html</context>\n <context context-type=\"linenumber\">16</context>\n </context-group>\n </trans-unit>";
9
- export declare const i18nEn = "<trans-unit id=\"luxc.dialog.btn.close.arialabel\" datatype=\"html\">\n <source>Dialog schlie\u00DFen</source>\n <target>Dialog close</target>\n <context-group purpose=\"location\">\n <context context-type=\"sourcefile\">src/app/modules/lux-popups/lux-dialog/lux-dialog-structure/lux-dialog-structure.component.html</context>\n <context context-type=\"linenumber\">16</context>\n </context-group>\n </trans-unit>";