dprint 0.22.1 → 0.22.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.
package/info.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
- "version": "0.22.1",
2
+ "version": "0.22.2",
3
3
  "checksums": {
4
- "windows": "b622edf5318057aa54f278696904cb8ef030cc04ec662ee4bc75f1e849f6f0d1",
5
- "linux": "20178b34672777805960ca56643e74e0dbf07cdca648c923b4292d70131db7b5",
6
- "mac": "d52e4399a81576181fb9cdaf7f2c12de94b53c88394bed287f07a891020bb634"
4
+ "windows-x86_64": "a8740fa8e131fdc163725f712a9d4d5ef426294c9c5d0b672251e950e9e2b2e5",
5
+ "mac-x86_64": "ab087ad3c89c11f8dbd60b810012a6d3944acef91cfc3eec028607c137868ac8",
6
+ "mac-aarch64": "c93be255a084b552314b011469c8549cdcbf548b147256eb392199cf7e31a611",
7
+ "linux-x86_64": "e57168da7a15efd980bc433afba2815697f51c4708313526fe95a25c83a5ba85"
7
8
  }
8
9
  }
package/install.js CHANGED
@@ -8,7 +8,7 @@ const child_process = require("child_process");
8
8
  const info = JSON.parse(fs.readFileSync(path.join(__dirname, "info.json"), "utf8"));
9
9
 
10
10
  if (!isM1Mac() && os.arch() !== "x64") {
11
- throw new Error("Unsupported architecture " + os.arch() + ". Only x64 binaries are available.");
11
+ throw new Error("Unsupported architecture " + os.arch() + ". Only x64 and M1 binaries are available.");
12
12
  }
13
13
 
14
14
  if (os.platform() === "win32") {
@@ -36,6 +36,5 @@ if (os.platform() === "win32") {
36
36
  }
37
37
 
38
38
  function isM1Mac() {
39
- // works on mac via rosetta
40
39
  return os.arch() === "arm64" && os.platform() === "darwin";
41
40
  }
package/install.sh CHANGED
@@ -6,8 +6,9 @@ if ! command -v unzip >/dev/null; then
6
6
  exit 1
7
7
  fi
8
8
 
9
- case $(uname -s) in
10
- Darwin) target="x86_64-apple-darwin" ;;
9
+ case $(uname -sm) in
10
+ "Darwin x86_64") target="x86_64-apple-darwin" ;;
11
+ "Darwin arm64") target="aarch64-apple-darwin" ;;
11
12
  *) target="x86_64-unknown-linux-gnu" ;;
12
13
  esac
13
14
 
@@ -25,10 +25,14 @@ if (actualZipChecksum !== expectedZipChecksum) {
25
25
  function getExpectedZipChecksum() {
26
26
  switch (os.platform()) {
27
27
  case "win32":
28
- return info.checksums.windows;
28
+ return info.checksums["windows-x86_64"];
29
29
  case "darwin":
30
- return info.checksums.mac;
30
+ if (os.arch() === "arm64") {
31
+ return info.checksums["mac-aarch64"];
32
+ } else {
33
+ return info.checksums["mac-x86_64"];
34
+ }
31
35
  default:
32
- return info.checksums.linux;
36
+ return info.checksums["linux-x86_64"];
33
37
  }
34
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dprint",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "Pluggable and configurable code formatting platform written in Rust.",
5
5
  "bin": "bin.js",
6
6
  "scripts": {