@ihk-gfi/lux-components-update 14.1.0 → 14.2.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/package.json +8 -4
- package/src/collection.json +6 -0
- package/src/update-en-messages/index.js +7 -8
- package/src/update-en-messages/index.js.map +1 -1
- package/src/update-en-messages/index.ts +7 -8
- package/src/update-en-messages/index_spec.d.ts +1 -0
- package/src/update-en-messages/index_spec.js +174 -0
- package/src/update-en-messages/index_spec.js.map +1 -0
- package/src/update-en-messages/index_spec.ts +182 -0
- package/src/updates/update140100/index_spec.js +1 -1
- package/src/updates/update140100/index_spec.js.map +1 -1
- package/src/updates/update140100/index_spec.ts +1 -1
- package/src/updates/update140200/index.d.ts +8 -0
- package/src/updates/update140200/index.js +40 -0
- package/src/updates/update140200/index.js.map +1 -0
- package/src/updates/update140200/index.ts +38 -0
- package/src/updates/update140200/index_spec.d.ts +1 -0
- package/src/updates/update140200/index_spec.js +75 -0
- package/src/updates/update140200/index_spec.js.map +1 -0
- package/src/updates/update140200/index_spec.ts +81 -0
- package/src/updates/update140200/schema.json +23 -0
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ihk-gfi/lux-components-update",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.2.0",
|
|
4
4
|
"description": "Schematics für die Aktualisierung von LUX-Applikationen",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -p tsconfig.json",
|
|
7
|
-
"
|
|
8
|
-
"security": "npm audit --registry=https://registry.npmjs.org --audit-level high"
|
|
7
|
+
"husky-init": "husky install",
|
|
8
|
+
"security": "npm audit --registry=https://registry.npmjs.org --audit-level high",
|
|
9
|
+
"smoketest": "npm run build && jasmine src/**/*_spec.js",
|
|
10
|
+
"test": "jasmine src/**/*_spec.js"
|
|
9
11
|
},
|
|
10
12
|
"keywords": [
|
|
11
13
|
"schematics",
|
|
@@ -48,6 +50,8 @@
|
|
|
48
50
|
"typescript": "4.7.3"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
|
-
"
|
|
53
|
+
"husky": "8.0.3",
|
|
54
|
+
"prettier": "2.6.2",
|
|
55
|
+
"pretty-quick": "3.1.3"
|
|
52
56
|
}
|
|
53
57
|
}
|
package/src/collection.json
CHANGED
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
"factory": "./updates/update140000/index#update",
|
|
7
7
|
"schema": "./updates/update140000/schema.json"
|
|
8
8
|
},
|
|
9
|
+
"update-14.2.0": {
|
|
10
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 14.2.0",
|
|
11
|
+
"factory": "./updates/update140200/index#update140200",
|
|
12
|
+
"schema": "./updates/update140200/schema.json"
|
|
13
|
+
},
|
|
9
14
|
"update-14.1.0": {
|
|
10
15
|
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 14.1.0",
|
|
11
16
|
"factory": "./updates/update140100/index#update140100",
|
|
@@ -18,6 +23,7 @@
|
|
|
18
23
|
},
|
|
19
24
|
"update-en-messages": {
|
|
20
25
|
"description": "Aktualisiert die englischen Übersetzungen im Projekt",
|
|
26
|
+
"factory": "./update-en-messages/index#updateEnMessages",
|
|
21
27
|
"schema": "./update-en-messages/schema.json"
|
|
22
28
|
},
|
|
23
29
|
"add-lux-components": {
|
|
@@ -34,17 +34,17 @@ function updateEnMessagesIntern() {
|
|
|
34
34
|
if (id === null || id === void 0 ? void 0 : id.startsWith('luxc.')) {
|
|
35
35
|
const transUnit = fnLCEEn(`trans-unit[id="${id}"]`).first();
|
|
36
36
|
fnAPPDe('\n ' + fnLCEEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${id}"]`).find('source'));
|
|
37
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
37
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
38
38
|
}
|
|
39
39
|
else if (id === null || id === void 0 ? void 0 : id.startsWith('luxsd.')) {
|
|
40
40
|
const transUnit = fnSDEn(`trans-unit[id="${id}"]`).first();
|
|
41
41
|
fnAPPDe('\n ' + fnSDEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${id}"]`).find('source'));
|
|
42
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
42
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
const transUnit = fnAPPEn(`trans-unit[id="${id}"]`).first();
|
|
46
46
|
fnAPPDe('\n ' + fnAPPEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${id}"]`).find('source'));
|
|
47
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
47
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
newContent += footerContent;
|
|
@@ -65,14 +65,13 @@ function readTransUnitFile(tree, filePath) {
|
|
|
65
65
|
}
|
|
66
66
|
return content;
|
|
67
67
|
}
|
|
68
|
-
const headerContent =
|
|
69
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
|
68
|
+
const headerContent = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
70
69
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
71
70
|
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
72
|
-
<body
|
|
73
|
-
`;
|
|
71
|
+
<body>`;
|
|
74
72
|
const footerContent = `
|
|
75
73
|
</body>
|
|
76
74
|
</file>
|
|
77
|
-
</xliff>
|
|
75
|
+
</xliff>
|
|
76
|
+
`;
|
|
78
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,qCAA+B;AAC/B,gDAA6C;AAC7C,0CAAkD;AAElD,MAAM,mBAAmB,GAAW,YAAY,CAAC;AA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C;aAAM;YACH,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;SAC7C;IACL,CAAC,CAAC;AACN,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAU,EAAE,QAAgB;IACnD,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,GAAQ,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClD;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,aAAa,GAAG;;;WAGX,CAAC;AAEZ,MAAM,aAAa,GAAG;;;;CAIrB,CAAC"}
|
|
@@ -37,15 +37,15 @@ function updateEnMessagesIntern(): Rule {
|
|
|
37
37
|
if (id?.startsWith('luxc.')) {
|
|
38
38
|
const transUnit = fnLCEEn(`trans-unit[id="${ id }"]`).first();
|
|
39
39
|
fnAPPDe('\n ' + fnLCEEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${ id }"]`).find('source'));
|
|
40
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
40
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
41
41
|
} else if (id?.startsWith('luxsd.')) {
|
|
42
42
|
const transUnit = fnSDEn(`trans-unit[id="${ id }"]`).first();
|
|
43
43
|
fnAPPDe('\n ' + fnSDEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${ id }"]`).find('source'));
|
|
44
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
44
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
45
45
|
} else {
|
|
46
46
|
const transUnit = fnAPPEn(`trans-unit[id="${ id }"]`).first();
|
|
47
47
|
fnAPPDe('\n ' + fnAPPEn(transUnit).find('target').toString()).insertAfter(fnAPPDe(`trans-unit[id="${ id }"]`).find('source'));
|
|
48
|
-
newContent += ' ' + fnAPPDe(element).toString()
|
|
48
|
+
newContent += '\n ' + fnAPPDe(element).toString();
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -71,14 +71,13 @@ function readTransUnitFile(tree: Tree, filePath: string): string {
|
|
|
71
71
|
return content;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
const headerContent =
|
|
75
|
-
<?xml version="1.0" encoding="UTF-8" ?>
|
|
74
|
+
const headerContent = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
76
75
|
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
77
76
|
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
78
|
-
<body
|
|
79
|
-
`;
|
|
77
|
+
<body>`;
|
|
80
78
|
|
|
81
79
|
const footerContent = `
|
|
82
80
|
</body>
|
|
83
81
|
</file>
|
|
84
|
-
</xliff>
|
|
82
|
+
</xliff>
|
|
83
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
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 test_1 = require("../utility/test");
|
|
17
|
+
const util_1 = require("../utility/util");
|
|
18
|
+
const index_1 = require("./index");
|
|
19
|
+
describe('updateEnMessages', () => {
|
|
20
|
+
let appTree;
|
|
21
|
+
let runner;
|
|
22
|
+
let context;
|
|
23
|
+
const testOptions = {
|
|
24
|
+
project: '',
|
|
25
|
+
path: '/',
|
|
26
|
+
verbose: false
|
|
27
|
+
};
|
|
28
|
+
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
30
|
+
runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
31
|
+
const collection = '@schematics/angular';
|
|
32
|
+
appTree = yield runner.runExternalSchematicAsync(collection, 'workspace', test_1.workspaceOptions).toPromise();
|
|
33
|
+
appTree = yield runner.runExternalSchematicAsync(collection, 'application', test_1.appOptions, appTree).toPromise();
|
|
34
|
+
context = runner.engine.createContext(runner.engine.createSchematic('update-en-messages', runner.engine.createCollection(collectionPath)));
|
|
35
|
+
util_1.UtilConfig.defaultWaitMS = 0;
|
|
36
|
+
testOptions.project = test_1.appOptions.name;
|
|
37
|
+
testOptions.path = test_1.workspaceOptions.newProjectRoot + '/' + test_1.appOptions.name;
|
|
38
|
+
testOptions.verbose = true;
|
|
39
|
+
}));
|
|
40
|
+
describe('[Rule] updateEnMessages', () => {
|
|
41
|
+
it('Sollte die englische Übersetzungen aktualisieren', (done) => {
|
|
42
|
+
const filePathDe = '/src/locale/messages.xlf';
|
|
43
|
+
const filePathEn = '/src/locale/messages.en.xlf';
|
|
44
|
+
appTree.create(filePathDe, i18nDeApp);
|
|
45
|
+
appTree.create(filePathEn, i18nEnApp);
|
|
46
|
+
const filePathLCEn = '/node_modules/@ihk-gfi/lux-components/src/locale/messages.en.xlf';
|
|
47
|
+
const filePathSDEn = '/node_modules/@ihk-gfi/lux-stammdaten/src/locale/messages.en.xlf';
|
|
48
|
+
appTree.create(filePathLCEn, i18nEnLuxC);
|
|
49
|
+
appTree.create(filePathSDEn, i18nEnStamm);
|
|
50
|
+
(0, schematics_1.callRule)((0, index_1.updateEnMessages)(), (0, rxjs_1.of)(appTree), context).subscribe({
|
|
51
|
+
next: (success) => {
|
|
52
|
+
var _a;
|
|
53
|
+
expect(success.exists(filePathDe)).toBeTrue();
|
|
54
|
+
expect(success.exists(filePathEn)).toBeTrue();
|
|
55
|
+
expect(success.exists(filePathLCEn)).toBeTrue();
|
|
56
|
+
expect(success.exists(filePathSDEn)).toBeTrue();
|
|
57
|
+
expect((_a = success.read(filePathEn)) === null || _a === void 0 ? void 0 : _a.toString()).toEqual(i18nEnAppResult);
|
|
58
|
+
done();
|
|
59
|
+
},
|
|
60
|
+
error: (reason) => expect(reason).toBeUndefined()
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
const i18nDeApp = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
66
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
67
|
+
<file source-language="de" datatype="plaintext" original="ng2.template">
|
|
68
|
+
<body>
|
|
69
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
70
|
+
<source>Menü</source>
|
|
71
|
+
<context-group purpose="location">
|
|
72
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
73
|
+
<context context-type="linenumber">64</context>
|
|
74
|
+
</context-group>
|
|
75
|
+
</trans-unit>
|
|
76
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
77
|
+
<source>E-Mail</source>
|
|
78
|
+
<context-group purpose="location">
|
|
79
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
80
|
+
<context context-type="linenumber">42</context>
|
|
81
|
+
</context-group>
|
|
82
|
+
</trans-unit>
|
|
83
|
+
<trans-unit id="test.001" datatype="html">
|
|
84
|
+
<source>test 001 De</source>
|
|
85
|
+
<context-group purpose="location">
|
|
86
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
87
|
+
<context context-type="linenumber">64</context>
|
|
88
|
+
</context-group>
|
|
89
|
+
</trans-unit>
|
|
90
|
+
</body>
|
|
91
|
+
</file>
|
|
92
|
+
</xliff>
|
|
93
|
+
`;
|
|
94
|
+
const i18nEnApp = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
95
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
96
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
97
|
+
<body>
|
|
98
|
+
<trans-unit id="test.001" datatype="html">
|
|
99
|
+
<source>test 001 De</source>
|
|
100
|
+
<target>test 001 En</target>
|
|
101
|
+
<context-group purpose="location">
|
|
102
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
103
|
+
<context context-type="linenumber">64</context>
|
|
104
|
+
</context-group>
|
|
105
|
+
</trans-unit>
|
|
106
|
+
</body>
|
|
107
|
+
</file>
|
|
108
|
+
</xliff>
|
|
109
|
+
`;
|
|
110
|
+
const i18nEnStamm = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
111
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
112
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
113
|
+
<body>
|
|
114
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
115
|
+
<source>E-Mail</source>
|
|
116
|
+
<target>E-mail</target>
|
|
117
|
+
<context-group purpose="location">
|
|
118
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
119
|
+
<context context-type="linenumber">42</context>
|
|
120
|
+
</context-group>
|
|
121
|
+
</trans-unit>
|
|
122
|
+
</body>
|
|
123
|
+
</file>
|
|
124
|
+
</xliff>
|
|
125
|
+
`;
|
|
126
|
+
const i18nEnLuxC = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
127
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
128
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
129
|
+
<body>
|
|
130
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
131
|
+
<source>Menü</source>
|
|
132
|
+
<target>Menu</target>
|
|
133
|
+
<context-group purpose="location">
|
|
134
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
135
|
+
<context context-type="linenumber">64</context>
|
|
136
|
+
</context-group>
|
|
137
|
+
</trans-unit>
|
|
138
|
+
</body>
|
|
139
|
+
</file>
|
|
140
|
+
</xliff>
|
|
141
|
+
`;
|
|
142
|
+
const i18nEnAppResult = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
143
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
144
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
145
|
+
<body>
|
|
146
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
147
|
+
<source>Menü</source>
|
|
148
|
+
<target>Menu</target>
|
|
149
|
+
<context-group purpose="location">
|
|
150
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
151
|
+
<context context-type="linenumber">64</context>
|
|
152
|
+
</context-group>
|
|
153
|
+
</trans-unit>
|
|
154
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
155
|
+
<source>E-Mail</source>
|
|
156
|
+
<target>E-mail</target>
|
|
157
|
+
<context-group purpose="location">
|
|
158
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
159
|
+
<context context-type="linenumber">42</context>
|
|
160
|
+
</context-group>
|
|
161
|
+
</trans-unit>
|
|
162
|
+
<trans-unit id="test.001" datatype="html">
|
|
163
|
+
<source>test 001 De</source>
|
|
164
|
+
<target>test 001 En</target>
|
|
165
|
+
<context-group purpose="location">
|
|
166
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
167
|
+
<context context-type="linenumber">64</context>
|
|
168
|
+
</context-group>
|
|
169
|
+
</trans-unit>
|
|
170
|
+
</body>
|
|
171
|
+
</file>
|
|
172
|
+
</xliff>
|
|
173
|
+
`;
|
|
174
|
+
//# 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,0CAA+D;AAC/D,0CAA6C;AAC7C,mCAA2C;AAE3C,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,IAAI,OAAqB,CAAC;IAC1B,IAAI,MAA2B,CAAC;IAChC,IAAI,OAAyB,CAAC;IAE9B,MAAM,WAAW,GAAwD;QACvE,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;KACf,CAAC;IAEF,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAClE,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAG,qBAAqB,CAAC;QACzC,OAAO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
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { of as observableOf } from 'rxjs';
|
|
5
|
+
import { appOptions, workspaceOptions } from '../utility/test';
|
|
6
|
+
import { UtilConfig } from '../utility/util';
|
|
7
|
+
import { updateEnMessages } from './index';
|
|
8
|
+
|
|
9
|
+
describe('updateEnMessages', () => {
|
|
10
|
+
let appTree: UnitTestTree;
|
|
11
|
+
let runner: SchematicTestRunner;
|
|
12
|
+
let context: SchematicContext;
|
|
13
|
+
|
|
14
|
+
const testOptions: { project: string; path: string; verbose: boolean } = {
|
|
15
|
+
project: '',
|
|
16
|
+
path: '/',
|
|
17
|
+
verbose: false
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
22
|
+
runner = new SchematicTestRunner('schematics', collectionPath);
|
|
23
|
+
|
|
24
|
+
const collection = '@schematics/angular';
|
|
25
|
+
appTree = await runner.runExternalSchematicAsync(collection, 'workspace', workspaceOptions).toPromise();
|
|
26
|
+
appTree = await runner.runExternalSchematicAsync(collection, 'application', appOptions, appTree).toPromise();
|
|
27
|
+
|
|
28
|
+
context = runner.engine.createContext(
|
|
29
|
+
runner.engine.createSchematic('update-en-messages', runner.engine.createCollection(collectionPath))
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
UtilConfig.defaultWaitMS = 0;
|
|
33
|
+
|
|
34
|
+
testOptions.project = appOptions.name;
|
|
35
|
+
testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
|
|
36
|
+
testOptions.verbose = true;
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('[Rule] updateEnMessages', () => {
|
|
40
|
+
it('Sollte die englische Übersetzungen aktualisieren', (done) => {
|
|
41
|
+
const filePathDe = '/src/locale/messages.xlf';
|
|
42
|
+
const filePathEn = '/src/locale/messages.en.xlf';
|
|
43
|
+
|
|
44
|
+
appTree.create(filePathDe, i18nDeApp);
|
|
45
|
+
appTree.create(filePathEn, i18nEnApp);
|
|
46
|
+
|
|
47
|
+
const filePathLCEn = '/node_modules/@ihk-gfi/lux-components/src/locale/messages.en.xlf';
|
|
48
|
+
const filePathSDEn = '/node_modules/@ihk-gfi/lux-stammdaten/src/locale/messages.en.xlf';
|
|
49
|
+
|
|
50
|
+
appTree.create(filePathLCEn, i18nEnLuxC);
|
|
51
|
+
appTree.create(filePathSDEn, i18nEnStamm);
|
|
52
|
+
|
|
53
|
+
callRule(updateEnMessages(), observableOf(appTree), context).subscribe({
|
|
54
|
+
next: (success) => {
|
|
55
|
+
|
|
56
|
+
expect(success.exists(filePathDe)).toBeTrue();
|
|
57
|
+
expect(success.exists(filePathEn)).toBeTrue();
|
|
58
|
+
expect(success.exists(filePathLCEn)).toBeTrue();
|
|
59
|
+
expect(success.exists(filePathSDEn)).toBeTrue();
|
|
60
|
+
|
|
61
|
+
expect(success.read(filePathEn)?.toString()).toEqual(i18nEnAppResult);
|
|
62
|
+
|
|
63
|
+
done();
|
|
64
|
+
},
|
|
65
|
+
error: (reason) => expect(reason).toBeUndefined()
|
|
66
|
+
});
|
|
67
|
+
})});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const i18nDeApp = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
71
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
72
|
+
<file source-language="de" datatype="plaintext" original="ng2.template">
|
|
73
|
+
<body>
|
|
74
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
75
|
+
<source>Menü</source>
|
|
76
|
+
<context-group purpose="location">
|
|
77
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
78
|
+
<context context-type="linenumber">64</context>
|
|
79
|
+
</context-group>
|
|
80
|
+
</trans-unit>
|
|
81
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
82
|
+
<source>E-Mail</source>
|
|
83
|
+
<context-group purpose="location">
|
|
84
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
85
|
+
<context context-type="linenumber">42</context>
|
|
86
|
+
</context-group>
|
|
87
|
+
</trans-unit>
|
|
88
|
+
<trans-unit id="test.001" datatype="html">
|
|
89
|
+
<source>test 001 De</source>
|
|
90
|
+
<context-group purpose="location">
|
|
91
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
92
|
+
<context context-type="linenumber">64</context>
|
|
93
|
+
</context-group>
|
|
94
|
+
</trans-unit>
|
|
95
|
+
</body>
|
|
96
|
+
</file>
|
|
97
|
+
</xliff>
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
const i18nEnApp = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
101
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
102
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
103
|
+
<body>
|
|
104
|
+
<trans-unit id="test.001" datatype="html">
|
|
105
|
+
<source>test 001 De</source>
|
|
106
|
+
<target>test 001 En</target>
|
|
107
|
+
<context-group purpose="location">
|
|
108
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
109
|
+
<context context-type="linenumber">64</context>
|
|
110
|
+
</context-group>
|
|
111
|
+
</trans-unit>
|
|
112
|
+
</body>
|
|
113
|
+
</file>
|
|
114
|
+
</xliff>
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
const i18nEnStamm = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
118
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
119
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
120
|
+
<body>
|
|
121
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
122
|
+
<source>E-Mail</source>
|
|
123
|
+
<target>E-mail</target>
|
|
124
|
+
<context-group purpose="location">
|
|
125
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
126
|
+
<context context-type="linenumber">42</context>
|
|
127
|
+
</context-group>
|
|
128
|
+
</trans-unit>
|
|
129
|
+
</body>
|
|
130
|
+
</file>
|
|
131
|
+
</xliff>
|
|
132
|
+
`;
|
|
133
|
+
|
|
134
|
+
const i18nEnLuxC = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
135
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
136
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
137
|
+
<body>
|
|
138
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
139
|
+
<source>Menü</source>
|
|
140
|
+
<target>Menu</target>
|
|
141
|
+
<context-group purpose="location">
|
|
142
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
143
|
+
<context context-type="linenumber">64</context>
|
|
144
|
+
</context-group>
|
|
145
|
+
</trans-unit>
|
|
146
|
+
</body>
|
|
147
|
+
</file>
|
|
148
|
+
</xliff>
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
const i18nEnAppResult = `<?xml version="1.0" encoding="UTF-8" ?>
|
|
152
|
+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
|
|
153
|
+
<file source-language="en" datatype="plaintext" original="ng2.template">
|
|
154
|
+
<body>
|
|
155
|
+
<trans-unit id="luxc.menu.trigger.btn" datatype="html">
|
|
156
|
+
<source>Menü</source>
|
|
157
|
+
<target>Menu</target>
|
|
158
|
+
<context-group purpose="location">
|
|
159
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
160
|
+
<context context-type="linenumber">64</context>
|
|
161
|
+
</context-group>
|
|
162
|
+
</trans-unit>
|
|
163
|
+
<trans-unit id="luxsd.contact.email" datatype="html">
|
|
164
|
+
<source>E-Mail</source>
|
|
165
|
+
<target>E-mail</target>
|
|
166
|
+
<context-group purpose="location">
|
|
167
|
+
<context context-type="sourcefile">src/app/modules/lux-stammdaten/lux-stammdaten-kontakt/lux-stammdaten-kontakt.component.ts</context>
|
|
168
|
+
<context context-type="linenumber">42</context>
|
|
169
|
+
</context-group>
|
|
170
|
+
</trans-unit>
|
|
171
|
+
<trans-unit id="test.001" datatype="html">
|
|
172
|
+
<source>test 001 De</source>
|
|
173
|
+
<target>test 001 En</target>
|
|
174
|
+
<context-group purpose="location">
|
|
175
|
+
<context context-type="sourcefile">node_modules/@ihk-gfi/src/app/modules/lux-action/lux-menu/lux-menu.component.ts</context>
|
|
176
|
+
<context context-type="linenumber">64</context>
|
|
177
|
+
</context-group>
|
|
178
|
+
</trans-unit>
|
|
179
|
+
</body>
|
|
180
|
+
</file>
|
|
181
|
+
</xliff>
|
|
182
|
+
`;
|
|
@@ -68,7 +68,7 @@ describe('update140100', () => {
|
|
|
68
68
|
done();
|
|
69
69
|
}, (reason) => expect(reason).toBeUndefined());
|
|
70
70
|
});
|
|
71
|
-
it('Sollte die
|
|
71
|
+
it('Sollte die I18N-Dateien aktualisieren', (done) => {
|
|
72
72
|
appTree.create('/src/locale/messages.xlf', i18nDe);
|
|
73
73
|
appTree.create('/src/locale/messages.en.xlf', i18nEn);
|
|
74
74
|
(0, schematics_1.callRule)((0, index_1.update140100)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2DAAwE;AACxE,gEAAuF;AACvF,6BAA6B;AAC7B,+BAA0C;AAC1C,6DAAsE;AACtE,6CAAkE;AAClE,6CAAg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AA,OAAO,CAAC,IAAI,CAAC,6BAA6B,CAAC,0CAAE,QAAQ,EAAE,CAAC;gBAC1E,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,oBAAY,CAAC,CAAC;gBAC1C,IAAI,EAAE,CAAC;YACT,CAAC,EACD,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAC3C,CAAC;QACJ,CAAC,CAAC,CAAC;IAEL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;CAkBd,CAAC;AAEF,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;CAmBd,CAAC"}
|
|
@@ -75,7 +75,7 @@ describe('update140100', () => {
|
|
|
75
75
|
);
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
it('Sollte die
|
|
78
|
+
it('Sollte die I18N-Dateien aktualisieren', (done) => {
|
|
79
79
|
appTree.create('/src/locale/messages.xlf', i18nDe);
|
|
80
80
|
appTree.create('/src/locale/messages.en.xlf', i18nEn);
|
|
81
81
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare const logosAssetBlock: {
|
|
3
|
+
glob: string;
|
|
4
|
+
input: string;
|
|
5
|
+
output: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function update140200(options: any): Rule;
|
|
8
|
+
export declare function addLogosAssets(options: any): Rule;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addLogosAssets = exports.update140200 = exports.logosAssetBlock = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const index_1 = require("../../update-dependencies/index");
|
|
7
|
+
const json_1 = require("../../utility/json");
|
|
8
|
+
const util_1 = require("../../utility/util");
|
|
9
|
+
exports.logosAssetBlock = {
|
|
10
|
+
glob: '**/*',
|
|
11
|
+
input: './node_modules/@ihk-gfi/lux-components-icons-and-fonts/assets/logos/',
|
|
12
|
+
output: './assets/logos'
|
|
13
|
+
};
|
|
14
|
+
function update140200(options) {
|
|
15
|
+
return (_tree, _context) => {
|
|
16
|
+
return (0, schematics_1.chain)([
|
|
17
|
+
(0, util_1.messageInfoRule)(`Die LUX-Components werden auf die Version 14.2.0 aktualisiert...`),
|
|
18
|
+
(0, util_1.messageInfoRule)(`Die Datei "package.json" wird angepasst...`),
|
|
19
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components', '14.2.0', false),
|
|
20
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components-theme', '14.2.0', false),
|
|
21
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components-icons-and-fonts', '1.3.0', false),
|
|
22
|
+
addLogosAssets(options),
|
|
23
|
+
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 14.2.0 aktualisiert.`),
|
|
24
|
+
(0, util_1.finish)(true, `${chalk.yellowBright('Fertig!')}`)
|
|
25
|
+
]);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.update140200 = update140200;
|
|
29
|
+
function addLogosAssets(options) {
|
|
30
|
+
const assetPath = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
|
|
31
|
+
const testAssetPath = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
|
|
32
|
+
return (0, schematics_1.chain)([
|
|
33
|
+
(0, util_1.messageInfoRule)(`Die Logos werden in den Asset-Abschnitten ergänzt...`),
|
|
34
|
+
(0, json_1.updateJsonArray)('/angular.json', assetPath, exports.logosAssetBlock),
|
|
35
|
+
(0, json_1.updateJsonArray)('/angular.json', testAssetPath, exports.logosAssetBlock),
|
|
36
|
+
(0, util_1.messageSuccessRule)(`Die Logos wurden in den Asset-Abschnitten ergänzt.`)
|
|
37
|
+
]);
|
|
38
|
+
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AC;IAE9F,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,sBAAe,EAAC,sDAAsD,CAAC;QACvE,IAAA,sBAAe,EAAC,eAAe,EAAE,SAAS,EAAE,uBAAe,CAAC;QAC5D,IAAA,sBAAe,EAAC,eAAe,EAAE,aAAa,EAAE,uBAAe,CAAC;QAChE,IAAA,yBAAkB,EAAC,oDAAoD,CAAC;KACzE,CAAC,CAAC;AACL,CAAC;AAVD,wCAUC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { updateDep } from '../../update-dependencies/index';
|
|
4
|
+
import { updateJsonArray } from '../../utility/json';
|
|
5
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../../utility/util';
|
|
6
|
+
|
|
7
|
+
export const logosAssetBlock = {
|
|
8
|
+
glob: '**/*',
|
|
9
|
+
input: './node_modules/@ihk-gfi/lux-components-icons-and-fonts/assets/logos/',
|
|
10
|
+
output: './assets/logos'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export function update140200(options: any): Rule {
|
|
14
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
15
|
+
return chain([
|
|
16
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 14.2.0 aktualisiert...`),
|
|
17
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
18
|
+
updateDep('@ihk-gfi/lux-components', '14.2.0', false),
|
|
19
|
+
updateDep('@ihk-gfi/lux-components-theme', '14.2.0', false),
|
|
20
|
+
updateDep('@ihk-gfi/lux-components-icons-and-fonts', '1.3.0', false),
|
|
21
|
+
addLogosAssets(options),
|
|
22
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 14.2.0 aktualisiert.`),
|
|
23
|
+
finish(true, `${chalk.yellowBright('Fertig!')}`)
|
|
24
|
+
]);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function addLogosAssets(options: any): Rule {
|
|
29
|
+
const assetPath = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
|
|
30
|
+
const testAssetPath = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
|
|
31
|
+
|
|
32
|
+
return chain([
|
|
33
|
+
messageInfoRule(`Die Logos werden in den Asset-Abschnitten ergänzt...`),
|
|
34
|
+
updateJsonArray('/angular.json', assetPath, logosAssetBlock),
|
|
35
|
+
updateJsonArray('/angular.json', testAssetPath, logosAssetBlock),
|
|
36
|
+
messageSuccessRule(`Die Logos wurden in den Asset-Abschnitten ergänzt.`)
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
14
|
+
const path = require("path");
|
|
15
|
+
const rxjs_1 = require("rxjs");
|
|
16
|
+
const dependencies_1 = require("../../utility/dependencies");
|
|
17
|
+
const test_1 = require("../../utility/test");
|
|
18
|
+
const util_1 = require("../../utility/util");
|
|
19
|
+
const index_1 = require("./index");
|
|
20
|
+
const collectionPath = path.join(__dirname, '../../collection.json');
|
|
21
|
+
describe('update140200', () => {
|
|
22
|
+
let appTree;
|
|
23
|
+
let runner;
|
|
24
|
+
let context;
|
|
25
|
+
const testOptions = {};
|
|
26
|
+
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
27
|
+
runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
28
|
+
appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'workspace', test_1.workspaceOptions).toPromise();
|
|
29
|
+
appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'application', test_1.appOptions, appTree).toPromise();
|
|
30
|
+
util_1.UtilConfig.defaultWaitMS = 0;
|
|
31
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
32
|
+
const schematic = runner.engine.createSchematic('update-14.2.0', collection);
|
|
33
|
+
context = runner.engine.createContext(schematic);
|
|
34
|
+
testOptions.project = test_1.appOptions.name;
|
|
35
|
+
testOptions.path = test_1.workspaceOptions.newProjectRoot + '/' + test_1.appOptions.name;
|
|
36
|
+
testOptions.verbose = true;
|
|
37
|
+
}));
|
|
38
|
+
describe('[Rule] update140200', () => {
|
|
39
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
40
|
+
appTree.overwrite('/package.json', `
|
|
41
|
+
{
|
|
42
|
+
"name": "Lorem ipsum",
|
|
43
|
+
"version": "0.0.32",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@angular/animations": "14.3.7",
|
|
50
|
+
"@angular/cdk": "14.3.7",
|
|
51
|
+
"@angular/common": "14.3.7",
|
|
52
|
+
"@ihk-gfi/lux-components": "14.1.0",
|
|
53
|
+
"@ihk-gfi/lux-components-theme": "14.1.0",
|
|
54
|
+
"@angular/compiler": "14.3.7",
|
|
55
|
+
"@ihk-gfi/lux-components-icons-and-fonts": "1.1.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@angular-devkit/build-angular": "14.3.5",
|
|
59
|
+
"@angular-eslint/builder": "14.2.1"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`);
|
|
63
|
+
(0, schematics_1.callRule)((0, index_1.update140200)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => {
|
|
64
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).not.toEqual('14.1.0');
|
|
65
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).toEqual('14.2.0');
|
|
66
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-theme').version).not.toEqual('14.1.0');
|
|
67
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('14.2.0');
|
|
68
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).not.toEqual('1.1.0');
|
|
69
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).toEqual('1.3.0');
|
|
70
|
+
done();
|
|
71
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//# 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,6DAAsE;AACtE,6CAAkE;AAClE,6CAAgD;AAChD,mCAAuC;AAEvC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAErE,QAAQ,CAAC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AW,CAAC,EAAE,IAAA,SAAY,EAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3E,GAAG,EAAE;gBACH,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACnG,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAE/F,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACzG,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAErG,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,yCAAyC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAClH,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,yCAAyC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC9G,IAAI,EAAE,CAAC;YACT,CAAC,EACD,CAAC,MAAM,EAAE,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,81 @@
|
|
|
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 { getPackageJsonDependency } from '../../utility/dependencies';
|
|
6
|
+
import { appOptions, workspaceOptions } from '../../utility/test';
|
|
7
|
+
import { UtilConfig } from '../../utility/util';
|
|
8
|
+
import { update140200 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update140200', () => {
|
|
13
|
+
let appTree: UnitTestTree;
|
|
14
|
+
let runner: SchematicTestRunner;
|
|
15
|
+
let context: SchematicContext;
|
|
16
|
+
|
|
17
|
+
const testOptions: any = {};
|
|
18
|
+
|
|
19
|
+
beforeEach(async () => {
|
|
20
|
+
runner = new SchematicTestRunner('schematics', collectionPath);
|
|
21
|
+
|
|
22
|
+
appTree = await runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
|
|
23
|
+
appTree = await runner.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree).toPromise();
|
|
24
|
+
|
|
25
|
+
UtilConfig.defaultWaitMS = 0;
|
|
26
|
+
|
|
27
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
28
|
+
const schematic = runner.engine.createSchematic('update-14.2.0', collection);
|
|
29
|
+
context = runner.engine.createContext(schematic);
|
|
30
|
+
|
|
31
|
+
testOptions.project = appOptions.name;
|
|
32
|
+
testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
|
|
33
|
+
testOptions.verbose = true;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('[Rule] update140200', () => {
|
|
37
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
38
|
+
appTree.overwrite(
|
|
39
|
+
'/package.json',
|
|
40
|
+
`
|
|
41
|
+
{
|
|
42
|
+
"name": "Lorem ipsum",
|
|
43
|
+
"version": "0.0.32",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.json",
|
|
46
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@angular/animations": "14.3.7",
|
|
50
|
+
"@angular/cdk": "14.3.7",
|
|
51
|
+
"@angular/common": "14.3.7",
|
|
52
|
+
"@ihk-gfi/lux-components": "14.1.0",
|
|
53
|
+
"@ihk-gfi/lux-components-theme": "14.1.0",
|
|
54
|
+
"@angular/compiler": "14.3.7",
|
|
55
|
+
"@ihk-gfi/lux-components-icons-and-fonts": "1.1.0"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@angular-devkit/build-angular": "14.3.5",
|
|
59
|
+
"@angular-eslint/builder": "14.2.1"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
callRule(update140200(testOptions), observableOf(appTree), context).subscribe(
|
|
66
|
+
() => {
|
|
67
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).not.toEqual('14.1.0');
|
|
68
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('14.2.0');
|
|
69
|
+
|
|
70
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).not.toEqual('14.1.0');
|
|
71
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('14.2.0');
|
|
72
|
+
|
|
73
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).not.toEqual('1.1.0');
|
|
74
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).toEqual('1.3.0');
|
|
75
|
+
done();
|
|
76
|
+
},
|
|
77
|
+
(reason) => expect(reason).toBeUndefined()
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "luxUpdate130200Schema",
|
|
4
|
+
"title": "Aktualisiert das LUX-Componentsprojekt",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"description": "Aktualisiert das LUX-Componentsprojekt",
|
|
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
|
+
}
|