Skip to content

Commit e511fac

Browse files
fix(cli): restore a publishable manifest and a real bin entry point (#727)
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 **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` entry **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 → resolves, verifies, execs, prints a version node bin/affinescript.js --version → same ``` Both resolve the pinned release binary, check its SHA-256, cache it, and exec it. ## Why `package.json` and not `deno.json` Deno is being removed estate-wide per the 2026-08-26 owner ruling (#655). 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 — flagged, not silently fixed The shim resolves the **v0.1.1** release binary, but that binary **self-reports `0.1.0`**, while `dune-project` and `lib/version.ml` both say `0.1.1`. The v0.1.1 release was cut before the version bump landed. ## Still open — needs a fresh tag **`v0.2.0` has zero release assets.** Root cause is in the run 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 exactly 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 new tag to run the corrected workflow. ## Scope note This makes AffineScript installable. It does **not** unblock the 18 estate repos whose `deno.json` files request `affinescript@^12.0.0` — that version has never existed, the CLI has no `build`/`clean`/`-w` subcommands, and it rejects `.res` input outright (demonstrated: a real estate `.res` file gives `parse error`). Those repos need their sources ported. Full analysis: standards#658. --------- Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
1 parent 09e92de commit e511fac

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 node
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)