@clubedge/create-clubedge-app 0.41.0 → 0.41.1
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/CHANGELOG.md +4 -0
- package/README.md +11 -11
- package/package.json +3 -3
- package/template/.github/workflows/clubedge-upgrade.yml +81 -22
- package/template/apps/api/package.json +1 -1
- package/template/apps/api-fastapi/package.json +1 -1
- package/template/apps/api-fastapi/pyproject.toml +1 -1
- package/template/apps/api-fastapi/uv.lock +1 -1
- package/template/apps/start/package.json +1 -1
- package/template/apps/vite/package.json +1 -1
- package/template/apps/web/package.json +1 -1
- package/template/clubedge.template.json +1 -0
- package/template/package.json +1 -1
- package/template/packages/auth/package.json +1 -1
- package/template/packages/auth-appwrite/package.json +1 -1
- package/template/packages/auth-better-auth/package.json +1 -1
- package/template/packages/auth-firebase/package.json +1 -1
- package/template/packages/auth-supabase/package.json +1 -1
- package/template/packages/cache/package.json +1 -1
- package/template/packages/cache-redis/package.json +1 -1
- package/template/packages/contract/package.json +1 -1
- package/template/packages/core/package.json +1 -1
- package/template/packages/db/package.json +1 -1
- package/template/packages/email/package.json +1 -1
- package/template/packages/email-resend/package.json +1 -1
- package/template/packages/email-smtp/package.json +1 -1
- package/template/packages/jobs/package.json +1 -1
- package/template/packages/jobs-bullmq/package.json +1 -1
- package/template/packages/jobs-inngest/package.json +1 -1
- package/template/packages/jobs-pg-boss/package.json +1 -1
- package/template/packages/local-db/package.json +1 -1
- package/template/packages/observability/package.json +1 -1
- package/template/packages/observability-otel/package.json +1 -1
- package/template/packages/observability-sentry/package.json +1 -1
- package/template/packages/payments/package.json +1 -1
- package/template/packages/payments-stripe/package.json +1 -1
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage-s3/package.json +1 -1
- package/template/packages/storage-supabase/package.json +1 -1
- package/template/packages/ui/package.json +1 -1
- package/template.lock.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `create-clubedge-app` are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.41.1
|
|
6
|
+
|
|
7
|
+
- Default to Starter `v0.26.1` (#130): new projects' weekly upgrade workflow opens its pull request when the upgrade leaves conflict markers in a `package.json`, listing them, instead of stopping without one. It runs `upgrade --detailed-exit-code`, from 0.41.0. Existing projects get the workflow through their next upgrade pull request.
|
|
8
|
+
|
|
5
9
|
## 0.41.0
|
|
6
10
|
|
|
7
11
|
- **A `package.json` with conflict markers no longer breaks the next commands** (#122, by @NishilRathod; issue #111):
|
package/README.md
CHANGED
|
@@ -141,7 +141,7 @@ They meet at one HTTP contract, `packages/contract/openapi.yaml`: the frontend c
|
|
|
141
141
|
|
|
142
142
|
With `--auth supabase`, the Vite app owns the browser session and attaches its access token to contract requests. Hono or FastAPI verifies that token with Supabase Auth and returns the contract's shared user shape. Configure `VITE_SUPABASE_URL`, `VITE_SUPABASE_PUBLISHABLE_KEY`, `SUPABASE_URL`, and `SUPABASE_PUBLISHABLE_KEY` in the generated env examples; no Supabase service-role key goes to the browser.
|
|
143
143
|
|
|
144
|
-
With the Hono API, the decoupled stacks support every module option the full-stack frameworks do (since Starter v0.26.
|
|
144
|
+
With the Hono API, the decoupled stacks support every module option the full-stack frameworks do (since Starter v0.26.1), each running in the API with the matching UI in the frontend; with FastAPI, they support Supabase Auth, Better Auth, Firebase, Appwrite, or `none`, plus memory cache. Both work with any local infrastructure (the API's `apps/api/.env.local` holds `DATABASE_URL`, since the API owns the database), and Docker or Railway deployment. With Docker, `pnpm clubedge deploy` writes a `compose.yaml` that builds the frontend and API as separate services; copy the variables of `.env.example` and `apps/api/.env.example` to `.env.production`, fill in their values, and run `docker compose --env-file .env.production up --build -d`. The frontend's `VITE_*` values are build arguments, compiled into its bundle; with Better Auth, its Node server also gets the auth variables (`DATABASE_URL`, `BETTER_AUTH_SECRET`, `BETTER_AUTH_URL`, and the email settings). With Railway, deploy provisions a public frontend and a private API, wires the frontend proxy to the API, and runs migrations before releasing the API. See [docs/stack-packs.md](docs/stack-packs.md) for how stacks and deployment facts are described.
|
|
145
145
|
|
|
146
146
|
## Choosing modules
|
|
147
147
|
|
|
@@ -207,7 +207,7 @@ pnpm dlx @clubedge/create-clubedge-app my-app --yes --no-git --framework tanstac
|
|
|
207
207
|
pnpm dlx @clubedge/create-clubedge-app my-app --ref main
|
|
208
208
|
|
|
209
209
|
# Reproduce a specific Starter release or commit
|
|
210
|
-
pnpm dlx @clubedge/create-clubedge-app my-app --ref v0.26.
|
|
210
|
+
pnpm dlx @clubedge/create-clubedge-app my-app --ref v0.26.1
|
|
211
211
|
pnpm dlx @clubedge/create-clubedge-app my-app --ref <commit-sha>
|
|
212
212
|
|
|
213
213
|
# Test local Starter changes before releasing them
|
|
@@ -226,7 +226,7 @@ pnpm clubedge add email resend payments stripe # several modules as
|
|
|
226
226
|
pnpm clubedge remove storage payments
|
|
227
227
|
pnpm dlx @clubedge/create-clubedge-app add infra local --dry-run
|
|
228
228
|
pnpm dlx @clubedge/create-clubedge-app@latest upgrade # to the newest CLI's Starter release
|
|
229
|
-
pnpm dlx @clubedge/create-clubedge-app upgrade --ref v0.26.
|
|
229
|
+
pnpm dlx @clubedge/create-clubedge-app upgrade --ref v0.26.1 # or a specific tag, branch, or commit
|
|
230
230
|
```
|
|
231
231
|
|
|
232
232
|
The CLI renders the project twice, from the Starter commit and modules recorded in your `package.json` and from the new state, and merges the difference into your project. The new state has other modules for `add` and `remove`, and the newer Starter with the same modules for `upgrade`. Modules a newer Starter introduces start as `none` where possible, so an upgrade never adds a service on its own.
|
|
@@ -341,27 +341,27 @@ Projects created with `--infra neon` also have `.github/workflows/preview.yml`,
|
|
|
341
341
|
Each CLI release is tested against one specific Starter release:
|
|
342
342
|
|
|
343
343
|
```text
|
|
344
|
-
create-clubedge-app v0.41.
|
|
344
|
+
create-clubedge-app v0.41.1
|
|
345
345
|
|
|
|
346
346
|
v
|
|
347
|
-
Clubedge Starter v0.26.
|
|
348
|
-
commit
|
|
347
|
+
Clubedge Starter v0.26.1
|
|
348
|
+
commit 93429784e265c9dc8eb8f8c87169e7b42732719f
|
|
349
349
|
```
|
|
350
350
|
|
|
351
351
|
The current relationship is:
|
|
352
352
|
|
|
353
353
|
| CLI release | Default Starter release | Meaning |
|
|
354
354
|
| --- | --- | --- |
|
|
355
|
-
| `create-clubedge-app@0.41.
|
|
355
|
+
| `create-clubedge-app@0.41.1` | `clubedge-starter@v0.26.1` | The CLI's required, tested default |
|
|
356
356
|
|
|
357
357
|
This means the same CLI version always scaffolds the same Starter revision by default. The CLI does not silently follow Starter `main`.
|
|
358
358
|
|
|
359
|
-
The `v0.26.
|
|
360
|
-
`
|
|
359
|
+
The `v0.26.1` tag is expected to resolve to commit
|
|
360
|
+
`93429784e265c9dc8eb8f8c87169e7b42732719f`. The CLI verifies this before
|
|
361
361
|
scaffolding with the default reference and fails rather than silently using a
|
|
362
362
|
moved tag.
|
|
363
363
|
|
|
364
|
-
When the Starter changes, its maintainers first publish a new versioned release, such as `v0.26.
|
|
364
|
+
When the Starter changes, its maintainers first publish a new versioned release, such as `v0.26.1`. The CLI is then updated to use that release, all generated-project checks must pass, and a new CLI version is published. This keeps Starter and CLI releases independently versioned while preserving a tested compatibility relationship.
|
|
365
365
|
|
|
366
366
|
Every generated project records its CLI version, Starter repository, Starter ref, Starter commit, framework, and modules in `package.json` and `README.md`.
|
|
367
367
|
|
|
@@ -416,7 +416,7 @@ CI packs the CLI with `npm pack`, scaffolds clean projects from the packed tarba
|
|
|
416
416
|
1. Make and validate changes in `clubedge-starter`.
|
|
417
417
|
2. Run lint, typecheck, unit tests, browser tests, and production build.
|
|
418
418
|
3. Update the Starter package versions.
|
|
419
|
-
4. Commit `main`, create a release tag such as `v0.26.
|
|
419
|
+
4. Commit `main`, create a release tag such as `v0.26.1`, and publish the Starter release.
|
|
420
420
|
|
|
421
421
|
### CLI maintainers
|
|
422
422
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clubedge/create-clubedge-app",
|
|
3
|
-
"version": "0.41.
|
|
3
|
+
"version": "0.41.1",
|
|
4
4
|
"description": "Create React apps from Clubedge Starter with a CLI or local MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.9.0",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"clubedge": {
|
|
26
26
|
"starterRepository": "Clubedge/clubedge-starter",
|
|
27
|
-
"starterRef": "v0.26.
|
|
28
|
-
"starterCommit": "
|
|
27
|
+
"starterRef": "v0.26.1",
|
|
28
|
+
"starterCommit": "93429784e265c9dc8eb8f8c87169e7b42732719f"
|
|
29
29
|
},
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"repository": {
|
|
@@ -37,14 +37,50 @@ jobs:
|
|
|
37
37
|
id: upgrade
|
|
38
38
|
shell: bash
|
|
39
39
|
run: |
|
|
40
|
-
|
|
40
|
+
# A field of `clubedge` in package.json, read with fs: while a package.json has conflict
|
|
41
|
+
# markers, require() fails for every file in the project, and pnpm cannot read it. After
|
|
42
|
+
# an upgrade that left them, the Starter's version saved in .clubedge/incoming has the
|
|
43
|
+
# new values; pass it as the fallback.
|
|
44
|
+
starter_field() {
|
|
45
|
+
node -e '
|
|
46
|
+
const fs = require("node:fs");
|
|
47
|
+
const [field, fallback] = process.argv.slice(1);
|
|
48
|
+
const read = (file) => JSON.parse(fs.readFileSync(file, "utf8"));
|
|
49
|
+
let manifest;
|
|
50
|
+
try {
|
|
51
|
+
manifest = read("package.json");
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (!fallback) {
|
|
54
|
+
console.error(`package.json could not be read (${error.message}). Fix it on the default branch, then run this workflow again.`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
manifest = read(fallback);
|
|
59
|
+
} catch {
|
|
60
|
+
console.error(`Neither package.json nor ${fallback} could be read after the upgrade.`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
console.log(manifest.clubedge?.[field] ?? "");
|
|
65
|
+
' "$@"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
before=$(starter_field starterRef)
|
|
41
69
|
if [ -z "$before" ]; then
|
|
42
70
|
echo "package.json records no Starter release: this project was not created by create-clubedge-app."
|
|
43
71
|
exit 1
|
|
44
72
|
fi
|
|
45
|
-
# The newest CLI upgrades to the Starter release it is pinned to.
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
# The newest CLI upgrades to the Starter release it is pinned to. With
|
|
74
|
+
# --detailed-exit-code it exits with 2 when the upgrade left conflicts to resolve, which
|
|
75
|
+
# the pull request lists; any other failure stops here.
|
|
76
|
+
status=0
|
|
77
|
+
pnpm dlx @clubedge/create-clubedge-app@latest upgrade --no-install --detailed-exit-code 2>&1 | tee "$RUNNER_TEMP/upgrade.log" || status=$?
|
|
78
|
+
if [ "$status" -ne 0 ] && [ "$status" -ne 2 ]; then
|
|
79
|
+
echo "The upgrade failed (exit code $status); nothing was pushed."
|
|
80
|
+
exit "$status"
|
|
81
|
+
fi
|
|
82
|
+
after=$(starter_field starterRef .clubedge/incoming/package.json)
|
|
83
|
+
repository=$(starter_field starterRepository .clubedge/incoming/package.json)
|
|
48
84
|
if [ "$after" = "$before" ] && [ -z "$(git status --porcelain)" ]; then
|
|
49
85
|
echo "Already on the newest Starter release, $before."
|
|
50
86
|
exit 0
|
|
@@ -54,12 +90,21 @@ jobs:
|
|
|
54
90
|
echo "$branch already exists: its pull request is open, or was closed on purpose."
|
|
55
91
|
exit 0
|
|
56
92
|
fi
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
93
|
+
conflicts=""
|
|
94
|
+
if [ "$status" -eq 2 ]; then conflicts=$(git grep -l --untracked '^<<<<<<< yours' -- . || true); fi
|
|
95
|
+
# The lockfile follows the upgraded package.json files. pnpm cannot read one with
|
|
96
|
+
# conflict markers, so the install waits until they are resolved.
|
|
97
|
+
if printf '%s\n' "$conflicts" | grep -qE '(^|/)package\.json$'; then
|
|
98
|
+
install="skipped"
|
|
99
|
+
else
|
|
100
|
+
install="updated"
|
|
101
|
+
pnpm install --no-frozen-lockfile >"$RUNNER_TEMP/install.log" 2>&1 || install="failed"
|
|
102
|
+
fi
|
|
103
|
+
printf '%s\n' "$conflicts" | sed '/^$/d' >"$RUNNER_TEMP/conflicts.txt"
|
|
60
104
|
{
|
|
61
105
|
echo "before=$before"
|
|
62
106
|
echo "after=$after"
|
|
107
|
+
echo "repository=${repository:-Clubedge/clubedge-starter}"
|
|
63
108
|
echo "branch=$branch"
|
|
64
109
|
echo "install=$install"
|
|
65
110
|
if [ -d .clubedge/incoming ]; then echo "incoming=true"; fi
|
|
@@ -79,21 +124,17 @@ jobs:
|
|
|
79
124
|
OWN_TOKEN: ${{ secrets.CLUBEDGE_UPGRADE_TOKEN != '' }}
|
|
80
125
|
BEFORE: ${{ steps.upgrade.outputs.before }}
|
|
81
126
|
AFTER: ${{ steps.upgrade.outputs.after }}
|
|
127
|
+
REPOSITORY: ${{ steps.upgrade.outputs.repository }}
|
|
82
128
|
BRANCH: ${{ steps.upgrade.outputs.branch }}
|
|
83
129
|
INSTALL: ${{ steps.upgrade.outputs.install }}
|
|
130
|
+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
84
131
|
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
|
85
132
|
run: |
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
git add --all
|
|
90
|
-
git commit --quiet --message "chore: upgrade to Clubedge Starter $AFTER"
|
|
91
|
-
git push --quiet --set-upstream origin "$BRANCH"
|
|
92
|
-
|
|
93
|
-
repository=$(node -p "require('./package.json').clubedge.starterRepository ?? 'Clubedge/clubedge-starter'")
|
|
94
|
-
conflicts=$(git grep -l '^<<<<<<< yours' -- . || true)
|
|
133
|
+
# The pull request's text is written before anything is pushed: it reads nothing from
|
|
134
|
+
# the upgraded files, whose package.json may have conflict markers.
|
|
135
|
+
conflicts=$(cat "$RUNNER_TEMP/conflicts.txt")
|
|
95
136
|
{
|
|
96
|
-
echo "Upgrades this project from Clubedge Starter \`$BEFORE\` to [\`$AFTER\`](https://github.com/$
|
|
137
|
+
echo "Upgrades this project from Clubedge Starter \`$BEFORE\` to [\`$AFTER\`](https://github.com/$REPOSITORY/releases/tag/$AFTER), with \`pnpm clubedge upgrade\`. Your own edits are merged in; files you never changed take the new version."
|
|
97
138
|
echo
|
|
98
139
|
if [ -n "$conflicts" ]; then
|
|
99
140
|
echo "### Conflicts to resolve"
|
|
@@ -105,15 +146,20 @@ jobs:
|
|
|
105
146
|
echo "The Starter's whole new version of each is in the **starter-versions** artifact of [the run]($RUN_URL), to compare with yours."
|
|
106
147
|
echo
|
|
107
148
|
fi
|
|
108
|
-
if [ "$INSTALL" = "
|
|
149
|
+
if [ "$INSTALL" = "skipped" ]; then
|
|
150
|
+
echo "### pnpm install"
|
|
151
|
+
echo
|
|
152
|
+
echo "\`pnpm install\` did not run: pnpm cannot read a \`package.json\` with conflict markers, so \`pnpm-lock.yaml\` and \`pnpm clubedge\` wait for them. Resolve the conflicts in the \`package.json\` files above, then run \`pnpm install\` and commit \`pnpm-lock.yaml\`."
|
|
153
|
+
echo
|
|
154
|
+
elif [ "$INSTALL" = "failed" ]; then
|
|
109
155
|
echo "### pnpm install"
|
|
110
156
|
echo
|
|
111
|
-
echo "\`pnpm install\` did not complete on the upgraded project,
|
|
157
|
+
echo "\`pnpm install\` did not complete on the upgraded project, so \`pnpm-lock.yaml\` is not updated. Run \`pnpm install\` to see why, then commit \`pnpm-lock.yaml\`."
|
|
112
158
|
echo
|
|
113
159
|
fi
|
|
114
160
|
echo "### Before merging"
|
|
115
161
|
echo
|
|
116
|
-
echo "- Read the [release notes](https://github.com/$
|
|
162
|
+
echo "- Read the [release notes](https://github.com/$REPOSITORY/releases/tag/$AFTER) for anything to do by hand."
|
|
117
163
|
echo "- Run \`pnpm db:migrate\` for new migrations, and your tests."
|
|
118
164
|
echo
|
|
119
165
|
echo "<details><summary>Upgrade output</summary>"
|
|
@@ -126,8 +172,21 @@ jobs:
|
|
|
126
172
|
echo
|
|
127
173
|
echo "Opened by the Starter upgrade workflow (\`.github/workflows/clubedge-upgrade.yml\`)."
|
|
128
174
|
} >"$RUNNER_TEMP/body.md"
|
|
129
|
-
|
|
130
|
-
|
|
175
|
+
|
|
176
|
+
git config user.name "github-actions[bot]"
|
|
177
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
178
|
+
git switch --create "$BRANCH"
|
|
179
|
+
git add --all
|
|
180
|
+
git commit --quiet --message "chore: upgrade to Clubedge Starter $AFTER"
|
|
181
|
+
git push --quiet --set-upstream origin "$BRANCH"
|
|
182
|
+
# A pushed branch without its pull request would make every later run skip this release,
|
|
183
|
+
# so it is deleted for the next run to try again.
|
|
184
|
+
if ! gh pr create --base "$DEFAULT_BRANCH" --head "$BRANCH" \
|
|
185
|
+
--title "chore: upgrade to Clubedge Starter $AFTER" --body-file "$RUNNER_TEMP/body.md"; then
|
|
186
|
+
echo "::error::The pull request could not be opened, so $BRANCH is deleted and the next run tries again."
|
|
187
|
+
git push --quiet origin --delete "$BRANCH" || echo "::warning::Delete $BRANCH by hand, or later runs skip $AFTER."
|
|
188
|
+
exit 1
|
|
189
|
+
fi
|
|
131
190
|
# Pull requests opened with the default token start no workflows: start CI on the branch.
|
|
132
191
|
if [ "$OWN_TOKEN" != "true" ] && [ -f .github/workflows/ci.yml ]; then
|
|
133
192
|
gh workflow run ci.yml --ref "$BRANCH" || echo "Start CI on $BRANCH by hand."
|
package/template/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clubedge/observability",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "Observability interface: error reports and spans for @clubedge/core's telemetry hooks, and an in-memory provider for tests.",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "Apache-2.0",
|
package/template.lock.json
CHANGED