[tauri] AtriumManifest: Ship domi-app.toml beside rosea-shell.exe for Atrium Domi, built from the name and version; 27 hostile fixtures refused with the parser's codes; no door, by the author's ruling
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
"type": "module",
|
||||
"description": "The Tauri 2 shell: the Android, iOS and desktop apps around apps/rosea's built game (dist-tauri/). Imports no package.",
|
||||
"scripts": {
|
||||
"dev": "tsx scripts/icons.ts && tauri dev",
|
||||
"build:desktop": "tsx scripts/icons.ts && tauri build",
|
||||
"dev": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri dev",
|
||||
"build:desktop": "tsx scripts/icons.ts && tsx scripts/domi-app.ts && tauri build",
|
||||
"build:android": "tsx scripts/android.ts prepare && tauri android build --debug --apk --target aarch64 && tsx scripts/android.ts verify",
|
||||
"build:android-release": "tsx scripts/android.ts prepare && tauri android build --apk --target aarch64 && tsx scripts/android.ts verify src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk",
|
||||
"sign:apk": "tsx scripts/sign-apk.ts",
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* The `domi-app.toml` that lets Atrium Domi show Rosea Domi in its grid (Atrium docs/APP_CONTRACT.md v0, §2–3;
|
||||
* .agents/features/atrium-adoption.md). It is made before every desktop build from the name constants and the game's
|
||||
* version, so the name stays in its three places (CLAUDE.md, header) and the version in Fabrica's four files
|
||||
* (scripts/check-version.mjs). It is build output, never committed. `tauri.windows.conf.json` puts it next to the
|
||||
* `.exe`, with the icon it names.
|
||||
*
|
||||
* tsx scripts/domi-app.ts writes src-tauri/atrium/domi-app.toml
|
||||
*
|
||||
* This is a static file only. Rosea reads nothing of Atrium's and calls nothing; the door (APP_CONTRACT §4–5) waits
|
||||
* on the author (atrium-adoption.md R4). What APP_CONTRACT §7 says may still change is kept here, in `ATRIUM`.
|
||||
*/
|
||||
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { PRODUCT_NAME, PRODUCT_SHORT_NAME } from '../../../packages/schema/src/constants.js';
|
||||
import { PACKAGE, SRC_TAURI } from './tauri.js';
|
||||
|
||||
/** What the Atrium contract fixes today and may move before its v1 (APP_CONTRACT §2.2, §7). */
|
||||
export const ATRIUM = {
|
||||
needs: { fundamentum: '>=0.7', atrium: '>=0.1' },
|
||||
/** The icon, beside the `.exe`: the shell's own 256 px icon, made from apps/rosea/public/icon.svg (a placeholder). */
|
||||
icon: { file: 'domi-icon.png', from: 'icons/128x128@2x.png' }
|
||||
} as const;
|
||||
|
||||
/** The file, relative to src-tauri/, that `tauri.windows.conf.json` bundles. */
|
||||
export const MANIFEST = 'atrium/domi-app.toml';
|
||||
|
||||
export interface DomiApp {
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
readonly label: string;
|
||||
readonly version: string;
|
||||
readonly accent: string;
|
||||
readonly icon: string;
|
||||
readonly hostable: boolean;
|
||||
readonly free: boolean;
|
||||
readonly needs: { readonly fundamentum: string; readonly atrium: string };
|
||||
}
|
||||
|
||||
export function domiApp(version: string): DomiApp {
|
||||
return {
|
||||
// The Aula project and the Canalis id; it changes with the name, in the same commit.
|
||||
id: PRODUCT_SHORT_NAME.toLowerCase(),
|
||||
name: PRODUCT_NAME,
|
||||
// One plain word for what she is (atrium-adoption.md §2.4, a judgment).
|
||||
label: 'Rose',
|
||||
version,
|
||||
// --rose on the dark theme (packages/ui/src/tokens.css): Atrium Domi's window is dark, and its catalogue names
|
||||
// the same colour for Rosea (Fundamentum crates/atrium-registry/src/catalogue.rs).
|
||||
accent: '#e8899b',
|
||||
icon: ATRIUM.icon.file,
|
||||
// Day 4 waits on R1: hosted, she must keep her own window and origin, or her rose seems gone.
|
||||
hostable: false,
|
||||
// Rosea needs no licence (APP_CONTRACT §2.2: "true if your app needs no licence").
|
||||
free: true,
|
||||
needs: ATRIUM.needs
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* A TOML basic string. Every value here is ours; the escape keeps a later one honest: a quote, a backslash or a
|
||||
* line break can never end the string and start a key.
|
||||
*/
|
||||
const str = (s: string): string =>
|
||||
// eslint-disable-next-line no-control-regex -- finding control characters is the point
|
||||
`"${s.replace(/[\\"\u0000-\u001f\u007f]/g, (c) =>
|
||||
c === '\\' || c === '"' ? `\\${c}` : `\\u${c.charCodeAt(0).toString(16).padStart(4, '0')}`
|
||||
)}"`;
|
||||
|
||||
export function toToml(m: DomiApp): string {
|
||||
return [
|
||||
`id = ${str(m.id)}`,
|
||||
`name = ${str(m.name)}`,
|
||||
`label = ${str(m.label)}`,
|
||||
`version = ${str(m.version)}`,
|
||||
`accent = ${str(m.accent)}`,
|
||||
`icon = ${str(m.icon)}`,
|
||||
`hostable = ${String(m.hostable)}`,
|
||||
`free = ${String(m.free)}`,
|
||||
`needs = { fundamentum = ${str(m.needs.fundamentum)}, atrium = ${str(m.needs.atrium)} }`,
|
||||
''
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
/** The game's version: the installer's own (tauri.conf.json reads the same file). */
|
||||
export function gameVersion(): string {
|
||||
const pkg = JSON.parse(readFileSync(join(PACKAGE, '..', 'rosea', 'package.json'), 'utf8')) as { version: string };
|
||||
return pkg.version;
|
||||
}
|
||||
|
||||
if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
||||
mkdirSync(join(SRC_TAURI, 'atrium'), { recursive: true });
|
||||
writeFileSync(join(SRC_TAURI, MANIFEST), toToml(domiApp(gameVersion())), 'utf8');
|
||||
console.log(`domi-app.toml: written for Atrium Domi (${MANIFEST})`);
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"bundle": {
|
||||
"targets": ["nsis"],
|
||||
"resources": { "atrium/domi-app.toml": "domi-app.toml", "icons/128x128@2x.png": "domi-icon.png" },
|
||||
"windows": { "nsis": { "installerHooks": "./windows/hooks.nsh" } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
/**
|
||||
* Atrium Domi's rules for a `domi-app.toml` (Atrium docs/APP_CONTRACT.md v0 §2), as a test helper. The real parser is
|
||||
* Rust (`atrium_registry::parse_manifest`, Fundamentum). APP_CONTRACT §6 asks an app that cannot use it "at least" to
|
||||
* check its file against §2. The rules are checked in the parser's order, so a hostile file gets the reason code
|
||||
* the parser gives. That agreement was measured once against the parser itself (review of `feature/atrium-door`).
|
||||
*
|
||||
* The TOML reader takes only what a manifest needs: `key = value` lines, comments, basic strings, booleans, decimal
|
||||
* integers (so `format = 2` is `unknown_key`, as in the parser), one-line inline tables and arrays of strings. Anything else is `not_toml`. That is stricter than TOML, which is safe for
|
||||
* Rosea's own file; `toml` 1.x would accept some files this refuses.
|
||||
*/
|
||||
export interface Refusal {
|
||||
readonly field: string | null;
|
||||
readonly reason: string;
|
||||
}
|
||||
|
||||
type Value = string | boolean | number | readonly string[] | { readonly [k: string]: Value };
|
||||
|
||||
const MAX_MANIFEST = 16_384;
|
||||
|
||||
class NotToml extends Error {}
|
||||
|
||||
function readString(s: string, at: number): [string, number] {
|
||||
if (s[at] !== '"') throw new NotToml();
|
||||
let out = '';
|
||||
let i = at + 1;
|
||||
while (i < s.length) {
|
||||
const c = s[i]!;
|
||||
if (c === '"') return [out, i + 1];
|
||||
if (c === '\\') {
|
||||
const e = s[i + 1];
|
||||
const simple: Record<string, string> = { '"': '"', '\\': '\\', n: '\n', t: '\t', r: '\r', b: '\b', f: '\f' };
|
||||
if (e && e in simple) {
|
||||
out += simple[e];
|
||||
i += 2;
|
||||
} else if (e === 'u' || e === 'U') {
|
||||
const len = e === 'u' ? 4 : 8;
|
||||
const hex = s.slice(i + 2, i + 2 + len);
|
||||
if (!/^[0-9a-fA-F]+$/.test(hex) || hex.length !== len) throw new NotToml();
|
||||
out += String.fromCodePoint(parseInt(hex, 16));
|
||||
i += 2 + len;
|
||||
} else throw new NotToml();
|
||||
} else if (c === '\n' || (c.charCodeAt(0) < 0x20 && c !== '\t') || c === '\x7f') {
|
||||
throw new NotToml();
|
||||
} else {
|
||||
out += c;
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
throw new NotToml();
|
||||
}
|
||||
|
||||
const skip = (s: string, at: number): number => {
|
||||
let i = at;
|
||||
while (s[i] === ' ' || s[i] === '\t') i += 1;
|
||||
return i;
|
||||
};
|
||||
|
||||
function readValue(s: string, at: number): [Value, number] {
|
||||
const i = skip(s, at);
|
||||
if (s[i] === '"') return readString(s, i);
|
||||
if (s.startsWith('true', i)) return [true, i + 4];
|
||||
if (s.startsWith('false', i)) return [false, i + 5];
|
||||
const int = /^[+-]?(0|[1-9][0-9]*)(?![0-9A-Za-z._:])/.exec(s.slice(i));
|
||||
if (int) return [Number(int[0]), i + int[0].length];
|
||||
if (s[i] === '[') {
|
||||
const items: string[] = [];
|
||||
let j = skip(s, i + 1);
|
||||
if (s[j] === ']') return [items, j + 1];
|
||||
for (;;) {
|
||||
const [v, k] = readString(s, skip(s, j));
|
||||
items.push(v);
|
||||
j = skip(s, k);
|
||||
if (s[j] === ']') return [items, j + 1];
|
||||
if (s[j] !== ',') throw new NotToml();
|
||||
j += 1;
|
||||
}
|
||||
}
|
||||
if (s[i] === '{') {
|
||||
const table: Record<string, Value> = {};
|
||||
let j = skip(s, i + 1);
|
||||
if (s[j] === '}') return [table, j + 1];
|
||||
for (;;) {
|
||||
const key = /^[A-Za-z0-9_-]+/.exec(s.slice(skip(s, j)))?.[0];
|
||||
if (!key) throw new NotToml();
|
||||
j = skip(s, skip(s, j) + key.length);
|
||||
if (s[j] !== '=') throw new NotToml();
|
||||
const [v, k] = readValue(s, j + 1);
|
||||
if (key in table) throw new NotToml();
|
||||
table[key] = v;
|
||||
j = skip(s, k);
|
||||
if (s[j] === '}') return [table, j + 1];
|
||||
if (s[j] !== ',') throw new NotToml();
|
||||
j += 1;
|
||||
}
|
||||
}
|
||||
throw new NotToml();
|
||||
}
|
||||
|
||||
function readToml(text: string): Record<string, Value> {
|
||||
const table: Record<string, Value> = {};
|
||||
for (const raw of text.split('\n')) {
|
||||
const line = raw.endsWith('\r') ? raw.slice(0, -1) : raw;
|
||||
const start = skip(line, 0);
|
||||
if (start === line.length || line[start] === '#') continue;
|
||||
const key = /^[A-Za-z0-9_-]+/.exec(line.slice(start))?.[0];
|
||||
if (!key) throw new NotToml();
|
||||
let i = skip(line, start + key.length);
|
||||
if (line[i] !== '=') throw new NotToml();
|
||||
const [v, end] = readValue(line, i + 1);
|
||||
i = skip(line, end);
|
||||
if (i !== line.length && line[i] !== '#') throw new NotToml();
|
||||
if (key in table) throw new NotToml();
|
||||
table[key] = v;
|
||||
}
|
||||
return table;
|
||||
}
|
||||
|
||||
type Kind = 'str' | 'bool' | 'table' | 'array' | 'other';
|
||||
const KEYS: readonly (readonly [string, Kind, boolean])[] = [
|
||||
['id', 'str', true],
|
||||
['name', 'str', true],
|
||||
['label', 'str', true],
|
||||
['version', 'str', true],
|
||||
['accent', 'str', true],
|
||||
['icon', 'str', false],
|
||||
['ui_bundle', 'str', false],
|
||||
['hostable', 'bool', true],
|
||||
['free', 'bool', true],
|
||||
['needs', 'table', true],
|
||||
['capabilities', 'array', false]
|
||||
];
|
||||
const kindOf = (v: Value): Kind =>
|
||||
typeof v === 'string' ? 'str' : typeof v === 'boolean' ? 'bool' : typeof v === 'number' ? 'other' : Array.isArray(v) ? 'array' : 'table';
|
||||
|
||||
// SemVer 2.0 (semver.org's regular expression).
|
||||
const SEMVER =
|
||||
/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
||||
// The part of Cargo's requirement syntax this file uses: comparators like `>=0.7`, comma-separated.
|
||||
const SEMVER_REQ = /^\s*(?:[=><~^]|>=|<=)?\s*\d+(?:\.\d+){0,2}(?:\s*,\s*(?:[=><~^]|>=|<=)?\s*\d+(?:\.\d+){0,2})*\s*$/;
|
||||
// eslint-disable-next-line no-control-regex -- APP_CONTRACT §2.2's control characters, on purpose
|
||||
const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
|
||||
const BIDI = /[--]/;
|
||||
const DEVICE = /^(con|prn|aux|nul|com[0-9]|lpt[0-9]|conin\$|conout\$)$/i;
|
||||
|
||||
function text(field: string, value: string, max: number): Refusal | null {
|
||||
const chars = [...value].length;
|
||||
if (chars === 0) return { field, reason: 'empty' };
|
||||
if (chars > max) return { field, reason: 'too_long' };
|
||||
if (CONTROL.test(value)) return { field, reason: 'control_char' };
|
||||
if (BIDI.test(value)) return { field, reason: 'bidi_char' };
|
||||
if (value.trim() !== value) return { field, reason: 'edge_space' };
|
||||
return null;
|
||||
}
|
||||
|
||||
function relPath(p: string): string | null {
|
||||
if (p.length === 0) return 'path_empty';
|
||||
if (new TextEncoder().encode(p).length > 255) return 'path_too_long';
|
||||
if (p.includes('\0')) return 'path_nul';
|
||||
if (p.includes('\\')) return 'path_backslash';
|
||||
if (p.startsWith('/')) return 'path_absolute';
|
||||
if (p.includes(':')) return 'path_colon';
|
||||
if (p.includes('..')) return 'path_dotdot';
|
||||
const parts = p.split('/');
|
||||
if (parts.some((c) => c === '' || c === '.')) return 'path_component';
|
||||
if (parts.some((c) => c.endsWith('.') || c.endsWith(' '))) return 'path_trailing';
|
||||
if (parts.some((c) => DEVICE.test(c.split('.')[0]!))) return 'path_reserved';
|
||||
if (!/^[A-Za-z0-9\-_./ %+()]+$/.test(p)) return 'path_char';
|
||||
return null;
|
||||
}
|
||||
|
||||
/** `null` when Atrium Domi would accept the file, else the first rule it breaks. */
|
||||
export function checkManifest(bytes: Uint8Array): Refusal | null {
|
||||
if (bytes.length > MAX_MANIFEST) return { field: null, reason: 'too_large' };
|
||||
let source: string;
|
||||
try {
|
||||
source = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
||||
} catch {
|
||||
// Invalid UTF-8 is the answer itself, not an error to report.
|
||||
return { field: null, reason: 'not_utf8' };
|
||||
}
|
||||
let t: Record<string, Value>;
|
||||
try {
|
||||
t = readToml(source);
|
||||
} catch (e) {
|
||||
if (e instanceof NotToml) return { field: null, reason: 'not_toml' };
|
||||
throw e;
|
||||
}
|
||||
if (Object.keys(t).some((k) => !KEYS.some(([name]) => name === k))) return { field: null, reason: 'unknown_key' };
|
||||
for (const [key, kind, required] of KEYS) {
|
||||
const v = t[key];
|
||||
if (v === undefined) {
|
||||
if (required) return { field: key, reason: 'missing' };
|
||||
} else if (kindOf(v) !== kind) return { field: key, reason: 'wrong_type' };
|
||||
}
|
||||
const needs = t['needs'] as Record<string, Value>;
|
||||
if (Object.keys(needs).some((k) => k !== 'fundamentum' && k !== 'atrium')) return { field: 'needs', reason: 'unknown_key' };
|
||||
for (const k of ['fundamentum', 'atrium']) {
|
||||
if (needs[k] === undefined) return { field: 'needs', reason: 'missing' };
|
||||
if (typeof needs[k] !== 'string') return { field: 'needs', reason: 'wrong_type' };
|
||||
}
|
||||
const caps = (t['capabilities'] ?? []) as readonly Value[];
|
||||
if (caps.length > 64) return { field: 'capabilities', reason: 'too_many' };
|
||||
if (caps.some((c) => typeof c !== 'string')) return { field: 'capabilities', reason: 'wrong_type' };
|
||||
|
||||
const id = t['id'] as string;
|
||||
if (!/^[a-z0-9-]{1,32}$/.test(id) || id.startsWith('-') || id.endsWith('-')) return { field: 'id', reason: 'bad_id' };
|
||||
const named = text('name', t['name'] as string, 64) ?? text('label', t['label'] as string, 32);
|
||||
if (named) return named;
|
||||
const version = t['version'] as string;
|
||||
if (version.length > 64 || !SEMVER.test(version)) return { field: 'version', reason: 'not_semver' };
|
||||
if (!/^#[0-9a-fA-F]{6}$/.test(t['accent'] as string)) return { field: 'accent', reason: 'not_rgb' };
|
||||
if (typeof t['icon'] === 'string') {
|
||||
const bad = relPath(t['icon']);
|
||||
if (bad) return { field: 'icon', reason: bad };
|
||||
const last = t['icon'].split('/').pop()!;
|
||||
const dot = last.lastIndexOf('.');
|
||||
if (dot <= 0 || !['png', 'svg', 'ico'].includes(last.slice(dot + 1).toLowerCase())) return { field: 'icon', reason: 'icon_type' };
|
||||
}
|
||||
if (typeof t['ui_bundle'] === 'string') {
|
||||
const bad = relPath(t['ui_bundle']);
|
||||
if (bad) return { field: 'ui_bundle', reason: bad };
|
||||
} else if (t['hostable'] === true) return { field: 'ui_bundle', reason: 'required' };
|
||||
for (const k of ['fundamentum', 'atrium']) {
|
||||
const req = needs[k] as string;
|
||||
if (req.length > 64 || !SEMVER_REQ.test(req)) return { field: 'needs', reason: 'not_semver_req' };
|
||||
}
|
||||
const seen = new Set<string>();
|
||||
for (const c of caps as readonly string[]) {
|
||||
if (!/^[a-z0-9-]+\.[a-z0-9-]+\.[a-z0-9-]+$/.test(c)) return { field: 'capabilities', reason: 'bad_name' };
|
||||
if (!c.startsWith(`${id}.`)) return { field: 'capabilities', reason: 'foreign_prefix' };
|
||||
if (seen.has(c)) return { field: 'capabilities', reason: 'duplicate' };
|
||||
seen.add(c);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* The `domi-app.toml` Rosea ships for Atrium Domi (atrium-adoption.md; Atrium docs/APP_CONTRACT.md v0). Rosea ships
|
||||
* a file Atrium accepts, ships it next to the `.exe` with the icon it names, and keeps her name, version and
|
||||
* identity in the places they already live. The hostile fixtures prove that the check refuses what Atrium refuses,
|
||||
* and refuses it for Atrium's reason.
|
||||
*/
|
||||
import { readdirSync, readFileSync } from 'node:fs';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { PRODUCT_NAME } from '../../../packages/schema/src/constants.js';
|
||||
import { ATRIUM, MANIFEST, domiApp, gameVersion, toToml } from '../scripts/domi-app.js';
|
||||
import { checkManifest } from './domi-app-rules.js';
|
||||
|
||||
const HERE = dirname(fileURLToPath(import.meta.url));
|
||||
const SRC_TAURI = join(HERE, '..', 'src-tauri');
|
||||
const FIXTURES = join(HERE, 'fixtures', 'domi-app');
|
||||
const shipped = toToml(domiApp(gameVersion()));
|
||||
const bytes = (s: string): Uint8Array => new TextEncoder().encode(s);
|
||||
|
||||
describe('domi-app.toml', () => {
|
||||
it('is accepted by the rules of APP_CONTRACT §2', () => {
|
||||
expect(checkManifest(bytes(shipped))).toBeNull();
|
||||
});
|
||||
|
||||
it("names her as the product does, at the game's version, with her Aula id", () => {
|
||||
const m = domiApp(gameVersion());
|
||||
expect(m.name).toBe(PRODUCT_NAME);
|
||||
expect(m.version).toBe(JSON.parse(readFileSync(join(HERE, '..', '..', 'rosea', 'package.json'), 'utf8')).version);
|
||||
expect(m.id).toBe('rosea');
|
||||
expect(shipped).toContain(`name = "${PRODUCT_NAME}"`);
|
||||
});
|
||||
|
||||
it('is not hostable until her own window and origin are kept (R1), and asks for nothing', () => {
|
||||
const m = domiApp('0.1.0');
|
||||
expect(m.hostable).toBe(false);
|
||||
expect(shipped).not.toContain('ui_bundle');
|
||||
expect(shipped).not.toContain('capabilities');
|
||||
});
|
||||
|
||||
it('is shipped next to the .exe on Windows only, with the icon it names', () => {
|
||||
const win = JSON.parse(readFileSync(join(SRC_TAURI, 'tauri.windows.conf.json'), 'utf8')) as {
|
||||
bundle: { resources: Record<string, string> };
|
||||
};
|
||||
expect(win.bundle.resources).toEqual({ [MANIFEST]: 'domi-app.toml', [ATRIUM.icon.from]: ATRIUM.icon.file });
|
||||
expect(domiApp('0.1.0').icon).toBe(ATRIUM.icon.file);
|
||||
// The shared config would put it into the Android and macOS packages too.
|
||||
const shared = JSON.parse(readFileSync(join(SRC_TAURI, 'tauri.conf.json'), 'utf8')) as { bundle: Record<string, unknown> };
|
||||
expect(shared.bundle['resources']).toBeUndefined();
|
||||
});
|
||||
|
||||
it('is made before every desktop build and never committed', () => {
|
||||
const pkg = JSON.parse(readFileSync(join(HERE, '..', 'package.json'), 'utf8')) as { scripts: Record<string, string> };
|
||||
expect(pkg.scripts['build:desktop']).toMatch(/tsx scripts\/domi-app\.ts && tauri build$/);
|
||||
expect(pkg.scripts['dev']).toContain('tsx scripts/domi-app.ts');
|
||||
const ignore = readFileSync(join(HERE, '..', '..', '..', '.gitignore'), 'utf8');
|
||||
expect(ignore).toContain('apps/rosea-tauri/src-tauri/atrium/');
|
||||
});
|
||||
|
||||
it('escapes a quote or a backslash, so no value can add a key', () => {
|
||||
const hostile = toToml({ ...domiApp('0.1.0'), label: 'Rose"\nfree = false\n#\\' });
|
||||
expect(checkManifest(bytes(hostile))).toEqual({ field: 'label', reason: 'control_char' });
|
||||
expect(hostile.split('\n').filter((l) => l.startsWith('free'))).toEqual(['free = true']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('a hostile domi-app.toml is refused, with the reason Atrium Domi logs', () => {
|
||||
const files = readdirSync(FIXTURES).filter((f) => f.endsWith('.toml'));
|
||||
|
||||
it('has one fixture for each rule it claims', () => {
|
||||
expect(files.length).toBeGreaterThanOrEqual(27);
|
||||
});
|
||||
|
||||
for (const file of files) {
|
||||
const [field, reason] = file.replace(/(-\d+)?\.toml$/, '').split('.') as [string, string];
|
||||
it(`${file}: ${field === 'file' ? '' : `${field} `}${reason}`, () => {
|
||||
const refusal = checkManifest(new Uint8Array(readFileSync(join(FIXTURES, file))));
|
||||
expect(refusal).toEqual({ field: field === 'file' ? null : field, reason });
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "rose"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,10 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
capabilities = ["rosea.rose.read", "rosea.rose.read"]
|
||||
@@ -0,0 +1,10 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
capabilities = ["culina.recipe.read"]
|
||||
@@ -0,0 +1,10 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
id = "rosea"
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea ÿ Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,10 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
format = 2
|
||||
@@ -0,0 +1,8 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = "false"
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.gif"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "/domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "icons\\domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi*icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "C:domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "../domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "CON.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "-rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "Rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = " Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = ""
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea\u0007Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = "newest", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1", lector = ">=1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1.0"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = true
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
@@ -0,0 +1,9 @@
|
||||
id = "rosea"
|
||||
name = "Rosea Domi"
|
||||
label = "Rose"
|
||||
version = "0.1"
|
||||
accent = "#b4485e"
|
||||
icon = "domi-icon.png"
|
||||
hostable = false
|
||||
free = true
|
||||
needs = { fundamentum = ">=0.7", atrium = ">=0.1" }
|
||||
Reference in New Issue
Block a user