portosaurus 0.16.1 → 0.16.3
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.
Potentially problematic release.
This version of portosaurus might be problematic. Click here for more details.
- package/lib/src/utils/cssUtils.js +16 -3
- package/package.json +1 -1
- package/src/utils/cssUtils.ts +21 -4
|
@@ -16,10 +16,23 @@ export function getCssVar(varName) {
|
|
|
16
16
|
}
|
|
17
17
|
DEBUG && console.log(`[CSS-DEBUG] Looking for CSS variable: ${varName}`);
|
|
18
18
|
// Try to find variable in CSS files
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
// We need to handle both dev (src/css) and prod (lib/src/css) structures
|
|
20
|
+
// When running in lib: __dirname is .../lib/src/utils
|
|
21
|
+
// We want .../lib/src/css
|
|
22
|
+
const cssDir = path.resolve(__dirname, '../css');
|
|
23
|
+
const srcCssDir = path.resolve(__dirname, '../../src/css'); // Fallback for some dev setups
|
|
24
|
+
const potentialFiles = [
|
|
25
|
+
path.join(cssDir, 'custom.css'),
|
|
26
|
+
path.join(cssDir, 'catppuccin.css'),
|
|
27
|
+
path.join(srcCssDir, 'custom.css'),
|
|
28
|
+
path.join(srcCssDir, 'catppuccin.css')
|
|
22
29
|
];
|
|
30
|
+
const cssFiles = potentialFiles.filter(f => fs.existsSync(f));
|
|
31
|
+
if (cssFiles.length === 0) {
|
|
32
|
+
DEBUG && console.warn(`[CSS-DEBUG] No CSS files found. Checked: ${potentialFiles.join(', ')}`);
|
|
33
|
+
// Don't throw immediately, maybe the variable is not needed?
|
|
34
|
+
// But getCssVar contract implies it must return something or throw.
|
|
35
|
+
}
|
|
23
36
|
for (const cssPath of cssFiles) {
|
|
24
37
|
try {
|
|
25
38
|
DEBUG && console.log(`[CSS-DEBUG] Checking file: ${cssPath}`);
|
package/package.json
CHANGED
package/src/utils/cssUtils.ts
CHANGED
|
@@ -21,12 +21,29 @@ export function getCssVar(varName: string): string {
|
|
|
21
21
|
|
|
22
22
|
DEBUG && console.log(`[CSS-DEBUG] Looking for CSS variable: ${varName}`);
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
// Try to find variable in CSS files
|
|
25
|
+
// We need to handle both dev (src/css) and prod (lib/src/css) structures
|
|
26
|
+
// When running in lib: __dirname is .../lib/src/utils
|
|
27
|
+
// We want .../lib/src/css
|
|
28
|
+
|
|
29
|
+
const cssDir = path.resolve(__dirname, '../css');
|
|
30
|
+
const srcCssDir = path.resolve(__dirname, '../../src/css'); // Fallback for some dev setups
|
|
31
|
+
|
|
32
|
+
const potentialFiles = [
|
|
33
|
+
path.join(cssDir, 'custom.css'),
|
|
34
|
+
path.join(cssDir, 'catppuccin.css'),
|
|
35
|
+
path.join(srcCssDir, 'custom.css'),
|
|
36
|
+
path.join(srcCssDir, 'catppuccin.css')
|
|
28
37
|
];
|
|
29
38
|
|
|
39
|
+
const cssFiles = potentialFiles.filter(f => fs.existsSync(f));
|
|
40
|
+
|
|
41
|
+
if (cssFiles.length === 0) {
|
|
42
|
+
DEBUG && console.warn(`[CSS-DEBUG] No CSS files found. Checked: ${potentialFiles.join(', ')}`);
|
|
43
|
+
// Don't throw immediately, maybe the variable is not needed?
|
|
44
|
+
// But getCssVar contract implies it must return something or throw.
|
|
45
|
+
}
|
|
46
|
+
|
|
30
47
|
for (const cssPath of cssFiles) {
|
|
31
48
|
try {
|
|
32
49
|
DEBUG && console.log(`[CSS-DEBUG] Checking file: ${cssPath}`);
|