create-sordo 0.0.0-stage → 0.3.0

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 (62) hide show
  1. package/CHANGELOG.md +120 -0
  2. package/README.md +52 -2
  3. package/bin/create-sordo.ts +11 -0
  4. package/package.json +36 -5
  5. package/src/index.ts +675 -0
  6. package/src/probes.ts +28 -0
  7. package/src/prompts.ts +141 -0
  8. package/src/readme.ts +74 -0
  9. package/src/ui.ts +207 -0
  10. package/src/versions.ts +3 -0
  11. package/templates/_backend/app/routes/api/todos.ts +27 -0
  12. package/templates/_claude/.claude/commands/sordo-init.md +64 -0
  13. package/templates/_claude/.claude/hooks/biome-check.sh +17 -0
  14. package/templates/_claude/.claude/rules/build-time-discovery.md +17 -0
  15. package/templates/_claude/.claude/rules/bun-native.md +28 -0
  16. package/templates/_claude/.claude/rules/filesystem-routing.md +31 -0
  17. package/templates/_claude/.claude/rules/islands.md +46 -0
  18. package/templates/_claude/.claude/rules/optional-ai.md +16 -0
  19. package/templates/_claude/.claude/rules/web-standards-boundary.md +25 -0
  20. package/templates/_claude/.claude/settings.json +22 -0
  21. package/templates/_claude/.claude/skills/sordo/SKILL.md +121 -0
  22. package/templates/_claude/.claude/skills/sordo-cli/SKILL.md +112 -0
  23. package/templates/_claude/CLAUDE.md +28 -0
  24. package/templates/_codex/.codex/README.md +10 -0
  25. package/templates/_codex/.codex/rules/build-time-discovery.md +17 -0
  26. package/templates/_codex/.codex/rules/bun-native.md +28 -0
  27. package/templates/_codex/.codex/rules/filesystem-routing.md +31 -0
  28. package/templates/_codex/.codex/rules/islands.md +46 -0
  29. package/templates/_codex/.codex/rules/optional-ai.md +15 -0
  30. package/templates/_codex/.codex/rules/sordo-cli.md +108 -0
  31. package/templates/_codex/.codex/rules/sordo-patterns.md +122 -0
  32. package/templates/_codex/.codex/rules/web-standards-boundary.md +25 -0
  33. package/templates/_codex/AGENTS.md +27 -0
  34. package/templates/_container/.dockerignore +7 -0
  35. package/templates/_container/Dockerfile +27 -0
  36. package/templates/_monorepo/packages/README.md +18 -0
  37. package/templates/_shared/sordo-patterns.md +122 -0
  38. package/templates/default/README-template.md +181 -0
  39. package/templates/default/app/islands/TodoApp.tsx +83 -0
  40. package/templates/default/app/routes/api/health.ts +8 -0
  41. package/templates/default/app/routes/index.tsx +29 -0
  42. package/templates/default/app/server.ts +28 -0
  43. package/templates/default/gitignore +9 -0
  44. package/templates/default/sordo.config.ts +5 -0
  45. package/templates/default/tsconfig.json +14 -0
  46. package/templates/ui-shadcn/components/button.tsx +63 -0
  47. package/templates/ui-shadcn/components/dialog.tsx +158 -0
  48. package/templates/ui-shadcn/demo/index.tsx +62 -0
  49. package/templates/ui-starter/_internal/cn.ts +6 -0
  50. package/templates/ui-starter/_internal/slot.ts +50 -0
  51. package/templates/ui-starter/_internal/variants.ts +1 -0
  52. package/templates/ui-starter/button.tsx +60 -0
  53. package/templates/ui-starter/card.tsx +92 -0
  54. package/templates/ui-starter/demo/TodoApp.tsx +86 -0
  55. package/templates/ui-starter/demo/index.tsx +45 -0
  56. package/templates/ui-starter/input.tsx +20 -0
  57. package/templates/ui-starter/label.tsx +18 -0
  58. package/templates/ui-starter/themes/neutral/tokens.css +46 -0
  59. package/templates/ui-starter/themes/slate/tokens.css +46 -0
  60. package/templates/ui-starter/themes/stone/tokens.css +46 -0
  61. package/templates/ui-starter/themes/zinc/tokens.css +46 -0
  62. package/templates/ui-starter/tokens.css +46 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,120 @@
1
+ # create-sordo
2
+
3
+ ## 0.3.0
4
+
5
+ ### Patch Changes
6
+
7
+ - c9b3d98: New apps pin `sordo@^0.3.0`, so they get the optional `css` build entry and a production server that serves client chunks (`bun run start`). `create-sordo` now releases in lockstep with `sordo`, so the version it pins always matches the latest `sordo`.
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 37f5e14: Add `--ui shadcn`: upstream shadcn/ui components on a whole-tree hydrated demo page. Scaffolded apps now pin `sordo` to the release create-sordo shipped with (`^<version>`) and `bun-types` to `^1.3.0` instead of `latest`.
14
+ - c5c1020: Remove the `patties-ui` package and its built-in 60-component catalog. `sordo add` now takes upstream shadcn/ui (`@shadcn/<name>`), local paths, URLs, and `ui.registries`; `sordo add <name>` for a non-catalog name points at `@shadcn/<name>`. The registry schema, `_internal` helpers, tokens, and theme presets now ship inside `sordo`, so `bun add -D patties-ui` is no longer needed. Scaffolded apps no longer depend on `patties-ui`.
15
+
16
+ ## 0.0.13
17
+
18
+ ### Patch Changes
19
+
20
+ - c606a1f: Fix scaffold UX gaps surfaced by dogfooding the UI + `/sordo-init` flow:
21
+
22
+ - **Wire Tailwind for UI projects.** A `--ui` scaffold previously rendered
23
+ unstyled — `app/styles/app.css` was written but never compiled or linked. Now
24
+ the scaffolder ships a `css` script (`@tailwindcss/cli`, run by `dev`/`build`),
25
+ a `app/routes/api/styles.ts` route that serves the compiled sheet, and a shared
26
+ `app/components/_head.tsx` each page re-exports so styles load in dev and the
27
+ compiled binary alike. The generated CSS is gitignored.
28
+ - **Typecheck cleanly out of the box.** A fresh app failed `tsc --noEmit`: the
29
+ `tsconfig` lacked `allowImportingTsExtensions`/`noEmit` (every `.ts`/`.tsx`
30
+ extension import errored TS5097), and templates used the global `JSX.Element`
31
+ namespace that React 19 removed (TS2503). Both fixed, plus a `typecheck` script
32
+ and a `css` module type for the stylesheet import.
33
+ - **`/sordo-init` starts clean.** The command now removes the placeholder
34
+ TodoApp demo before scaffolding the first real feature, and carries the stable
35
+ framework constraints (pages get only `ctx.params`; `.ts` routes live under
36
+ `api/`; middleware gates pages; styling is opt-in per page) so the agent
37
+ doesn't re-derive them from source. The `/sordo` recipes encode the same.
38
+ - **Ignore build output.** `sordo-gen` (written at build time) is now in the
39
+ default gitignore.
40
+
41
+ ## 0.0.12
42
+
43
+ ### Patch Changes
44
+
45
+ - a99d1bf: Redesign the scaffolder prompt flow (cli specs 18 + 19): coding agent moves
46
+ earlier; a new **project type** (frontend / backend / fullstack) drives gated
47
+ sub-prompts for **Patties UI** and **monorepo** and the deploy-target option
48
+ set. Adds `--type`, `--ui`/`--no-ui`, `--monorepo`/`--no-monorepo`, `--theme`,
49
+ and a `container` target (emits a `Dockerfile`). When Patties UI is chosen, a
50
+ vendored starter set (button/card/input/label + tokens) is stamped so the demo
51
+ renders with real components. Claude / Codex projects now ship the `/sordo`
52
+ skill + `/sordo-init` command (Codex: a `sordo-patterns` rule), generated
53
+ from one source so they can't drift, and the next-steps output hands off to
54
+ `claude --permission-mode plan "/sordo-init"`. Stays zero-dependency.
55
+
56
+ ## 0.0.12-next.0
57
+
58
+ ### Patch Changes
59
+
60
+ - a99d1bf: Redesign the scaffolder prompt flow (cli specs 18 + 19): coding agent moves
61
+ earlier; a new **project type** (frontend / backend / fullstack) drives gated
62
+ sub-prompts for **Patties UI** and **monorepo** and the deploy-target option
63
+ set. Adds `--type`, `--ui`/`--no-ui`, `--monorepo`/`--no-monorepo`, `--theme`,
64
+ and a `container` target (emits a `Dockerfile`). When Patties UI is chosen, a
65
+ vendored starter set (button/card/input/label + tokens) is stamped so the demo
66
+ renders with real components. Claude / Codex projects now ship the `/sordo`
67
+ skill + `/sordo-init` command (Codex: a `sordo-patterns` rule), generated
68
+ from one source so they can't drift, and the next-steps output hands off to
69
+ `claude --permission-mode plan "/sordo-init"`. Stays zero-dependency.
70
+
71
+ ## 0.0.8
72
+
73
+ ### Patch Changes
74
+
75
+ - 3b3f80d: Scaffolder DX overhaul (specs 09 + 10).
76
+
77
+ - **Tool probes** — fail fast with a clear message when `bun` is missing
78
+ from PATH; skip-and-warn when `git` is missing instead of silently
79
+ swallowing failures.
80
+ - **Interactive prompts** — when stdin is a TTY and flags were not passed,
81
+ prompt for project name, target, deploy, and agent. Add `--yes` / `-y`
82
+ to accept all defaults non-interactively.
83
+ - **`--agent` alias** — the spec-05 `--agent claude-code` form is kept as
84
+ a backwards-compatible alias for `--template claude`.
85
+ - **Expanded agent overlays** — `_claude` now ships
86
+ `.claude/settings.json` (with `bun`/`bunx`/`sordo` permissions and a
87
+ Biome PostToolUse hook), `.claude/hooks/biome-check.sh` (no-ops when
88
+ Biome is not installed), and empty `.claude/agents/` /
89
+ `.claude/commands/` directories with README pointers. `_codex` now
90
+ ships a `.codex/README.md`.
91
+ - **Templated README** — `templates/default/README-template.md` is now a
92
+ real onboarding doc with `{{name}}` / `{{agent}}` / `{{target}}` /
93
+ `{{deploy}}` placeholders and HTML-comment conditional blocks. A
94
+ generic templating pass also interpolates `{{name}}` into CLAUDE.md
95
+ and AGENTS.md.
96
+
97
+ - **Todo demo template** — the default scaffold now ships a `TodoApp.tsx`
98
+ island and a route that mounts it. The README explains that buttons
99
+ don't react under `bun dev` today (dev hydration lands with framework
100
+ spec 18) and tells the user to `bun run build && bun start` to see the
101
+ island work; it also includes a "Remove the demo" section for when the
102
+ user is ready to start their real app.
103
+ - **`--blank` flag** — `bunx create-sordo@latest <name> --blank`
104
+ (alias: `--empty`) scaffolds a hello-world page with no demo and no
105
+ `app/islands/` directory.
106
+ - **Demo prompt** — interactive flow asks "Include the interactive
107
+ todo demo? [Y/n]" right after the agent question.
108
+ - **Git is now opt-in** — `git init` no longer runs by default. Pass
109
+ `--git` to opt in. The success output reminds the user how to
110
+ initialise a repo when they're ready. `--no-git` is kept as a no-op
111
+ for back-compat.
112
+ - **`_claude` overlay restructured.** The empty `.claude/agents/` and
113
+ `.claude/commands/` placeholders are gone. Replaced with:
114
+ - `.claude/skills/sordo-cli/SKILL.md` — a real skill teaching
115
+ Claude how to use the project CLI (`sordo dev/build/start/deploy/secret`).
116
+ - `.claude/rules/` — scaffolded meta-framework knowledge:
117
+ `bun-native.md`, `web-standards-boundary.md`,
118
+ `filesystem-routing.md`, `islands.md`, `build-time-discovery.md`,
119
+ `optional-ai.md`. Mirrors the framework's own rules but tuned
120
+ for users of the framework.
package/README.md CHANGED
@@ -1,3 +1,53 @@
1
- # Temporary Holding Version
1
+ # create-sordo
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The official scaffolder for [Sordo](https://github.com/bihaviour/sordo) —
4
+ a Bun-native full-stack meta-framework with React 19 rendering.
5
+
6
+ ```sh
7
+ bunx create-sordo@latest my-app
8
+ ```
9
+
10
+ Runs an interactive prompt (project name, agent overlay, demo template,
11
+ runtime target, deploy target), then scaffolds, installs, and gets you
12
+ to `bunx sordo dev` in one shot.
13
+
14
+ ## Options
15
+
16
+ ```sh
17
+ bunx create-sordo@latest my-app \
18
+ --template claude|codex|none \
19
+ --target bun|edge \
20
+ --deploy cloudflare|vercel|deno|netlify|bun|none \
21
+ --blank \
22
+ --git \
23
+ --no-install \
24
+ --yes
25
+ ```
26
+
27
+ | Flag | Default | What it does |
28
+ |---|---|---|
29
+ | `--template` | `claude` | Agent-platform overlay (`claude`, `codex`, or `none`). |
30
+ | `--target` | `bun` | Runtime target written into `sordo.config.ts`. |
31
+ | `--deploy` | `none` | Records the intended deploy target. |
32
+ | `--blank` / `--empty` | off | Skip the interactive todo demo; ship a hello-world page. |
33
+ | `--git` | off | Run `git init` + initial commit (opt-in). |
34
+ | `--no-install` | off | Skip `bun install`. |
35
+ | `--yes` / `-y` | off | Accept all defaults; skip prompts. |
36
+
37
+ `--agent claude-code` is retained as a back-compat alias for
38
+ `--template claude`.
39
+
40
+ ## What you get
41
+
42
+ A minimal Sordo app with filesystem routing under `app/routes/`,
43
+ optional client islands under `app/islands/`, and either the `_claude`
44
+ or `_codex` agent overlay scaffolding conventions for your chosen
45
+ coding agent.
46
+
47
+ See [the Sordo docs](https://bun-patties.com) for the full framework
48
+ guide.
49
+
50
+ ## Requires
51
+
52
+ Bun 1.3+. `bunx create-sordo@latest` won't work under Node — install
53
+ Bun first from [bun.sh](https://bun.sh).
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+
4
+ if (typeof Bun === "undefined") {
5
+ console.error("create-sordo requires Bun. Install Bun first: https://bun.sh");
6
+ process.exit(1);
7
+ }
8
+
9
+ const { run } = await import("../src/index.ts");
10
+ const code = await run(process.argv.slice(2));
11
+ process.exit(code);
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
- "name": "create-sordo",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "create-sordo",
3
+ "version": "0.3.0",
4
+ "description": "Scaffolder for new Sordo projects.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/bihaviour/sordo.git",
8
+ "directory": "packages/create-sordo"
9
+ },
10
+ "type": "module",
11
+ "license": "MIT",
12
+ "bin": {
13
+ "create-sordo": "bin/create-sordo.ts"
14
+ },
15
+ "exports": {
16
+ ".": "./src/index.ts"
17
+ },
18
+ "files": [
19
+ "bin",
20
+ "src",
21
+ "templates",
22
+ "README.md",
23
+ "CHANGELOG.md"
24
+ ],
25
+ "scripts": {
26
+ "test": "bun test",
27
+ "typecheck": "tsc --noEmit",
28
+ "lint": "biome check .",
29
+ "generate:sordo-skill": "bun run scripts/gen-sordo-skill.ts",
30
+ "check:sordo-skill": "bun run scripts/gen-sordo-skill.ts --check",
31
+ "sync:versions": "bun run scripts/sync-versions.ts",
32
+ "check:versions": "bun run scripts/sync-versions.ts --check"
33
+ },
34
+ "engines": {
35
+ "bun": ">=1.3.0"
36
+ }
37
+ }