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
18 changes: 16 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ jobs:
ZIP_NAME="${{ env.ZIP_NAME }}"
SHA256=$(sha256sum "$GITHUB_WORKSPACE/$ZIP_NAME" | awk '{print $1}')

MANIFEST="$GITHUB_WORKSPACE/clients/renderer/dist/manifest.json"
JS_HASH=$(jq -r '.hash' "$MANIFEST")
CSS_FILE=$(jq -r '.cssFile' "$MANIFEST")
CSS_HASH=$(basename "$CSS_FILE" .css | cut -d. -f2)
L10N_HASH=$(jq -r '.l10nHash' "$MANIFEST")

LAST="${{ steps.next.outputs.last_official }}"
if [[ "$LAST" == "none" || -z "$LAST" ]]; then
SUBJECTS=$(git log --format="%s" HEAD)
Expand Down Expand Up @@ -149,8 +155,16 @@ jobs:
echo "$FIXES" | sed 's/^/- /'
echo ""
fi
echo "---"
echo "**SHA256:** \`${SHA256}\`"
echo "### Artifact Hashes"
echo ""
echo "| Artifact | Hash |"
echo "|---|---|"
echo "| JS | \`${JS_HASH}\` |"
echo "| CSS | \`${CSS_HASH}\` |"
echo "| l10n | \`${L10N_HASH}\` |"
echo "| Data Schema | — |"
echo ""
echo "**Zip SHA256:** \`${SHA256}\`"
} > /tmp/release-notes.md

- name: Create release
Expand Down
9 changes: 6 additions & 3 deletions clients/renderer/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
extractMessageIds,
} from "@config/l10n-config"
import react from "@vitejs/plugin-react"
import { mkdir, readFile, readdir, writeFile } from "node:fs/promises"
import { mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises"
import { resolve, dirname } from "node:path"
import { defineConfig } from "vite"

Expand Down Expand Up @@ -316,6 +316,9 @@ function duplicateOutput(
}
}

if (!ifMissing) {
await rm(destRenderer, { recursive: true, force: true })
}
await mkdir(destRenderer, { recursive: true })

// copy each file as-is (preserves hashed name)
Expand Down Expand Up @@ -355,7 +358,7 @@ export default defineConfig({
),
},
build: {
emptyOutDir: false,
emptyOutDir: true,
cssCodeSplit: false,
lib: {
entry: resolve(__dirname, "src/entry.tsx"),
Expand All @@ -370,7 +373,7 @@ export default defineConfig({
manualChunks: undefined,
entryFileNames: "index.[hash].js",
chunkFileNames: "index.[hash].js",
assetFileNames: "assets/[name].[hash][extname]",
assetFileNames: "[name].[hash][extname]",
},
},
target: "es2020",
Expand Down
4 changes: 1 addition & 3 deletions common/types/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ export type AppRenderManifest = {
l10nHash?: string
/** Path to the baseline FTL artifact, relative to the renderer's served directory. */
baselineFtlFile?: string
/** Base path for resolving additional assets (images, fonts, etc.). */
assetsBase?: string
/** Path to the data schema artifact, relative to the renderer's served directory. */
/** Path to the data schema artifact, relative to the renderer's served directory. */
schemaFile?: string
/** Whether this manifest was loaded from cache. */
isCached?: boolean
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/api-surfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Reference implementation of the coordinator role. In production, this behavior m
| `mountRendererFromUrl(url, options)` | Loads renderer JS and mounts into DOM |
| `fetchRemoteManifest()` | Fetches latest manifest from remote (no-store) |
| `validateRendererModule(url)` | Loads renderer without mounting — structural validation |
| `cacheRenderer(manifest, assetsBase)` | Writes manifest + JS + CSS to Cache API |
| `cacheRenderer(manifest)` | Writes manifest + JS + CSS to Cache API |
| `getCachedRenderer()` | Reads and validates cached renderer from Cache API |

### Data cache (`data-cache.ts`)
Expand Down Expand Up @@ -100,7 +100,7 @@ Shared type definitions used across all packages. Defined in `common/types/index

| Type | Purpose |
|------|---------|
| `AppRenderManifest` | Renderer build metadata: version, buildTime, file, hash, dataSchemaVersion, cssFile, assetsBase, isCached |
| `AppRenderManifest` | Renderer build metadata: version, buildTime, file, hash, dataSchemaVersion, cssFile, isCached |
| `AppProps` | Data passed to renderer mount/update: manifest, renderUpdate, isCached, isStaleData, nextHash, timeToStaleData, initialState |
| `RendererModule` | Renderer API contract: mount, update?, unmount?, version? |
| `BaselineRenderer` | Resolved renderer reference: manifest + jsUrl |
Expand Down
Loading