Skip to content

Commit 148e898

Browse files
committed
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.
1 parent 62757ba commit 148e898

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bun
2+
// SPDX-License-Identifier: MPL-2.0
3+
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
4+
//
5+
// Executable entry point for the `affinescript` command.
6+
//
7+
// WHY THIS FILE EXISTS. `mod.js` already self-executes when it is the entry
8+
// module, but it carries no hashbang, so it cannot be the target of a
9+
// package.json `bin` field on Unix. This wrapper adds the hashbang and nothing
10+
// else — all behaviour stays in mod.js.
11+
import { run } from "../mod.js";
12+
13+
const argv = typeof Deno !== "undefined" ? Deno.args : process.argv.slice(2);
14+
const code = await run(argv);
15+
if (typeof Deno !== "undefined") Deno.exit(code);
16+
else process.exit(code);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@hyperpolymath/affinescript",
3+
"version": "0.1.2",
4+
"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.",
5+
"license": "MPL-2.0",
6+
"type": "module",
7+
"bin": {
8+
"affinescript": "./bin/affinescript.js"
9+
},
10+
"exports": {
11+
".": "./mod.js"
12+
},
13+
"files": [
14+
"bin/affinescript.js",
15+
"mod.js",
16+
"pins.js",
17+
"mod.d.affine"
18+
],
19+
"engines": {
20+
"bun": ">=1.0.0",
21+
"node": ">=18.0.0"
22+
},
23+
"repository": {
24+
"type": "git",
25+
"url": "git+https://github.com/hyperpolymath/affinescript.git",
26+
"directory": "packages/affinescript-cli"
27+
},
28+
"homepage": "https://github.com/hyperpolymath/affinescript",
29+
"keywords": ["affinescript", "compiler", "affine-types", "wasm"]
30+
}

0 commit comments

Comments
 (0)