Skip to content

Package & publish the VS Code extension (.vsix → Marketplace) from a registry-reachable host #62

Closed

Description

@hyperpolymath

Single tracking issue for the one remaining step of the VS Code extension work. Everything that could be done from the WSL dev box is done and merged; this captures what's left, why it couldn't be done here, and exactly how to finish it.

✅ Done (merged to main)

PR What
#58 package.json compile corrected to affinescript compile --vscode-extension …; build requirements documented
#60 Real fix — src/extension.affine passed registerCommand("…", 0) (stale Phase-1 Int index); now registerCommand("…", fn(u: Unit) => handler_*()) per the binding registerCommand(name: String, handler: fn(Unit) -> Int). Extension now compiles; regenerated out/extension.cjs passes node --check
#61 Deprecated vsce 2.15.0 → @vscode/vsce ^3.2.0 (2.x can't handle a .cjs entrypoint); README "Status" corrected

Verified: affinescript compile --vscode-extension src/extension.affine -o out/extension.cjs succeeds against affinescript origin/main stdlib. The affinescript stdlib/Vscode.affine / VscodeLanguageClient.affine bindings type-check on affinescript main (affinescript#35 Phase 2 effectively complete) — no affinescript-repo change is needed.

Toolchain: affinescript v0.1.0 is installed at ~/.local/bin/affinescript on the dev box (clone-independent). Module resolution needs export AFFINESCRIPT_STDLIB=<affinescript-checkout>/stdlib.

🔲 Remaining (this issue)

  1. Build the .vsix — needs npm install of @vscode/vsce, which fails on the WSL dev box (npm registry unreachable there). Must run on CI or any non-WSL, registry-reachable host.
  2. Publish to the Marketplace (optional / later) — vsce publish needs an Azure DevOps PAT. Currently blocked by maintainer 2FA loss; not on the critical path — a .vsix (step 1) is installable directly and can be attached to a GitHub Release with no Azure account.

How to finish it (where everything lives)

Canonical how-to: vscode-extension/README.md → "Building from Source". Summary:

cd vscode-extension
npm install                                   # registry-reachable host (not WSL)
export AFFINESCRIPT_STDLIB=/path/to/affinescript/stdlib   # affinescript checkout on `main`
npm run compile                               # affinescript compile --vscode-extension … (needs `affinescript` on PATH)
npm run package                               # @vscode/vsce package -> my-lang-0.3.0.vsix   (NO Azure PAT needed)
# distribute: attach my-lang-0.3.0.vsix to a GitHub Release, OR:
npx @vscode/vsce publish                      # Marketplace upload — needs Azure DevOps PAT (publisher: hyperpolymath)

Key files: vscode-extension/package.json (main = src/index.cjs, publisher = hyperpolymath, version 0.3.0), src/extension.affine (source of truth), out/extension.cjs (committed compiled artifact), src/index.cjs (host entry, wraps the shim).

Acceptance criteria

  • my-lang-0.3.0.vsix produced by @vscode/vsce package on a registry-reachable host
  • .vsix attached to a GitHub Release (no-PAT distribution path), and/or
  • Published to the VS Code Marketplace under publisher hyperpolymath (when PAT available)

Refs affinescript#35, affinescript#64

Activity

  1. hyperpolymath commented on May 18, 2026

    @hyperpolymath
    OwnerAuthor

    Done — closing

    Executing this revealed the "just run vsce package" premise was wrong: the build produced a non-functional .vsix (the --vscode-extension auto-glue required the unpublished @hyperpolymath/affine-vscode at module load → crash on activation). Fixed in PR #63 (merged, 0dc33aa) using affinescript's documented --vscode-extension-adapter= flag pointed at the vendored adapter, main → ./out/extension.cjs, dead src/index.cjs removed.

    Also: the WSL dev box's npm registry was reachable after all (the prior blocker no longer applies), so the artifact was built here. Deno's .deno/-nested node_modules is structurally incompatible with the flat tree a .vsix needs, so the build dropped to bun per the package-manager fallback policy.

    Acceptance

    • my-lang-0.3.0.vsix produced by @vscode/vsce package (324 files, 466 KB; full vscode-languageclient closure bundled & verified Node-resolvable; extraImports() returns {Vscode, VscodeLanguageClient} with only host-provided vscode stubbed).
    • .vsix attached to a GitHub Release (no-PAT path): https://github.com/hyperpolymath/my-lang/releases/tag/v0.3.0 · sha256 1e1b96a7071399c6d261b08b6126bf69a77178e4e6c4c69c4a1b84239daf0d8d
    • Marketplace publish (publisher hyperpolymath) — optional, explicitly off the critical path; gated solely on an Azure DevOps PAT (maintainer 2FA). The Release above is the supported install path until then.

    Critical path complete → closing. The Marketplace upload is a no-code, externally-gated follow-up to run when the PAT is available (npx @vscode/vsce publish against the same artifact).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew capability or improvement to existing behaviour

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions