Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions .github/assets/demo.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Records .github/assets/demo.gif: `vhs .github/assets/demo.tape` from the repo root.
# Needs vhs and ttyd (e.g. `mise exec aqua:charmbracelet/vhs aqua:tsl0922/ttyd -- vhs ...`)
# and pnpm with a warm store, so the install takes a couple of seconds.
# EFFORGE_BIN (optional) points npm/npx at a local build: `EFFORGE_BIN=$PWD/dist/bin.js vhs ...`.

Output .github/assets/demo.gif

Require pnpm

Set Shell "bash"
Set FontSize 16
Set Width 1100
Set Height 860
Set Padding 20
Set Margin 0
Set WindowBar Colorful
Set BorderRadius 8
Set Theme "Catppuccin Mocha"
Set TypingSpeed 45ms
Set Framerate 24
Set WaitTimeout 90s

Hide
Type `export PS1='\[\e[2m\]$\[\e[0m\] '; cd "$(mktemp -d)"`
Enter
Type `if [ -n "$EFFORGE_BIN" ]; then npm() { [ "$1" = create ] && { shift 2; node "$EFFORGE_BIN" "$@"; return; }; command npm "$@"; }; npx() { [ "$1" = create-efforge ] && { shift; node "$EFFORGE_BIN" "$@"; return; }; command npx "$@"; }; fi; clear`
Enter
Show

Type "npm create efforge my-app"
Sleep 400ms
Enter

# Database: Cloudflare D1
Wait+Screen /Database/
Sleep 900ms
Down
Sleep 500ms
Enter
# ORM: Effect SQL
Wait+Screen /ORM/
Sleep 700ms
Down
Sleep 500ms
Enter
# Auth: Better Auth + organizations (default)
Wait+Screen /Auth/
Sleep 900ms
Enter
# Infrastructure: none
Wait+Screen /Infrastructure/
Sleep 600ms
Enter
# AI: none
Wait+Screen /AI/
Sleep 600ms
Enter
# Extras: Storage
Wait+Screen /Extras/
Sleep 600ms
Down 3
Sleep 300ms
Space
Sleep 600ms
Enter
# vhs only matches the first screenful, so the rest is timed
Sleep 2500ms
Enter
Sleep 9s

Type "cd my-app && npx create-efforge add email"
Sleep 400ms
Enter
Sleep 9s
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release
# Push a tag `vX.Y.Z` matching package.json to publish create-efforge to npm and create the GitHub
# release from that version's CHANGELOG section. npm authenticates this workflow through trusted
# publishing (OIDC): no token is stored, and provenance is attached automatically.
on:
push:
tags: ["v*"]

concurrency:
group: release
cancel-in-progress: false

permissions:
contents: write # the GitHub release
id-token: write # npm trusted publishing

env:
CI: "1"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
registry-url: https://registry.npmjs.org
- name: Tag matches package.json
run: |
version="$(node -p 'require("./package.json").version')"
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match package.json version $version"
exit 1
fi
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test
# trusted publishing needs npm 11.5.1+
- run: npm install -g npm@latest
- run: npm publish --access public
- name: GitHub release from the CHANGELOG
env:
GH_TOKEN: ${{ github.token }}
run: |
version="${GITHUB_REF_NAME#v}"
awk -v v="$version" '
$0 ~ "^## " v "( |$)" { on = 1; next }
on && /^## / { exit }
on { print }
' CHANGELOG.md > notes.md
printf '\n```sh\nnpm create efforge@%s my-app\n```\n' "$version" >> notes.md
gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file notes.md --verify-tag
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 0.2.0 (2026-10-22)

### Added

- Generated projects lint two rules that `AGENTS.md` only described before: `Effect.run*` and `ManagedRuntime.make` in test files (a local oxlint plugin, `lint/effect-tests.js`), and importing `env` from `cloudflare:workers` outside `server/cloudflare.ts`.
- Generated projects lint `typescript/no-deprecated` and `typescript/no-misused-promises`.
- The generated `AGENTS.md` has a Tests section and asks for lifecycles as tagged states. See `docs/decisions/0003-rat-stack-learnings.md`.
- `efforge list` shows every add-on, and marks the ones a project already has.
- `npm create efforge .` creates the project in the current directory. A directory that holds only `.git` counts as empty.
- `create` ends with next steps for the stack: start Postgres, run migrations, then `pnpm dev`.
- A dry run warns when the target directory isn't empty. Names npm rejects (over 214 characters, `node_modules`) and confusing ones (`test`, `src`) are refused.
- Help shows examples.

### Changed

- The `effect-ai-byok` crypto test uses `it.effect` instead of `Effect.runPromise`.
- Template forms and buttons use React's `SubmitEvent` instead of the deprecated `FormEvent`, and wrap async handlers as `() => void handler()`.
- Without a terminal (CI, pipes), a prompt that would be needed fails at once and names the flag to pass, instead of hanging.
- Ctrl-C exits with code 130. Stopping during setup lists the commands that finish it.
- pnpm is checked before the first prompt; a failed install lists the remaining steps. Unsupported Node versions get a warning, and a missing git skips git.
- The name prompt rejects a directory that isn't empty and asks again, instead of failing after the last prompt.
- Errors for incompatible flags say why (for example, auth needs a database), and unknown values say they are unknown. With `--json`, errors are JSON on stdout.
- The install shows its latest output line, and steps show how long they took. In CI or a pipe, each step prints one line.
- `add` shows a summary of new (`+`) and changed (`~`) files, warns about removed files, replaced package scripts and a dirty git tree, and lists the env vars to fill in. It runs `pnpm install` only when dependencies changed.
- `add` accepts ids in any case, suggests a fix for typos (unknown ids are an `UnknownAddon` error), says which ids to add together (database, ORM and auth), checks for pnpm before writing, and prints the database setup steps when it adds a database.
- The README is shorter, with a demo recording (`.github/assets/demo.tape`); the limits moved to `docs/limits.md`.
- The generated README explains the database setup.

### Fixed

- Duplicate `--extras` values are dropped.
- The name prompt accepts the default again after showing an error.
- `add infra/alchemy` no longer refuses to remove a `wrangler.jsonc` that only earlier `add`s changed. It compares the data and comments, not the text.
- Piping output into `head` no longer crashes with EPIPE.
- `list --cwd` with a missing directory is an error; piped `list` output keeps full descriptions.

## 0.1.0 (2026-10-19)

First release.
Expand Down
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ efforge lints and formats itself with Vite+ (`pnpm lint`, `pnpm format`, `pnpm c
- Generated-project dependency versions are exact pins in `src/versions.ts`; efforge's own dependencies are pinned in `package.json`.
- Templates live in `templates/<slot>/<option>/`, each with an `addon.json`. `pnpm pack` drops some file names (nested `package-lock.json`, `.npmrc`), so store those under another name and map them with `target`; `test/addon.test.ts` checks every template file ships.
- Design decisions are recorded in `docs/decisions/`.

## Releasing

1. Move the `Unreleased` section of `CHANGELOG.md` under `## X.Y.Z (date)` and set `version` in `package.json` to `X.Y.Z`. Merge that to `main`.
2. Tag the merge and push the tag: `git tag vX.Y.Z && git push origin vX.Y.Z`.

`.github/workflows/release.yml` then checks the tag matches `package.json`, runs typecheck, lint and tests, publishes to npm through trusted publishing (OIDC, with provenance, no stored token), and creates the GitHub release from that CHANGELOG section. The npm side is configured under the package's Settings → Trusted Publisher: GitHub Actions, `amagdy46/efforge`, workflow `release.yml`.
Loading
Loading