@vc-shell/vc-app-skill 2.0.0-alpha.32 → 2.0.0-alpha.33-pr220.455e322
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/CHANGELOG.md +59 -47
- package/README.md +18 -12
- package/package.json +4 -4
- package/runtime/VERSION +1 -1
- package/runtime/agents/api-analyzer.md +31 -16
- package/runtime/agents/blade-enhancer.md +15 -9
- package/runtime/agents/details-blade-generator.md +47 -31
- package/runtime/agents/list-blade-generator.md +21 -37
- package/runtime/agents/locales-generator.md +3 -0
- package/runtime/agents/migration-agent.md +94 -0
- package/runtime/agents/module-analyzer.md +2 -0
- package/runtime/agents/module-assembler.md +15 -0
- package/runtime/agents/promote-agent.md +15 -4
- package/runtime/agents/type-checker.md +11 -0
- package/runtime/knowledge/docs/_BUILD_HASH.md +1 -1
- package/runtime/knowledge/docs/core/api/platform.docs.md +30 -30
- package/runtime/knowledge/docs/core/blade-navigation/blade-nav-composables.docs.md +41 -41
- package/runtime/knowledge/docs/core/composables/bladeContext/index.docs.md +12 -10
- package/runtime/knowledge/docs/core/composables/useApiClient/useApiClient.docs.md +11 -14
- package/runtime/knowledge/docs/core/composables/useAppBarMobileButtons/useAppBarMobileButtons.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppBarWidget/useAppBarWidget.docs.md +35 -35
- package/runtime/knowledge/docs/core/composables/useAppInsights/useAppInsights.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useAssets/useAssets.docs.md +21 -18
- package/runtime/knowledge/docs/core/composables/useAssetsManager/useAssetsManager.docs.md +31 -27
- package/runtime/knowledge/docs/core/composables/useAsync/useAsync.docs.md +90 -61
- package/runtime/knowledge/docs/core/composables/useBeforeUnload/useBeforeUnload.docs.md +19 -18
- package/runtime/knowledge/docs/core/composables/useBlade/useBlade.docs.md +89 -68
- package/runtime/knowledge/docs/core/composables/useBladeForm/useBladeForm.docs.md +75 -19
- package/runtime/knowledge/docs/core/composables/useBladeRegistry/useBladeRegistry.docs.md +15 -15
- package/runtime/knowledge/docs/core/composables/useBladeWidgets/index.docs.md +74 -78
- package/runtime/knowledge/docs/core/composables/useBreadcrumbs/useBreadcrumbs.docs.md +11 -11
- package/runtime/knowledge/docs/core/composables/useConnectionStatus/useConnectionStatus.docs.md +27 -15
- package/runtime/knowledge/docs/core/composables/useDashboard/useDashboard.docs.md +30 -30
- package/runtime/knowledge/docs/core/composables/useDynamicProperties/useDynamicProperties.docs.md +34 -36
- package/runtime/knowledge/docs/core/composables/useErrorHandler/useErrorHandler.docs.md +44 -23
- package/runtime/knowledge/docs/core/composables/useFunctions/useFunctions.docs.md +14 -11
- package/runtime/knowledge/docs/core/composables/useKeyboardNavigation/useKeyboardNavigation.docs.md +47 -38
- package/runtime/knowledge/docs/core/composables/useLanguages/useLanguages.docs.md +37 -28
- package/runtime/knowledge/docs/core/composables/useLoading/useLoading.docs.md +23 -17
- package/runtime/knowledge/docs/core/composables/useMenuExpanded/index.docs.md +10 -10
- package/runtime/knowledge/docs/core/composables/useMenuService/useMenuService.docs.md +42 -42
- package/runtime/knowledge/docs/core/composables/useModificationTracker/useModificationTracker.docs.md +22 -12
- package/runtime/knowledge/docs/core/composables/useNotifications/useNotifications.docs.md +33 -41
- package/runtime/knowledge/docs/core/composables/usePermissions/usePermissions.docs.md +16 -16
- package/runtime/knowledge/docs/core/composables/usePopup/usePopup.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useResponsive/useResponsive.docs.md +32 -11
- package/runtime/knowledge/docs/core/composables/useSettings/useSettings.docs.md +24 -15
- package/runtime/knowledge/docs/core/composables/useSettingsMenu/useSettingsMenu.docs.md +7 -7
- package/runtime/knowledge/docs/core/composables/useSidebarState/useSidebarState.docs.md +32 -24
- package/runtime/knowledge/docs/core/composables/useSlowNetworkDetection/useSlowNetworkDetection.docs.md +21 -17
- package/runtime/knowledge/docs/core/composables/useTheme/useTheme.docs.md +24 -24
- package/runtime/knowledge/docs/core/composables/useToolbar/useToolbar.docs.md +28 -31
- package/runtime/knowledge/docs/core/composables/useUser/useUser.docs.md +43 -24
- package/runtime/knowledge/docs/core/composables/useUserManagement/useUserManagement.docs.md +68 -48
- package/runtime/knowledge/docs/core/composables/useWebVitals/useWebVitals.docs.md +19 -19
- package/runtime/knowledge/docs/core/composables/useWidgets/useWidgets.docs.md +42 -47
- package/runtime/knowledge/docs/core/directives/autofocus/autofocus.docs.md +10 -4
- package/runtime/knowledge/docs/core/directives/loading/loading.docs.md +35 -20
- package/runtime/knowledge/docs/core/notifications/notifications.docs.md +36 -35
- package/runtime/knowledge/docs/core/plugins/ai-agent/ai-agent.docs.md +38 -38
- package/runtime/knowledge/docs/core/plugins/extension-points/extension-points.docs.md +107 -91
- package/runtime/knowledge/docs/core/plugins/global-error-handler/global-error-handler.docs.md +10 -10
- package/runtime/knowledge/docs/core/plugins/i18n/i18n.docs.md +21 -23
- package/runtime/knowledge/docs/core/plugins/modularity/modularity.docs.md +98 -90
- package/runtime/knowledge/docs/core/plugins/permissions/permissions.docs.md +10 -16
- package/runtime/knowledge/docs/core/plugins/signalR/signalR.docs.md +9 -9
- package/runtime/knowledge/docs/core/plugins/validation/validation.docs.md +65 -22
- package/runtime/knowledge/docs/core/services/services.docs.md +19 -22
- package/runtime/knowledge/docs/core/types/types.docs.md +40 -40
- package/runtime/knowledge/docs/core/utilities/date/date-utilities.docs.md +27 -27
- package/runtime/knowledge/docs/core/utilities/shared-utilities.docs.md +23 -23
- package/runtime/knowledge/docs/core/utilities/thumbnail/thumbnail.docs.md +22 -25
- package/runtime/knowledge/docs/core/utilities/utilities.docs.md +64 -64
- package/runtime/knowledge/docs/injection-keys.docs.md +52 -51
- package/runtime/knowledge/docs/modules/assets-manager/assets-manager.docs.md +9 -9
- package/runtime/knowledge/docs/shell/_internal/popup/common/popup-common.docs.md +23 -43
- package/runtime/knowledge/docs/shell/auth/ChangePasswordPage/change-password-page.docs.md +102 -0
- package/runtime/knowledge/docs/shell/auth/ForgotPasswordPage/forgot-password-page.docs.md +5 -5
- package/runtime/knowledge/docs/shell/auth/InvitePage/invite-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/LoginPage/login-page.docs.md +7 -7
- package/runtime/knowledge/docs/shell/auth/ResetPasswordPage/reset-password-page.docs.md +8 -7
- package/runtime/knowledge/docs/shell/auth/sign-in/sign-in.docs.md +29 -13
- package/runtime/knowledge/docs/shell/components/change-password/change-password.docs.md +13 -16
- package/runtime/knowledge/docs/shell/components/change-password-button/change-password-button.docs.md +1 -7
- package/runtime/knowledge/docs/shell/components/error-interceptor/error-interceptor.docs.md +5 -5
- package/runtime/knowledge/docs/shell/components/language-selector/language-selector.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/logout-button/logout-button.docs.md +1 -1
- package/runtime/knowledge/docs/shell/components/notification-template/notification-template.docs.md +17 -9
- package/runtime/knowledge/docs/shell/components/settings-menu/settings-menu.docs.md +12 -18
- package/runtime/knowledge/docs/shell/components/settings-menu-item/settings-menu-item.docs.md +34 -65
- package/runtime/knowledge/docs/shell/components/sidebar/sidebar.docs.md +16 -26
- package/runtime/knowledge/docs/shell/components/theme-selector/theme-selector.docs.md +2 -2
- package/runtime/knowledge/docs/shell/components/user-dropdown-button/user-dropdown-button.docs.md +7 -9
- package/runtime/knowledge/docs/shell/dashboard/dashboard-charts/dashboard-charts.docs.md +30 -40
- package/runtime/knowledge/docs/shell/dashboard/dashboard-widget-card/dashboard-widget-card.docs.md +26 -19
- package/runtime/knowledge/docs/shell/dashboard/draggable-dashboard/draggable-dashboard.docs.md +15 -12
- package/runtime/knowledge/docs/ui/components/atoms/vc-badge/vc-badge.docs.md +15 -26
- package/runtime/knowledge/docs/ui/components/atoms/vc-banner/vc-banner.docs.md +21 -19
- package/runtime/knowledge/docs/ui/components/atoms/vc-button/vc-button.docs.md +83 -67
- package/runtime/knowledge/docs/ui/components/atoms/vc-card/vc-card.docs.md +104 -59
- package/runtime/knowledge/docs/ui/components/atoms/vc-col/vc-col.docs.md +28 -11
- package/runtime/knowledge/docs/ui/components/atoms/vc-container/vc-container.docs.md +20 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-hint/vc-hint.docs.md +26 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-icon/vc-icon.docs.md +30 -32
- package/runtime/knowledge/docs/ui/components/atoms/vc-image/vc-image.docs.md +25 -48
- package/runtime/knowledge/docs/ui/components/atoms/vc-label/vc-label.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/atoms/vc-link/vc-link.docs.md +23 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-loading/vc-loading.docs.md +22 -13
- package/runtime/knowledge/docs/ui/components/atoms/vc-progress/vc-progress.docs.md +33 -18
- package/runtime/knowledge/docs/ui/components/atoms/vc-row/vc-row.docs.md +56 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-scrollable-container/vc-scrollable-container.docs.md +28 -15
- package/runtime/knowledge/docs/ui/components/atoms/vc-skeleton/vc-skeleton.docs.md +40 -20
- package/runtime/knowledge/docs/ui/components/atoms/vc-status/vc-status.docs.md +25 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-status-icon/vc-status-icon.docs.md +40 -14
- package/runtime/knowledge/docs/ui/components/atoms/vc-tooltip/vc-tooltip.docs.md +54 -42
- package/runtime/knowledge/docs/ui/components/atoms/vc-video/vc-video.docs.md +17 -17
- package/runtime/knowledge/docs/ui/components/atoms/vc-widget/vc-widget.docs.md +21 -21
- package/runtime/knowledge/docs/ui/components/molecules/multilanguage-selector/multilanguage-selector.docs.md +23 -10
- package/runtime/knowledge/docs/ui/components/molecules/vc-accordion/vc-accordion.docs.md +59 -44
- package/runtime/knowledge/docs/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.docs.md +23 -20
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox/vc-checkbox.docs.md +96 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-checkbox-group/vc-checkbox-group.docs.md +26 -35
- package/runtime/knowledge/docs/ui/components/molecules/vc-color-input/vc-color-input.docs.md +69 -22
- package/runtime/knowledge/docs/ui/components/molecules/vc-date-picker/vc-date-picker.docs.md +58 -72
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown/vc-dropdown.docs.md +91 -85
- package/runtime/knowledge/docs/ui/components/molecules/vc-dropdown-panel/vc-dropdown-panel.docs.md +38 -42
- package/runtime/knowledge/docs/ui/components/molecules/vc-editor/vc-editor.docs.md +60 -72
- package/runtime/knowledge/docs/ui/components/molecules/vc-field/vc-field.docs.md +65 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-file-upload/vc-file-upload.docs.md +46 -49
- package/runtime/knowledge/docs/ui/components/molecules/vc-form/vc-form.docs.md +35 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-image-tile/vc-image-tile.docs.md +38 -41
- package/runtime/knowledge/docs/ui/components/molecules/vc-input/vc-input.docs.md +115 -130
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-currency/vc-input-currency.docs.md +53 -87
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-dropdown/vc-input-dropdown.docs.md +56 -63
- package/runtime/knowledge/docs/ui/components/molecules/vc-input-group/vc-input-group.docs.md +29 -24
- package/runtime/knowledge/docs/ui/components/molecules/vc-menu/vc-menu.docs.md +32 -28
- package/runtime/knowledge/docs/ui/components/molecules/vc-multivalue/vc-multivalue.docs.md +63 -64
- package/runtime/knowledge/docs/ui/components/molecules/vc-pagination/vc-pagination.docs.md +28 -26
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-button/vc-radio-button.docs.md +59 -19
- package/runtime/knowledge/docs/ui/components/molecules/vc-radio-group/vc-radio-group.docs.md +25 -34
- package/runtime/knowledge/docs/ui/components/molecules/vc-rating/vc-rating.docs.md +42 -32
- package/runtime/knowledge/docs/ui/components/molecules/vc-select/vc-select.docs.md +78 -82
- package/runtime/knowledge/docs/ui/components/molecules/vc-slider/vc-slider.docs.md +25 -15
- package/runtime/knowledge/docs/ui/components/molecules/vc-switch/vc-switch.docs.md +59 -63
- package/runtime/knowledge/docs/ui/components/molecules/vc-textarea/vc-textarea.docs.md +57 -69
- package/runtime/knowledge/docs/ui/components/molecules/vc-toast/vc-toast.docs.md +58 -57
- package/runtime/knowledge/docs/ui/components/organisms/vc-app/vc-app.docs.md +49 -26
- package/runtime/knowledge/docs/ui/components/organisms/vc-auth-layout/vc-auth-layout.docs.md +82 -28
- package/runtime/knowledge/docs/ui/components/organisms/vc-blade/vc-blade.docs.md +120 -75
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/composables/table-composables.docs.md +30 -44
- package/runtime/knowledge/docs/ui/components/organisms/vc-data-table/vc-data-table.docs.md +536 -365
- package/runtime/knowledge/docs/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.docs.md +35 -52
- package/runtime/knowledge/docs/ui/components/organisms/vc-gallery/vc-gallery.docs.md +33 -62
- package/runtime/knowledge/docs/ui/components/organisms/vc-image-upload/vc-image-upload.docs.md +17 -23
- package/runtime/knowledge/docs/ui/components/organisms/vc-popup/vc-popup.docs.md +109 -68
- package/runtime/knowledge/docs/ui/components/organisms/vc-sidebar/vc-sidebar.docs.md +82 -44
- package/runtime/knowledge/docs/ui/composables/ui-composables.docs.md +8 -8
- package/runtime/knowledge/docs/ui/composables/useDataTablePagination.docs.md +164 -0
- package/runtime/knowledge/docs/ui/composables/useDataTableSort.docs.md +34 -26
- package/runtime/knowledge/docs/ui/composables/useTableSelection.docs.md +48 -40
- package/runtime/knowledge/docs/ui/composables/useTableSort.docs.md +30 -17
- package/runtime/knowledge/docs/ui/types/ui-types.docs.md +40 -29
- package/runtime/knowledge/examples/offers-module.md +15 -13
- package/runtime/knowledge/examples/team-module.md +82 -119
- package/runtime/knowledge/examples/videos-module.md +44 -17
- package/runtime/knowledge/index.md +22 -0
- package/runtime/knowledge/migration-prompts/blade-form-migration.md +255 -0
- package/runtime/knowledge/migration-prompts/blade-props-migration.md +194 -0
- package/runtime/knowledge/migration-prompts/datatable-migration.md +801 -0
- package/runtime/knowledge/migration-prompts/icon-migration.md +97 -0
- package/runtime/knowledge/migration-prompts/manual-migration-audit.md +117 -0
- package/runtime/knowledge/migration-prompts/notifications-migration.md +223 -0
- package/runtime/knowledge/migration-prompts/nswag-migration.md +244 -0
- package/runtime/knowledge/migration-prompts/use-assets-migration.md +164 -0
- package/runtime/knowledge/migration-prompts/use-data-table-pagination-migration.md +176 -0
- package/runtime/knowledge/migration-prompts/widgets-migration.md +178 -0
- package/runtime/knowledge/patterns/assets-management.md +20 -20
- package/runtime/knowledge/patterns/blade-navigation.md +7 -14
- package/runtime/knowledge/patterns/blade-widget.md +19 -17
- package/runtime/knowledge/patterns/child-blade-flow.md +19 -7
- package/runtime/knowledge/patterns/composable-details.md +20 -50
- package/runtime/knowledge/patterns/composable-list.md +43 -31
- package/runtime/knowledge/patterns/dashboard-widget.md +14 -16
- package/runtime/knowledge/patterns/datatable-pattern.md +521 -0
- package/runtime/knowledge/patterns/details-blade-pattern.md +78 -116
- package/runtime/knowledge/patterns/extension-points-usage.md +53 -44
- package/runtime/knowledge/patterns/form-validation.md +28 -64
- package/runtime/knowledge/patterns/list-blade-pattern.md +33 -21
- package/runtime/knowledge/patterns/module-structure.md +7 -1
- package/runtime/knowledge/patterns/multilanguage-fields.md +8 -14
- package/runtime/knowledge/patterns/notification-template.md +21 -14
- package/runtime/knowledge/patterns/signalr-notifications.md +30 -32
- package/runtime/knowledge/patterns/toolbar-pattern.md +18 -20
- package/runtime/vc-app.md +354 -49
- package/runtime/knowledge/docs/core/constants/constants.docs.md +0 -185
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: icon-migration
|
|
3
|
+
description: AI transformation rules for migrating non-lucide icons to lucide equivalents.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Icon Migration: material-/bi-/fa- → lucide-
|
|
7
|
+
|
|
8
|
+
All icons in the v2 framework must use the `lucide-` prefix. Replace all `material-*`, `bi-*`, and `fa-*` icons with their lucide equivalents.
|
|
9
|
+
|
|
10
|
+
## RULE 1: Replace Icon Strings
|
|
11
|
+
|
|
12
|
+
Scan ALL `.vue` and `.ts` files in the affected module for icon strings. For each non-lucide icon, choose the closest semantic match from the lucide icon set (https://lucide.dev/icons).
|
|
13
|
+
|
|
14
|
+
When choosing a replacement:
|
|
15
|
+
|
|
16
|
+
- Match by **meaning**, not by visual similarity — e.g., `material-delete` → `lucide-trash-2` (both mean "delete")
|
|
17
|
+
- Use the most specific icon available — e.g., `material-person_add` → `lucide-user-plus` (not just `lucide-user`)
|
|
18
|
+
- When no perfect match exists, pick the closest conceptual equivalent and note it in the report
|
|
19
|
+
|
|
20
|
+
**BEFORE:**
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
const bladeToolbar = computed((): IBladeToolbar[] => [
|
|
24
|
+
{
|
|
25
|
+
id: "refresh",
|
|
26
|
+
icon: "material-refresh",
|
|
27
|
+
title: t("...REFRESH"),
|
|
28
|
+
clickHandler: reload,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "add",
|
|
32
|
+
icon: "material-add",
|
|
33
|
+
title: t("...ADD"),
|
|
34
|
+
clickHandler: addItem,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "delete",
|
|
38
|
+
icon: "material-delete",
|
|
39
|
+
title: t("...DELETE"),
|
|
40
|
+
clickHandler: deleteItems,
|
|
41
|
+
},
|
|
42
|
+
]);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**AFTER:**
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const bladeToolbar = computed((): IBladeToolbar[] => [
|
|
49
|
+
{
|
|
50
|
+
id: "refresh",
|
|
51
|
+
icon: "lucide-refresh-cw",
|
|
52
|
+
title: t("...REFRESH"),
|
|
53
|
+
clickHandler: reload,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "add",
|
|
57
|
+
icon: "lucide-plus",
|
|
58
|
+
title: t("...ADD"),
|
|
59
|
+
clickHandler: addItem,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "delete",
|
|
63
|
+
icon: "lucide-trash-2",
|
|
64
|
+
title: t("...DELETE"),
|
|
65
|
+
clickHandler: deleteItems,
|
|
66
|
+
},
|
|
67
|
+
]);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## RULE 2: Where Icons Appear
|
|
71
|
+
|
|
72
|
+
Icons appear in these contexts — check ALL of them:
|
|
73
|
+
|
|
74
|
+
1. **Toolbar items:** `icon: "material-*"` in `IBladeToolbar[]`
|
|
75
|
+
2. **Menu items in defineBlade:** `icon: "material-*"` in `menuItem` config
|
|
76
|
+
3. **VcIcon components:** `<VcIcon icon="material-*" />`
|
|
77
|
+
4. **Widget declarations:** `icon: "material-*"` in `useBladeWidgets()` config
|
|
78
|
+
5. **Action builders / row actions:** `icon: "material-*"` in action definitions
|
|
79
|
+
6. **Empty state configs:** `icon: "material-*"` in `:empty-state` or `:not-found-state`
|
|
80
|
+
7. **Any other string literal** containing `material-`, `bi-`, or `fa-` prefixes
|
|
81
|
+
|
|
82
|
+
## RULE 3: Perform Replacements In-Place
|
|
83
|
+
|
|
84
|
+
This is a **mechanical replacement** — do not restructure code. For each icon string found:
|
|
85
|
+
|
|
86
|
+
1. Identify the icon name (e.g., `material-edit_square`)
|
|
87
|
+
2. Determine the semantic meaning (e.g., "edit with square indicator")
|
|
88
|
+
3. Find the best lucide match (e.g., `lucide-square-pen`)
|
|
89
|
+
4. Replace the string in-place
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
|
|
93
|
+
After migration:
|
|
94
|
+
|
|
95
|
+
1. Search for remaining non-lucide icons: `grep -rn '"material-\|"bi-\|fa-' src/modules/`
|
|
96
|
+
2. Verify no results (all icons should be `lucide-*`)
|
|
97
|
+
3. Run the app and visually confirm icons render correctly
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: manual-migration-audit
|
|
3
|
+
description: AI transformation rules for findings emitted by manual-migration-audit transform.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Manual Migration Audit Fixes
|
|
7
|
+
|
|
8
|
+
Apply targeted refactors for diagnostics emitted by `manual-migration-audit`.
|
|
9
|
+
|
|
10
|
+
## RULE 1: `useExternalWidgets` is removed
|
|
11
|
+
|
|
12
|
+
Replace `useExternalWidgets(...)` with module-level widget composables based on `useBladeWidgets()`.
|
|
13
|
+
|
|
14
|
+
**BEFORE:**
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { useExternalWidgets } from "@vc-shell/framework";
|
|
18
|
+
|
|
19
|
+
useExternalWidgets({ bladeId, item });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**AFTER:**
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { useEntityWidgets } from "../widgets";
|
|
26
|
+
|
|
27
|
+
useEntityWidgets({
|
|
28
|
+
item,
|
|
29
|
+
isVisible: computed(() => !!param.value),
|
|
30
|
+
disabled,
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If widget migration is not yet done, perform it first (`widgets-migration` topic).
|
|
35
|
+
|
|
36
|
+
## RULE 2: Replace `moment` usage with framework date utilities
|
|
37
|
+
|
|
38
|
+
**BEFORE:**
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import moment from "moment";
|
|
42
|
+
|
|
43
|
+
const formatted = moment(item.value.createdDate).format("L LT");
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**AFTER:**
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { formatDateWithPattern } from "@vc-shell/framework";
|
|
50
|
+
|
|
51
|
+
const formatted = formatDateWithPattern(item.value.createdDate, "L LT", currentLocale.value);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
For relative dates, use `formatDateRelative` from `@vc-shell/framework`.
|
|
55
|
+
|
|
56
|
+
## RULE 3: Replace `useFunctions().debounce` with `useDebounceFn`
|
|
57
|
+
|
|
58
|
+
**BEFORE:**
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { useFunctions } from "@vc-shell/framework";
|
|
62
|
+
|
|
63
|
+
const { debounce } = useFunctions();
|
|
64
|
+
const debouncedSearch = debounce(runSearch, 300);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**AFTER:**
|
|
68
|
+
|
|
69
|
+
```typescript
|
|
70
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
71
|
+
|
|
72
|
+
const debouncedSearch = useDebounceFn(runSearch, 300);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## RULE 4: Replace `closeBlade()` with `closeSelf()` from `useBlade()`
|
|
76
|
+
|
|
77
|
+
**BEFORE:**
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
const { closeBlade } = useBlade();
|
|
81
|
+
await closeBlade();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**AFTER:**
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const { closeSelf } = useBlade();
|
|
88
|
+
await closeSelf();
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
If `closeBlade(index)` was used to close by index, refactor to close current blade only (or use explicit navigation logic) — do not keep index-based close calls.
|
|
92
|
+
|
|
93
|
+
## RULE 5: Consolidate multiple `useBlade()` calls per file
|
|
94
|
+
|
|
95
|
+
Use one `useBlade()` destructuring per component/composable unless there is a strong technical reason.
|
|
96
|
+
|
|
97
|
+
**BEFORE:**
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
const { openBlade } = useBlade();
|
|
101
|
+
const { closeSelf } = useBlade();
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**AFTER:**
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
const { openBlade, closeSelf, callParent, param } = useBlade();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Verification
|
|
111
|
+
|
|
112
|
+
After migration:
|
|
113
|
+
|
|
114
|
+
1. Search and remove stale APIs: `useExternalWidgets`, `import moment`, `useFunctions(`, `closeBlade(`.
|
|
115
|
+
2. Search for duplicate `useBlade()` calls in the same file and consolidate.
|
|
116
|
+
3. Run `npx vue-tsc --noEmit`.
|
|
117
|
+
4. Run `yarn build`.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: notifications-migration
|
|
3
|
+
description: AI transformation rules for notification template migration to new defineAppModule config.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Notifications Migration: useNotifications → useBladeNotifications
|
|
7
|
+
|
|
8
|
+
Migrate from `createAppModule(pages, locales, notificationTemplates)` to `defineAppModule({ notifications })`, and from `useNotifications()` to `useBladeNotifications()`.
|
|
9
|
+
|
|
10
|
+
## RULE 1: Move Notification Directory
|
|
11
|
+
|
|
12
|
+
Move `components/notifications/` to `notifications/` at the module root. Remove the barrel `index.ts` that re-exports all templates.
|
|
13
|
+
|
|
14
|
+
**BEFORE:**
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
my-module/
|
|
18
|
+
components/
|
|
19
|
+
notifications/
|
|
20
|
+
index.ts ← barrel: export { default as MyEvent } from "./MyEvent.vue"
|
|
21
|
+
MyEvent.vue
|
|
22
|
+
pages/
|
|
23
|
+
index.ts
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**AFTER:**
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
my-module/
|
|
30
|
+
notifications/
|
|
31
|
+
MyEvent.vue ← no barrel index.ts needed
|
|
32
|
+
pages/
|
|
33
|
+
index.ts
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## RULE 2: Update Notification Template
|
|
37
|
+
|
|
38
|
+
Remove `defineProps`, remove `defineOptions({ inheritAttrs: false })`, and use `useNotificationContext()` composable instead of props.
|
|
39
|
+
|
|
40
|
+
**BEFORE:**
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<template>
|
|
44
|
+
<NotificationTemplate
|
|
45
|
+
:color="color"
|
|
46
|
+
:title="notification.title"
|
|
47
|
+
:icon="icon"
|
|
48
|
+
:notification="notification"
|
|
49
|
+
@click="onClick"
|
|
50
|
+
>
|
|
51
|
+
<VcHint>{{ notification.description }}</VcHint>
|
|
52
|
+
</NotificationTemplate>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts" setup>
|
|
56
|
+
import { PushNotification, NotificationTemplate } from "@vc-shell/framework";
|
|
57
|
+
|
|
58
|
+
export interface Props {
|
|
59
|
+
notification: PushNotification;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
defineProps<Props>();
|
|
63
|
+
defineOptions({ inheritAttrs: false });
|
|
64
|
+
|
|
65
|
+
const color = computed(() => "var(--primary-500)");
|
|
66
|
+
const icon = "lucide-bell";
|
|
67
|
+
|
|
68
|
+
function onClick() {
|
|
69
|
+
// handle click
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**AFTER:**
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<template>
|
|
78
|
+
<NotificationTemplate
|
|
79
|
+
:color="color"
|
|
80
|
+
:title="notification.title"
|
|
81
|
+
:icon="icon"
|
|
82
|
+
:notification="notification"
|
|
83
|
+
@click="onClick"
|
|
84
|
+
>
|
|
85
|
+
<VcHint>{{ notification.description }}</VcHint>
|
|
86
|
+
</NotificationTemplate>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<script lang="ts" setup>
|
|
90
|
+
import { PushNotification, useBlade, NotificationTemplate, useNotificationContext } from "@vc-shell/framework";
|
|
91
|
+
import { computed } from "vue";
|
|
92
|
+
|
|
93
|
+
interface IMyNotification extends PushNotification {
|
|
94
|
+
customField?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const notificationRef = useNotificationContext<IMyNotification>();
|
|
98
|
+
const notification = computed(() => notificationRef.value);
|
|
99
|
+
|
|
100
|
+
const color = computed(() => "var(--primary-500)");
|
|
101
|
+
const icon = "lucide-bell";
|
|
102
|
+
|
|
103
|
+
function onClick() {
|
|
104
|
+
// handle click
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## RULE 3: Update Module index.ts
|
|
110
|
+
|
|
111
|
+
Replace `createAppModule(pages, locales, notificationTemplates)` with `defineAppModule({ notifications })`. Import each notification template individually instead of using a barrel `import *`.
|
|
112
|
+
|
|
113
|
+
**BEFORE:**
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
import * as pages from "./pages";
|
|
117
|
+
import * as locales from "./locales";
|
|
118
|
+
import * as notificationTemplates from "./components/notifications";
|
|
119
|
+
|
|
120
|
+
export default createAppModule(pages, locales, notificationTemplates);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**AFTER:**
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
import * as pages from "./pages";
|
|
127
|
+
import * as locales from "./locales";
|
|
128
|
+
import MyCreatedEvent from "./notifications/MyCreatedEvent.vue";
|
|
129
|
+
import MyDeletedEvent from "./notifications/MyDeletedEvent.vue";
|
|
130
|
+
import { defineAppModule } from "@vc-shell/framework";
|
|
131
|
+
|
|
132
|
+
export default defineAppModule({
|
|
133
|
+
blades: pages,
|
|
134
|
+
locales,
|
|
135
|
+
notifications: {
|
|
136
|
+
MyCreatedDomainEvent: {
|
|
137
|
+
template: MyCreatedEvent,
|
|
138
|
+
toast: { mode: "auto" },
|
|
139
|
+
},
|
|
140
|
+
MyDeletedDomainEvent: {
|
|
141
|
+
template: MyDeletedEvent,
|
|
142
|
+
toast: { mode: "auto", severity: "warning" },
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Toast options:
|
|
149
|
+
|
|
150
|
+
- `mode`: `"auto"` (show and auto-dismiss), `"progress"` (show with progress bar), `"silent"` (no toast)
|
|
151
|
+
- `severity`: `"info"` (default), `"warning"`, `"error"`, `"critical"`
|
|
152
|
+
|
|
153
|
+
## RULE 4: Replace useNotifications in Blades
|
|
154
|
+
|
|
155
|
+
Replace `useNotifications()` with `useBladeNotifications()`. Remove `setNotificationHandler`, `moduleNotifications` watch, and `notifyType` from `defineOptions`.
|
|
156
|
+
|
|
157
|
+
**BEFORE:**
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
defineOptions({
|
|
161
|
+
name: "MyBlade",
|
|
162
|
+
notifyType: "MyDomainEvent",
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const { markAsRead, setNotificationHandler, moduleNotifications } = useNotifications("MyDomainEvent");
|
|
166
|
+
|
|
167
|
+
setNotificationHandler((message) => {
|
|
168
|
+
if (message.title) {
|
|
169
|
+
notification.success(message.title, {
|
|
170
|
+
onClose() {
|
|
171
|
+
markAsRead(message);
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// or watch pattern:
|
|
178
|
+
watch(
|
|
179
|
+
moduleNotifications,
|
|
180
|
+
(newVal) => {
|
|
181
|
+
// manual toast management
|
|
182
|
+
},
|
|
183
|
+
{ deep: true },
|
|
184
|
+
);
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**AFTER:**
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
defineOptions({
|
|
191
|
+
name: "MyBlade",
|
|
192
|
+
// notifyType removed
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
const { messages } = useBladeNotifications({
|
|
196
|
+
types: ["MyDomainEvent"],
|
|
197
|
+
onMessage: () => reloadData(),
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
For progress notifications:
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
// Module config: notifications: { MyProgressEvent: { toast: { mode: "progress" } } }
|
|
205
|
+
useBladeNotifications({
|
|
206
|
+
types: ["MyProgressEvent"],
|
|
207
|
+
filter: (msg) => msg.entityId === param.value,
|
|
208
|
+
onMessage: (msg) => refreshData(msg),
|
|
209
|
+
});
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Verification
|
|
213
|
+
|
|
214
|
+
After migration:
|
|
215
|
+
|
|
216
|
+
1. Run `npx tsc --noEmit` to verify no TypeScript errors
|
|
217
|
+
2. Confirm notification templates render correctly in the notification panel
|
|
218
|
+
3. Confirm toast notifications appear for configured event types
|
|
219
|
+
4. Confirm `useBladeNotifications` triggers `onMessage` callback when events arrive
|
|
220
|
+
5. Confirm `notifyType` is removed from all `defineOptions` calls
|
|
221
|
+
6. Confirm `components/notifications/` directory is removed and `notifications/` exists at module root
|
|
222
|
+
7. Confirm no remaining imports of `useNotifications`, `setNotificationHandler`, or `moduleNotifications`
|
|
223
|
+
8. Confirm no remaining `defineProps` or `defineOptions({ inheritAttrs: false })` in notification templates
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: nswag-migration
|
|
3
|
+
description: AI transformation rules for NSwag class→interface DTO migration.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# NSwag API Client Migration: Class to Interface
|
|
7
|
+
|
|
8
|
+
You are tasked with fixing TypeScript errors caused by migrating NSwag-generated API clients from class-based to interface-based data models.
|
|
9
|
+
|
|
10
|
+
**Context:**
|
|
11
|
+
|
|
12
|
+
- API Client CLASSES (e.g., `*Client` classes) remain unchanged — they still have constructors
|
|
13
|
+
- DATA MODEL types (DTOs, Commands, Queries, etc.) are now INTERFACES instead of classes
|
|
14
|
+
- Interfaces cannot be instantiated with `new` — use object literals with type assertions instead
|
|
15
|
+
|
|
16
|
+
## RULE 1: Import Name Changes (Remove "I" Prefix)
|
|
17
|
+
|
|
18
|
+
**Error:** `error TS2724: has no exported member named 'IXxx'. Did you mean 'Xxx'?`
|
|
19
|
+
|
|
20
|
+
**Fix:** Remove the "I" prefix from all data model interface imports.
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
// BEFORE
|
|
24
|
+
import { IOffer, ISeller, ISearchQuery } from "@your-api-package";
|
|
25
|
+
|
|
26
|
+
// AFTER
|
|
27
|
+
import { Offer, Seller, SearchQuery } from "@your-api-package";
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Also update all type annotations in the file:
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
// BEFORE
|
|
34
|
+
const item = ref<IOffer>(...);
|
|
35
|
+
function process(data: IOffer): IOffer { ... }
|
|
36
|
+
|
|
37
|
+
// AFTER
|
|
38
|
+
const item = ref<Offer>(...);
|
|
39
|
+
function process(data: Offer): Offer { ... }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## RULE 2: Class Instantiation → Object Literals
|
|
43
|
+
|
|
44
|
+
**Error:** `error TS2693: 'Xxx' only refers to a type, but is being used as a value here`
|
|
45
|
+
|
|
46
|
+
**Fix:** Replace `new TypeName({...})` with `{...} as TypeName` or typed variable declaration.
|
|
47
|
+
|
|
48
|
+
**Pattern A — Command/Query objects:**
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// BEFORE
|
|
52
|
+
const command = new CreateCommand({
|
|
53
|
+
id: "123",
|
|
54
|
+
name: "Test",
|
|
55
|
+
details: new Details({ value: 100 }),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// AFTER
|
|
59
|
+
const command: CreateCommand = {
|
|
60
|
+
id: "123",
|
|
61
|
+
name: "Test",
|
|
62
|
+
details: { value: 100 } as Details,
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Pattern B — Search/Query criteria:**
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// BEFORE
|
|
70
|
+
const criteria = new SearchQuery({
|
|
71
|
+
take: 20,
|
|
72
|
+
skip: 0,
|
|
73
|
+
sort: "name:asc",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// AFTER
|
|
77
|
+
const criteria: SearchQuery = {
|
|
78
|
+
take: 20,
|
|
79
|
+
skip: 0,
|
|
80
|
+
sort: "name:asc",
|
|
81
|
+
};
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Pattern C — Empty/default objects:**
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// BEFORE
|
|
88
|
+
const item = ref<IEntity>(new Entity());
|
|
89
|
+
|
|
90
|
+
// AFTER
|
|
91
|
+
const item = ref<Entity>({} as Entity);
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Pattern D — Nested objects:**
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// BEFORE
|
|
98
|
+
const data = ref(new Parent({ child: new Child() }));
|
|
99
|
+
|
|
100
|
+
// AFTER
|
|
101
|
+
const data = ref<Parent>({
|
|
102
|
+
child: {} as Child,
|
|
103
|
+
} as Parent);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**Pattern E — With Vue reactive():**
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
// BEFORE
|
|
110
|
+
const item = ref<Order>(reactive(new Order()));
|
|
111
|
+
|
|
112
|
+
// AFTER
|
|
113
|
+
const item = ref<Order>(reactive({} as Order));
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## RULE 3: Factory Functions for Framework Callbacks
|
|
117
|
+
|
|
118
|
+
**Error:** `error TS2693: 'PropertyValue' only refers to a type, but is being used as a value here`
|
|
119
|
+
|
|
120
|
+
When a framework function expects a constructor function (callable with `new`), create factory functions:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// BEFORE — Framework expects constructor
|
|
124
|
+
const { loadItems } = useFrameworkHook<Type1, Type2>(fetchFunction, ItemClass, OtherClass);
|
|
125
|
+
|
|
126
|
+
// AFTER — Create factory functions
|
|
127
|
+
const createItem = (data?: Partial<ItemType>): ItemType => ({ ...data }) as ItemType;
|
|
128
|
+
|
|
129
|
+
const createOther = (data?: Partial<OtherType>): OtherType => ({ ...data }) as OtherType;
|
|
130
|
+
|
|
131
|
+
const { loadItems } = useFrameworkHook<Type1, Type2>(fetchFunction, createItem, createOther);
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## RULE 4: Image Import Conflict with Global DOM Type
|
|
135
|
+
|
|
136
|
+
**Error:** `error TS2866: Import 'Image' conflicts with global value used in this file`
|
|
137
|
+
|
|
138
|
+
**Fix:** Use type-only import or rename:
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
// BEFORE
|
|
142
|
+
import { Image, Entity } from "@your-api-package";
|
|
143
|
+
|
|
144
|
+
// AFTER — Option 1: Type-only import
|
|
145
|
+
import { type Image, Entity } from "@your-api-package";
|
|
146
|
+
|
|
147
|
+
// AFTER — Option 2: Rename import
|
|
148
|
+
import { Image as ApiImage, Entity } from "@your-api-package";
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## RULE 5: Implicit Any Types
|
|
152
|
+
|
|
153
|
+
**Error:** `error TS7006: Parameter 'x' implicitly has an 'any' type`
|
|
154
|
+
|
|
155
|
+
**Fix:** Add explicit type annotations to callback parameters:
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
// BEFORE
|
|
159
|
+
items.map((x) => x.id);
|
|
160
|
+
items.filter((item) => item.active);
|
|
161
|
+
data.forEach((d) => process(d));
|
|
162
|
+
|
|
163
|
+
// AFTER
|
|
164
|
+
items.map((x: ItemType) => x.id);
|
|
165
|
+
items.filter((item: ItemType) => item.active);
|
|
166
|
+
data.forEach((d: DataType) => process(d));
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## RULE 6: Type Mismatch in Function Arguments
|
|
170
|
+
|
|
171
|
+
**Error:** `error TS2345: Argument of type 'X' is not assignable to parameter of type 'Y'`
|
|
172
|
+
|
|
173
|
+
Check if the function signature expects a different type (often an ID instead of a full object):
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
// BEFORE
|
|
177
|
+
someFunction(asset); // asset is full object
|
|
178
|
+
|
|
179
|
+
// AFTER
|
|
180
|
+
someFunction(asset.id); // pass the id property
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Important Notes
|
|
184
|
+
|
|
185
|
+
1. **API Client Classes are NOT affected** — Do NOT modify client classes like `*Client`. They remain classes with constructors:
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
const { getApiClient } = useApiClient(MyApiClient); // No change needed
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
2. **Spread operators work with interfaces:**
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
const updated = { ...existingItem, name: "New Name" }; // Works fine
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
3. **Required properties must be provided** when using type assertions:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
const details: ItemDetails = {
|
|
201
|
+
sku: item.sku || "",
|
|
202
|
+
...otherProps,
|
|
203
|
+
};
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
4. **Generic type parameters need updating too:**
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
// BEFORE
|
|
210
|
+
const { action } = useAsync<ISearchQuery>(...)
|
|
211
|
+
|
|
212
|
+
// AFTER
|
|
213
|
+
const { action } = useAsync<SearchQuery>(...)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
5. **Interfaces with all optional properties** can use empty object:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
const query: SearchQuery = {}; // OK if all properties are optional
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
6. **Interfaces with required properties** need those properties:
|
|
223
|
+
```typescript
|
|
224
|
+
const item: Item = { id: "default" }; // Must provide 'id'
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
## Quick Reference Table
|
|
228
|
+
|
|
229
|
+
| Error Code | Pattern | Fix |
|
|
230
|
+
| ---------- | ---------------------------- | ----------------------------------------------- |
|
|
231
|
+
| TS2724 | `IXxx` not found | Remove "I" prefix from import |
|
|
232
|
+
| TS2693 | Type used as value | Replace `new Type({})` with `{} as Type` |
|
|
233
|
+
| TS2866 | Import conflicts with global | Use `type` import or rename |
|
|
234
|
+
| TS7006 | Implicit any | Add explicit type annotation |
|
|
235
|
+
| TS2345 | Type not assignable | Check if property (like `.id`) should be passed |
|
|
236
|
+
|
|
237
|
+
## Verification
|
|
238
|
+
|
|
239
|
+
After making changes:
|
|
240
|
+
|
|
241
|
+
1. Run TypeScript compiler: `npx tsc --noEmit` or `npx vue-tsc --noEmit`
|
|
242
|
+
2. Verify no new errors were introduced
|
|
243
|
+
3. Build the project to ensure everything compiles
|
|
244
|
+
4. Test affected functionality if possible
|