You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
affine-vscode: align docs with --vscode-extension + npm publish manifest (#117)
* Codegen: add --vscode-extension flag to inline extraImports wiring
Closes#105.
The Node-CJS codegen emitted a shim with an empty extraImports hook that
every consumer hand-wired in a separate index.cjs to install the concrete
vscode-API bindings. That boilerplate was 100% mechanical and identical
across consumers.
Add a --vscode-extension codegen flag that inlines the wiring so the
generated .cjs is directly loadable as a VS Code extension's `main`:
installs exports.extraImports calling the @hyperpolymath/affine-vscode
adapter. Sub-flags --vscode-extension-adapter (override the require
specifier) and --vscode-extension-no-lc (no language client; pass null)
cover the documented variants.
Migrate the editors/vscode pilot off the would-be hand-written index.cjs:
its compile script now passes --vscode-extension and the regenerated
out/extension.cjs carries the inline glue; package.json declares the
adapter dependency.
https://claude.ai/code/session_01FkzAgzpZFSGxzorVNZ9FUF
* docs(affine-vscode): align adapter docs with --vscode-extension (issue #105)
The README and mod.js still described the pre-#105 manual hookup and
referred to the hook as `_extraImports`. The codegen shim uses
`extraImports` and #105 now emits the wiring inline.
- Document `--vscode-extension` (and the adapter / no-lc sub-flags) as
the recommended path; keep a corrected manual fallback.
- Fix the hook name `_extraImports` -> `extraImports`.
- Fix the manual example's third argument: the adapter expects the .cjs
shim module (it reads `_registerHandle` / `_instance` off it), not a
`() => instance` thunk or a bare WebAssembly.Instance.
https://claude.ai/code/session_01FkzAgzpZFSGxzorVNZ9FUF
* chore: gitignore /_opam/ local opam switch
A project-local opam switch (created for a working OCaml toolchain) is a
machine-specific environment dir and must not be tracked, mirroring the
existing /_build/ ignore.
https://claude.ai/code/session_01FkzAgzpZFSGxzorVNZ9FUF
* feat(affine-vscode): npm package manifest + tag-driven publish (issue #104)
In-repo half of #104 so consumers can `npm install
@hyperpolymath/affine-vscode` instead of vendoring mod.js — which is what
makes --vscode-extension's default `require("@hyperpolymath/affine-vscode")`
resolvable downstream.
- packages/affine-vscode/package.json: publish manifest (name, main,
PMPL license matching the sibling deno.json, repository.directory,
peerDependencies vscode + optional vscode-languageclient, files
allowlist, public publishConfig). vscode-languageclient is marked
optional to match --vscode-extension-no-lc.
- .github/workflows/affine-vscode-publish.yml: publishes on a scoped
`affine-vscode-v*` tag (kept distinct from the compiler's `v*` tags),
verifies tag==package version, uses runner-provided Node and a runtime
$HOME/.npmrc (no committed .npmrc, so the npm/bun blocker stays green).
- README: npm-install section as the primary entry point.
Out of scope (needs npm org/token + other repos): the @hyperpolymath npm
org, first manual publish, and the my-lang / standards consumer ports.
https://claude.ai/code/session_01FkzAgzpZFSGxzorVNZ9FUF
---------
Co-authored-by: Claude <noreply@anthropic.com>
"description": "JS-side adapter for AffineScript's stdlib/Vscode.affine + stdlib/VscodeLanguageClient.affine binding modules. Resolves each extern fn to a real vscode / vscode-languageclient call and maintains the FFI handle table.",
0 commit comments