diff --git a/.agents/features/fabrica-release.md b/.agents/features/fabrica-release.md index f22ab3b..ec69ce4 100644 --- a/.agents/features/fabrica-release.md +++ b/.agents/features/fabrica-release.md @@ -141,7 +141,9 @@ nothing of Fabrica's. `v0.1.0`, the version every file has today. - **F11 — The page's words are copy.** `AULA.md`, `.fabrica/aula/brief.md` and `.fabrica/notes/*.md` are what a stranger reads about Rosea, like a store listing (§8). `lint:copy` scans them, so the - page never says *lonely*, never names the book, and makes no claim to heal anything. + page never says *lonely*, never names the book, and makes no claim to heal anything. The release + notes `fabrica notes` writes from commit subjects are copy too: the release's `notes-copy` step runs + `lint:copy` over `target/notes/release-notes.md` before the page is made. ## 3. Risk analysis diff --git a/.fabrica/artifex/release.yaml b/.fabrica/artifex/release.yaml index 82cd8a0..81cff1b 100644 --- a/.fabrica/artifex/release.yaml +++ b/.fabrica/artifex/release.yaml @@ -57,12 +57,15 @@ steps: - id: notes run: fabrica notes artifacts: ["target/notes/release-notes.md", "target/notes/release-notes.json"] + - id: notes-copy + needs: [notes, install] + run: pnpm lint:copy - id: shots needs: [pictures] run: fabrica aula shots artifacts: ["target/aula/aula-*.png", "target/aula/aula.json"] - id: page - needs: [notes, shots] + needs: [notes-copy, shots] run: fabrica aula page artifacts: ["target/aula/aula-page.json", "target/aula/aula-page.html"] - id: approve diff --git a/apps/rosea-tauri/test/sign-apk.test.ts b/apps/rosea-tauri/test/sign-apk.test.ts index 45a9fe6..2f226ac 100644 --- a/apps/rosea-tauri/test/sign-apk.test.ts +++ b/apps/rosea-tauri/test/sign-apk.test.ts @@ -40,15 +40,15 @@ describe('signArgs', () => { describe('custosSign', () => { it('runs the custos-sign CUSTOS_SIGN_EXE names, else the one on PATH', () => { - expect(custosSign({ CUSTOS_SIGN_EXE: 'F:\Apps\Custos\custos-sign.exe' }, () => true)).toBe('F:\Apps\Custos\custos-sign.exe'); + expect(custosSign({ CUSTOS_SIGN_EXE: 'F:\\Apps\\Custos\\custos-sign.exe' }, () => true)).toBe('F:\\Apps\\Custos\\custos-sign.exe'); expect(custosSign({}, () => true)).toBe('custos-sign.exe'); }); it('refuses a named custos-sign that is not there, rather than another one', () => { - expect(() => custosSign({ CUSTOS_SIGN_EXE: 'X:\nowhere.exe' }, () => false)).toThrow(/not there/); + expect(() => custosSign({ CUSTOS_SIGN_EXE: 'X:\\nowhere.exe' }, () => false)).toThrow(/not there/); }); it('refuses another Custos (CUSTOS_PIPE)', () => { - expect(() => custosSign({ CUSTOS_PIPE: '\\.\pipe\test' }, () => true)).toThrow(/CUSTOS_PIPE/); + expect(() => custosSign({ CUSTOS_PIPE: '\\\\.\\pipe\\test' }, () => true)).toThrow(/CUSTOS_PIPE/); }); }); diff --git a/scripts/lint-copy.ts b/scripts/lint-copy.ts index 134e183..95ed638 100644 --- a/scripts/lint-copy.ts +++ b/scripts/lint-copy.ts @@ -26,7 +26,15 @@ const TARGETS: readonly { dir: string; ext: readonly string[] }[] = [ ]; /** Single files: the page shell, the config that builds the web manifest, the Letter, and the Aula page's text. */ -const FILES: readonly string[] = ['apps/rosea/index.html', 'apps/rosea/vite.config.ts', 'docs/LETTER.md', 'AULA.md']; +const FILES: readonly string[] = [ + 'apps/rosea/index.html', + 'apps/rosea/vite.config.ts', + 'docs/LETTER.md', + 'AULA.md', + // Written by `fabrica notes` from commit subjects during a release; read when it is there, so the + // release's `notes-copy` step stops a forbidden word before it reaches the page (fabrica-release.md F11). + 'target/notes/release-notes.md' +]; function walk(dir: string, ext: readonly string[]): string[] { if (!existsSync(dir)) return []; diff --git a/tools/release/test/copy.test.ts b/tools/release/test/copy.test.ts index 1ed07b2..ac644f6 100644 --- a/tools/release/test/copy.test.ts +++ b/tools/release/test/copy.test.ts @@ -1,6 +1,7 @@ import { spawnSync } from 'node:child_process'; import { createRequire } from 'node:module'; -import { join } from 'node:path'; +import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { describe, expect, it } from 'vitest'; @@ -26,6 +27,20 @@ describe('lint:copy reads the Aula page', { timeout: 60_000 }, () => { expect(files).toContain('.fabrica/notes/0.1.0.md'); }); + it("a release's generated notes are checked when they are there", () => { + const notes = join(repo, 'target/notes/release-notes.md'); + const had = existsSync(notes); + if (!had) { + mkdirSync(dirname(notes), { recursive: true }); + writeFileSync(notes, '# notes\n'); + } + try { + expect(listed()).toContain('target/notes/release-notes.md'); + } finally { + if (!had) rmSync(notes); + } + }); + it('the game itself is still checked', () => { const files = listed(); expect(files).toContain('packages/ui/src/copy/en.ts');