@brust/create-app 0.0.0-stage → 2.0.0-alpha.10

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 (69) hide show
  1. package/README.md +19 -2
  2. package/bin/create-app.ts +4 -0
  3. package/package.json +31 -4
  4. package/src/args.ts +64 -0
  5. package/src/cli.ts +69 -0
  6. package/src/copy.ts +44 -0
  7. package/src/dep.ts +61 -0
  8. package/src/tailwind.ts +10 -0
  9. package/src/templates.ts +64 -0
  10. package/templates/blank/README.md.tmpl +43 -0
  11. package/templates/blank/_gitignore +4 -0
  12. package/templates/blank/actions.ts +13 -0
  13. package/templates/blank/app.css +32 -0
  14. package/templates/blank/brust.toml +6 -0
  15. package/templates/blank/components/Counter.tsx +15 -0
  16. package/templates/blank/components/Layout.tsx +22 -0
  17. package/templates/blank/package.json.tmpl +30 -0
  18. package/templates/blank/pages/HomePage.tsx +35 -0
  19. package/templates/blank/public/favicon.svg +1 -0
  20. package/templates/blank/routes.tsx +5 -0
  21. package/templates/blank/tsconfig.json +37 -0
  22. package/templates/blank/wrangler.jsonc.tmpl +9 -0
  23. package/templates/pokedex/README.md.tmpl +59 -0
  24. package/templates/pokedex/_gitignore +5 -0
  25. package/templates/pokedex/actions.ts +37 -0
  26. package/templates/pokedex/brust.toml +28 -0
  27. package/templates/pokedex/components/AddToTeamButton.tsx +37 -0
  28. package/templates/pokedex/components/AppLayout.tsx +32 -0
  29. package/templates/pokedex/components/Breadcrumb.tsx +4 -0
  30. package/templates/pokedex/components/DexCard.tsx +11 -0
  31. package/templates/pokedex/components/DexFilter.tsx +26 -0
  32. package/templates/pokedex/components/HeroSearch.tsx +14 -0
  33. package/templates/pokedex/components/NavLink.tsx +6 -0
  34. package/templates/pokedex/components/TeamBuilder.tsx +32 -0
  35. package/templates/pokedex/components/ThemeToggle.tsx +16 -0
  36. package/templates/pokedex/components/TypeBadge.tsx +5 -0
  37. package/templates/pokedex/components/UnifiedIsland.tsx +28 -0
  38. package/templates/pokedex/components/UnifiedNative.tsx +20 -0
  39. package/templates/pokedex/components/UnifiedStoreNode.tsx +14 -0
  40. package/templates/pokedex/data/pokedex.json +8767 -0
  41. package/templates/pokedex/lib/api.ts +5 -0
  42. package/templates/pokedex/lib/cloudflare.d.ts +24 -0
  43. package/templates/pokedex/lib/filter.ts +6 -0
  44. package/templates/pokedex/lib/format.ts +4 -0
  45. package/templates/pokedex/lib/loaders.ts +192 -0
  46. package/templates/pokedex/lib/pokeapi.ts +43 -0
  47. package/templates/pokedex/lib/team-client.ts +26 -0
  48. package/templates/pokedex/lib/team-db.d1.ts +47 -0
  49. package/templates/pokedex/lib/team-db.sqlite.ts +49 -0
  50. package/templates/pokedex/lib/team-db.ts +13 -0
  51. package/templates/pokedex/lib/team.ts +2 -0
  52. package/templates/pokedex/lib/types.ts +126 -0
  53. package/templates/pokedex/migrations/0001_team.sql +2 -0
  54. package/templates/pokedex/package.json.tmpl +30 -0
  55. package/templates/pokedex/pages/BrowsePage.tsx +15 -0
  56. package/templates/pokedex/pages/DetailPage.tsx +233 -0
  57. package/templates/pokedex/pages/HomePage.tsx +129 -0
  58. package/templates/pokedex/pages/NotFoundPage.tsx +7 -0
  59. package/templates/pokedex/pages/TypeChart.tsx +72 -0
  60. package/templates/pokedex/pages/UnifiedPage.tsx +24 -0
  61. package/templates/pokedex/public/app.css +3 -0
  62. package/templates/pokedex/public/favicon.svg +1 -0
  63. package/templates/pokedex/routes.tsx +27 -0
  64. package/templates/pokedex/scripts/snapshot.ts +53 -0
  65. package/templates/pokedex/stores/team.ts +6 -0
  66. package/templates/pokedex/stores/unified.ts +4 -0
  67. package/templates/pokedex/styles/app.css +14 -0
  68. package/templates/pokedex/tsconfig.json +37 -0
  69. package/templates/pokedex/wrangler.jsonc +9 -0
@@ -0,0 +1,4 @@
1
+ // examples/pokedex/stores/unified.ts — the /unified demo store: one counter, three surfaces (M3-F D10).
2
+ import { defineStore, signal } from '@brust/core/store'
3
+
4
+ export const unified = defineStore('unified', () => ({ count: signal(0) }))
@@ -0,0 +1,14 @@
1
+ @import "tailwindcss";
2
+ @source "../**/*.{tsx,ts}";
3
+ @custom-variant dark (&:where([data-mode="dark"], [data-mode="dark"] *));
4
+
5
+ @theme {
6
+ --color-brand-50: oklch(0.97 0.02 264);
7
+ --color-brand-500: oklch(0.55 0.20 264);
8
+ --color-brand-600: oklch(0.49 0.20 264);
9
+ --color-brand-700: oklch(0.43 0.19 264);
10
+ }
11
+
12
+ button {
13
+ cursor: pointer;
14
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup & latest features
4
+ "lib": [
5
+ "ESNext",
6
+ "DOM",
7
+ "DOM.Iterable"
8
+ ],
9
+ "target": "ESNext",
10
+ "module": "Preserve",
11
+ "moduleDetection": "force",
12
+ "jsx": "react-jsx",
13
+ "allowJs": true,
14
+ "types": [
15
+ "bun"
16
+ ],
17
+ // Bundler mode
18
+ "moduleResolution": "bundler",
19
+ "allowImportingTsExtensions": true,
20
+ "verbatimModuleSyntax": true,
21
+ "noEmit": true,
22
+ // Best practices
23
+ "strict": true,
24
+ "skipLibCheck": true,
25
+ "noFallthroughCasesInSwitch": true,
26
+ "noUncheckedIndexedAccess": true,
27
+ "noImplicitOverride": true,
28
+ // Some stricter flags (disabled by default)
29
+ "noUnusedLocals": false,
30
+ "noUnusedParameters": false,
31
+ "noPropertyAccessFromIndexSignature": false
32
+ },
33
+ "exclude": [
34
+ "dist",
35
+ "node_modules"
36
+ ]
37
+ }
@@ -0,0 +1,9 @@
1
+ // Bindings for `brust build --target cloudflare` (merged into dist/cf/wrangler.jsonc).
2
+ // brust owns main, assets and compatibility_date. Add the database_id from `wrangler d1 create pokedex-team` before deploy.
3
+ {
4
+ // To enable the shared cache tier (brust.toml [cache]), add these beside d1_databases:
5
+ // "kv_namespaces": [{ "binding": "BRUST_CACHE", "id": "<wrangler kv namespace create brust-cache>" }],
6
+ // "durable_objects": { "bindings": [{ "name": "BRUST_CACHE_DO", "class_name": "BrustCacheDO" }] },
7
+ // "migrations": [{ "tag": "brust-cache-v1", "new_sqlite_classes": ["BrustCacheDO"] }],
8
+ "d1_databases": [{ "binding": "TEAM_DB", "database_name": "pokedex-team", "migrations_dir": "migrations" }]
9
+ }