@overcy/usage 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +42 -2
  2. package/bin/usage.cjs +2 -0
  3. package/package.json +24 -4
package/README.md CHANGED
@@ -1,3 +1,43 @@
1
- # Temporary Holding Version
1
+ # Usage npm launcher
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@overcy/usage` runs the native `usage` CLI from a platform-specific optional dependency. It supports macOS and Linux on arm64 and x64. Linux artifacts use musl. Node.js 20 or newer is required.
4
+
5
+ ```sh
6
+ npx @overcy/usage --help
7
+ npx @overcy/usage score ./window-inputs.json
8
+ ```
9
+
10
+ Install with optional dependencies enabled. The launcher forwards arguments, standard streams, exit codes, and termination signals to the native binary. It does not download binaries at runtime. There is no install script.
11
+
12
+ Tokens come from `COLLECTOR_TOKEN`, `READ_API_TOKEN`, and `BACKFILL_TOKEN` in the runtime environment. Do not pass secrets as arguments. The server runs separately as `usage-server`.
13
+
14
+ ## Assemble release tarballs
15
+
16
+ Run these commands from `packages/npm`. The release script assembles and packs files locally. It never publishes.
17
+
18
+ ```sh
19
+ npm ci --ignore-scripts
20
+ ./scripts/pack-release.mjs 0.1.0 /absolute/path/to/artifacts /absolute/path/to/npm-tarballs
21
+ ```
22
+
23
+ The artifact directory must contain these four flat files.
24
+
25
+ | File | npm package |
26
+ | ---------------------------------- | ---------------------------- |
27
+ | `usage-aarch64-apple-darwin` | `@overcy/usage-darwin-arm64` |
28
+ | `usage-x86_64-apple-darwin` | `@overcy/usage-darwin-x64` |
29
+ | `usage-x86_64-unknown-linux-musl` | `@overcy/usage-linux-x64` |
30
+ | `usage-aarch64-unknown-linux-musl` | `@overcy/usage-linux-arm64` |
31
+
32
+ The output directory receives four native package tarballs and `overcy-usage-<version>.tgz`. Every package and optional dependency uses the supplied version. Native packages declare `os` and `cpu`. Each contains an executable `bin/usage`. The launcher contains the esbuild bundle. Existing output tarballs with the same version are replaced. The source package version stays unchanged.
33
+
34
+ The source package is private and contains only build dependencies. The assembler adds the platform optional dependencies to the staged launcher manifest. This lets `npm ci` work before the native packages exist in a registry.
35
+
36
+ ```sh
37
+ npm run check
38
+ npm test
39
+ cargo build -p usage-cli --manifest-path ../../Cargo.toml
40
+ USAGE_TEST_BINARY=/absolute/path/to/usage npm run test:pack
41
+ ```
42
+
43
+ `test:pack` copies the host binary into all four artifact slots to verify assembly, then installs the launcher and the host package from local tarballs. It runs `npx --offline --no-install usage` and compares its version and file-scoring output with the native executable. It uses a disposable npm cache and disables registry access. Cross-platform execution belongs to the release build matrix.
package/bin/usage.cjs ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ var n=require("node:child_process"),a=require("node:module"),p={"darwin-arm64":"@overcy/usage-darwin-arm64","darwin-x64":"@overcy/usage-darwin-x64","linux-x64":"@overcy/usage-linux-x64","linux-arm64":"@overcy/usage-linux-arm64"},i=`${process.platform}-${process.arch}`,s=p[i];s||(console.error(`usage: unsupported platform ${i}. Use a native release binary.`),process.exit(1));var c;try{c=(0,a.createRequire)(__filename).resolve(`${s}/bin/usage`)}catch{console.error(`usage: missing ${s}. Reinstall @overcy/usage with optional dependencies enabled.`),process.exit(1)}var o=(0,n.spawn)(c,process.argv.slice(2),{stdio:"inherit"}),t=new Map;for(let e of["SIGINT","SIGTERM","SIGHUP"]){let r=()=>o.kill(e);t.set(e,r),process.on(e,r)}function l(){for(let[e,r]of t)process.off(e,r)}o.once("error",()=>{l(),console.error("usage: could not start the native binary. Check its permissions and architecture."),process.exitCode=1});o.once("exit",(e,r)=>{l(),r?process.kill(process.pid,r):process.exitCode=e??1});
package/package.json CHANGED
@@ -1,6 +1,26 @@
1
1
  {
2
2
  "name": "@overcy/usage",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Native usage CLI for telemetry configuration and TER scores",
5
+ "type": "module",
6
+ "license": "LicenseRef-Proprietary",
7
+ "bin": {
8
+ "usage": "bin/usage.cjs"
9
+ },
10
+ "files": [
11
+ "bin/usage.cjs",
12
+ "README.md"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20"
16
+ },
17
+ "optionalDependencies": {
18
+ "@overcy/usage-darwin-arm64": "0.1.0",
19
+ "@overcy/usage-darwin-x64": "0.1.0",
20
+ "@overcy/usage-linux-x64": "0.1.0",
21
+ "@overcy/usage-linux-arm64": "0.1.0"
22
+ },
23
+ "publishConfig": {
24
+ "access": "public"
25
+ }
26
+ }