Repository navigation
Publish @hyperpolymath/affine-vscode to npm (eliminate vendoring) #104
Description
Activity
- added 5 commits that reference this issue
on May 15, 2026 Status sweep 2026-05-21
Most of the work in this issue already shipped via earlier PRs. The remaining gap is the first npm publish + downstream un-vendoring. Current state vs the four acceptance bullets:
AC Status Where @hyperpolymath/affine-vscoderesolvable vianpm view❌ owner action needs npm org create + NPM_TOKENsecret + tag pushCI publishes on tag push ✅ on main.github/workflows/affine-vscode-publish.yml(trigger:affine-vscode-v*)my-lang + standards depend on the published package; vendored .cjsremoved🟡 staged as DRAFTs hyperpolymath/my-lang#66, hyperpolymath/standards#160 README.adocdocuments npm-install as primary✅ on main(tightened)tightened in #316 (PMPL→MPL sweep + Status truth-up) Owner action checklist to land the first publish
- Merge chore(affine-vscode): finish PMPL→MPL sweep + truth-up Status paragraph (Refs #104) #316 (manifest+doc-only PMPL→MPL finishing sweep; the two stale license fields missed by 3170a6b).
- Create npm org
hyperpolymathat https://www.npmjs.com/org/create (free tier is fine for public packages — issue body §3 noted this org doesn't yet exist on npm). - Generate an npm automation token with publish rights to the
@hyperpolymathscope and add it as repo secretNPM_TOKENat https://github.com/hyperpolymath/affinescript/settings/secrets/actions. - Push tag
affine-vscode-v0.1.0to fireaffine-vscode-publish.yml:cd /home/hyperpolymath/dev/repos/affinescript git fetch origin main git tag -a affine-vscode-v0.1.0 origin/main -m "affine-vscode 0.1.0 — first npm publish (Refs #104)" git push origin affine-vscode-v0.1.0
- Verify with
npm view @hyperpolymath/affine-vscode. - Mark chore(vscode-extension): un-vendor affine-vscode (Refs hyperpolymath/affinescript#104) my-lang#66 + chore(rsr-certifier/vscode): un-vendor affine-vscode (Refs hyperpolymath/affinescript#104) standards#160 ready-for-review, run their test plans, merge.
- Close this issue with a
Closes #104reference on whichever PR (likely standards#160) lands last, per the ISSUE-CLOSURE rule in CLAUDE.md.
What the DRAFT consumer PRs contain
hyperpolymath/my-lang#66 (uses the
--vscode-extensioncodegen pattern):vscode-extension/package.json: drop--vscode-extension-adapter=../src/affine-vscode-adapter.cjsoverride fromcompile+vscode:prepublishscripts; add@hyperpolymath/affine-vscode@^0.1.0todependencies.vscode-extension/src/affine-vscode-adapter.cjs: deleted (-141 lines).vscode-extension/out/extension.cjsline 101:require("../src/affine-vscode-adapter.cjs")→require("@hyperpolymath/affine-vscode"). This is auto-generated--vscode-extensionglue; matches whatnpm run vscode:prepublishwill regenerate on first compile after publish.
hyperpolymath/standards#160 (uses the manual-wiring pattern):
rhodium-standard-repositories/satellites/rsr-certifier/extensions/vscode/package.json: add the dep.extensions/vscode/src/index.cjsline 18:require("./affine-vscode-adapter.cjs")→require("@hyperpolymath/affine-vscode").extensions/vscode/src/affine-vscode-adapter.cjs: deleted (-463 lines).out/extension.cjsunchanged — this extension's compiled wasm shim doesn't reference the adapter directly.
Per the ISSUE-CLOSURE rule, this comment does not self-close the issue.
Final session status 2026-05-21 (handover)
All three PRs landed earlier today merged successfully:
- chore(affine-vscode): finish PMPL→MPL sweep + truth-up Status paragraph (Refs #104) #316 — manifest+doc finishing sweep (MERGED)
- chore(vscode-extension): un-vendor affine-vscode (Refs hyperpolymath/affinescript#104) my-lang#66 — un-vendor consumer ci: Bump actions/setup-node from 4.0.2 to 6.3.0 #1 (MERGED, was DRAFT)
- chore(rsr-certifier/vscode): un-vendor affine-vscode (Refs hyperpolymath/affinescript#104) standards#160 — un-vendor consumer ci: Bump dtolnay/rust-toolchain from f7ccc83f9ed1e5b9c81d8a67d7ad1a747e22a561 to efa25f7f19611383d5b0ccf2d1c8914531636bf9 #2 (MERGED, was DRAFT)
⚠️ Issue stays OPEN — first publish not yet landedVerified at session-close:
npm view @hyperpolymath/affine-vscode→ 404; noaffine-vscode-v*tag on the repo; zero runs ofaffine-vscode-publish.yml.Consequence: both consumer extensions now declare
@hyperpolymath/affine-vscode@^0.1.0independenciesand have deleted their vendored adapters, sonpm installinhyperpolymath/my-lang/vscode-extension/andhyperpolymath/standards/.../rsr-certifier/extensions/vscode/will 404 until the publish lands.Blocked on owner action (2FA lockout)
Owner reports phone/2FA issues blocking the npm-side sequence, same pattern as the deferred VS Code Marketplace PAT lockout. When 2FA is restored:
- Create npm org
hyperpolymathat https://www.npmjs.com/org/create - Generate an npm automation token with publish rights to the scope; add as repo secret
NPM_TOKENat https://github.com/hyperpolymath/affinescript/settings/secrets/actions - Push the tag:
git tag -a affine-vscode-v0.1.0 origin/main -m "affine-vscode 0.1.0 — first npm publish (Closes #104)" git push origin affine-vscode-v0.1.0 - After
npm view @hyperpolymath/affine-vscoderesolves, this issue may be closed with a comment referencing the workflow run that published.
Fallback option (if 2FA stays blocked indefinitely)
If the publish can't land soon and the broken-install state needs resolving first, a pair of hotfix PRs against my-lang + standards can restore the vendored adapter as a temporary fallback. Not opened — owner discretion.
Per ISSUE-CLOSURE in CLAUDE.md, this comment does not self-close.
- added 7 commits that reference this issue
on May 25, 2026 Closing — Signal C (policy-superseded). npm publishing is contra-policy per the estate npm-avoidant direction (#67 lockfile elimination + #253 npm→Deno migration). The intent — eliminating vendoring of
packages/affine-vscode/mod.js— remains valid, but the canonical replacement is JSR via thepublish-jsr.ymlworkflow that landed today.If JSR publishing for affine-vscode needs its own narrow tracker, please refile under JSR scope rather than reopening this ticket (older tickets accumulate stale context).
Problem
packages/affine-vscode/mod.jsis the JS-side adapter forstdlib/Vscode.affine+stdlib/VscodeLanguageClient.affine. It maps eachextern fnto a realvscode/vscode-languageclient/nodecall and maintains the handle table.Today the package has no
package.json— onlymod.js,README.adoc, anddeno.json. Consumers outside this repo (currentlyhyperpolymath/my-langandhyperpolymath/standardsrsr-certifier; soon every other AffineScript-authored VS Code extension) vendor the adapter by copyingmod.jsintosrc/affine-vscode-adapter.cjsin their own repo.Vendoring works but has clear drawbacks:
mod.jshere requires manual re-sync in every consumer. The bindings PR (feat(vscode-bindings): expand surface for rsr-certifier port (#64) #102) added ~20 new functions; each consumer downstream had to remember to copy them across.Proposed plan
Publish
@hyperpolymath/affine-vscodeto npm so consumers cannpm install @hyperpolymath/affine-vscodeandrequire()the adapter directly. The vendoring step in each extension'ssrc/index.cjscollapses to:Steps
packages/affine-vscode/package.jsonwithname: "@hyperpolymath/affine-vscode",main: "./mod.js", an MIT or PMPL license entry matching the repo,peerDependencies: { vscode: "*", "vscode-languageclient": "^9.0.0" }, and arepository.directoryfield pointing at this subdirectory.0.1.0is fine for the first published cut).hyperpolymathorg doesn't currently have an npm presence — decide whether to publish under that scope (needs the npm org creating) or under a personal scope.npm publish --access publicfrompackages/affine-vscode/. Add the publish step to a GitHub Actions workflow guarded on a tag pattern so subsequent releases are tag-driven.hyperpolymath/my-lang's vscode-extension andhyperpolymath/standards's rsr-certifier to depend on@hyperpolymath/affine-vscodeinstead of vendoring; remove their localsrc/affine-vscode-adapter.cjsfiles.packages/affine-vscode/README.adoc(the existing Usage section already gets close — just needs the vendoring escape hatch removed and the npm-install path made primary).Acceptance criteria
@hyperpolymath/affine-vscodeis resolvable vianpm view.npm publishafter the first one).affine-vscode-adapter.cjsfiles are removed.packages/affine-vscode/README.adocdocuments the npm-install consumer pattern as primary.Out of scope
0.xis fine while the binding surface is still growing organically.module.exports = function (...)factory shape with ESM exports. CJS is what the vscode extension host loads.Related