@merginit/brandpeel 0.1.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.
- package/README.md +8 -0
- package/bin/brandpeel.js +57 -0
- package/package.json +46 -0
package/README.md
ADDED
package/bin/brandpeel.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const supported = new Set([
|
|
8
|
+
"darwin-arm64",
|
|
9
|
+
"darwin-x64",
|
|
10
|
+
"linux-arm64",
|
|
11
|
+
"linux-x64",
|
|
12
|
+
"win32-arm64",
|
|
13
|
+
"win32-x64",
|
|
14
|
+
]);
|
|
15
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
16
|
+
|
|
17
|
+
if (!supported.has(platformKey)) {
|
|
18
|
+
console.error(
|
|
19
|
+
`Brand Peel CLI does not provide a binary for ${process.platform}/${process.arch}.`,
|
|
20
|
+
);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const packageName = `@merginit/brandpeel-${platformKey}`;
|
|
25
|
+
const extension = process.platform === "win32" ? ".exe" : "";
|
|
26
|
+
|
|
27
|
+
let binaryPath;
|
|
28
|
+
try {
|
|
29
|
+
binaryPath = require.resolve(`${packageName}/bin/brandpeel${extension}`);
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(`Could not find the optional native package ${packageName}.`);
|
|
32
|
+
console.error("Reinstall @merginit/brandpeel without omitting optional dependencies.");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
37
|
+
stdio: "inherit",
|
|
38
|
+
shell: false,
|
|
39
|
+
windowsHide: true,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
43
|
+
process.on(signal, () => child.kill(signal));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
child.on("error", (error) => {
|
|
47
|
+
console.error(`Failed to start Brand Peel CLI: ${error.message}`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
child.on("exit", (code, signal) => {
|
|
52
|
+
if (signal) {
|
|
53
|
+
process.kill(process.pid, signal);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
process.exit(code ?? 1);
|
|
57
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@merginit/brandpeel",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official native CLI for Brand Peel exports and the public Brand Peel API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"brandpeel": "bin/brandpeel.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin",
|
|
11
|
+
"README.md"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"preferUnplugged": true,
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"homepage": "https://brandpeel.app",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/merginit/unpeeled.cli.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/merginit/unpeeled.cli/issues"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"brandpeel",
|
|
28
|
+
"brand-design",
|
|
29
|
+
"design-tokens",
|
|
30
|
+
"wcag",
|
|
31
|
+
"cli",
|
|
32
|
+
"zig"
|
|
33
|
+
],
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"provenance": true
|
|
37
|
+
},
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"@merginit/brandpeel-darwin-arm64": "0.1.0",
|
|
40
|
+
"@merginit/brandpeel-darwin-x64": "0.1.0",
|
|
41
|
+
"@merginit/brandpeel-linux-arm64": "0.1.0",
|
|
42
|
+
"@merginit/brandpeel-linux-x64": "0.1.0",
|
|
43
|
+
"@merginit/brandpeel-win32-arm64": "0.1.0",
|
|
44
|
+
"@merginit/brandpeel-win32-x64": "0.1.0"
|
|
45
|
+
}
|
|
46
|
+
}
|