@ludoloops/svelteforge 0.1.4 → 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 +11 -4
  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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludoloops/svelteforge",
3
- "version": "0.1.4",
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)",