@ihk-gfi/lux-components-update 11.9.0 → 11.12.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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;AAAA,2DAAiF;AACjF,+BAA+B;AAC/B,0DAAgF;AAChF,0CAA8F;AAE9F,SAAgB,YAAY,CAAC,OAAY;IACvC,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,OAAO,kBAAK,CAAC;YACX,sBAAe,CAAC,mEAAmE,CAAC;YAEpF,sBAAe,CAAC,4CAA4C,CAAC;YAC7D,kBAAkB,EAAE;YACpB,yBAAkB,CAAC,2CAA2C,CAAC;YAE/D,sBAAe,CAAC,0EAA0E,CAAC;YAC3F,UAAU,EAAE;YACZ,yBAAkB,CAAC,wEAAwE,CAAC;YAE5F,yBAAkB,CAAC,iEAAiE,CAAC;YACrF,aAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,SAAS,kBAAkB;QACzB,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;YAChD,+BAAgB,CAAC,IAAI,EAAE,yBAAyB,EAAE,SAAS,CAAC,CAAC;YAC7D,+BAAgB,CAAC,IAAI,EAAE,+BAA+B,EAAE,SAAS,CAAC,CAAC;YACnE,kCAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YAE7C,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IACJ,CAAC;AACH,CAAC;AA3BD,oCA2BC;AAED,SAAS,UAAU;IACjB,OAAO,CAAC,IAAU,EAAE,QAA0B,EAAE,EAAE;QAChD,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAU;IAC1C,qBAAc,CACZ,IAAI,EACJ,IAAI,EACJ,mCAAmC,EACnC;;;;;;;;SAQK,CACN,CAAC;IAEF,qBAAc,CACZ,IAAI,EACJ,IAAI,EACJ,mCAAmC,EACnC;;;;;;;;;SASK,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { chain, Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2
+ import * as chalk from 'chalk';
3
+ import { updateDependency, updateDependencyDev } from '../utility/dependencies';
4
+ import { finish, messageInfoRule, messageSuccessRule, updateI18nFile } from '../utility/util';
5
+
6
+ export function update111200(options: any): Rule {
7
+ return (tree: Tree, context: SchematicContext) => {
8
+ return chain([
9
+ messageInfoRule(`Die LUX-Components werden auf die Version 11.12.0 aktualisiert...`),
10
+
11
+ messageInfoRule(`Die Datei "package.json" wird angepasst...`),
12
+ updateDependencies(),
13
+ messageSuccessRule(`Die Datei "package.json" wurde angepasst.`),
14
+
15
+ messageInfoRule(`Die Sprachdateien werden um Einträge für die Chips-Komponente ergänzt...`),
16
+ updateI18N(),
17
+ messageSuccessRule(`Die Sprachdateien wurden um Einträge für die Chips-Komponente ergänzt.`),
18
+
19
+ messageSuccessRule(`Die LUX-Components wurden auf die Version 11.12.0 aktualisiert.`),
20
+ finish(`${chalk.yellowBright('Fertig!')}`)
21
+ ]);
22
+ };
23
+
24
+ function updateDependencies() {
25
+ return (tree: Tree, _context: SchematicContext) => {
26
+ updateDependency(tree, '@ihk-gfi/lux-components', '11.12.0');
27
+ updateDependency(tree, '@ihk-gfi/lux-components-theme', '11.13.0');
28
+ updateDependencyDev(tree, 'karma', '6.3.17');
29
+
30
+ return tree;
31
+ };
32
+ }
33
+ }
34
+
35
+ function updateI18N() {
36
+ return (tree: Tree, _context: SchematicContext) => {
37
+ addI18nForChipsComponent(tree);
38
+
39
+ return tree;
40
+ };
41
+ }
42
+
43
+ function addI18nForChipsComponent(tree: Tree) {
44
+ updateI18nFile(
45
+ tree,
46
+ 'de',
47
+ 'luxc.datepicker.error_message.min',
48
+ `
49
+ <trans-unit id="luxc.chips.input.placeholder.lbl" datatype="html">
50
+ <source>eingeben oder auswählen</source>
51
+ <context-group purpose="location">
52
+ <context context-type="sourcefile">src/app/modules/lux-form/lux-chips/lux-chips.component.ts</context>
53
+ <context context-type="linenumber">48</context>
54
+ </context-group>
55
+ </trans-unit>
56
+ `
57
+ );
58
+
59
+ updateI18nFile(
60
+ tree,
61
+ 'en',
62
+ 'luxc.datepicker.error_message.min',
63
+ `
64
+ <trans-unit id="luxc.chips.input.placeholder.lbl" datatype="html">
65
+ <source>eingeben oder auswählen</source>
66
+ <target>enter or select</target>
67
+ <context-group purpose="location">
68
+ <context context-type="sourcefile">src/app/modules/lux-form/lux-chips/lux-chips.component.ts</context>
69
+ <context context-type="linenumber">48</context>
70
+ </context-group>
71
+ </trans-unit>
72
+ `
73
+ );
74
+ }
75
+
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,67 @@
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('update111200', () => {
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.12.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] update111200', () => {
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.update111200(testOptions), rxjs_1.of(appTree), context).subscribe(() => {
59
+ expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.12.0');
60
+ expect(dependencies_1.getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('11.13.0');
61
+ expect(dependencies_1.getPackageJsonDependency(appTree, 'karma').version).toEqual('6.3.17');
62
+ done();
63
+ }, (reason) => expect(reason).toBeUndefined());
64
+ });
65
+ });
66
+ });
67
+ //# s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AG,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,SAAS,CAAC,CAAC;gBAChG,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,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAC7E,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,71 @@
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 { update111200 } from './index';
9
+
10
+ const collectionPath = path.join(__dirname, '../collection.json');
11
+
12
+ describe('update111200', () => {
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.12.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] update111200', () => {
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(update111200(testOptions), observableOf(appTree), context).subscribe(
61
+ () => {
62
+ expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components').version).toEqual('11.12.0');
63
+ expect(getPackageJsonDependency(appTree, '@ihk-gfi/lux-components-theme').version).toEqual('11.13.0');
64
+ expect(getPackageJsonDependency(appTree, 'karma').version).toEqual('6.3.17');
65
+ done();
66
+ },
67
+ (reason) => expect(reason).toBeUndefined()
68
+ );
69
+ });
70
+ });
71
+ });
@@ -0,0 +1,23 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "id": "luxUpdate111200Schema",
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
+ }