@lifeonlars/prime-yggdrasil 0.1.3 → 0.1.4

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.
@@ -603,7 +603,6 @@
603
603
  border-top-right-radius: var(--radius-lg) !important;
604
604
  border-bottom-right-radius: var(--radius-lg) !important;
605
605
  }
606
- }
607
606
 
608
607
  .p-inplace .p-inplace-display {
609
608
  padding: 0.75rem 0.75rem;
package/docs/Fixes.md CHANGED
@@ -1,123 +1,258 @@
1
- # Prime Yggdrasil npm Package Issues
1
+ # Prime Yggdrasil npm Package Issues - Testing Report
2
2
 
3
- ## Critical Issues Found
3
+ ## Version History
4
4
 
5
- ### 1. **Broken CSS Build** (CRITICAL - Blocks Usage)
5
+ ### v0.1.1 - Initial Test
6
6
 
7
- **Package Version:** `@lifeonlars/prime-yggdrasil@0.1.1`
7
+ **Status:** ❌ BROKEN - Missing 4 critical CSS files
8
+
9
+ ### v0.1.2 - After First Fix
10
+
11
+ **Status:** ⚠️ PARTIALLY FIXED - Missing 1 critical file (prime-palette.css)
12
+
13
+ ### v0.1.3 - After Second Fix
14
+
15
+ **Status:** ❌ BROKEN - CSS syntax error in misc.css
16
+
17
+ ---
18
+
19
+ ## Issue #1: Missing CSS Files (v0.1.1) ✅ RESOLVED
20
+
21
+ ### Problem
8
22
 
9
- **Problem:**
10
23
  The `yggdrasil-light.css` and `yggdrasil-dark.css` files contain `@import` statements that reference CSS files that don't exist in the published package.
11
24
 
12
- **yggdrasil-light.css contains:**
25
+ **Status:** ✅ FIXED in v0.1.2
26
+
27
+ ---
28
+
29
+ ## Issue #2: Missing prime-palette.css (v0.1.2) ✅ RESOLVED
30
+
31
+ ### Problem
32
+
33
+ Both `semantic-light.css` and `semantic-dark.css` import `prime-palette.css` which didn't exist in dist folder.
34
+
35
+ **Status:** ✅ FIXED in v0.1.3 - File is now present (8.1KB)
36
+
37
+ ---
38
+
39
+ ## Issue #3: CSS Syntax Error in misc.css (v0.1.3) ❌ CURRENT ISSUE
40
+
41
+ ### Problem (NEW in v0.1.3)
42
+
43
+ The file `dist/components/misc.css` has a CSS syntax error - an extra closing brace `}` at line 606.
44
+
45
+ **Build Error:**
13
46
 
14
- ```css
15
- @import url('https://fonts.googleapis.com/css2?family=Roboto:...');
16
- @import "./foundations.css"; ✅ EXISTS
17
- @import "./radius.css"; ❌ MISSING
18
- @import "./semantic-light.css"; ❌ MISSING
19
- @import "./components.css"; ❌ MISSING
20
47
  ```
48
+ [vite:css] [postcss] postcss-import:
49
+ S:\...\dist\components\misc.css:606:1: Unexpected }
50
+ ```
51
+
52
+ **Location:** `components/misc.css` line 606
53
+
54
+ **Analysis:**
21
55
 
22
- **Files in dist folder:**
56
+ - Lines 1-606 contain:
57
+ - **Opening braces:** 127
58
+ - **Closing braces:** 128
59
+ - **Extra closing braces:** 1
23
60
 
24
- - `foundations.css` (6KB, contains foundation color tokens)
25
- - ✅ `yggdrasil-light.css` (401 bytes, just imports)
26
- - ✅ `yggdrasil-dark.css` (399 bytes, just imports)
27
- - ❌ `radius.css` (MISSING)
28
- - ❌ `semantic-light.css` (MISSING)
29
- - ❌ `semantic-dark.css` (MISSING)
30
- - ❌ `components.css` (MISSING)
61
+ **Context around line 606:**
62
+
63
+ ```css
64
+ .border-round-right-lg {
65
+ border-top-right-radius: var(--radius-lg) !important;
66
+ border-bottom-right-radius: var(--radius-lg) !important;
67
+ }
68
+ } ← Line 606: EXTRA CLOSING BRACE
69
+
70
+ .p-inplace .p-inplace-display {
71
+ padding: 0.75rem 0.75rem;
72
+ ```
31
73
 
32
74
  **Impact:**
33
75
 
34
- - Cannot use the theme as documented
35
- - Importing `@lifeonlars/prime-yggdrasil/yggdrasil-light.css` fails silently or throws errors
36
- - Semantic tokens referenced in documentation are not available
76
+ - Production build fails completely
77
+ - Cannot deploy application
78
+ - PostCSS parsing error prevents CSS compilation
37
79
 
38
80
  **Root Cause:**
39
- The Vite build configuration is not properly bundling CSS files. The `@import` statements are being left as-is instead of:
40
-
41
- 1. Being resolved and bundled into a single file, OR
42
- 2. Having the referenced files copied to the dist folder
43
-
44
- ## Recommended Fixes
45
-
46
- ### Option 1: Bundle All Imports (Recommended)
47
-
48
- Update `vite.config.lib.ts` to use PostCSS with the `postcss-import` plugin to inline all `@import` statements:
49
-
50
- ```ts
51
- // vite.config.lib.ts
52
- import { defineConfig } from 'vite';
53
- import postcssImport from 'postcss-import';
54
-
55
- export default defineConfig({
56
- css: {
57
- postcss: {
58
- plugins: [postcssImport()],
59
- },
60
- },
61
- build: {
62
- lib: {
63
- // ... existing config
64
- },
65
- cssCodeSplit: false, // Bundle all CSS into one file
66
- },
67
- });
68
- ```
81
+ There's an unmatched closing brace at line 606. This appears to be a leftover from editing or a merge conflict. The brace doesn't close any open block.
69
82
 
70
- ### Option 2: Copy All Referenced Files
83
+ ---
71
84
 
72
- Update the build script to copy all referenced CSS files to dist:
85
+ ## Recommended Fix for v0.1.4
73
86
 
74
- ```json
75
- {
76
- "scripts": {
77
- "build": "tsc -p tsconfig.lib.json && vite build --config vite.config.lib.ts && npm run copy-css",
78
- "copy-css": "cp src/theme/radius.css src/theme/semantic-light.css src/theme/semantic-dark.css src/theme/components.css dist/"
87
+ ### Fix: Remove Extra Closing Brace
88
+
89
+ **In `dist/components/misc.css` line 606:**
90
+
91
+ ```diff
92
+ .border-round-right-lg {
93
+ border-top-right-radius: var(--radius-lg) !important;
94
+ border-bottom-right-radius: var(--radius-lg) !important;
79
95
  }
80
- }
96
+ - }
97
+
98
+ .p-inplace .p-inplace-display {
99
+ padding: 0.75rem 0.75rem;
81
100
  ```
82
101
 
83
- ### Option 3: Update Package Exports
102
+ **OR** - Check the source file before build:
84
103
 
85
- If the files are supposed to be separate, update the build to include them and update package.json exports:
104
+ If this error is coming from the source, fix it in the source file (likely `src/theme/components/misc.css` or similar) and rebuild.
86
105
 
87
- ```json
88
- {
89
- "exports": {
90
- "./radius.css": "./dist/radius.css",
91
- "./semantic-light.css": "./dist/semantic-light.css",
92
- "./semantic-dark.css": "./dist/semantic-dark.css",
93
- "./components.css": "./dist/components.css"
94
- }
95
- }
106
+ ### Validation Step
107
+
108
+ After fixing, validate the CSS:
109
+
110
+ ```bash
111
+ # Count braces - should be equal
112
+ grep -c "{" dist/components/misc.css
113
+ grep -c "}" dist/components/misc.css
114
+
115
+ # OR use a CSS linter
116
+ npx stylelint dist/components/misc.css
96
117
  ```
97
118
 
98
- ## Current Workaround in This Project
119
+ ---
120
+
121
+ ## Files Status in v0.1.3
99
122
 
100
- Since the Yggdrasil theme is broken, this project uses:
123
+ All required files are now present:
101
124
 
102
- - PrimeReact's base `lara-light-blue` theme
103
- - Yggdrasil's `foundations.css` (for foundation color tokens)
125
+ - `components.css` (469 bytes)
126
+ - `foundations.css` (6.1KB)
127
+ - ✅ `prime-palette.css` (8.1KB) - **FIXED in v0.1.3**
128
+ - ✅ `radius.css` (1.6KB)
129
+ - ✅ `semantic-dark.css` (9.0KB)
130
+ - ✅ `semantic-light.css` (8.8KB)
131
+ - ✅ `yggdrasil-dark.css` (399 bytes)
132
+ - ✅ `yggdrasil-light.css` (401 bytes)
133
+ - ✅ `components/` directory with individual component CSS files
134
+ - ❌ `components/misc.css` has syntax error
104
135
 
105
- See [src/main.tsx](src/main.tsx:3-8) for the workaround implementation.
136
+ ---
106
137
 
107
- ## Testing Checklist for Fixed Package
138
+ ## Testing Checklist for v0.1.4
108
139
 
109
- When the package is fixed, verify:
140
+ When the package is updated, verify:
110
141
 
142
+ - [ ] Remove extra closing brace from misc.css line 606
143
+ - [ ] CSS linting passes (`npx stylelint dist/**/*.css`)
144
+ - [ ] Brace count matches (opening === closing)
145
+ - [ ] `npm run build` succeeds in consumer project
146
+ - [ ] No PostCSS parsing errors
111
147
  - [ ] `yggdrasil-light.css` loads without errors
112
148
  - [ ] `yggdrasil-dark.css` loads without errors
113
- - [ ] All semantic tokens are available (--text-neutral-default, --surface-brand-primary, etc.)
114
- - [ ] PrimeReact components are properly styled
149
+ - [ ] All semantic tokens available in browser
150
+ - [ ] Production build succeeds
115
151
  - [ ] Dark mode switching works
116
- - [ ] No 404 errors in browser console for CSS files
152
+
153
+ ---
154
+
155
+ ## Test Commands
156
+
157
+ To reproduce the issue in v0.1.3:
158
+
159
+ ```bash
160
+ # Install the package
161
+ npm install @lifeonlars/prime-yggdrasil@0.1.3
162
+
163
+ # Import in your app (src/main.tsx)
164
+ import '@lifeonlars/prime-yggdrasil/yggdrasil-light.css'
165
+
166
+ # Try to build
167
+ npm run build
168
+
169
+ # Expected error:
170
+ # [postcss] postcss-import: ...misc.css:606:1: Unexpected }
171
+ ```
172
+
173
+ ---
174
+
175
+ ## Progress Summary
176
+
177
+ ### v0.1.1 → v0.1.2
178
+
179
+ ✅ **Fixed:** Added 4 missing CSS files
180
+
181
+ - radius.css
182
+ - semantic-light.css
183
+ - semantic-dark.css
184
+ - components.css
185
+
186
+ ### v0.1.2 → v0.1.3
187
+
188
+ ✅ **Fixed:** Added prime-palette.css (8.1KB)
189
+ ❌ **New Issue:** CSS syntax error in components/misc.css
190
+
191
+ ### v0.1.3 → v0.1.4 (Required)
192
+
193
+ ❌ **Remaining Issue:** Extra closing brace in misc.css line 606
194
+
195
+ - Single character fix
196
+ - Blocking all production builds
197
+
198
+ ---
117
199
 
118
200
  ## Additional Notes
119
201
 
120
- - The package.json version shows `0.1.1`, which suggests this is an early release
121
- - Documentation references Storybook but no Storybook URL is provided
122
- - The foundations.css works correctly and contains all expected foundation tokens
123
- - The JS exports (version, theme metadata) work correctly
202
+ ### Good Progress Overall!
203
+
204
+ - v0.1.2: Fixed the main missing files issue
205
+ - v0.1.3: Fixed the nested import issue (prime-palette.css)
206
+ - **Remaining:** Just one syntax error (extra `}` character)
207
+
208
+ ### Build Process Recommendations
209
+
210
+ To prevent CSS syntax errors in future releases:
211
+
212
+ 1. **Add CSS Linting to CI/CD:**
213
+
214
+ ```json
215
+ {
216
+ "scripts": {
217
+ "lint:css": "stylelint \"dist/**/*.css\"",
218
+ "test:css": "postcss dist/**/*.css --syntax postcss"
219
+ }
220
+ }
221
+ ```
222
+
223
+ 2. **Validate Build Output:**
224
+
225
+ ```bash
226
+ # After build, before publish
227
+ npm run lint:css
228
+ npm run test:css
229
+ ```
230
+
231
+ 3. **Test in Consumer Project:**
232
+ ```bash
233
+ # Link locally and test build
234
+ npm link
235
+ cd ../test-project
236
+ npm link @lifeonlars/prime-yggdrasil
237
+ npm run build
238
+ ```
239
+
240
+ ### CSS File Generation
241
+
242
+ The misc.css file is likely generated from source. Check:
243
+
244
+ - Is there a build script that concatenates CSS files?
245
+ - Is there a template or generator that might have introduced the extra brace?
246
+ - Did a recent merge introduce the syntax error?
247
+
248
+ ---
249
+
250
+ ## Quick Fix Summary
251
+
252
+ **The fix is simple - just remove one character:**
253
+
254
+ **File:** `dist/components/misc.css`
255
+ **Line:** 606
256
+ **Action:** Delete the standalone `}` on this line
257
+
258
+ After this fix, the package should work correctly! ✨
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeonlars/prime-yggdrasil",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "AI-agent-friendly PrimeReact design system for component-driven development with semantic tokens and dark mode support",
6
6
  "keywords": [