promptslide 0.3.8 → 0.3.9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.9](https://github.com/prompticeu/promptslide/compare/promptslide-v0.3.8...promptslide-v0.3.9) (2026-03-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * preserve component name casing through publish/pull roundtrip ([a34e83a](https://github.com/prompticeu/promptslide/commit/a34e83a7b3869ef7487b361bba23fd4cce72a0b6))
9
+ * preserve component name casing through publish/pull roundtrip ([e04d96c](https://github.com/prompticeu/promptslide/commit/e04d96c7367b69f8aff2f97c4a29a56a610a3c78))
10
+
3
11
  ## [0.3.8](https://github.com/prompticeu/promptslide/compare/promptslide-v0.3.7...promptslide-v0.3.8) (2026-03-23)
4
12
 
5
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptslide",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "CLI and slide engine for PromptSlide presentations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -177,7 +177,7 @@ export async function pull(args) {
177
177
  const shouldReplace = await confirm(" Replace deck-config.ts with pulled deck config?", true)
178
178
  if (shouldReplace) {
179
179
  const slides = deckItem.meta.slides.map(s => ({
180
- componentName: toPascalCase(s.slug),
180
+ componentName: s.componentName || toPascalCase(s.slug),
181
181
  importPath: `@/slides/${s.slug}`,
182
182
  steps: s.steps,
183
183
  section: s.section
@@ -190,7 +190,7 @@ export async function pull(args) {
190
190
  } else {
191
191
  // Append individual slides
192
192
  for (const s of deckItem.meta.slides) {
193
- const componentName = toPascalCase(s.slug)
193
+ const componentName = s.componentName || toPascalCase(s.slug)
194
194
  const importPath = `@/slides/${s.slug}`
195
195
  const updated = addSlideToDeckConfig(cwd, { componentName, importPath, steps: s.steps, section: s.section })
196
196
  if (updated) {
@@ -224,11 +224,12 @@ export function parseDeckConfig(cwd) {
224
224
 
225
225
  const content = readFileSync(configPath, "utf-8")
226
226
 
227
- // 1. Parse imports to build componentName -> slug map
227
+ // 1. Parse imports to build componentName -> slug map (and reverse)
228
228
  // Handles: import { SlideTitle } from "@/slides/slide-title"
229
229
  // Handles: import { default as SlideTitle } from "@/slides/slide-title"
230
230
  // Handles: import { SlideTitle as Alias } from "@/slides/slide-title"
231
231
  const componentToSlug = {}
232
+ const slugToComponent = {}
232
233
  const importRegex = /import\s*\{([^}]+)\}\s*from\s*["']@\/slides\/([^"']+)["']/g
233
234
  for (const match of content.matchAll(importRegex)) {
234
235
  const importClause = match[1].trim()
@@ -238,6 +239,7 @@ export function parseDeckConfig(cwd) {
238
239
  const componentName = asMatch ? asMatch[1] : importClause.match(/(\w+)/)?.[1]
239
240
  if (componentName) {
240
241
  componentToSlug[componentName] = slug
242
+ slugToComponent[slug] = componentName
241
243
  }
242
244
  }
243
245
 
@@ -278,6 +280,8 @@ export function parseDeckConfig(cwd) {
278
280
  if (!slug) continue // layout or unknown import — skip
279
281
  const stepsMatch = body.match(/steps:\s*(\d+)/)
280
282
  const entry = { slug, steps: stepsMatch ? parseInt(stepsMatch[1], 10) : 0 }
283
+ // Preserve original component name so pull can reconstruct the correct export
284
+ if (slugToComponent[slug]) entry.componentName = slugToComponent[slug]
281
285
  const sectionMatch = body.match(/section:\s*["']([^"']+)["']/)
282
286
  if (sectionMatch) entry.section = sectionMatch[1]
283
287
  slides.push(entry)