@labelbox/horizon-cli 0.0.0-stage → 0.0.1

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.
@@ -0,0 +1,22 @@
1
+ import { readFileSync } from 'node:fs';
2
+ // Kept out of `program.ts` deliberately. This is the only place in the package that
3
+ // touches `import.meta.url`. The backend is a CommonJS build and loads this package
4
+ // through `require(esm)`, which needs Node >= 22.12 — a floor pinned by the
5
+ // *backend's* `engines` (">= 24") and its `node:24` image, not by this package,
6
+ // which declares none. So the embeddable chain has to stay clear of anything a CJS
7
+ // consumer cannot reach. Nothing but the terminal entrypoint needs the version: the
8
+ // program takes it as an input, so an embedder supplies its own.
9
+ /**
10
+ * Read at runtime so the tag-only publish flow's stamped version is reported;
11
+ * local/dev builds will report the committed placeholder (0.0.0).
12
+ */
13
+ export function readCliVersion() {
14
+ const parsed = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
15
+ if (typeof parsed === 'object' &&
16
+ parsed !== null &&
17
+ 'version' in parsed &&
18
+ typeof parsed.version === 'string') {
19
+ return parsed.version;
20
+ }
21
+ throw new Error('could not read the CLI version from package.json');
22
+ }
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@labelbox/horizon-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.0.1",
4
+ "description": "Command-line client for Horizon",
5
+ "type": "module",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/Labelbox/recursion-platform.git",
9
+ "directory": "packages/horizon-cli"
10
+ },
11
+ "bin": {
12
+ "horizon": "dist/bin.js"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "engines": {
18
+ "node": ">= 24"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public",
22
+ "registry": "https://registry.npmjs.org"
23
+ },
24
+ "exports": {
25
+ "./program": {
26
+ "types": "./dist/program.d.ts",
27
+ "import": "./dist/program.js"
28
+ },
29
+ "./embed": {
30
+ "types": "./dist/embed.d.ts",
31
+ "default": "./dist/embed.js"
32
+ }
33
+ },
34
+ "typesVersions": {
35
+ "*": {
36
+ "embed": [
37
+ "./dist/embed.d.ts"
38
+ ],
39
+ "program": [
40
+ "./dist/program.d.ts"
41
+ ]
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.build.json",
46
+ "check": "yarn lint && tsc --noEmit",
47
+ "lint": "biome ci --error-on-warnings --config-path ./biome.json .",
48
+ "lint:fix": "biome check --config-path ./biome.json --write .",
49
+ "test": "vitest run",
50
+ "prepare": "yarn build",
51
+ "type-check": "tsc --noEmit"
52
+ },
53
+ "dependencies": {
54
+ "commander": "^14.0.0",
55
+ "zod": "^4.3.6"
56
+ },
57
+ "devDependencies": {
58
+ "@biomejs/biome": "2.4.6",
59
+ "@typescript/native": "npm:typescript@^7.0.2",
60
+ "typescript": "npm:@typescript/typescript6@^6.0.2",
61
+ "vitest": "^4.0.18"
62
+ }
63
+ }