printobserver-cli 0.2.0 → 0.4.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.
@@ -15,12 +15,27 @@
15
15
  import { spawnSync } from "node:child_process";
16
16
  import { createRequire } from "node:module";
17
17
 
18
- /** What each supported platform's package is called, by what Node reports. */
18
+ /**
19
+ * What each supported platform's package is called, by what Node reports.
20
+ *
21
+ * `just check-repo`'s `platform-facts` holds this map to AGENTS.md's
22
+ * supported-platform list in both directions: a platform the install path
23
+ * targets is here, and nothing else is.
24
+ */
19
25
  const PACKAGES = {
20
26
  "linux-x64": "@printobserver/cli-linux-x64",
21
27
  "linux-arm64": "@printobserver/cli-linux-arm64",
28
+ "darwin-arm64": "@printobserver/cli-darwin-arm64",
29
+ "win32-x64": "@printobserver/cli-win32-x64",
30
+ "win32-arm64": "@printobserver/cli-win32-arm64",
22
31
  };
23
32
 
33
+ /**
34
+ * What the program's own file is called inside its package: Windows finds a
35
+ * program by its suffix, and a file with none is one it will not run.
36
+ */
37
+ const PROGRAM = process.platform === "win32" ? "printobserver.exe" : "printobserver";
38
+
24
39
  const platform = `${process.platform}-${process.arch}`;
25
40
  const name = PACKAGES[platform];
26
41
  if (name === undefined) {
@@ -35,7 +50,7 @@ if (name === undefined) {
35
50
  const require = createRequire(import.meta.url);
36
51
  let program;
37
52
  try {
38
- program = require.resolve(`${name}/bin/printobserver`);
53
+ program = require.resolve(`${name}/bin/${PROGRAM}`);
39
54
  } catch {
40
55
  process.stderr.write(
41
56
  `printobserver: the program for ${platform} is not installed. Its package is ` +
package/package.json CHANGED
@@ -9,13 +9,16 @@
9
9
  "license": "MIT",
10
10
  "name": "printobserver-cli",
11
11
  "optionalDependencies": {
12
- "@printobserver/cli-linux-arm64": "0.2.0",
13
- "@printobserver/cli-linux-x64": "0.2.0"
12
+ "@printobserver/cli-darwin-arm64": "0.4.0",
13
+ "@printobserver/cli-linux-arm64": "0.4.0",
14
+ "@printobserver/cli-linux-x64": "0.4.0",
15
+ "@printobserver/cli-win32-arm64": "0.4.0",
16
+ "@printobserver/cli-win32-x64": "0.4.0"
14
17
  },
15
18
  "repository": {
16
19
  "type": "git",
17
20
  "url": "https://github.com/nickderobertis/printobserver"
18
21
  },
19
22
  "type": "module",
20
- "version": "0.2.0"
23
+ "version": "0.4.0"
21
24
  }