@ihk-gfi/lux-components-update 11.3.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/LICENSE +198 -0
- package/README.md +55 -0
- package/package.json +54 -0
- package/src/add-lux-components/files/app/app-routing.module.ts +19 -0
- package/src/add-lux-components/files/app/app.component.html +27 -0
- package/src/add-lux-components/files/app/app.component.spec.ts +19 -0
- package/src/add-lux-components/files/app/app.component.ts +13 -0
- package/src/add-lux-components/files/app/app.module.ts +56 -0
- package/src/add-lux-components/files/app/error/error.component.html +10 -0
- package/src/add-lux-components/files/app/error/error.component.scss +3 -0
- package/src/add-lux-components/files/app/error/error.component.spec.ts +49 -0
- package/src/add-lux-components/files/app/error/error.component.ts +17 -0
- package/src/add-lux-components/files/app/home/home.component.html +7 -0
- package/src/add-lux-components/files/app/home/home.component.scss +0 -0
- package/src/add-lux-components/files/app/home/home.component.ts +13 -0
- package/src/add-lux-components/files/app/profil/profil.component.html +1 -0
- package/src/add-lux-components/files/app/profil/profil.component.scss +0 -0
- package/src/add-lux-components/files/app/profil/profil.component.spec.ts +24 -0
- package/src/add-lux-components/files/app/profil/profil.component.ts +11 -0
- package/src/add-lux-components/files/environments/environment.prod.ts +4 -0
- package/src/add-lux-components/files/environments/environment.ts +17 -0
- package/src/add-lux-components/files/locale/messages.en.xlf +948 -0
- package/src/add-lux-components/files/locale/messages.xlf +822 -0
- package/src/add-lux-components/files/scripts/.browserslistrc +17 -0
- package/src/add-lux-components/files/src/polyfills.ts +68 -0
- package/src/add-lux-components/index.d.ts +10 -0
- package/src/add-lux-components/index.js +143 -0
- package/src/add-lux-components/index.js.map +1 -0
- package/src/add-lux-components/index.ts +183 -0
- package/src/add-lux-components/index_spec.d.ts +1 -0
- package/src/add-lux-components/index_spec.js +51 -0
- package/src/add-lux-components/index_spec.js.map +1 -0
- package/src/add-lux-components/index_spec.ts +55 -0
- package/src/add-lux-components/schema.json +23 -0
- package/src/collection.json +55 -0
- package/src/migrate-to-eslint/files/.eslintrc.json +68 -0
- package/src/migrate-to-eslint/files/.prettierrc +25 -0
- package/src/migrate-to-eslint/index.d.ts +6 -0
- package/src/migrate-to-eslint/index.js +149 -0
- package/src/migrate-to-eslint/index.js.map +1 -0
- package/src/migrate-to-eslint/index.ts +181 -0
- package/src/migrate-to-eslint/index_spec.d.ts +1 -0
- package/src/migrate-to-eslint/index_spec.js +129 -0
- package/src/migrate-to-eslint/index_spec.js.map +1 -0
- package/src/migrate-to-eslint/index_spec.ts +152 -0
- package/src/migrate-to-eslint/schema.json +23 -0
- package/src/migrate-to-webcomponent/index.d.ts +10 -0
- package/src/migrate-to-webcomponent/index.js +278 -0
- package/src/migrate-to-webcomponent/index.js.map +1 -0
- package/src/migrate-to-webcomponent/index.ts +331 -0
- package/src/migrate-to-webcomponent/index_spec.d.ts +1 -0
- package/src/migrate-to-webcomponent/index_spec.js +580 -0
- package/src/migrate-to-webcomponent/index_spec.js.map +1 -0
- package/src/migrate-to-webcomponent/index_spec.ts +703 -0
- package/src/migrate-to-webcomponent/schema.json +23 -0
- package/src/update/files/locale/messages.en.xlf +940 -0
- package/src/update/files/locale/messages.xlf +815 -0
- package/src/update/files/scripts/move-de-files.js +15 -0
- package/src/update/index.d.ts +23 -0
- package/src/update/index.js +635 -0
- package/src/update/index.js.map +1 -0
- package/src/update/index.ts +712 -0
- package/src/update/index_spec.d.ts +1 -0
- package/src/update/index_spec.js +990 -0
- package/src/update/index_spec.js.map +1 -0
- package/src/update/index_spec.ts +1145 -0
- package/src/update/schema.json +23 -0
- package/src/update-dependencies/index.d.ts +5 -0
- package/src/update-dependencies/index.js +113 -0
- package/src/update-dependencies/index.js.map +1 -0
- package/src/update-dependencies/index.ts +114 -0
- package/src/update-dependencies/schema.json +23 -0
- package/src/update110001/index.d.ts +2 -0
- package/src/update110001/index.js +42 -0
- package/src/update110001/index.js.map +1 -0
- package/src/update110001/index.ts +40 -0
- package/src/update110001/index_spec.d.ts +1 -0
- package/src/update110001/index_spec.js +67 -0
- package/src/update110001/index_spec.js.map +1 -0
- package/src/update110001/index_spec.ts +72 -0
- package/src/update110001/schema.json +23 -0
- package/src/update110100/index.d.ts +2 -0
- package/src/update110100/index.js +27 -0
- package/src/update110100/index.js.map +1 -0
- package/src/update110100/index.ts +24 -0
- package/src/update110100/index_spec.d.ts +1 -0
- package/src/update110100/index_spec.js +69 -0
- package/src/update110100/index_spec.js.map +1 -0
- package/src/update110100/index_spec.ts +73 -0
- package/src/update110100/schema.json +23 -0
- package/src/update110101/index.d.ts +2 -0
- package/src/update110101/index.js +24 -0
- package/src/update110101/index.js.map +1 -0
- package/src/update110101/index.ts +21 -0
- package/src/update110101/index_spec.d.ts +1 -0
- package/src/update110101/index_spec.js +65 -0
- package/src/update110101/index_spec.js.map +1 -0
- package/src/update110101/index_spec.ts +69 -0
- package/src/update110101/schema.json +23 -0
- package/src/update110200/index.d.ts +2 -0
- package/src/update110200/index.js +24 -0
- package/src/update110200/index.js.map +1 -0
- package/src/update110200/index.ts +21 -0
- package/src/update110200/index_spec.d.ts +1 -0
- package/src/update110200/index_spec.js +65 -0
- package/src/update110200/index_spec.js.map +1 -0
- package/src/update110200/index_spec.ts +69 -0
- package/src/update110200/schema.json +23 -0
- package/src/update110300/index.d.ts +2 -0
- package/src/update110300/index.js +133 -0
- package/src/update110300/index.js.map +1 -0
- package/src/update110300/index.ts +148 -0
- package/src/update110300/index_spec.d.ts +1 -0
- package/src/update110300/index_spec.js +121 -0
- package/src/update110300/index_spec.js.map +1 -0
- package/src/update110300/index_spec.ts +139 -0
- package/src/update110300/schema.json +23 -0
- package/src/utility/dependencies.d.ts +39 -0
- package/src/utility/dependencies.js +96 -0
- package/src/utility/dependencies.js.map +1 -0
- package/src/utility/dependencies.ts +116 -0
- package/src/utility/files.d.ts +60 -0
- package/src/utility/files.js +299 -0
- package/src/utility/files.js.map +1 -0
- package/src/utility/files.ts +355 -0
- package/src/utility/html.d.ts +49 -0
- package/src/utility/html.js +183 -0
- package/src/utility/html.js.map +1 -0
- package/src/utility/html.ts +212 -0
- package/src/utility/json.d.ts +34 -0
- package/src/utility/json.js +70 -0
- package/src/utility/json.js.map +1 -0
- package/src/utility/json.ts +70 -0
- package/src/utility/logging.d.ts +32 -0
- package/src/utility/logging.js +82 -0
- package/src/utility/logging.js.map +1 -0
- package/src/utility/logging.ts +80 -0
- package/src/utility/test.d.ts +10 -0
- package/src/utility/test.js +24 -0
- package/src/utility/test.js.map +1 -0
- package/src/utility/test.ts +24 -0
- package/src/utility/typescript.d.ts +22 -0
- package/src/utility/typescript.js +521 -0
- package/src/utility/typescript.js.map +1 -0
- package/src/utility/typescript.ts +598 -0
- package/src/utility/typescript_spec.d.ts +1 -0
- package/src/utility/typescript_spec.js +1006 -0
- package/src/utility/typescript_spec.js.map +1 -0
- package/src/utility/typescript_spec.ts +1267 -0
- package/src/utility/util.d.ts +33 -0
- package/src/utility/util.js +139 -0
- package/src/utility/util.js.map +1 -0
- package/src/utility/util.ts +140 -0
- package/src/utility/validation.d.ts +11 -0
- package/src/utility/validation.js +44 -0
- package/src/utility/validation.js.map +1 -0
- package/src/utility/validation.ts +49 -0
- package/tsconfig.json +37 -0
|
@@ -0,0 +1,17 @@
|
|
|
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 1 Chrome version
|
|
12
|
+
last 1 Firefox version
|
|
13
|
+
last 2 Edge major versions
|
|
14
|
+
last 2 Safari major versions
|
|
15
|
+
last 2 iOS major versions
|
|
16
|
+
Firefox ESR
|
|
17
|
+
IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/***************************************************************************************************
|
|
2
|
+
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
|
|
3
|
+
*/
|
|
4
|
+
import '@angular/localize/init';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This file includes polyfills needed by Angular and is loaded before the app.
|
|
8
|
+
* You can add your own extra polyfills to this file.
|
|
9
|
+
*
|
|
10
|
+
* This file is divided into 2 sections:
|
|
11
|
+
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
|
|
12
|
+
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
|
|
13
|
+
* file.
|
|
14
|
+
*
|
|
15
|
+
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
|
|
16
|
+
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
|
|
17
|
+
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
|
|
18
|
+
*
|
|
19
|
+
* Learn more in https://angular.io/guide/browser-support
|
|
20
|
+
*/
|
|
21
|
+
/***************************************************************************************************
|
|
22
|
+
* BROWSER POLYFILLS
|
|
23
|
+
*/
|
|
24
|
+
import 'core-js/es/array';
|
|
25
|
+
import 'core-js/es/date';
|
|
26
|
+
import 'core-js/es/function';
|
|
27
|
+
import 'core-js/es/map';
|
|
28
|
+
import 'core-js/es/math';
|
|
29
|
+
import 'core-js/es/number';
|
|
30
|
+
import 'core-js/es/object';
|
|
31
|
+
import 'core-js/es/parse-float';
|
|
32
|
+
import 'core-js/es/parse-int';
|
|
33
|
+
import 'core-js/es/reflect';
|
|
34
|
+
/** Evergreen browsers require these. */
|
|
35
|
+
import 'core-js/es/regexp';
|
|
36
|
+
import 'core-js/es/set';
|
|
37
|
+
import 'core-js/es/string';
|
|
38
|
+
/** IE9, IE10 and IE11 requires all of the following polyfills. */
|
|
39
|
+
import 'core-js/es/symbol';
|
|
40
|
+
import 'core-js/es/weak-map';
|
|
41
|
+
import 'core-js/es/weak-set';
|
|
42
|
+
/***************************************************************************************************
|
|
43
|
+
* Zone JS is required by Angular itself.
|
|
44
|
+
*/
|
|
45
|
+
import 'zone.js/dist/zone'; // Included with Angular CLI.
|
|
46
|
+
|
|
47
|
+
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
|
48
|
+
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Required to support Web Animations `@angular/animation`.
|
|
52
|
+
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
|
|
53
|
+
*/
|
|
54
|
+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
|
55
|
+
|
|
56
|
+
/***************************************************************************************************
|
|
57
|
+
* APPLICATION IMPORTS
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Date, currency, decimal and percent pipes.
|
|
62
|
+
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
|
|
63
|
+
*/
|
|
64
|
+
// import 'intl'; // Run `npm install --save intl`.
|
|
65
|
+
/**
|
|
66
|
+
* Need to import at least one locale-data with intl.
|
|
67
|
+
*/
|
|
68
|
+
// import 'intl/locale-data/jsonp/en';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function addLuxComponents(options: any): Rule;
|
|
3
|
+
/**
|
|
4
|
+
* Prüft ob die Versionen des Projekts mit den erforderlichen Versionen dieses Updates übereinstimmen.
|
|
5
|
+
*/
|
|
6
|
+
export declare function check(): Rule;
|
|
7
|
+
export declare function updatePackageJson(options: any): Rule;
|
|
8
|
+
export declare function updateIndexHtml(options: any): Rule;
|
|
9
|
+
export declare function copyAppFiles(options: any): Rule;
|
|
10
|
+
export declare function updateApp(options: any): Rule;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateApp = exports.copyAppFiles = exports.updateIndexHtml = exports.updatePackageJson = exports.check = exports.addLuxComponents = 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 index_2 = require("../update/index");
|
|
9
|
+
const index_3 = require("../update110001/index");
|
|
10
|
+
const index_4 = require("../update110100/index");
|
|
11
|
+
const index_5 = require("../update110101/index");
|
|
12
|
+
const index_6 = require("../update110200/index");
|
|
13
|
+
const index_7 = require("../update110300/index");
|
|
14
|
+
const files_1 = require("../utility/files");
|
|
15
|
+
const json_1 = require("../utility/json");
|
|
16
|
+
const logging_1 = require("../utility/logging");
|
|
17
|
+
const util_1 = require("../utility/util");
|
|
18
|
+
const validation_1 = require("../utility/validation");
|
|
19
|
+
function addLuxComponents(options) {
|
|
20
|
+
return (tree, _context) => {
|
|
21
|
+
return schematics_1.chain([
|
|
22
|
+
check(),
|
|
23
|
+
copyAppFiles(options),
|
|
24
|
+
updatePackageJson(options),
|
|
25
|
+
index_1.updateDependencies(),
|
|
26
|
+
index_2.addThemeAssets(options),
|
|
27
|
+
index_2.updateAppComponent(options),
|
|
28
|
+
updateIndexHtml(options),
|
|
29
|
+
index_2.i18nUpdatePackageJson(options),
|
|
30
|
+
index_2.i18nUpdateAngularJson(options),
|
|
31
|
+
index_2.i18nCopyMessages(options),
|
|
32
|
+
updateApp(options),
|
|
33
|
+
index_3.update110001(options),
|
|
34
|
+
index_4.update110100(options),
|
|
35
|
+
index_5.update110101(options),
|
|
36
|
+
index_6.update110200(options),
|
|
37
|
+
index_7.update110300(options),
|
|
38
|
+
util_1.finish(`Die LUX-Components ${index_2.updateMajorVersion} wurden erfolgreich eingerichtet.`, `${chalk.yellowBright('Fertig!')}`)
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.addLuxComponents = addLuxComponents;
|
|
43
|
+
/**
|
|
44
|
+
* Prüft ob die Versionen des Projekts mit den erforderlichen Versionen dieses Updates übereinstimmen.
|
|
45
|
+
*/
|
|
46
|
+
function check() {
|
|
47
|
+
return (tree, context) => {
|
|
48
|
+
return util_1.waitForTreeCallback(tree, () => {
|
|
49
|
+
validation_1.validateAngularVersion(tree, context, `^${+index_2.updateMajorVersion}.0.0`);
|
|
50
|
+
validation_1.validateNodeVersion(context, index_2.updateNodeMinVersion);
|
|
51
|
+
return tree;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
exports.check = check;
|
|
56
|
+
function updatePackageJson(options) {
|
|
57
|
+
return schematics_1.chain([
|
|
58
|
+
util_1.messageInfoRule(`package.json wird aktualisiert...`),
|
|
59
|
+
(tree, context) => {
|
|
60
|
+
const filePath = `/package.json`;
|
|
61
|
+
const newValuesArr = [
|
|
62
|
+
{ path: ['scripts', 'test_single_run'], value: 'ng test --watch=false --browsers=ChromeHeadless', message: `Skript "test_single_run" hinzugefügt.` },
|
|
63
|
+
{ path: ['scripts', 'smoketest'], value: 'npm run test_single_run && npm run build && npm run lint --bailOnLintError true', message: `Skript "smoketest" hinzugefügt.` }
|
|
64
|
+
];
|
|
65
|
+
newValuesArr.forEach(change => {
|
|
66
|
+
const tsConfigJson = json_1.readJsonAsString(tree, filePath);
|
|
67
|
+
const edits = jsonc_parser_1.modify(tsConfigJson, change.path, change.value, { formattingOptions: json_1.jsonFormattingOptions });
|
|
68
|
+
tree.overwrite(filePath, jsonc_parser_1.applyEdits(tsConfigJson, edits));
|
|
69
|
+
logging_1.logInfo(change.message);
|
|
70
|
+
});
|
|
71
|
+
return tree;
|
|
72
|
+
},
|
|
73
|
+
util_1.messageSuccessRule(`package.json wurde aktualisiert.`)
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
exports.updatePackageJson = updatePackageJson;
|
|
77
|
+
function updateIndexHtml(options) {
|
|
78
|
+
return schematics_1.chain([
|
|
79
|
+
util_1.messageInfoRule(`index.html wird aktualisiert...`),
|
|
80
|
+
(tree, context) => {
|
|
81
|
+
files_1.iterateFilesAndModifyContent(tree, options.path, (filePath, content) => {
|
|
82
|
+
let modifiedContent = util_1.replaceAll(content, '<body>', '<body style="margin: 0">');
|
|
83
|
+
if (content !== modifiedContent) {
|
|
84
|
+
tree.overwrite(filePath, modifiedContent);
|
|
85
|
+
}
|
|
86
|
+
}, 'index.html');
|
|
87
|
+
},
|
|
88
|
+
util_1.messageSuccessRule(`index.html wurde aktualisiert.`)
|
|
89
|
+
]);
|
|
90
|
+
}
|
|
91
|
+
exports.updateIndexHtml = updateIndexHtml;
|
|
92
|
+
function copyAppFiles(options) {
|
|
93
|
+
return schematics_1.chain([
|
|
94
|
+
util_1.messageInfoRule(`App-Dateien werden angelegt...`),
|
|
95
|
+
files_1.moveFilesToDirectory(options, 'files/app', 'src/app'),
|
|
96
|
+
files_1.moveFilesToDirectory(options, 'files/environments', 'src/environments'),
|
|
97
|
+
files_1.moveFilesToDirectory(options, 'files/scripts', '/'),
|
|
98
|
+
files_1.moveFilesToDirectory(options, 'files/src', '/src'),
|
|
99
|
+
util_1.messageSuccessRule(`App-Dateien wurden angelegt.`)
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
exports.copyAppFiles = copyAppFiles;
|
|
103
|
+
function updateApp(options) {
|
|
104
|
+
return schematics_1.chain([
|
|
105
|
+
util_1.messageInfoRule(`App-Dateien wird angepasst...`),
|
|
106
|
+
(tree, context) => {
|
|
107
|
+
const filePath = `/package.json`;
|
|
108
|
+
const newValuesArr = [
|
|
109
|
+
{ path: ['scripts', 'move-de-files'], value: 'node move-de-files.js', message: `Skript "move-de-files" hinzugefügt.` },
|
|
110
|
+
{ path: ['scripts', 'build'], value: 'ng build --aot --localize && npm run move-de-files', message: `Skript "build" angepasst.` },
|
|
111
|
+
{ path: ['scripts', 'build-aot'], value: undefined, message: `` },
|
|
112
|
+
{ path: ['scripts', 'buildzentral'], value: undefined, message: `` },
|
|
113
|
+
{ path: ['devDependencies', 'fs-extra'], value: '^10.0.0', message: `devDependencies "fs-extra" hinzugefügt.` },
|
|
114
|
+
{ path: ['devDependencies', 'del'], value: '^6.0.0', message: `devDependencies "del" hinzugefügt.` }
|
|
115
|
+
];
|
|
116
|
+
newValuesArr.forEach(change => {
|
|
117
|
+
const tsConfigJson = json_1.readJsonAsString(tree, filePath);
|
|
118
|
+
const edits = jsonc_parser_1.modify(tsConfigJson, change.path, change.value, { formattingOptions: json_1.jsonFormattingOptions });
|
|
119
|
+
tree.overwrite(filePath, jsonc_parser_1.applyEdits(tsConfigJson, edits));
|
|
120
|
+
logging_1.logInfo(change.message);
|
|
121
|
+
});
|
|
122
|
+
json_1.readJson(tree, filePath);
|
|
123
|
+
return tree;
|
|
124
|
+
},
|
|
125
|
+
(tree, context) => {
|
|
126
|
+
const filePath = `/angular.json`;
|
|
127
|
+
const newValuesArr = [
|
|
128
|
+
{ path: ['projects', options.project, 'architect', 'build', 'options', 'outputPath'], value: 'dist', message: `Property "outputPath" auf "dist" gesetzt.` },
|
|
129
|
+
];
|
|
130
|
+
newValuesArr.forEach(change => {
|
|
131
|
+
const tsConfigJson = json_1.readJsonAsString(tree, filePath);
|
|
132
|
+
const edits = jsonc_parser_1.modify(tsConfigJson, change.path, change.value, { formattingOptions: json_1.jsonFormattingOptions });
|
|
133
|
+
tree.overwrite(filePath, jsonc_parser_1.applyEdits(tsConfigJson, edits));
|
|
134
|
+
logging_1.logInfo(change.message);
|
|
135
|
+
});
|
|
136
|
+
json_1.readJson(tree, filePath);
|
|
137
|
+
return tree;
|
|
138
|
+
},
|
|
139
|
+
util_1.messageSuccessRule(`App wurde angepasst.`)
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
exports.updateApp = updateApp;
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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AAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,2CAA2C,EAAC;aAC3J,CAAC;YAEF,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;gBAC5B,MAAM,YAAY,GAAG,uBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACtD,MAAM,KAAK,GAAW,qBAAM,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,iBAAiB,EAAE,4BAAqB,EAAE,CAAC,CAAA;gBAEnH,IAAI,CAAC,SAAS,CACZ,QAAQ,EACR,yBAAU,CAAC,YAAY,EAAE,KAAK,CAAC,CAChC,CAAC;gBAEF,iBAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;YAEH,eAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAEzB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,yBAAkB,CAAC,sBAAsB,CAAC;KAC3C,CAAC,CAAC;AACL,CAAC;AAxDD,8BAwDC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { applyEdits, Edit, modify } from 'jsonc-parser';
|
|
4
|
+
import { updateDependencies } from '../update-dependencies/index';
|
|
5
|
+
import {
|
|
6
|
+
addThemeAssets,
|
|
7
|
+
i18nCopyMessages,
|
|
8
|
+
i18nUpdateAngularJson,
|
|
9
|
+
i18nUpdatePackageJson,
|
|
10
|
+
updateAppComponent,
|
|
11
|
+
updateMajorVersion,
|
|
12
|
+
updateNodeMinVersion
|
|
13
|
+
} from '../update/index';
|
|
14
|
+
import { update110001 } from '../update110001/index';
|
|
15
|
+
import { update110100 } from '../update110100/index';
|
|
16
|
+
import { update110101 } from '../update110101/index';
|
|
17
|
+
import { update110200 } from '../update110200/index';
|
|
18
|
+
import { update110300 } from '../update110300/index';
|
|
19
|
+
import { iterateFilesAndModifyContent, moveFilesToDirectory } from '../utility/files';
|
|
20
|
+
import { jsonFormattingOptions, readJson, readJsonAsString } from '../utility/json';
|
|
21
|
+
import { logInfo } from '../utility/logging';
|
|
22
|
+
import { finish, messageInfoRule, messageSuccessRule, replaceAll, waitForTreeCallback } from '../utility/util';
|
|
23
|
+
import { validateAngularVersion, validateNodeVersion } from '../utility/validation';
|
|
24
|
+
|
|
25
|
+
export function addLuxComponents(options: any): Rule {
|
|
26
|
+
return (tree: Tree, _context: SchematicContext) => {
|
|
27
|
+
return chain([
|
|
28
|
+
check(),
|
|
29
|
+
copyAppFiles(options),
|
|
30
|
+
updatePackageJson(options),
|
|
31
|
+
updateDependencies(),
|
|
32
|
+
addThemeAssets(options),
|
|
33
|
+
updateAppComponent(options),
|
|
34
|
+
updateIndexHtml(options),
|
|
35
|
+
i18nUpdatePackageJson(options),
|
|
36
|
+
i18nUpdateAngularJson(options),
|
|
37
|
+
i18nCopyMessages(options),
|
|
38
|
+
updateApp(options),
|
|
39
|
+
update110001(options),
|
|
40
|
+
update110100(options),
|
|
41
|
+
update110101(options),
|
|
42
|
+
update110200(options),
|
|
43
|
+
update110300(options),
|
|
44
|
+
finish(
|
|
45
|
+
`Die LUX-Components ${updateMajorVersion} wurden erfolgreich eingerichtet.`,
|
|
46
|
+
`${chalk.yellowBright('Fertig!')}`
|
|
47
|
+
)
|
|
48
|
+
]);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Prüft ob die Versionen des Projekts mit den erforderlichen Versionen dieses Updates übereinstimmen.
|
|
54
|
+
*/
|
|
55
|
+
export function check(): Rule {
|
|
56
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
57
|
+
return waitForTreeCallback(tree, () => {
|
|
58
|
+
validateAngularVersion(tree, context, `^${+updateMajorVersion}.0.0`);
|
|
59
|
+
validateNodeVersion(context, updateNodeMinVersion);
|
|
60
|
+
|
|
61
|
+
return tree;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function updatePackageJson(options: any): Rule {
|
|
67
|
+
return chain([
|
|
68
|
+
messageInfoRule(`package.json wird aktualisiert...`),
|
|
69
|
+
(tree: Tree, context: SchematicContext) => {
|
|
70
|
+
const filePath = `/package.json`;
|
|
71
|
+
|
|
72
|
+
const newValuesArr = [
|
|
73
|
+
{ path: ['scripts', 'test_single_run'], value: 'ng test --watch=false --browsers=ChromeHeadless', message: `Skript "test_single_run" hinzugefügt.`},
|
|
74
|
+
{ path: ['scripts', 'smoketest'], value: 'npm run test_single_run && npm run build && npm run lint --bailOnLintError true', message: `Skript "smoketest" hinzugefügt.`}
|
|
75
|
+
];
|
|
76
|
+
|
|
77
|
+
newValuesArr.forEach(change => {
|
|
78
|
+
const tsConfigJson = readJsonAsString(tree, filePath);
|
|
79
|
+
const edits: Edit[] = modify(tsConfigJson, change.path, change.value, { formattingOptions: jsonFormattingOptions })
|
|
80
|
+
|
|
81
|
+
tree.overwrite(
|
|
82
|
+
filePath,
|
|
83
|
+
applyEdits(tsConfigJson, edits)
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
logInfo(change.message);
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
return tree;
|
|
90
|
+
},
|
|
91
|
+
messageSuccessRule(`package.json wurde aktualisiert.`)
|
|
92
|
+
]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function updateIndexHtml(options: any): Rule {
|
|
96
|
+
return chain([
|
|
97
|
+
messageInfoRule(`index.html wird aktualisiert...`),
|
|
98
|
+
(tree: Tree, context: SchematicContext) => {
|
|
99
|
+
iterateFilesAndModifyContent(
|
|
100
|
+
tree,
|
|
101
|
+
options.path,
|
|
102
|
+
(filePath: string, content: string) => {
|
|
103
|
+
let modifiedContent = replaceAll(content, '<body>', '<body style="margin: 0">');
|
|
104
|
+
|
|
105
|
+
if (content !== modifiedContent) {
|
|
106
|
+
tree.overwrite(filePath, modifiedContent);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
'index.html'
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
messageSuccessRule(`index.html wurde aktualisiert.`)
|
|
113
|
+
]);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function copyAppFiles(options: any): Rule {
|
|
117
|
+
return chain([
|
|
118
|
+
messageInfoRule(`App-Dateien werden angelegt...`),
|
|
119
|
+
moveFilesToDirectory(options, 'files/app', 'src/app'),
|
|
120
|
+
moveFilesToDirectory(options, 'files/environments', 'src/environments'),
|
|
121
|
+
moveFilesToDirectory(options, 'files/scripts', '/'),
|
|
122
|
+
moveFilesToDirectory(options, 'files/src', '/src'),
|
|
123
|
+
messageSuccessRule(`App-Dateien wurden angelegt.`)
|
|
124
|
+
]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function updateApp(options: any): Rule {
|
|
128
|
+
return chain([
|
|
129
|
+
messageInfoRule(`App-Dateien wird angepasst...`),
|
|
130
|
+
(tree: Tree, context: SchematicContext) => {
|
|
131
|
+
const filePath = `/package.json`;
|
|
132
|
+
|
|
133
|
+
const newValuesArr = [
|
|
134
|
+
{ path: ['scripts', 'move-de-files'], value: 'node move-de-files.js', message: `Skript "move-de-files" hinzugefügt.`},
|
|
135
|
+
{ path: ['scripts', 'build'], value: 'ng build --aot --localize && npm run move-de-files', message: `Skript "build" angepasst.`},
|
|
136
|
+
{ path: ['scripts', 'build-aot'], value: undefined, message: ``},
|
|
137
|
+
{ path: ['scripts', 'buildzentral'], value: undefined, message: ``},
|
|
138
|
+
{ path: ['devDependencies', 'fs-extra'], value: '^10.0.0', message: `devDependencies "fs-extra" hinzugefügt.`},
|
|
139
|
+
{ path: ['devDependencies', 'del'], value: '^6.0.0', message: `devDependencies "del" hinzugefügt.`}
|
|
140
|
+
];
|
|
141
|
+
|
|
142
|
+
newValuesArr.forEach(change => {
|
|
143
|
+
const tsConfigJson = readJsonAsString(tree, filePath);
|
|
144
|
+
const edits: Edit[] = modify(tsConfigJson, change.path, change.value, { formattingOptions: jsonFormattingOptions })
|
|
145
|
+
|
|
146
|
+
tree.overwrite(
|
|
147
|
+
filePath,
|
|
148
|
+
applyEdits(tsConfigJson, edits)
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
logInfo(change.message);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
readJson(tree, filePath);
|
|
155
|
+
|
|
156
|
+
return tree;
|
|
157
|
+
},
|
|
158
|
+
(tree: Tree, context: SchematicContext) => {
|
|
159
|
+
const filePath = `/angular.json`;
|
|
160
|
+
|
|
161
|
+
const newValuesArr = [
|
|
162
|
+
{ path: ['projects', options.project, 'architect', 'build', 'options', 'outputPath'], value: 'dist', message: `Property "outputPath" auf "dist" gesetzt.`},
|
|
163
|
+
];
|
|
164
|
+
|
|
165
|
+
newValuesArr.forEach(change => {
|
|
166
|
+
const tsConfigJson = readJsonAsString(tree, filePath);
|
|
167
|
+
const edits: Edit[] = modify(tsConfigJson, change.path, change.value, { formattingOptions: jsonFormattingOptions })
|
|
168
|
+
|
|
169
|
+
tree.overwrite(
|
|
170
|
+
filePath,
|
|
171
|
+
applyEdits(tsConfigJson, edits)
|
|
172
|
+
);
|
|
173
|
+
|
|
174
|
+
logInfo(change.message);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
readJson(tree, filePath);
|
|
178
|
+
|
|
179
|
+
return tree;
|
|
180
|
+
},
|
|
181
|
+
messageSuccessRule(`App wurde angepasst.`)
|
|
182
|
+
]);
|
|
183
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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 update_1 = require("../update");
|
|
17
|
+
const dependencies_1 = require("../utility/dependencies");
|
|
18
|
+
const test_1 = require("../utility/test");
|
|
19
|
+
const util_1 = require("../utility/util");
|
|
20
|
+
const index_1 = require("./index");
|
|
21
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
22
|
+
describe('add-lux-components', () => {
|
|
23
|
+
let appTree;
|
|
24
|
+
let runner;
|
|
25
|
+
let context;
|
|
26
|
+
const testOptions = {};
|
|
27
|
+
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
|
+
runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
29
|
+
appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'workspace', test_1.workspaceOptions).toPromise();
|
|
30
|
+
appTree = yield runner
|
|
31
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', test_1.appOptions, appTree)
|
|
32
|
+
.toPromise();
|
|
33
|
+
util_1.UtilConfig.defaultWaitMS = 0;
|
|
34
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
35
|
+
const schematic = runner.engine.createSchematic('add-lux-components', collection);
|
|
36
|
+
context = runner.engine.createContext(schematic);
|
|
37
|
+
testOptions.project = test_1.appOptions.name;
|
|
38
|
+
testOptions.path = test_1.workspaceOptions.newProjectRoot + '/' + test_1.appOptions.name;
|
|
39
|
+
testOptions.verbose = true;
|
|
40
|
+
}));
|
|
41
|
+
describe('[Rule] addLuxComponents', () => {
|
|
42
|
+
it('Sollte die LUX-Components im Projekt eingerichtet haben', (done) => {
|
|
43
|
+
dependencies_1.updatePackageJsonDependency(appTree, { type: dependencies_1.NodeDependencyType.Default, version: update_1.updateMajorVersion + '.0.0', name: '@angular/common' });
|
|
44
|
+
schematics_1.callRule(index_1.addLuxComponents(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
|
|
45
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toContain(update_1.updateMajorVersion);
|
|
46
|
+
done();
|
|
47
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index_spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAwE;AACxE,gEAAuF;AACvF,6BAA6B;AAC7B,+BAA0C;AAC1C,sCAA+C;AAC/C,0DAAoH;AACpH,0CAA+D;AAC/D,0CAA6C;AAC7C,mCAA2C;AAE3C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,IAAI,OAAqB,CAAC;IAC1B,IAAI,MAA2B,CAAC;IAChC,IAAI,OAAyB,CAAC;IAE9B,MAAM,WAAW,GAAQ,EAAE,CAAC;IAE5B,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QAE/D,OAAO,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,qBAAqB,EAAE,WAAW,EAAE,u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AE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAC3C,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { callRule, SchematicContext } from '@angular-devkit/schematics';
|
|
2
|
+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { of as observableOf } from 'rxjs';
|
|
5
|
+
import { updateMajorVersion } from '../update';
|
|
6
|
+
import { getPackageJsonDependency, NodeDependencyType, updatePackageJsonDependency } from '../utility/dependencies';
|
|
7
|
+
import { appOptions, workspaceOptions } from '../utility/test';
|
|
8
|
+
import { UtilConfig } from '../utility/util';
|
|
9
|
+
import { addLuxComponents } from './index';
|
|
10
|
+
|
|
11
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
12
|
+
|
|
13
|
+
describe('add-lux-components', () => {
|
|
14
|
+
let appTree: UnitTestTree;
|
|
15
|
+
let runner: SchematicTestRunner;
|
|
16
|
+
let context: SchematicContext;
|
|
17
|
+
|
|
18
|
+
const testOptions: any = {};
|
|
19
|
+
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
runner = new SchematicTestRunner('schematics', collectionPath);
|
|
22
|
+
|
|
23
|
+
appTree = await runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
|
|
24
|
+
appTree = await runner
|
|
25
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
|
|
26
|
+
.toPromise();
|
|
27
|
+
|
|
28
|
+
UtilConfig.defaultWaitMS = 0;
|
|
29
|
+
|
|
30
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
31
|
+
const schematic = runner.engine.createSchematic('add-lux-components', collection);
|
|
32
|
+
context = runner.engine.createContext(schematic);
|
|
33
|
+
|
|
34
|
+
testOptions.project = appOptions.name;
|
|
35
|
+
testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
|
|
36
|
+
testOptions.verbose = true;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('[Rule] addLuxComponents', () => {
|
|
40
|
+
it('Sollte die LUX-Components im Projekt eingerichtet haben', (done) => {
|
|
41
|
+
updatePackageJsonDependency(
|
|
42
|
+
appTree,
|
|
43
|
+
{ type: NodeDependencyType.Default, version: updateMajorVersion + '.0.0', name: '@angular/common' }
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
callRule(addLuxComponents(testOptions), observableOf(appTree), context).subscribe(
|
|
47
|
+
() => {
|
|
48
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toContain(updateMajorVersion);
|
|
49
|
+
done();
|
|
50
|
+
},
|
|
51
|
+
(reason) => expect(reason).toBeUndefined()
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "addLuxComponentsSchema",
|
|
4
|
+
"title": "Fügt die LUX-Components zum Projekt hinzu",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "Fügt die LUX-Components zum Projekt hinzu",
|
|
7
|
+
"properties": {
|
|
8
|
+
"project": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Der Projektname",
|
|
11
|
+
"$default": {
|
|
12
|
+
"$source": "projectName"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"verbose": {
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"description": "Generiert mehr Logausgaben",
|
|
18
|
+
"default": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": [],
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"update": {
|
|
5
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.0.0",
|
|
6
|
+
"factory": "./update/index#update",
|
|
7
|
+
"schema": "./update/schema.json"
|
|
8
|
+
},
|
|
9
|
+
"update-11.0.1": {
|
|
10
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.0.1",
|
|
11
|
+
"factory": "./update110001/index#update110001",
|
|
12
|
+
"schema": "./update110001/schema.json"
|
|
13
|
+
},
|
|
14
|
+
"update-11.1.0": {
|
|
15
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.1.0",
|
|
16
|
+
"factory": "./update110100/index#update110100",
|
|
17
|
+
"schema": "./update110100/schema.json"
|
|
18
|
+
},
|
|
19
|
+
"update-11.1.1": {
|
|
20
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.1.1",
|
|
21
|
+
"factory": "./update110101/index#update110101",
|
|
22
|
+
"schema": "./update110101/schema.json"
|
|
23
|
+
},
|
|
24
|
+
"update-11.2.0": {
|
|
25
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.2.0",
|
|
26
|
+
"factory": "./update110200/index#update110200",
|
|
27
|
+
"schema": "./update110200/schema.json"
|
|
28
|
+
},
|
|
29
|
+
"update-11.3.0": {
|
|
30
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 11.3.0",
|
|
31
|
+
"factory": "./update110300/index#update110300",
|
|
32
|
+
"schema": "./update110300/schema.json"
|
|
33
|
+
},
|
|
34
|
+
"update-dependencies": {
|
|
35
|
+
"description": "Aktualisiert die Abhängigkeiten im LUX-Componentsprojekt",
|
|
36
|
+
"factory": "./update-dependencies/index#updateDependencies",
|
|
37
|
+
"schema": "./update-dependencies/schema.json"
|
|
38
|
+
},
|
|
39
|
+
"add-lux-components": {
|
|
40
|
+
"description": "Fügt die LUX-Components zum Projekt hinzu",
|
|
41
|
+
"factory": "./add-lux-components/index#addLuxComponents",
|
|
42
|
+
"schema": "./add-lux-components/schema.json"
|
|
43
|
+
},
|
|
44
|
+
"migrate-to-eslint": {
|
|
45
|
+
"description": "Bereitet das LUX-Componentsprojekt für die Migration auf ES-Lint vor",
|
|
46
|
+
"factory": "./migrate-to-eslint/index#migrateToEsLint",
|
|
47
|
+
"schema": "./migrate-to-eslint/schema.json"
|
|
48
|
+
},
|
|
49
|
+
"migrate-to-webcomponent": {
|
|
50
|
+
"description": "LUX-Componentsprojekt wird zur Web Component umgebaut",
|
|
51
|
+
"factory": "./migrate-to-webcomponent/index#migrateToWebcomponent",
|
|
52
|
+
"schema": "./migrate-to-webcomponent/schema.json"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|