@enactprotocol/enact 2.0.5 → 2.0.7

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/enact.js +4 -5
  2. package/package.json +6 -6
package/bin/enact.js CHANGED
@@ -18,7 +18,7 @@ function loadPlatformBinary(pkgName) {
18
18
  try {
19
19
  // eslint-disable-next-line @typescript-eslint/no-var-requires
20
20
  const mod = require(pkgName);
21
- return mod && mod.binPath ? mod : mod && mod.default ? mod.default : mod;
21
+ return mod?.binPath ? mod : mod?.default ? mod.default : mod;
22
22
  } catch (err) {
23
23
  return { loadError: err };
24
24
  }
@@ -28,18 +28,17 @@ function run() {
28
28
  const pkgName = pkgNameFor(process.platform, process.arch);
29
29
  if (!pkgName) {
30
30
  console.error(
31
- `enact: unsupported platform ${process.platform}/${process.arch}. ` +
32
- `No prebuilt binary is available.`
31
+ `enact: unsupported platform ${process.platform}/${process.arch}. No prebuilt binary is available.`
33
32
  );
34
33
  process.exit(1);
35
34
  }
36
35
 
37
36
  const platformPkg = loadPlatformBinary(pkgName);
38
37
  if (!platformPkg || !platformPkg.binPath) {
39
- const msg = platformPkg && platformPkg.loadError ? String(platformPkg.loadError) : "Unknown error";
38
+ const msg = platformPkg?.loadError ? String(platformPkg.loadError) : "Unknown error";
40
39
  console.error(`enact: failed to load platform package ${pkgName}.`);
41
40
  console.error(msg);
42
- console.error(`\nTry reinstalling: npm i -g @enactprotocol/enact`);
41
+ console.error("\nTry reinstalling: npm i -g @enactprotocol/enact");
43
42
  process.exit(1);
44
43
  }
45
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enactprotocol/enact",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Enact CLI (thin wrapper that loads the correct platform binary)",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -12,11 +12,11 @@
12
12
  "enact": "./bin/enact.js"
13
13
  },
14
14
  "optionalDependencies": {
15
- "@enactprotocol/enact-darwin-arm64": "2.0.5",
16
- "@enactprotocol/enact-darwin-x64": "2.0.5",
17
- "@enactprotocol/enact-linux-arm64": "2.0.5",
18
- "@enactprotocol/enact-linux-x64": "2.0.5",
19
- "@enactprotocol/enact-win32-x64": "2.0.5"
15
+ "@enactprotocol/enact-darwin-arm64": "2.0.7",
16
+ "@enactprotocol/enact-darwin-x64": "2.0.7",
17
+ "@enactprotocol/enact-linux-arm64": "2.0.7",
18
+ "@enactprotocol/enact-linux-x64": "2.0.7",
19
+ "@enactprotocol/enact-win32-x64": "2.0.7"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=18.0.0"