@designcrowd/fe-shared-lib 1.5.0 → 1.5.1-icontranslation
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/settings.local.json +17 -0
- package/.claude/skills/publishing-test-versions.md +285 -0
- package/.eslintrc.js +1 -0
- package/.storybook/image-1.png +0 -0
- package/.storybook/image-2.png +0 -0
- package/.storybook/image.png +0 -0
- package/.storybook/test.md +3 -0
- package/APasking.md +9 -0
- package/CLAUDE.md +227 -65
- package/GT-8753.md +127 -0
- package/docs/plans/2025-11-03-typescript-declarations-design.md +222 -0
- package/package.json +1 -1
- package/public/css/tailwind-brandCrowd.css +3 -6
- package/public/css/tailwind-brandPage.css +3 -6
- package/public/css/tailwind-crazyDomains.css +3 -6
- package/public/css/tailwind-designCom.css +3 -6
- package/public/css/tailwind-designCrowd.css +3 -6
- package/src/atoms/components/SparkleIcon/SparkleIcon.stories.js +207 -3
- package/src/atoms/components/SparkleIcon/SparkleIcon.vue +46 -7
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-01.svg +5 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-02.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-03.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-04.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-05.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-06.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-07.svg +14 -0
- package/src/atoms/components/SparkleIcon/assets/animations/spinner/state-08.svg +14 -0
- package/src/atoms/components/SparkleIcon/sparkle-paths.ts +1 -0
- package/src/atoms/components/SparkleIcon/sparkle-with-spinner-paths.ts +61 -0
- package/src/atoms/components/design-com/Icon/Icon.stories.js +62 -0
- package/src/atoms/components/design-com/Icon/Icon.vue +7 -2
- package/dist/css/tailwind-brandCrowd.css +0 -2496
- package/dist/css/tailwind-brandPage.css +0 -2180
- package/dist/css/tailwind-crazyDomains.css +0 -2496
- package/dist/css/tailwind-designCom.css +0 -2496
- package/dist/css/tailwind-designCrowd.css +0 -2496
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-01.svg → sparkle/state-01.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-02.svg → sparkle/state-02.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-03.svg → sparkle/state-03.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-04.svg → sparkle/state-04.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-05.svg → sparkle/state-05.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-06.svg → sparkle/state-06.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-07.svg → sparkle/state-07.svg} +0 -0
- /package/src/atoms/components/SparkleIcon/assets/animations/{state-08.svg → sparkle/state-08.svg} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"CLAUDE_CODE_USE_BEDROCK": "1",
|
|
4
|
+
"AWS_PROFILE": "default",
|
|
5
|
+
"AWS_REGION": "us-east-1",
|
|
6
|
+
"ANTHROPIC_MODEL": "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
7
|
+
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "10000",
|
|
8
|
+
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
|
|
9
|
+
},
|
|
10
|
+
"outputStyle": "default",
|
|
11
|
+
"spinnerTipsEnabled": false,
|
|
12
|
+
"permissions": {
|
|
13
|
+
"allow": [
|
|
14
|
+
"Bash(mkdir:*)"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publishing-test-versions
|
|
3
|
+
description: Use when you need to publish an experimental/test version of fe-shared-lib to NPM for testing in consuming applications before releasing a stable version
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Publishing Test Versions of fe-shared-lib
|
|
7
|
+
|
|
8
|
+
This skill guides you through publishing experimental versions of `@designcrowd/fe-shared-lib` to NPM for testing in consuming applications (BrandCrowd.Net, DesignCrowd, Design.com, etc.) before cutting an official release.
|
|
9
|
+
|
|
10
|
+
## When to Use This Skill
|
|
11
|
+
|
|
12
|
+
Use this skill when:
|
|
13
|
+
- You've implemented changes that need testing in a real consuming application
|
|
14
|
+
- You want to share work-in-progress for integration testing
|
|
15
|
+
- You're verifying a bug fix works in production-like environments
|
|
16
|
+
- You need to test changes across multiple consuming apps before release
|
|
17
|
+
|
|
18
|
+
**Do NOT use for:**
|
|
19
|
+
- Final production releases (use standard release process instead)
|
|
20
|
+
- Changes you haven't tested locally in Storybook
|
|
21
|
+
- Untested or broken code
|
|
22
|
+
|
|
23
|
+
## Pre-Publishing Checklist
|
|
24
|
+
|
|
25
|
+
Before publishing a test version, create TodoWrite todos for these items:
|
|
26
|
+
|
|
27
|
+
1. ☐ Verify all changes work correctly in Storybook (`npm start`)
|
|
28
|
+
2. ☐ Run linting and fix any issues (`npm run lint:fix`)
|
|
29
|
+
3. ☐ Ensure translations are bundled if you modified i18n files
|
|
30
|
+
4. ☐ Check git status - know what changes you're publishing
|
|
31
|
+
5. ☐ Verify NPM_TOKEN environment variable is set
|
|
32
|
+
6. ☐ Verify you're on the correct git account (use `gh auth status`)
|
|
33
|
+
|
|
34
|
+
**IMPORTANT:** NEVER run `npm run build` - it takes too long and isn't required for publishing.
|
|
35
|
+
|
|
36
|
+
## Publishing Workflow
|
|
37
|
+
|
|
38
|
+
### Step 1: Create Descriptive Test Version Number
|
|
39
|
+
|
|
40
|
+
Test versions follow the format: `[current-version]-[description]`
|
|
41
|
+
|
|
42
|
+
**Examples:**
|
|
43
|
+
- `1.5.1-icon-lang-fix` - Testing icon language attribute fix
|
|
44
|
+
- `1.5.1-spinner-variant` - Testing new spinner variant
|
|
45
|
+
- `1.5.1-dcom-checkout` - Testing Design.com checkout changes
|
|
46
|
+
- `1.5.1-test-GT-8753` - Testing specific Jira ticket
|
|
47
|
+
|
|
48
|
+
**Rules:**
|
|
49
|
+
- Use lowercase and hyphens (no spaces, underscores, or special chars)
|
|
50
|
+
- Keep description short but meaningful (2-4 words)
|
|
51
|
+
- Include ticket number if relevant (GT-1234, BP-5678)
|
|
52
|
+
|
|
53
|
+
### Step 2: Update package.json Version
|
|
54
|
+
|
|
55
|
+
1. Read the current version from package.json
|
|
56
|
+
2. Edit package.json to set the test version number
|
|
57
|
+
3. **Example:**
|
|
58
|
+
```json
|
|
59
|
+
"version": "1.5.1-icon-lang-fix"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Step 3: Update package-lock.json
|
|
63
|
+
|
|
64
|
+
Run npm install to update the lock file with the new version:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm i
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Important:** This MUST be done before building Docker image, or the lock file will be out of sync.
|
|
71
|
+
|
|
72
|
+
### Step 4: Verify NPM_TOKEN Environment Variable
|
|
73
|
+
|
|
74
|
+
Check that NPM_TOKEN is set:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
echo $NPM_TOKEN
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**If empty or undefined:**
|
|
81
|
+
- STOP and ask the user to set NPM_TOKEN
|
|
82
|
+
- The user will need to add it to their environment
|
|
83
|
+
- Do NOT proceed without a valid token
|
|
84
|
+
|
|
85
|
+
### Step 5: Build and Publish via Docker
|
|
86
|
+
|
|
87
|
+
Run the Docker build command which will:
|
|
88
|
+
1. Create a Node 20.11.0 container
|
|
89
|
+
2. Install all dependencies
|
|
90
|
+
3. Bundle translations
|
|
91
|
+
4. Publish to NPM registry
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run docker:publish
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Or directly:
|
|
98
|
+
```bash
|
|
99
|
+
docker build . --build-arg NPM_TOKEN=$NPM_TOKEN
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Expected output:**
|
|
103
|
+
- You should see npm install logs
|
|
104
|
+
- Translation bundling messages
|
|
105
|
+
- NPM publish success message
|
|
106
|
+
- Final output: "Nothing to do."
|
|
107
|
+
|
|
108
|
+
**If publish fails:**
|
|
109
|
+
- Check Docker output for error messages
|
|
110
|
+
- Common issues:
|
|
111
|
+
- NPM_TOKEN not set or invalid
|
|
112
|
+
- Version number already exists on NPM
|
|
113
|
+
- Network connectivity issues
|
|
114
|
+
- Authentication problems
|
|
115
|
+
|
|
116
|
+
### Step 6: Verify Publication
|
|
117
|
+
|
|
118
|
+
Check that the version was published to NPM:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npm view @designcrowd/fe-shared-lib versions --json | grep -i "[version-substring]"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Example:**
|
|
125
|
+
```bash
|
|
126
|
+
npm view @designcrowd/fe-shared-lib versions --json | grep -i "icon-lang"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This confirms the test version is available for consumers to install.
|
|
130
|
+
|
|
131
|
+
### Step 7: Document Test Version for Consumers
|
|
132
|
+
|
|
133
|
+
Create a summary for the user explaining:
|
|
134
|
+
1. The test version number that was published
|
|
135
|
+
2. How to install it in consuming applications:
|
|
136
|
+
```bash
|
|
137
|
+
npm install @designcrowd/fe-shared-lib@1.5.1-icon-lang-fix
|
|
138
|
+
```
|
|
139
|
+
3. What changes are included in this test version
|
|
140
|
+
4. Any testing notes or known limitations
|
|
141
|
+
|
|
142
|
+
**Example message:**
|
|
143
|
+
```
|
|
144
|
+
Successfully published test version: @designcrowd/fe-shared-lib@1.5.1-icon-lang-fix
|
|
145
|
+
|
|
146
|
+
To test in consuming applications:
|
|
147
|
+
npm install @designcrowd/fe-shared-lib@1.5.1-icon-lang-fix
|
|
148
|
+
|
|
149
|
+
Changes in this version:
|
|
150
|
+
- Added lang prop to DcomIcon component
|
|
151
|
+
- Updated SVG title/desc to use dynamic lang attribute
|
|
152
|
+
- Maintains backward compatibility (defaults to 'en')
|
|
153
|
+
|
|
154
|
+
Testing notes:
|
|
155
|
+
- Test with different locales (fr-FR, es-ES, pt-PT)
|
|
156
|
+
- Verify screen readers announce correct language
|
|
157
|
+
- Check that existing usage without lang prop still works
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Post-Publishing Workflow
|
|
161
|
+
|
|
162
|
+
After publishing:
|
|
163
|
+
|
|
164
|
+
1. **Do NOT commit the version change** to git yet - test versions are temporary
|
|
165
|
+
2. Test in consuming application(s)
|
|
166
|
+
3. If issues found:
|
|
167
|
+
- Fix the issues
|
|
168
|
+
- Publish a new test version (e.g., `1.5.1-icon-lang-fix-v2`)
|
|
169
|
+
- Repeat testing
|
|
170
|
+
4. Once testing passes:
|
|
171
|
+
- Revert package.json back to stable version (e.g., `1.5.1`)
|
|
172
|
+
- Make a proper release with version bump (e.g., `1.5.2`)
|
|
173
|
+
- Commit and push the stable release
|
|
174
|
+
|
|
175
|
+
## Git Account Verification
|
|
176
|
+
|
|
177
|
+
**Before publishing, verify you're using the correct GitHub account:**
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
gh auth status
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Expected output for DesignCrowd work:
|
|
184
|
+
```
|
|
185
|
+
Logged in to github.com as KnowlesZ
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
If you're on the wrong account:
|
|
189
|
+
- STOP and inform the user
|
|
190
|
+
- Ask them to switch accounts using `gh auth switch`
|
|
191
|
+
|
|
192
|
+
## Common Pitfalls
|
|
193
|
+
|
|
194
|
+
**Don't:**
|
|
195
|
+
- ❌ Skip updating package-lock.json (causes version mismatch errors)
|
|
196
|
+
- ❌ Commit test versions to git (they're temporary)
|
|
197
|
+
- ❌ Publish with generic names like `1.5.1-test` (not descriptive)
|
|
198
|
+
- ❌ Forget to bundle translations if you modified i18n files
|
|
199
|
+
- ❌ Run `npm run build` (takes forever, not needed)
|
|
200
|
+
- ❌ Publish without linting first
|
|
201
|
+
- ❌ Use the same test version name twice (causes NPM conflicts)
|
|
202
|
+
|
|
203
|
+
**Do:**
|
|
204
|
+
- ✅ Use descriptive test version names
|
|
205
|
+
- ✅ Update both package.json and package-lock.json
|
|
206
|
+
- ✅ Verify NPM_TOKEN before starting
|
|
207
|
+
- ✅ Test in Storybook before publishing
|
|
208
|
+
- ✅ Document what's in the test version for consumers
|
|
209
|
+
- ✅ Clean up by reverting version after testing
|
|
210
|
+
|
|
211
|
+
## Understanding What Gets Published
|
|
212
|
+
|
|
213
|
+
The `.npmignore` file excludes:
|
|
214
|
+
- `node_modules/`
|
|
215
|
+
- `./src` directory (source code is excluded!)
|
|
216
|
+
- `.storybook-static/`
|
|
217
|
+
- Logs, cache files, and IDE configs
|
|
218
|
+
|
|
219
|
+
**What DOES get published:**
|
|
220
|
+
- Compiled/built files in `dist/`
|
|
221
|
+
- `index.js` and `index.cjs` (entry points)
|
|
222
|
+
- Translation bundles
|
|
223
|
+
- `package.json` and lock file
|
|
224
|
+
|
|
225
|
+
This is why the Docker build bundles translations but doesn't require a full build - the source files are published directly.
|
|
226
|
+
|
|
227
|
+
## Docker Build Process Explained
|
|
228
|
+
|
|
229
|
+
The Dockerfile performs these steps:
|
|
230
|
+
1. Creates Node 20.11.0 environment
|
|
231
|
+
2. Copies package files and installs dependencies
|
|
232
|
+
3. Copies the entire project
|
|
233
|
+
4. Runs `npm run bundle-translation` (required for i18n)
|
|
234
|
+
5. Runs `npm publish` (publishes to NPM registry)
|
|
235
|
+
6. Copies package.json to artifacts for verification
|
|
236
|
+
|
|
237
|
+
**Why Docker?**
|
|
238
|
+
- Ensures consistent Node version (20.11.0)
|
|
239
|
+
- Isolates publish environment from local machine
|
|
240
|
+
- Handles NPM authentication securely via build arg
|
|
241
|
+
- Creates reproducible builds
|
|
242
|
+
|
|
243
|
+
## Troubleshooting
|
|
244
|
+
|
|
245
|
+
### "npm publish failed"
|
|
246
|
+
- Check if version already exists: `npm view @designcrowd/fe-shared-lib@[version]`
|
|
247
|
+
- Verify NPM_TOKEN is valid
|
|
248
|
+
- Check network connectivity
|
|
249
|
+
- Look at Docker build output for specific error
|
|
250
|
+
|
|
251
|
+
### "Cannot find NPM_TOKEN"
|
|
252
|
+
- User needs to set environment variable: `export NPM_TOKEN=[token]`
|
|
253
|
+
- Verify with: `echo $NPM_TOKEN`
|
|
254
|
+
- Token must have publish permissions for @designcrowd scope
|
|
255
|
+
|
|
256
|
+
### "Version already exists"
|
|
257
|
+
- Choose a different test version name
|
|
258
|
+
- Append `-v2`, `-v3`, etc. to your description
|
|
259
|
+
- Example: `1.5.1-icon-lang-fix-v2`
|
|
260
|
+
|
|
261
|
+
### Package-lock.json out of sync
|
|
262
|
+
- Always run `npm i` after changing package.json version
|
|
263
|
+
- Commit lock file changes along with package.json
|
|
264
|
+
|
|
265
|
+
### Consumer can't install test version
|
|
266
|
+
- Verify version published: `npm view @designcrowd/fe-shared-lib versions`
|
|
267
|
+
- Check for typos in version string
|
|
268
|
+
- Ensure consuming app has access to @designcrowd scoped packages
|
|
269
|
+
|
|
270
|
+
## Summary Checklist
|
|
271
|
+
|
|
272
|
+
Use TodoWrite to create todos for each step:
|
|
273
|
+
|
|
274
|
+
1. ☐ Run linting (`npm run lint:fix`)
|
|
275
|
+
2. ☐ Test changes in Storybook (`npm start`)
|
|
276
|
+
3. ☐ Verify git account is correct (`gh auth status`)
|
|
277
|
+
4. ☐ Create descriptive test version number
|
|
278
|
+
5. ☐ Update package.json version
|
|
279
|
+
6. ☐ Run `npm i` to update lock file
|
|
280
|
+
7. ☐ Verify NPM_TOKEN is set (`echo $NPM_TOKEN`)
|
|
281
|
+
8. ☐ Run `npm run docker:publish`
|
|
282
|
+
9. ☐ Verify publication with `npm view`
|
|
283
|
+
10. ☐ Document test version for user
|
|
284
|
+
|
|
285
|
+
Remember: Test versions are temporary. Don't commit them to git. After testing succeeds, revert the version and create a proper release.
|
package/.eslintrc.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/APasking.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Ask brooke about the critical gap between speed curve and DD rum
|
|
2
|
+
- Missing data points like blocking time?
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Get questions together to give to DD solution architect before
|
|
6
|
+
- How do we get metrics on the nuxt internals
|
|
7
|
+
- How can get get API calls made correlated?
|
|
8
|
+
- Would be good to just have the different types of processing that happens in the SSR/client tracked and mapped.
|
|
9
|
+
|
package/CLAUDE.md
CHANGED
|
@@ -2,70 +2,232 @@
|
|
|
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
|
+
|
|
5
9
|
## Development Commands
|
|
6
10
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
11
|
+
**Start Development:**
|
|
12
|
+
```bash
|
|
13
|
+
npm start # Builds Tailwind for all themes + starts Storybook + watches translations
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Storybook:**
|
|
17
|
+
```bash
|
|
18
|
+
npm run storybook # Starts Storybook dev server on port 6006
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Linting:**
|
|
22
|
+
```bash
|
|
23
|
+
npm run lint # Lint Vue/JS files
|
|
24
|
+
npm run lint:fix # Auto-fix linting issues
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Translation Bundles:**
|
|
28
|
+
```bash
|
|
29
|
+
npm run bundle-translation # Bundle translation files
|
|
30
|
+
npm run watch:translation # Watch translation files for changes
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Build CSS Only:**
|
|
34
|
+
```bash
|
|
35
|
+
npm run build:css # Builds Tailwind CSS for all themes
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Testing Single Components:**
|
|
39
|
+
- Use Storybook to develop and test individual components
|
|
40
|
+
- Run `npm start` and navigate to the component's story
|
|
41
|
+
|
|
42
|
+
## Architecture
|
|
43
|
+
|
|
44
|
+
### Component Structure
|
|
45
|
+
|
|
46
|
+
The library follows atomic design principles:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
/src
|
|
50
|
+
├── atoms/components/ # Atomic, reusable components
|
|
51
|
+
│ ├── Button/
|
|
52
|
+
│ ├── Icon/
|
|
53
|
+
│ ├── Modal/
|
|
54
|
+
│ ├── design-com/ # Design.com-specific components (DcomIcon, etc.)
|
|
55
|
+
│ └── [30+ other components]
|
|
56
|
+
├── experiences/ # Higher-level feature components
|
|
57
|
+
│ ├── components/ # Auth flows, upload flows, payment config
|
|
58
|
+
│ ├── mixins/
|
|
59
|
+
│ ├── helpers/
|
|
60
|
+
│ ├── clients/ # API clients
|
|
61
|
+
│ └── constants/
|
|
62
|
+
├── themes/ # Theme configuration files
|
|
63
|
+
├── css/ # Base CSS and Tailwind setup
|
|
64
|
+
└── bundles/ # i18n translation bundles
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Multi-Theme System
|
|
68
|
+
|
|
69
|
+
The library supports 5 product themes, each extending `themes/base.js`:
|
|
70
|
+
|
|
71
|
+
1. **brandCrowd** (bc.js) - BrandCrowd
|
|
72
|
+
2. **brandPage** (bp.js) - BrandPage
|
|
73
|
+
3. **designCrowd** (dc.js) - DesignCrowd
|
|
74
|
+
4. **crazyDomains** (cd.js) - CrazyDomains
|
|
75
|
+
5. **designCom** (dcom.js) - Design.com
|
|
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)
|