Skip to content

publish the editor surface to public npm via trusted publishing - #11

Merged
lightninglu10 merged 23 commits into
codepress-mainfrom
publish-surface-to-npm
Aug 20, 2026
Merged

publish the editor surface to public npm via trusted publishing#11
lightninglu10 merged 23 commits into
codepress-mainfrom
publish-surface-to-npm

Conversation

@lightninglu10

@lightninglu10 lightninglu10 commented Aug 20, 2026

Copy link
Copy Markdown

Publishes @quantfive/freecut-editor-surface to the public npm registry using npm trusted publishing (OIDC), so consumers need no credential and this repo needs no publish token.

0.3.0 is already live on npmjs.org — published by hand from the exact tarball that was on GitHub Packages, with only publishConfig retargeted. Same bytes, same dist tree digest (3b5f539a…), so the content-hashed chunk names CodePress pins in apps/web/next.config.ts could not shift. This PR makes the repo agree with that reality so the next release doesn't silently go back to the private registry.

Why public

The package is MIT and built from a public repository. Routing it through GitHub Packages bought no secrecy — only a read:packages token every consumer had to obtain, which is a real ongoing cost: CodePress had grown ~630 lines of setup scripts, a pnpmfile advisory, a git-hook token fallback, and a failure sentinel purely to distribute it. All of that is now deleted.

Worth noting GitHub Packages' npm registry requires a token even for public packages (401 {"error":"authentication token not provided"}), so flipping package visibility there would not have helped. npmjs.org was the only option that removes the credential.

Changes

  • publishConfigregistry.npmjs.org with access: public
  • scripts/package-editor-surface.mjs — the guard asserted the package must target GitHub Packages and must not be public; it now enforces the opposite. Without this the build fails immediately.
  • .github/workflows/publish-editor-surface.ymlpermissions: packages: writeid-token: write, registry-url → npmjs, and the publish step drops NODE_AUTH_TOKEN for OIDC + --provenance. Also triggers on merges into codepress-main, not only release tags, and no-ops when the version is already published so a merge without a version bump isn't a red run. Everything else — tag/version matching, verify:provenance, the consumer smoke test against the packed artifact — is untouched.
  • .github/workflows/sync-upstream.yml (new) — keeps main a clean mirror of walterlow/freecut via gh repo sync, and warns when codepress-main falls behind.
  • packages/freecut-editor/README.md — drops the registry and token setup consumers no longer need.

Fork layout this assumes

main stays a pristine mirror of upstream; nothing of ours lands there, which is what keeps gh repo sync a conflict-free fast-forward. codepress-main is the integration branch and is now the repo default. Upstream reaches us through a reviewed PR (maincodepress-main) rather than landing unattended.

The branch could not be named codepress: refs/heads/codepress/bootstrap/dev-server/… (PR #10) already occupies that namespace as a directory, so git rejects a ref at refs/heads/codepress.

Read this before merging

20 of the 22 commits here are the pr9d-freecut-transcript-consumer-5319 line, not this change. Only the last two are mine. codepress-main was seeded from main, so it has no packages/freecut-editor at all — this PR is the first thing to bring the surface package onto the integration branch, and it brings that entire feature line with it.

The 5319 branches diverge. pr9d vs qa/parity-gates-5319 is 4 ahead / 2 behind, and pr9a-caption-ui-5319 diverges from both. Merging this integrates the pr9d line only; the other two are not included and will need their own integration. If pr9d is not the line you want as the basis, say so and I'll rebase onto whichever is.

Not verified here

I could not exercise the workflow. Two things need checking on the first real run: the trusted publisher must be configured on npmjs.com against this repository and the filename publish-editor-surface.yml (renaming the file breaks publishing until that entry is updated), and --provenance may reject a pre-built tarball rather than a live pack — if it does, dropping the flag is the fix and OIDC auth is unaffected.

lightninglu10 and others added 22 commits August 15, 2026 00:07
Merge PR2 provenance and reproducible packaging baseline for CodePress issue #5319.
feat: publish host-backed FreeCut editor surface
* add caption command and editor ui

* fix(editor): mount caption editor in production shell

* feat(editor): route captions through host surface

* fix(editor): preserve caption background opacity
…hots

Applying a transcript edit installs the authoritative snapshot, and the
host runtime reset the active sidebar tab to Media on every install.
That unmounted the transcript panel before it could show its applied
state or its inline revision-conflict error (the conflict only reached
the user through the host notify channel).

Preserve the active tab when host mode still shows it (media always,
text/transcript per capability and port), and keep resetting tabs host
mode does not expose. Cover the applied and conflict outcomes through
the real MediaSidebar path.
the package is MIT and built from a public repo, so routing it through a
private registry only bought a credential every consumer had to obtain.
0.3.0 is already on npmjs.org with the same bytes it had on github packages.

- publishConfig targets registry.npmjs.org with public access, and the
  packaging guard now enforces that instead of the opposite
- the release workflow authenticates with OIDC (id-token: write) rather than
  a GITHUB_TOKEN with packages: write, so there is no token to rotate, and
  publishes with --provenance
- it also runs on merges into the codepress integration branch, not just on
  release tags, and no-ops when the version is already published
- sync-upstream keeps main a clean mirror of walterlow/freecut and warns when
  the integration branch falls behind
- README drops the registry and token setup consumers no longer need
the integration branch could not be named codepress: refs/heads/codepress/
is already a directory in the ref namespace (PR #10's bootstrap branch), so
git rejects a ref at refs/heads/codepress outright.
@codepress-reviewer-dev

Copy link
Copy Markdown

Starting initial review of efc6b07c from baseline 4d62e808... 👀

View automation run

@codepress-reviewer-dev codepress-reviewer-dev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package boundary and workflow shape are appropriate: the artifact is built deterministically, tested as an installed consumer, and then published through GitHub OIDC without a long-lived token.

I cannot approve the release migration yet because its required npm-side trusted-publisher configuration has not been verified. The workflow only has an OIDC credential, so a missing or mismatched package configuration will make the next publish fail rather than fall back to a token. Before merging, confirm the publisher for @quantfive/freecut-editor-surface exactly targets quantfive/freecut and publish-editor-surface.yml, and that it allows npm publish; then exercise that path with a safe new version or attach the configuration evidence. npm documents the exact filename/repository match and allowed-action requirement in its trusted publishing guide.

One documentation cleanup can follow: the package README still says the package is published to GitHub Packages immediately before stating that it is published to the public npm registry.

Coverage

This review is partial because some textual changes were not fully supplied or inspected. The automation will not submit an approval until those paths are reviewed.

  • src/features/editor/codepress/adapter.test.ts (patch_too_large)
  • src/features/editor/codepress/adapter.ts (diff_budget_exceeded)
  • src/features/editor/codepress/caption-editor-view.tsx (diff_budget_exceeded)
  • src/features/editor/codepress/caption-editor.test.tsx (diff_budget_exceeded)
  • src/features/editor/codepress/caption-editor.tsx (diff_budget_exceeded)
  • src/features/editor/codepress/caption-validation.test.ts (diff_budget_exceeded)
  • src/features/editor/codepress/caption-validation.ts (diff_budget_exceeded)
  • src/features/editor/codepress/contract.ts (diff_budget_exceeded)
  • src/features/editor/codepress/document.ts (diff_budget_exceeded)
  • src/features/editor/codepress/edit-engine.ts (diff_budget_exceeded)
  • ... and 56 more pending file(s)
Reviewed `4d62e808`...`efc6b07c`. Diff collection and GitHub posting were handled by the automation.

View automation run

@codepress-reviewer-dev

Copy link
Copy Markdown

Review head efc6b07cb027fa067debeaa1d8caace9d48db624; round 1; 36 reviewed file(s), 66 pending/skipped file(s). 1 subsystem record(s) retained; 0 omitted.

View automation run

the rewrite left the old sentence directly above its replacement, so the
readme claimed both registries in consecutive lines.
@codepress-reviewer-dev

Copy link
Copy Markdown

Starting new changes review of 652fcd3e from baseline efc6b07c... 👀

View automation run

@lightninglu10 lightninglu10 self-assigned this Aug 20, 2026
@lightninglu10
lightninglu10 merged commit 7799d29 into codepress-main Aug 20, 2026
3 checks passed
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