@ludoloops/svelteforge 0.1.3 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/index.js +20 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -172,18 +172,25 @@ function shouldSkipLayout(name) {
172
172
  return LAYOUT_SKIP.some((s) => name.startsWith(s));
173
173
  }
174
174
  /**
175
+ * Convert a kebab-case filename to PascalCase component name
176
+ * e.g. "mobile-menu" → "MobileMenu", "nav-links" → "NavLinks"
177
+ */
178
+ function toPascalCase(str) {
179
+ return str.split("-").map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
180
+ }
181
+ /**
175
182
  * Generate a barrel index.ts that only exports files present in the filtered set
176
183
  */
177
- function generateBarrel(files, directory, stripExtension = true) {
184
+ function generateBarrel(files, directory) {
178
185
  const lines = [];
179
186
  const sortedPaths = [...files.keys()].filter((p) => p.startsWith(directory)).sort();
180
187
  for (const path of sortedPaths) {
181
188
  const name = path.split("/").pop() || "";
182
189
  if (name === "index.ts" || name.endsWith(".test.ts")) continue;
183
- const baseName = stripExtension ? name.replace(/\.\w+$/, "") : name;
184
190
  if (name.endsWith(".svelte")) {
185
- const componentName = baseName;
186
- lines.push(`export { default as ${componentName} } from './${name}';`);
191
+ const baseName = name.replace(/\.svelte$/, "");
192
+ const exportName = baseName.includes("-") ? toPascalCase(baseName) : baseName;
193
+ lines.push(`export { default as ${exportName} } from './${name}';`);
187
194
  } else if (name.endsWith(".ts")) lines.push(`export * from './${name}';`);
188
195
  }
189
196
  return lines.join("\n") + "\n";
@@ -277,6 +284,12 @@ function applyLandingMode(sv, landingFiles, fullstackFiles, projectName) {
277
284
  sv.file("src/lib/components/layout/index.ts", () => {
278
285
  return generateBarrel(layoutFiles, "/lib/components/layout/");
279
286
  });
287
+ sv.file("src/lib/components/index.ts", () => {
288
+ return `// Layout components\nexport * from './layout';\n\n// UI components\nexport * from './ui';\n`;
289
+ });
290
+ if (uiRichTextFiles.size > 0) sv.file("src/lib/components/ui/rich-text/index.ts", () => {
291
+ return generateBarrel(uiRichTextFiles, "/lib/components/ui/rich-text/");
292
+ });
280
293
  for (const [path, content] of Object.entries(landingFiles)) {
281
294
  const finalContent = content.replace(/__PROJECT_NAME__/g, projectName);
282
295
  sv.file(`src${path}`, () => finalContent);
@@ -334,10 +347,12 @@ var src_default = defineAddon({
334
347
  sv.dependency("zod", "latest");
335
348
  sv.devDependency("@skeletonlabs/skeleton", "latest");
336
349
  sv.devDependency("@skeletonlabs/skeleton-svelte", "latest");
350
+ sv.devDependency("@tailwindcss/vite", "^4.0.0");
351
+ sv.devDependency("tailwindcss", "^4.0.0");
337
352
  if (template === "landing") applyLandingMode(sv, landingFiles, fullstackFiles, directory.src.split("/").slice(-2, -1)[0] || "My App");
338
353
  else applyFullstackMode(sv, fullstackFiles);
339
354
  },
340
- nextSteps: ({ options }) => [`SvelteForge ${options.template} template applied!`, "Run `bun dev` to start developing."]
355
+ nextSteps: ({ options }) => [`SvelteForge ${options.template} template applied!`, "Run `npm run dev` (or `bun dev`) to start developing."]
341
356
  });
342
357
  //#endregion
343
358
  export { src_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludoloops/svelteforge",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "sv community addon — 34 theme-aware UI components, admin dashboard, and 3-layer theme system for SvelteKit",
6
6
  "author": "Ludo (https://lelab.dev)",