@ihk-gfi/lux-components-update 13.1.0 → 13.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 +10 -0
- package/src/updates/update130200/index.d.ts +2 -0
- package/src/updates/update130200/index.js +43 -0
- package/src/updates/update130200/index.js.map +1 -0
- package/src/updates/update130200/index.ts +41 -0
- package/src/updates/update130200/index_spec.d.ts +1 -0
- package/src/updates/update130200/index_spec.js +106 -0
- package/src/updates/update130200/index_spec.js.map +1 -0
- package/src/updates/update130200/index_spec.ts +110 -0
- package/src/updates/update130200/schema.json +23 -0
- package/src/updates/update130300/index.d.ts +2 -0
- package/src/updates/update130300/index.js +35 -0
- package/src/updates/update130300/index.js.map +1 -0
- package/src/updates/update130300/index.ts +32 -0
- package/src/updates/update130300/index_spec.d.ts +1 -0
- package/src/updates/update130300/index_spec.js +85 -0
- package/src/updates/update130300/index_spec.js.map +1 -0
- package/src/updates/update130300/index_spec.ts +89 -0
- package/src/updates/update130300/schema.json +23 -0
- package/src/utility/json.js +4 -1
- package/src/utility/json.js.map +1 -1
- package/src/utility/json.ts +5 -2
package/package.json
CHANGED
package/src/collection.json
CHANGED
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
"factory": "./updates/update130000/index#update",
|
|
7
7
|
"schema": "./updates/update130000/schema.json"
|
|
8
8
|
},
|
|
9
|
+
"update-13.3.0": {
|
|
10
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 13.3.0",
|
|
11
|
+
"factory": "./updates/update130300/index#update130300",
|
|
12
|
+
"schema": "./updates/update130300/schema.json"
|
|
13
|
+
},
|
|
14
|
+
"update-13.2.0": {
|
|
15
|
+
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 13.2.0",
|
|
16
|
+
"factory": "./updates/update130200/index#update130200",
|
|
17
|
+
"schema": "./updates/update130200/schema.json"
|
|
18
|
+
},
|
|
9
19
|
"update-13.1.0": {
|
|
10
20
|
"description": "Aktualisiert das LUX-Componentsprojekt auf die Version 13.1.0",
|
|
11
21
|
"factory": "./updates/update130100/index#update130100",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update130200 = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const json_1 = require("../../utility/json");
|
|
7
|
+
const util_1 = require("../../utility/util");
|
|
8
|
+
function update130200(options) {
|
|
9
|
+
return (tree, context) => {
|
|
10
|
+
const filePath = '/package.json';
|
|
11
|
+
return (0, schematics_1.chain)([
|
|
12
|
+
(0, util_1.messageInfoRule)(`Die LUX-Components werden auf die Version 13.2.0 aktualisiert...`),
|
|
13
|
+
(0, util_1.messageInfoRule)(`Die Datei "package.json" wird angepasst...`),
|
|
14
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@ihk-gfi/lux-components'], '13.2.0', true),
|
|
15
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/animations'], '13.3.11', true),
|
|
16
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/cdk'], '13.3.9', true),
|
|
17
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/common'], '13.3.11', true),
|
|
18
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/compiler'], '13.3.11', true),
|
|
19
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/core'], '13.3.11', true),
|
|
20
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/forms'], '13.3.11', true),
|
|
21
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/localize'], '13.3.11', true),
|
|
22
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/material'], '13.3.9', true),
|
|
23
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/platform-browser'], '13.3.11', true),
|
|
24
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/platform-browser-dynamic'], '13.3.11', true),
|
|
25
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/router'], '13.3.11', true),
|
|
26
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-devkit/build-angular'], '13.3.9', true),
|
|
27
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-eslint/builder'], '13.5.0', true),
|
|
28
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-eslint/eslint-plugin'], '13.5.0', true),
|
|
29
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-eslint/eslint-plugin-template'], '13.5.0', true),
|
|
30
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-eslint/schematics'], '13.5.0', true),
|
|
31
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-eslint/template-parser'], '13.5.0', true),
|
|
32
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/cli'], '13.3.9', true),
|
|
33
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/compiler-cli'], '13.3.11', true),
|
|
34
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/elements'], '13.3.11', true),
|
|
35
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/language-service'], '13.3.11', true),
|
|
36
|
+
(0, util_1.messageSuccessRule)(`Die Datei "package.json" wurde angepasst.`),
|
|
37
|
+
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 13.2.0 aktualisiert.`),
|
|
38
|
+
(0, util_1.finish)(true, `${chalk.yellowBright('Fertig!')}`)
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.update130200 = update130200;
|
|
43
|
+
//# source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IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,cAAc,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YACpF,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YAC9F,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YAC1F,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YAClG,IAAA,yBAAkB,EAAC,2CAA2C,CAAC;YAE/D,IAAA,yBAAkB,EAAC,gEAAgE,CAAC;YACpF,IAAA,aAAM,EAAC,IAAI,EAAC,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;SAChD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAnCD,oCAmCC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { updateJsonValue } from '../../utility/json';
|
|
4
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../../utility/util';
|
|
5
|
+
|
|
6
|
+
export function update130200(options: any): Rule {
|
|
7
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
8
|
+
const filePath = '/package.json';
|
|
9
|
+
return chain([
|
|
10
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 13.2.0 aktualisiert...`),
|
|
11
|
+
|
|
12
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
13
|
+
updateJsonValue(null, filePath, ['dependencies', '@ihk-gfi/lux-components'], '13.2.0', true),
|
|
14
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/animations'], '13.3.11', true),
|
|
15
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/cdk'], '13.3.9', true),
|
|
16
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/common'], '13.3.11', true),
|
|
17
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/compiler'], '13.3.11', true),
|
|
18
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/core'], '13.3.11', true),
|
|
19
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/forms'], '13.3.11', true),
|
|
20
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/localize'], '13.3.11', true),
|
|
21
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/material'], '13.3.9', true),
|
|
22
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/platform-browser'], '13.3.11', true),
|
|
23
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/platform-browser-dynamic'], '13.3.11', true),
|
|
24
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/router'], '13.3.11', true),
|
|
25
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-devkit/build-angular'], '13.3.9', true),
|
|
26
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-eslint/builder'], '13.5.0', true),
|
|
27
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-eslint/eslint-plugin'], '13.5.0', true),
|
|
28
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-eslint/eslint-plugin-template'], '13.5.0', true),
|
|
29
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-eslint/schematics'], '13.5.0', true),
|
|
30
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-eslint/template-parser'], '13.5.0', true),
|
|
31
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/cli'], '13.3.9', true),
|
|
32
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/compiler-cli'], '13.3.11', true),
|
|
33
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/elements'], '13.3.11', true),
|
|
34
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/language-service'], '13.3.11', true),
|
|
35
|
+
messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
36
|
+
|
|
37
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 13.2.0 aktualisiert.`),
|
|
38
|
+
finish(true,`${chalk.yellowBright('Fertig!')}`)
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
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('update130200', () => {
|
|
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
|
|
30
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', test_1.appOptions, appTree)
|
|
31
|
+
.toPromise();
|
|
32
|
+
util_1.UtilConfig.defaultWaitMS = 0;
|
|
33
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
34
|
+
const schematic = runner.engine.createSchematic('update-13.2.0', collection);
|
|
35
|
+
context = runner.engine.createContext(schematic);
|
|
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] update130200', () => {
|
|
41
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
42
|
+
appTree.overwrite('/package.json', `
|
|
43
|
+
{
|
|
44
|
+
"name": "Lorem ipsum",
|
|
45
|
+
"version": "0.0.32",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ihk-gfi/lux-components": "13.1.0",
|
|
52
|
+
"@angular/animations": "13.3.7",
|
|
53
|
+
"@angular/cdk": "13.3.7",
|
|
54
|
+
"@angular/common": "13.3.7",
|
|
55
|
+
"@angular/compiler": "13.3.7",
|
|
56
|
+
"@angular/core": "13.3.7",
|
|
57
|
+
"@angular/forms": "13.3.7",
|
|
58
|
+
"@angular/localize": "13.3.7",
|
|
59
|
+
"@angular/material": "13.3.7",
|
|
60
|
+
"@angular/platform-browser": "13.3.7",
|
|
61
|
+
"@angular/platform-browser-dynamic": "13.3.7",
|
|
62
|
+
"@angular/router": "13.3.7"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@angular-devkit/build-angular": "13.3.5",
|
|
66
|
+
"@angular-eslint/builder": "13.2.1",
|
|
67
|
+
"@angular-eslint/eslint-plugin": "13.2.1",
|
|
68
|
+
"@angular-eslint/eslint-plugin-template": "13.2.1",
|
|
69
|
+
"@angular-eslint/schematics": "13.2.1",
|
|
70
|
+
"@angular-eslint/template-parser": "13.2.1",
|
|
71
|
+
"@angular/cli": "13.3.5",
|
|
72
|
+
"@angular/compiler-cli": "13.3.7",
|
|
73
|
+
"@angular/elements": "13.3.7",
|
|
74
|
+
"@angular/language-service": "13.3.7"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`);
|
|
78
|
+
(0, schematics_1.callRule)((0, index_1.update130200)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => {
|
|
79
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).toEqual('13.2.0');
|
|
80
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-devkit/build-angular').version).toEqual('13.3.9');
|
|
81
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-eslint/builder').version).toEqual('13.5.0');
|
|
82
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-eslint/eslint-plugin').version).toEqual('13.5.0');
|
|
83
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-eslint/eslint-plugin-template').version).toEqual('13.5.0');
|
|
84
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-eslint/schematics').version).toEqual('13.5.0');
|
|
85
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular-eslint/template-parser').version).toEqual('13.5.0');
|
|
86
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/animations').version).toEqual('13.3.11');
|
|
87
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/cdk').version).toEqual('13.3.9');
|
|
88
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/cli').version).toEqual('13.3.9');
|
|
89
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/common').version).toEqual('13.3.11');
|
|
90
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/compiler').version).toEqual('13.3.11');
|
|
91
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/compiler-cli').version).toEqual('13.3.11');
|
|
92
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/core').version).toEqual('13.3.11');
|
|
93
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/elements').version).toEqual('13.3.11');
|
|
94
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/forms').version).toEqual('13.3.11');
|
|
95
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/language-service').version).toEqual('13.3.11');
|
|
96
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/localize').version).toEqual('13.3.11');
|
|
97
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/material').version).toEqual('13.3.9');
|
|
98
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/platform-browser').version).toEqual('13.3.11');
|
|
99
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/platform-browser-dynamic').version).toEqual('13.3.11');
|
|
100
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@angular/router').version).toEqual('13.3.11');
|
|
101
|
+
done();
|
|
102
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
//# sourceMappingURL=index_spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index_spec.js","sourceRoot":"","sources":["index_spec.ts"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BAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAC1F,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACzF,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,2BAA2B,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAClG,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,mCAAmC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBAC1G,MAAM,CAAC,IAAA,uCAAwB,EAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBACxF,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,110 @@
|
|
|
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 { update130200 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update130200', () => {
|
|
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
|
|
24
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
|
|
25
|
+
.toPromise();
|
|
26
|
+
|
|
27
|
+
UtilConfig.defaultWaitMS = 0;
|
|
28
|
+
|
|
29
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
30
|
+
const schematic = runner.engine.createSchematic('update-13.2.0', collection);
|
|
31
|
+
context = runner.engine.createContext(schematic);
|
|
32
|
+
|
|
33
|
+
testOptions.project = appOptions.name;
|
|
34
|
+
testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
|
|
35
|
+
testOptions.verbose = true;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('[Rule] update130200', () => {
|
|
39
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
40
|
+
appTree.overwrite(
|
|
41
|
+
'/package.json',
|
|
42
|
+
`
|
|
43
|
+
{
|
|
44
|
+
"name": "Lorem ipsum",
|
|
45
|
+
"version": "0.0.32",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ihk-gfi/lux-components": "13.1.0",
|
|
52
|
+
"@angular/animations": "13.3.7",
|
|
53
|
+
"@angular/cdk": "13.3.7",
|
|
54
|
+
"@angular/common": "13.3.7",
|
|
55
|
+
"@angular/compiler": "13.3.7",
|
|
56
|
+
"@angular/core": "13.3.7",
|
|
57
|
+
"@angular/forms": "13.3.7",
|
|
58
|
+
"@angular/localize": "13.3.7",
|
|
59
|
+
"@angular/material": "13.3.7",
|
|
60
|
+
"@angular/platform-browser": "13.3.7",
|
|
61
|
+
"@angular/platform-browser-dynamic": "13.3.7",
|
|
62
|
+
"@angular/router": "13.3.7"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@angular-devkit/build-angular": "13.3.5",
|
|
66
|
+
"@angular-eslint/builder": "13.2.1",
|
|
67
|
+
"@angular-eslint/eslint-plugin": "13.2.1",
|
|
68
|
+
"@angular-eslint/eslint-plugin-template": "13.2.1",
|
|
69
|
+
"@angular-eslint/schematics": "13.2.1",
|
|
70
|
+
"@angular-eslint/template-parser": "13.2.1",
|
|
71
|
+
"@angular/cli": "13.3.5",
|
|
72
|
+
"@angular/compiler-cli": "13.3.7",
|
|
73
|
+
"@angular/elements": "13.3.7",
|
|
74
|
+
"@angular/language-service": "13.3.7"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
callRule(update130200(testOptions), observableOf(appTree), context).subscribe(
|
|
81
|
+
() => {
|
|
82
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('13.2.0');
|
|
83
|
+
expect(getPackageJsonDependency(appTree, '@angular-devkit/build-angular').version).toEqual('13.3.9');
|
|
84
|
+
expect(getPackageJsonDependency(appTree, '@angular-eslint/builder').version).toEqual('13.5.0');
|
|
85
|
+
expect(getPackageJsonDependency(appTree, '@angular-eslint/eslint-plugin').version).toEqual('13.5.0');
|
|
86
|
+
expect(getPackageJsonDependency(appTree, '@angular-eslint/eslint-plugin-template').version).toEqual('13.5.0');
|
|
87
|
+
expect(getPackageJsonDependency(appTree, '@angular-eslint/schematics').version).toEqual('13.5.0');
|
|
88
|
+
expect(getPackageJsonDependency(appTree, '@angular-eslint/template-parser').version).toEqual('13.5.0');
|
|
89
|
+
expect(getPackageJsonDependency(appTree, '@angular/animations').version).toEqual('13.3.11');
|
|
90
|
+
expect(getPackageJsonDependency(appTree, '@angular/cdk').version).toEqual('13.3.9');
|
|
91
|
+
expect(getPackageJsonDependency(appTree, '@angular/cli').version).toEqual('13.3.9');
|
|
92
|
+
expect(getPackageJsonDependency(appTree, '@angular/common').version).toEqual('13.3.11');
|
|
93
|
+
expect(getPackageJsonDependency(appTree, '@angular/compiler').version).toEqual('13.3.11');
|
|
94
|
+
expect(getPackageJsonDependency(appTree, '@angular/compiler-cli').version).toEqual('13.3.11');
|
|
95
|
+
expect(getPackageJsonDependency(appTree, '@angular/core').version).toEqual('13.3.11');
|
|
96
|
+
expect(getPackageJsonDependency(appTree, '@angular/elements').version).toEqual('13.3.11');
|
|
97
|
+
expect(getPackageJsonDependency(appTree, '@angular/forms').version).toEqual('13.3.11');
|
|
98
|
+
expect(getPackageJsonDependency(appTree, '@angular/language-service').version).toEqual('13.3.11');
|
|
99
|
+
expect(getPackageJsonDependency(appTree, '@angular/localize').version).toEqual('13.3.11');
|
|
100
|
+
expect(getPackageJsonDependency(appTree, '@angular/material').version).toEqual('13.3.9');
|
|
101
|
+
expect(getPackageJsonDependency(appTree, '@angular/platform-browser').version).toEqual('13.3.11');
|
|
102
|
+
expect(getPackageJsonDependency(appTree, '@angular/platform-browser-dynamic').version).toEqual('13.3.11');
|
|
103
|
+
expect(getPackageJsonDependency(appTree, '@angular/router').version).toEqual('13.3.11');
|
|
104
|
+
done();
|
|
105
|
+
},
|
|
106
|
+
(reason) => expect(reason).toBeUndefined()
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
});
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update130300 = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const json_1 = require("../../utility/json");
|
|
7
|
+
const util_1 = require("../../utility/util");
|
|
8
|
+
function update130300(options) {
|
|
9
|
+
return (tree, context) => {
|
|
10
|
+
const filePath = '/package.json';
|
|
11
|
+
return (0, schematics_1.chain)([
|
|
12
|
+
(0, util_1.messageInfoRule)(`Die LUX-Components werden auf die Version 13.3.0 aktualisiert...`),
|
|
13
|
+
(0, util_1.messageInfoRule)(`Die Datei "package.json" wird angepasst...`),
|
|
14
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@ihk-gfi/lux-components'], '13.3.0', true),
|
|
15
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular-devkit/build-angular'], '13.3.10', true),
|
|
16
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/animations'], '13.3.12', true),
|
|
17
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/cli'], '13.3.10', true),
|
|
18
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/common'], '13.3.12', true),
|
|
19
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/compiler'], '13.3.12', true),
|
|
20
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/compiler-cli'], '13.3.12', true),
|
|
21
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/core'], '13.3.12', true),
|
|
22
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/elements'], '13.3.12', true),
|
|
23
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/forms'], '13.3.12', true),
|
|
24
|
+
(0, json_1.updateJsonValue)(null, filePath, ['devDependencies', '@angular/language-service'], '13.3.12', true),
|
|
25
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/localize'], '13.3.12', true),
|
|
26
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/platform-browser'], '13.3.12', true),
|
|
27
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/platform-browser-dynamic'], '13.3.12', true),
|
|
28
|
+
(0, json_1.updateJsonValue)(null, filePath, ['dependencies', '@angular/router'], '13.3.12', true), (0, util_1.messageSuccessRule)(`Die Datei "package.json" wurde angepasst.`),
|
|
29
|
+
(0, util_1.messageSuccessRule)(`Die LUX-Components wurden auf die Version 13.2.0 aktualisiert.`),
|
|
30
|
+
(0, util_1.finish)(true, `${chalk.yellowBright('Fertig!')}`)
|
|
31
|
+
]);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
exports.update130300 = update130300;
|
|
35
|
+
//# 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,6CAAqD;AACrD,6CAAiF;AAEjF,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,QAAQ,GAAG,eAAe,CAAC;QACjC,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAe,E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,EAAE,QAAQ,EAAE,CAAC,iBAAiB,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YAClG,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YACvF,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,2BAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YAC/F,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,mCAAmC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC;YACvG,IAAA,sBAAe,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAC,IAAA,yBAAkB,EAAC,2CAA2C,CAAC;YACrJ,IAAA,yBAAkB,EAAC,gEAAgE,CAAC;YACpF,IAAA,aAAM,EAAC,IAAI,EAAC,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;SAChD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AA1BD,oCA0BC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { updateJsonValue } from '../../utility/json';
|
|
4
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../../utility/util';
|
|
5
|
+
|
|
6
|
+
export function update130300(options: any): Rule {
|
|
7
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
8
|
+
const filePath = '/package.json';
|
|
9
|
+
return chain([
|
|
10
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 13.3.0 aktualisiert...`),
|
|
11
|
+
|
|
12
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
13
|
+
updateJsonValue(null, filePath, ['dependencies', '@ihk-gfi/lux-components'], '13.3.0', true),
|
|
14
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular-devkit/build-angular'], '13.3.10', true),
|
|
15
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/animations'], '13.3.12', true),
|
|
16
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/cli'], '13.3.10', true),
|
|
17
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/common'], '13.3.12', true),
|
|
18
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/compiler'], '13.3.12', true),
|
|
19
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/compiler-cli'], '13.3.12', true),
|
|
20
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/core'], '13.3.12', true),
|
|
21
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/elements'], '13.3.12', true),
|
|
22
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/forms'], '13.3.12', true),
|
|
23
|
+
updateJsonValue(null, filePath, ['devDependencies', '@angular/language-service'], '13.3.12', true),
|
|
24
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/localize'], '13.3.12', true),
|
|
25
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/platform-browser'], '13.3.12', true),
|
|
26
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/platform-browser-dynamic'], '13.3.12', true),
|
|
27
|
+
updateJsonValue(null, filePath, ['dependencies', '@angular/router'], '13.3.12', true),messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
28
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 13.2.0 aktualisiert.`),
|
|
29
|
+
finish(true,`${chalk.yellowBright('Fertig!')}`)
|
|
30
|
+
]);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
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('update130300', () => {
|
|
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
|
|
30
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', test_1.appOptions, appTree)
|
|
31
|
+
.toPromise();
|
|
32
|
+
util_1.UtilConfig.defaultWaitMS = 0;
|
|
33
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
34
|
+
const schematic = runner.engine.createSchematic('update-13.3.0', collection);
|
|
35
|
+
context = runner.engine.createContext(schematic);
|
|
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] update130300', () => {
|
|
41
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
42
|
+
appTree.overwrite('/package.json', `
|
|
43
|
+
{
|
|
44
|
+
"name": "Lorem ipsum",
|
|
45
|
+
"version": "0.0.32",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ihk-gfi/lux-components": "13.1.0",
|
|
52
|
+
"@angular/animations": "13.3.7",
|
|
53
|
+
"@angular/cdk": "13.3.7",
|
|
54
|
+
"@angular/common": "13.3.7",
|
|
55
|
+
"@angular/compiler": "13.3.7",
|
|
56
|
+
"@angular/core": "13.3.7",
|
|
57
|
+
"@angular/forms": "13.3.7",
|
|
58
|
+
"@angular/localize": "13.3.7",
|
|
59
|
+
"@angular/material": "13.3.7",
|
|
60
|
+
"@angular/platform-browser": "13.3.7",
|
|
61
|
+
"@angular/platform-browser-dynamic": "13.3.7",
|
|
62
|
+
"@angular/router": "13.3.7"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@angular-devkit/build-angular": "13.3.5",
|
|
66
|
+
"@angular-eslint/builder": "13.2.1",
|
|
67
|
+
"@angular-eslint/eslint-plugin": "13.2.1",
|
|
68
|
+
"@angular-eslint/eslint-plugin-template": "13.2.1",
|
|
69
|
+
"@angular-eslint/schematics": "13.2.1",
|
|
70
|
+
"@angular-eslint/template-parser": "13.2.1",
|
|
71
|
+
"@angular/cli": "13.3.5",
|
|
72
|
+
"@angular/compiler-cli": "13.3.7",
|
|
73
|
+
"@angular/elements": "13.3.7",
|
|
74
|
+
"@angular/language-service": "13.3.7"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`);
|
|
78
|
+
(0, schematics_1.callRule)((0, index_1.update130300)(testOptions), (0, rxjs_1.of)(appTree), context).subscribe(() => {
|
|
79
|
+
expect((0, dependencies_1.getPackageJsonDependency)(appTree, '@ihk-gfi/lux-components').version).toEqual('13.3.0');
|
|
80
|
+
done();
|
|
81
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
//# 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,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,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,uBAAgB,CAAC,CAAC,SAAS,EAAE,CAAC;QACnH,OAAO,GAAG,MAAM,MAAM;aACnB,yBAAyB,CAAC,qBAAqB,EAAE,aAAa,EAAE,iBAAU,EAAE,OAAO,CAAC;aACpF,SAAS,EAAE,CAAC;QAEf,iBAAU,CAAC,aAAa,GAAG,CA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chematicTestRunner, 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 { update130300 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update130300', () => {
|
|
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
|
|
24
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', appOptions, appTree)
|
|
25
|
+
.toPromise();
|
|
26
|
+
|
|
27
|
+
UtilConfig.defaultWaitMS = 0;
|
|
28
|
+
|
|
29
|
+
const collection = runner.engine.createCollection(collectionPath);
|
|
30
|
+
const schematic = runner.engine.createSchematic('update-13.3.0', collection);
|
|
31
|
+
context = runner.engine.createContext(schematic);
|
|
32
|
+
|
|
33
|
+
testOptions.project = appOptions.name;
|
|
34
|
+
testOptions.path = workspaceOptions.newProjectRoot + '/' + appOptions.name;
|
|
35
|
+
testOptions.verbose = true;
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
describe('[Rule] update130300', () => {
|
|
39
|
+
it('Sollte die Abhängigkeiten aktualisieren', (done) => {
|
|
40
|
+
appTree.overwrite(
|
|
41
|
+
'/package.json',
|
|
42
|
+
`
|
|
43
|
+
{
|
|
44
|
+
"name": "Lorem ipsum",
|
|
45
|
+
"version": "0.0.32",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.json",
|
|
48
|
+
"test": "npm run build && jasmine src/**/*_spec.js"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ihk-gfi/lux-components": "13.1.0",
|
|
52
|
+
"@angular/animations": "13.3.7",
|
|
53
|
+
"@angular/cdk": "13.3.7",
|
|
54
|
+
"@angular/common": "13.3.7",
|
|
55
|
+
"@angular/compiler": "13.3.7",
|
|
56
|
+
"@angular/core": "13.3.7",
|
|
57
|
+
"@angular/forms": "13.3.7",
|
|
58
|
+
"@angular/localize": "13.3.7",
|
|
59
|
+
"@angular/material": "13.3.7",
|
|
60
|
+
"@angular/platform-browser": "13.3.7",
|
|
61
|
+
"@angular/platform-browser-dynamic": "13.3.7",
|
|
62
|
+
"@angular/router": "13.3.7"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@angular-devkit/build-angular": "13.3.5",
|
|
66
|
+
"@angular-eslint/builder": "13.2.1",
|
|
67
|
+
"@angular-eslint/eslint-plugin": "13.2.1",
|
|
68
|
+
"@angular-eslint/eslint-plugin-template": "13.2.1",
|
|
69
|
+
"@angular-eslint/schematics": "13.2.1",
|
|
70
|
+
"@angular-eslint/template-parser": "13.2.1",
|
|
71
|
+
"@angular/cli": "13.3.5",
|
|
72
|
+
"@angular/compiler-cli": "13.3.7",
|
|
73
|
+
"@angular/elements": "13.3.7",
|
|
74
|
+
"@angular/language-service": "13.3.7"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
callRule(update130300(testOptions), observableOf(appTree), context).subscribe(
|
|
81
|
+
() => {
|
|
82
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('13.3.0');
|
|
83
|
+
done();
|
|
84
|
+
},
|
|
85
|
+
(reason) => expect(reason).toBeUndefined()
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
});
|
|
@@ -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
|
+
}
|
package/src/utility/json.js
CHANGED
|
@@ -75,7 +75,7 @@ function updateJsonValue(options, filePath, jsonPath, value, onlyUpdate = false)
|
|
|
75
75
|
const edits = (0, jsonc_parser_1.modify)(jsonFile, jsonPath, value, { formattingOptions: exports.jsonFormattingOptions, isArrayInsertion: false });
|
|
76
76
|
if (edits) {
|
|
77
77
|
tree.overwrite(filePath, (0, jsonc_parser_1.applyEdits)(jsonFile, edits));
|
|
78
|
-
(0, logging_1.logInfo)(
|
|
78
|
+
(0, logging_1.logInfo)(`${getLogValue(value)} an der Stelle "${jsonPath.join('.')}" eingetragen.`);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
};
|
|
@@ -237,4 +237,7 @@ function removeJsonNode(tree, filePath, jsonPath, message = `Den Abschnitt "${JS
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
exports.removeJsonNode = removeJsonNode;
|
|
240
|
+
function getLogValue(value) {
|
|
241
|
+
return typeof value === 'string' && value.startsWith('') && value.endsWith('') ? JSON.stringify(value) : '"' + JSON.stringify(value) + '"';
|
|
242
|
+
}
|
|
240
243
|
//# sourceMappingURL=json.js.map
|
package/src/utility/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["json.ts"],"names":[],"mappings":";;;AACA,+CAA0G;
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["json.ts"],"names":[],"mappings":";;;AACA,+CAA0G;AAC1G,uCAAkE;AAErD,QAAA,qBAAqB,GAAsB;IACtD,YAAY,EAAE,IAAI;IAClB,OAAO,EAAE,CAAC;IACV,GAAG,EAAE,IAAI;CACV,CAAC;AAEF;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAU,EAAE,QAAgB;IACnD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,MAAM,IAAA,sCAA4B,EAAC,oBAAoB,QAAQ,eAAe,CAAC,CAAC;KACjF;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAElC,IAAI,MAAM,GAAG,IAAA,wBAAS,EAAC,OAAO,CAAS,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AATD,4BASC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,IAAU,EAAE,QAAgB;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,MAAM,IAAA,sCAA4B,EAAC,oBAAoB,QAAQ,eAAe,CAAC,CAAC;KACjF;IACD,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAND,4CAMC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,MAAc,EAAE,IAAY,EAAE,KAAc;IACvE,IAAI,SAAS,GAAG,EAAE,CAA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,EAAE,EAAE,iBAAiB,EAAE,6BAAqB,EAAE,CAAC,CAAC;QACxG,IAAI,KAAK,EAAE;YACT,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAA,yBAAU,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;YACzD,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAC;SAClB;KACF;AACH,CAAC;AAXD,wCAWC;AAED,SAAS,WAAW,CAAC,KAAU;IAC7B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAC7I,CAAC"}
|
package/src/utility/json.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
2
|
import { applyEdits, findNodeAtLocation, FormattingOptions, modify, Node, parseTree } from 'jsonc-parser';
|
|
3
|
-
import { types } from 'util';
|
|
4
3
|
import { formattedSchematicsException, logInfo } from './logging';
|
|
5
4
|
|
|
6
5
|
export const jsonFormattingOptions: FormattingOptions = {
|
|
@@ -85,7 +84,7 @@ export function updateJsonValue(options: any, filePath: string, jsonPath: string
|
|
|
85
84
|
|
|
86
85
|
if (edits) {
|
|
87
86
|
tree.overwrite(filePath, applyEdits(jsonFile, edits));
|
|
88
|
-
logInfo(
|
|
87
|
+
logInfo(`${getLogValue(value)} an der Stelle "${jsonPath.join('.')}" eingetragen.`);
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
90
|
};
|
|
@@ -263,3 +262,7 @@ export function removeJsonNode(tree: Tree, filePath: string, jsonPath: (string |
|
|
|
263
262
|
}
|
|
264
263
|
}
|
|
265
264
|
}
|
|
265
|
+
|
|
266
|
+
function getLogValue(value: any) {
|
|
267
|
+
return typeof value === 'string' && value.startsWith('') && value.endsWith('') ? JSON.stringify(value) : '"' + JSON.stringify(value) + '"';
|
|
268
|
+
}
|