Skip to content
- Create the file under
apps/cosmos/digital-services/src/pages/ using existing naming conventions (index.astro for directory index, nested folders for URL segments).
- Wrap with
Layout.astro unless you have a deliberate exception (e.g. minimal layout for a special case).
- Set title and description so SEO components (
SeoHead / layout contract) get explicit values for non-generic pages.
- Reuse shared packages (
@cosmos/ui-astro, @cosmos/theme, etc.) before adding new app-local components.
- If the route must be protected (under
/portal or /admin):
- Confirm the path prefix is listed in
PROTECTED_PATH_PREFIXES in wrangler.gateway.toml.
- Confirm Wrangler
routes include that host’s /portal* or /admin* patterns.
- Do not rely on “hiding” the link—edge enforcement is what matters.
- If the page calls a worker or third-party API from the browser, check
public/_headers CSP: connect-src, form-action, and related directives must allow the origin.
- Tests:
- Add or update Jest tests for non-trivial page or script behavior (
src/__tests__/).
- Add or update Playwright specs for meaningful user-visible flows (
e2e/).
- Quality gates before merge (from repo root):
yarn workspace cosmos-digital-services lint
yarn workspace cosmos-digital-services test:unit
- Relevant
yarn workspace cosmos-digital-services test:e2e (or full test if you own the whole change).