Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions packages/affinescript-cli/bin/affinescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
//
// 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);
30 changes: 30 additions & 0 deletions packages/affinescript-cli/package.json
Original file line number Diff line number Diff line change
@@ -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"]
}
Loading