@ihk-gfi/lux-components-update 13.2.0 → 14.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.
- package/README.md +2 -2
- package/package.json +10 -8
- package/src/add-lux-components/files/app/app-routing.module.ts +2 -0
- package/src/add-lux-components/files/app/app.component.html +7 -2
- package/src/add-lux-components/files/app/app.component.ts +9 -1
- package/src/add-lux-components/files/app/app.module.ts +6 -1
- package/src/add-lux-components/files/app/base/license-hint/license-hint.component.html +7 -0
- package/src/add-lux-components/files/app/base/license-hint/license-hint.component.ts +18 -0
- package/src/add-lux-components/files/app/home/home.component.scss +3 -0
- package/src/add-lux-components/files/assets/svg/Example.svg +6 -0
- package/src/add-lux-components/files/assets/svg/android.svg +2 -0
- package/src/add-lux-components/files/assets/svg/box.svg +690 -0
- package/src/add-lux-components/files/assets/svg/demoAppLogo.svg +1 -0
- package/src/add-lux-components/files/assets/svg/red_power_button.svg +67 -0
- package/src/add-lux-components/files/assets/svg/svg2009.svg +57457 -0
- package/src/add-lux-components/files/environments/environment.ts +2 -2
- package/src/add-lux-components/files/locale/messages.en.xlf +544 -373
- package/src/add-lux-components/files/locale/messages.xlf +517 -352
- package/src/add-lux-components/files/src/polyfills.ts +29 -39
- package/src/add-lux-components/index.d.ts +1 -1
- package/src/add-lux-components/index.js +47 -26
- package/src/add-lux-components/index.js.map +1 -1
- package/src/add-lux-components/index.ts +50 -31
- package/src/add-lux-components/index_spec.js +3 -3
- package/src/add-lux-components/index_spec.ts +1 -1
- package/src/collection.json +13 -14
- package/src/theme/change-theme-to-authentic/index.d.ts +4 -0
- package/src/theme/change-theme-to-authentic/index.js +129 -0
- package/src/theme/change-theme-to-authentic/index.js.map +1 -0
- package/src/theme/change-theme-to-authentic/index.ts +131 -0
- package/src/{updates/update130000 → theme/change-theme-to-authentic}/index_spec.d.ts +0 -0
- package/src/theme/change-theme-to-authentic/index_spec.js +300 -0
- package/src/theme/change-theme-to-authentic/index_spec.js.map +1 -0
- package/src/theme/change-theme-to-authentic/index_spec.ts +321 -0
- package/src/{updates/update130100 → theme/change-theme-to-authentic}/schema.json +3 -3
- package/src/theme/change-to-lux-icons/index.d.ts +7 -0
- package/src/theme/change-to-lux-icons/index.js +395 -0
- package/src/theme/change-to-lux-icons/index.js.map +1 -0
- package/src/theme/change-to-lux-icons/index.ts +406 -0
- package/src/{updates/update130100 → theme/change-to-lux-icons}/index_spec.d.ts +0 -0
- package/src/theme/change-to-lux-icons/index_spec.js +214 -0
- package/src/theme/change-to-lux-icons/index_spec.js.map +1 -0
- package/src/theme/change-to-lux-icons/index_spec.ts +220 -0
- package/src/{updates/update130200 → theme/change-to-lux-icons}/schema.json +3 -3
- package/src/update-dependencies/index.d.ts +0 -3
- package/src/update-dependencies/index.js +68 -116
- package/src/update-dependencies/index.js.map +1 -1
- package/src/update-dependencies/index.ts +73 -122
- package/src/update-en-messages/index.js +18 -15
- package/src/update-en-messages/index.js.map +1 -1
- package/src/update-en-messages/index.ts +22 -16
- package/src/updates/update140000/files/src/polyfills.ts +70 -0
- package/src/updates/update140000/index.d.ts +8 -0
- package/src/updates/update140000/index.js +83 -0
- package/src/updates/update140000/index.js.map +1 -0
- package/src/updates/update140000/index.ts +97 -0
- package/src/updates/{update130200 → update140000}/index_spec.d.ts +0 -0
- package/src/updates/update140000/index_spec.js +77 -0
- package/src/updates/update140000/index_spec.js.map +1 -0
- package/src/updates/update140000/index_spec.ts +79 -0
- package/src/updates/{update130000 → update140000}/schema.json +0 -0
- package/src/utility/files.d.ts +2 -2
- package/src/utility/files.js +5 -5
- package/src/utility/files.js.map +1 -1
- package/src/utility/files.ts +5 -5
- package/src/utility/html/hit.d.ts +21 -0
- package/src/utility/html/hit.js +27 -0
- package/src/utility/html/hit.js.map +1 -0
- package/src/utility/html/hit.ts +28 -0
- package/src/utility/html/html-manipulator.d.ts +71 -0
- package/src/utility/html/html-manipulator.js +136 -0
- package/src/utility/html/html-manipulator.js.map +1 -0
- package/src/utility/html/html-manipulator.ts +156 -0
- package/src/utility/{html_spec.d.ts → html/html_spec.d.ts} +0 -0
- package/src/utility/{html_spec.js → html/html_spec.js} +232 -100
- package/src/utility/html/html_spec.js.map +1 -0
- package/src/utility/{html_spec.ts → html/html_spec.ts} +282 -106
- package/src/utility/html/manipulator-functions.d.ts +99 -0
- package/src/utility/html/manipulator-functions.js +147 -0
- package/src/utility/html/manipulator-functions.js.map +1 -0
- package/src/utility/html/manipulator-functions.ts +149 -0
- package/src/utility/json.d.ts +2 -2
- package/src/utility/json.js +11 -7
- package/src/utility/json.js.map +1 -1
- package/src/utility/json.ts +42 -26
- package/src/utility/json_spec.js +18 -18
- package/src/utility/json_spec.js.map +1 -1
- package/src/utility/json_spec.ts +136 -66
- package/src/utility/typescript.d.ts +3 -3
- package/src/utility/typescript.js +2 -2
- package/src/utility/typescript.js.map +1 -1
- package/src/utility/typescript.ts +3 -3
- package/src/utility/typescript_spec.js +0 -1
- package/src/utility/typescript_spec.js.map +1 -1
- package/src/utility/typescript_spec.ts +0 -2
- package/src/utility/util.d.ts +7 -6
- package/src/utility/util.js +12 -8
- package/src/utility/util.js.map +1 -1
- package/src/utility/util.ts +13 -10
- package/src/utility/validation.d.ts +2 -3
- package/src/utility/validation.js +2 -3
- package/src/utility/validation.js.map +1 -1
- package/src/utility/validation.ts +2 -3
- package/tsconfig.json +5 -7
- package/src/add-lux-components/files/scripts/.browserslistrc +0 -20
- package/src/updates/update130000/files/root/.browserslistrc +0 -20
- package/src/updates/update130000/index.d.ts +0 -27
- package/src/updates/update130000/index.js +0 -310
- package/src/updates/update130000/index.js.map +0 -1
- package/src/updates/update130000/index.ts +0 -362
- package/src/updates/update130000/index_spec.js +0 -584
- package/src/updates/update130000/index_spec.js.map +0 -1
- package/src/updates/update130000/index_spec.ts +0 -675
- package/src/updates/update130100/index.d.ts +0 -2
- package/src/updates/update130100/index.js +0 -27
- package/src/updates/update130100/index.js.map +0 -1
- package/src/updates/update130100/index.ts +0 -27
- package/src/updates/update130100/index_spec.js +0 -65
- package/src/updates/update130100/index_spec.js.map +0 -1
- package/src/updates/update130100/index_spec.ts +0 -69
- package/src/updates/update130200/index.d.ts +0 -2
- package/src/updates/update130200/index.js +0 -43
- package/src/updates/update130200/index.js.map +0 -1
- package/src/updates/update130200/index.ts +0 -41
- package/src/updates/update130200/index_spec.js +0 -106
- package/src/updates/update130200/index_spec.js.map +0 -1
- package/src/updates/update130200/index_spec.ts +0 -110
- package/src/utility/html.d.ts +0 -49
- package/src/utility/html.js +0 -246
- package/src/utility/html.js.map +0 -1
- package/src/utility/html.ts +0 -288
- package/src/utility/html_spec.js.map +0 -1
package/src/utility/util.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.finish = exports.messageSuccessRule = exports.messageInfoInternRule = exports.messageInfoRule = exports.messageDebugRule = exports.applyRuleIf = exports.updateI18nFile = exports.runInstallAndLogToDos = exports.waitForTreeCallback = exports.replaceAll = exports.escapeRegExp = exports.UtilConfig = void 0;
|
|
3
|
+
exports.finish = exports.messageSuccessRule = exports.messageInfoInternRule = exports.messageInfoRule = exports.messageDebugRule = exports.applyRuleIf = exports.updateI18nFile = exports.runInstallAndLogToDos = exports.waitForTreeCallback = exports.replaceAll = exports.replaceFirst = exports.escapeRegExp = exports.UtilConfig = void 0;
|
|
4
4
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
5
|
const rxjs_1 = require("rxjs");
|
|
6
6
|
const operators_1 = require("rxjs/operators");
|
|
@@ -18,18 +18,22 @@ function escapeRegExp(str) {
|
|
|
18
18
|
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
|
|
19
19
|
}
|
|
20
20
|
exports.escapeRegExp = escapeRegExp;
|
|
21
|
+
function replaceFirst(str, find, replace) {
|
|
22
|
+
return str.replace(new RegExp(escapeRegExp(find), 'm'), replace);
|
|
23
|
+
}
|
|
24
|
+
exports.replaceFirst = replaceFirst;
|
|
21
25
|
function replaceAll(str, find, replace) {
|
|
22
|
-
return str.replace(new RegExp(escapeRegExp(find), '
|
|
26
|
+
return str.replace(new RegExp(escapeRegExp(find), 'gm'), replace);
|
|
23
27
|
}
|
|
24
28
|
exports.replaceAll = replaceAll;
|
|
25
29
|
/**
|
|
26
30
|
* Wartet die übergebene Zeitspanne und ruft dann den Callback auf.
|
|
27
31
|
* Gibt anschließend den Tree über ein Observable zurück.
|
|
28
|
-
* @param
|
|
32
|
+
* @param _tree
|
|
29
33
|
* @param callback
|
|
30
34
|
* @param waitMS
|
|
31
35
|
*/
|
|
32
|
-
const waitForTreeCallback = (
|
|
36
|
+
const waitForTreeCallback = (_tree, callback, waitMS = exports.UtilConfig.defaultWaitMS) => {
|
|
33
37
|
return new rxjs_1.Observable((subscriber) => {
|
|
34
38
|
(0, rxjs_1.of)(callback())
|
|
35
39
|
.pipe((0, operators_1.delay)(waitMS))
|
|
@@ -106,7 +110,7 @@ function applyRuleIf(minVersion, rule) {
|
|
|
106
110
|
}
|
|
107
111
|
exports.applyRuleIf = applyRuleIf;
|
|
108
112
|
function messageDebugRule(message, options) {
|
|
109
|
-
return (
|
|
113
|
+
return (_tree, _context) => {
|
|
110
114
|
if (options && options.verbose) {
|
|
111
115
|
(0, logging_1.logInfo)(message);
|
|
112
116
|
}
|
|
@@ -114,19 +118,19 @@ function messageDebugRule(message, options) {
|
|
|
114
118
|
}
|
|
115
119
|
exports.messageDebugRule = messageDebugRule;
|
|
116
120
|
function messageInfoRule(message) {
|
|
117
|
-
return (
|
|
121
|
+
return (_tree, _context) => {
|
|
118
122
|
(0, logging_1.logInfoWithDescriptor)(message);
|
|
119
123
|
};
|
|
120
124
|
}
|
|
121
125
|
exports.messageInfoRule = messageInfoRule;
|
|
122
126
|
function messageInfoInternRule(message) {
|
|
123
|
-
return (
|
|
127
|
+
return (_tree, _context) => {
|
|
124
128
|
(0, logging_1.logInfo)(message);
|
|
125
129
|
};
|
|
126
130
|
}
|
|
127
131
|
exports.messageInfoInternRule = messageInfoInternRule;
|
|
128
132
|
function messageSuccessRule(message) {
|
|
129
|
-
return (
|
|
133
|
+
return (_tree, _context) => {
|
|
130
134
|
(0, logging_1.logSuccess)(message);
|
|
131
135
|
};
|
|
132
136
|
}
|
package/src/utility/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;AACA,4DAA0E;AAC1E,+BAAsC;AACtC,8CAAuC;AACvC,iCAAiC;AACjC,iDAA0D;AAC1D,uCAAuE;AAEvE;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,SAAgB,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["util.ts"],"names":[],"mappings":";;;AACA,4DAA0E;AAC1E,+BAAsC;AACtC,8CAAuC;AACvC,iCAAiC;AACjC,iDAA0D;AAC1D,uCAAuE;AAEvE;;;GAGG;AACU,QAAA,UAAU,GAAG;IACxB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,SAAgB,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG,CAAC,OAAO,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC;AAC5D,CAAC;AAFD,oCAEC;AAED,SAAgB,YAAY,CAAC,GAAW,EAAE,IAAY,EAAE,OAAe;IACrE,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC;AAFD,oCAEC;AACD,SAAgB,UAAU,CAAC,GAAW,EAAE,IAAY,EAAE,OAAe;IACnE,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AAC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AC;AAVD,kCAUC;AAED,SAAgB,gBAAgB,CAAC,OAAY,EAAE,OAAY;IACzD,OAAO,CAAC,KAAW,EAAE,QAA0B,EAAE,EAAE;QACjD,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,EAAE;YAC9B,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;SAClB;IACH,CAAC,CAAC;AACJ,CAAC;AAND,4CAMC;AAED,SAAgB,eAAe,CAAC,OAAY;IAC1C,OAAO,CAAC,KAAW,EAAE,QAA0B,EAAE,EAAE;QACjD,IAAA,+BAAqB,EAAC,OAAO,CAAC,CAAC;IACjC,CAAC,CAAC;AACJ,CAAC;AAJD,0CAIC;AAED,SAAgB,qBAAqB,CAAC,OAAY;IAChD,OAAO,CAAC,KAAW,EAAE,QAA0B,EAAE,EAAE;QACjD,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;IACnB,CAAC,CAAC;AACJ,CAAC;AAJD,sDAIC;AAED,SAAgB,kBAAkB,CAAC,OAAY;IAC7C,OAAO,CAAC,KAAW,EAAE,QAA0B,EAAE,EAAE;QACjD,IAAA,oBAAU,EAAC,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;AACJ,CAAC;AAJD,gDAIC;AAED,SAAgB,MAAM,CAAC,aAAsB,EAAE,GAAG,QAAkB;IAClE,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,IAAA,6BAAqB,EAAC,OAAO,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AALD,wBAKC"}
|
package/src/utility/util.ts
CHANGED
|
@@ -14,22 +14,25 @@ export const UtilConfig = {
|
|
|
14
14
|
defaultWaitMS: 4000
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export function escapeRegExp(str) {
|
|
17
|
+
export function escapeRegExp(str: string) {
|
|
18
18
|
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, '\\$1');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function
|
|
22
|
-
return str.replace(new RegExp(escapeRegExp(find), '
|
|
21
|
+
export function replaceFirst(str: string, find: string, replace: string) {
|
|
22
|
+
return str.replace(new RegExp(escapeRegExp(find), 'm'), replace);
|
|
23
|
+
}
|
|
24
|
+
export function replaceAll(str: string, find: string, replace: string) {
|
|
25
|
+
return str.replace(new RegExp(escapeRegExp(find), 'gm'), replace);
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
/**
|
|
26
29
|
* Wartet die übergebene Zeitspanne und ruft dann den Callback auf.
|
|
27
30
|
* Gibt anschließend den Tree über ein Observable zurück.
|
|
28
|
-
* @param
|
|
31
|
+
* @param _tree
|
|
29
32
|
* @param callback
|
|
30
33
|
* @param waitMS
|
|
31
34
|
*/
|
|
32
|
-
export const waitForTreeCallback = (
|
|
35
|
+
export const waitForTreeCallback = (_tree: Tree, callback: Function, waitMS: number = UtilConfig.defaultWaitMS) => {
|
|
33
36
|
return new Observable<Tree>((subscriber) => {
|
|
34
37
|
of(callback())
|
|
35
38
|
.pipe(delay(waitMS))
|
|
@@ -58,7 +61,7 @@ export const waitForTreeCallback = (tree, callback, waitMS: number = UtilConfig.
|
|
|
58
61
|
* @param context
|
|
59
62
|
* @param messages
|
|
60
63
|
*/
|
|
61
|
-
export const runInstallAndLogToDos: (context, messages, runNpmInstall) => void = (context: SchematicContext, messages, runNpmInstall) => {
|
|
64
|
+
export const runInstallAndLogToDos: (context: SchematicContext, messages: string[], runNpmInstall: boolean) => void = (context: SchematicContext, messages, runNpmInstall) => {
|
|
62
65
|
// diese log-Ausgaben werden erst ganz zum Schluss ausgeführt (nach Update und npm-install logs)
|
|
63
66
|
process.addListener('exit', () => {
|
|
64
67
|
if (messages) {
|
|
@@ -109,7 +112,7 @@ export function applyRuleIf(minVersion: string, rule: Rule): Rule {
|
|
|
109
112
|
}
|
|
110
113
|
|
|
111
114
|
export function messageDebugRule(message: any, options: any): Rule {
|
|
112
|
-
return (
|
|
115
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
113
116
|
if (options && options.verbose) {
|
|
114
117
|
logInfo(message);
|
|
115
118
|
}
|
|
@@ -117,19 +120,19 @@ export function messageDebugRule(message: any, options: any): Rule {
|
|
|
117
120
|
}
|
|
118
121
|
|
|
119
122
|
export function messageInfoRule(message: any): Rule {
|
|
120
|
-
return (
|
|
123
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
121
124
|
logInfoWithDescriptor(message);
|
|
122
125
|
};
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
export function messageInfoInternRule(message: any): Rule {
|
|
126
|
-
return (
|
|
129
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
127
130
|
logInfo(message);
|
|
128
131
|
};
|
|
129
132
|
}
|
|
130
133
|
|
|
131
134
|
export function messageSuccessRule(message: any): Rule {
|
|
132
|
-
return (
|
|
135
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
133
136
|
logSuccess(message);
|
|
134
137
|
};
|
|
135
138
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function validateNodeVersion(
|
|
2
|
+
export declare function validateNodeVersion(_context: SchematicContext, minimumVersion: string): void;
|
|
3
3
|
/**
|
|
4
4
|
* Prüft die Angular Version der aufrufenden Applikation und wirft eine SchematicsException, wenn
|
|
5
5
|
* die Version nicht der erforderlichen entspricht.
|
|
6
6
|
* @param tree
|
|
7
|
-
* @param context
|
|
8
7
|
* @param angularVersion
|
|
9
8
|
*/
|
|
10
|
-
export declare function validateAngularVersion(tree: Tree,
|
|
9
|
+
export declare function validateAngularVersion(tree: Tree, angularVersion: string): void;
|
|
11
10
|
export declare function validateLuxComponentsVersion(tree: Tree, versionRange: string): void;
|
|
@@ -5,7 +5,7 @@ const chalk = require("chalk");
|
|
|
5
5
|
const semver = require("semver");
|
|
6
6
|
const dependencies_1 = require("./dependencies");
|
|
7
7
|
const logging_1 = require("./logging");
|
|
8
|
-
function validateNodeVersion(
|
|
8
|
+
function validateNodeVersion(_context, minimumVersion) {
|
|
9
9
|
if (semver.lt(process.versions.node, minimumVersion)) {
|
|
10
10
|
(0, logging_1.logInfo)(`Nodeversion ${process.versions.node} -> ${chalk.redBright('fail')}`);
|
|
11
11
|
throw (0, logging_1.formattedSchematicsException)(`Ihre Node.js Version ist ${process.versions.node}.\n` +
|
|
@@ -19,10 +19,9 @@ exports.validateNodeVersion = validateNodeVersion;
|
|
|
19
19
|
* Prüft die Angular Version der aufrufenden Applikation und wirft eine SchematicsException, wenn
|
|
20
20
|
* die Version nicht der erforderlichen entspricht.
|
|
21
21
|
* @param tree
|
|
22
|
-
* @param context
|
|
23
22
|
* @param angularVersion
|
|
24
23
|
*/
|
|
25
|
-
function validateAngularVersion(tree,
|
|
24
|
+
function validateAngularVersion(tree, angularVersion) {
|
|
26
25
|
const currentVersion = (0, dependencies_1.getPackageJsonDependency)(tree, '@angular/common').version.replace(/([\^~])/g, '');
|
|
27
26
|
if (!semver.satisfies(currentVersion, angularVersion)) {
|
|
28
27
|
(0, logging_1.logInfo)(`Angularversion ${currentVersion} -> ${chalk.redBright('fail')}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAC/B,iCAAiC;AACjC,iDAA0D;AAC1D,uCAAkE;AAElE,SAAgB,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["validation.ts"],"names":[],"mappings":";;;AACA,+BAA+B;AAC/B,iCAAiC;AACjC,iDAA0D;AAC1D,uCAAkE;AAElE,SAAgB,mBAAmB,CAAC,QAA0B,EAAE,cAAsB;IACpF,IAAI,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE;QACpD,IAAA,iBAAO,EAAC,eAA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,EAAE,CAAC,CAAC;QAC1E,MAAM,IAAA,sCAA4B,EAChC,6BAA6B,OAAO,2BAA2B;YAC7D,4CAA4C,YAAY,GAAG,CAC9D,CAAC;KACH;IACD,IAAA,iBAAO,EAAC,yBAAyB,OAAO,QAAQ,CAAC,CAAC;AACpD,CAAC;AAVD,oEAUC"}
|
|
@@ -4,7 +4,7 @@ import * as semver from 'semver';
|
|
|
4
4
|
import { getPackageJsonDependency } from './dependencies';
|
|
5
5
|
import { formattedSchematicsException, logInfo } from './logging';
|
|
6
6
|
|
|
7
|
-
export function validateNodeVersion(
|
|
7
|
+
export function validateNodeVersion(_context: SchematicContext, minimumVersion: string) {
|
|
8
8
|
if (semver.lt(process.versions.node, minimumVersion)) {
|
|
9
9
|
logInfo(`Nodeversion ${process.versions.node} -> ${chalk.redBright('fail')}`);
|
|
10
10
|
throw formattedSchematicsException(
|
|
@@ -20,10 +20,9 @@ export function validateNodeVersion(context: SchematicContext, minimumVersion: s
|
|
|
20
20
|
* Prüft die Angular Version der aufrufenden Applikation und wirft eine SchematicsException, wenn
|
|
21
21
|
* die Version nicht der erforderlichen entspricht.
|
|
22
22
|
* @param tree
|
|
23
|
-
* @param context
|
|
24
23
|
* @param angularVersion
|
|
25
24
|
*/
|
|
26
|
-
export function validateAngularVersion(tree: Tree,
|
|
25
|
+
export function validateAngularVersion(tree: Tree, angularVersion: string) {
|
|
27
26
|
const currentVersion = getPackageJsonDependency(tree, '@angular/common').version.replace(/([\^~])/g, '');
|
|
28
27
|
if (!semver.satisfies(currentVersion, angularVersion)) {
|
|
29
28
|
logInfo(`Angularversion ${currentVersion} -> ${chalk.redBright('fail')}`);
|
package/tsconfig.json
CHANGED
|
@@ -10,21 +10,19 @@
|
|
|
10
10
|
"moduleResolution": "node",
|
|
11
11
|
"noEmitOnError": true,
|
|
12
12
|
"noFallthroughCasesInSwitch": true,
|
|
13
|
-
"noImplicitAny": false,
|
|
14
13
|
"noImplicitThis": true,
|
|
15
|
-
"noUnusedParameters":
|
|
16
|
-
"noUnusedLocals":
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
17
16
|
"rootDir": "src/",
|
|
18
17
|
"skipDefaultLibCheck": true,
|
|
19
18
|
"skipLibCheck": true,
|
|
20
19
|
"sourceMap": true,
|
|
21
|
-
"
|
|
22
|
-
"target": "
|
|
20
|
+
"strict": true,
|
|
21
|
+
"target": "ES2015",
|
|
23
22
|
"types": [
|
|
24
23
|
"jasmine",
|
|
25
24
|
"node"
|
|
26
|
-
]
|
|
27
|
-
"allowUnusedLabels": true
|
|
25
|
+
]
|
|
28
26
|
},
|
|
29
27
|
"include": [
|
|
30
28
|
"src/**/*"
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
-
# For additional information regarding the format and rule options, please see:
|
|
3
|
-
# https://github.com/browserslist/browserslist#queries
|
|
4
|
-
|
|
5
|
-
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
-
# https://angular.io/guide/browser-support
|
|
7
|
-
|
|
8
|
-
# You can see what browsers were selected by your queries by running:
|
|
9
|
-
# npx browserslist
|
|
10
|
-
|
|
11
|
-
last 2 Chrome versions
|
|
12
|
-
last 2 ChromeAndroid versions
|
|
13
|
-
|
|
14
|
-
last 2 Safari versions
|
|
15
|
-
last 2 iOS versions
|
|
16
|
-
|
|
17
|
-
last 2 Firefox versions
|
|
18
|
-
last 2 FirefoxAndroid versions
|
|
19
|
-
|
|
20
|
-
last 2 Edge versions
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
-
# For additional information regarding the format and rule options, please see:
|
|
3
|
-
# https://github.com/browserslist/browserslist#queries
|
|
4
|
-
|
|
5
|
-
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
-
# https://angular.io/guide/browser-support
|
|
7
|
-
|
|
8
|
-
# You can see what browsers were selected by your queries by running:
|
|
9
|
-
# npx browserslist
|
|
10
|
-
|
|
11
|
-
last 2 Chrome versions
|
|
12
|
-
last 2 ChromeAndroid versions
|
|
13
|
-
|
|
14
|
-
last 2 Safari versions
|
|
15
|
-
last 2 iOS versions
|
|
16
|
-
|
|
17
|
-
last 2 Firefox versions
|
|
18
|
-
last 2 FirefoxAndroid versions
|
|
19
|
-
|
|
20
|
-
last 2 Edge versions
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare const updateMajorVersion = "13";
|
|
3
|
-
export declare const updateMinVersion = "11.14.0";
|
|
4
|
-
export declare const updateNodeMinVersion = "16.0.0";
|
|
5
|
-
export declare function update(options: any): Rule;
|
|
6
|
-
export declare function updateProject(options: any): Rule;
|
|
7
|
-
export declare function check(options: any): Rule;
|
|
8
|
-
export declare function deleteWebpackConfig(options: any): Rule;
|
|
9
|
-
export declare function copyFiles(options: any): Rule;
|
|
10
|
-
export declare function updateAngularJson(options: any): Rule;
|
|
11
|
-
export declare function updateTsConfigJson(options: any): Rule;
|
|
12
|
-
export declare function updateIndexHtml(options: any): Rule;
|
|
13
|
-
export declare function updatePackageJson(options: any): Rule;
|
|
14
|
-
export declare function updateBuildThemeAssets(options: any): Rule;
|
|
15
|
-
export declare function updateTestThemeAssets(options: any): Rule;
|
|
16
|
-
export declare function removeThemeAssets(options: any): Rule;
|
|
17
|
-
export declare function removeLuxSelectedFilesAlwaysUseArray(options: any): Rule;
|
|
18
|
-
/**
|
|
19
|
-
* Wenn eine Komponente einen leeren Style im styles-Array (styles: ['']) angegeben hat, führt dies zu dem folgenden Fehler:
|
|
20
|
-
* Error: PostCSS received undefined instead of CSS string
|
|
21
|
-
* Diese Methode repariert diesen Fehler, in dem der Leerstring entfernt wird.
|
|
22
|
-
*
|
|
23
|
-
* @param options
|
|
24
|
-
*/
|
|
25
|
-
export declare function fixEmptyStyles(options: any): Rule;
|
|
26
|
-
export declare function removeDatepickerDefaultLocale(options: any): Rule;
|
|
27
|
-
export declare function fixKarmaConf(options: any): Rule;
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixKarmaConf = exports.removeDatepickerDefaultLocale = exports.fixEmptyStyles = exports.removeLuxSelectedFilesAlwaysUseArray = exports.removeThemeAssets = exports.updateTestThemeAssets = exports.updateBuildThemeAssets = exports.updatePackageJson = exports.updateIndexHtml = exports.updateTsConfigJson = exports.updateAngularJson = exports.copyFiles = exports.deleteWebpackConfig = exports.check = exports.updateProject = exports.update = exports.updateNodeMinVersion = exports.updateMinVersion = exports.updateMajorVersion = void 0;
|
|
4
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
-
const chalk = require("chalk");
|
|
6
|
-
const jsonc_parser_1 = require("jsonc-parser");
|
|
7
|
-
const index_1 = require("../../update-dependencies/index");
|
|
8
|
-
const files_1 = require("../../utility/files");
|
|
9
|
-
const html_1 = require("../../utility/html");
|
|
10
|
-
const json_1 = require("../../utility/json");
|
|
11
|
-
const logging_1 = require("../../utility/logging");
|
|
12
|
-
const util_1 = require("../../utility/util");
|
|
13
|
-
const validation_1 = require("../../utility/validation");
|
|
14
|
-
exports.updateMajorVersion = '13';
|
|
15
|
-
exports.updateMinVersion = '11.14.0';
|
|
16
|
-
exports.updateNodeMinVersion = '16.0.0';
|
|
17
|
-
function update(options) {
|
|
18
|
-
return (tree, _context) => {
|
|
19
|
-
return (0, schematics_1.chain)([
|
|
20
|
-
check(options),
|
|
21
|
-
(0, util_1.applyRuleIf)(exports.updateMinVersion, updateProject(options)),
|
|
22
|
-
(0, util_1.finish)(false, `${chalk.yellowBright('Wichtig!!!')} Hinweise im Update Guide beachten -> https://github.com/IHK-GfI/lux-components/wiki/update-guide-${exports.updateMajorVersion}`)
|
|
23
|
-
]);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.update = update;
|
|
27
|
-
function updateProject(options) {
|
|
28
|
-
return (tree, _context) => {
|
|
29
|
-
return (0, schematics_1.chain)([
|
|
30
|
-
(0, util_1.messageInfoRule)(`LUX-Components ${exports.updateMajorVersion} werden aktualisiert...`),
|
|
31
|
-
updateAngularJson(options),
|
|
32
|
-
updatePackageJson(options),
|
|
33
|
-
updateTsConfigJson(options),
|
|
34
|
-
updateIndexHtml(options),
|
|
35
|
-
removeLuxSelectedFilesAlwaysUseArray(options),
|
|
36
|
-
fixEmptyStyles(options),
|
|
37
|
-
removeDatepickerDefaultLocale(options),
|
|
38
|
-
copyFiles(options),
|
|
39
|
-
fixKarmaConf(options),
|
|
40
|
-
deleteWebpackConfig(options),
|
|
41
|
-
(0, index_1.updateDependencies)(),
|
|
42
|
-
(0, util_1.messageSuccessRule)(`LUX-Components ${exports.updateMajorVersion} wurden aktualisiert.`)
|
|
43
|
-
]);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.updateProject = updateProject;
|
|
47
|
-
function check(options) {
|
|
48
|
-
return (tree, _context) => {
|
|
49
|
-
(0, logging_1.logInfoWithDescriptor)(`Vorbedingungen werden geprüft...`);
|
|
50
|
-
(0, validation_1.validateNodeVersion)(_context, exports.updateNodeMinVersion);
|
|
51
|
-
(0, validation_1.validateLuxComponentsVersion)(tree, `${exports.updateMinVersion} || ^${exports.updateMajorVersion}.0.0`);
|
|
52
|
-
(0, logging_1.logSuccess)(`Vorbedingungen wurden geprüft.`);
|
|
53
|
-
return tree;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
exports.check = check;
|
|
57
|
-
function deleteWebpackConfig(options) {
|
|
58
|
-
return (0, schematics_1.chain)([
|
|
59
|
-
(0, util_1.messageInfoRule)(`Datei 'webpack.config.js' wird gelöscht...`),
|
|
60
|
-
(0, files_1.deleteFile)(options, '/webpack.config.js'),
|
|
61
|
-
(0, util_1.messageSuccessRule)(`Datei 'webpack.config.js' wurde gelöscht.`),
|
|
62
|
-
(0, util_1.messageInfoRule)(`Verweis auf die 'webpack.config.js' wird aus der Datei 'angular.json' gelöscht...`),
|
|
63
|
-
(tree, _context) => {
|
|
64
|
-
(0, json_1.removeJsonNode)(tree, '/angular.json', ['projects', options.project, 'architect', 'build', 'options', 'extraWebpackConfig']);
|
|
65
|
-
},
|
|
66
|
-
(0, util_1.messageSuccessRule)(`Verweis auf die 'webpack.config.js' wurde aus der Datei 'angular.json' gelöscht.`),
|
|
67
|
-
]);
|
|
68
|
-
}
|
|
69
|
-
exports.deleteWebpackConfig = deleteWebpackConfig;
|
|
70
|
-
function copyFiles(options) {
|
|
71
|
-
return (0, schematics_1.chain)([
|
|
72
|
-
(0, util_1.messageInfoRule)(`Dateien werden kopiert...`),
|
|
73
|
-
(0, files_1.moveFilesToDirectory)(options, 'files/root', '/'),
|
|
74
|
-
(0, util_1.messageSuccessRule)(`Dateien wurden kopiert.`)
|
|
75
|
-
]);
|
|
76
|
-
}
|
|
77
|
-
exports.copyFiles = copyFiles;
|
|
78
|
-
function updateAngularJson(options) {
|
|
79
|
-
return (tree, _context) => {
|
|
80
|
-
const jsonPathAllowedCommonJS = ['projects', options.project, 'architect', 'build', 'options', 'allowedCommonJsDependencies'];
|
|
81
|
-
const jsonPathOptimization = ['projects', options.project, 'architect', 'build', 'configurations', 'production', 'optimization'];
|
|
82
|
-
const jsonValueOptimization = {
|
|
83
|
-
'scripts': true,
|
|
84
|
-
'styles': {
|
|
85
|
-
'minify': true,
|
|
86
|
-
'inlineCritical': false
|
|
87
|
-
},
|
|
88
|
-
'fonts': true
|
|
89
|
-
};
|
|
90
|
-
const jsonPathDevelopmentBuild = ['projects', options.project, 'architect', 'build', 'configurations', 'development'];
|
|
91
|
-
const jsonValueDevelopmentBuild = {
|
|
92
|
-
'buildOptimizer': false,
|
|
93
|
-
'optimization': false,
|
|
94
|
-
'vendorChunk': true,
|
|
95
|
-
'extractLicenses': false,
|
|
96
|
-
'sourceMap': true,
|
|
97
|
-
'namedChunks': true
|
|
98
|
-
};
|
|
99
|
-
const jsonPathDevelopmentServe = ['projects', options.project, 'architect', 'serve', 'configurations', 'development'];
|
|
100
|
-
const jsonValueDevelopmentServe = {
|
|
101
|
-
'browserTarget': options.project + ':build:development'
|
|
102
|
-
};
|
|
103
|
-
const jsonPathDevelopmentServeDefault = ['projects', options.project, 'architect', 'serve', 'defaultConfiguration'];
|
|
104
|
-
const findGlobFn = (node) => (0, json_1.findObjectPropertyInArray)(node, 'glob', 'material-design-icons.css');
|
|
105
|
-
const jsonPathGlob = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
|
|
106
|
-
const jsonValueGlob = {
|
|
107
|
-
"glob": "material-design-icons.css*",
|
|
108
|
-
"input": "./node_modules/material-design-icons-iconfont/dist",
|
|
109
|
-
"output": "./assets/icons/material-icons"
|
|
110
|
-
};
|
|
111
|
-
return (0, schematics_1.chain)([
|
|
112
|
-
(0, util_1.messageInfoRule)(`Datei "angular.json" wird aktualisiert...`),
|
|
113
|
-
updateBuildThemeAssets(options),
|
|
114
|
-
updateTestThemeAssets(options),
|
|
115
|
-
removeThemeAssets(options),
|
|
116
|
-
(0, json_1.updateJsonArray)(options, '/angular.json', jsonPathGlob, jsonValueGlob, true, findGlobFn),
|
|
117
|
-
(0, json_1.updateJsonValue)(options, '/angular.json', jsonPathDevelopmentBuild, jsonValueDevelopmentBuild),
|
|
118
|
-
(0, json_1.updateJsonValue)(options, '/angular.json', jsonPathDevelopmentServe, jsonValueDevelopmentServe),
|
|
119
|
-
(0, json_1.updateJsonValue)(options, '/angular.json', jsonPathDevelopmentServeDefault, 'development'),
|
|
120
|
-
(0, json_1.updateJsonArray)(options, '/angular.json', jsonPathAllowedCommonJS, 'hammerjs'),
|
|
121
|
-
(0, json_1.updateJsonArray)(options, '/angular.json', jsonPathAllowedCommonJS, 'ng2-pdf-viewer'),
|
|
122
|
-
(0, json_1.updateJsonArray)(options, '/angular.json', jsonPathAllowedCommonJS, 'pdfjs-dist'),
|
|
123
|
-
(0, json_1.updateJsonValue)(options, '/angular.json', jsonPathOptimization, jsonValueOptimization),
|
|
124
|
-
(0, util_1.messageSuccessRule)(`Datei "angular.json" wurde aktualisiert.`)
|
|
125
|
-
]);
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
exports.updateAngularJson = updateAngularJson;
|
|
129
|
-
function updateTsConfigJson(options) {
|
|
130
|
-
return (tree, _context) => {
|
|
131
|
-
return (0, schematics_1.chain)([
|
|
132
|
-
(0, util_1.messageInfoRule)(`Datei "tsconfig.json" wird aktualisiert...`),
|
|
133
|
-
(0, json_1.updateJsonValue)(options, '/tsconfig.json', ['compilerOptions', 'allowSyntheticDefaultImports'], true),
|
|
134
|
-
(0, util_1.messageSuccessRule)(`Datei "tsconfig.json" wurde aktualisiert.`)
|
|
135
|
-
]);
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
exports.updateTsConfigJson = updateTsConfigJson;
|
|
139
|
-
function updateIndexHtml(options) {
|
|
140
|
-
return (tree, _context) => {
|
|
141
|
-
return (0, schematics_1.chain)([
|
|
142
|
-
(0, util_1.messageInfoRule)(`Datei "index.html" wird aktualisiert...`),
|
|
143
|
-
(tree, _context) => {
|
|
144
|
-
const filePath = '/src/index.html';
|
|
145
|
-
const buffer = tree.read(filePath);
|
|
146
|
-
if (buffer) {
|
|
147
|
-
const content = buffer.toString();
|
|
148
|
-
let modifiedContent = content;
|
|
149
|
-
modifiedContent = (0, util_1.replaceAll)(modifiedContent, 'rel="stylesheet"', 'rel="stylesheet preload" as="style" type="text/css"');
|
|
150
|
-
if (content !== modifiedContent) {
|
|
151
|
-
(0, logging_1.logInfo)(`Den Wert "preload" ergänzt.`);
|
|
152
|
-
tree.overwrite(filePath, modifiedContent);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
(0, util_1.messageSuccessRule)(`Datei "index.html" wurde aktualisiert.`)
|
|
157
|
-
]);
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
exports.updateIndexHtml = updateIndexHtml;
|
|
161
|
-
function updatePackageJson(options) {
|
|
162
|
-
return (tree, _context) => {
|
|
163
|
-
return (0, schematics_1.chain)([
|
|
164
|
-
(0, util_1.messageInfoRule)(`Datei "package.json" wird aktualisiert...`),
|
|
165
|
-
(tree, _context) => {
|
|
166
|
-
const filePath = '/package.json';
|
|
167
|
-
const content = (0, json_1.readJsonAsString)(tree, filePath);
|
|
168
|
-
let modifiedContent = content;
|
|
169
|
-
modifiedContent = modifiedContent.replace(' --ivy', '');
|
|
170
|
-
modifiedContent = modifiedContent.replace(' --plugin @ihk-gfi/lux-components/ie11-lazy-modules-plugin.js', '');
|
|
171
|
-
modifiedContent = modifiedContent.replace(' npm run lint --bailOnLintError true', ' npm run lint');
|
|
172
|
-
modifiedContent = modifiedContent.replace('./node_modules/.bin/compodoc -p tsconfig.json', 'compodoc -p tsconfig.json');
|
|
173
|
-
if (content !== modifiedContent) {
|
|
174
|
-
(0, logging_1.logInfo)(`Das Flag "--ivy" wurde aus dem Script "xi18n" entfernt.`);
|
|
175
|
-
(0, logging_1.logInfo)(`Das Plugin "ie11-lazy-modules-plugin.js" wurde entfernt.`);
|
|
176
|
-
(0, logging_1.logInfo)(`Das lint-Skript wurde angepasst.`);
|
|
177
|
-
(0, logging_1.logInfo)(`Das compodoc-Skript wurde angepasst.`);
|
|
178
|
-
tree.overwrite(filePath, modifiedContent);
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
(tree, _context) => {
|
|
182
|
-
(0, json_1.removeJsonNode)(tree, '/package.json', ['scripts', 'start-ie']);
|
|
183
|
-
},
|
|
184
|
-
(0, util_1.messageSuccessRule)(`Datei "package.json" wurde aktualisiert.`)
|
|
185
|
-
]);
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
exports.updatePackageJson = updatePackageJson;
|
|
189
|
-
function updateBuildThemeAssets(options) {
|
|
190
|
-
return (tree, context) => {
|
|
191
|
-
updateThemeAssetsIntern(tree, ['projects', options.project, 'architect', 'build', 'options', 'assets'], 'build');
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
exports.updateBuildThemeAssets = updateBuildThemeAssets;
|
|
195
|
-
function updateTestThemeAssets(options) {
|
|
196
|
-
return (tree, context) => {
|
|
197
|
-
updateThemeAssetsIntern(tree, ['projects', options.project, 'architect', 'test', 'options', 'assets'], 'test');
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
exports.updateTestThemeAssets = updateTestThemeAssets;
|
|
201
|
-
function updateThemeAssetsIntern(tree, jsonPath, label) {
|
|
202
|
-
const filePath = '/angular.json';
|
|
203
|
-
const contentAsNode = (0, json_1.readJson)(tree, filePath);
|
|
204
|
-
const buildAssetsNode = (0, jsonc_parser_1.findNodeAtLocation)(contentAsNode, jsonPath);
|
|
205
|
-
if (buildAssetsNode) {
|
|
206
|
-
const arrayIndex = (0, json_1.findObjectIndexInArray)(buildAssetsNode, 'glob', '*.css');
|
|
207
|
-
if (arrayIndex >= 0) {
|
|
208
|
-
const angularJson = (0, json_1.readJsonAsString)(tree, filePath);
|
|
209
|
-
const edits = (0, jsonc_parser_1.modify)(angularJson, [...jsonPath, arrayIndex], {
|
|
210
|
-
glob: '*(*min.css|*min.css.map)',
|
|
211
|
-
input: './node_modules/@ihk-gfi/lux-components-theme/prebuilt-themes',
|
|
212
|
-
output: './assets/themes'
|
|
213
|
-
}, { formattingOptions: json_1.jsonFormattingOptions, isArrayInsertion: false });
|
|
214
|
-
if (edits) {
|
|
215
|
-
tree.overwrite(filePath, (0, jsonc_parser_1.applyEdits)(angularJson, edits));
|
|
216
|
-
(0, logging_1.logInfo)(`Den Abschnitt "${JSON.stringify(jsonPath)}" aktualisiert.`);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
function removeThemeAssets(options) {
|
|
222
|
-
return (tree, context) => {
|
|
223
|
-
const filePath = '/angular.json';
|
|
224
|
-
const jsonPath = ['projects', options.project, 'architect', 'build', 'configurations', 'es5'];
|
|
225
|
-
(0, json_1.removeJsonNode)(tree, filePath, jsonPath);
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
exports.removeThemeAssets = removeThemeAssets;
|
|
229
|
-
function removeLuxSelectedFilesAlwaysUseArray(options) {
|
|
230
|
-
return (0, schematics_1.chain)([
|
|
231
|
-
(0, util_1.messageInfoRule)(`Das Attribut "luxSelectedFilesAlwaysUseArray" wird entfernt...`),
|
|
232
|
-
(tree, context) => {
|
|
233
|
-
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
234
|
-
let result = (0, html_1.removeAttribute)(content, 'lux-file-list', 'luxSelectedFilesAlwaysUseArray');
|
|
235
|
-
if (content !== result.content) {
|
|
236
|
-
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
237
|
-
tree.overwrite(filePath, result.content);
|
|
238
|
-
}
|
|
239
|
-
}, '.component.html');
|
|
240
|
-
},
|
|
241
|
-
(0, util_1.messageSuccessRule)(`Das Attribut "luxSelectedFilesAlwaysUseArray" wird entfernt.`)
|
|
242
|
-
]);
|
|
243
|
-
}
|
|
244
|
-
exports.removeLuxSelectedFilesAlwaysUseArray = removeLuxSelectedFilesAlwaysUseArray;
|
|
245
|
-
/**
|
|
246
|
-
* Wenn eine Komponente einen leeren Style im styles-Array (styles: ['']) angegeben hat, führt dies zu dem folgenden Fehler:
|
|
247
|
-
* Error: PostCSS received undefined instead of CSS string
|
|
248
|
-
* Diese Methode repariert diesen Fehler, in dem der Leerstring entfernt wird.
|
|
249
|
-
*
|
|
250
|
-
* @param options
|
|
251
|
-
*/
|
|
252
|
-
function fixEmptyStyles(options) {
|
|
253
|
-
return (0, schematics_1.chain)([
|
|
254
|
-
(0, util_1.messageInfoRule)(`Die leeren Styles im @Component-Teil (styles: [''] => styles: []) werden korrigiert...`),
|
|
255
|
-
(tree, context) => {
|
|
256
|
-
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
257
|
-
const modifiedContent = content.replace(/styles\s?:\s*\[('{2}|"{2})\]/g, 'styles: []');
|
|
258
|
-
if (modifiedContent !== content) {
|
|
259
|
-
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
260
|
-
tree.overwrite(filePath, modifiedContent);
|
|
261
|
-
}
|
|
262
|
-
}, '.component.ts');
|
|
263
|
-
},
|
|
264
|
-
(0, util_1.messageSuccessRule)(`Die leeren Styles wurden korrigiert.`)
|
|
265
|
-
]);
|
|
266
|
-
}
|
|
267
|
-
exports.fixEmptyStyles = fixEmptyStyles;
|
|
268
|
-
function removeDatepickerDefaultLocale(options) {
|
|
269
|
-
return (0, schematics_1.chain)([
|
|
270
|
-
(0, util_1.messageInfoRule)(`Die explizit gesetzte Defaultlocale "de-DE" wird bei allen Datepickern entfernt...`),
|
|
271
|
-
(tree, context) => {
|
|
272
|
-
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
273
|
-
const modifiedContent = content.replace(/\sluxLocale="de-DE"/g, '');
|
|
274
|
-
if (modifiedContent !== content) {
|
|
275
|
-
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
276
|
-
tree.overwrite(filePath, modifiedContent);
|
|
277
|
-
}
|
|
278
|
-
}, '.component.html');
|
|
279
|
-
},
|
|
280
|
-
(0, util_1.messageSuccessRule)(`Die explizit gesetzte Defaultlocale "de-DE" wurde bei allen Datepickern entfernt.`)
|
|
281
|
-
]);
|
|
282
|
-
}
|
|
283
|
-
exports.removeDatepickerDefaultLocale = removeDatepickerDefaultLocale;
|
|
284
|
-
function fixKarmaConf(options) {
|
|
285
|
-
return (0, schematics_1.chain)([
|
|
286
|
-
(0, util_1.messageInfoRule)(`Datei "karma.conf.js" wird aktualisiert...`),
|
|
287
|
-
(tree, context) => {
|
|
288
|
-
(0, files_1.iterateFilesAndModifyContent)(tree, options.path, (filePath, content) => {
|
|
289
|
-
let modifiedContent = content.replace(/require\('karma-coverage-istanbul-reporter'\),/g, 'require(\'karma-coverage\'),');
|
|
290
|
-
modifiedContent = modifiedContent.replace(/coverageIstanbulReporter\:.*\{([\s\S])*\},/gim, karmaCoverageReporter);
|
|
291
|
-
modifiedContent = modifiedContent.replace(/reporters\:(.*)],/gim, karmaReporters);
|
|
292
|
-
if (modifiedContent !== content) {
|
|
293
|
-
(0, logging_1.logInfo)(filePath + ' wurde angepasst.');
|
|
294
|
-
tree.overwrite(filePath, modifiedContent);
|
|
295
|
-
}
|
|
296
|
-
}, 'karma.conf.js');
|
|
297
|
-
},
|
|
298
|
-
(0, util_1.messageSuccessRule)(`Datei "karma.conf.js" wurde aktualisiert.`)
|
|
299
|
-
]);
|
|
300
|
-
}
|
|
301
|
-
exports.fixKarmaConf = fixKarmaConf;
|
|
302
|
-
const karmaCoverageReporter = `coverageReporter: {
|
|
303
|
-
dir: require('path').join(__dirname, 'coverage'),
|
|
304
|
-
reporters: [
|
|
305
|
-
{type: 'html', subdir: '.'},
|
|
306
|
-
{type: 'lcovonly', subdir: '.'}
|
|
307
|
-
]
|
|
308
|
-
},`;
|
|
309
|
-
const karmaReporters = `reporters: ['progress', 'coverage'],`;
|
|
310
|
-
//# sourceMappingURL=index.js.map
|