Add multi-framework support to create-refrakt
Extend create-refrakt to scaffold projects for Astro, Nuxt, Next.js, and Eleventy in addition to the existing SvelteKit and HTML targets.
Context
create-refrakt currently supports two targets: --target sveltekit (default) and --target html. With Framework Adapter System delivering framework adapters, the scaffolding tool needs to generate correct project templates for each supported framework — appropriate config files, dependencies, routing boilerplate, and starter content.
Acceptance Criteria
--target astroscaffolds an Astro project withastro.config.mjs,@refrakt-md/astrointegration,BaseLayout.astrousage,getStaticPaths()content loading, behavior init script, and starter content--target nuxtscaffolds a Nuxt project withnuxt.config.ts,@refrakt-md/nuxtmodule registration, catch-all routepages/[...slug].vuewithRefraktContent,useRefraktMetacomposable usage, and starter content--target nextscaffolds a Next.js App Router project withapp/layout.tsx(CSS import),app/[...slug]/page.tsx(RSC content loading +RefraktContent+BehaviorInit),generateStaticParams,generateMetadatahelper usage, and starter content--target eleventyscaffolds an Eleventy 3.0 project with.eleventy.jsplugin config,_data/refrakt.jsglobal data file,base.njktemplate, pagination config, CSS passthrough copy, behavior script inclusion, and starter content- Each target generates correct
package.jsonwith framework-appropriate dependencies (peer deps, dev deps) using the same~versioncoupling strategy as existing targets - Each target generates correct
refrakt.config.jsonwith appropriatetargetfield - Starter content (
_layout.md,index.md,docs/getting-started.md) is shared across all targets — only the surrounding framework boilerplate differs - Interactive mode when
--targetis not provided: prompts for project name (if not given as positional arg) and target selection from a list (SvelteKit, Astro, Nuxt, Next.js, Eleventy, HTML) - CLI help text and post-scaffold "next steps" messages are framework-appropriate
site/content/docs/adapters/overview page updated to list all available targets- Existing tests updated; new tests cover each target's generated file structure, dependency versions, and config correctness
Approach
Each new target needs a template directory (template-astro/, template-nuxt/, template-next/, template-eleventy/) containing framework boilerplate files. The scaffold.ts logic already handles target selection via the --target flag — extend the switch to dispatch to new template directories.
Starter content files (content/) are identical across targets and can be symlinked or copied from a shared location to avoid duplication.
Dependency versions follow the existing pattern: @refrakt-md/* packages use ~${getRefraktVersion()}, framework deps use pinned semver ranges (e.g., astro@^5.0.0, nuxt@^3.0.0, next@^14.0.0 || ^15.0.0, @11ty/eleventy@^3.0.0).
Interactive mode is the default when --target is omitted. Running npx create-refrakt (or npx create-refrakt my-site without --target) presents a list of framework targets to choose from. The --target flag remains available for CI and scripted usage. Use a lightweight prompting library (e.g., @inquirer/prompts or @clack/prompts) — keep the dependency small.
Dependencies
- Create @refrakt-md/astro adapter package (Astro adapter exists)
- Create @refrakt-md/nuxt adapter package (Nuxt adapter exists)
- Create @refrakt-md/next adapter package (Next.js adapter exists)
- Create @refrakt-md/eleventy adapter package (Eleventy adapter exists)
Note: Templates can be written before adapters ship, but the scaffolded projects won't work until the corresponding adapter package is published. Consider gating targets behind adapter availability or scaffolding with a "coming soon" note.
References
- Framework Adapter System (Framework Adapter System)
- Create-Refrakt Project Type Defaults (project-type defaults — complementary, covers package pre-selection)
packages/create-refrakt/src/scaffold.ts— existing scaffolding logicpackages/create-refrakt/template/— SvelteKit template (reference for new templates)site/content/docs/adapters/— existing adapter documentation
Resolution
Completed: 2026-04-04
Branch: claude/implement-spec-030-F0LFn
What was done
- Created template directories for Astro, Nuxt, Next.js, and Eleventy with framework-specific boilerplate (config files, page templates, tsconfig)
- All templates share starter content (index.md, getting-started.md, _layout.md) via identical content/ directories
- Added scaffold functions and package.json generators for each target in scaffold.ts
- Expanded --target CLI flag to accept 6 targets: sveltekit, html, astro, nuxt, next, eleventy
- Updated post-scaffold messages per target
- Added template directories to create-refrakt's files array for npm publishing
- Added 12 new tests (3 per target) covering file creation, dependency generation, and config — 46 total tests pass
- Refactored dotfile renaming into shared renameDotfiles() helper
Notes
- Eleventy template uses src/ as input dir with _data/refrakt.js and _includes/base.njk
- Package.json generators pin @refrakt-md/* deps to ~version, framework deps to semver ranges
- Each target generates appropriate refrakt.config.json with correct target value
Relationships
Depends on
History
- 59ded4aResolution recorded
- f262d7bsource+SPEC-030
- 581e2c2
- ☑ Interactive mode when `--target` is not provided: prompts for project name (if not given as positional arg) and target selection from a list (SvelteKit, Astro, Nuxt, Next.js, Eleventy, HTML)
- 08fbe4bstatusready→done
- 11e81a8milestone+v1.0.0
- 04e907a
- + Interactive mode when `--target` is not provided: prompts for project name (if not given as positional arg) and target selection from a list (SvelteKit, Astro, Nuxt, Next.js, Eleventy, HTML)
- 982a9dbCreated (ready, medium, moderate, create-refrakt, frameworks)