okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-clean-3 (321794636): docs and history (cleanup step 3, items 3.0-3.10); release manifest and capability table with checks, history/ with pointers, link check, tools/ split, bench index; owner OK'd the wording 11-082b36e8a02

main
1.3 KiB19 linesraw
1import {test} from 'node:test';
2import assert from 'node:assert/strict';
3import {readFileSync,existsSync} from 'node:fs';
4import {resolve} from 'node:path';
5const root=resolve(import.meta.dirname,'..');
6const repo=resolve(root,'..','..');
7/* The app and the standalone server page (serve/web) each serve their own components.css. They are the same file: change both together. */
8test('serve/web/components.css is byte-identical to the app kit components.css',()=>{
9 const app=readFileSync(resolve(root,'src/styles/kit/components.css'));
10 const web=readFileSync(resolve(repo,'serve/web/components.css'));
11 assert.ok(app.equals(web),'src/styles/kit/components.css and serve/web/components.css differ; edit both with the same change');
12});
13/* A package.json script that runs a file under scripts/ must point at a file that exists (the removed sync:kit pointed at a design folder that is not in the repository). */
14test('every npm script that runs a scripts/ file points at a file that exists',()=>{
15 const scripts=JSON.parse(readFileSync(resolve(root,'package.json'),'utf8')).scripts;
16 for(const [name,command] of Object.entries(scripts)){
17  for(const m of command.matchAll(/\bnode\s+(scripts\/[\w./-]+)/g))assert.ok(existsSync(resolve(root,m[1])),`npm run ${name} runs ${m[1]}, which does not exist`);
18 }
19});