diff --git a/packages/affinescript-cli/bin/affinescript.js b/packages/affinescript-cli/bin/affinescript.js new file mode 100755 index 00000000..a01690f6 --- /dev/null +++ b/packages/affinescript-cli/bin/affinescript.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +// 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"] +}