create-raredays-app 0.1.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.
- package/README.md +89 -0
- package/bin/index.js +1024 -0
- package/package.json +43 -0
- package/scaffold-fragments/billing/files/app/api/billing/webhook/route.ts +5 -0
- package/scaffold-fragments/billing/module.json +31 -0
- package/scaffold-fragments/billing/runtime/config.ts +8 -0
- package/scaffold-fragments/billing/runtime/exports.ts +6 -0
- package/scaffold-fragments/billing/runtime/imports.ts +6 -0
- package/scaffold-fragments/billing/runtime/ports.ts +3 -0
- package/scaffold-fragments/cms/module.json +29 -0
- package/scaffold-fragments/cms/runtime/config.ts +4 -0
- package/scaffold-fragments/cms/runtime/exports.ts +1 -0
- package/scaffold-fragments/cms/runtime/imports.ts +1 -0
- package/scaffold-fragments/email/module.json +30 -0
- package/scaffold-fragments/email/runtime/config.ts +1 -0
- package/scaffold-fragments/email/runtime/imports.ts +1 -0
- package/scaffold-fragments/email/runtime/ports.ts +1 -0
- package/scaffold-fragments/feature-flags/files/app/lib/flags.ts +48 -0
- package/scaffold-fragments/feature-flags/module.json +66 -0
- package/scaffold-fragments/i18n/files/messages/en-US.json +15 -0
- package/scaffold-fragments/i18n/module.json +9 -0
- package/scaffold-fragments/i18n/runtime/config.ts +7 -0
- package/scaffold-fragments/i18n/runtime/exports.ts +1 -0
- package/scaffold-fragments/i18n/runtime/imports.ts +2 -0
- package/scaffold-fragments/i18n/runtime/ports.ts +1 -0
- package/scaffold-fragments/identity/module.json +30 -0
- package/scaffold-fragments/identity/vendors/better-auth/files/app/api/auth/[...all]/route.ts +15 -0
- package/scaffold-fragments/identity/vendors/better-auth/files/app/lib/auth.ts +20 -0
- package/scaffold-fragments/jobs/module.json +12 -0
- package/scaffold-fragments/jobs/runtime/config.ts +4 -0
- package/scaffold-fragments/jobs/runtime/imports.ts +1 -0
- package/scaffold-fragments/jobs/runtime/ports.ts +1 -0
- package/scaffold-fragments/notifications/module.json +12 -0
- package/scaffold-fragments/notifications/runtime/config.ts +8 -0
- package/scaffold-fragments/notifications/runtime/imports.ts +5 -0
- package/scaffold-fragments/notifications/runtime/ports.ts +1 -0
- package/scaffold-fragments/organizations/module.json +12 -0
- package/scaffold-fragments/telemetry/module.json +43 -0
- package/scaffold-fragments/telemetry/runtime/config.ts +7 -0
- package/scaffold-fragments/telemetry/runtime/imports.ts +7 -0
- package/scaffold-fragments/telemetry/runtime/ports.ts +1 -0
- package/skillex/private/contribute.md +193 -0
- package/skillex/public/consumer.md +157 -0
- package/templates/client/.storybook/main.ts +77 -0
- package/templates/client/.storybook/preview.ts +12 -0
- package/templates/client/CLAUDE.md +50 -0
- package/templates/client/_claude/settings.json +107 -0
- package/templates/client/_github/PULL_REQUEST_TEMPLATE.md +19 -0
- package/templates/client/_github/dependabot.yml +48 -0
- package/templates/client/_github/workflows/ci.yml +104 -0
- package/templates/client/_gitignore +15 -0
- package/templates/client/_npmrc +1 -0
- package/templates/client/app/(app)/layout.tsx +49 -0
- package/templates/client/app/(marketing)/layout.tsx +21 -0
- package/templates/client/app/(marketing)/page.tsx +34 -0
- package/templates/client/app/api/backend/[...path]/route.ts +37 -0
- package/templates/client/app/api/dev/login/route.ts +14 -0
- package/templates/client/app/api/dev/logout/route.ts +18 -0
- package/templates/client/app/globals.css +22 -0
- package/templates/client/app/home-auth-controls.tsx +28 -0
- package/templates/client/app/layout.tsx +38 -0
- package/templates/client/app/lib/backend-client.ts +55 -0
- package/templates/client/app/lib/runtime.test.ts +38 -0
- package/templates/client/app/lib/runtime.ts +54 -0
- package/templates/client/app/protected/page.tsx +31 -0
- package/templates/client/app/theme.override.css +9 -0
- package/templates/client/instrumentation.ts +10 -0
- package/templates/client/mocks/browser.tsx +28 -0
- package/templates/client/mocks/handlers.ts +20 -0
- package/templates/client/mocks/node.ts +7 -0
- package/templates/client/next.config.ts +8 -0
- package/templates/client/oxfmt.config.ts +8 -0
- package/templates/client/oxlint.config.ts +8 -0
- package/templates/client/package.json +61 -0
- package/templates/client/postcss.config.mjs +1 -0
- package/templates/client/public/mockServiceWorker.js +349 -0
- package/templates/client/scripts/build-theme.mjs +18 -0
- package/templates/client/site.spec.ts +58 -0
- package/templates/client/skillex.json +12 -0
- package/templates/client/skills/repo.md +56 -0
- package/templates/client/stylelint.config.mjs +4 -0
- package/templates/client/tsconfig.json +11 -0
- package/templates/client/vitest.config.ts +27 -0
- package/templates/client/vitest.setup.ts +18 -0
- package/templates/full-stack/.storybook/main.ts +77 -0
- package/templates/full-stack/.storybook/preview.ts +12 -0
- package/templates/full-stack/CLAUDE.md +50 -0
- package/templates/full-stack/_claude/settings.json +107 -0
- package/templates/full-stack/_github/PULL_REQUEST_TEMPLATE.md +19 -0
- package/templates/full-stack/_github/dependabot.yml +57 -0
- package/templates/full-stack/_github/workflows/ci.yml +109 -0
- package/templates/full-stack/_github/workflows/db-check.yml +36 -0
- package/templates/full-stack/_github/workflows/db-migrate.yml +39 -0
- package/templates/full-stack/_gitignore +15 -0
- package/templates/full-stack/_npmrc +1 -0
- package/templates/full-stack/app/(app)/layout.tsx +53 -0
- package/templates/full-stack/app/(marketing)/layout.tsx +21 -0
- package/templates/full-stack/app/(marketing)/page.tsx +38 -0
- package/templates/full-stack/app/api/dev/login/route.ts +14 -0
- package/templates/full-stack/app/api/dev/logout/route.ts +18 -0
- package/templates/full-stack/app/api/widgets/route.ts +10 -0
- package/templates/full-stack/app/demo/widgets/page.tsx +86 -0
- package/templates/full-stack/app/globals.css +22 -0
- package/templates/full-stack/app/home-auth-controls.tsx +28 -0
- package/templates/full-stack/app/layout.tsx +38 -0
- package/templates/full-stack/app/lib/runtime.test.ts +38 -0
- package/templates/full-stack/app/lib/runtime.ts +54 -0
- package/templates/full-stack/app/protected/page.tsx +31 -0
- package/templates/full-stack/app/theme.override.css +9 -0
- package/templates/full-stack/db/check.ts +46 -0
- package/templates/full-stack/db/index.ts +109 -0
- package/templates/full-stack/db/migrate.ts +66 -0
- package/templates/full-stack/db/migrations/.gitkeep +0 -0
- package/templates/full-stack/db/schema.ts +20 -0
- package/templates/full-stack/drizzle.config.ts +16 -0
- package/templates/full-stack/instrumentation.ts +10 -0
- package/templates/full-stack/mocks/browser.tsx +28 -0
- package/templates/full-stack/mocks/handlers.ts +34 -0
- package/templates/full-stack/mocks/node.ts +7 -0
- package/templates/full-stack/next.config.ts +8 -0
- package/templates/full-stack/oxfmt.config.ts +8 -0
- package/templates/full-stack/oxlint.config.ts +8 -0
- package/templates/full-stack/package.json +72 -0
- package/templates/full-stack/postcss.config.mjs +1 -0
- package/templates/full-stack/public/mockServiceWorker.js +349 -0
- package/templates/full-stack/scripts/build-theme.mjs +18 -0
- package/templates/full-stack/site.spec.ts +58 -0
- package/templates/full-stack/skillex.json +12 -0
- package/templates/full-stack/skills/repo.md +56 -0
- package/templates/full-stack/stylelint.config.mjs +4 -0
- package/templates/full-stack/tsconfig.json +11 -0
- package/templates/full-stack/vitest.config.ts +42 -0
- package/templates/full-stack/vitest.setup.ts +18 -0
- package/templates/static/.storybook/main.ts +77 -0
- package/templates/static/.storybook/preview.ts +12 -0
- package/templates/static/CLAUDE.md +50 -0
- package/templates/static/_claude/settings.json +107 -0
- package/templates/static/_github/PULL_REQUEST_TEMPLATE.md +18 -0
- package/templates/static/_github/dependabot.yml +43 -0
- package/templates/static/_github/workflows/ci.yml +91 -0
- package/templates/static/_gitignore +15 -0
- package/templates/static/_npmrc +1 -0
- package/templates/static/app/(marketing)/layout.tsx +21 -0
- package/templates/static/app/(marketing)/page.tsx +17 -0
- package/templates/static/app/globals.css +22 -0
- package/templates/static/app/layout.tsx +24 -0
- package/templates/static/app/theme.override.css +9 -0
- package/templates/static/next.config.ts +19 -0
- package/templates/static/oxfmt.config.ts +8 -0
- package/templates/static/oxlint.config.ts +8 -0
- package/templates/static/package.json +53 -0
- package/templates/static/postcss.config.mjs +1 -0
- package/templates/static/scripts/build-theme.mjs +18 -0
- package/templates/static/site.spec.ts +58 -0
- package/templates/static/skillex.json +12 -0
- package/templates/static/skills/repo.md +56 -0
- package/templates/static/stylelint.config.mjs +4 -0
- package/templates/static/tsconfig.json +11 -0
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# create-raredays-app
|
|
2
|
+
|
|
3
|
+
Scaffold a new RareDays Next.js app. Runs as an interactive TUI or non-interactively with flags.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# interactive mode (prompts for everything)
|
|
9
|
+
pnpm create raredays-app
|
|
10
|
+
|
|
11
|
+
# non-interactive with a preset
|
|
12
|
+
pnpm create raredays-app my-app --preset courseware
|
|
13
|
+
|
|
14
|
+
# non-interactive with explicit options
|
|
15
|
+
pnpm create raredays-app my-app --template full-stack --modules billing,jobs
|
|
16
|
+
|
|
17
|
+
# from a checkout of this repo
|
|
18
|
+
node workspaces/app/cli/create-raredays-app/bin/index.js my-app
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Presets
|
|
22
|
+
|
|
23
|
+
Pre-configured app types offered in interactive mode and via `--preset`:
|
|
24
|
+
|
|
25
|
+
- **courseware** -- Full course platform (full-stack template + billing module, violet brand).
|
|
26
|
+
- **internal-tool** -- Admin dashboard (full-stack template + jobs module, slate brand).
|
|
27
|
+
- **demo** -- Lightweight demo (static template, no modules, emerald brand).
|
|
28
|
+
|
|
29
|
+
Presets set the template, modules, and brand color. You can still customise display name and git settings.
|
|
30
|
+
|
|
31
|
+
## Templates
|
|
32
|
+
|
|
33
|
+
- **full-stack** -- Next.js + Drizzle + the full module system. Supports identity, billing, jobs, notifications, email, telemetry. Composition root at `app/lib/runtime.ts`.
|
|
34
|
+
- **client** -- Next.js BFF + SPA, proxies to an external backend. Supports modules but no database layer.
|
|
35
|
+
- **static** -- Truly static, deployable to CDN/edge. Core + design system only, no SSR or API routes.
|
|
36
|
+
|
|
37
|
+
## Options
|
|
38
|
+
|
|
39
|
+
- `--template <name>` -- `full-stack` (default), `client`, or `static`.
|
|
40
|
+
- `--preset <name>` -- `courseware`, `internal-tool`, or `demo`. Overrides `--template` and `--modules`.
|
|
41
|
+
- `--modules <list>` -- comma-separated modules to wire: `billing`, `jobs`, `notifications`, `email`, `telemetry`, `feature-flags`.
|
|
42
|
+
- `--vendors <list>` -- comma-separated vendor preconfiguration: `stripe`, `resend`, `sentry`, `axiom`.
|
|
43
|
+
- `--remote-url <url>` -- set git remote origin after scaffolding.
|
|
44
|
+
- `--no-git` -- skip `git init`.
|
|
45
|
+
- `--no-install` -- skip `pnpm install`.
|
|
46
|
+
- `--dev` -- rewrite every `@raredays/*` dependency to `workspace:*` (for in-repo dogfooding).
|
|
47
|
+
- `-h`, `--help` -- show usage.
|
|
48
|
+
|
|
49
|
+
## What it does
|
|
50
|
+
|
|
51
|
+
1. Copies `templates/<name>/` into the target directory.
|
|
52
|
+
2. Renames stub files (`_gitignore` -> `.gitignore`, `_npmrc` -> `.npmrc`).
|
|
53
|
+
3. Sets `package.json:name` to the project slug.
|
|
54
|
+
4. Substitutes `__SLUG__` in `site.spec.ts` and applies display name, domain, and brand color.
|
|
55
|
+
5. Loads scaffold fragments for selected modules (imports, config, ports, file overlays).
|
|
56
|
+
6. Composes `app/lib/runtime.ts` with module wiring and `mocks/handlers.ts` with vendor mocks.
|
|
57
|
+
7. Merges fragment dependencies into `package.json`.
|
|
58
|
+
8. Writes `.env.example` if any vendor env vars are needed.
|
|
59
|
+
9. Optionally runs `git init` and `pnpm install`.
|
|
60
|
+
|
|
61
|
+
## Scaffold fragments
|
|
62
|
+
|
|
63
|
+
The `scaffold-fragments/` directory contains per-module overlays:
|
|
64
|
+
|
|
65
|
+
- `billing/` -- Stripe billing integration (checkout, portal, webhooks)
|
|
66
|
+
- `email/` -- Resend email provider
|
|
67
|
+
- `feature-flags/` -- Vercel Flags SDK wiring
|
|
68
|
+
- `jobs/` -- Background job processing
|
|
69
|
+
- `notifications/` -- Multi-channel notification delivery
|
|
70
|
+
- `telemetry/` -- Sentry + Axiom telemetry
|
|
71
|
+
|
|
72
|
+
Each fragment has a `module.json` manifest, runtime slot injections, and optional file overlays.
|
|
73
|
+
|
|
74
|
+
## How it fits in the ecosystem
|
|
75
|
+
|
|
76
|
+
`create-raredays-app` is the primary entry point for new RareDays projects. It produces a fully configured Next.js app that depends on `@raredays/core`, `@raredays/style`, `@raredays/lint`, and `@raredays/typescript`, plus any domain modules the user selects. The generated app follows the same hexagonal architecture used internally: port contracts from `@raredays/core`, in-memory dev providers, and vendor adapters swapped in for production.
|
|
77
|
+
|
|
78
|
+
## Development
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
# run the scaffolder interactively in a sandbox
|
|
82
|
+
pnpm --filter create-raredays-app dev
|
|
83
|
+
|
|
84
|
+
# clean the sandbox
|
|
85
|
+
pnpm --filter create-raredays-app clean
|
|
86
|
+
|
|
87
|
+
# lint
|
|
88
|
+
pnpm --filter create-raredays-app lint
|
|
89
|
+
```
|