@ihk-gfi/lux-components-update 11.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +198 -0
- package/README.md +55 -0
- package/package.json +54 -0
- package/src/add-lux-components/files/app/app-routing.module.ts +19 -0
- package/src/add-lux-components/files/app/app.component.html +27 -0
- package/src/add-lux-components/files/app/app.component.spec.ts +19 -0
- package/src/add-lux-components/files/app/app.component.ts +13 -0
- package/src/add-lux-components/files/app/app.module.ts +56 -0
- package/src/add-lux-components/files/app/error/error.component.html +10 -0
- package/src/add-lux-components/files/app/error/error.component.scss +3 -0
- package/src/add-lux-components/files/app/error/error.component.spec.ts +49 -0
- package/src/add-lux-components/files/app/error/error.component.ts +17 -0
- package/src/add-lux-components/files/app/home/home.component.html +7 -0
- package/src/add-lux-components/files/app/home/home.component.scss +0 -0
- package/src/add-lux-components/files/app/home/home.component.ts +13 -0
- package/src/add-lux-components/files/app/profil/profil.component.html +1 -0
- package/src/add-lux-components/files/app/profil/profil.component.scss +0 -0
- package/src/add-lux-components/files/app/profil/profil.component.spec.ts +24 -0
- package/src/add-lux-components/files/app/profil/profil.component.ts +11 -0
- package/src/add-lux-components/files/environments/environment.prod.ts +4 -0
- package/src/add-lux-components/files/environments/environment.ts +17 -0
- package/src/add-lux-components/files/locale/messages.en.xlf +948 -0
- package/src/add-lux-components/files/locale/messages.xlf +822 -0
- package/src/add-lux-components/files/scripts/.browserslistrc +17 -0
- package/src/add-lux-components/files/src/polyfills.ts +68 -0
- package/src/add-lux-components/index.d.ts +10 -0
- package/src/add-lux-components/index.js +143 -0
- package/src/add-lux-components/index.js.map +1 -0
- package/src/add-lux-components/index.ts +183 -0
- package/src/add-lux-components/index_spec.d.ts +1 -0
- package/src/add-lux-components/index_spec.js +51 -0
- package/src/add-lux-components/index_spec.js.map +1 -0
- package/src/add-lux-components/index_spec.ts +55 -0
- package/src/add-lux-components/schema.json +23 -0
- package/src/collection.json +55 -0
- package/src/migrate-to-eslint/files/.eslintrc.json +68 -0
- package/src/migrate-to-eslint/files/.prettierrc +25 -0
- package/src/migrate-to-eslint/index.d.ts +6 -0
- package/src/migrate-to-eslint/index.js +149 -0
- package/src/migrate-to-eslint/index.js.map +1 -0
- package/src/migrate-to-eslint/index.ts +181 -0
- package/src/migrate-to-eslint/index_spec.d.ts +1 -0
- package/src/migrate-to-eslint/index_spec.js +129 -0
- package/src/migrate-to-eslint/index_spec.js.map +1 -0
- package/src/migrate-to-eslint/index_spec.ts +152 -0
- package/src/migrate-to-eslint/schema.json +23 -0
- package/src/migrate-to-webcomponent/index.d.ts +10 -0
- package/src/migrate-to-webcomponent/index.js +278 -0
- package/src/migrate-to-webcomponent/index.js.map +1 -0
- package/src/migrate-to-webcomponent/index.ts +331 -0
- package/src/migrate-to-webcomponent/index_spec.d.ts +1 -0
- package/src/migrate-to-webcomponent/index_spec.js +580 -0
- package/src/migrate-to-webcomponent/index_spec.js.map +1 -0
- package/src/migrate-to-webcomponent/index_spec.ts +703 -0
- package/src/migrate-to-webcomponent/schema.json +23 -0
- package/src/update/files/locale/messages.en.xlf +940 -0
- package/src/update/files/locale/messages.xlf +815 -0
- package/src/update/files/scripts/move-de-files.js +15 -0
- package/src/update/index.d.ts +23 -0
- package/src/update/index.js +635 -0
- package/src/update/index.js.map +1 -0
- package/src/update/index.ts +712 -0
- package/src/update/index_spec.d.ts +1 -0
- package/src/update/index_spec.js +990 -0
- package/src/update/index_spec.js.map +1 -0
- package/src/update/index_spec.ts +1145 -0
- package/src/update/schema.json +23 -0
- package/src/update-dependencies/index.d.ts +5 -0
- package/src/update-dependencies/index.js +113 -0
- package/src/update-dependencies/index.js.map +1 -0
- package/src/update-dependencies/index.ts +114 -0
- package/src/update-dependencies/schema.json +23 -0
- package/src/update110001/index.d.ts +2 -0
- package/src/update110001/index.js +42 -0
- package/src/update110001/index.js.map +1 -0
- package/src/update110001/index.ts +40 -0
- package/src/update110001/index_spec.d.ts +1 -0
- package/src/update110001/index_spec.js +67 -0
- package/src/update110001/index_spec.js.map +1 -0
- package/src/update110001/index_spec.ts +72 -0
- package/src/update110001/schema.json +23 -0
- package/src/update110100/index.d.ts +2 -0
- package/src/update110100/index.js +27 -0
- package/src/update110100/index.js.map +1 -0
- package/src/update110100/index.ts +24 -0
- package/src/update110100/index_spec.d.ts +1 -0
- package/src/update110100/index_spec.js +69 -0
- package/src/update110100/index_spec.js.map +1 -0
- package/src/update110100/index_spec.ts +73 -0
- package/src/update110100/schema.json +23 -0
- package/src/update110101/index.d.ts +2 -0
- package/src/update110101/index.js +24 -0
- package/src/update110101/index.js.map +1 -0
- package/src/update110101/index.ts +21 -0
- package/src/update110101/index_spec.d.ts +1 -0
- package/src/update110101/index_spec.js +65 -0
- package/src/update110101/index_spec.js.map +1 -0
- package/src/update110101/index_spec.ts +69 -0
- package/src/update110101/schema.json +23 -0
- package/src/update110200/index.d.ts +2 -0
- package/src/update110200/index.js +24 -0
- package/src/update110200/index.js.map +1 -0
- package/src/update110200/index.ts +21 -0
- package/src/update110200/index_spec.d.ts +1 -0
- package/src/update110200/index_spec.js +65 -0
- package/src/update110200/index_spec.js.map +1 -0
- package/src/update110200/index_spec.ts +69 -0
- package/src/update110200/schema.json +23 -0
- package/src/update110300/index.d.ts +2 -0
- package/src/update110300/index.js +133 -0
- package/src/update110300/index.js.map +1 -0
- package/src/update110300/index.ts +148 -0
- package/src/update110300/index_spec.d.ts +1 -0
- package/src/update110300/index_spec.js +121 -0
- package/src/update110300/index_spec.js.map +1 -0
- package/src/update110300/index_spec.ts +139 -0
- package/src/update110300/schema.json +23 -0
- package/src/utility/dependencies.d.ts +39 -0
- package/src/utility/dependencies.js +96 -0
- package/src/utility/dependencies.js.map +1 -0
- package/src/utility/dependencies.ts +116 -0
- package/src/utility/files.d.ts +60 -0
- package/src/utility/files.js +299 -0
- package/src/utility/files.js.map +1 -0
- package/src/utility/files.ts +355 -0
- package/src/utility/html.d.ts +49 -0
- package/src/utility/html.js +183 -0
- package/src/utility/html.js.map +1 -0
- package/src/utility/html.ts +212 -0
- package/src/utility/json.d.ts +34 -0
- package/src/utility/json.js +70 -0
- package/src/utility/json.js.map +1 -0
- package/src/utility/json.ts +70 -0
- package/src/utility/logging.d.ts +32 -0
- package/src/utility/logging.js +82 -0
- package/src/utility/logging.js.map +1 -0
- package/src/utility/logging.ts +80 -0
- package/src/utility/test.d.ts +10 -0
- package/src/utility/test.js +24 -0
- package/src/utility/test.js.map +1 -0
- package/src/utility/test.ts +24 -0
- package/src/utility/typescript.d.ts +22 -0
- package/src/utility/typescript.js +521 -0
- package/src/utility/typescript.js.map +1 -0
- package/src/utility/typescript.ts +598 -0
- package/src/utility/typescript_spec.d.ts +1 -0
- package/src/utility/typescript_spec.js +1006 -0
- package/src/utility/typescript_spec.js.map +1 -0
- package/src/utility/typescript_spec.ts +1267 -0
- package/src/utility/util.d.ts +33 -0
- package/src/utility/util.js +139 -0
- package/src/utility/util.js.map +1 -0
- package/src/utility/util.ts +140 -0
- package/src/utility/validation.d.ts +11 -0
- package/src/utility/validation.js +44 -0
- package/src/utility/validation.js.map +1 -0
- package/src/utility/validation.ts +49 -0
- package/tsconfig.json +37 -0
|
@@ -0,0 +1,69 @@
|
|
|
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('update110100', () => {
|
|
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-11.1.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] update110100', () => {
|
|
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": "11.0.0",
|
|
52
|
+
"@ihk-gfi/lux-components": "^11.1.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`);
|
|
59
|
+
schematics_1.callRule(index_1.update110100(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
|
|
60
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, 'marked').version).toEqual('2.1.3');
|
|
61
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.1.0');
|
|
62
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('^11.3.0');
|
|
63
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@compodoc/compodoc').version).toEqual('1.1.14');
|
|
64
|
+
done();
|
|
65
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
//# 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,0DAAmE;AACnE,0CAA+D;AAC/D,0CAA6C;AAC7C,mCAAuC;AAEvC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,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,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC7E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAEjD,WAAW,CAAC,OAAO,GAAG,iBAAU,CAAC,IAAI,CAAC;QACtC,WAAW,CAAC,IAAI,GAAG,uBAAgB,CAAC,cAAc,GAAG,GAAG,GAAG,iBAAU,CAAC,IAAI,CAAC;QAC3E,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,yCAAyC,EAAE,CAAC,IAAI,EAAE,EAAE;YACrD,OAAO,CAAC,SAAS,CACf,eAAe,EACf;;;;;;;;;;;;;;;;SAgBC,CACF,CAAC;YAEF,qBAAQ,CAAC,oBAAY,CAAC,WAAW,CAAC,EAAE,SAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3E,GAAG,EAAE;gBACH,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;gBAC7E,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC/F,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBACtG,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC1F,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,73 @@
|
|
|
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 { update110100 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update110100', () => {
|
|
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-11.1.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] update110100', () => {
|
|
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": "11.0.0",
|
|
52
|
+
"@ihk-gfi/lux-components": "^11.1.0"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
callRule(update110100(testOptions), observableOf(appTree), context).subscribe(
|
|
62
|
+
() => {
|
|
63
|
+
expect(getPackageJsonDependency(appTree, 'marked').version).toEqual('2.1.3');
|
|
64
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.1.0');
|
|
65
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('^11.3.0');
|
|
66
|
+
expect(getPackageJsonDependency(appTree, '@compodoc/compodoc').version).toEqual('1.1.14');
|
|
67
|
+
done();
|
|
68
|
+
},
|
|
69
|
+
(reason) => expect(reason).toBeUndefined()
|
|
70
|
+
);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "luxUpdate110100Schema",
|
|
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,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update110101 = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const dependencies_1 = require("../utility/dependencies");
|
|
7
|
+
const util_1 = require("../utility/util");
|
|
8
|
+
function update110101(options) {
|
|
9
|
+
return (tree, context) => {
|
|
10
|
+
return schematics_1.chain([
|
|
11
|
+
util_1.messageInfoRule(`Die LUX-Components werden auf die Version 11.1.1 aktualisiert...`),
|
|
12
|
+
util_1.messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
13
|
+
(tree, _context) => {
|
|
14
|
+
dependencies_1.updateDependency(tree, '@ihk-gfi/lux-components', '11.1.1');
|
|
15
|
+
return tree;
|
|
16
|
+
},
|
|
17
|
+
util_1.messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
18
|
+
util_1.messageSuccessRule(`Die LUX-Components wurden auf die Version 11.1.1 aktualisiert.`),
|
|
19
|
+
util_1.finish(`${chalk.yellowBright('Fertig!')}`)
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.update110101 = update110101;
|
|
24
|
+
//# 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,0DAA2D;AAC3D,0CAA8E;AAE9E,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,kBAAK,CAAC;YACX,sBAAe,CAAC,kEAAkE,CAAC;YACnF,sBAAe,CAAC,4CAA4C,CAAC;YAC7D,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;gBACzC,+BAAgB,CAAC,IAAI,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;gBAE5D,OAAO,IAAI,CAAC;YACd,CAAC;YACD,yBAAkB,CAAC,2CAA2C,CAAC;YAC/D,yBAAkB,CAAC,gEAAgE,CAAC;YACpF,aAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAfD,oCAeC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { updateDependency } from '../utility/dependencies';
|
|
4
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../utility/util';
|
|
5
|
+
|
|
6
|
+
export function update110101(options: any): Rule {
|
|
7
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
8
|
+
return chain([
|
|
9
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 11.1.1 aktualisiert...`),
|
|
10
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
11
|
+
(tree: Tree, _context: SchematicContext) => {
|
|
12
|
+
updateDependency(tree, '@ihk-gfi/lux-components', '11.1.1');
|
|
13
|
+
|
|
14
|
+
return tree;
|
|
15
|
+
},
|
|
16
|
+
messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
17
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 11.1.1 aktualisiert.`),
|
|
18
|
+
finish(`${chalk.yellowBright('Fertig!')}`)
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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('update110101', () => {
|
|
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-11.1.1', 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] update110101', () => {
|
|
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": "11.0.0",
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`);
|
|
58
|
+
schematics_1.callRule(index_1.update110101(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
|
|
59
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.1.1');
|
|
60
|
+
done();
|
|
61
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# 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,0DAAmE;AACnE,0CAA+D;AAC/D,0CAA6C;AAC7C,mCAAuC;AAEvC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,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,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC7E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAEjD,WAAW,CAAC,OAAO,GAAG,iBAAU,CAAC,IAAI,CAAC;QACtC,WAAW,CAAC,IAAI,GAAG,uBAAgB,CAAC,cAAc,GAAG,GAAG,GAAG,iBAAU,CAAC,IAAI,CAAC;QAC3E,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,yCAAyC,EAAE,CAAC,IAAI,EAAE,EAAE;YACrD,OAAO,CAAC,SAAS,CACf,eAAe,EACf;;;;;;;;;;;;;;;SAeC,CACF,CAAC;YAEF,qBAAQ,CAAC,oBAAY,CAAC,WAAW,CAAC,EAAE,SAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3E,GAAG,EAAE;gBACH,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC/F,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,69 @@
|
|
|
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 { update110101 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update110101', () => {
|
|
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-11.1.1', 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] update110101', () => {
|
|
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": "11.0.0",
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
callRule(update110101(testOptions), observableOf(appTree), context).subscribe(
|
|
61
|
+
() => {
|
|
62
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.1.1');
|
|
63
|
+
done();
|
|
64
|
+
},
|
|
65
|
+
(reason) => expect(reason).toBeUndefined()
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "luxUpdate110101Schema",
|
|
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,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.update110200 = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const chalk = require("chalk");
|
|
6
|
+
const dependencies_1 = require("../utility/dependencies");
|
|
7
|
+
const util_1 = require("../utility/util");
|
|
8
|
+
function update110200(options) {
|
|
9
|
+
return (tree, context) => {
|
|
10
|
+
return schematics_1.chain([
|
|
11
|
+
util_1.messageInfoRule(`Die LUX-Components werden auf die Version 11.2.0 aktualisiert...`),
|
|
12
|
+
util_1.messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
13
|
+
(tree, _context) => {
|
|
14
|
+
dependencies_1.updateDependency(tree, '@ihk-gfi/lux-components', '11.2.0');
|
|
15
|
+
return tree;
|
|
16
|
+
},
|
|
17
|
+
util_1.messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
18
|
+
util_1.messageSuccessRule(`Die LUX-Components wurden auf die Version 11.2.0 aktualisiert.`),
|
|
19
|
+
util_1.finish(`${chalk.yellowBright('Fertig!')}`)
|
|
20
|
+
]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
exports.update110200 = update110200;
|
|
24
|
+
//# 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,0DAA2D;AAC3D,0CAA8E;AAE9E,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,kBAAK,CAAC;YACX,sBAAe,CAAC,kEAAkE,CAAC;YACnF,sBAAe,CAAC,4CAA4C,CAAC;YAC7D,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;gBACzC,+BAAgB,CAAC,IAAI,EAAE,yBAAyB,EAAE,QAAQ,CAAC,CAAC;gBAE5D,OAAO,IAAI,CAAC;YACd,CAAC;YACD,yBAAkB,CAAC,2CAA2C,CAAC;YAC/D,yBAAkB,CAAC,gEAAgE,CAAC;YACpF,aAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAfD,oCAeC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
|
+
import { updateDependency } from '../utility/dependencies';
|
|
4
|
+
import { finish, messageInfoRule, messageSuccessRule } from '../utility/util';
|
|
5
|
+
|
|
6
|
+
export function update110200(options: any): Rule {
|
|
7
|
+
return (tree: Tree, context: SchematicContext) => {
|
|
8
|
+
return chain([
|
|
9
|
+
messageInfoRule(`Die LUX-Components werden auf die Version 11.2.0 aktualisiert...`),
|
|
10
|
+
messageInfoRule(`Die Datei "package.json" wird angepasst...`),
|
|
11
|
+
(tree: Tree, _context: SchematicContext) => {
|
|
12
|
+
updateDependency(tree, '@ihk-gfi/lux-components', '11.2.0');
|
|
13
|
+
|
|
14
|
+
return tree;
|
|
15
|
+
},
|
|
16
|
+
messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
|
|
17
|
+
messageSuccessRule(`Die LUX-Components wurden auf die Version 11.2.0 aktualisiert.`),
|
|
18
|
+
finish(`${chalk.yellowBright('Fertig!')}`)
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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('update110200', () => {
|
|
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-11.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] update110200', () => {
|
|
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": "11.0.0",
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`);
|
|
58
|
+
schematics_1.callRule(index_1.update110200(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
|
|
59
|
+
expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.2.0');
|
|
60
|
+
done();
|
|
61
|
+
}, (reason) => expect(reason).toBeUndefined());
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# 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,0DAAmE;AACnE,0CAA+D;AAC/D,0CAA6C;AAC7C,mCAAuC;AAEvC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,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,CAAC,CAAC;QAE7B,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC7E,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;QAEjD,WAAW,CAAC,OAAO,GAAG,iBAAU,CAAC,IAAI,CAAC;QACtC,WAAW,CAAC,IAAI,GAAG,uBAAgB,CAAC,cAAc,GAAG,GAAG,GAAG,iBAAU,CAAC,IAAI,CAAC;QAC3E,WAAW,CAAC,OAAO,GAAG,IAAI,CAAC;IAC7B,CAAC,CAAA,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,yCAAyC,EAAE,CAAC,IAAI,EAAE,EAAE;YACrD,OAAO,CAAC,SAAS,CACf,eAAe,EACf;;;;;;;;;;;;;;;SAeC,CACF,CAAC;YAEF,qBAAQ,CAAC,oBAAY,CAAC,WAAW,CAAC,EAAE,SAAY,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,CAC3E,GAAG,EAAE;gBACH,MAAM,CAAC,uCAAwB,CAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC/F,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,69 @@
|
|
|
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 { update110200 } from './index';
|
|
9
|
+
|
|
10
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
11
|
+
|
|
12
|
+
describe('update110200', () => {
|
|
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-11.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] update110200', () => {
|
|
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": "11.0.0",
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@angular-devkit/build-angular": "0.1102.10",
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
callRule(update110200(testOptions), observableOf(appTree), context).subscribe(
|
|
61
|
+
() => {
|
|
62
|
+
expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.2.0');
|
|
63
|
+
done();
|
|
64
|
+
},
|
|
65
|
+
(reason) => expect(reason).toBeUndefined()
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"id": "luxUpdate110200Schema",
|
|
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
|
+
}
|