feat: add create-claudius project scaffolder#122
Merged
Conversation
`npm create claudius@latest` scaffolds a ready-to-run Claudius project (vanilla, React, or Next.js), optionally with a Cloudflare Worker — the same way `npm create vite` works. - create-claudius/ — CLI (@clack/prompts + node:util parseArgs) that copies a template with token replacement; every prompt has a flag for non-interactive use. - Templates: vanilla (CDN script embed), react (Vite + claudius-chat-widget), next (App Router + 'use client' wrapper), and an optional config-first worker scaffold (wrangler.toml + KV stub + deploy runbook). - Snapshot tests of generated output for every template (vitest). - Version-synced with the widget via release-please; auto-publishes on release, and the manual publish-npm workflow now selects which package to publish. - CI job (typecheck + test + build); docs scaffolding page + sidebar entry; README badge + quick-start section. Verified: all three frameworks install and build against the published claudius-chat-widget@1.6.0, the worker scaffold typechecks, and the npm tarball ships dist + templates (including dotfiles). Closes #42 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #42
Summary
npm create claudius@latest(orpnpm create claudius) scaffolds a ready-to-run Claudius project in under a minute — thenpm create viteexperience for Claudius. Newcreate-claudius/package, published to npm.Acceptance criteria
create-claudiuspackage (flat at repo root, matching widget/worker/docs — confirmed with you overpackages/)pnpm install && pnpm devworks)wrangler.toml+ KV stub + deploy runbook)How it works
@clack/prompts+ built-innode:utilparseArgs (no arg-parser dep), bundled to a single ESM bin withtsup. Templates are copied with{{TOKEN}}replacement;_gitignore→.gitignoreon write (npm strips.gitignore), andclaudius-chat-widgetis pinned to^<version>(create-claudius is version-synced with the widget via release-please, so it always matches a real release).claudius-chat-widget), next (App Router +'use client'wrapper), worker (trimmed but runnable Hono worker, widget-compatible{messages}→{reply}).Verification
pnpm typecheck+pnpm build+pnpm test(5 tests, snapshots) green.gitignorerename workstsc + vite build), vanilla (vite build), and Next.js (next build) all build against the publishedclaudius-chat-widget@1.6.0; the worker scaffold typechecksnpm packshipsdist/+templates/(including the_gitignoreand.dev.vars.exampledotfiles)Release wiring
release-please-config.jsonextra-filesrelease-please.yml;publish-npm.ymlnow takes apackageinput (widget|create-claudius)create-claudiusCI jobLike the widget,
create-claudiuswon't exist on npm until first published, and a package-scoped token can't create it. TheNPM_TOKENsecret must be able to create a new package (it's the all-packages token you set last time, so this should work). Bootstrap the first version after merge via Actions → Publish to npm → package: create-claudius, or it ships on the next release.🤖 Generated with Claude Code