@ihk-gfi/lux-components-update 16.6.0 → 16.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/updates/16.5.0/index.js +8 -13
- package/updates/16.6.0/index.d.ts +3 -1
- package/updates/16.6.0/index.js +36 -2
package/package.json
CHANGED
package/updates/16.5.0/index.js
CHANGED
|
@@ -7,6 +7,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
7
7
|
const chalk = require("chalk");
|
|
8
8
|
const index_1 = require("../../update-dependencies/index");
|
|
9
9
|
const util_1 = require("../../utility/util");
|
|
10
|
+
const json_1 = require("../../utility/json");
|
|
10
11
|
const files_1 = require("../../utility/files");
|
|
11
12
|
const logging_1 = require("../../utility/logging");
|
|
12
13
|
function update160500(options, runNpmInstall = true) {
|
|
@@ -25,24 +26,18 @@ function update160500(options, runNpmInstall = true) {
|
|
|
25
26
|
updateAngularJson(options),
|
|
26
27
|
updateAppModuleTs(options),
|
|
27
28
|
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 16.5.0 aktualisiert.`),
|
|
28
|
-
(0, util_1.finish)(runNpmInstall, ``, `${chalk.yellowBright('
|
|
29
|
+
(0, util_1.finish)(runNpmInstall, ``, `${chalk.yellowBright('Die folgenden manuellen Schritte müssen nur ausgeführt werden,')}`, `${chalk.yellowBright('wenn die App die LUX-File-Preview (PDF-Vorschau) einsetzt')}`, `${chalk.yellowBright('----------------------------------------------------------------------')}`, `${chalk.yellowBright('1. Bitte einmal den "node_modules"-Ordner und die "package-lock.json"-Datei löschen und noch einmal "npm install" ausführen.')}`, `${chalk.yellowBright('2. Die Datei "./node_modules/pdfjs-dist/build/pdf.worker.min.mjs" in den Ordner "src/assets/pdf" kopieren.')}`, `${chalk.yellowBright('3. Die Datei "pdf.worker.min.mjs" in "pdf.worker.min.js" umbenennen.')}`, `${chalk.yellowBright('4. Prüfen, ob in der "app.module.ts" die folgende Zeile "(window as any).pdfWorkerSrc = "/assets/pdf/pdf.worker.min.js"; enthalten ist.')}`, `${chalk.gray('Die Abhängigkeit "ng2-pdf-viewer" wurde aktualisiert.')}`, `${chalk.gray('Diese Library verwendet intern die Abhängigkeit "pdfjs-dist@4.6.82".')}`, ``, `${chalk.greenBright('Fertig!')}`)
|
|
29
30
|
]);
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
function updateAngularJson(options) {
|
|
34
|
+
var _a, _b, _c, _d;
|
|
33
35
|
return (0, schematics_1.chain)([
|
|
34
36
|
(0, util_1.messageInfoRule)(`Die Datei angular.json wird verarbeitet...`),
|
|
35
|
-
(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
result = (0, util_1.replaceAll)(result, 'node_modules/ng2-pdf-viewer/node_modules/pdfjs-dist/build', 'node_modules/pdfjs-dist/build');
|
|
40
|
-
if (content !== result) {
|
|
41
|
-
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
42
|
-
tree.overwrite(filePath, result);
|
|
43
|
-
}
|
|
44
|
-
}, 'angular.json');
|
|
45
|
-
},
|
|
37
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'build', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.js')), ((_a = options.path) !== null && _a !== void 0 ? _a : '.') + '/angular.json'),
|
|
38
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'test', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.js')), ((_b = options.path) !== null && _b !== void 0 ? _b : '.') + '/angular.json'),
|
|
39
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'build', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.mjs')), ((_c = options.path) !== null && _c !== void 0 ? _c : '.') + '/angular.json'),
|
|
40
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'test', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.mjs')), ((_d = options.path) !== null && _d !== void 0 ? _d : '.') + '/angular.json'),
|
|
46
41
|
(0, util_1.messageSuccessRule)(`Die Datei angular.json wurde verarbeitet.`)
|
|
47
42
|
]);
|
|
48
43
|
}
|
|
@@ -52,7 +47,7 @@ function updateAppModuleTs(options) {
|
|
|
52
47
|
(tree, _context) => {
|
|
53
48
|
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
54
49
|
let result = content;
|
|
55
|
-
result = (0, util_1.replaceAll)(result, 'pdf.worker.min.
|
|
50
|
+
result = (0, util_1.replaceAll)(result, 'pdf.worker.min.mjs', 'pdf.worker.min.js');
|
|
56
51
|
if (content !== result) {
|
|
57
52
|
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
58
53
|
tree.overwrite(filePath, result);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function update160600(
|
|
2
|
+
export declare function update160600(options: any, runNpmInstall?: boolean): Rule;
|
|
3
|
+
export declare function updateAngularJson(options: any): Rule;
|
|
4
|
+
export declare function updateAppModuleTs(options: any): Rule;
|
package/updates/16.6.0/index.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.update160600 = update160600;
|
|
4
|
+
exports.updateAngularJson = updateAngularJson;
|
|
5
|
+
exports.updateAppModuleTs = updateAppModuleTs;
|
|
4
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
7
|
const chalk = require("chalk");
|
|
6
8
|
const index_1 = require("../../update-dependencies/index");
|
|
7
9
|
const util_1 = require("../../utility/util");
|
|
8
|
-
|
|
10
|
+
const files_1 = require("../../utility/files");
|
|
11
|
+
const logging_1 = require("../../utility/logging");
|
|
12
|
+
const json_1 = require("../../utility/json");
|
|
13
|
+
function update160600(options, runNpmInstall = true) {
|
|
9
14
|
return (_tree, _context) => {
|
|
10
15
|
return (0, schematics_1.chain)([
|
|
11
16
|
(0, util_1.messageInfoRule)(`Die LUX-Components werden auf die Version 16.6.0 aktualisiert...`),
|
|
@@ -14,8 +19,37 @@ function update160600(_options, runNpmInstall = true) {
|
|
|
14
19
|
(0, index_1.updateDep)('dompurify', '~3.1.6', true),
|
|
15
20
|
(0, index_1.updateDevDep)('@angular-devkit/build-angular', '16.2.16', false),
|
|
16
21
|
(0, index_1.updateDevDep)('@angular/cli', '16.2.16', false),
|
|
22
|
+
updateAngularJson(options),
|
|
23
|
+
updateAppModuleTs(options),
|
|
17
24
|
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 16.6.0 aktualisiert.`),
|
|
18
|
-
(0, util_1.finish)(runNpmInstall, `${chalk.yellowBright('Fertig!')}`)
|
|
25
|
+
(0, util_1.finish)(runNpmInstall, ``, `${chalk.yellowBright('Die folgenden manuellen Schritte müssen nur ausgeführt werden,')}`, `${chalk.yellowBright('wenn die App die LUX-File-Preview (PDF-Vorschau) einsetzt')}`, `${chalk.yellowBright('----------------------------------------------------------------------')}`, `${chalk.yellowBright('1. Bitte einmal den "node_modules"-Ordner und die "package-lock.json"-Datei löschen und noch einmal "npm install" ausführen.')}`, `${chalk.yellowBright('2. Die Datei "./node_modules/pdfjs-dist/build/pdf.worker.min.mjs" in den Ordner "src/assets/pdf" kopieren.')}`, `${chalk.yellowBright('3. Die Datei "pdf.worker.min.mjs" in "pdf.worker.min.js" umbenennen.')}`, `${chalk.yellowBright('4. Prüfen, ob in der "app.module.ts" die folgende Zeile "(window as any).pdfWorkerSrc = "/assets/pdf/pdf.worker.min.js"; enthalten ist.')}`, `${chalk.gray('Die Abhängigkeit "ng2-pdf-viewer" wurde aktualisiert.')}`, `${chalk.gray('Diese Library verwendet intern die Abhängigkeit "pdfjs-dist@4.6.82".')}`, ``, `${chalk.greenBright('Fertig!')}`)
|
|
19
26
|
]);
|
|
20
27
|
};
|
|
21
28
|
}
|
|
29
|
+
function updateAngularJson(options) {
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
return (0, schematics_1.chain)([
|
|
32
|
+
(0, util_1.messageInfoRule)(`Die Datei angular.json wird verarbeitet...`),
|
|
33
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'build', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.js')), ((_a = options.path) !== null && _a !== void 0 ? _a : '.') + '/angular.json'),
|
|
34
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'test', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.js')), ((_b = options.path) !== null && _b !== void 0 ? _b : '.') + '/angular.json'),
|
|
35
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'build', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.mjs')), ((_c = options.path) !== null && _c !== void 0 ? _c : '.') + '/angular.json'),
|
|
36
|
+
(0, util_1.applyRuleIfFileExists)((0, json_1.deleteJsonArray)(options.path + '/angular.json', ['projects', options.project, 'architect', 'test', 'options', 'assets'], (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'pdf.worker.min.mjs')), ((_d = options.path) !== null && _d !== void 0 ? _d : '.') + '/angular.json'),
|
|
37
|
+
(0, util_1.messageSuccessRule)(`Die Datei angular.json wurde verarbeitet.`)
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
40
|
+
function updateAppModuleTs(options) {
|
|
41
|
+
return (0, schematics_1.chain)([
|
|
42
|
+
(0, util_1.messageInfoRule)(`Die Datei app.module.ts wird verarbeitet...`),
|
|
43
|
+
(tree, _context) => {
|
|
44
|
+
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
45
|
+
let result = content;
|
|
46
|
+
result = (0, util_1.replaceAll)(result, 'pdf.worker.min.mjs', 'pdf.worker.min.js');
|
|
47
|
+
if (content !== result) {
|
|
48
|
+
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
49
|
+
tree.overwrite(filePath, result);
|
|
50
|
+
}
|
|
51
|
+
}, 'app.module.ts');
|
|
52
|
+
},
|
|
53
|
+
(0, util_1.messageSuccessRule)(`Die Datei app.module.ts wurde verarbeitet.`)
|
|
54
|
+
]);
|
|
55
|
+
}
|