Stijnus commited on
Commit
2c991e4
·
1 Parent(s): 1eae44d
app/components/chat/StarterTemplates.tsx CHANGED
@@ -14,7 +14,7 @@ const FrameworkLink: React.FC<FrameworkLinkProps> = ({ template }) => (
14
  className="items-center justify-center"
15
  >
16
  <div
17
- className={`inline-flex items-center justify-center ${template.icon} w-8 h-8 text-4xl transition-theme opacity-25 hover:opacity-100 hover:text-purple-500 dark:text-white dark:opacity-50 dark:hover:opacity-100 dark:hover:text-purple-400 transition-all`}
18
  title={template.label}
19
  />
20
  </a>
 
14
  className="items-center justify-center"
15
  >
16
  <div
17
+ className={`inline-block ${template.icon} w-8 h-8 text-4xl transition-theme opacity-25 hover:opacity-100 hover:text-purple-500 dark:text-white dark:opacity-50 dark:hover:opacity-100 dark:hover:text-purple-400 transition-all`}
18
  title={template.label}
19
  />
20
  </a>
app/utils/constants.ts CHANGED
@@ -31,7 +31,7 @@ export const STARTER_TEMPLATES: Template[] = [
31
  description: 'Lightweight Astro starter template for building fast static websites',
32
  githubRepo: 'thecodacus/bolt-astro-basic-template',
33
  tags: ['astro', 'blog', 'performance'],
34
- icon: 'i-bolt-astro',
35
  },
36
  {
37
  name: 'bolt-nextjs-shadcn',
@@ -39,7 +39,7 @@ export const STARTER_TEMPLATES: Template[] = [
39
  description: 'Next.js starter fullstack template integrated with shadcn/ui components and styling system',
40
  githubRepo: 'thecodacus/bolt-nextjs-shadcn-template',
41
  tags: ['nextjs', 'react', 'typescript', 'shadcn', 'tailwind'],
42
- icon: 'i-bolt-nextjs',
43
  },
44
  {
45
  name: 'bolt-qwik-ts',
@@ -47,7 +47,7 @@ export const STARTER_TEMPLATES: Template[] = [
47
  description: 'Qwik framework starter with TypeScript for building resumable applications',
48
  githubRepo: 'thecodacus/bolt-qwik-ts-template',
49
  tags: ['qwik', 'typescript', 'performance', 'resumable'],
50
- icon: 'i-bolt-qwik',
51
  },
52
  {
53
  name: 'bolt-remix-ts',
@@ -55,7 +55,7 @@ export const STARTER_TEMPLATES: Template[] = [
55
  description: 'Remix framework starter with TypeScript for full-stack web applications',
56
  githubRepo: 'thecodacus/bolt-remix-ts-template',
57
  tags: ['remix', 'typescript', 'fullstack', 'react'],
58
- icon: 'i-bolt-remix',
59
  },
60
  {
61
  name: 'bolt-slidev',
@@ -71,7 +71,7 @@ export const STARTER_TEMPLATES: Template[] = [
71
  description: 'SvelteKit starter template for building fast, efficient web applications',
72
  githubRepo: 'bolt-sveltekit-template',
73
  tags: ['svelte', 'sveltekit', 'typescript'],
74
- icon: 'i-bolt-svelte',
75
  },
76
  {
77
  name: 'vanilla-vite',
@@ -79,7 +79,7 @@ export const STARTER_TEMPLATES: Template[] = [
79
  description: 'Minimal Vite starter template for vanilla JavaScript projects',
80
  githubRepo: 'thecodacus/vanilla-vite-template',
81
  tags: ['vite', 'vanilla-js', 'minimal'],
82
- icon: 'i-bolt-vite',
83
  },
84
  {
85
  name: 'bolt-vite-react',
@@ -87,7 +87,7 @@ export const STARTER_TEMPLATES: Template[] = [
87
  description: 'React starter template powered by Vite for fast development experience',
88
  githubRepo: 'thecodacus/bolt-vite-react-ts-template',
89
  tags: ['react', 'vite', 'frontend'],
90
- icon: 'i-bolt-react',
91
  },
92
  {
93
  name: 'bolt-vite-ts',
@@ -95,7 +95,7 @@ export const STARTER_TEMPLATES: Template[] = [
95
  description: 'Vite starter template with TypeScript configuration for type-safe development',
96
  githubRepo: 'thecodacus/bolt-vite-ts-template',
97
  tags: ['vite', 'typescript', 'minimal'],
98
- icon: 'i-bolt-typescript',
99
  },
100
  {
101
  name: 'bolt-vue',
@@ -103,7 +103,7 @@ export const STARTER_TEMPLATES: Template[] = [
103
  description: 'Vue.js starter template with modern tooling and best practices',
104
  githubRepo: 'thecodacus/bolt-vue-template',
105
  tags: ['vue', 'typescript', 'frontend'],
106
- icon: 'i-bolt-vue',
107
  },
108
  {
109
  name: 'bolt-angular',
@@ -111,6 +111,6 @@ export const STARTER_TEMPLATES: Template[] = [
111
  description: 'A modern Angular starter template with TypeScript support and best practices configuration',
112
  githubRepo: 'thecodacus/bolt-angular-template',
113
  tags: ['angular', 'typescript', 'frontend', 'spa'],
114
- icon: 'i-bolt-angular',
115
  },
116
  ];
 
31
  description: 'Lightweight Astro starter template for building fast static websites',
32
  githubRepo: 'thecodacus/bolt-astro-basic-template',
33
  tags: ['astro', 'blog', 'performance'],
34
+ icon: 'i-bolt:astro',
35
  },
36
  {
37
  name: 'bolt-nextjs-shadcn',
 
39
  description: 'Next.js starter fullstack template integrated with shadcn/ui components and styling system',
40
  githubRepo: 'thecodacus/bolt-nextjs-shadcn-template',
41
  tags: ['nextjs', 'react', 'typescript', 'shadcn', 'tailwind'],
42
+ icon: 'i-bolt:nextjs',
43
  },
44
  {
45
  name: 'bolt-qwik-ts',
 
47
  description: 'Qwik framework starter with TypeScript for building resumable applications',
48
  githubRepo: 'thecodacus/bolt-qwik-ts-template',
49
  tags: ['qwik', 'typescript', 'performance', 'resumable'],
50
+ icon: 'i-bolt:qwik',
51
  },
52
  {
53
  name: 'bolt-remix-ts',
 
55
  description: 'Remix framework starter with TypeScript for full-stack web applications',
56
  githubRepo: 'thecodacus/bolt-remix-ts-template',
57
  tags: ['remix', 'typescript', 'fullstack', 'react'],
58
+ icon: 'i-bolt:remix',
59
  },
60
  {
61
  name: 'bolt-slidev',
 
71
  description: 'SvelteKit starter template for building fast, efficient web applications',
72
  githubRepo: 'bolt-sveltekit-template',
73
  tags: ['svelte', 'sveltekit', 'typescript'],
74
+ icon: 'i-bolt:svelte',
75
  },
76
  {
77
  name: 'vanilla-vite',
 
79
  description: 'Minimal Vite starter template for vanilla JavaScript projects',
80
  githubRepo: 'thecodacus/vanilla-vite-template',
81
  tags: ['vite', 'vanilla-js', 'minimal'],
82
+ icon: 'i-bolt:vite',
83
  },
84
  {
85
  name: 'bolt-vite-react',
 
87
  description: 'React starter template powered by Vite for fast development experience',
88
  githubRepo: 'thecodacus/bolt-vite-react-ts-template',
89
  tags: ['react', 'vite', 'frontend'],
90
+ icon: 'i-bolt:react',
91
  },
92
  {
93
  name: 'bolt-vite-ts',
 
95
  description: 'Vite starter template with TypeScript configuration for type-safe development',
96
  githubRepo: 'thecodacus/bolt-vite-ts-template',
97
  tags: ['vite', 'typescript', 'minimal'],
98
+ icon: 'i-bolt:typescript',
99
  },
100
  {
101
  name: 'bolt-vue',
 
103
  description: 'Vue.js starter template with modern tooling and best practices',
104
  githubRepo: 'thecodacus/bolt-vue-template',
105
  tags: ['vue', 'typescript', 'frontend'],
106
+ icon: 'i-bolt:vue',
107
  },
108
  {
109
  name: 'bolt-angular',
 
111
  description: 'A modern Angular starter template with TypeScript support and best practices configuration',
112
  githubRepo: 'thecodacus/bolt-angular-template',
113
  tags: ['angular', 'typescript', 'frontend', 'spa'],
114
+ icon: 'i-bolt:angular',
115
  },
116
  ];
uno.config.ts CHANGED
@@ -2,6 +2,7 @@ import { globSync } from 'fast-glob';
2
  import fs from 'node:fs/promises';
3
  import { basename, join } from 'node:path';
4
  import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
 
5
 
6
  // Debug: Log the current working directory and icon paths
7
  console.log('CWD:', process.cwd());
@@ -15,11 +16,13 @@ const customIconCollection = {
15
  [collectionName]: iconPaths.reduce(
16
  (acc, iconPath) => {
17
  const [iconName] = basename(iconPath).split('.');
18
- console.log(`Loading icon: ${iconName} from ${iconPath}`);
19
 
20
  acc[iconName] = async () => {
21
  try {
22
  const content = await fs.readFile(iconPath, 'utf8');
 
 
23
  return content
24
  .replace(/fill="[^"]*"/g, 'fill="currentColor"')
25
  .replace(/fill='[^']*'/g, "fill='currentColor'")
@@ -120,7 +123,7 @@ export default defineConfig({
120
  safelist: [
121
  // Explicitly safelist all icon combinations
122
  ...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x}`),
123
- ...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x.toLowerCase()}`),
124
  ],
125
  shortcuts: {
126
  'bolt-ease-cubic-bezier': 'ease-[cubic-bezier(0.4,0,0.2,1)]',
@@ -263,7 +266,11 @@ export default defineConfig({
263
  presetIcons({
264
  warn: true,
265
  collections: {
266
- [collectionName]: customIconCollection[collectionName],
 
 
 
 
267
  },
268
  extraProperties: {
269
  display: 'inline-block',
@@ -271,9 +278,15 @@ export default defineConfig({
271
  width: '24px',
272
  height: '24px',
273
  },
274
- scale: 1,
275
- unit: 'px',
276
- cdn: '',
 
 
 
 
 
 
277
  }),
278
  ],
279
  });
 
2
  import fs from 'node:fs/promises';
3
  import { basename, join } from 'node:path';
4
  import { defineConfig, presetIcons, presetUno, transformerDirectives } from 'unocss';
5
+ import type { IconifyJSON } from '@iconify/types';
6
 
7
  // Debug: Log the current working directory and icon paths
8
  console.log('CWD:', process.cwd());
 
16
  [collectionName]: iconPaths.reduce(
17
  (acc, iconPath) => {
18
  const [iconName] = basename(iconPath).split('.');
19
+ console.log(`Loading icon: ${iconName} from ${iconPath}`); // Debug log
20
 
21
  acc[iconName] = async () => {
22
  try {
23
  const content = await fs.readFile(iconPath, 'utf8');
24
+
25
+ // Simplified SVG processing
26
  return content
27
  .replace(/fill="[^"]*"/g, 'fill="currentColor"')
28
  .replace(/fill='[^']*'/g, "fill='currentColor'")
 
123
  safelist: [
124
  // Explicitly safelist all icon combinations
125
  ...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}-${x}`),
126
+ ...Object.keys(customIconCollection[collectionName] || {}).map((x) => `i-${collectionName}:${x}`),
127
  ],
128
  shortcuts: {
129
  'bolt-ease-cubic-bezier': 'ease-[cubic-bezier(0.4,0,0.2,1)]',
 
266
  presetIcons({
267
  warn: true,
268
  collections: {
269
+ bolt: customIconCollection.bolt,
270
+ ph: async () => {
271
+ const icons = await import('@iconify-json/ph/icons.json');
272
+ return icons.default as IconifyJSON;
273
+ },
274
  },
275
  extraProperties: {
276
  display: 'inline-block',
 
278
  width: '24px',
279
  height: '24px',
280
  },
281
+ customizations: {
282
+ customize(props) {
283
+ return {
284
+ ...props,
285
+ width: '24px',
286
+ height: '24px',
287
+ };
288
+ },
289
+ },
290
  }),
291
  ],
292
  });