@public-ui/visual-tests 1.7.0-rc.7 → 1.7.0-rc.8
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/README.md +144 -23
- package/package.json +12 -17
- package/src/index.ts +33 -0
- package/src/migrate/index.ts +127 -0
- package/src/migrate/runner/abstract-task.ts +64 -0
- package/src/migrate/runner/task-runner.ts +163 -0
- package/src/migrate/runner/tasks/common/GenericRenamePropertyTask.ts +85 -0
- package/src/migrate/runner/tasks/common/LabelExpertSlot.ts +96 -0
- package/src/migrate/runner/tasks/common/RemovePropertyNameTask.ts +104 -0
- package/src/migrate/runner/tasks/common/RenamePropertyNameTask.ts +31 -0
- package/src/migrate/runner/tasks/test/index.ts +16 -0
- package/src/migrate/runner/tasks/test/test-dummy.ts +20 -0
- package/src/migrate/runner/tasks/test/test-version-1.3.ts +7 -0
- package/src/migrate/runner/tasks/test/test-version-current.ts +7 -0
- package/src/migrate/runner/tasks/test/test-version-next-2.ts +7 -0
- package/src/migrate/runner/tasks/test/test-version-next-3.ts +7 -0
- package/src/migrate/runner/tasks/test/test-version-zero.ts +7 -0
- package/src/migrate/runner/tasks/v1/abbr.ts +3 -0
- package/src/migrate/runner/tasks/v1/accordion.ts +3 -0
- package/src/migrate/runner/tasks/v1/badge.ts +6 -0
- package/src/migrate/runner/tasks/v1/breadcrumb.ts +3 -0
- package/src/migrate/runner/tasks/v1/button-link.ts +6 -0
- package/src/migrate/runner/tasks/v1/button.ts +8 -0
- package/src/migrate/runner/tasks/v1/card.ts +4 -0
- package/src/migrate/runner/tasks/v1/details.ts +3 -0
- package/src/migrate/runner/tasks/v1/icon.ts +5 -0
- package/src/migrate/runner/tasks/v1/index.ts +151 -0
- package/src/migrate/runner/tasks/v1/input-checkbox.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-color.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-date.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-email.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-number.ts +4 -0
- package/src/migrate/runner/tasks/v1/input-radio.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-range.ts +3 -0
- package/src/migrate/runner/tasks/v1/input-text.ts +3 -0
- package/src/migrate/runner/tasks/v1/link-button.ts +15 -0
- package/src/migrate/runner/tasks/v1/link-group.ts +7 -0
- package/src/migrate/runner/tasks/v1/link.ts +15 -0
- package/src/migrate/runner/tasks/v1/logo.ts +3 -0
- package/src/migrate/runner/tasks/v1/modal.ts +3 -0
- package/src/migrate/runner/tasks/v1/nav.ts +7 -0
- package/src/migrate/runner/tasks/v1/pagination.ts +3 -0
- package/src/migrate/runner/tasks/v1/progress.ts +3 -0
- package/src/migrate/runner/tasks/v1/quote.ts +3 -0
- package/src/migrate/runner/tasks/v1/select.ts +4 -0
- package/src/migrate/runner/tasks/v1/skip-nav.ts +3 -0
- package/src/migrate/runner/tasks/v1/span.ts +3 -0
- package/src/migrate/runner/tasks/v1/split-button.ts +3 -0
- package/src/migrate/runner/tasks/v1/table.ts +3 -0
- package/src/migrate/runner/tasks/v1/tabs.ts +4 -0
- package/src/migrate/runner/tasks/v1/toast.ts +3 -0
- package/src/migrate/runner/tasks/v1/version.ts +3 -0
- package/src/migrate/runner/types.ts +2 -0
- package/src/migrate/shares/reuse.ts +182 -0
- package/src/migrate/types.ts +2 -0
- package/src/types.ts +23 -0
- package/dist/index.js +0 -43
- package/kolibri-visual-test.sh +0 -3
- package/playwright.config.ts +0 -59
- package/tests/theme-snapshots.spec.ts +0 -46
- package/tsconfig.json +0 -22
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
import { COMPONENT_FILE_EXTENSIONS, CUSTOM_ELEMENT_FILE_EXTENSIONS, MARKUP_EXTENSIONS } from '../../../../types';
|
|
4
|
+
import {
|
|
5
|
+
filterFilesByExt,
|
|
6
|
+
isPropertyKebabCaseRegExp,
|
|
7
|
+
isTagKebabCaseRegExp,
|
|
8
|
+
kebabToCamelCase,
|
|
9
|
+
kebabToCapitalCase,
|
|
10
|
+
logAndCreateError,
|
|
11
|
+
MODIFIED_FILES,
|
|
12
|
+
} from '../../../shares/reuse';
|
|
13
|
+
import { AbstractTask, TaskOptions } from '../../abstract-task';
|
|
14
|
+
|
|
15
|
+
const DATA_REMOVED_REGEXP = /DataRemoved_/gi; // not /DataRemoved-_/g
|
|
16
|
+
const DATA_REMOVEDS_REGEXP = /(data-removed-){2,}/g;
|
|
17
|
+
|
|
18
|
+
export class GenericRenamePropertyTask extends AbstractTask {
|
|
19
|
+
private readonly componentRegExp: RegExp;
|
|
20
|
+
private readonly customElementRegExp: RegExp;
|
|
21
|
+
|
|
22
|
+
private readonly newPropertyInCamelCase: string;
|
|
23
|
+
|
|
24
|
+
protected constructor(
|
|
25
|
+
identifier: string,
|
|
26
|
+
description: string,
|
|
27
|
+
tag: string,
|
|
28
|
+
oldProperty: string,
|
|
29
|
+
private readonly newProperty: string,
|
|
30
|
+
versionRange: string,
|
|
31
|
+
dependentTasks: AbstractTask[] = [],
|
|
32
|
+
options: TaskOptions = {},
|
|
33
|
+
) {
|
|
34
|
+
super(identifier, description, MARKUP_EXTENSIONS, versionRange, dependentTasks, options);
|
|
35
|
+
|
|
36
|
+
if (!isTagKebabCaseRegExp.test(tag)) {
|
|
37
|
+
throw logAndCreateError(`Tag "${tag}" is not in kebab case.`);
|
|
38
|
+
}
|
|
39
|
+
if (!isPropertyKebabCaseRegExp.test(oldProperty)) {
|
|
40
|
+
throw logAndCreateError(`Old property "${oldProperty}" is not in kebab case.`);
|
|
41
|
+
}
|
|
42
|
+
if (!isPropertyKebabCaseRegExp.test(newProperty)) {
|
|
43
|
+
throw logAndCreateError(`New property "${newProperty}" is not in kebab case.`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
this.newPropertyInCamelCase = kebabToCamelCase(newProperty);
|
|
47
|
+
|
|
48
|
+
this.componentRegExp = new RegExp(`(<${kebabToCapitalCase(tag)}[^>]+)${kebabToCapitalCase(oldProperty)}([ >=])`, 'g');
|
|
49
|
+
this.customElementRegExp = new RegExp(`(<${tag}[^>]+)${oldProperty}([ >=])`, 'g');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public run(baseDir: string): void {
|
|
53
|
+
this.transpileComponentFileRename(baseDir);
|
|
54
|
+
this.transpileCustomElementFileRename(baseDir);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private transpileComponentFileRename(baseDir: string): void {
|
|
58
|
+
filterFilesByExt(baseDir, COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
59
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
60
|
+
const newContent = content
|
|
61
|
+
// Replacements
|
|
62
|
+
.replace(this.componentRegExp, `$1${this.newPropertyInCamelCase}$2`)
|
|
63
|
+
.replace(DATA_REMOVED_REGEXP, 'data-removed-_')
|
|
64
|
+
.replace(DATA_REMOVEDS_REGEXP, 'data-removed-');
|
|
65
|
+
if (content !== newContent) {
|
|
66
|
+
MODIFIED_FILES.add(file);
|
|
67
|
+
fs.writeFileSync(file, newContent);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private transpileCustomElementFileRename(baseDir: string): void {
|
|
73
|
+
filterFilesByExt(baseDir, CUSTOM_ELEMENT_FILE_EXTENSIONS).forEach((file) => {
|
|
74
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
75
|
+
const newContent = content
|
|
76
|
+
// Replacements
|
|
77
|
+
.replace(this.customElementRegExp, `$1${this.newProperty}$2`)
|
|
78
|
+
.replace(DATA_REMOVEDS_REGEXP, 'data-removed-');
|
|
79
|
+
if (content !== newContent) {
|
|
80
|
+
MODIFIED_FILES.add(file);
|
|
81
|
+
fs.writeFileSync(file, newContent);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
import { COMPONENT_FILE_EXTENSIONS, MARKUP_EXTENSIONS } from '../../../../types';
|
|
4
|
+
import {
|
|
5
|
+
filterFilesByExt,
|
|
6
|
+
isPropertyKebabCaseRegExp,
|
|
7
|
+
isTagKebabCaseRegExp,
|
|
8
|
+
kebabToCamelCase,
|
|
9
|
+
kebabToCapitalCase,
|
|
10
|
+
logAndCreateError,
|
|
11
|
+
MODIFIED_FILES,
|
|
12
|
+
} from '../../../shares/reuse';
|
|
13
|
+
import { AbstractTask, TaskOptions } from '../../abstract-task';
|
|
14
|
+
|
|
15
|
+
const removeLineBreaksAndSpaces = (match: string) => {
|
|
16
|
+
return match.replace(/\r?\n/g, ' ').replace(/>\s+/g, '>').replace(/\s+</g, '<');
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export class LabelExpertSlot extends AbstractTask {
|
|
20
|
+
private readonly componentRegExp: RegExp;
|
|
21
|
+
private readonly customElementRegExp: RegExp;
|
|
22
|
+
private readonly propertyInCamelCase: string;
|
|
23
|
+
|
|
24
|
+
private constructor(
|
|
25
|
+
identifier: string,
|
|
26
|
+
tag: string,
|
|
27
|
+
private readonly property: string,
|
|
28
|
+
versionRange: string,
|
|
29
|
+
dependentTasks: AbstractTask[],
|
|
30
|
+
options: TaskOptions,
|
|
31
|
+
) {
|
|
32
|
+
super(identifier, `Move innerText of "${tag}" component to property "${property}"`, MARKUP_EXTENSIONS, versionRange, dependentTasks, options);
|
|
33
|
+
|
|
34
|
+
if (!isTagKebabCaseRegExp.test(tag)) {
|
|
35
|
+
throw logAndCreateError(`Tag "${tag}" is not in kebab case.`);
|
|
36
|
+
}
|
|
37
|
+
if (!isPropertyKebabCaseRegExp.test(property)) {
|
|
38
|
+
throw logAndCreateError(`Property "${property}" is not in kebab case.`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const tagCapitalCase = kebabToCapitalCase(tag);
|
|
42
|
+
this.propertyInCamelCase = kebabToCamelCase(property);
|
|
43
|
+
|
|
44
|
+
// https://regex101.com/r/WkEKxu/1
|
|
45
|
+
|
|
46
|
+
this.componentRegExp = new RegExp(`(<${tagCapitalCase}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tagCapitalCase}>)`, 'g');
|
|
47
|
+
this.customElementRegExp = new RegExp(`(<${tag}[^>]*)>([^<]+(\\n\\s*)*)(<\\/${tag}>)`, 'g');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public static getInstance(
|
|
51
|
+
tag: string,
|
|
52
|
+
property: string,
|
|
53
|
+
versionRange: string,
|
|
54
|
+
dependentTasks: AbstractTask[] = [],
|
|
55
|
+
options: TaskOptions = {},
|
|
56
|
+
): LabelExpertSlot {
|
|
57
|
+
const identifier = `${tag}-move-innerText-to-property-${property}`;
|
|
58
|
+
if (!this.instances.has(identifier)) {
|
|
59
|
+
this.instances.set(identifier, new LabelExpertSlot(identifier, tag, property, versionRange, dependentTasks, options));
|
|
60
|
+
}
|
|
61
|
+
return this.instances.get(identifier) as LabelExpertSlot;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public run(baseDir: string): void {
|
|
65
|
+
this.transpileComponentFileDelete(baseDir);
|
|
66
|
+
this.transpileCustomElementFileDelete(baseDir);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
private transpileComponentFileDelete(baseDir: string): void {
|
|
70
|
+
filterFilesByExt(baseDir, COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
71
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
72
|
+
const newContent = content
|
|
73
|
+
// Replacements
|
|
74
|
+
.replace(this.componentRegExp, removeLineBreaksAndSpaces)
|
|
75
|
+
.replace(this.componentRegExp, `$1 ${this.propertyInCamelCase}="$2">$4`);
|
|
76
|
+
if (content !== newContent) {
|
|
77
|
+
MODIFIED_FILES.add(file);
|
|
78
|
+
fs.writeFileSync(file, newContent);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
private transpileCustomElementFileDelete(baseDir: string): void {
|
|
84
|
+
filterFilesByExt(baseDir, COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
85
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
86
|
+
const newContent = content
|
|
87
|
+
// Replacements
|
|
88
|
+
.replace(this.customElementRegExp, removeLineBreaksAndSpaces)
|
|
89
|
+
.replace(this.customElementRegExp, `$1 ${this.property}="$2">$4`);
|
|
90
|
+
if (content !== newContent) {
|
|
91
|
+
MODIFIED_FILES.add(file);
|
|
92
|
+
// fs.writeFileSync(file, newContent);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
|
|
3
|
+
import { COMPONENT_FILE_EXTENSIONS, CUSTOM_ELEMENT_FILE_EXTENSIONS } from '../../../../types';
|
|
4
|
+
import {
|
|
5
|
+
filterFilesByExt,
|
|
6
|
+
getRemoveMode,
|
|
7
|
+
isPropertyKebabCaseRegExp,
|
|
8
|
+
isTagKebabCaseRegExp,
|
|
9
|
+
kebabToCamelCase,
|
|
10
|
+
kebabToCapitalCase,
|
|
11
|
+
logAndCreateError,
|
|
12
|
+
MODIFIED_FILES,
|
|
13
|
+
} from '../../../shares/reuse';
|
|
14
|
+
import { AbstractTask, TaskOptions } from '../../abstract-task';
|
|
15
|
+
import { GenericRenamePropertyTask } from './GenericRenamePropertyTask';
|
|
16
|
+
|
|
17
|
+
const DATA_REMOVED_REGEXP = /data-removed-/g;
|
|
18
|
+
|
|
19
|
+
export class RemovePropertyNameTask extends GenericRenamePropertyTask {
|
|
20
|
+
private readonly componentRegExpBoolean: RegExp;
|
|
21
|
+
private readonly componentRegExpCurlyBrackets: RegExp;
|
|
22
|
+
private readonly componentRegExpQuotationMarks: RegExp;
|
|
23
|
+
private readonly customElementRegExpBoolean: RegExp;
|
|
24
|
+
private readonly customElementRegExpCurlyBrackets: RegExp;
|
|
25
|
+
private readonly customElementRegExpQuotationMarks: RegExp;
|
|
26
|
+
|
|
27
|
+
protected constructor(identifier: string, tag: string, property: string, versionRange: string, dependentTasks?: AbstractTask[], options?: TaskOptions) {
|
|
28
|
+
super(identifier, `Remove property "${property}" of "${tag}" component`, tag, property, `data-removed-${property}`, versionRange, dependentTasks, options);
|
|
29
|
+
|
|
30
|
+
if (!isTagKebabCaseRegExp.test(tag)) {
|
|
31
|
+
throw logAndCreateError(`Tag "${tag}" is not in kebab case.`);
|
|
32
|
+
}
|
|
33
|
+
if (!isPropertyKebabCaseRegExp.test(property)) {
|
|
34
|
+
throw logAndCreateError(`Property "${property}" is not in kebab case.`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const tagCapitalCase = kebabToCapitalCase(tag);
|
|
38
|
+
const propertyInCamelCase = kebabToCamelCase(property);
|
|
39
|
+
|
|
40
|
+
this.componentRegExpBoolean = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}([ >])`, 'g');
|
|
41
|
+
this.componentRegExpCurlyBrackets = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}(=\\{[^\\}]+\\})`, 'g');
|
|
42
|
+
this.componentRegExpQuotationMarks = new RegExp(`(<${tagCapitalCase}[^>]+)${propertyInCamelCase}(="[^"]+")`, 'g');
|
|
43
|
+
this.customElementRegExpBoolean = new RegExp(`(<${tag}[^>]+)${property}([ >])`, 'g');
|
|
44
|
+
this.customElementRegExpCurlyBrackets = new RegExp(`(<${tag}[^>]+)${property}(=\\{[^\\}]+\\})`, 'g');
|
|
45
|
+
this.customElementRegExpQuotationMarks = new RegExp(`(<${tag}[^>]+)${property}(="[^"]+")`, 'g');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static getInstance(
|
|
49
|
+
tag: string,
|
|
50
|
+
property: string,
|
|
51
|
+
versionRange: string,
|
|
52
|
+
dependentTasks: AbstractTask[] = [],
|
|
53
|
+
options: TaskOptions = {},
|
|
54
|
+
): RemovePropertyNameTask {
|
|
55
|
+
const identifier = `${tag}-remove-property-${property}`;
|
|
56
|
+
if (!this.instances.has(identifier)) {
|
|
57
|
+
this.instances.set(identifier, new RemovePropertyNameTask(identifier, tag, property, versionRange, dependentTasks, options));
|
|
58
|
+
}
|
|
59
|
+
return this.instances.get(identifier) as RemovePropertyNameTask;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public run(baseDir: string): void {
|
|
63
|
+
switch (getRemoveMode()) {
|
|
64
|
+
case 'delete':
|
|
65
|
+
this.transpileComponentFileDelete(baseDir);
|
|
66
|
+
this.transpileCustomElementFileDelete(baseDir);
|
|
67
|
+
break;
|
|
68
|
+
default:
|
|
69
|
+
super.run(baseDir);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
private transpileComponentFileDelete(baseDir: string): void {
|
|
74
|
+
filterFilesByExt(baseDir, COMPONENT_FILE_EXTENSIONS).forEach((file) => {
|
|
75
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
76
|
+
const newContent = content
|
|
77
|
+
// Replacements
|
|
78
|
+
.replace(DATA_REMOVED_REGEXP, ``)
|
|
79
|
+
.replace(this.componentRegExpBoolean, `$1$2`)
|
|
80
|
+
.replace(this.componentRegExpCurlyBrackets, `$1`)
|
|
81
|
+
.replace(this.componentRegExpQuotationMarks, `$1`);
|
|
82
|
+
if (content !== newContent) {
|
|
83
|
+
MODIFIED_FILES.add(file);
|
|
84
|
+
fs.writeFileSync(file, newContent);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private transpileCustomElementFileDelete(baseDir: string): void {
|
|
90
|
+
filterFilesByExt(baseDir, CUSTOM_ELEMENT_FILE_EXTENSIONS).forEach((file) => {
|
|
91
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
92
|
+
const newContent = content
|
|
93
|
+
// Replacements
|
|
94
|
+
.replace(DATA_REMOVED_REGEXP, ``)
|
|
95
|
+
.replace(this.customElementRegExpBoolean, `$1$2`)
|
|
96
|
+
.replace(this.customElementRegExpCurlyBrackets, `$1`)
|
|
97
|
+
.replace(this.customElementRegExpQuotationMarks, `$1`);
|
|
98
|
+
if (content !== newContent) {
|
|
99
|
+
MODIFIED_FILES.add(file);
|
|
100
|
+
fs.writeFileSync(file, newContent);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AbstractTask, TaskOptions } from '../../abstract-task';
|
|
2
|
+
import { GenericRenamePropertyTask } from './GenericRenamePropertyTask';
|
|
3
|
+
|
|
4
|
+
export class RenamePropertyNameTask extends GenericRenamePropertyTask {
|
|
5
|
+
public static getInstance(
|
|
6
|
+
tag: string,
|
|
7
|
+
oldProperty: string,
|
|
8
|
+
newProperty: string,
|
|
9
|
+
versionRange: string,
|
|
10
|
+
dependentTasks: AbstractTask[] = [],
|
|
11
|
+
options: TaskOptions = {},
|
|
12
|
+
): RenamePropertyNameTask {
|
|
13
|
+
const identifier = `${tag}-rename-property-${oldProperty}-to-${newProperty}`;
|
|
14
|
+
if (!this.instances.has(identifier)) {
|
|
15
|
+
this.instances?.set(
|
|
16
|
+
identifier,
|
|
17
|
+
new RenamePropertyNameTask(
|
|
18
|
+
identifier,
|
|
19
|
+
`Rename property "${oldProperty}" to "${newProperty}" of "${tag}" component`,
|
|
20
|
+
tag,
|
|
21
|
+
oldProperty,
|
|
22
|
+
newProperty,
|
|
23
|
+
versionRange,
|
|
24
|
+
dependentTasks,
|
|
25
|
+
options,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
return this.instances.get(identifier) as RenamePropertyNameTask;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getVersionOfPublicUiComponents } from '../../../shares/reuse';
|
|
2
|
+
import { AbstractTask } from '../../abstract-task';
|
|
3
|
+
import { TestVersion13 } from './test-version-1.3';
|
|
4
|
+
import { TestVersionCurrent } from './test-version-current';
|
|
5
|
+
import { TestVersionNext2 } from './test-version-next-2';
|
|
6
|
+
import { TestVersionNext3 } from './test-version-next-3';
|
|
7
|
+
import { TestVersionZero } from './test-version-zero';
|
|
8
|
+
|
|
9
|
+
export const testTasks: AbstractTask[] = [];
|
|
10
|
+
testTasks.push(TestVersionZero.getInstance());
|
|
11
|
+
testTasks.push(TestVersionNext2.getInstance());
|
|
12
|
+
testTasks.push(TestVersionNext3.getInstance());
|
|
13
|
+
testTasks.push(TestVersion13.getInstance());
|
|
14
|
+
|
|
15
|
+
const versionOfPublicUiComponents = getVersionOfPublicUiComponents();
|
|
16
|
+
testTasks.push(TestVersionCurrent.getInstance(versionOfPublicUiComponents));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FileExtension } from '../../../../types';
|
|
2
|
+
import { AbstractTask, TaskOptions } from '../../abstract-task';
|
|
3
|
+
|
|
4
|
+
export class TestDummy extends AbstractTask {
|
|
5
|
+
protected static getInstance(
|
|
6
|
+
identifier: string,
|
|
7
|
+
title: string,
|
|
8
|
+
extensions: FileExtension[],
|
|
9
|
+
versionRange: string,
|
|
10
|
+
dependentTasks: AbstractTask[] = [],
|
|
11
|
+
options: TaskOptions = {},
|
|
12
|
+
): TestDummy {
|
|
13
|
+
if (!this.instances.has(identifier)) {
|
|
14
|
+
this.instances.set(identifier, new TestDummy(identifier, title, extensions, versionRange, dependentTasks, options));
|
|
15
|
+
}
|
|
16
|
+
return this.instances.get(identifier) as TestDummy;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public run(): void {}
|
|
20
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
+
|
|
4
|
+
export const BadgeRemovePropertyIconOnly = RemovePropertyNameTask.getInstance('kol-badge', '_icon-only', '^1');
|
|
5
|
+
export const BadgeRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask.getInstance('kol-badge', '_icon-only', '_hide-label', '^1');
|
|
6
|
+
export const BadgeRemovePropertyHideLabel = RemovePropertyNameTask.getInstance('kol-badge', '_hide-label', '^1', [BadgeRenamePropertyIconOnlyToHideLabel]);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
+
|
|
4
|
+
export const ButtonLinkRemovePropertyAriaCurrent = RemovePropertyNameTask.getInstance('kol-button-link', '_aria-current', '^1');
|
|
5
|
+
export const ButtonLinkRemovePropertyAriaLabel = RemovePropertyNameTask.getInstance('kol-button-link', '_aria-label', '^1');
|
|
6
|
+
export const ButtonLinkRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask.getInstance('kol-button-link', '_icon-only', '_hide-label', '^1');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
+
|
|
4
|
+
export const ButtonRemovePropertyAriaCurrent = RemovePropertyNameTask.getInstance('kol-button', '_aria-current', '^1');
|
|
5
|
+
export const ButtonRemovePropertyAriaLabel = RemovePropertyNameTask.getInstance('kol-button', '_aria-label', '^1');
|
|
6
|
+
// @todo: handle _icon-align in _icon
|
|
7
|
+
export const ButtonRemovePropertyIconAlign = RemovePropertyNameTask.getInstance('kol-button', '_icon-align', '^1');
|
|
8
|
+
export const ButtonRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask.getInstance('kol-button', '_icon-only', '_hide-label', '^1');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
2
|
+
|
|
3
|
+
export const CardRenamePropertyHeadingToLabel = RenamePropertyNameTask.getInstance('kol-card', '_heading', '_label', '^1');
|
|
4
|
+
export const CardRenamePropertyHeadlineToLabel = RenamePropertyNameTask.getInstance('kol-card', '_headline', '_label', '^1');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
+
|
|
4
|
+
export const IconRenamePropertyAriaLabelToLabel = RenamePropertyNameTask.getInstance('kol-icon', '_aria-label', '_label', '^1');
|
|
5
|
+
export const IconRemovePropertyPart = RemovePropertyNameTask.getInstance('kol-icon', '_part', '^1');
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { AbstractTask } from '../../abstract-task';
|
|
2
|
+
import { LabelExpertSlot } from '../common/LabelExpertSlot';
|
|
3
|
+
import { AbbrRenamePropertyTitleToLabel } from './abbr';
|
|
4
|
+
import { AccordionRenamePropertyHeadingToLabel } from './accordion';
|
|
5
|
+
import { BadgeRemovePropertyHideLabel, BadgeRemovePropertyIconOnly, BadgeRenamePropertyIconOnlyToHideLabel } from './badge';
|
|
6
|
+
import { BreadcrumbRenamePropertyAriaLabelToLabel } from './breadcrumb';
|
|
7
|
+
import {
|
|
8
|
+
ButtonRemovePropertyAriaCurrent,
|
|
9
|
+
ButtonRemovePropertyAriaLabel,
|
|
10
|
+
ButtonRemovePropertyIconAlign,
|
|
11
|
+
ButtonRenamePropertyIconOnlyToHideLabel,
|
|
12
|
+
} from './button';
|
|
13
|
+
import { ButtonLinkRemovePropertyAriaCurrent, ButtonLinkRemovePropertyAriaLabel, ButtonLinkRenamePropertyIconOnlyToHideLabel } from './button-link';
|
|
14
|
+
import { CardRenamePropertyHeadingToLabel, CardRenamePropertyHeadlineToLabel } from './card';
|
|
15
|
+
import { DetailsRenamePropertySummaryToLabel } from './details';
|
|
16
|
+
import { IconRemovePropertyPart, IconRenamePropertyAriaLabelToLabel } from './icon';
|
|
17
|
+
import { InputCheckboxRenamePropertyTypeToVariant } from './input-checkbox';
|
|
18
|
+
import { InputColorRenamePropertyListToSuggestions } from './input-color';
|
|
19
|
+
import { InputDateRenamePropertyListToSuggestions } from './input-date';
|
|
20
|
+
import { InputEmailRenamePropertyListToSuggestions } from './input-email';
|
|
21
|
+
import { InputNumberRenamePropertyListToSuggestions } from './input-number';
|
|
22
|
+
import { InputRadioRenamePropertyListToSuggestions } from './input-radio';
|
|
23
|
+
import { InputRangeRenamePropertyListToSuggestions } from './input-range';
|
|
24
|
+
import { InputTextRenamePropertyListToSuggestions } from './input-text';
|
|
25
|
+
import {
|
|
26
|
+
LinkRemovePropertyAriaControl,
|
|
27
|
+
LinkRemovePropertyAriaExpanded,
|
|
28
|
+
LinkRemovePropertyAriaLabel,
|
|
29
|
+
LinkRemovePropertyAriaSelected,
|
|
30
|
+
LinkRemovePropertyDisabled,
|
|
31
|
+
LinkRemovePropertyIconAlign,
|
|
32
|
+
LinkRemovePropertySelector,
|
|
33
|
+
LinkRemovePropertyStealth,
|
|
34
|
+
LinkRemovePropertyUseCase,
|
|
35
|
+
LinkRenamePropertyAriaCurrentToListenAriaCurrent,
|
|
36
|
+
LinkRenamePropertyIconOnlyToHideLabel,
|
|
37
|
+
} from './link';
|
|
38
|
+
import {
|
|
39
|
+
LinkButtonRemovePropertyAriaControl,
|
|
40
|
+
LinkButtonRemovePropertyAriaExpanded,
|
|
41
|
+
LinkButtonRemovePropertyAriaLabel,
|
|
42
|
+
LinkButtonRemovePropertyAriaSelected,
|
|
43
|
+
LinkButtonRemovePropertyDisabled,
|
|
44
|
+
LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent,
|
|
45
|
+
LinkButtonRenamePropertyIconOnlyToHideLabel,
|
|
46
|
+
} from './link-button';
|
|
47
|
+
import {
|
|
48
|
+
LinkGroupRemovePropertyHeading,
|
|
49
|
+
LinkGroupRemovePropertyOrdered,
|
|
50
|
+
LinkGroupRenamePropertyAriaLabelToLabel,
|
|
51
|
+
LinkGroupRenamePropertyHeadingToLabel,
|
|
52
|
+
} from './link-group';
|
|
53
|
+
import { LogoRenamePropertyAbbrToOrg } from './logo';
|
|
54
|
+
import { ModalRenamePropertyAriaLabelToLabel } from './modal';
|
|
55
|
+
import { NavRemovePropertyHasCompactButton, NavRemovePropertyVariant, NavRenamePropertyAriaLabelToLabel, NavRenamePropertyCompactToHideLabel } from './nav';
|
|
56
|
+
import { PaginationRenamePropertyCountToTotal } from './pagination';
|
|
57
|
+
import { ProgressRenamePropertyTypeToVariant } from './progress';
|
|
58
|
+
import { QuoteRenamePropertyCaptionToLabel } from './quote';
|
|
59
|
+
import { SelectRenamePropertyHeightToRows, SelectRenamePropertyListToOptions } from './select';
|
|
60
|
+
import { SkipNavButtonRenamePropertyAriaLabelToLabel } from './skip-nav';
|
|
61
|
+
import { SpanRenamePropertyIconOnlyToHideLabel } from './span';
|
|
62
|
+
import { SplitButtonRemovePropertyAriaLabel } from './split-button';
|
|
63
|
+
import { TableRenamePropertyCaptionToLabel } from './table';
|
|
64
|
+
import { TabsRenamePropertyAriaLabelToLabel, TabsRenamePropertyTabAlignToAlign } from './tabs';
|
|
65
|
+
import { ToastRenamePropertyHeadingToLabel } from './toast';
|
|
66
|
+
import { VersionRenamePropertyVersionToLabel } from './version';
|
|
67
|
+
|
|
68
|
+
export const v1Tasks: AbstractTask[] = [];
|
|
69
|
+
v1Tasks.push(AbbrRenamePropertyTitleToLabel);
|
|
70
|
+
v1Tasks.push(AccordionRenamePropertyHeadingToLabel);
|
|
71
|
+
v1Tasks.push(BadgeRemovePropertyHideLabel);
|
|
72
|
+
v1Tasks.push(BadgeRemovePropertyIconOnly);
|
|
73
|
+
v1Tasks.push(BadgeRenamePropertyIconOnlyToHideLabel);
|
|
74
|
+
v1Tasks.push(BreadcrumbRenamePropertyAriaLabelToLabel);
|
|
75
|
+
v1Tasks.push(ButtonLinkRemovePropertyAriaCurrent);
|
|
76
|
+
v1Tasks.push(ButtonLinkRemovePropertyAriaLabel);
|
|
77
|
+
v1Tasks.push(ButtonLinkRenamePropertyIconOnlyToHideLabel);
|
|
78
|
+
v1Tasks.push(ButtonRemovePropertyAriaCurrent);
|
|
79
|
+
v1Tasks.push(ButtonRemovePropertyAriaLabel);
|
|
80
|
+
v1Tasks.push(ButtonRemovePropertyIconAlign);
|
|
81
|
+
v1Tasks.push(ButtonRenamePropertyIconOnlyToHideLabel);
|
|
82
|
+
v1Tasks.push(CardRenamePropertyHeadingToLabel);
|
|
83
|
+
v1Tasks.push(CardRenamePropertyHeadlineToLabel);
|
|
84
|
+
v1Tasks.push(DetailsRenamePropertySummaryToLabel);
|
|
85
|
+
v1Tasks.push(IconRemovePropertyPart);
|
|
86
|
+
v1Tasks.push(IconRenamePropertyAriaLabelToLabel);
|
|
87
|
+
v1Tasks.push(InputCheckboxRenamePropertyTypeToVariant);
|
|
88
|
+
v1Tasks.push(InputColorRenamePropertyListToSuggestions);
|
|
89
|
+
v1Tasks.push(InputDateRenamePropertyListToSuggestions);
|
|
90
|
+
v1Tasks.push(InputEmailRenamePropertyListToSuggestions);
|
|
91
|
+
v1Tasks.push(InputNumberRenamePropertyListToSuggestions);
|
|
92
|
+
v1Tasks.push(InputRadioRenamePropertyListToSuggestions);
|
|
93
|
+
v1Tasks.push(InputRangeRenamePropertyListToSuggestions);
|
|
94
|
+
v1Tasks.push(InputTextRenamePropertyListToSuggestions);
|
|
95
|
+
v1Tasks.push(LinkButtonRemovePropertyAriaControl);
|
|
96
|
+
v1Tasks.push(LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
97
|
+
v1Tasks.push(LinkButtonRemovePropertyAriaExpanded);
|
|
98
|
+
v1Tasks.push(LinkButtonRemovePropertyAriaLabel);
|
|
99
|
+
v1Tasks.push(LinkButtonRemovePropertyAriaSelected);
|
|
100
|
+
v1Tasks.push(LinkButtonRemovePropertyDisabled);
|
|
101
|
+
v1Tasks.push(LinkButtonRenamePropertyIconOnlyToHideLabel);
|
|
102
|
+
v1Tasks.push(LinkRemovePropertyAriaControl);
|
|
103
|
+
v1Tasks.push(LinkRenamePropertyAriaCurrentToListenAriaCurrent);
|
|
104
|
+
v1Tasks.push(LinkRemovePropertyAriaExpanded);
|
|
105
|
+
v1Tasks.push(LinkRemovePropertyAriaLabel);
|
|
106
|
+
v1Tasks.push(LinkRemovePropertyAriaSelected);
|
|
107
|
+
v1Tasks.push(LinkRemovePropertyDisabled);
|
|
108
|
+
v1Tasks.push(LinkRemovePropertyIconAlign);
|
|
109
|
+
v1Tasks.push(LinkRenamePropertyIconOnlyToHideLabel);
|
|
110
|
+
v1Tasks.push(LinkRemovePropertySelector);
|
|
111
|
+
v1Tasks.push(LinkRemovePropertyStealth);
|
|
112
|
+
v1Tasks.push(LinkRemovePropertyUseCase);
|
|
113
|
+
v1Tasks.push(LogoRenamePropertyAbbrToOrg);
|
|
114
|
+
v1Tasks.push(LinkGroupRenamePropertyAriaLabelToLabel);
|
|
115
|
+
v1Tasks.push(LinkGroupRenamePropertyHeadingToLabel);
|
|
116
|
+
v1Tasks.push(LinkGroupRemovePropertyHeading);
|
|
117
|
+
v1Tasks.push(LinkGroupRemovePropertyOrdered);
|
|
118
|
+
v1Tasks.push(ModalRenamePropertyAriaLabelToLabel);
|
|
119
|
+
v1Tasks.push(NavRenamePropertyAriaLabelToLabel);
|
|
120
|
+
v1Tasks.push(NavRenamePropertyCompactToHideLabel);
|
|
121
|
+
v1Tasks.push(NavRemovePropertyHasCompactButton);
|
|
122
|
+
v1Tasks.push(NavRemovePropertyVariant);
|
|
123
|
+
v1Tasks.push(NavRenamePropertyCompactToHideLabel);
|
|
124
|
+
v1Tasks.push(PaginationRenamePropertyCountToTotal);
|
|
125
|
+
v1Tasks.push(ProgressRenamePropertyTypeToVariant);
|
|
126
|
+
v1Tasks.push(QuoteRenamePropertyCaptionToLabel);
|
|
127
|
+
v1Tasks.push(SelectRenamePropertyHeightToRows);
|
|
128
|
+
v1Tasks.push(SelectRenamePropertyListToOptions);
|
|
129
|
+
v1Tasks.push(SkipNavButtonRenamePropertyAriaLabelToLabel);
|
|
130
|
+
v1Tasks.push(SpanRenamePropertyIconOnlyToHideLabel);
|
|
131
|
+
v1Tasks.push(SplitButtonRemovePropertyAriaLabel);
|
|
132
|
+
v1Tasks.push(TableRenamePropertyCaptionToLabel);
|
|
133
|
+
v1Tasks.push(TabsRenamePropertyAriaLabelToLabel);
|
|
134
|
+
v1Tasks.push(TabsRenamePropertyTabAlignToAlign);
|
|
135
|
+
v1Tasks.push(ToastRenamePropertyHeadingToLabel);
|
|
136
|
+
v1Tasks.push(VersionRenamePropertyVersionToLabel);
|
|
137
|
+
|
|
138
|
+
v1Tasks.push(LabelExpertSlot.getInstance('kol-heading', '_label', '^1'));
|
|
139
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-checkbox', '_label', '^1'));
|
|
140
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-color', '_label', '^1'));
|
|
141
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-date', '_label', '^1'));
|
|
142
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-email', '_label', '^1'));
|
|
143
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-file', '_label', '^1'));
|
|
144
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-number', '_label', '^1'));
|
|
145
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-password', '_label', '^1'));
|
|
146
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-radio', '_label', '^1'));
|
|
147
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-range', '_label', '^1'));
|
|
148
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-input-text', '_label', '^1'));
|
|
149
|
+
v1Tasks.push(LabelExpertSlot.getInstance('kol-link', '_label', '^1'));
|
|
150
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-select', '_label', '^1'));
|
|
151
|
+
// v1Tasks.push(LabelExpertSlot.getInstance('kol-textarea', '_label', '^1'));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
2
|
+
|
|
3
|
+
export const InputNumberRenamePropertyListToSuggestions = RenamePropertyNameTask.getInstance('kol-input-number', '_list', '_suggestions', '^1');
|
|
4
|
+
// @todo export const InputNumberRemovePropertyType = RemovePropertyNameTask.getInstance('kol-input-number', '_type', '^1');
|