From 148e898ea2bc7a6139201b2b44f8aef0416aef7f Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Thu, 27 Aug 2026 01:12:03 +0100 Subject: [PATCH 1/2] fix(cli): restore a publishable manifest and a real `bin` entry point The compiler shim has been unpublishable and uninstallable-as-a-CLI. Two gaps, both fixed here. 1. NO MANIFEST. `packages/affinescript-cli/` ships mod.js, pins.js, mod_test.js and mod.d.affine but has no package.json, jsr.json or deno.json - and git history shows one was never committed. The shim is live on JSR as @hyperpolymath/affinescript 0.1.2, so it was published from an untracked manifest and cannot be republished from a clean checkout. pins.js even instructs the maintainer to "bump THIS package's deno.json version in lockstep" with a file that is not in the tree. 2. NO `bin`. NOTHING in this repository declares a `bin` field, so nothing installs as an `affinescript` command. mod.js self-executes when it is the entry module but carries no hashbang, so it cannot be a `bin` target on Unix. bin/affinescript.js adds the hashbang and delegates to mod.js's exported run(); no behaviour moves. VERIFIED, not assumed: `bun bin/affinescript.js --version` and `node bin/affinescript.js --version` both resolve the pinned binary, verify its checksum, exec it, and print a version. package.json (not deno.json) because Deno is being removed estate-wide per the 2026-08-26 owner ruling; the manifest is npm-compatible so Bun, npm and Node all consume it. Version 0.1.2 matches what is already on JSR - same code, same version, two registries. FOUND WHILE TESTING, not fixed here: the shim resolves the v0.1.1 release binary, but that binary self-reports 0.1.0, while dune-project and lib/version.ml say 0.1.1. The v0.1.1 release was cut before the version bump landed. Flagged rather than silently re-pinned. STILL OPEN, needs a new tag: v0.2.0 has ZERO release assets. Root cause is in the logs - "HTTP 422: Cannot upload assets to an immutable release": the release was published before the build legs uploaded. release.yml has ALREADY been fixed for this (create as draft, upload, publish last, sealing atomically) but that fix has never been exercised. v0.2.0 is immutable and cannot be repaired retroactively; it needs a fresh tag to run the corrected workflow. --- packages/affinescript-cli/bin/affinescript.js | 16 ++++++++++ packages/affinescript-cli/package.json | 30 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 packages/affinescript-cli/bin/affinescript.js create mode 100644 packages/affinescript-cli/package.json diff --git a/packages/affinescript-cli/bin/affinescript.js b/packages/affinescript-cli/bin/affinescript.js new file mode 100755 index 00000000..cd2c3f0c --- /dev/null +++ b/packages/affinescript-cli/bin/affinescript.js @@ -0,0 +1,16 @@ +#!/usr/bin/env bun +// SPDX-License-Identifier: MPL-2.0 +// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) +// +// Executable entry point for the `affinescript` command. +// +// WHY THIS FILE EXISTS. `mod.js` already self-executes when it is the entry +// module, but it carries no hashbang, so it cannot be the target of a +// package.json `bin` field on Unix. This wrapper adds the hashbang and nothing +// else — all behaviour stays in mod.js. +import { run } from "../mod.js"; + +const argv = typeof Deno !== "undefined" ? Deno.args : process.argv.slice(2); +const code = await run(argv); +if (typeof Deno !== "undefined") Deno.exit(code); +else process.exit(code); diff --git a/packages/affinescript-cli/package.json b/packages/affinescript-cli/package.json new file mode 100644 index 00000000..c5dc19b5 --- /dev/null +++ b/packages/affinescript-cli/package.json @@ -0,0 +1,30 @@ +{ + "name": "@hyperpolymath/affinescript", + "version": "0.1.2", + "description": "Ergonomic front door for the AffineScript compiler: downloads the pinned native binary for the host platform, verifies its SHA-256, caches it, and execs it.", + "license": "MPL-2.0", + "type": "module", + "bin": { + "affinescript": "./bin/affinescript.js" + }, + "exports": { + ".": "./mod.js" + }, + "files": [ + "bin/affinescript.js", + "mod.js", + "pins.js", + "mod.d.affine" + ], + "engines": { + "bun": ">=1.0.0", + "node": ">=18.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/hyperpolymath/affinescript.git", + "directory": "packages/affinescript-cli" + }, + "homepage": "https://github.com/hyperpolymath/affinescript", + "keywords": ["affinescript", "compiler", "affine-types", "wasm"] +} From 456aa2c2b4fa050df0fb1b525309edaf91614b49 Mon Sep 17 00:00:00 2001 From: "Jonathan D.A. Jewell" <6759885+hyperpolymath@users.noreply.github.com> Date: Thu, 27 Aug 2026 10:10:30 +0100 Subject: [PATCH 2/2] Update packages/affinescript-cli/bin/affinescript.js Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> --- packages/affinescript-cli/bin/affinescript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/affinescript-cli/bin/affinescript.js b/packages/affinescript-cli/bin/affinescript.js index cd2c3f0c..a01690f6 100755 --- a/packages/affinescript-cli/bin/affinescript.js +++ b/packages/affinescript-cli/bin/affinescript.js @@ -1,4 +1,4 @@ -#!/usr/bin/env bun +#!/usr/bin/env node // SPDX-License-Identifier: MPL-2.0 // Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) //