create-disposabl-app 0.3.1 → 0.3.2

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 (39) hide show
  1. package/dist/index.js +36 -8
  2. package/dist/templates/default/.github/README.md +99 -57
  3. package/dist/templates/default/.github/actionlint.yaml +6 -0
  4. package/dist/templates/default/.github/workflows/pipeline.yml.example +492 -0
  5. package/dist/templates/default/apps/desktop/README.md +44 -14
  6. package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
  7. package/dist/templates/default/apps/desktop/forge.config.mts +36 -17
  8. package/dist/templates/default/apps/desktop/package.json +5 -5
  9. package/dist/templates/default/apps/mobile/README.md +127 -0
  10. package/dist/templates/default/apps/mobile/app.config.js +78 -0
  11. package/dist/templates/default/apps/mobile/assets/expo.icon/icon.json +21 -26
  12. package/dist/templates/default/apps/mobile/eas.json +22 -0
  13. package/dist/templates/default/apps/mobile/eslint.config.js +3 -3
  14. package/dist/templates/default/apps/mobile/package.json +5 -3
  15. package/dist/templates/default/apps/mobile/plugins/with-android-signing.js +29 -0
  16. package/dist/templates/default/apps/mobile/scripts/android-config.test.mjs +128 -0
  17. package/dist/templates/default/apps/mobile/tsconfig.json +3 -12
  18. package/dist/templates/default/apps/web/src/index.css +124 -73
  19. package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -9
  20. package/dist/templates/default/bun.lock +121 -11
  21. package/dist/templates/default/bunfig.toml +8 -1
  22. package/dist/templates/default/disposabl.json +9 -4
  23. package/dist/templates/default/gitignore +2 -0
  24. package/dist/templates/default/package.json +1 -0
  25. package/dist/templates/default/packages/backend/convex/todos/internal.ts +3 -3
  26. package/dist/templates/default/packages/backend/package.json +2 -3
  27. package/dist/templates/default/packages/disposabl-kit/client/styles/globals.css +43 -43
  28. package/dist/templates/default/packages/disposabl-kit/eslint.config.js +2 -2
  29. package/dist/templates/default/packages/disposabl-kit/package.json +2 -1
  30. package/dist/templates/default/packages/disposabl-kit/platforms.ts +87 -0
  31. package/dist/templates/default/packages/disposabl-kit/server/http.ts +20 -7
  32. package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +1 -10
  33. package/dist/templates/default/packages/disposabl-kit/server/lib/platform-spec.ts +137 -0
  34. package/dist/templates/default/turbo.json +16 -5
  35. package/package.json +1 -1
  36. package/dist/templates/default/.github/workflows/pipeline.yml +0 -141
  37. package/dist/templates/default/packages/disposabl-kit/server/dev-setup.mjs +0 -39
  38. package/dist/templates/default/packages/disposabl-kit/server/lib/mcp-tools.ts +0 -47
  39. package/dist/templates/default/packages/disposabl-kit/server/lib/platforms.ts +0 -20
package/dist/index.js CHANGED
@@ -8,9 +8,9 @@ import { fileURLToPath } from "node:url";
8
8
  import { Command, CommanderError } from "commander";
9
9
  import * as p2 from "@clack/prompts";
10
10
  // package.json
11
- var version = "0.3.1";
11
+ var version = "0.3.2";
12
12
 
13
- // options.ts
13
+ // ../disposabl-kit/platforms.ts
14
14
  var platforms = [
15
15
  { id: "web", label: "Web", group: "Required", status: "required" },
16
16
  { id: "android", label: "Android", group: "Mobile", status: "available" },
@@ -54,10 +54,33 @@ var platforms = [
54
54
  status: "disabled"
55
55
  }
56
56
  ];
57
+ var platformIds = platforms.map(({ id }) => id);
58
+ var requiredPlatform = "web";
57
59
  var platformDependencies = {
58
60
  "openai-plugin": ["mcp"],
59
- "claude-code-plugin": ["mcp"]
61
+ "claude-code-plugin": ["mcp"],
62
+ cli: ["api"],
63
+ "python-sdk": ["api"],
64
+ "typescript-sdk": ["api"]
60
65
  };
66
+ function isPlatform(value) {
67
+ return typeof value === "string" && platformIds.includes(value);
68
+ }
69
+ function parsePlatform(value) {
70
+ if (isPlatform(value))
71
+ return value;
72
+ throw new Error(`Unknown platform ${JSON.stringify(value)}`);
73
+ }
74
+ function resolvePlatforms(values) {
75
+ const selected = new Set(values.map(parsePlatform));
76
+ selected.add(requiredPlatform);
77
+ for (const id of selected)
78
+ for (const dependency of platformDependencies[id] ?? [])
79
+ selected.add(dependency);
80
+ return platformIds.filter((id) => selected.has(id));
81
+ }
82
+
83
+ // options.ts
61
84
  var features = [
62
85
  { id: "docs", label: "Docs", hint: "apps/docs" },
63
86
  { id: "blog", label: "Blog", hint: "apps/blog" },
@@ -79,11 +102,7 @@ function selectPlatforms(input = "web") {
79
102
  if (option.status === "disabled")
80
103
  throw new Error(option.label + " is not available yet and cannot be selected.");
81
104
  }
82
- for (const [plugin, dependencies] of Object.entries(platformDependencies)) {
83
- if (requested.includes(plugin))
84
- requested.push(...dependencies);
85
- }
86
- return platforms.filter((option) => option.id === "web" || requested.includes(option.id)).map((option) => option.id);
105
+ return resolvePlatforms(requested);
87
106
  }
88
107
  function selectFeatures(input = "none") {
89
108
  const requested = input === "none" ? [] : parseList(input);
@@ -305,6 +324,7 @@ import { join } from "node:path";
305
324
  async function createApp(template, destination, name, config, overwrite = false) {
306
325
  config = {
307
326
  ...config,
327
+ platforms: selectPlatforms(config.platforms.join(",")),
308
328
  features: selectFeatures(config.features.join(",") || "none")
309
329
  };
310
330
  const folders = selectedFolders(config);
@@ -339,6 +359,14 @@ async function createApp(template, destination, name, config, overwrite = false)
339
359
  manifest.name = name;
340
360
  await writeFile(manifestPath, JSON.stringify(manifest, null, 2) + `
341
361
  `);
362
+ if (folders.includes("apps/mobile")) {
363
+ const appConfigPath = join(destination, "apps/mobile/app.json");
364
+ const appConfig = JSON.parse(await readFile(appConfigPath, "utf8"));
365
+ appConfig.expo.name = name;
366
+ appConfig.expo.slug = name;
367
+ await writeFile(appConfigPath, JSON.stringify(appConfig, null, 2) + `
368
+ `);
369
+ }
342
370
  await writeFile(join(destination, "disposabl.json"), JSON.stringify(config, null, 2) + `
343
371
  `);
344
372
  } catch (error) {
@@ -1,57 +1,99 @@
1
- # CI and deployment
2
-
3
- The app runs GitHub Actions on Boat's 4-CPU runner. Install the
4
- [Boat CI GitHub App](https://docs.boat.dev/ci) for the repository with
5
- `boat ci connect` before pushing. This connects the installation to the current
6
- Boat billing account. It does not require a personal GitHub token or a Boat API
7
- key in the workflow.
8
-
9
- Boat CI requires a paid Boat plan. Public repositories also require explicit
10
- enablement in Boat and an allowlist of GitHub users. Fork pull requests use
11
- `ubuntu-latest` and build without deployment secrets.
12
-
13
- Keep these repository or organization secrets in GitHub Actions:
14
-
15
- - `CONVEX_DEPLOY_KEY`: production deploy key.
16
- - `CONVEX_DEPLOY_KEY_PREVIEW`: project preview deploy key.
17
-
18
- Do not move them to Boat environments. Boat CI deliberately does not inherit
19
- those environments. GitHub supplies the workflow's secrets and job token.
20
- `actions/cache` continues to store the Turbo cache through GitHub Actions.
21
-
22
- Same-repository pull requests deploy branch previews. Pushing to `main` deploys
23
- production. Set the GitHub Actions repository variable `DISPOSABL_CI_RUNNER` to
24
- `boat-small` for 2 CPUs, `boat` for 4 CPUs, or `ubuntu-latest` for GitHub's runner.
25
- Without the variable, normal jobs use `boat`.
26
-
27
- ## Compare runners
28
-
29
- Run **CI and deploy** manually on the same branch and commit for each of
30
- `ubuntu-latest`, `boat-small`, and `boat`. The workflow must first exist on the
31
- default branch. Keep the lockfile and inputs identical.
32
-
33
- Use a new `cache_scope`, such as `comparison-20261101-a`, for the first round.
34
- Each runner has a separate Turbo cache namespace. Repeat with the same scope
35
- and commit to measure a warm cache. The scope controls Turbo caching, not any
36
- provider's preinstalled tools or package download caches. Check cache restore
37
- logs and Turbo's hit counts before labeling a result warm.
38
-
39
- The default manual run installs, checks, tests, and builds without deployment
40
- credentials. Enable `preview` to measure the full deployment path using the
41
- preview key. Manual runs never deploy production. Each runner gets a separate
42
- `ci-benchmark-<runner>` preview. Manual runs on the same runner serialize across
43
- branches, so two branches cannot deploy to the same benchmark preview at once.
44
-
45
- Record the workflow/run URL, commit, attempt, actual CPU/RAM details from
46
- **Record machine**, cache state, and step timings. For each job, compute queue
47
- time as `started_at - created_at` and runtime as `completed_at - started_at`
48
- from GitHub's jobs API. Also record time from workflow creation to job creation
49
- and workflow creation to job completion, so workflow scheduling delay is not
50
- hidden. For reruns, use that attempt's start and jobs instead of the original
51
- workflow creation time.
52
-
53
- The deployment log prints `Web build seconds` separately from the combined
54
- backend deployment, web build, and upload step. `boat ci job <job-id> --json`
55
- provides Boat's own provisioning/wait/runtime measurements. Do not add its wait
56
- time to GitHub's queue time: the intervals can overlap. Compare multiple cold
57
- and warm rounds before choosing a default based on speed.
1
+ # Preview pipeline
2
+
3
+ `pipeline.yml` runs directly in this repository and is included in generated apps.
4
+ All preview decisions are visible in the workflow. There are no `preview.mjs`
5
+ helpers or local development setup hooks. Backend development uses `convex dev`.
6
+
7
+ ## Order
8
+
9
+ 1. **Web**, **Linux** and **Windows** start in parallel on 4-vCPU Blacksmith runners.
10
+ **macOS** joins them on a 6-vCPU Blacksmith Apple Silicon runner.
11
+ Platform selection runs inline, with no separate Plan job. Each desktop runner
12
+ checks whether it is enabled and affected before installing dependencies.
13
+ 2. Web checks the source and deploys backend and web, then checks each affected
14
+ mobile platform's fingerprint on the same runner.
15
+ 3. A matching project, application ID, channel and fingerprint uses EAS Update.
16
+ A different fingerprint or missing compatible binary starts that platform's
17
+ native job after Web. Android and iOS build in parallel on 4-vCPU Linux and
18
+ 6-vCPU macOS Blacksmith runners respectively.
19
+ 4. Each platform publishes from its existing build runner as soon as its own
20
+ build and verification succeed. Compatible updates publish from Web; native
21
+ jobs publish independently. There is no final Release job or artifact transfer.
22
+
23
+ Each PR has one published prerelease per affected platform at
24
+ `<RELEASE_PREFIX>-<CHANNEL>-<PLATFORM>`, for example `app-pr-2-macos`.
25
+ Successful updates replace its assets and notes, remove obsolete assets and move
26
+ that platform's preview tag to the tested commit. A failed platform build leaves
27
+ its previous preview available and does not block other platforms.
28
+ New releases are drafts only during their initial upload, then become public.
29
+ Production publishes regular releases with separate tags per platform and run.
30
+ Platform releases do not compete for GitHub's single Latest label with the CLI's
31
+ semantic-release publication. Desktop package versions remain `1.0.<run number>`.
32
+
33
+ iOS uses EAS local builds with remote ad hoc signing credentials and publishes
34
+ release IPAs. A matching, unexpired IPA receives EAS Update. Missing credentials
35
+ fail the native build; no additional enable flag is required. The macOS desktop
36
+ runner is separate from iOS. See [iOS setup](../apps/mobile/README.md#ios).
37
+
38
+ `CHANNEL` at the top is the single preview-name expression. Convex preview names,
39
+ EAS channels, EAS branches and mobile builds all use it. The default is `pr-N` for
40
+ PRs and `production` for main. Runner labels and tool versions are also at the top.
41
+
42
+ ## Selection
43
+
44
+ Mobile changes select Android and iOS; desktop changes select Linux, Windows and macOS. Shared
45
+ packages, lockfiles and platform configuration select all enabled supported
46
+ native targets. Web, backend-only and documentation changes skip native installs
47
+ and builds. Desktop runners still start briefly to make that decision; forks skip
48
+ the desktop jobs entirely.
49
+ Each PR platform compares against its last successfully published release's
50
+ source commit. Later web-only commits therefore skip desktop and mobile, while
51
+ failed or cancelled builds remain pending. Without a published baseline, selection
52
+ uses the whole PR diff. Truncated or diverged comparisons conservatively rebuild.
53
+ Main uses the complete pushed commit range. Fork PRs only
54
+ validate on Blacksmith Linux; they never deploy or publish.
55
+
56
+ ## Runners and caches
57
+
58
+ Every job uses Blacksmith. GitHub Actions schedules the jobs and displays their
59
+ graph; there are no GitHub-hosted or Boat runners.
60
+
61
+ A full native preview can use four 4-vCPU runners and two 6-vCPU macOS runners.
62
+ Android and iOS allocate runners only when a native build is needed. Publishing
63
+ reuses those machines; there is no separate Plan or Release runner.
64
+ Install the Blacksmith GitHub App for the repository.
65
+
66
+ Bun cache keys include OS, architecture, Bun version and lockfile. Each fresh
67
+ runner installs from that cache; `node_modules` is not transferred between OSes.
68
+ Blacksmith's native Turbo remote cache stores checks and web builds. Gradle caches dependencies and cacheable build
69
+ outputs; Electron downloads have their own cache. Build outputs upload directly
70
+ to GitHub Releases without an intermediate Actions artifact. Superseded PR runs
71
+ cancel; production runs serialize.
72
+
73
+ Default branch dependency caches can seed previews. Blacksmith's Turbo cache
74
+ shares eligible tasks across branches; Actions dependency caches retain their
75
+ branch access rules. No cache access policy is changed here.
76
+ Thirty to forty seconds is a warm update-only target, not a measured guarantee.
77
+ Native compilation and external deployment can take longer than one minute.
78
+ Compare the same commit with warm caches before increasing runner size; use a
79
+ larger runner only when it saves close to half the end-to-end time or more.
80
+ The 4-vCPU configuration is a candidate until comparable cold/warm runs verify it.
81
+
82
+ ## Configuration
83
+
84
+ Web requires `CONVEX_DEPLOY_KEY_PREVIEW` for PRs and `CONVEX_DEPLOY_KEY` for main.
85
+ Mobile previews require `EXPO_TOKEN` plus `EXPO_PROJECT_ID`, `EXPO_OWNER` and `EXPO_SLUG`
86
+ repository variables. See [mobile setup](../apps/mobile/README.md) for signing.
87
+ macOS signing and notarization use the five optional
88
+ [desktop signing secrets](../apps/desktop/README.md#macos-signing). With all five
89
+ present, both previews and production are Developer ID signed and notarized.
90
+ Otherwise, both publish an ad hoc signed, unnotarized Apple Silicon DMG with its
91
+ status and installation guidance in the release notes. Configured signing or
92
+ notarization failures still fail the job. Apple notarization adds external
93
+ processing time. `MACOS_BUNDLE_ID` configures the app identifier.
94
+ The Web/Android and desktop jobs have contents-write permission for their own
95
+ releases. Forks never deploy or publish; checkout does not persist credentials.
96
+ Each platform verifies its expected files and source commit before publication.
97
+
98
+ Benchmark branches are separate from this product workflow. Build-only benchmark
99
+ URLs and cache timings do not prove a live backend deployment or device behavior.
@@ -0,0 +1,6 @@
1
+ self-hosted-runner:
2
+ labels:
3
+ - blacksmith-2vcpu-ubuntu-2404
4
+ - blacksmith-4vcpu-ubuntu-2404
5
+ - blacksmith-2vcpu-windows-2025
6
+ - blacksmith-6vcpu-macos-26