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.
- package/README.md +80 -2
- package/dist/create.js +842 -0
- package/dist/extension-skill/usebecky-extension/SKILL.md +181 -0
- package/dist/extension-skill/usebecky-extension/references/accounts.md +125 -0
- package/dist/extension-skill/usebecky-extension/references/dev-server.md +102 -0
- package/dist/extension-skill/usebecky-extension/references/manifest.md +104 -0
- package/dist/extension-skill/usebecky-extension/references/oauth-and-tokens.md +179 -0
- package/dist/extension-skill/usebecky-extension/references/partner-api.md +87 -0
- package/dist/extension-skill/usebecky-extension/references/submit-and-pricing.md +31 -0
- package/dist/extension-skill/usebecky-extension/references/ui.md +172 -0
- package/dist/extension-skill/usebecky-extension/references/webhooks.md +97 -0
- package/dist/index.js +10 -0
- package/dist/keys.js +72 -0
- package/dist/platform.js +104 -0
- package/dist/pm.js +69 -0
- package/dist/prompts.js +242 -0
- package/dist/scaffold.js +108 -0
- package/dist/setup.js +130 -0
- package/dist/shared/ai.js +203 -0
- package/dist/shared/extension-skill.js +107 -0
- package/dist/shared/framework.js +460 -0
- package/dist/shared/hosted.js +8 -0
- package/dist/shared/ui.js +141 -0
- package/dist/skill/usebecky/SKILL.md +339 -0
- package/dist/skill/usebecky/references/access-rules.md +307 -0
- package/dist/skill/usebecky/references/addons.md +68 -0
- package/dist/skill/usebecky/references/analytics.md +166 -0
- package/dist/skill/usebecky/references/android.md +434 -0
- package/dist/skill/usebecky/references/auth.md +379 -0
- package/dist/skill/usebecky/references/cache.md +51 -0
- package/dist/skill/usebecky/references/components.md +127 -0
- package/dist/skill/usebecky/references/emails.md +105 -0
- package/dist/skill/usebecky/references/expo.md +147 -0
- package/dist/skill/usebecky/references/functions.md +99 -0
- package/dist/skill/usebecky/references/hosting.md +119 -0
- package/dist/skill/usebecky/references/http-api.md +233 -0
- package/dist/skill/usebecky/references/ios.md +355 -0
- package/dist/skill/usebecky/references/payments.md +493 -0
- package/dist/skill/usebecky/references/realtime.md +143 -0
- package/dist/skill/usebecky/references/scheduled-jobs.md +82 -0
- package/dist/skill/usebecky/references/sdk.md +838 -0
- package/dist/skill/usebecky/references/storage.md +210 -0
- package/dist/skill/usebecky/references/templates.md +191 -0
- package/dist/skill/usebecky/references/wordpress.md +87 -0
- package/dist/templates.js +74 -0
- package/package.json +37 -4
- package/templates/expo/App.tsx +48 -0
- package/templates/expo/README.md +59 -0
- package/templates/expo/_env.example +4 -0
- package/templates/expo/_gitignore +12 -0
- package/templates/expo/app.json +25 -0
- package/templates/expo/assets/icon.png +0 -0
- package/templates/expo/brand.ts +7 -0
- package/templates/expo/components/Avatar.tsx +75 -0
- package/templates/expo/components/ui.tsx +57 -0
- package/templates/expo/index.ts +4 -0
- package/templates/expo/lib/theme.ts +43 -0
- package/templates/expo/lib/usebecky.ts +15 -0
- package/templates/expo/package.json +29 -0
- package/templates/expo/screens/Home.tsx +187 -0
- package/templates/expo/screens/SignIn.tsx +112 -0
- package/templates/expo/tsconfig.json +6 -0
- package/templates/expo/usebecky.template.json +36 -0
- package/templates/extension/README.md +128 -0
- package/templates/extension/_env.example +21 -0
- package/templates/extension/_gitignore +11 -0
- package/templates/extension/logo.svg +1 -0
- package/templates/extension/package.json +25 -0
- package/templates/extension/src/accounts.ts +90 -0
- package/templates/extension/src/app.ts +178 -0
- package/templates/extension/src/pages.ts +108 -0
- package/templates/extension/src/replay-guard.ts +17 -0
- package/templates/extension/src/server.ts +57 -0
- package/templates/extension/src/settings.ts +69 -0
- package/templates/extension/src/ui.ts +70 -0
- package/templates/extension/test/app.test.ts +222 -0
- package/templates/extension/tsconfig.json +16 -0
- package/templates/extension/usebecky-extension.json +36 -0
- package/templates/extension/usebecky.template.json +22 -0
- package/templates/landing/README.md +43 -0
- package/templates/landing/_env.example +4 -0
- package/templates/landing/_gitignore +9 -0
- package/templates/landing/index.html +16 -0
- package/templates/landing/package.json +28 -0
- package/templates/landing/public/icon.svg +1 -0
- package/templates/landing/src/App.tsx +97 -0
- package/templates/landing/src/components/Contact.tsx +43 -0
- package/templates/landing/src/components/Counter.tsx +34 -0
- package/templates/landing/src/components/Feedback.tsx +36 -0
- package/templates/landing/src/components/Logo.tsx +11 -0
- package/templates/landing/src/components/Receipt.tsx +128 -0
- package/templates/landing/src/components/Setup.tsx +20 -0
- package/templates/landing/src/components/fields.tsx +63 -0
- package/templates/landing/src/content.ts +22 -0
- package/templates/landing/src/index.css +119 -0
- package/templates/landing/src/lib/usebecky.ts +11 -0
- package/templates/landing/src/lib/waitlist.ts +46 -0
- package/templates/landing/src/main.tsx +12 -0
- package/templates/landing/src/vite-env.d.ts +6 -0
- package/templates/landing/tsconfig.json +19 -0
- package/templates/landing/usebecky.template.json +20 -0
- package/templates/landing/vite.config.ts +10 -0
- package/templates/notes/README.md +68 -0
- package/templates/notes/_env.example +4 -0
- package/templates/notes/_gitignore +9 -0
- package/templates/notes/index.html +15 -0
- package/templates/notes/package.json +28 -0
- package/templates/notes/public/icon.svg +1 -0
- package/templates/notes/src/App.tsx +35 -0
- package/templates/notes/src/brand.ts +7 -0
- package/templates/notes/src/components/Composer.tsx +113 -0
- package/templates/notes/src/components/NoteEntry.tsx +151 -0
- package/templates/notes/src/components/Notes.tsx +163 -0
- package/templates/notes/src/components/Setup.tsx +44 -0
- package/templates/notes/src/components/SignIn.tsx +112 -0
- package/templates/notes/src/components/icons.tsx +54 -0
- package/templates/notes/src/index.css +105 -0
- package/templates/notes/src/lib/notes.ts +68 -0
- package/templates/notes/src/lib/usebecky.ts +9 -0
- package/templates/notes/src/main.tsx +22 -0
- package/templates/notes/src/vite-env.d.ts +6 -0
- package/templates/notes/tsconfig.json +19 -0
- package/templates/notes/usebecky.template.json +34 -0
- package/templates/notes/vite.config.ts +10 -0
- package/templates/saas/README.md +69 -0
- package/templates/saas/_env.example +10 -0
- package/templates/saas/_gitignore +11 -0
- package/templates/saas/app/(app)/account/ManageBilling.tsx +26 -0
- package/templates/saas/app/(app)/account/page.tsx +71 -0
- package/templates/saas/app/(app)/dashboard/Projects.tsx +227 -0
- package/templates/saas/app/(app)/dashboard/page.tsx +21 -0
- package/templates/saas/app/(app)/layout.tsx +29 -0
- package/templates/saas/app/(app)/premium/page.tsx +62 -0
- package/templates/saas/app/auth/callback/page.tsx +33 -0
- package/templates/saas/app/globals.css +143 -0
- package/templates/saas/app/icon.svg +1 -0
- package/templates/saas/app/layout.tsx +20 -0
- package/templates/saas/app/page.tsx +87 -0
- package/templates/saas/app/pricing/Plans.tsx +133 -0
- package/templates/saas/app/pricing/TestCardHint.tsx +18 -0
- package/templates/saas/app/pricing/page.tsx +21 -0
- package/templates/saas/app/setup/page.tsx +34 -0
- package/templates/saas/app/sign-in/SignInForm.tsx +195 -0
- package/templates/saas/app/sign-in/page.tsx +21 -0
- package/templates/saas/brand.ts +10 -0
- package/templates/saas/components/AppNav.tsx +45 -0
- package/templates/saas/components/Logo.tsx +22 -0
- package/templates/saas/components/SiteHeader.tsx +50 -0
- package/templates/saas/components/Status.tsx +15 -0
- package/templates/saas/lib/session.ts +26 -0
- package/templates/saas/lib/usebecky.ts +11 -0
- package/templates/saas/next-env.d.ts +5 -0
- package/templates/saas/next.config.ts +5 -0
- package/templates/saas/package.json +26 -0
- package/templates/saas/postcss.config.mjs +3 -0
- package/templates/saas/tsconfig.json +21 -0
- package/templates/saas/usebecky.template.json +31 -0
package/README.md
CHANGED
|
@@ -1,3 +1,81 @@
|
|
|
1
|
-
#
|
|
1
|
+
# create-usebecky
|
|
2
2
|
|
|
3
|
-
|
|
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.
|