Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/standalone-cms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"web": patch
---

Consume the standalone CMS contract release and support cross-repository local development and browser checks.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,42 @@ jobs:
- run: bun run build
- run: bunx wrangler deploy --env staging --dry-run
- run: bunx wrangler deploy --env alpha --dry-run
browser:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
path: web
- uses: actions/setup-node@v4
with:
node-version: 24.10.0
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
working-directory: web
- name: Read pinned CMS revision
id: cms
working-directory: web
run: node scripts/cms-revision.mjs >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
with:
repository: AstrologyEngine/cms
ref: ${{ steps.cms.outputs.revision }}
path: cms
persist-credentials: false
- run: bun install --frozen-lockfile && bun run contract:build
working-directory: cms
- run: bun run sync && bun test verification
working-directory: web
- run: bunx playwright install --with-deps chromium
working-directory: web
- run: bun run test:browser
working-directory: web
- uses: actions/upload-artifact@v4
if: failure()
with:
name: local-browser-results
path: |
web/playwright-report/
web/test-results/
23 changes: 21 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,26 @@ jobs:
checks:
if: github.event_name == 'release' && github.event.release.prerelease
uses: ./.github/workflows/ci.yml
gate:
if: github.event_name == 'push' || (github.event_name == 'release' && github.event.release.prerelease)
runs-on: ubuntu-24.04
env:
CMS_DEPLOY_ENABLED: ${{ vars.CMS_DEPLOY_ENABLED }}
steps:
- name: Report CMS provisioning gate
run: |
if [ "$CMS_DEPLOY_ENABLED" != true ]; then
echo "CMS deployment is disabled pending [hosted setup #39](https://github.com/AstrologyEngine/web-issues/issues/39)." >> "$GITHUB_STEP_SUMMARY"
if [ "$GITHUB_EVENT_NAME" = release ]; then
echo "::error::Alpha release blocked: complete CMS setup #39 and enable CMS_DEPLOY_ENABLED."
exit 1
fi
else
echo "CMS deployment is enabled." >> "$GITHUB_STEP_SUMMARY"
fi
deploy:
if: always() && (github.event_name == 'push' || needs.checks.result == 'success')
needs: checks
if: vars.CMS_DEPLOY_ENABLED == 'true' && always() && needs.gate.result == 'success' && (github.event_name == 'push' || needs.checks.result == 'success')
needs: [checks, gate]
runs-on: ubuntu-24.04
environment: ${{ github.event_name == 'push' && 'staging' || 'alpha' }}
env:
Expand All @@ -38,6 +55,8 @@ jobs:
bun-version: 1.3.14
- run: bun install --frozen-lockfile
- run: bun run sync && bun run build
env:
CMS_SNAPSHOT_ORIGIN: https://cms-${{ env.TARGET }}.astrologyengine.dev
- run: bunx wrangler deploy --env "$TARGET" --dry-run
- name: Recheck current staging head
if: github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: false
jobs:
preview:
if: github.event.pull_request.head.repo.full_name == github.repository
if: github.event.pull_request.head.repo.full_name == github.repository && (github.event.action == 'closed' || vars.CMS_DEPLOY_ENABLED == 'true')
runs-on: ubuntu-24.04
timeout-minutes: 25
env:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
echo "id=$id" >> "$GITHUB_OUTPUT"
gh api -X POST "repos/$REPO/deployments/$id/statuses" -f state=in_progress
bun run sync
bun run build
CMS_SNAPSHOT_ORIGIN=https://cms-staging.astrologyengine.dev bun run build
- name: Upload preview
id: upload
if: steps.deploy.outputs.id != ''
Expand Down
1 change: 0 additions & 1 deletion .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"ignorePatterns": [
"static/engine/**",
"static/atlas/**",
"apps/**",
"docs/editorial/natal-chart-review.md"
]
}
6 changes: 1 addition & 5 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"ignorePatterns": [
"static/engine/**",
"static/calculation-worker.js",
"apps/**"
]
"ignorePatterns": ["static/engine/**", "static/calculation-worker.js"]
}
80 changes: 39 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,50 @@ Use Node 24.10.0 and Bun 1.3.14.

```sh
bun install --frozen-lockfile
(cd apps/cms && bun install --frozen-lockfile)
bun run sync
bun run dev
```

Before committing: `bun run check`, `bun run check:ts`, `bun run lint`,
`bun run format:check`, `bun run build`, both environment dry runs, and
Web can install, check and build independently. Without a running CMS, local
requests use baseline copy bundled from the pinned contract package.

For both services, clone [AstrologyEngine/cms](https://github.com/AstrologyEngine/cms)
as sibling `../cms` and run:

```sh
bun run dev:stack
# Other checkout/ports:
CMS_REPO_PATH=/path/to/cms WEB_PORT=5174 CMS_PORT=8789 bun run dev:stack
```

The launcher installs frozen dependencies, migrates/seeds persistent local D1,
watches and temporarily links the local contract, and starts CMS then web.
Ctrl+C stops its processes and restores the pinned package. Each service can
also run separately: start CMS there, then set `CMS_ORIGIN` when starting web
(default `http://127.0.0.1:8787`). `scripts/review.sh` runs checks and browser
tests before starting the same stack; `--serve` starts it without checks.

Before committing: `bun run sync`, `bun run check`, `bun run check:ts`,
`bun run lint`, `bun run format:check`, `node --test scripts/*.test.mjs`,
`bun test verification`, `bun run build`, both environment dry runs and
`bun run test:browser` (install Chromium with `bunx playwright install chromium`).

## CMS copy

The [CMS Worker](apps/cms/README.md) stores website text and reference content.
See the [design](docs/designs/cms.md), [plan](docs/plans/cms.md) and
[operations runbook](docs/runbooks/cms.md).

Start `bun run dev:e2e` in `apps/cms` in a separate terminal for a fresh local
CMS on port 8787. The web server uses `CMS_ORIGIN` (default
`http://127.0.0.1:8787`); deployed Workers use the `CMS` service binding.
The server negotiates `?lang`, the language cookie and `Accept-Language`.
A language switcher appears when multiple locales are enabled.

Dev and build generate outage snapshots in `static/content/` from the English
seed. Set `CMS_SNAPSHOT_ORIGIN` to the target CMS for deployed builds; a failed
snapshot fetch fails the build. Provision and seed the CMS before deploying the
web service binding, following the runbook. Remote database IDs are placeholders.

The imported toolchain uses SvelteKit 2.59.1, Cloudflare adapter 7.2.9 and the
official Svelte compiler, with oxfmt and Prettier for formatting. Node and Bun
pins remain unchanged.

Run `node --test scripts/*.test.mjs` and `bun test verification` alongside the
web checks above. Run `test`, `check`, `lint` and `format:check` in `apps/cms`.
Browser tests start two local CMS instances and three web servers to cover
English, a partial pseudo-locale and CMS outages. `PLAYWRIGHT_PORT` changes the
base web port; `E2E_BASE_URL` uses an existing server;
`PLAYWRIGHT_CHROMIUM_EXECUTABLE` optionally selects a local Chromium executable.

## Local review runner

With Node 24.10.0 and Bun 1.3.14 on PATH, run `./scripts/review.sh` to install
locked dependencies, validate both applications, run browser tests, and start
the local web/CMS stack with manual review steps. Use `./scripts/review.sh --serve`
to skip checks and start the stack. Ctrl+C stops its services.

`REVIEW_WEB_PORT`, `REVIEW_CMS_PORT`, and `PLAYWRIGHT_PORT` configure ports.
Set `PLAYWRIGHT_CHROMIUM_EXECUTABLE` to use an existing Chromium; otherwise the
runner downloads it. On Linux, missing browser system libraries require a
one-time `bunx playwright install-deps chromium` installation with administrator
access. The runner itself does not install system packages.
[CMS](https://github.com/AstrologyEngine/cms) owns website copy, the typed
catalog, locale helpers and baseline English seed. Web pins
`@astrologyengine/cms-contract` to an exact public GitHub release asset.

New keys: update and release CMS, deploy/seed it, then update web's dependency
URL and lockfile before using those keys. Ordinary content edits use the CMS
admin API and need no web release. See the
[CMS runbook](https://github.com/AstrologyEngine/cms/blob/main/docs/runbooks/cms.md).

Builds bundle outage snapshots from the package's baseline seed by default.
`CMS_SNAPSHOT_ORIGIN` fetches all enabled locales from a live CMS; fetch errors
fail the build. Deployed builds always use their target CMS origin.

Browser tests require a CMS checkout and use isolated databases for English,
a partial pseudo-locale and CMS outages. `CMS_REPO_PATH` overrides the sibling
path; `PLAYWRIGHT_PORT` changes test ports. `E2E_BASE_URL` tests an existing site
without a local CMS checkout. See [extraction details](docs/cms-extraction.md).
2 changes: 0 additions & 2 deletions apps/cms/.dev.vars.example

This file was deleted.

5 changes: 0 additions & 5 deletions apps/cms/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions apps/cms/.oxfmtrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions apps/cms/.oxlintrc.json

This file was deleted.

87 changes: 0 additions & 87 deletions apps/cms/README.md

This file was deleted.

Loading
Loading