@ihk-gfi/lux-components-update 14.2.0 → 14.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/package.json +1 -1
- package/src/collection.json +5 -0
- package/src/updates/update140300/index.d.ts +10 -0
- package/src/updates/update140300/index.js +85 -0
- package/src/updates/update140300/index.js.map +1 -0
- package/src/updates/update140300/index.ts +86 -0
- package/src/updates/update140300/index_spec.d.ts +1 -0
- package/src/updates/update140300/index_spec.js +145 -0
- package/src/updates/update140300/index_spec.js.map +1 -0
- package/src/updates/update140300/index_spec.ts +177 -0
- package/src/updates/update140300/schema.json +23 -0
package/package.json
CHANGED
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.3.0": {
|
|
10
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 14.3.0",
|
|
11
|
+
"factory": "./updates/update140300/index#update140300",
|
|
12
|
+
"schema": "./updates/update140300/schema.json"
|
|
13
|
+
},
|
|
9
14
|
"update-14.2.0": {
|
|
10
15
|
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 14.2.0",
|
|
11
16
|
"factory": "./updates/update140200/index#update140200",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare const stylesScss: string;
|
|
3
|
+
export declare const fontAssetBlock: {
|
|
4
|
+
glob: string;
|
|
5
|
+
input: string;
|
|
6
|
+
output: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function update140300(options: any): Rule;
|
|
9
|
+
export declare function updateStylesScss(options: any): Rule;
|
|
10
|
+
export declare function updateAngularJson(options: any): Rule;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateAngularJson = exports.updateStylesScss = exports.update140300 = exports.fontAssetBlock = exports.stylesScss = 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 logging_1 = require("../../utility/logging");
|
|
9
|
+
const util_1 = require("../../utility/util");
|
|
10
|
+
const comment = `/* You can add global styles to this file, and also import other style files */`;
|
|
11
|
+
const fontImport = `@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';`;
|
|
12
|
+
const body = `
|
|
13
|
+
$basepath: '/';
|
|
14
|
+
@include web-fonts($basepath);
|
|
15
|
+
`;
|
|
16
|
+
exports.stylesScss = `${comment}
|
|
17
|
+
${fontImport}
|
|
18
|
+
|
|
19
|
+
${body}`;
|
|
20
|
+
exports.fontAssetBlock = {
|
|
21
|
+
glob: '**/*',
|
|
22
|
+
input: './node_modules/@ihk-gfi/lux-components-icons-and-fonts/assets/fonts/',
|
|
23
|
+
output: './assets/fonts'
|
|
24
|
+
};
|
|
25
|
+
function update140300(options) {
|
|
26
|
+
return (_tree, _context) => {
|
|
27
|
+
return (0, schematics_1.chain)([
|
|
28
|
+
(0, util_1.messageInfoRule)(`Die LUX-Components werden auf die Version 14.3.0 aktualisiert...`),
|
|
29
|
+
(0, util_1.messageInfoRule)(`Die Datei "package.json" wird angepasst...`),
|
|
30
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components', '14.3.0', false),
|
|
31
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components-theme', '14.4.0', false),
|
|
32
|
+
(0, index_1.updateDep)('@ihk-gfi/lux-components-icons-and-fonts', '1.4.0', false),
|
|
33
|
+
updateAngularJson(options),
|
|
34
|
+
updateStylesScss(options),
|
|
35
|
+
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 14.3.0 aktualisiert.`),
|
|
36
|
+
(0, util_1.finish)(true, `${chalk.yellowBright('Fertig!')}`)
|
|
37
|
+
]);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.update140300 = update140300;
|
|
41
|
+
function updateStylesScss(options) {
|
|
42
|
+
return (0, schematics_1.chain)([
|
|
43
|
+
(0, util_1.messageInfoRule)(`Die Fonts werden in der Datei "styles.scss" ergänzt...`),
|
|
44
|
+
(tree, _context) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const filePath = ((_a = options.path) !== null && _a !== void 0 ? _a : '.') + '/src/styles.scss';
|
|
47
|
+
if (!tree.exists(filePath)) {
|
|
48
|
+
throw Error(`Die Datei ${filePath} konnte nicht gefunden werden.`);
|
|
49
|
+
}
|
|
50
|
+
const lines = tree.read(filePath).toString().split('\n');
|
|
51
|
+
let resultLines = [];
|
|
52
|
+
if (lines.length > 0) {
|
|
53
|
+
if (lines[0].trim().startsWith('/*') && lines[0].endsWith('*/')) {
|
|
54
|
+
resultLines = [lines[0], fontImport, ...lines.slice(1, lines.length - 1), body];
|
|
55
|
+
}
|
|
56
|
+
else if (lines[0].trim() === '') {
|
|
57
|
+
resultLines = [fontImport, ...lines.slice(1, lines.length - 1), body];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
resultLines = [fontImport, ...lines, body];
|
|
61
|
+
}
|
|
62
|
+
tree.overwrite(filePath, resultLines.join('\n'));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
tree.overwrite(filePath, exports.stylesScss);
|
|
66
|
+
}
|
|
67
|
+
(0, logging_1.logInfo)(fontImport);
|
|
68
|
+
(0, logging_1.logInfo)(body.replace(/\r?\n/gm, '\n '));
|
|
69
|
+
},
|
|
70
|
+
(0, util_1.messageSuccessRule)(`Die Fonts wurden in der Datei "styles.scss" ergänzt.`)
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
exports.updateStylesScss = updateStylesScss;
|
|
74
|
+
function updateAngularJson(options) {
|
|
75
|
+
const assetPath = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
|
|
76
|
+
const testAssetPath = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
|
|
77
|
+
return (0, schematics_1.chain)([
|
|
78
|
+
(0, util_1.messageInfoRule)(`Die Fonts werden in den Asset-Abschnitten ergänzt...`),
|
|
79
|
+
(0, json_1.updateJsonArray)('/angular.json', assetPath, exports.fontAssetBlock),
|
|
80
|
+
(0, json_1.updateJsonArray)('/angular.json', testAssetPath, exports.fontAssetBlock),
|
|
81
|
+
(0, util_1.messageSuccessRule)(`Die Fonts wurden in den Asset-Abschnitten ergänzt.`)
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
exports.updateAngularJson = updateAngularJson;
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,+BAA+B;AAC/B,2DAA4D;AAC5D,6CAAqD;AACrD,mDAAgD;AAChD,6CAAiF;AAEjF,MAAM,OAAO,GAAG,iFAAiF,CAAC;AAClG,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,MAAM,IAAI,GAAG;;;CAGZ,CAAC;AAEW,QAAA,UAAU,GAAG,GAAG,OAAO;EAClC,UAAU;;EAEV,IAAI,EAAE,CAAC;AAEI,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,sEAAsE;IAC7E,MAAM,EAAE,gBAAgB;CACzB,CAAC;AAEF,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,CAAC,KAAW,EAAE,QAA0B,EAAE,EAAE;QACjD,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAe,EAAC,kEAAkE,CAAC;YACnF,IAAA,sBAAe,EAAC,4CAA4C,CAAC;YAC7D,IAAA,iBAAS,EAAC,yBAAyB,EAAE,QAAQ,EAAE,KAAK,CAAC;YACrD,IAAA,iBAAS,EAAC,+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kB,EAAC,oDAAoD,CAAC;KACzE,CAAC,CAAC;AACL,CAAC;AAVD,8CAUC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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 { logInfo } from '../../utility/logging';
|
|
6
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../../utility/util';
|
|
7
|
+
|
|
8
|
+
const comment = `/* You can add global styles to this file, and also import other style files */`;
|
|
9
|
+
const fontImport = `@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';`;
|
|
10
|
+
const body = `
|
|
11
|
+
$basepath: '/';
|
|
12
|
+
@include web-fonts($basepath);
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
export const stylesScss = `${comment}
|
|
16
|
+
${fontImport}
|
|
17
|
+
|
|
18
|
+
${body}`;
|
|
19
|
+
|
|
20
|
+
export const fontAssetBlock = {
|
|
21
|
+
glob: '**/*',
|
|
22
|
+
input: './node_modules/@ihk-gfi/lux-components-icons-and-fonts/assets/fonts/',
|
|
23
|
+
output: './assets/fonts'
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function update140300(options: any): Rule {
|
|
27
|
+
return (_tree: Tree, _context: SchematicContext) => {
|
|
28
|
+
return chain([
|
|
29
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 14.3.0 aktualisiert...`),
|
|
30
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
31
|
+
updateDep('@ihk-gfi/lux-components', '14.3.0', false),
|
|
32
|
+
updateDep('@ihk-gfi/lux-components-theme', '14.4.0', false),
|
|
33
|
+
updateDep('@ihk-gfi/lux-components-icons-and-fonts', '1.4.0', false),
|
|
34
|
+
updateAngularJson(options),
|
|
35
|
+
updateStylesScss(options),
|
|
36
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 14.3.0 aktualisiert.`),
|
|
37
|
+
finish(true, `${chalk.yellowBright('Fertig!')}`)
|
|
38
|
+
]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function updateStylesScss(options: any): Rule {
|
|
43
|
+
return chain([
|
|
44
|
+
messageInfoRule(`Die Fonts werden in der Datei "styles.scss" ergänzt...`),
|
|
45
|
+
(tree: Tree, _context: SchematicContext) => {
|
|
46
|
+
const filePath = (options.path ?? '.') + '/src/styles.scss';
|
|
47
|
+
|
|
48
|
+
if (!tree.exists(filePath)) {
|
|
49
|
+
throw Error(`Die Datei ${filePath} konnte nicht gefunden werden.`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const lines = tree.read(filePath)!.toString().split('\n');
|
|
53
|
+
|
|
54
|
+
let resultLines = [];
|
|
55
|
+
if (lines.length > 0) {
|
|
56
|
+
if (lines[0].trim().startsWith('/*') && lines[0].endsWith('*/')) {
|
|
57
|
+
resultLines = [lines[0], fontImport, ...lines.slice(1, lines.length - 1), body];
|
|
58
|
+
} else if (lines[0].trim() === '') {
|
|
59
|
+
resultLines = [fontImport, ...lines.slice(1, lines.length - 1), body];
|
|
60
|
+
} else {
|
|
61
|
+
resultLines = [fontImport, ...lines, body];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
tree.overwrite(filePath, resultLines.join('\n'));
|
|
65
|
+
} else {
|
|
66
|
+
tree.overwrite(filePath, stylesScss);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
logInfo(fontImport);
|
|
70
|
+
logInfo(body.replace(/\r?\n/gm, '\n '));
|
|
71
|
+
},
|
|
72
|
+
messageSuccessRule(`Die Fonts wurden in der Datei "styles.scss" ergänzt.`)
|
|
73
|
+
]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function updateAngularJson(options: any): Rule {
|
|
77
|
+
const assetPath = ['projects', options.project, 'architect', 'build', 'options', 'assets'];
|
|
78
|
+
const testAssetPath = ['projects', options.project, 'architect', 'test', 'options', 'assets'];
|
|
79
|
+
|
|
80
|
+
return chain([
|
|
81
|
+
messageInfoRule(`Die Fonts werden in den Asset-Abschnitten ergänzt...`),
|
|
82
|
+
updateJsonArray('/angular.json', assetPath, fontAssetBlock),
|
|
83
|
+
updateJsonArray('/angular.json', testAssetPath, fontAssetBlock),
|
|
84
|
+
messageSuccessRule(`Die Fonts wurden in den Asset-Abschnitten ergänzt.`)
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
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('update140300', () => {
|
|
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.3.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] update140300', () => {
|
|
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.2.0",
|
|
53
|
+
"@ihk-gfi/lux-components-theme": "14.2.0",
|
|
54
|
+
"@angular/compiler": "14.3.7",
|
|
55
|
+
"@ihk-gfi/lux-components-icons-and-fonts": "1.3.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.update140300)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => {
|
|
64
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).not.toEqual('14.2.0');
|
|
65
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).toEqual('14.3.0');
|
|
66
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-theme').version).not.toEqual('14.2.0');
|
|
67
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('14.4.0');
|
|
68
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).not.toEqual('1.3.0');
|
|
69
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).toEqual('1.4.0');
|
|
70
|
+
done();
|
|
71
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('[Rule] updateStylesScss', () => {
|
|
75
|
+
it('Sollte die Datei "styles.scss" aktualisieren 01', (done) => {
|
|
76
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
77
|
+
appTree.overwrite(filePath, updateStylesScssInit01);
|
|
78
|
+
(0, schematics_1.callRule)((0, index_1.updateStylesScss)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe((success) => {
|
|
79
|
+
var _a;
|
|
80
|
+
const content = (_a = success.read(filePath)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
81
|
+
expect(content).toEqual(updateStylesScssResult01);
|
|
82
|
+
done();
|
|
83
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
84
|
+
});
|
|
85
|
+
it('Sollte die Datei "styles.scss" aktualisieren 02', (done) => {
|
|
86
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
87
|
+
appTree.overwrite(filePath, updateStylesScssInit02);
|
|
88
|
+
(0, schematics_1.callRule)((0, index_1.updateStylesScss)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe((success) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const content = (_a = success.read(filePath)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
91
|
+
expect(content).toEqual(updateStylesScssResult02);
|
|
92
|
+
done();
|
|
93
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
94
|
+
});
|
|
95
|
+
it('Sollte die Datei "styles.scss" aktualisieren 03', (done) => {
|
|
96
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
97
|
+
appTree.overwrite(filePath, updateStylesScssInit03);
|
|
98
|
+
(0, schematics_1.callRule)((0, index_1.updateStylesScss)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe((success) => {
|
|
99
|
+
var _a;
|
|
100
|
+
const content = (_a = success.read(filePath)) === null || _a === void 0 ? void 0 : _a.toString();
|
|
101
|
+
expect(content).toEqual(updateStylesScssResult03);
|
|
102
|
+
done();
|
|
103
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
104
|
+
});
|
|
105
|
+
it('Sollte einen Fehler werfen, wenn die Datei "styles.scss" fehlt', (done) => {
|
|
106
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
107
|
+
appTree.delete(filePath);
|
|
108
|
+
(0, schematics_1.callRule)((0, index_1.updateStylesScss)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => { }, (reason) => {
|
|
109
|
+
expect(reason).toEqual(new Error(`Die Datei ${filePath} konnte nicht gefunden werden.`));
|
|
110
|
+
done();
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
const updateStylesScssInit01 = `/* You can add global styles to this file, and also import other style files */
|
|
116
|
+
`;
|
|
117
|
+
const updateStylesScssResult01 = `/* You can add global styles to this file, and also import other style files */
|
|
118
|
+
@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
119
|
+
|
|
120
|
+
$basepath: '/';
|
|
121
|
+
@include web-fonts($basepath);
|
|
122
|
+
`;
|
|
123
|
+
const updateStylesScssInit02 = ``;
|
|
124
|
+
const updateStylesScssResult02 = `@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
125
|
+
|
|
126
|
+
$basepath: '/';
|
|
127
|
+
@include web-fonts($basepath);
|
|
128
|
+
`;
|
|
129
|
+
const updateStylesScssInit03 = `/* You can add global styles to this file, and also import other style files */
|
|
130
|
+
|
|
131
|
+
.test {
|
|
132
|
+
width: 12px;
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
const updateStylesScssResult03 = `/* You can add global styles to this file, and also import other style files */
|
|
136
|
+
@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
137
|
+
|
|
138
|
+
.test {
|
|
139
|
+
width: 12px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
$basepath: '/';
|
|
143
|
+
@include web-fonts($basepath);
|
|
144
|
+
`;
|
|
145
|
+
//# 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,mCAAyD;AAEzD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;AAErE,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,IAAI,OAAqB,CAAC;IAC1B,IAAI,MAA2B,CAAC;IAChC,IAAI,OAAyB,CAAC;IAE9B,MAAM,WAAW,GAAQ,EAAE,CAAC;IAE5B,UAAU,CAAC,G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wBAAwB,GAAG;;;;;;;;;CAShC,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
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 { update140300, updateStylesScss } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update140300', () => {
|
|
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.3.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] update140300', () => {
|
|
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.2.0",
|
|
53
|
+
"@ihk-gfi/lux-components-theme": "14.2.0",
|
|
54
|
+
"@angular/compiler": "14.3.7",
|
|
55
|
+
"@ihk-gfi/lux-components-icons-and-fonts": "1.3.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(update140300(testOptions), observableOf(appTree), context).subscribe(
|
|
66
|
+
() => {
|
|
67
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).not.toEqual('14.2.0');
|
|
68
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('14.3.0');
|
|
69
|
+
|
|
70
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).not.toEqual('14.2.0');
|
|
71
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('14.4.0');
|
|
72
|
+
|
|
73
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).not.toEqual('1.3.0');
|
|
74
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-icons-and-fonts').version).toEqual('1.4.0');
|
|
75
|
+
done();
|
|
76
|
+
},
|
|
77
|
+
(reason) => expect(reason).toBeUndefined()
|
|
78
|
+
);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('[Rule] updateStylesScss', () => {
|
|
83
|
+
it('Sollte die Datei "styles.scss" aktualisieren 01', (done) => {
|
|
84
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
85
|
+
appTree.overwrite(filePath, updateStylesScssInit01);
|
|
86
|
+
|
|
87
|
+
callRule(updateStylesScss(testOptions), observableOf(appTree), context).subscribe(
|
|
88
|
+
(success) => {
|
|
89
|
+
const content = success.read(filePath)?.toString();
|
|
90
|
+
|
|
91
|
+
expect(content).toEqual(updateStylesScssResult01);
|
|
92
|
+
done();
|
|
93
|
+
},
|
|
94
|
+
(reason) => expect(reason).toBeUndefined()
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('Sollte die Datei "styles.scss" aktualisieren 02', (done) => {
|
|
99
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
100
|
+
appTree.overwrite(filePath, updateStylesScssInit02);
|
|
101
|
+
|
|
102
|
+
callRule(updateStylesScss(testOptions), observableOf(appTree), context).subscribe(
|
|
103
|
+
(success) => {
|
|
104
|
+
const content = success.read(filePath)?.toString();
|
|
105
|
+
|
|
106
|
+
expect(content).toEqual(updateStylesScssResult02);
|
|
107
|
+
done();
|
|
108
|
+
},
|
|
109
|
+
(reason) => expect(reason).toBeUndefined()
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
it('Sollte die Datei "styles.scss" aktualisieren 03', (done) => {
|
|
114
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
115
|
+
appTree.overwrite(filePath, updateStylesScssInit03);
|
|
116
|
+
|
|
117
|
+
callRule(updateStylesScss(testOptions), observableOf(appTree), context).subscribe(
|
|
118
|
+
(success) => {
|
|
119
|
+
const content = success.read(filePath)?.toString();
|
|
120
|
+
|
|
121
|
+
expect(content).toEqual(updateStylesScssResult03);
|
|
122
|
+
done();
|
|
123
|
+
},
|
|
124
|
+
(reason) => expect(reason).toBeUndefined()
|
|
125
|
+
);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('Sollte einen Fehler werfen, wenn die Datei "styles.scss" fehlt', (done) => {
|
|
129
|
+
const filePath = testOptions.path + '/src/styles.scss';
|
|
130
|
+
appTree.delete(filePath);
|
|
131
|
+
|
|
132
|
+
callRule(updateStylesScss(testOptions), observableOf(appTree), context).subscribe(
|
|
133
|
+
() => {},
|
|
134
|
+
(reason) => {
|
|
135
|
+
expect(reason).toEqual(new Error(`Die Datei ${filePath} konnte nicht gefunden werden.`));
|
|
136
|
+
done();
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const updateStylesScssInit01 = `/* You can add global styles to this file, and also import other style files */
|
|
144
|
+
`;
|
|
145
|
+
|
|
146
|
+
const updateStylesScssResult01 = `/* You can add global styles to this file, and also import other style files */
|
|
147
|
+
@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
148
|
+
|
|
149
|
+
$basepath: '/';
|
|
150
|
+
@include web-fonts($basepath);
|
|
151
|
+
`;
|
|
152
|
+
|
|
153
|
+
const updateStylesScssInit02 = ``;
|
|
154
|
+
|
|
155
|
+
const updateStylesScssResult02 = `@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
156
|
+
|
|
157
|
+
$basepath: '/';
|
|
158
|
+
@include web-fonts($basepath);
|
|
159
|
+
`;
|
|
160
|
+
|
|
161
|
+
const updateStylesScssInit03 = `/* You can add global styles to this file, and also import other style files */
|
|
162
|
+
|
|
163
|
+
.test {
|
|
164
|
+
width: 12px;
|
|
165
|
+
}
|
|
166
|
+
`;
|
|
167
|
+
|
|
168
|
+
const updateStylesScssResult03 = `/* You can add global styles to this file, and also import other style files */
|
|
169
|
+
@import '@ihk-gfi/lux-components-theme/src/base/luxfonts';
|
|
170
|
+
|
|
171
|
+
.test {
|
|
172
|
+
width: 12px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
$basepath: '/';
|
|
176
|
+
@include web-fonts($basepath);
|
|
177
|
+
`;
|
|
@@ -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
|
+
}
|