@designcrowd/fe-shared-lib 1.5.1-icontranslation → 1.5.1
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 +65 -227
- package/{public → dist}/css/tailwind-brandCrowd.css +597 -512
- package/{public → dist}/css/tailwind-brandPage.css +520 -435
- package/{public → dist}/css/tailwind-crazyDomains.css +597 -512
- package/{public → dist}/css/tailwind-designCom.css +597 -512
- package/{public → dist}/css/tailwind-designCrowd.css +597 -512
- package/package.json +1 -1
- package/src/atoms/components/design-com/Icon/Icon.stories.js +0 -62
- package/src/atoms/components/design-com/Icon/Icon.vue +2 -7
- package/.claude/settings.local.json +0 -17
- package/.claude/skills/publishing-test-versions.md +0 -285
- package/.storybook/image-1.png +0 -0
- package/.storybook/image-2.png +0 -0
- package/.storybook/image.png +0 -0
- package/.storybook/test.md +0 -3
- package/APasking.md +0 -9
- package/GT-8753.md +0 -127
- package/docs/plans/2025-11-03-typescript-declarations-design.md +0 -222
package/CLAUDE.md
CHANGED
|
@@ -2,232 +2,70 @@
|
|
|
2
2
|
|
|
3
3
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
4
|
|
|
5
|
-
## Project Overview
|
|
6
|
-
|
|
7
|
-
`@designcrowd/fe-shared-lib` is a Vue 3 component library and design system used across multiple DesignCrowd products: BrandCrowd, DesignCrowd, CrazyDomains, Design.com, and BrandPage. The library uses Tailwind CSS with a custom `tw-` prefix and features a sophisticated multi-theme system.
|
|
8
|
-
|
|
9
5
|
## Development Commands
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
npm
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
npm run storybook
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
**Theme Configuration:**
|
|
78
|
-
- Each theme defines custom colors (primary, secondary, success, info, warning, error, grayscale, discount)
|
|
79
|
-
- Custom fonts and spacing
|
|
80
|
-
- Tailwind builds separate CSS files: `dist/css/tailwind-{themeName}.css`
|
|
81
|
-
|
|
82
|
-
**Using Themes in Components:**
|
|
83
|
-
- Components accept a `theme` prop (e.g., 'brandCrowd', 'designCom')
|
|
84
|
-
- Use dynamic component selection: `:is="button-${theme}-${variant}"`
|
|
85
|
-
- Ensure all theme variants are exported from component files
|
|
86
|
-
|
|
87
|
-
### Internationalization
|
|
88
|
-
|
|
89
|
-
The library uses i18next with @nuxtjs/i18n for multi-language support:
|
|
90
|
-
|
|
91
|
-
**Supported Locales:**
|
|
92
|
-
- en-US, de-DE, fr-FR, fr-CA, es-ES, pt-PT, pt-BR
|
|
93
|
-
|
|
94
|
-
**Usage Pattern:**
|
|
95
|
-
```javascript
|
|
96
|
-
import { setSharedLibLocaleAsync, tr } from '@designcrowd/fe-shared-lib'
|
|
97
|
-
|
|
98
|
-
// Set locale
|
|
99
|
-
await setSharedLibLocaleAsync('en-US')
|
|
100
|
-
|
|
101
|
-
// Translate
|
|
102
|
-
const text = tr('translation.key')
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
**Development Workflow:**
|
|
106
|
-
1. Edit translation files in appropriate directories
|
|
107
|
-
2. Run `npm run bundle-translation` or `npm run watch:translation`
|
|
108
|
-
3. Translations are bundled into `/src/bundles/`
|
|
109
|
-
|
|
110
|
-
### Component Development Patterns
|
|
111
|
-
|
|
112
|
-
**Creating New Components:**
|
|
113
|
-
1. Add component to `/src/atoms/components/[ComponentName]/`
|
|
114
|
-
2. Create `[ComponentName].vue` with proper theme support
|
|
115
|
-
3. Create `[ComponentName].stories.js` for Storybook
|
|
116
|
-
4. Export from `/src/atoms/components/index.js`
|
|
117
|
-
5. If theme-specific, create variants in theme subdirectories
|
|
118
|
-
|
|
119
|
-
**Component Guidelines:**
|
|
120
|
-
- Use Tailwind classes with `tw-` prefix
|
|
121
|
-
- Support all 5 themes or document theme restrictions
|
|
122
|
-
- Include proper ARIA attributes for accessibility
|
|
123
|
-
- Add `lang` prop to text-containing components for i18n
|
|
124
|
-
- Follow variant patterns: primary, secondary, outlined, text, etc.
|
|
125
|
-
|
|
126
|
-
**Icon System:**
|
|
127
|
-
- Standard icons: Use `Icon.vue` component
|
|
128
|
-
- Design.com specific: Use `design-com/DcomIcon.vue`
|
|
129
|
-
- Icons defined in `Icon/icons/` and `design-com/icons/`
|
|
130
|
-
- SVG icons should include `:lang` attribute when containing text
|
|
131
|
-
|
|
132
|
-
## Storybook
|
|
133
|
-
|
|
134
|
-
**Running Storybook:**
|
|
135
|
-
```bash
|
|
136
|
-
npm start # Includes Storybook + CSS build + translation watch
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**Story Files:**
|
|
140
|
-
- Located alongside components: `ComponentName.stories.js`
|
|
141
|
-
- Use `@storybook/vue3` format
|
|
142
|
-
- Published to: https://brandcrowd-storybook.s3.amazonaws.com/fe-shared-lib/live/index.html
|
|
143
|
-
|
|
144
|
-
**Writing Stories:**
|
|
145
|
-
```javascript
|
|
146
|
-
export default {
|
|
147
|
-
title: 'atoms/ComponentName',
|
|
148
|
-
component: ComponentName,
|
|
149
|
-
argTypes: {
|
|
150
|
-
theme: {
|
|
151
|
-
control: { type: 'select' },
|
|
152
|
-
options: ['brandCrowd', 'designCom', ...]
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
## Build & Publishing
|
|
159
|
-
|
|
160
|
-
**Version Bump:**
|
|
161
|
-
1. Update version in `package.json`
|
|
162
|
-
2. Run `npm i` to update lock file
|
|
163
|
-
3. Commit changes
|
|
164
|
-
|
|
165
|
-
**Publishing to NPM:**
|
|
166
|
-
```bash
|
|
167
|
-
npm run docker:publish # Requires NPM_TOKEN environment variable
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Testing Experimental Versions:**
|
|
171
|
-
1. Set version to `"[current]-[description]"` (e.g., "1.5.1-test-feature")
|
|
172
|
-
2. Build Docker image
|
|
173
|
-
3. Update consuming app's package.json reference
|
|
174
|
-
|
|
175
|
-
**CI/CD:**
|
|
176
|
-
- AWS CodeBuild auto-deploys Storybook to S3 on master commits
|
|
177
|
-
- Uses Node 20.11.0
|
|
178
|
-
- Configuration in `buildspec.yml`
|
|
179
|
-
|
|
180
|
-
## ESLint & Code Style
|
|
181
|
-
|
|
182
|
-
**ESLint Configuration:**
|
|
183
|
-
- Extends Vue recommended, Airbnb, Prettier, and Storybook recommended
|
|
184
|
-
- Console statements allowed in development, error in production
|
|
185
|
-
- Prettier: 120 character line width
|
|
186
|
-
|
|
187
|
-
**Git Hooks (Husky):**
|
|
188
|
-
- Pre-commit/pre-push runs `lint-staged`
|
|
189
|
-
- Auto-lints and stages `*.{js,jsx,vue}` files
|
|
190
|
-
|
|
191
|
-
## Common Tasks
|
|
192
|
-
|
|
193
|
-
**Adding a New Icon:**
|
|
194
|
-
1. Add SVG to `src/atoms/components/Icon/icons/` or `design-com/icons/`
|
|
195
|
-
2. Import in component's icon list
|
|
196
|
-
3. Add story to `Icon.stories.js` or `DcomIcon.stories.js`
|
|
197
|
-
4. If icon contains text, ensure `lang` attribute is properly bound
|
|
198
|
-
|
|
199
|
-
**Adding a New Theme:**
|
|
200
|
-
1. Create `themes/{themeName}.js` extending `base.js`
|
|
201
|
-
2. Define color palette, fonts, spacing
|
|
202
|
-
3. Update `tailwind.build.js` to include new theme
|
|
203
|
-
4. Run `npm run build:css`
|
|
204
|
-
5. Test in Storybook
|
|
205
|
-
|
|
206
|
-
**Working with Translations:**
|
|
207
|
-
1. Edit translation files in source directories
|
|
208
|
-
2. Run `npm run watch:translation` during development
|
|
209
|
-
3. Translations auto-bundle to `/src/bundles/`
|
|
210
|
-
4. Use `setSharedLibLocaleAsync()` and `tr()` in components
|
|
211
|
-
|
|
212
|
-
**Debugging Theme Issues:**
|
|
213
|
-
1. Check that all theme variants exist for the component
|
|
214
|
-
2. Verify CSS was built: `npm run build:css`
|
|
215
|
-
3. Check component exports from `index.js`
|
|
216
|
-
4. Inspect Storybook controls for theme selection
|
|
217
|
-
|
|
218
|
-
## Technology Stack
|
|
219
|
-
|
|
220
|
-
- **Framework:** Vue 3.5.15
|
|
221
|
-
- **Build Tool:** Vite 6.3.5
|
|
222
|
-
- **Styling:** TailwindCSS 3.4.1 (with `tw-` prefix)
|
|
223
|
-
- **Documentation:** Storybook 9.0.4
|
|
224
|
-
- **Internationalization:** i18next 25.2.1
|
|
225
|
-
- **Linting:** ESLint (Airbnb + Vue + Prettier)
|
|
226
|
-
- **Git Hooks:** Husky + lint-staged
|
|
227
|
-
|
|
228
|
-
**Key Dependencies:**
|
|
229
|
-
- Vue Router 4.5.0
|
|
230
|
-
- axios (HTTP client)
|
|
231
|
-
- cropperjs (image cropping)
|
|
232
|
-
- swiper (carousels)
|
|
233
|
-
- dropzone-vue3 (file uploads)
|
|
7
|
+
### Starting Development
|
|
8
|
+
- `npm start` - Builds Tailwind CSS files for all themes and launches Storybook development server on port 6006
|
|
9
|
+
- `npm run storybook` - Same as `npm start` (alias)
|
|
10
|
+
|
|
11
|
+
### Building
|
|
12
|
+
- `npm run build` - Builds production CSS using Tailwind
|
|
13
|
+
- `npm run build:css` - Builds CSS files using tailwind.build.js
|
|
14
|
+
- `npm run build:storybook` - Builds static Storybook for deployment
|
|
15
|
+
|
|
16
|
+
### Code Quality
|
|
17
|
+
- `npm run lint` - Runs ESLint on TypeScript, JavaScript, and Vue files in src/
|
|
18
|
+
- `npm run lint:fix` - Automatically fixes linting issues where possible
|
|
19
|
+
|
|
20
|
+
### Testing in UAT Environment
|
|
21
|
+
To test experimental versions without publishing to production:
|
|
22
|
+
1. Update package.json version to `[current]-[description]`
|
|
23
|
+
2. Run `docker build . --build-arg NPM_TOKEN=$NPM_TOKEN`
|
|
24
|
+
3. Update consumer package reference to the new version
|
|
25
|
+
|
|
26
|
+
## Architecture Overview
|
|
27
|
+
|
|
28
|
+
This is a shared component library and design system for DesignCrowd's frontend applications, published as `@designcrowd/fe-shared-lib`.
|
|
29
|
+
|
|
30
|
+
### Project Structure
|
|
31
|
+
- **`src/atoms/`** - Reusable UI components (Button, Modal, Icon, etc.)
|
|
32
|
+
- **`src/experiences/`** - Complex, business-specific components (AuthFlow, PaymentConfig, etc.)
|
|
33
|
+
- **`src/themes/`** - Tailwind CSS theme configurations for different brands
|
|
34
|
+
- **`src/css/`** - Global CSS and Tailwind configuration
|
|
35
|
+
- **`public/css/`** - Generated CSS output files
|
|
36
|
+
|
|
37
|
+
### Theme System
|
|
38
|
+
The library supports multiple brand themes through Tailwind CSS:
|
|
39
|
+
- **BrandCrowd** (`bc.js`)
|
|
40
|
+
- **BrandPage** (`bp.js`)
|
|
41
|
+
- **CrazyDomains** (`cd.js`)
|
|
42
|
+
- **DesignCrowd** (`dc.js`)
|
|
43
|
+
- **Design.com** (`dcom.js`)
|
|
44
|
+
|
|
45
|
+
Themes are built using `tailwind.themes.js` and exported via `src/themes/themes.js`.
|
|
46
|
+
|
|
47
|
+
### Component Organization
|
|
48
|
+
- **Atoms**: Basic UI components with stories in Storybook
|
|
49
|
+
- **Experiences**: Complex components combining multiple atoms for specific workflows
|
|
50
|
+
- **Icons**: Extensive icon library with brand-specific variants
|
|
51
|
+
- **Mixins**: Reusable Vue.js mixins for common functionality
|
|
52
|
+
|
|
53
|
+
### Key Files
|
|
54
|
+
- `index.js` - Main export file exposing all components
|
|
55
|
+
- `tailwind.config.js` - Tailwind CSS configuration
|
|
56
|
+
- `vite.config.ts` - Vite build configuration for development
|
|
57
|
+
|
|
58
|
+
### Local Development Workflow
|
|
59
|
+
Use `npm link` in this directory and `npm link @designcrowd/fe-shared-lib` in consumer projects for local development.
|
|
60
|
+
|
|
61
|
+
### Storybook
|
|
62
|
+
- Development server runs on port 6006
|
|
63
|
+
- Live Storybook: https://brandcrowd-storybook.s3.amazonaws.com/fe-shared-lib/live/index.html
|
|
64
|
+
- Stories are co-located with components (`.stories.js` files)
|
|
65
|
+
|
|
66
|
+
### Brand Page Integration
|
|
67
|
+
For changes affecting BrandPage Tab in BC.NET:
|
|
68
|
+
1. Update app.maker's reference to this library
|
|
69
|
+
2. Bump app.maker version
|
|
70
|
+
3. Run `npm run docker:publish:bp`
|
|
71
|
+
4. Update BC.NET's reference to the new app.maker version
|