SPB Git

Repository Public

README.md 2.8 KB 37 lines markdown

1# Reference material (read-only copies)23Copies of the web application's sources that the native core must stay compatible with (backend `note-spboucher-ai`, commit 2c18f85):4`text.ts` (plain text, word count, Markdown export, block ids), `markdown.ts` (Markdown import), `html.ts` (HTML export), `validate.ts`5(server-side document checks), `same-json.ts` (key-order independent equality), `service.ts` (page versions and conflicts),6`web-editor-schema.txt` (the ProseMirror schema of the web editor: node content expressions, attributes and defaults, marks).78Validate documents against the real web schema (the dev worktree on the backend node, never production):910    scp docs.json M4M64c:/tmp/spn-docs.json11    ssh M4M64c 'bash -lc "cd ~/dev/note-v2 && node_modules/.bin/tsx .spn-schema.mts validate /tmp/spn-docs.json"'1213`docs.json` is one document or an array of documents; one line per document (`ok … identical`, `ok … NORMALISED`, `FAIL …`).1415## 3.0 nodes (`next/`)1617`next/next-nodes.ts`, `next/next-nodes-html.ts` and `next/text.ts` are the server sources `Sources/SPNotesDocument/NextNodes.swift`18is a line-by-line port of (text, Markdown and HTML of mermaid, drawing, chart, queryView, citation, bibliography, pdf, blockRef,19runCode, audio, canvasLink; attachment / page / reference ids; block id types). They were read on 2026-11-19 from the backend20worktree `M4M64c:~/dev/note-next` while it was **still uncommitted** (HEAD `77ef5f0` + working tree; `shasum` prefixes21`61d2222b6414` next-nodes.ts, `a5c63324fb22` next-nodes-html.ts, `5aa71acc2fdf` text.ts, re-copied at 13:30 after the backend made block ids stable across saves — exports unchanged). If the backend changes them before its22release, re-copy, re-record and adapt the port.2324`Tests/SPNotesDocumentTests/Fixtures/next-server.json` holds 521 documents with what the server's own functions return for them25(`toMarkdown`, `docText`, `wordCount`, `docToHtml(...).html`, `extractPageRefs`); `NextNodeExportTests.parityWithTheServerRecording`26requires Core to produce the same bytes. To re-record (read-only on the node: the script imports the worktree's modules and writes27to `/tmp`):2829    SPN_DUMP_NEXT=/tmp/spn-next-docs.json SPN_ONLY=Document swift test --scratch-path .build-document --filter dumpDocumentsForTheServerRecording30    scp /tmp/spn-next-docs.json docs/reference/next/record.mts M4M64c:/tmp/31    ssh M4M64c 'bash -lc "cd ~/dev/note-next && node_modules/.bin/tsx /tmp/record.mts /tmp/spn-next-docs.json /tmp/spn-next-server.json"'32    scp M4M64c:/tmp/spn-next-server.json Tests/SPNotesDocumentTests/Fixtures/next-server.json3334`web-editor-schema.txt` is still the 2.x schema: the web editor's Tiptap extensions for the 3.0 nodes did not exist when Core 2.035was written. `Schema.nodeDefaults` for those nodes comes from the table of SPEC §2; re-record the file when the web editor has them.3637
Files main
Menu

Theme