@skillsgate/tui 0.1.5 → 0.1.6
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/bin/postinstall.cjs +37 -0
- package/package.json +7 -6
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Ensures the correct platform binary is installed.
|
|
3
|
+
// npm may skip optionalDependencies for global installs (npm v11+/Node v24+).
|
|
4
|
+
const { execSync } = require("child_process");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const fs = require("fs");
|
|
8
|
+
|
|
9
|
+
const platformMap = {
|
|
10
|
+
darwin: { arm64: "tui-darwin-arm64", x64: "tui-darwin-x64" },
|
|
11
|
+
linux: { arm64: "tui-linux-arm64", x64: "tui-linux-x64" },
|
|
12
|
+
win32: { x64: "tui-win32-x64" },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const pkg = platformMap[os.platform()]?.[os.arch()];
|
|
16
|
+
if (!pkg) process.exit(0);
|
|
17
|
+
|
|
18
|
+
// Check if already available as a sibling (optionalDeps worked)
|
|
19
|
+
const siblingPath = path.join(__dirname, "..", "..", "..", `@skillsgate/${pkg}`);
|
|
20
|
+
if (fs.existsSync(siblingPath)) process.exit(0);
|
|
21
|
+
|
|
22
|
+
// Also check nested node_modules
|
|
23
|
+
try {
|
|
24
|
+
require.resolve(`@skillsgate/${pkg}/package.json`);
|
|
25
|
+
process.exit(0);
|
|
26
|
+
} catch {}
|
|
27
|
+
|
|
28
|
+
// Not found — install it explicitly
|
|
29
|
+
const version = require("../package.json").version;
|
|
30
|
+
try {
|
|
31
|
+
execSync(`npm install -g @skillsgate/${pkg}@${version} --no-save`, {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
timeout: 30000,
|
|
34
|
+
});
|
|
35
|
+
} catch {
|
|
36
|
+
console.warn(`Warning: could not install @skillsgate/${pkg}. Run manually: npm install -g @skillsgate/${pkg}`);
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skillsgate/tui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"skillsgate-tui": "bin/skillsgate-tui"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
+
"postinstall": "node bin/postinstall.cjs",
|
|
9
10
|
"dev": "bun --watch run src/index.tsx",
|
|
10
11
|
"start": "bun run src/index.tsx"
|
|
11
12
|
},
|
|
@@ -15,11 +16,11 @@
|
|
|
15
16
|
"gray-matter": "4.0.3"
|
|
16
17
|
},
|
|
17
18
|
"optionalDependencies": {
|
|
18
|
-
"@skillsgate/tui-darwin-arm64": "0.1.
|
|
19
|
-
"@skillsgate/tui-darwin-x64": "0.1.
|
|
20
|
-
"@skillsgate/tui-linux-x64": "0.1.
|
|
21
|
-
"@skillsgate/tui-linux-arm64": "0.1.
|
|
22
|
-
"@skillsgate/tui-win32-x64": "0.1.
|
|
19
|
+
"@skillsgate/tui-darwin-arm64": "0.1.6",
|
|
20
|
+
"@skillsgate/tui-darwin-x64": "0.1.6",
|
|
21
|
+
"@skillsgate/tui-linux-x64": "0.1.6",
|
|
22
|
+
"@skillsgate/tui-linux-arm64": "0.1.6",
|
|
23
|
+
"@skillsgate/tui-win32-x64": "0.1.6"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"react": "19.1.5"
|