create-usebecky 0.0.0-stage → 0.2.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 (157) hide show
  1. package/README.md +80 -2
  2. package/dist/create.js +842 -0
  3. package/dist/extension-skill/usebecky-extension/SKILL.md +181 -0
  4. package/dist/extension-skill/usebecky-extension/references/accounts.md +125 -0
  5. package/dist/extension-skill/usebecky-extension/references/dev-server.md +102 -0
  6. package/dist/extension-skill/usebecky-extension/references/manifest.md +104 -0
  7. package/dist/extension-skill/usebecky-extension/references/oauth-and-tokens.md +179 -0
  8. package/dist/extension-skill/usebecky-extension/references/partner-api.md +87 -0
  9. package/dist/extension-skill/usebecky-extension/references/submit-and-pricing.md +31 -0
  10. package/dist/extension-skill/usebecky-extension/references/ui.md +172 -0
  11. package/dist/extension-skill/usebecky-extension/references/webhooks.md +97 -0
  12. package/dist/index.js +10 -0
  13. package/dist/keys.js +72 -0
  14. package/dist/platform.js +104 -0
  15. package/dist/pm.js +69 -0
  16. package/dist/prompts.js +242 -0
  17. package/dist/scaffold.js +108 -0
  18. package/dist/setup.js +130 -0
  19. package/dist/shared/ai.js +203 -0
  20. package/dist/shared/extension-skill.js +107 -0
  21. package/dist/shared/framework.js +460 -0
  22. package/dist/shared/hosted.js +8 -0
  23. package/dist/shared/ui.js +141 -0
  24. package/dist/skill/usebecky/SKILL.md +339 -0
  25. package/dist/skill/usebecky/references/access-rules.md +307 -0
  26. package/dist/skill/usebecky/references/addons.md +68 -0
  27. package/dist/skill/usebecky/references/analytics.md +166 -0
  28. package/dist/skill/usebecky/references/android.md +434 -0
  29. package/dist/skill/usebecky/references/auth.md +379 -0
  30. package/dist/skill/usebecky/references/cache.md +51 -0
  31. package/dist/skill/usebecky/references/components.md +127 -0
  32. package/dist/skill/usebecky/references/emails.md +105 -0
  33. package/dist/skill/usebecky/references/expo.md +147 -0
  34. package/dist/skill/usebecky/references/functions.md +99 -0
  35. package/dist/skill/usebecky/references/hosting.md +119 -0
  36. package/dist/skill/usebecky/references/http-api.md +233 -0
  37. package/dist/skill/usebecky/references/ios.md +355 -0
  38. package/dist/skill/usebecky/references/payments.md +493 -0
  39. package/dist/skill/usebecky/references/realtime.md +143 -0
  40. package/dist/skill/usebecky/references/scheduled-jobs.md +82 -0
  41. package/dist/skill/usebecky/references/sdk.md +838 -0
  42. package/dist/skill/usebecky/references/storage.md +210 -0
  43. package/dist/skill/usebecky/references/templates.md +191 -0
  44. package/dist/skill/usebecky/references/wordpress.md +87 -0
  45. package/dist/templates.js +74 -0
  46. package/package.json +37 -4
  47. package/templates/expo/App.tsx +48 -0
  48. package/templates/expo/README.md +59 -0
  49. package/templates/expo/_env.example +4 -0
  50. package/templates/expo/_gitignore +12 -0
  51. package/templates/expo/app.json +25 -0
  52. package/templates/expo/assets/icon.png +0 -0
  53. package/templates/expo/brand.ts +7 -0
  54. package/templates/expo/components/Avatar.tsx +75 -0
  55. package/templates/expo/components/ui.tsx +57 -0
  56. package/templates/expo/index.ts +4 -0
  57. package/templates/expo/lib/theme.ts +43 -0
  58. package/templates/expo/lib/usebecky.ts +15 -0
  59. package/templates/expo/package.json +29 -0
  60. package/templates/expo/screens/Home.tsx +187 -0
  61. package/templates/expo/screens/SignIn.tsx +112 -0
  62. package/templates/expo/tsconfig.json +6 -0
  63. package/templates/expo/usebecky.template.json +36 -0
  64. package/templates/extension/README.md +128 -0
  65. package/templates/extension/_env.example +21 -0
  66. package/templates/extension/_gitignore +11 -0
  67. package/templates/extension/logo.svg +1 -0
  68. package/templates/extension/package.json +25 -0
  69. package/templates/extension/src/accounts.ts +90 -0
  70. package/templates/extension/src/app.ts +178 -0
  71. package/templates/extension/src/pages.ts +108 -0
  72. package/templates/extension/src/replay-guard.ts +17 -0
  73. package/templates/extension/src/server.ts +57 -0
  74. package/templates/extension/src/settings.ts +69 -0
  75. package/templates/extension/src/ui.ts +70 -0
  76. package/templates/extension/test/app.test.ts +222 -0
  77. package/templates/extension/tsconfig.json +16 -0
  78. package/templates/extension/usebecky-extension.json +36 -0
  79. package/templates/extension/usebecky.template.json +22 -0
  80. package/templates/landing/README.md +43 -0
  81. package/templates/landing/_env.example +4 -0
  82. package/templates/landing/_gitignore +9 -0
  83. package/templates/landing/index.html +16 -0
  84. package/templates/landing/package.json +28 -0
  85. package/templates/landing/public/icon.svg +1 -0
  86. package/templates/landing/src/App.tsx +97 -0
  87. package/templates/landing/src/components/Contact.tsx +43 -0
  88. package/templates/landing/src/components/Counter.tsx +34 -0
  89. package/templates/landing/src/components/Feedback.tsx +36 -0
  90. package/templates/landing/src/components/Logo.tsx +11 -0
  91. package/templates/landing/src/components/Receipt.tsx +128 -0
  92. package/templates/landing/src/components/Setup.tsx +20 -0
  93. package/templates/landing/src/components/fields.tsx +63 -0
  94. package/templates/landing/src/content.ts +22 -0
  95. package/templates/landing/src/index.css +119 -0
  96. package/templates/landing/src/lib/usebecky.ts +11 -0
  97. package/templates/landing/src/lib/waitlist.ts +46 -0
  98. package/templates/landing/src/main.tsx +12 -0
  99. package/templates/landing/src/vite-env.d.ts +6 -0
  100. package/templates/landing/tsconfig.json +19 -0
  101. package/templates/landing/usebecky.template.json +20 -0
  102. package/templates/landing/vite.config.ts +10 -0
  103. package/templates/notes/README.md +68 -0
  104. package/templates/notes/_env.example +4 -0
  105. package/templates/notes/_gitignore +9 -0
  106. package/templates/notes/index.html +15 -0
  107. package/templates/notes/package.json +28 -0
  108. package/templates/notes/public/icon.svg +1 -0
  109. package/templates/notes/src/App.tsx +35 -0
  110. package/templates/notes/src/brand.ts +7 -0
  111. package/templates/notes/src/components/Composer.tsx +113 -0
  112. package/templates/notes/src/components/NoteEntry.tsx +151 -0
  113. package/templates/notes/src/components/Notes.tsx +163 -0
  114. package/templates/notes/src/components/Setup.tsx +44 -0
  115. package/templates/notes/src/components/SignIn.tsx +112 -0
  116. package/templates/notes/src/components/icons.tsx +54 -0
  117. package/templates/notes/src/index.css +105 -0
  118. package/templates/notes/src/lib/notes.ts +68 -0
  119. package/templates/notes/src/lib/usebecky.ts +9 -0
  120. package/templates/notes/src/main.tsx +22 -0
  121. package/templates/notes/src/vite-env.d.ts +6 -0
  122. package/templates/notes/tsconfig.json +19 -0
  123. package/templates/notes/usebecky.template.json +34 -0
  124. package/templates/notes/vite.config.ts +10 -0
  125. package/templates/saas/README.md +69 -0
  126. package/templates/saas/_env.example +10 -0
  127. package/templates/saas/_gitignore +11 -0
  128. package/templates/saas/app/(app)/account/ManageBilling.tsx +26 -0
  129. package/templates/saas/app/(app)/account/page.tsx +71 -0
  130. package/templates/saas/app/(app)/dashboard/Projects.tsx +227 -0
  131. package/templates/saas/app/(app)/dashboard/page.tsx +21 -0
  132. package/templates/saas/app/(app)/layout.tsx +29 -0
  133. package/templates/saas/app/(app)/premium/page.tsx +62 -0
  134. package/templates/saas/app/auth/callback/page.tsx +33 -0
  135. package/templates/saas/app/globals.css +143 -0
  136. package/templates/saas/app/icon.svg +1 -0
  137. package/templates/saas/app/layout.tsx +20 -0
  138. package/templates/saas/app/page.tsx +87 -0
  139. package/templates/saas/app/pricing/Plans.tsx +133 -0
  140. package/templates/saas/app/pricing/TestCardHint.tsx +18 -0
  141. package/templates/saas/app/pricing/page.tsx +21 -0
  142. package/templates/saas/app/setup/page.tsx +34 -0
  143. package/templates/saas/app/sign-in/SignInForm.tsx +195 -0
  144. package/templates/saas/app/sign-in/page.tsx +21 -0
  145. package/templates/saas/brand.ts +10 -0
  146. package/templates/saas/components/AppNav.tsx +45 -0
  147. package/templates/saas/components/Logo.tsx +22 -0
  148. package/templates/saas/components/SiteHeader.tsx +50 -0
  149. package/templates/saas/components/Status.tsx +15 -0
  150. package/templates/saas/lib/session.ts +26 -0
  151. package/templates/saas/lib/usebecky.ts +11 -0
  152. package/templates/saas/next-env.d.ts +5 -0
  153. package/templates/saas/next.config.ts +5 -0
  154. package/templates/saas/package.json +26 -0
  155. package/templates/saas/postcss.config.mjs +3 -0
  156. package/templates/saas/tsconfig.json +21 -0
  157. package/templates/saas/usebecky.template.json +31 -0
package/README.md CHANGED
@@ -1,3 +1,81 @@
1
- # Temporary Holding Version
1
+ # create-usebecky
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
+ Make a working app that is already connected to usebecky, with one command:
4
+
5
+ ```bash
6
+ npm create usebecky@latest
7
+ ```
8
+
9
+ `npx create-usebecky` and `npx usebecky create` do the same. It asks for a name, a starter and a project, then copies the starter, installs packages, writes your keys, creates the tables the starter needs and adds the AI assistant skill. Docs: [Starter apps](https://usebecky.com/docs/getting-started/starters).
10
+
11
+ | Starter | Stack | Server template |
12
+ |---|---|---|
13
+ | `notes` | React + Vite | `blank` + a `notes` table and `attachments` bucket |
14
+ | `saas` | Next.js | `saas` |
15
+ | `landing` | React + Vite | `waitlist` + a `contact` form |
16
+ | `expo` | Expo (JavaScript; for Swift or Kotlin see the [iOS](https://usebecky.com/docs/frameworks/ios) / [Android](https://usebecky.com/docs/frameworks/android) guides) | `mobile` |
17
+
18
+ Options: `--template`, `--new-project`, `--project <ref>`, `--skip-connect`, `--no-install`, `--no-ai`, `--api-url`, `--pm`, `--name`, `--sdk <path>`, `--yes`. Run with `--help` for details.
19
+
20
+ The new app talks to the hosted usebecky API (`https://api.usebecky.com`); its `.env` holds your project's publishable key (and the secret key for server code).
21
+
22
+ ## Develop
23
+
24
+ ```bash
25
+ node src/index.ts my-app # run from source (uses the hosted API)
26
+ npm test -w create-usebecky # node --test, no server needed
27
+ npm run typecheck -w create-usebecky
28
+ ```
29
+
30
+ To try a starter against your local SDK, pack it and pass `--sdk`:
31
+
32
+ ```bash
33
+ npm run build -w usebecky && (cd packages/sdk && npm pack --pack-destination /tmp)
34
+ node packages/create-usebecky/src/index.ts /tmp/my-app --template notes --new-project --sdk /tmp/usebecky-0.1.0.tgz
35
+ ```
36
+
37
+ `src/shared/` is a generated copy of `packages/sdk/src/cli/{ui,framework,ai}.ts` (env files, `.gitignore`, the AI skill, terminal style), `packages/sdk/src/lib/hosted.ts` (the hosted API address) and `packages/extension/src/cli/skill.ts` (the extension starter's AI skill), so this package has no dependencies and behaves exactly like `npx usebecky init`. Edit the SDK files, then run `npm run sync -w create-usebecky`. The tests fail when the copy is stale.
38
+
39
+ ## Add a starter
40
+
41
+ 1. Create `templates/<id>/` with the app and a `README.md` for beginners. Name dotfiles `_gitignore` and `_env.example` (npm drops `.gitignore` from packages).
42
+ 2. Add `templates/<id>/usebecky.template.json`:
43
+
44
+ ```json
45
+ {
46
+ "id": "<id>",
47
+ "name": "Shown in the picker",
48
+ "description": "One short line",
49
+ "stack": "SwiftUI",
50
+ "kind": "node | xcode | gradle",
51
+ "framework": "next | vite | expo (node only: picks the env file and variable names)",
52
+ "serverTemplate": "blank | saas | mobile | waitlist | ...",
53
+ "brandName": "Placeholder name, replaced with the user's app name in brandFiles",
54
+ "brandSlug": "placeholder-slug",
55
+ "brandFiles": ["src/brand.ts"],
56
+ "customize": { "name": "src/brand.ts", "colour": "src/index.css (--brand)" },
57
+ "requires": { "tables": ["todos"] },
58
+ "setup": { "tables": [], "buckets": [], "realtime": [], "forms": [] },
59
+ "run": { "script": "dev", "url": "http://localhost:3000", "port": 3000, "first": "Shown above Next: (optional)", "note": "Shown under it (optional)", "localNote": "Shown only when --api-url points at a local API (optional)" }
60
+ }
61
+ ```
62
+
63
+ 3. `npm test -w create-usebecky` checks every manifest, pinned versions, the README and that the client file sits where `npx usebecky init` expects it.
64
+
65
+ ### Starters without a project (the extension starter)
66
+
67
+ `templates/extension` is an extension for the usebecky store, not an app on a project: customers install it on their own projects. Its manifest has `"project": false` (no connect question, no keys, no tables; `serverTemplate`, `setup`, `requires` and `config` are not allowed) and `"skill": "usebecky-extension"`, so it gets the extension kit's AI skill (`packages/extension/skill`, bundled into `dist/extension-skill` by the build) and an AGENTS.md section for it instead of the SDK skill. `src/shared/extension-skill.ts` is a generated copy of `packages/extension/src/cli/skill.ts`, the code behind `npx @usebecky/extension ai`. The tests also generate the starter with a custom name and run its own tests and type check against the workspace's `@usebecky/extension`.
68
+
69
+ ### Native starters (iOS, Android)
70
+
71
+ Set `"kind": "xcode"` or `"gradle"`. They skip the install step and write the keys into `config` instead of an env file:
72
+
73
+ ```json
74
+ {
75
+ "kind": "xcode",
76
+ "config": { "file": "Config/UseBecky.xcconfig", "format": "xcconfig", "url": "USEBECKY_URL", "publishableKey": "USEBECKY_PUBLISHABLE_KEY" },
77
+ "run": { "command": "open MyApp.xcodeproj" }
78
+ }
79
+ ```
80
+
81
+ Formats: `xcconfig` (URLs are written as `https:/$()/host`, because `//` starts a comment there), `properties` (Gradle's `local.properties`) and `dotenv`. The file is added to `.gitignore`. `setup`, `brandFiles` and the AI skill work the same as for Node starters.