@klarlabs-studio/warden 0.6.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.
Files changed (3) hide show
  1. package/README.md +15 -0
  2. package/bin/warden.cjs +36 -0
  3. package/package.json +38 -0
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # warden (npm)
2
+
3
+ `npx @klarlabs-studio/warden` — a configurable git commit/push gate with native hooks, worktree
4
+ isolation, and cryptographic provenance. No Go toolchain required.
5
+
6
+ ```bash
7
+ npx @klarlabs-studio/warden init # set up the gate in the current repo
8
+ npx @klarlabs-studio/warden import --write # or: generate config from your existing CI/Makefile
9
+ ```
10
+
11
+ This package is a thin launcher: it ships the prebuilt `warden` binary per
12
+ platform (via `optionalDependencies`, the esbuild pattern) and execs it. All
13
+ logic lives in the binary; there is no JavaScript reimplementation.
14
+
15
+ Full docs: <https://go.klarlabs.de/warden>
package/bin/warden.cjs ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ // Pure launcher: locate the prebuilt warden binary for this platform (shipped
3
+ // as an optionalDependency npm resolved for us) and exec it, forwarding args,
4
+ // stdio, and the exit code. All warden logic lives in the Go binary; this file
5
+ // carries none of it.
6
+ "use strict";
7
+
8
+ const { spawnSync } = require("node:child_process");
9
+
10
+ function binaryPath() {
11
+ const pkg = `@klarlabs-studio/warden-${process.platform}-${process.arch}`;
12
+ const exe = process.platform === "win32" ? "warden.exe" : "warden";
13
+ try {
14
+ // npm installed only the platform package matching this os/cpu.
15
+ return require.resolve(`${pkg}/bin/${exe}`);
16
+ } catch {
17
+ return null;
18
+ }
19
+ }
20
+
21
+ const bin = binaryPath();
22
+ if (!bin) {
23
+ console.error(
24
+ `warden: no prebuilt binary for ${process.platform}-${process.arch}.\n` +
25
+ `Install another way: https://github.com/klarlabs-studio/warden/releases ` +
26
+ `or 'go install go.klarlabs.de/warden@latest'.`,
27
+ );
28
+ process.exit(1);
29
+ }
30
+
31
+ const res = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
32
+ if (res.error) {
33
+ console.error(res.error.message);
34
+ process.exit(1);
35
+ }
36
+ process.exit(res.status === null ? 1 : res.status);
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@klarlabs-studio/warden",
3
+ "version": "0.6.0",
4
+ "description": "Configurable git commit/push gate — native hooks, worktree isolation, cryptographic provenance. Wraps the warden binary so `npx @klarlabs-studio/warden` works with no Go toolchain.",
5
+ "bin": {
6
+ "warden": "bin/warden.cjs"
7
+ },
8
+ "files": [
9
+ "bin/warden.cjs",
10
+ "README.md"
11
+ ],
12
+ "optionalDependencies": {
13
+ "@klarlabs-studio/warden-linux-x64": "0.6.0",
14
+ "@klarlabs-studio/warden-linux-arm64": "0.6.0",
15
+ "@klarlabs-studio/warden-darwin-x64": "0.6.0",
16
+ "@klarlabs-studio/warden-darwin-arm64": "0.6.0",
17
+ "@klarlabs-studio/warden-win32-x64": "0.6.0",
18
+ "@klarlabs-studio/warden-win32-arm64": "0.6.0"
19
+ },
20
+ "keywords": [
21
+ "git",
22
+ "hooks",
23
+ "pre-commit",
24
+ "pre-push",
25
+ "gate",
26
+ "lint",
27
+ "ci"
28
+ ],
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/klarlabs-studio/warden.git"
33
+ },
34
+ "homepage": "https://go.klarlabs.de/warden",
35
+ "engines": {
36
+ "node": ">=16"
37
+ }
38
+ }