@nqlib/nqui 0.1.0 → 0.1.1
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/package.json +1 -1
- package/scripts/init-css.js +13 -1
package/package.json
CHANGED
package/scripts/init-css.js
CHANGED
|
@@ -19,8 +19,12 @@ const __dirname = dirname(__filename);
|
|
|
19
19
|
const projectRoot = resolve(__dirname, '..');
|
|
20
20
|
const indexCssPath = join(projectRoot, 'src', 'index.css');
|
|
21
21
|
const colorsCssPath = join(projectRoot, 'src', 'styles', 'colors.css');
|
|
22
|
+
const distStylesPath = join(projectRoot, 'dist', 'styles.css');
|
|
22
23
|
const examplesDir = join(projectRoot, 'scripts', 'examples');
|
|
23
24
|
|
|
25
|
+
// Check if we're in a published package (source files don't exist, but dist/styles.css does)
|
|
26
|
+
const isPublishedPackage = !existsSync(indexCssPath) && existsSync(distStylesPath);
|
|
27
|
+
|
|
24
28
|
// Function to find actual CSS file location for Next.js
|
|
25
29
|
function findNextJsCssFile() {
|
|
26
30
|
const possiblePaths = [
|
|
@@ -98,7 +102,15 @@ function findProjectType() {
|
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
function extractStandaloneCSS() {
|
|
101
|
-
//
|
|
105
|
+
// If we're in a published package, use dist/styles.css directly
|
|
106
|
+
if (isPublishedPackage) {
|
|
107
|
+
if (!existsSync(distStylesPath)) {
|
|
108
|
+
throw new Error(`Published package CSS file not found: ${distStylesPath}`);
|
|
109
|
+
}
|
|
110
|
+
return readFileSync(distStylesPath, 'utf-8');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Read the source CSS files (for local development)
|
|
102
114
|
if (!existsSync(indexCssPath)) {
|
|
103
115
|
throw new Error(`Source CSS file not found: ${indexCssPath}`);
|
|
104
116
|
}
|