@pwrs/cem 0.0.2 → 0.0.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.
@@ -0,0 +1,23 @@
1
+ import { platform, arch } from "node:process";
2
+ import { execSync } from "node:child_process";
3
+
4
+ const pkg = {
5
+ "darwin-x64": "@pwrs/cem-darwin-x64",
6
+ "darwin-arm64": "@pwrs/cem-darwin-arm64",
7
+ "linux-x64": "@pwrs/cem-linux-x64",
8
+ "linux-arm64": "@pwrs/cem-linux-arm64"
9
+ }[`${platform}-${arch}`];
10
+
11
+ if (!pkg) {
12
+ console.error(
13
+ `Unsupported platform: ${platform}-${arch}. Please check https://github.com/bennypowers/cem for supported platforms.`
14
+ );
15
+ process.exit(1);
16
+ }
17
+
18
+ try {
19
+ execSync(`npm install --no-save ${pkg}`, { stdio: "inherit" });
20
+ } catch (err) {
21
+ console.error(`Failed to install platform binary package: ${pkg}`);
22
+ process.exit(1);
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pwrs/cem",
3
- "version": "0.0.2",
3
+ "version": "0.0.6",
4
4
  "description": "CLI tool for generating and working with Custom Elements Manifests",
5
5
  "type": "module",
6
6
  "engines": {
@@ -22,6 +22,7 @@
22
22
  },
23
23
  "files": [
24
24
  "bin/cem.js",
25
+ "install-platform-binary.js",
25
26
  "README.md"
26
27
  ]
27
28
  }