@getsigit/sigit 1.5.6 → 1.5.7

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/README.md CHANGED
@@ -21,6 +21,14 @@ npm install -g @getsigit/sigit
21
21
 
22
22
  npm pulls in the right binary for your platform automatically.
23
23
 
24
+ If you installed this before 1.5.5, you have it under its old name,
25
+ `@smbcloud/sigit`. That name still gets every release, so nothing is broken,
26
+ but `@getsigit/sigit` is the one to move to:
27
+
28
+ ```sh
29
+ npm uninstall -g @smbcloud/sigit && npm install -g @getsigit/sigit
30
+ ```
31
+
24
32
  Supported targets:
25
33
 
26
34
  - macOS, Apple Silicon and Intel
package/lib/index.js CHANGED
@@ -2,6 +2,17 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const child_process_1 = require("child_process");
5
+ /**
6
+ * The same launcher ships under two names: `@getsigit/sigit`, and
7
+ * `@smbcloud/sigit`, which is what the package was called before 1.5.5. Each
8
+ * one carries its own set of platform packages, so which scope to look the
9
+ * binary up in is whichever scope this copy was published under.
10
+ */
11
+ function getScope() {
12
+ const selfName = require("../package.json").name;
13
+ const scope = selfName.split("/")[0];
14
+ return scope.startsWith("@") ? scope : "@getsigit";
15
+ }
5
16
  /**
6
17
  * Returns the executable path which is located inside node_modules
7
18
  * The naming convention is cli-OS-ARCH
@@ -20,17 +31,34 @@ function getExePath() {
20
31
  }
21
32
  try {
22
33
  // Since the binary will be located inside node_modules, we can simply call require.resolve
23
- return require.resolve(`@getsigit/sigit-${os}-${arch}/bin/sigit${extension}`);
34
+ return require.resolve(`${getScope()}/sigit-${os}-${arch}/bin/sigit${extension}`);
24
35
  }
25
36
  catch (e) {
26
37
  throw new Error(`Couldn't find application binary inside node_modules for ${os}-${arch}`);
27
38
  }
28
39
  }
40
+ /**
41
+ * `@smbcloud/sigit` is kept publishing so that an install predating the rename
42
+ * keeps updating instead of sitting on 1.5.2, but `@getsigit/sigit` is the
43
+ * name the project actually goes by. Say so, once per run, on stderr — in ACP
44
+ * mode stdout is the JSON-RPC pipe to the editor.
45
+ */
46
+ function warnIfDeprecatedName() {
47
+ if (getScope() !== "@smbcloud")
48
+ return;
49
+ if (process.env.SIGIT_SUPPRESS_SCOPE_NOTICE)
50
+ return;
51
+ process.stderr.write("@smbcloud/sigit is the old name for @getsigit/sigit. Both names get the " +
52
+ "same release for now; the new one is where siGit Code lives:\n" +
53
+ " npm uninstall -g @smbcloud/sigit && npm install -g @getsigit/sigit\n" +
54
+ "Set SIGIT_SUPPRESS_SCOPE_NOTICE=1 to silence this.\n");
55
+ }
29
56
  /**
30
57
  * Runs the application with args using nodejs spawn
31
58
  */
32
59
  function run() {
33
60
  var _a;
61
+ warnIfDeprecatedName();
34
62
  const args = process.argv.slice(2);
35
63
  const processResult = (0, child_process_1.spawnSync)(getExePath(), args, { stdio: "inherit" });
36
64
  process.exit((_a = processResult.status) !== null && _a !== void 0 ? _a : 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getsigit/sigit",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
4
4
  "keywords": [
5
5
  "sigit",
6
6
  "cli",
@@ -31,11 +31,11 @@
31
31
  "typescript": "^5.0.0"
32
32
  },
33
33
  "optionalDependencies": {
34
- "@getsigit/sigit-darwin-arm64": "1.5.6",
35
- "@getsigit/sigit-darwin-x64": "1.5.6",
36
- "@getsigit/sigit-linux-arm64": "1.5.6",
37
- "@getsigit/sigit-linux-x64": "1.5.6",
38
- "@getsigit/sigit-windows-arm64": "1.5.6",
39
- "@getsigit/sigit-windows-x64": "1.5.6"
34
+ "@getsigit/sigit-darwin-arm64": "1.5.7",
35
+ "@getsigit/sigit-darwin-x64": "1.5.7",
36
+ "@getsigit/sigit-linux-arm64": "1.5.7",
37
+ "@getsigit/sigit-linux-x64": "1.5.7",
38
+ "@getsigit/sigit-windows-arm64": "1.5.7",
39
+ "@getsigit/sigit-windows-x64": "1.5.7"
40
40
  }
41
41
  }