chore(vscode-extension): un-vendor affine-vscode (Refs hyperpolymath/affinescript#104)#66
Merged
Merged
Conversation
…olymath/affinescript#104) Replace the in-tree copy of `vscode-extension/src/affine-vscode-adapter.cjs` (141-line copy of `packages/affine-vscode/mod.js` in hyperpolymath/affinescript) with the published `@hyperpolymath/affine-vscode` npm package. Concrete edits: * package.json: add `@hyperpolymath/affine-vscode@^0.1.0` to `dependencies`; drop `--vscode-extension-adapter=../src/affine-vscode-adapter.cjs` from `compile` + `vscode:prepublish` scripts so the codegen default kicks in. * src/affine-vscode-adapter.cjs: deleted (was a verbatim copy of the upstream mod.js as of bindings PR #102). * out/extension.cjs line 101 hand-edited: `require("../src/affine-vscode-adapter.cjs")` → `require("@hyperpolymath/affine-vscode")`. This matches what `affinescript compile --vscode-extension` will regenerate on first `npm run vscode:prepublish` after the package is on npm — the line is auto-generated glue (see "Inserted by --vscode-extension" comment above it), and the only difference is the bare specifier vs the relative path. # DRAFT — gated on hyperpolymath/affinescript#104 (npm first publish) Do NOT merge until `npm view @hyperpolymath/affine-vscode` resolves. Until then `npm install` here will 404. The PR is staged so the diff is reviewable in isolation from the publish step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath
added a commit
to hyperpolymath/standards
that referenced
this pull request
May 21, 2026
…ath/affinescript#104) (#160) ## Summary - Replace the 463-line in-tree copy of `rsr-certifier/extensions/vscode/src/affine-vscode-adapter.cjs` with a `require("@hyperpolymath/affine-vscode")` against the published npm package. - `src/index.cjs` line 18 swap + accompanying comment-block update. - `out/extension.cjs` is unchanged — this extension uses the manual-wiring pattern (`src/index.cjs` as the extension's `main`), so only the hand-written entry-point needs touching, not the AffineScript-compiled wasm shim. ## DRAFT — gated on hyperpolymath/affinescript#104 This PR cannot be marked ready-for-review until the package is on npm. Current state of affinescript#104: | Acceptance criterion | Status | |---|---| | `package.json` shape, peer deps, `repository.directory` | ✅ on `affinescript/main` | | CI tag-driven publish | ✅ `affine-vscode-publish.yml` on `affinescript/main` | | README documents npm-install as primary | ✅ on `affinescript/main` (tightened in hyperpolymath/affinescript#316) | | `npm view @hyperpolymath/affine-vscode` resolves | ❌ owner action: create npm org `hyperpolymath`, add `NPM_TOKEN` secret to affinescript repo, push tag `affine-vscode-v0.1.0` | | my-lang + standards un-vendored | 🟡 **this PR** (DRAFT) + companion DRAFT in hyperpolymath/my-lang#66 | ## Test plan After hyperpolymath/affinescript#104 lands the first publish: - [ ] `npm install` in `rhodium-standard-repositories/satellites/rsr-certifier/extensions/vscode/` resolves the new dep - [ ] Loading the extension in a fresh VS Code instance: `activate` runs without error, `rsr.checkCompliance` is registered, `deactivate` tears down cleanly - [ ] Mark this PR ready-for-review, then merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vscode-extension/src/affine-vscode-adapter.cjswith arequire("@hyperpolymath/affine-vscode")against the published npm package.--vscode-extension-adapter=../src/affine-vscode-adapter.cjsoverride from thecompileandvscode:prepublishscripts so the AffineScript codegen default (@hyperpolymath/affine-vscode) takes over.out/extension.cjsline 101 hand-edited fromrequire("../src/affine-vscode-adapter.cjs")→require("@hyperpolymath/affine-vscode"). This matches whataffinescript compile --vscode-extensionwill regenerate next timenpm run vscode:prepublishruns after the npm package is live. The line is--vscode-extensionauto-generated glue — see the "Inserted by --vscode-extension" comment block above it in the file.DRAFT — gated on hyperpolymath/affinescript#104
This PR cannot be marked ready-for-review until the package is on npm. Current state of affinescript#104:
package.jsonshape, peer deps,repository.directoryaffinescript/mainaffine-vscode-publish.ymlonaffinescript/mainaffinescript/main(tightened in hyperpolymath/affinescript#316)npm view @hyperpolymath/affine-vscoderesolveshyperpolymath, addNPM_TOKENsecret to affinescript repo, push tagaffine-vscode-v0.1.0Test plan
After hyperpolymath/affinescript#104 lands the first publish:
npm installinvscode-extension/resolves the new depnpm run compileregeneratesout/extension.cjsto a file byte-identical (or only-difference whitespace) to what's currently committed in this branchvsce packageproduces a working.vsixand the extension activates in a fresh VS Code instance🤖 Generated with Claude Code