sleev 1.7.6-beta.5 → 1.7.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.
@@ -1,8 +1,8 @@
1
1
  # Third-Party Notices
2
2
 
3
3
  <!-- Generated by tools/generate_third_party_notices.py; do not edit manually. -->
4
- <!-- cli/Cargo.lock SHA-256: 1eae9a69f647e9b5c9a53e3c52bd9752174d8680c9c5af2de1c8eff0b71a4d4d -->
5
- <!-- uv.lock SHA-256: fb9180c7943c6fd1e98155044b7bb941e27932392ce95ad479129b85c6f59cde -->
4
+ <!-- cli/Cargo.lock SHA-256: 1ef38f7b2788d58320be898719780aaf73beeb67ab866ea1cb24143e920a1e5c -->
5
+ <!-- uv.lock SHA-256: 5f3ec9a35594883397a1c56c9456f91b20b167e1264eaf998bd0fb568bbae523 -->
6
6
 
7
7
  Sleev's own code and materials are proprietary and are not covered by this
8
8
  document. Third-party components remain governed by their respective terms.
@@ -0,0 +1,50 @@
1
+ export const npmTargets = [
2
+ {
3
+ platform: "linux",
4
+ npmOs: "linux",
5
+ arch: "x64",
6
+ triple: "x86_64-unknown-linux-musl",
7
+ },
8
+ {
9
+ platform: "linux",
10
+ npmOs: "linux",
11
+ arch: "arm64",
12
+ triple: "aarch64-unknown-linux-musl",
13
+ },
14
+ {
15
+ platform: "darwin",
16
+ npmOs: "darwin",
17
+ arch: "x64",
18
+ triple: "x86_64-apple-darwin",
19
+ },
20
+ {
21
+ platform: "darwin",
22
+ npmOs: "darwin",
23
+ arch: "arm64",
24
+ triple: "aarch64-apple-darwin",
25
+ },
26
+ {
27
+ platform: "windows",
28
+ npmOs: "win32",
29
+ arch: "x64",
30
+ triple: "x86_64-pc-windows-msvc",
31
+ ext: ".exe",
32
+ },
33
+ {
34
+ platform: "windows",
35
+ npmOs: "win32",
36
+ arch: "arm64",
37
+ triple: "aarch64-pc-windows-msvc",
38
+ ext: ".exe",
39
+ },
40
+ ];
41
+
42
+ export function npmPackageName(target) {
43
+ return `sleev-${target.platform}-${target.arch}`;
44
+ }
45
+
46
+ export function npmTargetFor(platform, arch) {
47
+ return npmTargets.find(
48
+ (target) => target.npmOs === platform && target.arch === arch,
49
+ );
50
+ }
package/bin/sleev.js ADDED
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from "node:child_process";
4
+ import { createRequire } from "node:module";
5
+ import {
6
+ npmPackageName,
7
+ npmTargetFor,
8
+ } from "./npm-platforms.mjs";
9
+
10
+ const target = npmTargetFor(process.platform, process.arch);
11
+ if (!target) {
12
+ console.error(
13
+ `Sleev does not support ${process.platform}-${process.arch}.`,
14
+ );
15
+ process.exit(1);
16
+ }
17
+
18
+ const packageName = npmPackageName(target);
19
+ let binary;
20
+ try {
21
+ binary = createRequire(import.meta.url).resolve(packageName);
22
+ } catch {
23
+ console.error(
24
+ [
25
+ `Sleev could not find its native package (${packageName}).`,
26
+ "Reinstall without --omit=optional and ensure optional dependencies are enabled.",
27
+ ].join("\n"),
28
+ );
29
+ process.exit(1);
30
+ }
31
+
32
+ const result = spawnSync(binary, process.argv.slice(2), {
33
+ stdio: "inherit",
34
+ windowsHide: false,
35
+ });
36
+ if (result.error) {
37
+ console.error(`Sleev could not start ${binary}: ${result.error.message}`);
38
+ process.exit(1);
39
+ }
40
+ if (result.signal) {
41
+ process.kill(process.pid, result.signal);
42
+ }
43
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sleev",
3
- "version": "1.7.6-beta.5",
3
+ "version": "1.7.7",
4
4
  "description": "Sleev CLI tool.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,21 +9,18 @@
9
9
  },
10
10
  "type": "module",
11
11
  "bin": {
12
- "sleev": "./bin/sleev.exe"
13
- },
14
- "scripts": {
15
- "postinstall": "node ./postinstall.mjs"
12
+ "sleev": "./bin/sleev.js"
16
13
  },
17
14
  "publishConfig": {
18
15
  "access": "public"
19
16
  },
20
17
  "optionalDependencies": {
21
- "sleev-linux-x64": "1.7.6-beta.5",
22
- "sleev-linux-arm64": "1.7.6-beta.5",
23
- "sleev-darwin-x64": "1.7.6-beta.5",
24
- "sleev-darwin-arm64": "1.7.6-beta.5",
25
- "sleev-windows-x64": "1.7.6-beta.5",
26
- "sleev-windows-arm64": "1.7.6-beta.5"
18
+ "sleev-linux-x64": "1.7.7",
19
+ "sleev-linux-arm64": "1.7.7",
20
+ "sleev-darwin-x64": "1.7.7",
21
+ "sleev-darwin-arm64": "1.7.7",
22
+ "sleev-windows-x64": "1.7.7",
23
+ "sleev-windows-arm64": "1.7.7"
27
24
  },
28
25
  "keywords": [
29
26
  "sleev",
@@ -39,7 +36,6 @@
39
36
  "files": [
40
37
  "bin",
41
38
  "README.md",
42
- "postinstall.mjs",
43
39
  "LICENSE.md",
44
40
  "EULA.md",
45
41
  "THIRD_PARTY_NOTICES.md"
package/bin/sleev.exe DELETED
@@ -1,3 +0,0 @@
1
- echo "Error: sleev's postinstall script was not run." >&2
2
- echo "Reinstall without --ignore-scripts, or run node postinstall.mjs in the package directory." >&2
3
- exit 1
package/postinstall.mjs DELETED
@@ -1,88 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { spawnSync } from "node:child_process";
4
- import {
5
- chmodSync,
6
- copyFileSync,
7
- existsSync,
8
- linkSync,
9
- mkdirSync,
10
- realpathSync,
11
- unlinkSync,
12
- } from "node:fs";
13
- import { dirname, join } from "node:path";
14
- import { fileURLToPath } from "node:url";
15
-
16
- if (process.env.SLEEV_SKIP_POSTINSTALL) process.exit(0);
17
-
18
- const platformMap = {
19
- darwin: "darwin",
20
- linux: "linux",
21
- win32: "windows",
22
- };
23
-
24
- const archMap = {
25
- arm64: "arm64",
26
- x64: "x64",
27
- };
28
-
29
- const platform = platformMap[process.platform] ?? process.platform;
30
- const arch = archMap[process.arch] ?? process.arch;
31
- const packageName = `sleev-${platform}-${arch}`;
32
- const binary = process.platform === "win32" ? "sleev.exe" : "sleev";
33
-
34
- function findBinary(startDir) {
35
- let current = startDir;
36
- for (;;) {
37
- const candidate = join(
38
- current,
39
- "node_modules",
40
- packageName,
41
- "bin",
42
- binary,
43
- );
44
- if (existsSync(candidate)) return candidate;
45
-
46
- const parent = dirname(current);
47
- if (parent === current) return undefined;
48
- current = parent;
49
- }
50
- }
51
-
52
- const scriptDir = dirname(realpathSync(fileURLToPath(import.meta.url)));
53
- const resolved = process.env.SLEEV_BIN_PATH || findBinary(scriptDir);
54
- const target = join(scriptDir, "bin", "sleev.exe");
55
-
56
- if (!resolved) {
57
- console.error(
58
- [
59
- `Sleev could not find ${packageName}.`,
60
- "This package is installed as an optional dependency that matches your platform.",
61
- "Try reinstalling without --ignore-scripts/--omit=optional, or set SLEEV_SKIP_POSTINSTALL=1 to skip this check.",
62
- ].join("\n"),
63
- );
64
- process.exit(1);
65
- }
66
-
67
- mkdirSync(dirname(target), { recursive: true });
68
- if (existsSync(target)) unlinkSync(target);
69
- try {
70
- linkSync(resolved, target);
71
- } catch {
72
- copyFileSync(resolved, target);
73
- }
74
- chmodSync(target, 0o755);
75
-
76
- const result = spawnSync(target, ["--version"], {
77
- encoding: "utf8",
78
- stdio: "pipe",
79
- timeout: 5000,
80
- windowsHide: true,
81
- });
82
-
83
- if (result.status !== 0 || !/^\d+\.\d+\.\d+/.test(result.stdout.trim())) {
84
- console.error(`Sleev native binary verification failed: ${target}`);
85
- if (result.stderr) console.error(result.stderr);
86
- if (result.stdout) console.error(result.stdout);
87
- process.exit(result.status ?? 1);
88
- }