It lived in scratchpad/, which is untracked, and a tidy-up on 2026-10-22 deleted it — along with the pdf-editor's copy of the same harness. Forty checks of coverage gone, and nothing in the repo so much as mentioned they had existed. Anything load-bearing belongs next to the code it tests. Rebuilt as test/e2e.mjs plus test/e2e-harness.mjs, runnable with `npm run test:e2e`. It boots a throwaway Theseus, opens documents through the sidebar panel, clicks the real ribbon, types with real key events, saves and exports, then reads the result back with the add-on's own reader. The editor carries no test-only hook, so a pass is a pass for what users get. This is the only level that catches breakage which exists solely in the browser — a bundle that will not load as a classic script from file://, webfonts that register and then never fetch, a ribbon button wired to nothing, a PDF on the wrong paper. All four have happened. One trap is recorded in the harness: the throwaway profile must not live under addon-build/, whose package.json declares "type": "module". Node picks a file's module kind from the nearest package.json above it, so an add-on seeded into a profile there is parsed as ESM and dies on its first require() with "require is not defined in ES module scope" — which reads exactly like the add-on being broken, and is not. Run against today's build: 38/38, including the new start-on-first-use activation.
33 lines
1 KiB
JSON
33 lines
1 KiB
JSON
{
|
|
"name": "docx-editor-vendor-build",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"description": "Build-time only: bundles mammoth + ProseMirror + docx into bundled-addons/docx-editor/vendor/, and rasterises the icon.",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "node build.mjs",
|
|
"icons": "node make-icons.mjs",
|
|
"fonts": "node fetch-fonts.mjs",
|
|
"test": "node test/roundtrip.mjs",
|
|
"test:e2e": "node test/e2e.mjs"
|
|
},
|
|
"devDependencies": {
|
|
"docx": "^9.5.1",
|
|
"esbuild": "^0.28.2",
|
|
"jsdom": "^29.1.1",
|
|
"jszip": "^3.10.1",
|
|
"mammoth": "^1.12.3",
|
|
"prosemirror-commands": "^1.7.1",
|
|
"prosemirror-dropcursor": "^1.8.2",
|
|
"prosemirror-gapcursor": "^1.3.2",
|
|
"prosemirror-history": "^1.4.1",
|
|
"prosemirror-inputrules": "^1.5.0",
|
|
"prosemirror-keymap": "^1.2.3",
|
|
"prosemirror-model": "^1.25.0",
|
|
"prosemirror-schema-basic": "^1.2.4",
|
|
"prosemirror-schema-list": "^1.5.1",
|
|
"prosemirror-state": "^1.4.3",
|
|
"prosemirror-tables": "^1.7.1",
|
|
"prosemirror-view": "^1.40.0"
|
|
}
|
|
}
|