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.
- package/dist/index.js +36 -8
- package/dist/templates/default/.github/README.md +99 -57
- package/dist/templates/default/.github/actionlint.yaml +6 -0
- package/dist/templates/default/.github/workflows/pipeline.yml.example +492 -0
- package/dist/templates/default/apps/desktop/README.md +44 -14
- package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +36 -17
- package/dist/templates/default/apps/desktop/package.json +5 -5
- package/dist/templates/default/apps/mobile/README.md +127 -0
- package/dist/templates/default/apps/mobile/app.config.js +78 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/icon.json +21 -26
- package/dist/templates/default/apps/mobile/eas.json +22 -0
- package/dist/templates/default/apps/mobile/eslint.config.js +3 -3
- package/dist/templates/default/apps/mobile/package.json +5 -3
- package/dist/templates/default/apps/mobile/plugins/with-android-signing.js +29 -0
- package/dist/templates/default/apps/mobile/scripts/android-config.test.mjs +128 -0
- package/dist/templates/default/apps/mobile/tsconfig.json +3 -12
- package/dist/templates/default/apps/web/src/index.css +124 -73
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -9
- package/dist/templates/default/bun.lock +121 -11
- package/dist/templates/default/bunfig.toml +8 -1
- package/dist/templates/default/disposabl.json +9 -4
- package/dist/templates/default/gitignore +2 -0
- package/dist/templates/default/package.json +1 -0
- package/dist/templates/default/packages/backend/convex/todos/internal.ts +3 -3
- package/dist/templates/default/packages/backend/package.json +2 -3
- package/dist/templates/default/packages/disposabl-kit/client/styles/globals.css +43 -43
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +2 -2
- package/dist/templates/default/packages/disposabl-kit/package.json +2 -1
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +87 -0
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +20 -7
- package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +1 -10
- package/dist/templates/default/packages/disposabl-kit/server/lib/platform-spec.ts +137 -0
- package/dist/templates/default/turbo.json +16 -5
- package/package.json +1 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +0 -141
- package/dist/templates/default/packages/disposabl-kit/server/dev-setup.mjs +0 -39
- package/dist/templates/default/packages/disposabl-kit/server/lib/mcp-tools.ts +0 -47
- 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.
|
|
11
|
+
var version = "0.3.2";
|
|
12
12
|
|
|
13
|
-
//
|
|
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
|
-
|
|
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
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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.
|