typeslayer 0.1.1 → 0.1.2

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/bin/typeslayer.js +19 -6
  2. package/package.json +1 -2
package/bin/typeslayer.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { spawn } from "node:child_process";
3
+ import { spawn, spawnSync } from "node:child_process";
4
4
  import { existsSync } from "node:fs";
5
5
  import { arch, platform } from "node:os";
6
6
  import { dirname, join } from "node:path";
@@ -45,11 +45,24 @@ try {
45
45
  const binaryInfo = getBinaryInfo();
46
46
 
47
47
  if (!existsSync(binaryInfo.path)) {
48
- console.error(`\n Binary not available for ${binaryInfo.platform}`);
49
- console.error(
50
- `\nYour platform (${binaryInfo.platform}) is not yet supported.`,
51
- );
52
- process.exit(1);
48
+ console.error(`\n⚠️ Binary not found for ${binaryInfo.platform}. Attempting download...`);
49
+ const postinstallPath = join(__dirname, "..", "scripts", "postinstall.js");
50
+ const res = spawnSync(process.execPath, [postinstallPath], {
51
+ stdio: "inherit",
52
+ env: process.env,
53
+ });
54
+ if (res.status !== 0) {
55
+ console.error("\n❌ Failed to download platform binary.");
56
+ }
57
+ if (!existsSync(binaryInfo.path)) {
58
+ console.error(
59
+ `\n❌ Binary still unavailable at ${binaryInfo.path}. Please check the release assets or your network.`,
60
+ );
61
+ console.error(
62
+ "You can manually download from: https://github.com/dimitropoulos/typeslayer/releases",
63
+ );
64
+ process.exit(1);
65
+ }
53
66
  }
54
67
 
55
68
  const proc = spawn(binaryInfo.path, [], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typeslayer",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Slay your TypeScript types",
5
5
  "private": false,
6
6
  "type": "module",
@@ -27,7 +27,6 @@
27
27
  },
28
28
  "files": [
29
29
  "bin",
30
- "binaries",
31
30
  "scripts"
32
31
  ],
33
32
  "os": [