create-disposabl-app 0.2.4 → 0.3.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/dist/index.js CHANGED
@@ -8,7 +8,7 @@ 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.2.4";
11
+ var version = "0.3.0";
12
12
 
13
13
  // options.ts
14
14
  var platforms = [
@@ -0,0 +1,56 @@
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. Runs on the same branch and runner serialize.
43
+
44
+ Record the workflow/run URL, commit, attempt, actual CPU/RAM details from
45
+ **Record machine**, cache state, and step timings. For each job, compute queue
46
+ time as `started_at - created_at` and runtime as `completed_at - started_at`
47
+ from GitHub's jobs API. Also record time from workflow creation to job creation
48
+ and workflow creation to job completion, so workflow scheduling delay is not
49
+ hidden. For reruns, use that attempt's start and jobs instead of the original
50
+ workflow creation time.
51
+
52
+ The deployment log prints `Web build seconds` separately from the combined
53
+ backend deployment, web build, and upload step. `boat ci job <job-id> --json`
54
+ provides Boat's own provisioning/wait/runtime measurements. Do not add its wait
55
+ time to GitHub's queue time: the intervals can overlap. Compare multiple cold
56
+ and warm rounds before choosing a default based on speed.
@@ -6,18 +6,35 @@ on:
6
6
  types: [opened, synchronize, reopened]
7
7
  push:
8
8
  branches: [main]
9
+ workflow_dispatch:
10
+ inputs:
11
+ runner:
12
+ description: Machine to compare
13
+ type: choice
14
+ options: [ubuntu-latest, boat-small, boat]
15
+ default: boat
16
+ preview:
17
+ description: Deploy an isolated Convex preview, including the web build
18
+ type: boolean
19
+ default: false
20
+ cache_scope:
21
+ description: Use a new value for a cold run; reuse it for warm runs
22
+ type: string
23
+ default: benchmark-v1
9
24
 
10
25
  permissions:
11
26
  contents: read
12
27
 
13
28
  concurrency:
14
- group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
29
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}-${{ inputs.runner || 'default' }}
15
30
  cancel-in-progress: false
16
31
 
17
32
  jobs:
18
33
  pipeline:
19
34
  if: github.event.deleted != true
20
- runs-on: ubuntu-latest
35
+ # Install the Boat CI GitHub App first. Fork PRs use GitHub-hosted runners.
36
+ # DISPOSABL_CI_RUNNER can select boat-small or ubuntu-latest for normal runs.
37
+ runs-on: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository && 'ubuntu-latest' || inputs.runner || vars.DISPOSABL_CI_RUNNER || 'boat' }}
21
38
  timeout-minutes: 30
22
39
  steps:
23
40
  - name: Check out repository
@@ -25,6 +42,13 @@ jobs:
25
42
  with:
26
43
  persist-credentials: false
27
44
 
45
+ - name: Record machine
46
+ run: |
47
+ printf 'CPUs: %s\n' "$(nproc)"
48
+ lscpu
49
+ free -h
50
+ cat /etc/os-release
51
+
28
52
  - name: Install Node.js
29
53
  uses: actions/setup-node@v6
30
54
  with:
@@ -40,9 +64,9 @@ jobs:
40
64
  uses: actions/cache@v4
41
65
  with:
42
66
  path: .turbo/cache
43
- key: turbo-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-${{ github.sha }}
67
+ key: turbo-${{ inputs.cache_scope || 'ci' }}-${{ inputs.runner || vars.DISPOSABL_CI_RUNNER || 'boat' }}-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-${{ github.sha }}
44
68
  restore-keys: |
45
- turbo-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-
69
+ turbo-${{ inputs.cache_scope || 'ci' }}-${{ inputs.runner || vars.DISPOSABL_CI_RUNNER || 'boat' }}-${{ runner.os }}-${{ runner.arch }}-node24-bun1.4.4-
46
70
 
47
71
  - name: Install dependencies
48
72
  run: bun install --frozen-lockfile
@@ -62,7 +86,7 @@ jobs:
62
86
 
63
87
  - name: Build
64
88
  # Trusted branches build once below, with their actual deployment URLs.
65
- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
89
+ if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch' && !inputs.preview)
66
90
  env:
67
91
  VITE_CONVEX_URL: https://ci.invalid
68
92
  VITE_CONVEX_SITE_URL: https://ci.invalid
@@ -79,24 +103,29 @@ jobs:
79
103
  --cmd-url-env-var-name VITE_CONVEX_URL \
80
104
  --cmd '
81
105
  bun x --no-install --package @convex-dev/auth auth --keys-only --prod &&
106
+ build_started=$(date +%s) &&
82
107
  VITE_CONVEX_SITE_URL="$CONVEX_SITE_URL" bun run --cwd ../.. build &&
108
+ echo "Web build seconds: $(($(date +%s) - build_started))" &&
83
109
  echo "url=$CONVEX_SITE_URL" >> "$GITHUB_OUTPUT"
84
110
  '
85
111
  bun x --no-install static-hosting upload --prod --no-spa --dist ../../apps/web/dist/client
86
112
 
87
113
  - name: Deploy preview
88
114
  id: preview
89
- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
115
+ if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'workflow_dispatch' && inputs.preview)
90
116
  working-directory: packages/backend
91
117
  env:
92
118
  CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY_PREVIEW }}
93
- PREVIEW_NAME: ${{ github.head_ref }}
119
+ # Each benchmark runner gets its own preview to avoid concurrent writes.
120
+ PREVIEW_NAME: ${{ github.head_ref || format('ci-benchmark-{0}', inputs.runner) }}
94
121
  run: |
95
122
  bun x --no-install convex deploy --yes --preview-name "$PREVIEW_NAME" \
96
123
  --cmd-url-env-var-name VITE_CONVEX_URL \
97
124
  --cmd '
98
125
  bun x --no-install --package @convex-dev/auth auth --keys-only --preview-name "$PREVIEW_NAME" &&
126
+ build_started=$(date +%s) &&
99
127
  VITE_CONVEX_SITE_URL="$CONVEX_SITE_URL" bun run --cwd ../.. build &&
128
+ echo "Web build seconds: $(($(date +%s) - build_started))" &&
100
129
  echo "url=$CONVEX_SITE_URL" >> "$GITHUB_OUTPUT"
101
130
  '
102
131
  bun x --no-install static-hosting upload --preview-name "$PREVIEW_NAME" --no-spa --dist ../../apps/web/dist/client
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-disposabl-app",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "Create a Disposabl app",
5
5
  "type": "module",
6
6
  "license": "MIT",