@randomlabs/slate 1.0.26 → 1.0.28

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.
Files changed (2) hide show
  1. package/package.json +12 -12
  2. package/bin/bin/slate +0 -96
package/package.json CHANGED
@@ -6,19 +6,19 @@
6
6
  "scripts": {
7
7
  "postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
8
8
  },
9
- "version": "1.0.26",
9
+ "version": "1.0.28",
10
10
  "license": "Proprietary",
11
11
  "optionalDependencies": {
12
- "@randomlabs/slate-linux-arm64": "1.0.26",
13
- "@randomlabs/slate-linux-x64-baseline-musl": "1.0.26",
14
- "@randomlabs/slate-darwin-arm64": "1.0.26",
15
- "@randomlabs/slate-windows-x64": "1.0.26",
16
- "@randomlabs/slate-windows-x64-baseline": "1.0.26",
17
- "@randomlabs/slate-darwin-x64": "1.0.26",
18
- "@randomlabs/slate-linux-x64-musl": "1.0.26",
19
- "@randomlabs/slate-linux-arm64-musl": "1.0.26",
20
- "@randomlabs/slate-linux-x64-baseline": "1.0.26",
21
- "@randomlabs/slate-darwin-x64-baseline": "1.0.26",
22
- "@randomlabs/slate-linux-x64": "1.0.26"
12
+ "@randomlabs/slate-linux-arm64": "1.0.28",
13
+ "@randomlabs/slate-linux-x64-baseline-musl": "1.0.28",
14
+ "@randomlabs/slate-darwin-arm64": "1.0.28",
15
+ "@randomlabs/slate-windows-x64": "1.0.28",
16
+ "@randomlabs/slate-windows-x64-baseline": "1.0.28",
17
+ "@randomlabs/slate-darwin-x64": "1.0.28",
18
+ "@randomlabs/slate-linux-x64-musl": "1.0.28",
19
+ "@randomlabs/slate-linux-arm64-musl": "1.0.28",
20
+ "@randomlabs/slate-linux-x64-baseline": "1.0.28",
21
+ "@randomlabs/slate-darwin-x64-baseline": "1.0.28",
22
+ "@randomlabs/slate-linux-x64": "1.0.28"
23
23
  }
24
24
  }
package/bin/bin/slate DELETED
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const childProcess = require("child_process")
4
- const fs = require("fs")
5
- const path = require("path")
6
- const os = require("os")
7
-
8
- function run(target) {
9
- const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
- stdio: "inherit",
11
- })
12
- if (result.error) {
13
- console.error(result.error.message)
14
- process.exit(1)
15
- }
16
- const code = typeof result.status === "number" ? result.status : 0
17
- process.exit(code)
18
- }
19
-
20
- const envPath = process.env.SLATE_BIN_PATH
21
- if (envPath) {
22
- run(envPath)
23
- }
24
-
25
- const scriptPath = fs.realpathSync(__filename)
26
- const scriptDir = path.dirname(scriptPath)
27
- const projectRoot = path.dirname(scriptDir)
28
-
29
- const platformMap = {
30
- darwin: "darwin",
31
- linux: "linux",
32
- win32: "windows",
33
- }
34
- const archMap = {
35
- x64: "x64",
36
- arm64: "arm64",
37
- arm: "arm",
38
- }
39
-
40
- let platform = platformMap[os.platform()]
41
- if (!platform) {
42
- platform = os.platform()
43
- }
44
- let arch = archMap[os.arch()]
45
- if (!arch) {
46
- arch = os.arch()
47
- }
48
- const base = "slate-" + platform + "-" + arch
49
- const binary = platform === "windows" ? "slate.exe" : "slate"
50
-
51
- function findBinary(startDir) {
52
- let current = startDir
53
- for (;;) {
54
- const modules = path.join(current, "node_modules")
55
- if (fs.existsSync(modules)) {
56
- const entries = fs.readdirSync(modules)
57
- for (const entry of entries) {
58
- if (!entry.startsWith(base)) {
59
- continue
60
- }
61
- const candidate = path.join(modules, entry, "bin", binary)
62
- if (fs.existsSync(candidate)) {
63
- return candidate
64
- }
65
- }
66
- const scopedCandidate = path.join(modules, "@randomlabs", base, "bin", binary)
67
- if (fs.existsSync(scopedCandidate)) {
68
- return scopedCandidate
69
- }
70
- }
71
- const parent = path.dirname(current)
72
- if (parent === current) {
73
- return
74
- }
75
- current = parent
76
- }
77
- }
78
-
79
- function findBinaryInDist(rootDir) {
80
- const candidate = path.join(rootDir, "dist", "@randomlabs", base, "bin", binary)
81
- if (fs.existsSync(candidate)) {
82
- return candidate
83
- }
84
- }
85
-
86
- const resolved = findBinary(scriptDir) || findBinaryInDist(projectRoot)
87
- if (!resolved) {
88
- console.error(
89
- 'It seems that your package manager failed to install the right version of the slate CLI for your platform. You can try manually installing the "' +
90
- base +
91
- '" package',
92
- )
93
- process.exit(1)
94
- }
95
-
96
- run(resolved)