@auv-js/cli 0.0.10 → 0.0.11

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.
package/dist/binary.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from "node:module";
2
2
  import process from "node:process";
3
- import { accessSync, constants, readFileSync } from "node:fs";
3
+ import { accessSync, constants } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  //#region src-js/binary.ts
6
6
  const require = createRequire(import.meta.url);
@@ -30,7 +30,6 @@ function binaryPath() {
30
30
  } catch (cause) {
31
31
  throw new AuvBinaryError(`The optional package ${packageName} is missing. Reinstall @auv-js/cli without omitting optional dependencies.`, { cause });
32
32
  }
33
- verifyPackageVersion(packageName, manifestPath);
34
33
  const resolvedPath = join(dirname(manifestPath), executable);
35
34
  try {
36
35
  accessSync(resolvedPath, process.platform === "win32" ? constants.F_OK : constants.X_OK);
@@ -42,11 +41,6 @@ function binaryPath() {
42
41
  function isMusl() {
43
42
  return (process.report?.getReport?.())?.header?.glibcVersionRuntime === void 0;
44
43
  }
45
- function verifyPackageVersion(packageName, manifestPath) {
46
- const rootManifest = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
47
- const platformManifest = JSON.parse(readFileSync(manifestPath, "utf8"));
48
- if (platformManifest.version !== rootManifest.version) throw new AuvBinaryError(`The installed ${packageName} version (${platformManifest.version}) does not match @auv-js/cli (${rootManifest.version}). Reinstall both packages together.`);
49
- }
50
44
  //#endregion
51
45
  export { AuvBinaryError, binaryPath };
52
46
 
@@ -1 +1 @@
1
- {"version":3,"file":"binary.js","names":[],"sources":["../src-js/binary.ts"],"sourcesContent":["import process from 'node:process'\n\nimport { accessSync, constants, readFileSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join } from 'node:path'\n\nconst require = createRequire(import.meta.url)\n\nconst PLATFORM_PACKAGES = new Map<string, readonly [string, string]>([\n ['darwin-arm64', ['@auv-js/cli-darwin-arm64', 'bin/auv']],\n ['darwin-x64', ['@auv-js/cli-darwin-x64', 'bin/auv']],\n ['linux-arm64', ['@auv-js/cli-linux-arm64-gnu', 'bin/auv']],\n ['linux-x64', ['@auv-js/cli-linux-x64-gnu', 'bin/auv']],\n ['win32-x64', ['@auv-js/cli-win32-x64-msvc', 'bin/auv.exe']],\n])\n\ninterface DiagnosticReport {\n header?: {\n glibcVersionRuntime?: string\n }\n}\n\ninterface PackageManifest {\n version: string\n}\n\nexport class AuvBinaryError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options)\n this.name = 'AuvBinaryError'\n }\n}\n\n/** Return the absolute path of the AUV executable installed for this host. */\nexport function binaryPath(): string {\n const platformKey = `${process.platform}-${process.arch}`\n const platformPackage = PLATFORM_PACKAGES.get(platformKey)\n\n if (!platformPackage) {\n throw new AuvBinaryError(\n `AUV does not publish an executable for ${process.platform}/${process.arch}.`,\n )\n }\n\n if (process.platform === 'linux' && isMusl()) {\n throw new AuvBinaryError(\n 'AUV currently publishes glibc Linux executables only; musl Linux is not supported.',\n )\n }\n\n const [packageName, executable] = platformPackage\n let manifestPath: string\n\n try {\n manifestPath = require.resolve(`${packageName}/package.json`)\n }\n catch (cause) {\n throw new AuvBinaryError(\n `The optional package ${packageName} is missing. Reinstall @auv-js/cli without omitting optional dependencies.`,\n { cause },\n )\n }\n\n verifyPackageVersion(packageName, manifestPath)\n\n const resolvedPath = join(dirname(manifestPath), executable)\n try {\n accessSync(\n resolvedPath,\n process.platform === 'win32' ? constants.F_OK : constants.X_OK,\n )\n }\n catch (cause) {\n throw new AuvBinaryError(\n `The ${packageName} package does not contain an executable AUV binary at ${resolvedPath}.`,\n { cause },\n )\n }\n\n return resolvedPath\n}\n\nfunction isMusl(): boolean {\n const report = process.report?.getReport?.() as DiagnosticReport | undefined\n return report?.header?.glibcVersionRuntime === undefined\n}\n\nfunction verifyPackageVersion(packageName: string, manifestPath: string): void {\n const rootManifest = JSON.parse(\n readFileSync(new URL('../package.json', import.meta.url), 'utf8'),\n ) as PackageManifest\n const platformManifest = JSON.parse(\n readFileSync(manifestPath, 'utf8'),\n ) as PackageManifest\n\n if (platformManifest.version !== rootManifest.version) {\n throw new AuvBinaryError(\n `The installed ${packageName} version (${platformManifest.version}) does not match @auv-js/cli (${rootManifest.version}). Reinstall both packages together.`,\n )\n }\n}\n"],"mappings":";;;;;AAMA,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAE7C,MAAM,oCAAoB,IAAI,IAAuC;CACnE,CAAC,gBAAgB,CAAC,4BAA4B,SAAS,CAAC;CACxD,CAAC,cAAc,CAAC,0BAA0B,SAAS,CAAC;CACpD,CAAC,eAAe,CAAC,+BAA+B,SAAS,CAAC;CAC1D,CAAC,aAAa,CAAC,6BAA6B,SAAS,CAAC;CACtD,CAAC,aAAa,CAAC,8BAA8B,aAAa,CAAC;AAC7D,CAAC;AAYD,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,SAAiB,SAAwB;EACnD,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,aAAqB;CACnC,MAAM,cAAc,GAAG,QAAQ,SAAS,GAAG,QAAQ;CACnD,MAAM,kBAAkB,kBAAkB,IAAI,WAAW;CAEzD,IAAI,CAAC,iBACH,MAAM,IAAI,eACR,0CAA0C,QAAQ,SAAS,GAAG,QAAQ,KAAK,EAC7E;CAGF,IAAI,QAAQ,aAAa,WAAW,OAAO,GACzC,MAAM,IAAI,eACR,oFACF;CAGF,MAAM,CAAC,aAAa,cAAc;CAClC,IAAI;CAEJ,IAAI;EACF,eAAe,QAAQ,QAAQ,GAAG,YAAY,cAAc;CAC9D,SACO,OAAO;EACZ,MAAM,IAAI,eACR,wBAAwB,YAAY,6EACpC,EAAE,MAAM,CACV;CACF;CAEA,qBAAqB,aAAa,YAAY;CAE9C,MAAM,eAAe,KAAK,QAAQ,YAAY,GAAG,UAAU;CAC3D,IAAI;EACF,WACE,cACA,QAAQ,aAAa,UAAU,UAAU,OAAO,UAAU,IAC5D;CACF,SACO,OAAO;EACZ,MAAM,IAAI,eACR,OAAO,YAAY,wDAAwD,aAAa,IACxF,EAAE,MAAM,CACV;CACF;CAEA,OAAO;AACT;AAEA,SAAS,SAAkB;CAEzB,QADe,QAAQ,QAAQ,YAAY,EAAA,EAC5B,QAAQ,wBAAwB,KAAA;AACjD;AAEA,SAAS,qBAAqB,aAAqB,cAA4B;CAC7E,MAAM,eAAe,KAAK,MACxB,aAAa,IAAI,IAAI,mBAAmB,OAAO,KAAK,GAAG,GAAG,MAAM,CAClE;CACA,MAAM,mBAAmB,KAAK,MAC5B,aAAa,cAAc,MAAM,CACnC;CAEA,IAAI,iBAAiB,YAAY,aAAa,SAC5C,MAAM,IAAI,eACR,iBAAiB,YAAY,YAAY,iBAAiB,QAAQ,gCAAgC,aAAa,QAAQ,qCACzH;AAEJ"}
1
+ {"version":3,"file":"binary.js","names":[],"sources":["../src-js/binary.ts"],"sourcesContent":["import process from 'node:process'\n\nimport { accessSync, constants } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport { dirname, join } from 'node:path'\n\nconst require = createRequire(import.meta.url)\n\nconst PLATFORM_PACKAGES = new Map<string, readonly [string, string]>([\n ['darwin-arm64', ['@auv-js/cli-darwin-arm64', 'bin/auv']],\n ['darwin-x64', ['@auv-js/cli-darwin-x64', 'bin/auv']],\n ['linux-arm64', ['@auv-js/cli-linux-arm64-gnu', 'bin/auv']],\n ['linux-x64', ['@auv-js/cli-linux-x64-gnu', 'bin/auv']],\n ['win32-x64', ['@auv-js/cli-win32-x64-msvc', 'bin/auv.exe']],\n])\n\ninterface DiagnosticReport {\n header?: {\n glibcVersionRuntime?: string\n }\n}\n\nexport class AuvBinaryError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options)\n this.name = 'AuvBinaryError'\n }\n}\n\n/** Return the absolute path of the AUV executable installed for this host. */\nexport function binaryPath(): string {\n const platformKey = `${process.platform}-${process.arch}`\n\n const platformPackage = PLATFORM_PACKAGES.get(platformKey)\n if (!platformPackage) {\n throw new AuvBinaryError(`AUV does not publish an executable for ${process.platform}/${process.arch}.`)\n }\n if (process.platform === 'linux' && isMusl()) {\n throw new AuvBinaryError('AUV currently publishes glibc Linux executables only; musl Linux is not supported.')\n }\n\n const [packageName, executable] = platformPackage\n let manifestPath: string\n\n try {\n manifestPath = require.resolve(`${packageName}/package.json`)\n }\n catch (cause) {\n throw new AuvBinaryError(`The optional package ${packageName} is missing. Reinstall @auv-js/cli without omitting optional dependencies.`, { cause })\n }\n\n const resolvedPath = join(dirname(manifestPath), executable)\n try {\n accessSync(resolvedPath, process.platform === 'win32' ? constants.F_OK : constants.X_OK)\n }\n catch (cause) {\n throw new AuvBinaryError(`The ${packageName} package does not contain an executable AUV binary at ${resolvedPath}.`, { cause })\n }\n\n return resolvedPath\n}\n\nfunction isMusl(): boolean {\n const report = process.report?.getReport?.() as DiagnosticReport | undefined\n return report?.header?.glibcVersionRuntime === undefined\n}\n"],"mappings":";;;;;AAMA,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAE7C,MAAM,oCAAoB,IAAI,IAAuC;CACnE,CAAC,gBAAgB,CAAC,4BAA4B,SAAS,CAAC;CACxD,CAAC,cAAc,CAAC,0BAA0B,SAAS,CAAC;CACpD,CAAC,eAAe,CAAC,+BAA+B,SAAS,CAAC;CAC1D,CAAC,aAAa,CAAC,6BAA6B,SAAS,CAAC;CACtD,CAAC,aAAa,CAAC,8BAA8B,aAAa,CAAC;AAC7D,CAAC;AAQD,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAY,SAAiB,SAAwB;EACnD,MAAM,SAAS,OAAO;EACtB,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,aAAqB;CACnC,MAAM,cAAc,GAAG,QAAQ,SAAS,GAAG,QAAQ;CAEnD,MAAM,kBAAkB,kBAAkB,IAAI,WAAW;CACzD,IAAI,CAAC,iBACH,MAAM,IAAI,eAAe,0CAA0C,QAAQ,SAAS,GAAG,QAAQ,KAAK,EAAE;CAExG,IAAI,QAAQ,aAAa,WAAW,OAAO,GACzC,MAAM,IAAI,eAAe,oFAAoF;CAG/G,MAAM,CAAC,aAAa,cAAc;CAClC,IAAI;CAEJ,IAAI;EACF,eAAe,QAAQ,QAAQ,GAAG,YAAY,cAAc;CAC9D,SACO,OAAO;EACZ,MAAM,IAAI,eAAe,wBAAwB,YAAY,6EAA6E,EAAE,MAAM,CAAC;CACrJ;CAEA,MAAM,eAAe,KAAK,QAAQ,YAAY,GAAG,UAAU;CAC3D,IAAI;EACF,WAAW,cAAc,QAAQ,aAAa,UAAU,UAAU,OAAO,UAAU,IAAI;CACzF,SACO,OAAO;EACZ,MAAM,IAAI,eAAe,OAAO,YAAY,wDAAwD,aAAa,IAAI,EAAE,MAAM,CAAC;CAChI;CAEA,OAAO;AACT;AAEA,SAAS,SAAkB;CAEzB,QADe,QAAQ,QAAQ,YAAY,EAAA,EAC5B,QAAQ,wBAAwB,KAAA;AACjD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@auv-js/cli",
3
3
  "type": "module",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "NAPI bindings and the platform-matched AUV command-line executable",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -56,16 +56,17 @@
56
56
  ]
57
57
  },
58
58
  "optionalDependencies": {
59
- "@auv-js/cli-darwin-arm64": "0.0.10",
60
- "@auv-js/cli-linux-arm64-gnu": "0.0.10",
61
- "@auv-js/cli-darwin-x64": "0.0.10",
62
- "@auv-js/cli-win32-x64-msvc": "0.0.10",
63
- "@auv-js/cli-linux-x64-gnu": "0.0.10"
59
+ "@auv-js/cli-darwin-arm64": "0.0.11",
60
+ "@auv-js/cli-linux-arm64-gnu": "0.0.11",
61
+ "@auv-js/cli-darwin-x64": "0.0.11",
62
+ "@auv-js/cli-win32-x64-msvc": "0.0.11",
63
+ "@auv-js/cli-linux-x64-gnu": "0.0.11"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@emnapi/core": "^1.11.2",
67
67
  "@emnapi/runtime": "^1.11.2",
68
68
  "@napi-rs/cli": "^3.8.6",
69
+ "@pnpm/find-workspace-dir": "1000.1.5",
69
70
  "emnapi": "^1.11.3",
70
71
  "tsdown": "^0.22.3",
71
72
  "tsx": "^4.23.12",