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.

@@ -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
- const cssFiles = [
20
- path.resolve(__dirname, '../css/custom.css'),
21
- path.resolve(__dirname, '../css/catppuccin.css')
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portosaurus",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "license": "GPL-3.0",
5
5
  "author": "soymadip",
6
6
  "description": "Complete portfolio cum personal website solution for your digital personality",
@@ -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
- // Try to find variable in CSS files
25
- const cssFiles = [
26
- path.resolve(__dirname, '../css/custom.css'),
27
- path.resolve(__dirname, '../css/catppuccin.css')
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}`);