@pwrs/cem 0.1.2 → 0.1.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.
- package/bin/cem.js +18 -13
- package/package.json +26 -1
package/bin/cem.js
CHANGED
|
@@ -4,25 +4,30 @@ import { createRequire } from "node:module";
|
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
|
|
6
6
|
const require = createRequire(import.meta.url);
|
|
7
|
-
const
|
|
8
|
-
"linux-x64"
|
|
9
|
-
"linux-arm64"
|
|
10
|
-
"darwin-x64"
|
|
11
|
-
"darwin-arm64"
|
|
12
|
-
// "win32-x64"
|
|
13
|
-
// "win32-arm64"
|
|
14
|
-
|
|
7
|
+
const supportedTargets = new Set([
|
|
8
|
+
"linux-x64",
|
|
9
|
+
"linux-arm64",
|
|
10
|
+
"darwin-x64",
|
|
11
|
+
"darwin-arm64",
|
|
12
|
+
// "win32-x64",
|
|
13
|
+
// "win32-arm64",
|
|
14
|
+
]);
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
if (!
|
|
19
|
-
console.error(`cem: Unsupported platform/arch: ${
|
|
16
|
+
const target = `${platform()}-${arch()}`
|
|
17
|
+
|
|
18
|
+
if (!supportedTargets.has(target)) {
|
|
19
|
+
console.error(`cem: Unsupported platform/arch: ${target}`);
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
let binPath;
|
|
24
24
|
try {
|
|
25
|
-
|
|
25
|
+
let pkgPath = `@pwrs/cem-${target}/bin/cem`
|
|
26
|
+
if (platform() === "win32" ? ".exe" : "") {
|
|
27
|
+
pkgPath += '.exe'
|
|
28
|
+
}
|
|
29
|
+
binPath = require.resolve(pkgPath);
|
|
30
|
+
console.log(pkgPath);
|
|
26
31
|
} catch {
|
|
27
32
|
console.error(`cem: Platform binary package ${subpkg} not installed. Was there an install error?`);
|
|
28
33
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1 +1,26 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@pwrs/cem",
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "CLI tool for generating and working with Custom Elements Manifests",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22.0.0"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"cem": "bin/cem.js"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"postinstall": "node ./install-platform-binary.js"
|
|
14
|
+
},
|
|
15
|
+
"optionalDependencies": {
|
|
16
|
+
"@pwrs/cem-linux-x64": "0.1.7",
|
|
17
|
+
"@pwrs/cem-linux-arm64": "0.1.7",
|
|
18
|
+
"@pwrs/cem-darwin-x64": "0.1.7",
|
|
19
|
+
"@pwrs/cem-darwin-arm64": "0.1.7"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"bin/cem.js",
|
|
23
|
+
"install-platform-binary.js",
|
|
24
|
+
"README.md"
|
|
25
|
+
]
|
|
26
|
+
}
|