big fixes

fixes feedback from thecodacus
This commit is contained in:
Stijnus
2025-01-30 17:17:36 +01:00
parent d9a380f28a
commit d1d23d80e7
68 changed files with 2449 additions and 1350 deletions

View File

@@ -63,7 +63,7 @@ export const STARTER_TEMPLATES: Template[] = [
description: 'Slidev starter template for creating developer-friendly presentations using Markdown',
githubRepo: 'thecodacus/bolt-slidev-template',
tags: ['slidev', 'presentation', 'markdown'],
icon: 'i-bolt:slidev',
icon: 'i-bolt-slidev',
},
{
name: 'bolt-sveltekit',

View File

@@ -1,17 +0,0 @@
export function getLocalStorage(key: string) {
try {
const item = localStorage.getItem(key);
return item ? JSON.parse(item) : null;
} catch (error) {
console.error(`Error reading from localStorage key "${key}":`, error);
return null;
}
}
export function setLocalStorage(key: string, value: any) {
try {
localStorage.setItem(key, JSON.stringify(value));
} catch (error) {
console.error(`Error writing to localStorage key "${key}":`, error);
}
}

19
app/utils/path.ts Normal file
View File

@@ -0,0 +1,19 @@
// Browser-compatible path utilities
import type { ParsedPath } from 'path';
import pathBrowserify from 'path-browserify';
/**
* A browser-compatible path utility that mimics Node's path module
* Using path-browserify for consistent behavior in browser environments
*/
export const path = {
join: (...paths: string[]): string => pathBrowserify.join(...paths),
dirname: (path: string): string => pathBrowserify.dirname(path),
basename: (path: string, ext?: string): string => pathBrowserify.basename(path, ext),
extname: (path: string): string => pathBrowserify.extname(path),
relative: (from: string, to: string): string => pathBrowserify.relative(from, to),
isAbsolute: (path: string): boolean => pathBrowserify.isAbsolute(path),
normalize: (path: string): string => pathBrowserify.normalize(path),
parse: (path: string): ParsedPath => pathBrowserify.parse(path),
format: (pathObject: ParsedPath): string => pathBrowserify.format(pathObject),
} as const;