@kavtuai/guildgate 0.1.0 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.1 - 2026-07-26
2
+
3
+ ### Fixed
4
+
5
+ - Added help output for both command-line tools.
6
+ - Made the writing checker operate on the current project directory.
7
+ - Missing documentation paths are now skipped instead of causing an error.
8
+ - Added regression tests for installed CLI behavior.
1
9
  # Changelog
2
10
 
3
11
  All notable changes are recorded in this file. The project follows Semantic Versioning after `1.0.0`. Before `1.0.0`, a minor release may contain an API change with migration notes.
@@ -1,7 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import { Buffer } from "node:buffer";
3
3
 
4
- const isJson = process.argv.includes("--json");
4
+ const args = process.argv.slice(2);
5
+
6
+ if (args.includes("--help") || args.includes("-h")) {
7
+ console.log([
8
+ "Usage: guildgate-doctor [options]",
9
+ "",
10
+ "Checks the GuildGate environment and production safety settings.",
11
+ "",
12
+ "Options:",
13
+ " --json Print machine-readable JSON output.",
14
+ " -h, --help Show this help message.",
15
+ ].join("\n"));
16
+ process.exit(0);
17
+ }
18
+
19
+ const isJson = args.includes("--json");
5
20
  const environment = process.env.GUILDGATE_ENVIRONMENT ?? process.env.NODE_ENV ?? "development";
6
21
  const results = [];
7
22
 
@@ -1,9 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
  import { readFile, readdir } from "node:fs/promises";
3
- import { extname, join, relative } from "node:path";
4
- import { fileURLToPath } from "node:url";
3
+ import { extname, join, relative, resolve } from "node:path";
5
4
 
6
- const root = fileURLToPath(new URL("../", import.meta.url));
5
+ const args = process.argv.slice(2);
6
+
7
+ if (args.includes("--help") || args.includes("-h")) {
8
+ console.log([
9
+ "Usage: guildgate-writing-check [options]",
10
+ "",
11
+ "Checks documentation files in the current project directory.",
12
+ "",
13
+ "Options:",
14
+ " --root <path> Check another project directory.",
15
+ " -h, --help Show this help message.",
16
+ ].join("\n"));
17
+ process.exit(0);
18
+ }
19
+
20
+ const rootOptionIndex = args.indexOf("--root");
21
+
22
+ if (rootOptionIndex !== -1 && !args[rootOptionIndex + 1]) {
23
+ console.error("The --root option requires a directory path.");
24
+ process.exit(2);
25
+ }
26
+
27
+ const root = resolve(
28
+ rootOptionIndex === -1 ? process.cwd() : args[rootOptionIndex + 1],
29
+ );
7
30
  const includedRoots = [
8
31
  "README.md",
9
32
  "README.tr.md",
@@ -67,6 +90,7 @@ async function filesUnder(path) {
67
90
  }
68
91
  return files;
69
92
  } catch (error) {
93
+ if (error?.code === "ENOENT") return [];
70
94
  if (error?.code === "ENOTDIR") return [path];
71
95
  throw error;
72
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kavtuai/guildgate",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Security and control primitives for Discord bot dashboards.",
5
5
  "type": "module",
6
6
  "license": "MIT",