shekel-fe-shared-lib 1.0.16 → 1.0.18
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/README.md +27 -8
- package/dist/index.cjs +30 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +807 -785
- package/dist/index.mjs.map +1 -1
- package/dist/shekel-fe-shared-lib.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ function App() {
|
|
|
78
78
|
|
|
79
79
|
### Next.js Projects
|
|
80
80
|
|
|
81
|
-
Due to PostCSS compatibility
|
|
81
|
+
Due to PostCSS compatibility between Tailwind v4 (used in this library) and Tailwind v3 (commonly used in Next.js projects), Next.js requires a special setup:
|
|
82
82
|
|
|
83
83
|
1. **Create a postinstall script** (`scripts/copy-shared-lib-css.js`):
|
|
84
84
|
|
|
@@ -87,12 +87,18 @@ const fs = require('fs');
|
|
|
87
87
|
const path = require('path');
|
|
88
88
|
|
|
89
89
|
const source = path.join(__dirname, '../node_modules/shekel-fe-shared-lib/dist/shekel-fe-shared-lib.css');
|
|
90
|
-
const dest = path.join(__dirname, '../styles/shekel-shared-lib.css');
|
|
90
|
+
const dest = path.join(__dirname, '../public/styles/shekel-shared-lib.css');
|
|
91
91
|
|
|
92
92
|
try {
|
|
93
|
+
// Ensure public/styles directory exists
|
|
94
|
+
const dir = path.dirname(dest);
|
|
95
|
+
if (!fs.existsSync(dir)) {
|
|
96
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
97
|
+
}
|
|
98
|
+
|
|
93
99
|
if (fs.existsSync(source)) {
|
|
94
100
|
fs.copyFileSync(source, dest);
|
|
95
|
-
console.log('✓ Copied shekel-fe-shared-lib CSS
|
|
101
|
+
console.log('✓ Copied shekel-fe-shared-lib CSS to public/styles/');
|
|
96
102
|
}
|
|
97
103
|
} catch (error) {
|
|
98
104
|
console.error('Warning: Could not copy shekel-fe-shared-lib CSS:', error.message);
|
|
@@ -109,15 +115,28 @@ try {
|
|
|
109
115
|
}
|
|
110
116
|
```
|
|
111
117
|
|
|
112
|
-
3. **
|
|
118
|
+
3. **Load CSS in `pages/_document.tsx`**:
|
|
113
119
|
|
|
114
120
|
```tsx
|
|
115
|
-
import '
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
import { Html, Head, Main, NextScript } from 'next/document';
|
|
122
|
+
|
|
123
|
+
export default function Document() {
|
|
124
|
+
return (
|
|
125
|
+
<Html lang="en">
|
|
126
|
+
<Head>
|
|
127
|
+
{/* Load shared library CSS directly to bypass PostCSS */}
|
|
128
|
+
<link rel="stylesheet" href="/styles/shekel-shared-lib.css" />
|
|
129
|
+
</Head>
|
|
130
|
+
<body>
|
|
131
|
+
<Main />
|
|
132
|
+
<NextScript />
|
|
133
|
+
</body>
|
|
134
|
+
</Html>
|
|
135
|
+
);
|
|
136
|
+
}
|
|
118
137
|
```
|
|
119
138
|
|
|
120
|
-
The postinstall script automatically copies the library's CSS to
|
|
139
|
+
The postinstall script automatically copies the library's CSS to the `public/` folder on install, and loading it via a link tag bypasses PostCSS processing entirely.
|
|
121
140
|
|
|
122
141
|
### Tailwind CSS Setup
|
|
123
142
|
|