@designcrowd/fe-shared-lib 1.5.20-dts-upgrades-2 → 1.5.21-BestLogoIcons-3
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/CLAUDE.md +4 -2
- package/Dockerfile +1 -1
- package/package.json +1 -2
- package/src/atoms/components/Dropdown/Dropdown.vue +7 -2
- package/src/atoms/components/Icon/Icon.vue +38 -0
- package/src/atoms/components/Icon/icons/annotate-heart.vue +7 -0
- package/src/atoms/components/Icon/icons/award.vue +7 -0
- package/src/atoms/components/Icon/icons/bezier-curve-outline.vue +7 -0
- package/src/atoms/components/Icon/icons/bezier-curve.vue +7 -0
- package/src/atoms/components/Icon/icons/browser.vue +7 -0
- package/src/atoms/components/Icon/icons/card-vertical.vue +7 -0
- package/src/atoms/components/Icon/icons/file-empty.vue +7 -0
- package/src/atoms/components/Icon/icons/font.vue +7 -0
- package/src/atoms/components/Icon/icons/headphones.vue +7 -0
- package/src/atoms/components/Icon/icons/image.vue +7 -0
- package/src/atoms/components/Icon/icons/lightning.vue +7 -0
- package/src/atoms/components/Icon/icons/logo.vue +7 -0
- package/src/atoms/components/Icon/icons/palette-outline.vue +7 -0
- package/src/atoms/components/Icon/icons/pen-outline.vue +7 -0
- package/src/atoms/components/Icon/icons/pen-sparkle.vue +17 -0
- package/src/atoms/components/Icon/icons/pen.vue +7 -0
- package/src/atoms/components/Icon/icons/sparkle-square.vue +22 -0
- package/.npm-publish-token +0 -1
- package/MODERNIZATION_ROADMAP.md +0 -264
- package/docs/plans/2026-01-19-typescript-declarations-design.md +0 -114
- package/docs/plans/2026-01-19-typescript-declarations-tdd-plan.md +0 -953
- package/index.d.ts +0 -309
- package/types-test/all-components.test.ts +0 -81
- package/types-test/basic-imports.test.ts +0 -16
- package/types-test/button-props.test.ts +0 -63
- package/types-test/checkbox-toggle-props.test.ts +0 -78
- package/types-test/dropdown-props.test.ts +0 -36
- package/types-test/icon-props.test.ts +0 -42
- package/types-test/loader-props.test.ts +0 -7
- package/types-test/modal-props.test.ts +0 -39
- package/types-test/select-props.test.ts +0 -97
- package/types-test/text-input-props.test.ts +0 -80
- package/types-test/textarea-props.test.ts +0 -72
- package/types-test/tsconfig.json +0 -12
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# fe-shared-lib TypeScript Declarations Design
|
|
2
|
-
|
|
3
|
-
## Overview & Goals
|
|
4
|
-
|
|
5
|
-
**Objective**: Add TypeScript declaration file to `@designcrowd/fe-shared-lib` so consumers get basic type checking and IDE autocomplete without converting the library to TypeScript.
|
|
6
|
-
|
|
7
|
-
**Success Criteria**:
|
|
8
|
-
- BrandCrowd.Nuxt's 117 `TS7016` errors for `@designcrowd/fe-shared-lib` resolve
|
|
9
|
-
- Commonly-used components (Button, Modal, Icon, etc.) have typed props
|
|
10
|
-
- Less-used components have minimal stub declarations
|
|
11
|
-
- No changes to existing JavaScript/Vue component code
|
|
12
|
-
|
|
13
|
-
**Approach**:
|
|
14
|
-
1. Create `index.d.ts` at package root declaring all exports from `index.js`
|
|
15
|
-
2. Add `"types": "./index.d.ts"` to `package.json` exports
|
|
16
|
-
3. Define detailed prop interfaces for ~10 most-used components
|
|
17
|
-
4. Use generic `DefineComponent<{}, {}, any>` for remaining components
|
|
18
|
-
5. Publish new version for BrandCrowd.Nuxt to consume
|
|
19
|
-
|
|
20
|
-
**Files to Create/Modify**:
|
|
21
|
-
- `index.d.ts` (new) - Main declaration file
|
|
22
|
-
- `package.json` - Add types field to exports
|
|
23
|
-
|
|
24
|
-
## Implementation Details
|
|
25
|
-
|
|
26
|
-
**Structure of `index.d.ts`**:
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { DefineComponent, PropType } from 'vue';
|
|
30
|
-
|
|
31
|
-
// ============ Detailed Component Types ============
|
|
32
|
-
// Most-used components with full prop definitions
|
|
33
|
-
|
|
34
|
-
export interface ButtonProps {
|
|
35
|
-
label?: string;
|
|
36
|
-
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'link';
|
|
37
|
-
size?: 'sm' | 'md' | 'lg';
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
isBusy?: boolean;
|
|
40
|
-
fullWidth?: boolean;
|
|
41
|
-
icon?: string;
|
|
42
|
-
// ... other props from examining Button.vue
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export const Button: DefineComponent<ButtonProps>;
|
|
46
|
-
export const Modal: DefineComponent<ModalProps>;
|
|
47
|
-
export const Icon: DefineComponent<IconProps>;
|
|
48
|
-
// ... ~10 detailed components
|
|
49
|
-
|
|
50
|
-
// ============ Stub Component Types ============
|
|
51
|
-
// Less-used components - typed but generic
|
|
52
|
-
|
|
53
|
-
export const UploadYourLogoDropzone: DefineComponent<{}, {}, any>;
|
|
54
|
-
export const SignUpModal: DefineComponent<{}, {}, any>;
|
|
55
|
-
// ... remaining ~45 components
|
|
56
|
-
|
|
57
|
-
// ============ Utilities ============
|
|
58
|
-
export function setSharedLibLocaleAsync(locale: string): Promise<void>;
|
|
59
|
-
export function tr(key: string, params?: Record<string, any>): string;
|
|
60
|
-
|
|
61
|
-
// ============ API Clients ============
|
|
62
|
-
export const brandPageApiClient: any;
|
|
63
|
-
export const brandCrowdApiClient: any;
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
**Components to fully type** (based on usage frequency):
|
|
67
|
-
1. Button
|
|
68
|
-
2. Modal
|
|
69
|
-
3. Icon
|
|
70
|
-
4. Dropdown
|
|
71
|
-
5. TextInput
|
|
72
|
-
6. Textarea
|
|
73
|
-
7. Checkbox
|
|
74
|
-
8. Toggle
|
|
75
|
-
9. Loader
|
|
76
|
-
10. Select
|
|
77
|
-
|
|
78
|
-
## Verification & Publishing
|
|
79
|
-
|
|
80
|
-
**Local Testing** (before publishing):
|
|
81
|
-
1. Create `index.d.ts` in fe-shared-lib
|
|
82
|
-
2. In BrandCrowd.Nuxt, run `npm link ../fe-shared-lib`
|
|
83
|
-
3. Run `npx vue-tsc --noEmit` - verify TS7016 errors for fe-shared-lib resolve
|
|
84
|
-
4. Check IDE autocomplete works for Button props in a .vue file
|
|
85
|
-
|
|
86
|
-
**Publishing Workflow**:
|
|
87
|
-
1. Bump version in `package.json` (e.g., `1.5.20` → `1.5.21`)
|
|
88
|
-
2. Commit with message: `Add TypeScript declarations for consumers`
|
|
89
|
-
3. Build and publish: `npm publish` (or via CI pipeline)
|
|
90
|
-
4. In BrandCrowd.Nuxt: `npm update @designcrowd/fe-shared-lib`
|
|
91
|
-
|
|
92
|
-
**Iterative Improvement**:
|
|
93
|
-
After initial release, prop types can be refined by:
|
|
94
|
-
- Examining actual component `.vue` files for accurate prop definitions
|
|
95
|
-
- Adding missing props as consumers report them
|
|
96
|
-
- Eventually generating declarations from JSDoc or migrating to TypeScript
|
|
97
|
-
|
|
98
|
-
**Rollback Plan**:
|
|
99
|
-
If declarations cause issues, consumers can add to their own `types/vendor-modules.d.ts`:
|
|
100
|
-
```typescript
|
|
101
|
-
declare module '@designcrowd/fe-shared-lib';
|
|
102
|
-
```
|
|
103
|
-
This overrides the package's declarations with a permissive stub.
|
|
104
|
-
|
|
105
|
-
## Checklist
|
|
106
|
-
|
|
107
|
-
- [ ] Create `index.d.ts` with all exports from `index.js`
|
|
108
|
-
- [ ] Add detailed prop interfaces for 10 most-used components
|
|
109
|
-
- [ ] Add stub declarations for remaining components
|
|
110
|
-
- [ ] Add types for utility functions (setSharedLibLocaleAsync, tr)
|
|
111
|
-
- [ ] Update `package.json` with types field in exports
|
|
112
|
-
- [ ] Test locally with `npm link` in BrandCrowd.Nuxt
|
|
113
|
-
- [ ] Verify TS7016 errors resolve
|
|
114
|
-
- [ ] Bump version and publish
|