endform 0.74.1 → 0.75.0

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/endform +17 -7
  2. package/package.json +8 -6
package/bin/endform CHANGED
@@ -3,7 +3,7 @@
3
3
  * A simplified launcher for the Endform CLI.
4
4
  *
5
5
  * This script selects and executes the appropriate platform-specific binary.
6
- * It supports macOS and Linux on x86 (x64) or arm64.
6
+ * It supports macOS, Linux, and Windows on x86 (x64) or arm64.
7
7
  */
8
8
 
9
9
  const child_process = require("node:child_process");
@@ -12,13 +12,13 @@ const fs = require("node:fs");
12
12
  const { pipeline } = require("node:stream/promises");
13
13
 
14
14
  // Define supported platforms and architectures.
15
- const supportedPlatforms = ["darwin", "linux"];
15
+ const supportedPlatforms = ["darwin", "linux", "win32"];
16
16
  const supportedArchs = ["x64", "arm64"];
17
17
 
18
18
  const platform = process.platform;
19
19
  if (!supportedPlatforms.includes(platform)) {
20
20
  console.error(
21
- `Unsupported platform: ${platform}. This CLI supports only macOS and Linux.`,
21
+ `Unsupported platform: ${platform}. This CLI supports only macOS, Linux, and Windows.`,
22
22
  );
23
23
  process.exit(1);
24
24
  }
@@ -35,11 +35,11 @@ if (!supportedArchs.includes(arch)) {
35
35
  const archSuffix = arch === "x64" ? "x86" : "arm64";
36
36
 
37
37
  // Construct the package name.
38
- // For example: "endform-darwin-x86" or "endform-linux-arm64"
38
+ // For example: "endform-darwin-x86" or "endform-win32-arm64"
39
39
  const packageName = `endform-${platform}-${archSuffix}`;
40
40
 
41
41
  // The binary is expected to reside in the package's "bin" directory.
42
- const binaryRelativePath = "bin/endform";
42
+ const binaryRelativePath = platform === "win32" ? "bin/endform.exe" : "bin/endform";
43
43
 
44
44
  // Get version from package.json
45
45
  const packageJsonPath = path.join(__dirname, "..", "package.json");
@@ -51,6 +51,8 @@ const MAC_ARM_URL = `https://cli.endform.dev/${version}/endform-aarch64-apple-da
51
51
  const MAC_X86_URL = `https://cli.endform.dev/${version}/endform-x86_64-apple-darwin/endform`;
52
52
  const LINUX_ARM_URL = `https://cli.endform.dev/${version}/endform-aarch64-unknown-linux-musl/endform`;
53
53
  const LINUX_X86_URL = `https://cli.endform.dev/${version}/endform-x86_64-unknown-linux-musl/endform`;
54
+ const WINDOWS_ARM_URL = `https://cli.endform.dev/${version}/endform-aarch64-pc-windows-msvc/endform.exe`;
55
+ const WINDOWS_X86_URL = `https://cli.endform.dev/${version}/endform-x86_64-pc-windows-msvc/endform.exe`;
54
56
 
55
57
  // Get the appropriate URL and binary name based on platform and architecture
56
58
  const getDownloadInfo = () => {
@@ -63,6 +65,15 @@ const getDownloadInfo = () => {
63
65
  : "endform-x86_64-apple-darwin",
64
66
  };
65
67
  }
68
+ if (platform === "win32") {
69
+ return {
70
+ url: arch === "arm64" ? WINDOWS_ARM_URL : WINDOWS_X86_URL,
71
+ binaryName:
72
+ arch === "arm64"
73
+ ? "endform-aarch64-pc-windows-msvc.exe"
74
+ : "endform-x86_64-pc-windows-msvc.exe",
75
+ };
76
+ }
66
77
  return {
67
78
  url: arch === "arm64" ? LINUX_ARM_URL : LINUX_X86_URL,
68
79
  binaryName:
@@ -112,8 +123,7 @@ const downloadBinary = async ({ force } = {}) => {
112
123
 
113
124
  try {
114
125
  fs.renameSync(tmpPath, binaryPath);
115
- fs.chmodSync(binaryPath, 0o755);
116
-
126
+ if (platform !== "win32") fs.chmodSync(binaryPath, 0o755);
117
127
  return binaryPath;
118
128
  } catch (err) {
119
129
  fs.unlink(tmpPath, () => {});
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "endform",
3
- "version": "0.74.1",
3
+ "version": "0.75.0",
4
4
  "description": "Endform CLI",
5
5
  "license": "UNLICENSED",
6
- "repository": "https://github.com/endformdev/npm",
6
+ "repository": "https://github.com/endformdev/docs",
7
7
  "bin": {
8
8
  "endform": "./bin/endform"
9
9
  },
@@ -21,9 +21,11 @@
21
21
  }
22
22
  },
23
23
  "optionalDependencies": {
24
- "endform-darwin-arm64": "0.74.1",
25
- "endform-darwin-x86": "0.74.1",
26
- "endform-linux-arm64": "0.74.1",
27
- "endform-linux-x86": "0.74.1"
24
+ "endform-darwin-arm64": "0.75.0",
25
+ "endform-darwin-x86": "0.75.0",
26
+ "endform-linux-arm64": "0.75.0",
27
+ "endform-linux-x86": "0.75.0",
28
+ "endform-win32-arm64": "0.75.0",
29
+ "endform-win32-x86": "0.75.0"
28
30
  }
29
31
  }