@public-ui/visual-tests 1.7.0-rc.8 → 1.7.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/README.md +25 -140
- package/package.json +48 -45
- package/playwright.config.js +59 -0
- package/src/index.js +80 -0
- package/tests/axe-snapshots.spec.js +82 -0
- package/tests/sample-app.routes.js +387 -0
- package/tests/theme-snapshots.spec.js +70 -0
- package/src/index.ts +0 -33
- package/src/migrate/index.ts +0 -127
- package/src/migrate/runner/abstract-task.ts +0 -64
- package/src/migrate/runner/task-runner.ts +0 -163
- package/src/migrate/runner/tasks/common/GenericRenamePropertyTask.ts +0 -85
- package/src/migrate/runner/tasks/common/LabelExpertSlot.ts +0 -96
- package/src/migrate/runner/tasks/common/RemovePropertyNameTask.ts +0 -104
- package/src/migrate/runner/tasks/common/RenamePropertyNameTask.ts +0 -31
- package/src/migrate/runner/tasks/test/index.ts +0 -16
- package/src/migrate/runner/tasks/test/test-dummy.ts +0 -20
- package/src/migrate/runner/tasks/test/test-version-1.3.ts +0 -7
- package/src/migrate/runner/tasks/test/test-version-current.ts +0 -7
- package/src/migrate/runner/tasks/test/test-version-next-2.ts +0 -7
- package/src/migrate/runner/tasks/test/test-version-next-3.ts +0 -7
- package/src/migrate/runner/tasks/test/test-version-zero.ts +0 -7
- package/src/migrate/runner/tasks/v1/abbr.ts +0 -3
- package/src/migrate/runner/tasks/v1/accordion.ts +0 -3
- package/src/migrate/runner/tasks/v1/badge.ts +0 -6
- package/src/migrate/runner/tasks/v1/breadcrumb.ts +0 -3
- package/src/migrate/runner/tasks/v1/button-link.ts +0 -6
- package/src/migrate/runner/tasks/v1/button.ts +0 -8
- package/src/migrate/runner/tasks/v1/card.ts +0 -4
- package/src/migrate/runner/tasks/v1/details.ts +0 -3
- package/src/migrate/runner/tasks/v1/icon.ts +0 -5
- package/src/migrate/runner/tasks/v1/index.ts +0 -151
- package/src/migrate/runner/tasks/v1/input-checkbox.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-color.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-date.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-email.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-number.ts +0 -4
- package/src/migrate/runner/tasks/v1/input-radio.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-range.ts +0 -3
- package/src/migrate/runner/tasks/v1/input-text.ts +0 -3
- package/src/migrate/runner/tasks/v1/link-button.ts +0 -15
- package/src/migrate/runner/tasks/v1/link-group.ts +0 -7
- package/src/migrate/runner/tasks/v1/link.ts +0 -15
- package/src/migrate/runner/tasks/v1/logo.ts +0 -3
- package/src/migrate/runner/tasks/v1/modal.ts +0 -3
- package/src/migrate/runner/tasks/v1/nav.ts +0 -7
- package/src/migrate/runner/tasks/v1/pagination.ts +0 -3
- package/src/migrate/runner/tasks/v1/progress.ts +0 -3
- package/src/migrate/runner/tasks/v1/quote.ts +0 -3
- package/src/migrate/runner/tasks/v1/select.ts +0 -4
- package/src/migrate/runner/tasks/v1/skip-nav.ts +0 -3
- package/src/migrate/runner/tasks/v1/span.ts +0 -3
- package/src/migrate/runner/tasks/v1/split-button.ts +0 -3
- package/src/migrate/runner/tasks/v1/table.ts +0 -3
- package/src/migrate/runner/tasks/v1/tabs.ts +0 -4
- package/src/migrate/runner/tasks/v1/toast.ts +0 -3
- package/src/migrate/runner/tasks/v1/version.ts +0 -3
- package/src/migrate/runner/types.ts +0 -2
- package/src/migrate/shares/reuse.ts +0 -182
- package/src/migrate/types.ts +0 -2
- package/src/types.ts +0 -23
|
@@ -1,151 +0,0 @@
|
|
|
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'));
|
|
@@ -1,4 +0,0 @@
|
|
|
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');
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
-
|
|
4
|
-
export const LinkButtonRemovePropertyAriaControl = RemovePropertyNameTask.getInstance('kol-link-button', '_aria-control', '^1');
|
|
5
|
-
export const LinkButtonRenamePropertyAriaCurrentToListenAriaCurrent = RenamePropertyNameTask.getInstance(
|
|
6
|
-
'kol-link-button',
|
|
7
|
-
'_aria-current',
|
|
8
|
-
'_listen-aria-current',
|
|
9
|
-
'^1',
|
|
10
|
-
);
|
|
11
|
-
export const LinkButtonRemovePropertyAriaExpanded = RemovePropertyNameTask.getInstance('kol-link-button', '_aria-expanded', '^1');
|
|
12
|
-
export const LinkButtonRemovePropertyAriaLabel = RemovePropertyNameTask.getInstance('kol-link-button', '_aria-label', '^1');
|
|
13
|
-
export const LinkButtonRemovePropertyAriaSelected = RemovePropertyNameTask.getInstance('kol-link-button', '_aria-selected', '^1');
|
|
14
|
-
export const LinkButtonRemovePropertyDisabled = RemovePropertyNameTask.getInstance('kol-link-button', '_disabled', '^1');
|
|
15
|
-
export const LinkButtonRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask.getInstance('kol-link-button', '_icon-only', '_hide-label', '^1');
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
-
|
|
4
|
-
export const LinkGroupRenamePropertyAriaLabelToLabel = RenamePropertyNameTask.getInstance('kol-link-group', '_aria-label', '_label', '^1');
|
|
5
|
-
export const LinkGroupRenamePropertyHeadingToLabel = RenamePropertyNameTask.getInstance('kol-link-group', '_heading', '_label', '^1');
|
|
6
|
-
export const LinkGroupRemovePropertyHeading = RemovePropertyNameTask.getInstance('kol-link-group', '_heading', '^1', [LinkGroupRenamePropertyHeadingToLabel]);
|
|
7
|
-
export const LinkGroupRemovePropertyOrdered = RemovePropertyNameTask.getInstance('kol-link-group', '_ordered', '^1');
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
-
|
|
4
|
-
export const LinkRemovePropertyAriaControl = RemovePropertyNameTask.getInstance('kol-link', '_aria-control', '^1');
|
|
5
|
-
export const LinkRenamePropertyAriaCurrentToListenAriaCurrent = RenamePropertyNameTask.getInstance('kol-link', '_aria-current', '_listen-aria-current', '^1');
|
|
6
|
-
export const LinkRemovePropertyAriaExpanded = RemovePropertyNameTask.getInstance('kol-link', '_aria-expanded', '^1');
|
|
7
|
-
export const LinkRemovePropertyAriaLabel = RemovePropertyNameTask.getInstance('kol-link', '_aria-label', '^1');
|
|
8
|
-
export const LinkRemovePropertyAriaSelected = RemovePropertyNameTask.getInstance('kol-link', '_aria-selected', '^1');
|
|
9
|
-
export const LinkRemovePropertyDisabled = RemovePropertyNameTask.getInstance('kol-link', '_disabled', '^1');
|
|
10
|
-
// @todo: handle _icon-align in _icon
|
|
11
|
-
export const LinkRemovePropertyIconAlign = RemovePropertyNameTask.getInstance('kol-link', '_icon-align', '^1');
|
|
12
|
-
export const LinkRenamePropertyIconOnlyToHideLabel = RenamePropertyNameTask.getInstance('kol-link', '_icon-only', '_hide-label', '^1');
|
|
13
|
-
export const LinkRemovePropertySelector = RemovePropertyNameTask.getInstance('kol-link', '_selector', '^1');
|
|
14
|
-
export const LinkRemovePropertyStealth = RemovePropertyNameTask.getInstance('kol-link', '_stealth', '^1');
|
|
15
|
-
export const LinkRemovePropertyUseCase = RemovePropertyNameTask.getInstance('kol-link', '_use-case', '^1');
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RemovePropertyNameTask } from '../common/RemovePropertyNameTask';
|
|
2
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
3
|
-
|
|
4
|
-
export const NavRenamePropertyAriaLabelToLabel = RenamePropertyNameTask.getInstance('kol-nav', '_aria-label', '_label', '^1');
|
|
5
|
-
export const NavRenamePropertyCompactToHideLabel = RenamePropertyNameTask.getInstance('kol-nav', '_compact', '_hide-label', '^1');
|
|
6
|
-
export const NavRemovePropertyHasCompactButton = RemovePropertyNameTask.getInstance('kol-nav', '_has-compact-button', '^1');
|
|
7
|
-
export const NavRemovePropertyVariant = RemovePropertyNameTask.getInstance('kol-nav', '_variant', '^1');
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
2
|
-
|
|
3
|
-
export const SelectRenamePropertyHeightToRows = RenamePropertyNameTask.getInstance('kol-select', '_height', '_rows', '^1');
|
|
4
|
-
export const SelectRenamePropertyListToOptions = RenamePropertyNameTask.getInstance('kol-select', '_list', '_options', '^1');
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RenamePropertyNameTask } from '../common/RenamePropertyNameTask';
|
|
2
|
-
|
|
3
|
-
export const TabsRenamePropertyAriaLabelToLabel = RenamePropertyNameTask.getInstance('kol-tabs', '_aria-label', '_label', '^1');
|
|
4
|
-
export const TabsRenamePropertyTabAlignToAlign = RenamePropertyNameTask.getInstance('kol-tabs', '_tab-align', '_align', '^1');
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
|
|
5
|
-
import { FileExtension, PackageJson } from '../../types';
|
|
6
|
-
import { RemoveMode } from '../types';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This function is used to exit the process with an error message.
|
|
10
|
-
* @param {string} msg The error message
|
|
11
|
-
* @param {string} hint The hint message
|
|
12
|
-
* @returns {Error} The error object
|
|
13
|
-
*/
|
|
14
|
-
export function logAndCreateError(msg: string, hint?: string) {
|
|
15
|
-
const hintText = hint
|
|
16
|
-
? chalk.yellow(
|
|
17
|
-
`
|
|
18
|
-
ℹ️ `,
|
|
19
|
-
chalk.underline.bold(`Hinweis:`),
|
|
20
|
-
hint,
|
|
21
|
-
`
|
|
22
|
-
`,
|
|
23
|
-
)
|
|
24
|
-
: '';
|
|
25
|
-
console.log(
|
|
26
|
-
chalk.red(
|
|
27
|
-
chalk.underline.bold(`
|
|
28
|
-
Error:`),
|
|
29
|
-
`${msg}
|
|
30
|
-
`,
|
|
31
|
-
),
|
|
32
|
-
hintText,
|
|
33
|
-
`
|
|
34
|
-
👉 You can report this error to`,
|
|
35
|
-
chalk.blue(`https://github.com/public-ui/kolibri/issues/new?title=CLI:+`),
|
|
36
|
-
`
|
|
37
|
-
`,
|
|
38
|
-
);
|
|
39
|
-
// @todo process.exit(1); // makes `hint` undefined - ?!
|
|
40
|
-
return new Error();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Recursively searches for files with the specified extension in the specified directory.
|
|
45
|
-
* @param {string} dir The directory to search in
|
|
46
|
-
* @param {FileExtension | FileExtension[]} ext The extension to search for
|
|
47
|
-
* @returns {string[]} The found files
|
|
48
|
-
*/
|
|
49
|
-
export function filterFilesByExt(dir: string, ext: FileExtension | FileExtension[]): string[] {
|
|
50
|
-
ext = Array.isArray(ext) ? ext : [ext];
|
|
51
|
-
let files: string[] = [];
|
|
52
|
-
const dirPath = path.resolve(process.cwd(), dir);
|
|
53
|
-
fs.readdirSync(dirPath).forEach((file) => {
|
|
54
|
-
const fullPath = path.resolve(dir, file);
|
|
55
|
-
if (fs.lstatSync(fullPath).isDirectory()) {
|
|
56
|
-
files = files.concat(filterFilesByExt(fullPath, ext));
|
|
57
|
-
} else if (ext.includes(path.extname(fullPath).replace('.', '') as FileExtension)) {
|
|
58
|
-
files.push(fullPath);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
return files;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* This function is used to get the version of the package.json as string.
|
|
66
|
-
* @param {string} offsetPath The offset path to the package.json
|
|
67
|
-
* @returns {string} The package.json as string
|
|
68
|
-
*/
|
|
69
|
-
function readPackageString(offsetPath: string): string {
|
|
70
|
-
offsetPath = path.resolve(offsetPath, 'package.json');
|
|
71
|
-
if (!fs.existsSync(offsetPath)) {
|
|
72
|
-
throw logAndCreateError(`The following "package.json" does not exists: ${offsetPath}`);
|
|
73
|
-
}
|
|
74
|
-
return fs.readFileSync(offsetPath, 'utf8');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* This function is used to get the version of the package.json.
|
|
79
|
-
* @param {string} offsetPath The offset path to the package.json
|
|
80
|
-
* @returns {PackageJson} The package.json as object
|
|
81
|
-
*/
|
|
82
|
-
function readPackageJson(offsetPath: string): PackageJson {
|
|
83
|
-
const content = readPackageString(offsetPath);
|
|
84
|
-
let json: Record<string, unknown>;
|
|
85
|
-
try {
|
|
86
|
-
json = JSON.parse(content) as Record<string, unknown>;
|
|
87
|
-
} catch (err) {
|
|
88
|
-
throw logAndCreateError(`The following "package.json" content could not parse: ${content}`);
|
|
89
|
-
}
|
|
90
|
-
return json as PackageJson;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* This function is used to get the package manager install command.
|
|
95
|
-
* @param {string} baseDir The base directory to start searching for the package manager
|
|
96
|
-
* @returns {string} The package manager install command
|
|
97
|
-
*/
|
|
98
|
-
export function getPackageManagerInstallCommand(baseDir: string = process.cwd()) {
|
|
99
|
-
if (fs.existsSync(path.resolve(baseDir, 'pnpm-lock.yaml'))) return 'pnpm i';
|
|
100
|
-
if (fs.existsSync(path.resolve(baseDir, 'yarn.lock'))) return 'yarn';
|
|
101
|
-
if (fs.existsSync(path.resolve(baseDir, 'package-lock.json'))) return 'npm i';
|
|
102
|
-
baseDir = path.resolve(baseDir, '..');
|
|
103
|
-
if (baseDir === '/') {
|
|
104
|
-
throw logAndCreateError('Package manager could not detected.');
|
|
105
|
-
}
|
|
106
|
-
return getPackageManagerInstallCommand(baseDir);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export const isTagKebabCaseRegExp = /^kol-[a-z]+(-[a-z]+)*$/;
|
|
110
|
-
export const isPropertyKebabCaseRegExp = /^(data-removed-)?_[a-z]+(-[a-z]+)*$/;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Converts a kebab case string to a capital case string.
|
|
114
|
-
* @param {string} str The kebab case string
|
|
115
|
-
* @returns {string} The capital case string
|
|
116
|
-
*/
|
|
117
|
-
export function kebabToCapitalCase(str: string) {
|
|
118
|
-
return str
|
|
119
|
-
.split('-') // Split on hyphen
|
|
120
|
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()) // Capitalize each word
|
|
121
|
-
.join(''); // Join without space
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Converts a kebab case string to a camel case string.
|
|
126
|
-
* @param {string} str The kebab case string
|
|
127
|
-
* @returns {string} The camel case string
|
|
128
|
-
*/
|
|
129
|
-
export function kebabToCamelCase(str: string) {
|
|
130
|
-
return str
|
|
131
|
-
.split('-') // Split on hyphen
|
|
132
|
-
.map((word, index) => (index === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())) // Capitalize each word
|
|
133
|
-
.join(''); // Join without space
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export const MODIFIED_FILES = new Set<string>();
|
|
137
|
-
|
|
138
|
-
let REMOVE_MODE: RemoveMode = 'prefix';
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Sets the remove mode.
|
|
142
|
-
* @param {RemoveMode} mode The remove mode
|
|
143
|
-
*/
|
|
144
|
-
export function setRemoveMode(mode: RemoveMode): void {
|
|
145
|
-
REMOVE_MODE = mode;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Gets the remove mode.
|
|
150
|
-
* @returns {RemoveMode} The remove mode
|
|
151
|
-
*/
|
|
152
|
-
export function getRemoveMode(): RemoveMode {
|
|
153
|
-
return REMOVE_MODE;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export const getContentOfProjectPkgJson = (): string => {
|
|
157
|
-
try {
|
|
158
|
-
return readPackageString(path.resolve(process.cwd()));
|
|
159
|
-
} catch (err) {
|
|
160
|
-
throw logAndCreateError('Could not read content of project "package.json"!');
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
export const getVersionOfPublicUiComponents = (): string => {
|
|
164
|
-
try {
|
|
165
|
-
return readPackageJson(path.resolve(process.cwd(), 'node_modules/@public-ui/components')).version;
|
|
166
|
-
} catch (err) {
|
|
167
|
-
throw logAndCreateError(
|
|
168
|
-
'Could not get version of installed "@public-ui/components" package!',
|
|
169
|
-
'Check that you are in the root directory of your project and that the package "@public-ui/components" is installed.',
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
export const getVersionOfPublicUiKoliBriCli = (): string => {
|
|
174
|
-
try {
|
|
175
|
-
return readPackageJson(path.resolve(__dirname, '..', '..', '..')).version;
|
|
176
|
-
} catch (err) {
|
|
177
|
-
throw logAndCreateError(
|
|
178
|
-
'Could not get version of global installed "@public-ui/kolibri-cli" package!',
|
|
179
|
-
'Install the package with: npm i -g @public-ui/kolibri-cli',
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
};
|
package/src/migrate/types.ts
DELETED
package/src/types.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const FILE_EXTENSIONS = ['html', 'js', 'json', 'jsx', 'ts', 'tsx', 'vue'] as const;
|
|
2
|
-
export type FileExtension = (typeof FILE_EXTENSIONS)[number];
|
|
3
|
-
|
|
4
|
-
export const COMPONENT_FILE_EXTENSIONS: FileExtension[] = ['jsx', 'tsx', 'vue'];
|
|
5
|
-
export const CUSTOM_ELEMENT_FILE_EXTENSIONS: FileExtension[] = ['html', 'jsx', 'tsx', 'vue'];
|
|
6
|
-
export const MARKUP_EXTENSIONS: FileExtension[] = COMPONENT_FILE_EXTENSIONS.concat(CUSTOM_ELEMENT_FILE_EXTENSIONS);
|
|
7
|
-
|
|
8
|
-
export type PackageJson = {
|
|
9
|
-
name: string;
|
|
10
|
-
version: string;
|
|
11
|
-
scripts?: { [key: string]: string };
|
|
12
|
-
dependencies?: { [key: string]: string };
|
|
13
|
-
devDependencies?: { [key: string]: string };
|
|
14
|
-
peerDependencies?: { [key: string]: string };
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type Configuration = {
|
|
18
|
-
migrate?: {
|
|
19
|
-
tasks: {
|
|
20
|
-
[identifier: string]: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|