@schandlergarcia/sf-web-components 1.9.43 → 1.9.44

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 ADDED
@@ -0,0 +1,401 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## Critical History: Component Naming Crisis (v1.9.29 - v1.9.42)
9
+
10
+ ### The Problem
11
+
12
+ Between versions 1.9.29 and 1.9.42, a critical inconsistency existed that broke consuming applications:
13
+
14
+ **Root Cause:** Component files were renamed from `UIButton.tsx`/`UIInput.tsx` to `Button.jsx`/`Input.jsx`, but:
15
+ - Templates still imported `UIButton` and `UIInput`
16
+ - Documentation in `.a4drules/skills/component-library/ui-primitives.md` still referenced `UIButton` and `UIInput`
17
+ - The barrel export still referenced the old paths
18
+
19
+ **Impact:** New installations failed with "Cannot resolve import" errors because:
20
+ 1. NotFound.tsx.template imported `UIButton` from `@/components/library/ui/UIButton`
21
+ 2. Home.tsx.template imported `UIButton` and `UIInput` from the same paths
22
+ 3. But the package only contained `Button.jsx` and `Input.jsx`
23
+
24
+ **Why This Happened:** Components were renamed to match shadcn naming convention without understanding that:
25
+ - Shadcn components (`Button`, `Input`) are for the **outer application shell**
26
+ - Library components (`UIButton`, `UIInput`) are for **command centers and dashboards**
27
+ - The `.a4drules/skills/component-library/common-mistakes.md` explicitly documents this distinction
28
+
29
+ ### Timeline of Issues
30
+
31
+ #### v1.9.25 - v1.9.28 (✅ Golden Versions - Working)
32
+ - **Status:** Fully functional
33
+ - **Components:** `UIButton.tsx`, `UIInput.tsx` (correct names)
34
+ - **Templates:** Import `UIButton` and `UIInput` (matching)
35
+ - **Documentation:** References `UIButton` and `UIInput` (matching)
36
+ - **Evidence:** `/Users/stephan.garcia/reactapp4/` uses v1.9.25 successfully
37
+
38
+ #### v1.9.29 (❌ Broken - Missing Postinstall)
39
+ - **Issue:** Postinstall script referenced in package.json but not included in published package
40
+ - **Error:** "Cannot find module postinstall.mjs"
41
+ - **Cause:** Missing from package.json `files` array
42
+
43
+ #### v1.9.30 - v1.9.38 (❌ Broken - Missing Source Files)
44
+ - **Issue:** Removed `src/` directories from package.json `files` array
45
+ - **Error:** Postinstall couldn't find source files to copy
46
+ - **Cause:** Attempted to publish only dist/ but postinstall needs src/ for templates and components
47
+
48
+ #### v1.9.39 (❌ Broken - Partial Fix)
49
+ - **Issue:** Restored src/ directories but components had wrong names
50
+ - **Components:** `Button.jsx`, `Input.jsx` (wrong - shadcn names)
51
+ - **Templates:** Still importing `UIButton`, `UIInput`
52
+ - **Result:** Import resolution failures
53
+
54
+ #### v1.9.40 (❌ Broken - Missing Glob Dependency)
55
+ - **Issue:** Postinstall script imports `glob` but it wasn't in dependencies
56
+ - **Error:** "Cannot find package 'glob'"
57
+ - **Added:** `"glob": "^11.0.0"` to dependencies
58
+
59
+ #### v1.9.41 - v1.9.42 (❌ Broken - Component Naming Mismatch)
60
+ - **Issue:** All other fixes applied but component names still wrong
61
+ - **Components:** `Button.jsx`, `Input.jsx` (shadcn naming)
62
+ - **Templates:** Importing `UIButton`, `UIInput` (library naming)
63
+ - **Documentation:** References `UIButton`, `UIInput` (library naming)
64
+ - **Result:** "Failed to resolve import @/components/library/ui/UIButton"
65
+
66
+ #### v1.9.43 (✅ Fixed)
67
+ - **Fix:** Restored `UIButton.tsx` and `UIInput.tsx` from golden version
68
+ - **Removed:** Incorrect `Button.jsx` and `Input.jsx` files
69
+ - **Updated:** Barrel export paths to match new file names
70
+ - **Updated:** Internal imports in `ActionList.jsx` and `TableCard.jsx`
71
+ - **Verified:** Templates, components, and documentation all aligned
72
+ - **Result:** Consuming applications install and run successfully
73
+
74
+ ---
75
+
76
+ ## [1.9.44] - 2026-04-01
77
+
78
+ ### Added
79
+ - **ARCHITECTURE.md** - Comprehensive documentation of source of truth hierarchy
80
+ - Documents that `.a4drules/skills/component-library/` is authoritative
81
+ - Explains component naming convention (UI prefix for library, plain names for outer app)
82
+ - File structure master reference with clear responsibilities
83
+
84
+ - **CONTRIBUTING.md** - Detailed contribution guidelines
85
+ - Change process with correct order (docs → code → templates → exports)
86
+ - Component naming rules with examples
87
+ - Template import rules
88
+ - Pre-release checklist (9 required steps)
89
+ - Common mistakes and how to avoid them
90
+ - Recovery procedures for bad releases
91
+
92
+ - **CHANGELOG.md** - This file with complete version history
93
+ - Detailed timeline of v1.9.29-v1.9.42 naming crisis
94
+ - Root cause analysis of why templates broke
95
+ - Version-by-version breakdown of issues
96
+ - Documentation standards for future changelog entries
97
+
98
+ - **QUICK-REFERENCE.md** - One-page quick reference card
99
+ - Pre-publish checklist
100
+ - Component naming table
101
+ - Source of truth hierarchy
102
+ - Common errors and fixes
103
+ - Emergency recovery procedures
104
+
105
+ - **.a4drules/RULES.md** - Mandatory project rules
106
+ - 10 enforced rules for all contributors and AI assistants
107
+ - Rule 1: Documentation is source of truth
108
+ - Rule 2: CHANGELOG.md is mandatory
109
+ - Rule 3-10: Component naming, templates, testing, versioning
110
+ - Pre-commit verification hooks
111
+
112
+ - **scripts/verify-consistency.sh** - Automated consistency verification
113
+ - Checks component files exist (UIButton.tsx, UIInput.tsx)
114
+ - Verifies barrel export paths
115
+ - Validates template imports
116
+ - Checks internal library imports
117
+ - Verifies documentation references
118
+ - Validates package.json files array
119
+ - Exit code 0 if all checks pass, 1 if any fail
120
+
121
+ - **scripts/pre-publish-check.sh** - Pre-publish verification script
122
+ - Runs all consistency checks
123
+ - Verifies CHANGELOG has entry for current version
124
+ - Checks component naming conventions
125
+ - Runs build to verify no errors
126
+ - Validates documentation files exist
127
+ - Checks package.json files array
128
+ - Blocks publish if any check fails
129
+
130
+ ### Changed
131
+ - **package.json scripts** - Added verification scripts
132
+ - Added `verify`: Run consistency checks
133
+ - Added `prepublish:check`: Run all pre-publish checks
134
+ - Updated `prepublishOnly`: Now runs verification before build
135
+ - Publishing now automatically blocked if verification fails
136
+
137
+ - **package.json files array** - Added documentation files
138
+ - Added CHANGELOG.md
139
+ - Added CONTRIBUTING.md
140
+ - Added ARCHITECTURE.md
141
+ - Added QUICK-REFERENCE.md
142
+ - These files now ship with the package
143
+
144
+ - **README.md** - Updated with contribution and publishing sections
145
+ - Added Contributing section with links to all docs
146
+ - Updated Publishing section to document automated verification
147
+ - Changed import examples to use UIButton (not Button)
148
+ - Added verification command examples
149
+
150
+ ### Documentation
151
+ - Created comprehensive documentation system to prevent future naming issues
152
+ - All rules, processes, and guidelines now documented in multiple formats:
153
+ - Detailed guides (CONTRIBUTING.md, ARCHITECTURE.md)
154
+ - Quick reference (QUICK-REFERENCE.md)
155
+ - Mandatory rules (.a4drules/RULES.md)
156
+ - Version history (CHANGELOG.md)
157
+ - Added guide for consuming projects (internal-app-standard-config/.a4drules/sf-web-components-guide.md)
158
+
159
+ ### Infrastructure
160
+ - Automated pre-publish verification prevents broken releases
161
+ - Scripts enforce consistency between docs, code, and templates
162
+ - Cannot publish without CHANGELOG entry
163
+ - Cannot publish with naming mismatches
164
+ - Cannot publish if build fails
165
+
166
+ ### Purpose
167
+ This release adds comprehensive documentation and automation to ensure the component naming crisis of v1.9.29-v1.9.42 **never happens again**:
168
+
169
+ **The Problem We're Preventing:**
170
+ - Components renamed without updating templates → Import failures
171
+ - Changes made without updating CHANGELOG → Lost history
172
+ - Code changed without checking documentation → Contract violations
173
+ - Published without testing → Broken consuming applications
174
+
175
+ **How We're Preventing It:**
176
+ - Automated verification scripts run on every publish
177
+ - Comprehensive documentation at multiple levels
178
+ - Clear source of truth hierarchy
179
+ - Mandatory CHANGELOG updates
180
+ - Pre-commit hooks (optional but recommended)
181
+
182
+ ### Breaking Changes
183
+ None - This is a documentation and tooling release
184
+
185
+ ### Migration
186
+ No migration needed. This version adds documentation and verification tools but does not change any component APIs.
187
+
188
+ If you're maintaining or contributing to sf-web-components:
189
+ 1. Read CONTRIBUTING.md before making changes
190
+ 2. Run `npm run verify` before committing
191
+ 3. Update CHANGELOG.md with every change
192
+ 4. The `prepublishOnly` hook will enforce these rules
193
+
194
+ ---
195
+
196
+ ## [1.9.43] - 2026-04-01
197
+
198
+ ### Fixed
199
+ - **CRITICAL:** Restored UIButton.tsx and UIInput.tsx with correct naming convention
200
+ - Component files now match template imports and documentation
201
+ - Fixes "Cannot resolve import @/components/library/ui/UIButton" error
202
+ - Copied from golden version (v1.9.25) at `/Users/stephan.garcia/reactapp4/`
203
+ - Removed incorrect Button.jsx and Input.jsx files (shadcn naming reserved for outer app)
204
+ - Updated barrel export in src/components/library/index.jsx:
205
+ - Changed `from "./ui/Button"` to `from "./ui/UIButton"`
206
+ - Changed `from "./ui/Input"` to `from "./ui/UIInput"`
207
+ - Fixed internal imports in:
208
+ - src/components/library/cards/ActionList.jsx
209
+ - src/components/library/cards/TableCard.jsx
210
+
211
+ ### Added
212
+ - ARCHITECTURE.md - Documents source of truth and naming conventions
213
+ - CONTRIBUTING.md - Comprehensive guide to prevent future naming issues
214
+ - scripts/verify-consistency.sh - Automated verification of component/template/doc alignment
215
+ - This CHANGELOG.md - Detailed history and requirements for all future changes
216
+
217
+ ### Documentation
218
+ - Confirmed .a4drules/skills/component-library/ui-primitives.md is authoritative source
219
+ - Confirmed .a4drules/skills/component-library/common-mistakes.md prohibits shadcn names in library
220
+
221
+ ### Breaking Changes
222
+ None - This version restores functionality that was broken in v1.9.29-v1.9.42
223
+
224
+ ### Migration from v1.9.42
225
+ If you're using v1.9.42 (broken version):
226
+ ```bash
227
+ # Update to fixed version
228
+ npm install @schandlergarcia/sf-web-components@1.9.43
229
+
230
+ # Re-run postinstall to copy correct components
231
+ rm -rf src/components/library
232
+ node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs
233
+ ```
234
+
235
+ ---
236
+
237
+ ## [1.9.42] - 2026-03-31
238
+
239
+ ### Known Issues
240
+ - ❌ Button.jsx and Input.jsx exist instead of UIButton.tsx and UIInput.tsx
241
+ - ❌ Templates import UIButton/UIInput but files don't exist
242
+ - ❌ Consuming applications fail to build
243
+
244
+ ### Fixed
245
+ - Restored comprehensive postinstall.mjs script
246
+ - Added "data" directory to package.json files array
247
+ - Re-added glob dependency
248
+
249
+ ---
250
+
251
+ ## [1.9.40] - 2026-03-31
252
+
253
+ ### Added
254
+ - glob dependency to package.json dependencies
255
+
256
+ ### Known Issues
257
+ - ❌ Component naming still incorrect (Button.jsx instead of UIButton.tsx)
258
+
259
+ ---
260
+
261
+ ## [1.9.29 - 1.9.39] - 2026-03-31
262
+
263
+ ### Known Issues
264
+ - Various combinations of missing files, missing dependencies, and incorrect naming
265
+ - All versions in this range are broken for new installations
266
+
267
+ ---
268
+
269
+ ## [1.9.28] - 2026-03-31
270
+
271
+ ### Status
272
+ ✅ Last known working version before naming crisis
273
+
274
+ ### Components
275
+ - UIButton.tsx ✅
276
+ - UIInput.tsx ✅
277
+ - All templates import correctly ✅
278
+ - Documentation matches implementation ✅
279
+
280
+ ---
281
+
282
+ ## [1.9.25] - 2026-03-30
283
+
284
+ ### Status
285
+ ✅ Golden reference version
286
+
287
+ ### Components
288
+ - UIButton.tsx ✅
289
+ - UIInput.tsx ✅
290
+ - Complete component library
291
+ - Working postinstall script
292
+ - All templates functional
293
+
294
+ ### Evidence
295
+ Used successfully in production project at `/Users/stephan.garcia/reactapp4/`
296
+
297
+ ---
298
+
299
+ ## Versioning Policy
300
+
301
+ ### When to Bump Versions
302
+
303
+ #### Patch (1.9.x)
304
+ - Bug fixes
305
+ - Documentation updates
306
+ - Internal refactoring that doesn't affect API
307
+
308
+ #### Minor (1.x.0)
309
+ - New components added
310
+ - New features added
311
+ - Backward-compatible API changes
312
+
313
+ #### Major (x.0.0)
314
+ - Breaking changes to component APIs
315
+ - Component renames that affect imports
316
+ - Removal of deprecated components
317
+
318
+ ### Pre-Release Checklist
319
+
320
+ **REQUIRED before every publish:**
321
+
322
+ 1. [ ] Run `bash scripts/verify-consistency.sh` (must pass)
323
+ 2. [ ] Run `npm run build` (must succeed)
324
+ 3. [ ] Update CHANGELOG.md with changes
325
+ 4. [ ] Test postinstall in a fresh directory
326
+ 5. [ ] Verify component names match .a4drules documentation
327
+ 6. [ ] Verify templates import components correctly
328
+ 7. [ ] Check package.json files array includes all necessary directories
329
+
330
+ **Never skip these steps.**
331
+
332
+ ---
333
+
334
+ ## Documentation Standards
335
+
336
+ ### Changelog Requirements
337
+
338
+ Every version entry MUST include:
339
+
340
+ 1. **Version number and date**
341
+ ```markdown
342
+ ## [1.9.43] - 2026-04-01
343
+ ```
344
+
345
+ 2. **Category sections** (as applicable):
346
+ - Added - New features
347
+ - Changed - Changes to existing functionality
348
+ - Deprecated - Soon-to-be removed features
349
+ - Removed - Removed features
350
+ - Fixed - Bug fixes
351
+ - Security - Security fixes
352
+
353
+ 3. **Component changes** (if any):
354
+ - List every component file added, removed, or renamed
355
+ - Explain why the change was made
356
+ - Document impact on templates and consuming projects
357
+
358
+ 4. **Breaking changes** (if any):
359
+ - Clearly marked with ⚠️ or "BREAKING"
360
+ - Migration instructions
361
+ - Affected versions
362
+
363
+ 5. **Known issues** (if any):
364
+ - Marked with ❌
365
+ - Description of the issue
366
+ - Workaround if available
367
+
368
+ ### Example Good Changelog Entry
369
+
370
+ ```markdown
371
+ ## [1.9.43] - 2026-04-01
372
+
373
+ ### Fixed
374
+ - **CRITICAL:** Restored UIButton.tsx and UIInput.tsx
375
+ - Fixes "Cannot resolve import" errors in templates
376
+ - Matches documented API in .a4drules/skills/component-library/
377
+ - Removed incorrect Button.jsx and Input.jsx files
378
+
379
+ ### Added
380
+ - CONTRIBUTING.md - Contribution guidelines
381
+ - scripts/verify-consistency.sh - Pre-publish validation
382
+
383
+ ### Migration
384
+ Update package version and re-run postinstall:
385
+ \`\`\`bash
386
+ npm install @schandlergarcia/sf-web-components@1.9.43
387
+ node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs
388
+ \`\`\`
389
+ ```
390
+
391
+ ---
392
+
393
+ ## Questions?
394
+
395
+ If you're unsure about:
396
+ - **Naming:** Check `.a4drules/skills/component-library/ui-primitives.md`
397
+ - **Changes:** Review this CHANGELOG for patterns
398
+ - **Testing:** Run `scripts/verify-consistency.sh`
399
+ - **Publishing:** Follow CONTRIBUTING.md checklist
400
+
401
+ **When in doubt, check against golden version 1.9.25-1.9.28.**
@@ -0,0 +1,247 @@
1
+ # Contributing to sf-web-components
2
+
3
+ ## Critical Rules
4
+
5
+ ### 1. Documentation is the Source of Truth
6
+
7
+ **Before making ANY changes to component names, check `.a4drules/skills/component-library/` first.**
8
+
9
+ The documentation in `.a4drules/skills/component-library/` defines the contract. Code must match documentation, not the other way around.
10
+
11
+ #### Change Process (ALWAYS follow this order):
12
+
13
+ 1. **Update `.a4drules/skills/component-library/` documentation FIRST**
14
+ 2. Update the component implementation in `src/components/library/`
15
+ 3. Update templates in `src/templates/` to use the new names
16
+ 4. Update barrel export in `src/components/library/index.jsx`
17
+ 5. Update any internal imports in `src/components/library/`
18
+ 6. Run `npm run build` to verify
19
+ 7. Test the postinstall script
20
+ 8. Publish new version
21
+
22
+ **Never skip step 1.** If you change code without updating docs first, you break the contract.
23
+
24
+ ### 2. Component Naming Rules
25
+
26
+ #### Library Components Must Use UI Prefix
27
+
28
+ ```tsx
29
+ // ✅ CORRECT
30
+ src/components/library/ui/UIButton.tsx
31
+ src/components/library/ui/UIInput.tsx
32
+
33
+ // ❌ WRONG - These names are reserved for outer app shadcn components
34
+ src/components/library/ui/Button.tsx
35
+ src/components/library/ui/Input.tsx
36
+ ```
37
+
38
+ From `.a4drules/skills/component-library/common-mistakes.md`:
39
+
40
+ > "shadcn components (`Button`, `Card`, `Input`, `Select`, `Alert`, `Skeleton`, etc.) exist for the outer app only. In command center pages, use the equivalent library component (`UIButton`, `BaseCard`/`WidgetCard`, `UIInput`, `Select`, `Alert`, `Skeleton`, etc. from `@/components/library`)"
41
+
42
+ #### File Extensions Matter
43
+
44
+ - Use `.tsx` for TypeScript files with JSX
45
+ - Use `.jsx` only for pure JavaScript files with JSX
46
+ - Prefer TypeScript (`.tsx`) for all new components
47
+
48
+ ### 3. Template Import Rules
49
+
50
+ Templates in `src/templates/` MUST import components using the exact names from `.a4drules/skills/component-library/`:
51
+
52
+ ```tsx
53
+ // ✅ CORRECT - Matches ui-primitives.md documentation
54
+ import UIButton from '@/components/library/ui/UIButton';
55
+ import UIInput from '@/components/library/ui/UIInput';
56
+
57
+ // ❌ WRONG - Does not match documentation
58
+ import Button from '@/components/library/ui/Button';
59
+ import Input from '@/components/library/ui/Input';
60
+ ```
61
+
62
+ ### 4. Barrel Export Consistency
63
+
64
+ The barrel export at `src/components/library/index.jsx` MUST match both:
65
+ 1. The actual file names in `src/components/library/ui/`
66
+ 2. The component names in `.a4drules/skills/component-library/ui-primitives.md`
67
+
68
+ ```jsx
69
+ // ✅ CORRECT
70
+ export { default as UIButton } from "./ui/UIButton";
71
+ export { default as UIInput } from "./ui/UIInput";
72
+
73
+ // ❌ WRONG
74
+ export { default as UIButton } from "./ui/Button"; // File doesn't exist
75
+ export { default as UIInput } from "./ui/Input"; // File doesn't exist
76
+ ```
77
+
78
+ ## Pre-Release Checklist
79
+
80
+ Before publishing any version, verify:
81
+
82
+ ### 1. Documentation Check
83
+ - [ ] All component names in code match `.a4drules/skills/component-library/` docs
84
+ - [ ] No new components added without documentation
85
+ - [ ] `common-mistakes.md` updated if new patterns emerge
86
+
87
+ ### 2. Component Check
88
+ ```bash
89
+ # UIButton and UIInput MUST exist as .tsx files
90
+ ls src/components/library/ui/UIButton.tsx
91
+ ls src/components/library/ui/UIInput.tsx
92
+
93
+ # Button.jsx and Input.jsx should NOT exist in library/ui/
94
+ # (They can exist in heroui/ but not in ui/)
95
+ ! ls src/components/library/ui/Button.jsx 2>/dev/null
96
+ ! ls src/components/library/ui/Input.jsx 2>/dev/null
97
+ ```
98
+
99
+ ### 3. Template Check
100
+ ```bash
101
+ # All templates must import UIButton (not Button)
102
+ grep -r "from '@/components/library/ui/UIButton'" src/templates/
103
+
104
+ # No template should import Button from ui/
105
+ ! grep -r "from '@/components/library/ui/Button'" src/templates/
106
+ ```
107
+
108
+ ### 4. Build Check
109
+ ```bash
110
+ npm run build
111
+ # Must succeed with no errors
112
+ ```
113
+
114
+ ### 5. Postinstall Check
115
+ ```bash
116
+ # Create test directory
117
+ mkdir -p /tmp/test-sf-components && cd /tmp/test-sf-components
118
+
119
+ # Initialize minimal package.json
120
+ cat > package.json << 'EOF'
121
+ {
122
+ "name": "test-project",
123
+ "version": "1.0.0",
124
+ "type": "module"
125
+ }
126
+ EOF
127
+
128
+ # Create minimal structure
129
+ mkdir -p src/pages src/components/library/ui
130
+
131
+ # Install package (will run postinstall)
132
+ npm install @schandlergarcia/sf-web-components@latest
133
+
134
+ # Verify UIButton was copied
135
+ ls src/components/library/ui/UIButton.tsx
136
+ ls src/components/library/ui/UIInput.tsx
137
+
138
+ # Verify templates were installed
139
+ ls src/pages/NotFound.tsx
140
+
141
+ # Verify NotFound imports UIButton
142
+ grep "UIButton" src/pages/NotFound.tsx
143
+ ```
144
+
145
+ ### 6. Version and Publish
146
+ ```bash
147
+ # Bump version
148
+ npm version patch # or minor, or major
149
+
150
+ # Publish
151
+ npm publish
152
+ ```
153
+
154
+ ## Common Mistakes to Avoid
155
+
156
+ ### Mistake #1: Renaming Components Without Updating Docs
157
+
158
+ ```bash
159
+ # ❌ WRONG - Changed code but not docs
160
+ mv src/components/library/ui/UIButton.tsx src/components/library/ui/Button.tsx
161
+ # Now templates fail because they import UIButton
162
+
163
+ # ✅ CORRECT - Update docs first
164
+ # 1. Edit .a4drules/skills/component-library/ui-primitives.md
165
+ # Change "UIButton" to "Button"
166
+ # 2. Update templates to import Button
167
+ # 3. Then rename the file
168
+ ```
169
+
170
+ ### Mistake #2: Using shadcn Names in Library
171
+
172
+ ```bash
173
+ # ❌ WRONG - Using shadcn naming convention
174
+ src/components/library/ui/Button.jsx
175
+ src/components/library/ui/Input.jsx
176
+
177
+ # ✅ CORRECT - Using library naming convention
178
+ src/components/library/ui/UIButton.tsx
179
+ src/components/library/ui/UIInput.tsx
180
+ ```
181
+
182
+ ### Mistake #3: Inconsistent File Extensions
183
+
184
+ ```bash
185
+ # ❌ WRONG - Mixing .jsx and .tsx inconsistently
186
+ src/components/library/ui/UIButton.jsx # JavaScript
187
+ src/components/library/ui/UIInput.tsx # TypeScript
188
+
189
+ # ✅ CORRECT - Consistent TypeScript
190
+ src/components/library/ui/UIButton.tsx
191
+ src/components/library/ui/UIInput.tsx
192
+ ```
193
+
194
+ ### Mistake #4: Forgetting to Update Barrel Export
195
+
196
+ ```jsx
197
+ // ❌ WRONG - File renamed but export not updated
198
+ // File: src/components/library/ui/UIButton.tsx
199
+ // But index.jsx still has:
200
+ export { default as UIButton } from "./ui/Button"; // ❌ Wrong path
201
+
202
+ // ✅ CORRECT
203
+ export { default as UIButton } from "./ui/UIButton"; // ✅ Matches file
204
+ ```
205
+
206
+ ### Mistake #5: Not Testing Postinstall
207
+
208
+ ```bash
209
+ # ❌ WRONG - Publishing without testing postinstall
210
+ npm publish
211
+
212
+ # ✅ CORRECT - Test postinstall first
213
+ npm pack
214
+ cd /tmp/test-package
215
+ npm install /path/to/sf-web-components-1.9.43.tgz
216
+ # Verify files copied correctly
217
+ ls src/components/library/ui/UIButton.tsx
218
+ ```
219
+
220
+ ## Recovery from Bad Release
221
+
222
+ If a broken version was published:
223
+
224
+ 1. **Do NOT use `npm unpublish`** (breaks downstream projects)
225
+ 2. Fix the issue following the correct process above
226
+ 3. Publish a new patch version immediately
227
+ 4. Document the issue in CHANGELOG.md
228
+
229
+ ## Golden Reference Version
230
+
231
+ **Version 1.9.25-1.9.28** is the golden reference that works correctly.
232
+
233
+ If you need to verify correct structure:
234
+ ```bash
235
+ npm view @schandlergarcia/sf-web-components@1.9.28 --json
236
+ ```
237
+
238
+ Working consuming project example: `/Users/stephan.garcia/reactapp4/` uses v1.9.25 successfully.
239
+
240
+ ## Questions?
241
+
242
+ If you're unsure about naming or structure:
243
+
244
+ 1. Check `.a4drules/skills/component-library/` documentation FIRST
245
+ 2. Check golden version 1.9.25-1.9.28
246
+ 3. Check working example in `/Users/stephan.garcia/reactapp4/`
247
+ 4. Ask before making changes