@methiu/raigal 0.2.6 → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  import "node:fs";
2
2
  import "node:url";
3
3
  //#region src/version.ts
4
- const APP_VERSION = "0.2.6";
4
+ const APP_VERSION = "0.2.7";
5
5
  //#endregion
6
6
  export { APP_VERSION as t };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@methiu/raigal",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "description": "Catch the slop AI coding agents leave in your code: narrative comments, swallowed exceptions, as-any casts, dead code, oversized functions. 50+ rules across 10 language targets (TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP, C#, C/C++). Sub-second, deterministic, no LLM at runtime.",
7
+ "description": "Raigal CLI: a code-quality and security gate for AI-written code. Runs formatting, lint, code-quality, AI-pattern, architecture and security checks across 10 language targets and scores each change from 0 to 100.",
8
8
  "type": "module",
9
9
  "bin": {
10
10
  "raigal": "dist/cli.js",
@@ -14,7 +14,9 @@
14
14
  "files": [
15
15
  "dist",
16
16
  "scripts",
17
- "tools/jb"
17
+ "tools/jb",
18
+ "LICENSE",
19
+ "THIRD_PARTY_NOTICES.md"
18
20
  ],
19
21
  "exports": {
20
22
  ".": {
@@ -81,7 +83,8 @@
81
83
  "cpp"
82
84
  ],
83
85
  "author": {
84
- "name": "Kenny Olawuwo",
86
+ "name": "Raigal",
87
+ "email": "matei@raigal.dev",
85
88
  "url": "https://raigal.dev"
86
89
  },
87
90
  "license": "SEE LICENSE IN LICENSE",
@@ -11,6 +11,15 @@ const ALLOWED_KEYS = new Set([]);
11
11
  const PH_KEY_PREFIX = `${"p" + "h" + "c"}_`;
12
12
  const PH_KEY_PATTERN = new RegExp(`${PH_KEY_PREFIX}[A-Za-z0-9_-]{20,}`, "g");
13
13
 
14
+ // Signing-key and issuer overrides must never reach the published package.
15
+ const FORBIDDEN_STRINGS = [
16
+ "RAIGAL_PUBLIC_KEY",
17
+ "RAIGAL_KEY_ID",
18
+ "RAIGAL_ISSUER",
19
+ "RAIGAL_TEST_PUBLIC_KEY",
20
+ "RAIGAL_TEST_KEY_ID",
21
+ ];
22
+
14
23
  const ROOT_DIR = path.resolve(import.meta.dirname, "..");
15
24
 
16
25
  const walkDirectory = (dir, callback) => {
@@ -60,11 +69,20 @@ try {
60
69
 
61
70
  // 3. Scan all extracted files for unapproved PostHog keys
62
71
  const unauthorizedKeys = [];
72
+ const forbiddenHits = [];
63
73
 
64
74
  walkDirectory(packageDir, (filePath) => {
65
75
  // Only check text / script / metadata files
66
76
  try {
67
77
  const content = fs.readFileSync(filePath, "utf-8");
78
+ const relFile = path.relative(packageDir, filePath).split(path.sep).join("/");
79
+ if (relFile.startsWith("dist/")) {
80
+ for (const needle of FORBIDDEN_STRINGS) {
81
+ if (content.includes(needle)) {
82
+ forbiddenHits.push({ needle, file: relFile });
83
+ }
84
+ }
85
+ }
68
86
  const matches = content.match(PH_KEY_PATTERN);
69
87
  if (matches) {
70
88
  for (const match of matches) {
@@ -87,6 +105,14 @@ try {
87
105
  process.exit(1);
88
106
  }
89
107
 
108
+ if (forbiddenHits.length > 0) {
109
+ console.error("Tarball key check FAILED: signing-key overrides found in package:");
110
+ for (const item of forbiddenHits) {
111
+ console.error(` - "${item.needle}" in file "${item.file}"`);
112
+ }
113
+ process.exit(1);
114
+ }
115
+
90
116
  console.log("Tarball key check passed: No unauthorized PostHog keys found in package.");
91
117
  process.exit(0);
92
118
  } catch (err) {