From 9fa5896ae20718383c7b06be2a181fcb07efee05 Mon Sep 17 00:00:00 2001 From: SylvainDruaux Date: Sat, 24 Oct 2026 16:59:52 +0200 Subject: [PATCH 1/4] refactor(project): remove the unused scaffold project channel The renderer never calls project:scaffold, so the channel and the minimal starter it generated are removed. --- README.md | 2 +- docs/codebase.md | 2 +- electron/handlers/projectHandlers.ts | 9 +- electron/preload/preloadBridge.ts | 1 - electron/project/scaffold.ts | 184 ------------------- shared/ipc/ipcPayloads.ts | 1 - shared/ipc/ipcResults.ts | 3 - shared/ipc/preloadApi.ts | 1 - test/electron/app/mainBoundaries.test.ts | 2 +- test/electron/documents/singleWriter.test.ts | 3 - 10 files changed, 4 insertions(+), 204 deletions(-) delete mode 100644 electron/project/scaffold.ts diff --git a/README.md b/README.md index 11b601cf..531e6cc4 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ MIT licensed — fork it, build on it, ship your own version. - **Git & GitHub** — the branch chip in the title bar shows the current branch and dirty state. From its dropdown you can switch branches, create branches, commit, push, or publish a brand-new repo to GitHub (via the `gh` CLI). - **Tell an AI what's selected** — **⇧⌘C** copies whatever the canvas has selected as the trail of `file:line-range` pointers that leads to it: the page, each component drilled into on the way down, then the node itself. Paste that into Claude Code or any AI chat that can read the project and it knows exactly which markup you mean. - **Code fallback** — pages with markup too complex for the visual model open in a code editor instead, still with live preview. -- **New project** — "New Project…" scaffolds a minimal Astro starter (layout + 5 components + home page) and runs `npm install` for you. +- **New project** — "Start from Lumos" or "Start from Astro" creates a named site with the framework's own scaffolder and installs its dependencies for you. ## Running in development diff --git a/docs/codebase.md b/docs/codebase.md index 3ad857ed..c83b0942 100644 --- a/docs/codebase.md +++ b/docs/codebase.md @@ -27,7 +27,7 @@ lets you edit its pages visually: assistant so it knows exactly which markup is meant. Making the project legible to AI tools is a first-class goal of the design. - Pages too complex for the visual model fall back to a code editor with live - preview; "New Project…" scaffolds a minimal Astro starter. + preview; "Start from Lumos" and "Start from Astro" create a new site. The product constraint that shapes everything below: Stacki edits files that are _also_ edited by hand and by AI assistants in real editors. The source of diff --git a/electron/handlers/projectHandlers.ts b/electron/handlers/projectHandlers.ts index aaa4b69c..2d481680 100644 --- a/electron/handlers/projectHandlers.ts +++ b/electron/handlers/projectHandlers.ts @@ -1,5 +1,5 @@ // The project IPC: opening and creating projects (from a dialog, the Astro -// template, a starter or a scaffold), and installing their dependencies. +// template or a starter), and installing their dependencies. import { gitErrorDetail } from '../git/git'; import { toRecord } from '../../shared/core/record'; @@ -7,7 +7,6 @@ import { assert } from '../../shared/core/assert'; import * as path from 'path'; import * as fs from 'fs'; import { spawn } from 'child_process'; -import { scaffoldProject } from '../project/scaffold'; import { createStarter, newSiteDirectory } from '../project/starter'; import { isWin, errorMessage } from '../lib/mainHelpers'; import { ensureToolPath, run } from '../lib/nodeTools'; @@ -123,12 +122,6 @@ function registerProjectCreateAstroHandlers({ return result; }, ); - - ipcMain.handle('project:scaffold', async (_event, { dir: directory, name }) => { - scaffoldProject(directory, name); - await installDependencies({ send }, directory); - return { ok: true as const }; - }); } export async function installDependencies({ send }: Pick, directory: string) { diff --git a/electron/preload/preloadBridge.ts b/electron/preload/preloadBridge.ts index 1a5d93bf..7747c061 100644 --- a/electron/preload/preloadBridge.ts +++ b/electron/preload/preloadBridge.ts @@ -48,7 +48,6 @@ function projectBridge() { // Project: openProjectDialog: invoke('project:openDialog'), - scaffoldProject: invoke('project:scaffold'), createAstroProject: invoke('project:createAstro'), parentDialog: invoke('project:parentDialog'), createStarter: invoke('project:createStarter'), diff --git a/electron/project/scaffold.ts b/electron/project/scaffold.ts deleted file mode 100644 index 65e02762..00000000 --- a/electron/project/scaffold.ts +++ /dev/null @@ -1,184 +0,0 @@ -// Creates a minimal Astro starter project the visual builder can edit -// immediately: a base layout, a handful of components with typed props, -// and an index page. - -import fs from 'fs'; -import path from 'path'; - -const FILES: Record string> = { - 'package.json': (name) => - JSON.stringify( - { - name, - type: 'module', - version: '0.0.1', - scripts: { - dev: 'astro dev', - build: 'astro build', - preview: 'astro preview', - }, - dependencies: { - astro: '^5.1.1', - }, - }, - null, - 2, - ) + '\n', - - 'astro.config.mjs': () => `import { defineConfig } from 'astro/config'; - -export default defineConfig({}); -`, - - '.gitignore': () => `node_modules/ -dist/ -.astro/ -`, - - 'src/layouts/BaseLayout.astro': () => `--- -interface Props { - title?: string; - description?: string; -} -const { title = 'My Site', description = 'Built with Stacki' } = Astro.props; ---- - - - - - - {title} - - - - - - -`, - - 'src/components/Hero.astro': () => `--- -interface Props { - heading?: string; - subheading?: string; - ctaText?: string; - ctaLink?: string; -} -const { - heading = 'Welcome to your new site', - subheading = 'Edit this hero in the visual builder.', - ctaText = 'Get Started', - ctaLink = '#', -} = Astro.props; ---- -
-

{heading}

-

{subheading}

- {ctaText} -
-`, - - 'src/components/Feature.astro': () => `--- -interface Props { - icon?: string; - title?: string; - description?: string; -} -const { - icon = '✨', - title = 'Feature title', - description = 'Describe this feature here.', -} = Astro.props; ---- -
-
{icon}
-
-

{title}

-

{description}

-
-
-`, - - 'src/components/TextBlock.astro': () => `--- -interface Props { - heading?: string; - text?: string; - align?: string; -} -const { - heading = '', - text = 'Write something here.', - align = 'left', -} = Astro.props; ---- -
- {heading &&

{heading}

} -

{text}

-
-`, - - 'src/components/Spacer.astro': () => `--- -interface Props { - height?: number; -} -const { height = 48 } = Astro.props; ---- -
-`, - - 'src/components/Footer.astro': () => `--- -interface Props { - text?: string; -} -const { text = '© 2026 My Site. All rights reserved.' } = Astro.props; ---- -
-

{text}

-
-`, - - 'src/pages/index.astro': () => `--- -import BaseLayout from '../layouts/BaseLayout.astro'; -import Hero from '../components/Hero.astro'; -import Feature from '../components/Feature.astro'; -import Footer from '../components/Footer.astro'; ---- - - - - -