Skip to content

MR-23d: wire up packages/editor - #800

Closed
michaeljgrimm wants to merge 7 commits into
codex/mr-23a-root-galleryfrom
codex/mr-23d-editor
Closed

michaeljgrimm wants to merge 7 commits into
codex/mr-23a-root-galleryfrom
codex/mr-23d-editor

Conversation

@michaeljgrimm

Copy link
Copy Markdown
Contributor

MR-23d: wire up packages/editor (slice of MR-23 "Wire-up", docs/programs/monorepo/README.md section 9, Phase 2; the editor part of the "Remaining for MR-23b/c/d" list in #797). Base is codex/mr-23a-root-gallery (30befac); merge with a merge commit or rebase, not a squash. Touches only packages/editor/**.

What is in it (7 commits, none squashed)

  • Scripts. npm run to pnpm run; test/test:contract call ../../scripts/run-tests.mjs; check:font-hotlinks:built calls node ../../scripts/check-font-hotlinks.mjs --built dist artifacts/playground; check:runners, check:changes and check:font-hotlinks are dropped (the root covers them). New build:deps (gallery, then core: core's build imports the gallery's dist) runs before build in test, test:contract, test:json, test:playground, test:packed and as the playground and browser suites' setup in test/browser-suites.json. New check:scripts runs the package's own script tests. Suite commands that passed -- <args> lost the --: pnpm hands the literal -- to the script, which rich-input-browser and json-editor-browser read as their first argument (verified; render/pptx suites with npm run x -- args need the same).
  • Deleted local copies of shared scripts: changelog-fragments, flake-repeat, publish-source, quarantine, run-tests (+ tests), check-font-hotlinks (+ test, allowlist), ci-evidence.{mjs,json}, and published-core-gate.mjs (the opf.requiresUnreleasedCore gate is gone; its test and its contractExclude entry go too). The check-syntax tests moved out of run-tests.test.mjs into scripts/check-syntax.test.mjs; scripts/browser-suites.test.mjs imports ../../../scripts/quarantine.mjs.
  • Workflow-contract tests deleted (they read the removed .github/): candidate-gallery-ci, ci-evidence, publish-source, publish-workflow-trust.
  • test/packed-install.mjs. No npm_execpath (every npm, pnpm and tar call goes through the root spawnSpec). Packs the editor with pnpm pack and reads the packed manifest from the tarball (workspace: is a version there; its own package.json is compared with the tarball's copy). 0.26.0 is not on the registry, so the consumer installs the editor together with packed workspace candidates of gallery, core, renderer and PPTX (staged manifests with concreteRange, npm pack; see "Root changes needed" for why not pnpm pack); the lock assertions check the candidate tarballs' integrity; npm audit signatures is recorded as skipped until every candidate version is on the registry. The two package-lock.json readers (packed-install.mjs, rich-input-browser.mjs) read the lock of the npm consumer the test creates, so they stay.
  • dist/ untracked. git rm -r --cached packages/editor/dist (158 files; the committed copy was stale at the import and in 0.25.1), packages/editor/.gitignore (/dist/, /artifacts/). Every consumer in the package builds it first (above). build is just src/*.js,*.d.ts copied plus styles.css.
  • Docs. packages/editor/AGENTS.md rewritten: points at the root AGENTS.md, keeps the editor rules, replaces the toolchain/CI/release text. README.md (development, release lane, playground, composition paragraphs), CONTRIBUTING.md, test/QUARANTINE.md and docs/browser-pptx-workflow.md use pnpm and the root workflow. Historical docs/*.md and CHANGELOG.md are untouched.
  • No changelog fragment: tooling, tests and docs only (src/ is untouched); MR-23a: root wiring and gallery (six packages, one version, workspace edges, integration) #797's changes/mr-23-workspace-wire-up.md covers the wire-up.

Local results (macOS, Node 26.7, pnpm 10.33.2)

Command (from packages/editor) Result
pnpm run test:contract pass: 89 test files (the contract is now the full suite)
pnpm test pass: build, 89 files, check:scripts (4 tests)
pnpm run typecheck / pnpm run validate pass (256 files) / pass
pnpm run test:packed pass: 162 byte-matched files, 23 model suites, installed-consumer browser suites (JSON, code, rich input)
pnpm run test:playground pass: all 29 steps (Chromium via Playwright)
node ../../scripts/quarantine.mjs run-suite browser (setup runs build:deps, build) pass
node ../../scripts/quarantine.mjs check pass (empty list)
root check:font-hotlinks, check:quarantine, check:changes, check:pins, check:workspace-graph, check:versions pass
root pnpm check:changed editor steps pass (biome, check:font-hotlinks, check:text, typecheck, editor test:contract); tests render and tests pptx fail, which is MR-23b/c

Not run: Windows (spawnSpec and tar on Windows, test:playground with Edge), CI (no workflows yet), flake-repeat, macOS-only legs, the Node 22/26 range legs, test/native-playground.ps1 (owner's Windows host only), the opf-editor playground/browser suites inside the Playwright container.

Root changes needed (not done here; this PR only touches packages/editor)

  1. Core cannot be packed with pnpm pack: it fails with ERR_PNPM_CANNOT_RESOLVE_WORKSPACE_PROTOCOL ("opf-pptx ... is not installed"), because the optional peers workspace:^ on render and pptx are neither installed (autoInstallPeers: false) nor devDependencies. MR-40's release packing needs a fix (a staged manifest as in packed-install.mjs, or another approach); pnpm pack works for editor, CLI (and, presumably, gallery).
  2. Core's build needs the gallery's dist (src/node/catalogs.ts imports @openpresentation/gallery), and gallery's test, typecheck and check:* scripts build core first: on a fresh clone pnpm --filter @openpresentation/opf build fails with TS2307 until pnpm --filter @openpresentation/gallery build has run. The editor's build:deps works around it; the root build/test:run should build the gallery first.
  3. packages/editor/dist consumers at the root now need pnpm --filter @openpresentation/opf-editor build first, and still use the sibling layout (../opf-editor/dist/...) that MR-34 deletes: scripts/test-timeline-workflow.mjs, test-plain-whitespace-workflow.mjs, test-furniture-workflow.mjs, test-ecosystem.mjs, test-font-ecosystem.mjs, test-office-fonts.mjs, published-matrix/engines-source.mjs (re-point to packages/editor/dist and build it first, or retire), and scripts/rebuilt-release-files.mjs (RR-101, runs npm ci in the editor; MR-34/40).
  4. Root .gitignore line packages/editor/dist/styles.css is now redundant (the package's own .gitignore covers /dist/).
  5. Root check:quarantine runs quarantine.mjs check once for the root; add --dir packages/editor (loop the packages that have a test/quarantine.json), per MR-12: shared scripts take a package directory #780. The root check:runners already passes without the editor copy.
  6. src/index.js (githubRepository: "OpenPresentation/opf-editor") and README line 191 still name the old repository; that is a src/ change and a public constant, left for its own decision.

Notes for MR-23b/c

  • Everything here uses root helpers only: spawnSpec, DEPENDENCY_FIELDS, concreteRange. A running pnpm check:changed (core build, tsup cleans dist) concurrently with a browser suite broke one of my playground runs (ERR_MODULE_NOT_FOUND on core's dist/composition.js); run them one after the other.
  • pnpm install sets mode 755 on render's dist/preview-fonts-cli.js (a bin); it shows in git status and is not committed here.

🤖 Generated with Claude Code

michaeljgrimm and others added 7 commits October 22, 2026 05:08
…copies of shared scripts and workflow-contract tests deleted

package.json: npm run -> pnpm run; run-tests, check-font-hotlinks:built point at ../../scripts; check:runners, check:changes and
check:font-hotlinks dropped (the root covers them); build:deps builds the gallery and core before the editor build, because dist/ is no
longer tracked and the tests import it. The check-syntax tests move out of run-tests.test.mjs into scripts/check-syntax.test.mjs; the
browser-suites test imports the root quarantine.mjs.

Deleted: the sibling copies of changelog-fragments, flake-repeat, publish-source, quarantine, run-tests, check-font-hotlinks (+ tests and
allowlist), ci-evidence, published-core-gate (opf.requiresUnreleasedCore is gone), and the workflow-contract tests that read the removed
.github/ (candidate-gallery-ci, ci-evidence, publish-source, publish-workflow-trust, published-core-gate).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dist/ is a copy of src/ plus the generated styles.css. The committed copy went stale in 0.25.1 (it lacked the source-pane and presenter
changes), the registry lane rebuilds it from source (opf #794) and npm builds it at prepack. Untrack it and ignore it; the test scripts,
test:contract and the playground now run `build:deps` and `build` first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ore-gate test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… installs the workspace candidates

The test no longer needs npm_execpath (`pnpm run` sets it to pnpm's entrypoint): every npm, pnpm and tar call goes through the root
spawnSpec. The editor is packed with `pnpm pack` and its packed manifest is read from the tarball (workspace: ranges are versions
there; package.json is compared with the tarball's copy). The consumer installs the editor with the workspace candidates of gallery,
core, renderer and PPTX converter, because 0.26.0 is not on the registry before the release; the lock assertions check the candidate
tarballs' integrity, and `npm audit signatures` is recorded as skipped until every candidate version is published.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…points at the root rules

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@michaeljgrimm

Copy link
Copy Markdown
Contributor Author

Landed on main through #808 (merge commit 62c4b26), which carries this PR's commits unchanged.

@michaeljgrimm
michaeljgrimm deleted the codex/mr-23d-editor branch October 26, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant