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.
Files changed (158) hide show
  1. package/README.md +89 -0
  2. package/bin/index.js +1024 -0
  3. package/package.json +43 -0
  4. package/scaffold-fragments/billing/files/app/api/billing/webhook/route.ts +5 -0
  5. package/scaffold-fragments/billing/module.json +31 -0
  6. package/scaffold-fragments/billing/runtime/config.ts +8 -0
  7. package/scaffold-fragments/billing/runtime/exports.ts +6 -0
  8. package/scaffold-fragments/billing/runtime/imports.ts +6 -0
  9. package/scaffold-fragments/billing/runtime/ports.ts +3 -0
  10. package/scaffold-fragments/cms/module.json +29 -0
  11. package/scaffold-fragments/cms/runtime/config.ts +4 -0
  12. package/scaffold-fragments/cms/runtime/exports.ts +1 -0
  13. package/scaffold-fragments/cms/runtime/imports.ts +1 -0
  14. package/scaffold-fragments/email/module.json +30 -0
  15. package/scaffold-fragments/email/runtime/config.ts +1 -0
  16. package/scaffold-fragments/email/runtime/imports.ts +1 -0
  17. package/scaffold-fragments/email/runtime/ports.ts +1 -0
  18. package/scaffold-fragments/feature-flags/files/app/lib/flags.ts +48 -0
  19. package/scaffold-fragments/feature-flags/module.json +66 -0
  20. package/scaffold-fragments/i18n/files/messages/en-US.json +15 -0
  21. package/scaffold-fragments/i18n/module.json +9 -0
  22. package/scaffold-fragments/i18n/runtime/config.ts +7 -0
  23. package/scaffold-fragments/i18n/runtime/exports.ts +1 -0
  24. package/scaffold-fragments/i18n/runtime/imports.ts +2 -0
  25. package/scaffold-fragments/i18n/runtime/ports.ts +1 -0
  26. package/scaffold-fragments/identity/module.json +30 -0
  27. package/scaffold-fragments/identity/vendors/better-auth/files/app/api/auth/[...all]/route.ts +15 -0
  28. package/scaffold-fragments/identity/vendors/better-auth/files/app/lib/auth.ts +20 -0
  29. package/scaffold-fragments/jobs/module.json +12 -0
  30. package/scaffold-fragments/jobs/runtime/config.ts +4 -0
  31. package/scaffold-fragments/jobs/runtime/imports.ts +1 -0
  32. package/scaffold-fragments/jobs/runtime/ports.ts +1 -0
  33. package/scaffold-fragments/notifications/module.json +12 -0
  34. package/scaffold-fragments/notifications/runtime/config.ts +8 -0
  35. package/scaffold-fragments/notifications/runtime/imports.ts +5 -0
  36. package/scaffold-fragments/notifications/runtime/ports.ts +1 -0
  37. package/scaffold-fragments/organizations/module.json +12 -0
  38. package/scaffold-fragments/telemetry/module.json +43 -0
  39. package/scaffold-fragments/telemetry/runtime/config.ts +7 -0
  40. package/scaffold-fragments/telemetry/runtime/imports.ts +7 -0
  41. package/scaffold-fragments/telemetry/runtime/ports.ts +1 -0
  42. package/skillex/private/contribute.md +193 -0
  43. package/skillex/public/consumer.md +157 -0
  44. package/templates/client/.storybook/main.ts +77 -0
  45. package/templates/client/.storybook/preview.ts +12 -0
  46. package/templates/client/CLAUDE.md +50 -0
  47. package/templates/client/_claude/settings.json +107 -0
  48. package/templates/client/_github/PULL_REQUEST_TEMPLATE.md +19 -0
  49. package/templates/client/_github/dependabot.yml +48 -0
  50. package/templates/client/_github/workflows/ci.yml +104 -0
  51. package/templates/client/_gitignore +15 -0
  52. package/templates/client/_npmrc +1 -0
  53. package/templates/client/app/(app)/layout.tsx +49 -0
  54. package/templates/client/app/(marketing)/layout.tsx +21 -0
  55. package/templates/client/app/(marketing)/page.tsx +34 -0
  56. package/templates/client/app/api/backend/[...path]/route.ts +37 -0
  57. package/templates/client/app/api/dev/login/route.ts +14 -0
  58. package/templates/client/app/api/dev/logout/route.ts +18 -0
  59. package/templates/client/app/globals.css +22 -0
  60. package/templates/client/app/home-auth-controls.tsx +28 -0
  61. package/templates/client/app/layout.tsx +38 -0
  62. package/templates/client/app/lib/backend-client.ts +55 -0
  63. package/templates/client/app/lib/runtime.test.ts +38 -0
  64. package/templates/client/app/lib/runtime.ts +54 -0
  65. package/templates/client/app/protected/page.tsx +31 -0
  66. package/templates/client/app/theme.override.css +9 -0
  67. package/templates/client/instrumentation.ts +10 -0
  68. package/templates/client/mocks/browser.tsx +28 -0
  69. package/templates/client/mocks/handlers.ts +20 -0
  70. package/templates/client/mocks/node.ts +7 -0
  71. package/templates/client/next.config.ts +8 -0
  72. package/templates/client/oxfmt.config.ts +8 -0
  73. package/templates/client/oxlint.config.ts +8 -0
  74. package/templates/client/package.json +61 -0
  75. package/templates/client/postcss.config.mjs +1 -0
  76. package/templates/client/public/mockServiceWorker.js +349 -0
  77. package/templates/client/scripts/build-theme.mjs +18 -0
  78. package/templates/client/site.spec.ts +58 -0
  79. package/templates/client/skillex.json +12 -0
  80. package/templates/client/skills/repo.md +56 -0
  81. package/templates/client/stylelint.config.mjs +4 -0
  82. package/templates/client/tsconfig.json +11 -0
  83. package/templates/client/vitest.config.ts +27 -0
  84. package/templates/client/vitest.setup.ts +18 -0
  85. package/templates/full-stack/.storybook/main.ts +77 -0
  86. package/templates/full-stack/.storybook/preview.ts +12 -0
  87. package/templates/full-stack/CLAUDE.md +50 -0
  88. package/templates/full-stack/_claude/settings.json +107 -0
  89. package/templates/full-stack/_github/PULL_REQUEST_TEMPLATE.md +19 -0
  90. package/templates/full-stack/_github/dependabot.yml +57 -0
  91. package/templates/full-stack/_github/workflows/ci.yml +109 -0
  92. package/templates/full-stack/_github/workflows/db-check.yml +36 -0
  93. package/templates/full-stack/_github/workflows/db-migrate.yml +39 -0
  94. package/templates/full-stack/_gitignore +15 -0
  95. package/templates/full-stack/_npmrc +1 -0
  96. package/templates/full-stack/app/(app)/layout.tsx +53 -0
  97. package/templates/full-stack/app/(marketing)/layout.tsx +21 -0
  98. package/templates/full-stack/app/(marketing)/page.tsx +38 -0
  99. package/templates/full-stack/app/api/dev/login/route.ts +14 -0
  100. package/templates/full-stack/app/api/dev/logout/route.ts +18 -0
  101. package/templates/full-stack/app/api/widgets/route.ts +10 -0
  102. package/templates/full-stack/app/demo/widgets/page.tsx +86 -0
  103. package/templates/full-stack/app/globals.css +22 -0
  104. package/templates/full-stack/app/home-auth-controls.tsx +28 -0
  105. package/templates/full-stack/app/layout.tsx +38 -0
  106. package/templates/full-stack/app/lib/runtime.test.ts +38 -0
  107. package/templates/full-stack/app/lib/runtime.ts +54 -0
  108. package/templates/full-stack/app/protected/page.tsx +31 -0
  109. package/templates/full-stack/app/theme.override.css +9 -0
  110. package/templates/full-stack/db/check.ts +46 -0
  111. package/templates/full-stack/db/index.ts +109 -0
  112. package/templates/full-stack/db/migrate.ts +66 -0
  113. package/templates/full-stack/db/migrations/.gitkeep +0 -0
  114. package/templates/full-stack/db/schema.ts +20 -0
  115. package/templates/full-stack/drizzle.config.ts +16 -0
  116. package/templates/full-stack/instrumentation.ts +10 -0
  117. package/templates/full-stack/mocks/browser.tsx +28 -0
  118. package/templates/full-stack/mocks/handlers.ts +34 -0
  119. package/templates/full-stack/mocks/node.ts +7 -0
  120. package/templates/full-stack/next.config.ts +8 -0
  121. package/templates/full-stack/oxfmt.config.ts +8 -0
  122. package/templates/full-stack/oxlint.config.ts +8 -0
  123. package/templates/full-stack/package.json +72 -0
  124. package/templates/full-stack/postcss.config.mjs +1 -0
  125. package/templates/full-stack/public/mockServiceWorker.js +349 -0
  126. package/templates/full-stack/scripts/build-theme.mjs +18 -0
  127. package/templates/full-stack/site.spec.ts +58 -0
  128. package/templates/full-stack/skillex.json +12 -0
  129. package/templates/full-stack/skills/repo.md +56 -0
  130. package/templates/full-stack/stylelint.config.mjs +4 -0
  131. package/templates/full-stack/tsconfig.json +11 -0
  132. package/templates/full-stack/vitest.config.ts +42 -0
  133. package/templates/full-stack/vitest.setup.ts +18 -0
  134. package/templates/static/.storybook/main.ts +77 -0
  135. package/templates/static/.storybook/preview.ts +12 -0
  136. package/templates/static/CLAUDE.md +50 -0
  137. package/templates/static/_claude/settings.json +107 -0
  138. package/templates/static/_github/PULL_REQUEST_TEMPLATE.md +18 -0
  139. package/templates/static/_github/dependabot.yml +43 -0
  140. package/templates/static/_github/workflows/ci.yml +91 -0
  141. package/templates/static/_gitignore +15 -0
  142. package/templates/static/_npmrc +1 -0
  143. package/templates/static/app/(marketing)/layout.tsx +21 -0
  144. package/templates/static/app/(marketing)/page.tsx +17 -0
  145. package/templates/static/app/globals.css +22 -0
  146. package/templates/static/app/layout.tsx +24 -0
  147. package/templates/static/app/theme.override.css +9 -0
  148. package/templates/static/next.config.ts +19 -0
  149. package/templates/static/oxfmt.config.ts +8 -0
  150. package/templates/static/oxlint.config.ts +8 -0
  151. package/templates/static/package.json +53 -0
  152. package/templates/static/postcss.config.mjs +1 -0
  153. package/templates/static/scripts/build-theme.mjs +18 -0
  154. package/templates/static/site.spec.ts +58 -0
  155. package/templates/static/skillex.json +12 -0
  156. package/templates/static/skills/repo.md +56 -0
  157. package/templates/static/stylelint.config.mjs +4 -0
  158. package/templates/static/tsconfig.json +11 -0
@@ -0,0 +1,58 @@
1
+ import { defineSiteSpec } from "@raredays/site-config";
2
+
3
+ /**
4
+ * The site specification for this app.
5
+ *
6
+ * Edit this file to brand your site, configure navigation, declare integrations,
7
+ * and enable modules. The Tailwind theme override stylesheet at
8
+ * `app/theme.override.css` is regenerated from this file by `pnpm theme:build`
9
+ * (which is chained into `pnpm dev` and `pnpm build`).
10
+ */
11
+ export default defineSiteSpec({
12
+ framework: "0.x",
13
+ runtime: "static",
14
+ identity: {
15
+ name: "__SLUG__",
16
+ slug: "__SLUG__",
17
+ canonicalDomain: "example.com",
18
+ locales: ["en-US"],
19
+ },
20
+ branding: {
21
+ // Token overrides flow into Tailwind's @theme layer at build time.
22
+ // Anything in @raredays/tokens can be overridden here; unset keys keep
23
+ // the framework defaults. Examples:
24
+ //
25
+ // tokens: {
26
+ // color: { brand: { primary: "#0070f3", secondary: "#111111" } },
27
+ // font: { sans: "'Inter Variable', ui-sans-serif, system-ui, sans-serif" },
28
+ // radius: { md: "0.5rem" },
29
+ // },
30
+ assets: {
31
+ logo: "/logo.svg",
32
+ favicon: "/favicon.ico",
33
+ },
34
+ },
35
+ navigation: {
36
+ primary: [{ label: "Home", href: "/" }],
37
+ footer: [{ label: "About", href: "/about" }],
38
+ },
39
+ // Module configurations live here, keyed by module id. Each enabled module
40
+ // package validates its own slice. Example:
41
+ //
42
+ // modules: {
43
+ // billing: { plans: [...] },
44
+ // },
45
+ integrations: {
46
+ // Each integration's credential slots reference SHOUTING_SNAKE_CASE env
47
+ // var names — never literal secret values. Example:
48
+ //
49
+ // stripe: {
50
+ // secretKey: "STRIPE_SECRET_KEY",
51
+ // webhookSecret: "STRIPE_WEBHOOK_SECRET",
52
+ // },
53
+ },
54
+ deploy: {
55
+ vercel: { projectId: "prj_replace_me" },
56
+ // No `database` field — static apps have no server runtime.
57
+ },
58
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "Version": 4,
3
+ "Rules": [
4
+ {
5
+ "Scope": "**",
6
+ "Skills": [
7
+ "skills/repo.md"
8
+ ],
9
+ "DependencyBoundary": "."
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Repository conventions
3
+ topic: repo-conventions
4
+ tags: [getting-started]
5
+ ---
6
+
7
+ # Repository conventions
8
+
9
+ This app was scaffolded with `create-raredays-app`. The framework's
10
+ `@raredays/*` packages are workspace deps and ship their own skills, all
11
+ auto-discovered via the `DependencyBoundary` in `skillex.json`.
12
+
13
+ ## Layout
14
+
15
+ ```
16
+ app/
17
+ ├── (auth)/ # Sign-in / sign-up routes (when identity:better-auth is wired)
18
+ ├── (subscribed)/ # Routes gated behind an active subscription
19
+ ├── api/ # API route handlers
20
+ ├── demo/ # Sample pages (delete or replace)
21
+ ├── lib/
22
+ │ └── runtime.ts # Provider composition root — edit here to swap providers
23
+ ├── globals.css # Tailwind v4 entry; scans @raredays/* dists for utilities
24
+ ├── layout.tsx # Root layout — wraps app in RaredaysProvider
25
+ └── theme.override.css # Generated by `pnpm theme:build` from site.spec.ts
26
+ db/ # Drizzle schema + migrations
27
+ mocks/ # MSW handlers (node + browser setups)
28
+ public/ # Static assets + mockServiceWorker.js
29
+ site.spec.ts # Single source of truth for site config — feeds theme:build
30
+ ```
31
+
32
+ ## Always-on workflow
33
+
34
+ ```sh
35
+ pnpm install # auto-runs skillex refresh via postinstall
36
+ pnpm dev # Next dev server
37
+ pnpm dev:mocks # Dev with MSW intercepting fetch
38
+ pnpm test # vitest run (node-mode tests)
39
+ pnpm check # lint + format:check + style + typecheck (gate before commit)
40
+ ```
41
+
42
+ ## Where things live in the framework
43
+
44
+ - `@raredays/core` — provider/port pattern, `RaredaysProvider`, env-config, ports
45
+ - `@raredays/components` — design system components (Tailwind v4, shadcn-flavored)
46
+ - `@raredays/identity` (+ `identity-better-auth`) — auth, sessions, organizations
47
+ - `@raredays/billing` (+ `billing-stripe`) — subscriptions, webhooks → events
48
+ - `@raredays/notifications` — in-app + email notification port
49
+ - `@raredays/cms` (+ `cms-hygraph`, `cms-bridge`) — headless CMS port + canonical-id bridge
50
+ - `@raredays/engagement` — declarative engagement tables (bookmarks, history, tags)
51
+ - `@raredays/state-machine` — typed state machine primitive
52
+ - `@raredays/i18n` — locale-aware translations + formatters
53
+ - `@raredays/mocks` — MSW setup for node + browser
54
+
55
+ Run `pnpm exec skillex query --package "@raredays/<name>"` for any of them
56
+ to see canonical usage patterns.
@@ -0,0 +1,4 @@
1
+ /** @type {import("stylelint").Config} */
2
+ export default {
3
+ extends: ["@raredays/lint/stylelint"],
4
+ };
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@raredays/typescript/tsconfig.next.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@/*": ["./app/*"]
7
+ }
8
+ },
9
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
10
+ "exclude": ["node_modules"]
11
+ }