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 CHANGED
@@ -78,7 +78,7 @@ function App() {
78
78
 
79
79
  ### Next.js Projects
80
80
 
81
- Due to PostCSS compatibility, Next.js projects need a slightly different setup:
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 successfully');
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. **Import in `_app.tsx`**:
118
+ 3. **Load CSS in `pages/_document.tsx`**:
113
119
 
114
120
  ```tsx
115
- import '@/styles/globals.scss';
116
- import '@/styles/shekel-shared-lib.css'; // Import the copied CSS
117
- import { ConfigProvider } from 'antd';
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 your local styles folder, avoiding PostCSS processing conflicts.
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