greprag 5.59.0 → 5.59.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/package.json +2 -2
- package/scripts/verify-publish.cjs +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "greprag",
|
|
3
|
-
"version": "5.59.
|
|
3
|
+
"version": "5.59.1",
|
|
4
4
|
"description": "GrepRAG — agent memory for Claude Code, Codex, and OpenCode.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "tsc && node scripts/bundle-opencode-plugin.mjs",
|
|
12
12
|
"clean": "rimraf dist",
|
|
13
|
-
"prepublishOnly": "npm
|
|
13
|
+
"prepublishOnly": "npm run clean && npm run build && node scripts/verify-publish.cjs",
|
|
14
14
|
"postinstall": "node scripts/postinstall.js"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
|
|
4
|
+
const root = path.resolve(__dirname, '..');
|
|
5
|
+
const seen = new Set();
|
|
6
|
+
const missing = [];
|
|
7
|
+
|
|
8
|
+
function resolveRelative(from, request) {
|
|
9
|
+
const base = path.resolve(path.dirname(from), request);
|
|
10
|
+
for (const candidate of [`${base}.js`, path.join(base, 'index.js')]) {
|
|
11
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function visit(file) {
|
|
17
|
+
if (seen.has(file)) return;
|
|
18
|
+
seen.add(file);
|
|
19
|
+
const source = fs.readFileSync(file, 'utf8');
|
|
20
|
+
for (const match of source.matchAll(/require\(["'](\.[^"']+)["']\)/g)) {
|
|
21
|
+
const resolved = resolveRelative(file, match[1]);
|
|
22
|
+
if (!resolved) missing.push(`${path.relative(root, file)} -> ${match[1]}`);
|
|
23
|
+
else visit(resolved);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
for (const entry of ['dist/index.js', 'dist/hook.js']) {
|
|
28
|
+
const file = path.join(root, entry);
|
|
29
|
+
if (!fs.existsSync(file)) missing.push(entry);
|
|
30
|
+
else visit(file);
|
|
31
|
+
}
|
|
32
|
+
if (missing.length) {
|
|
33
|
+
console.error(`Publish verification failed; missing runtime modules:\n${missing.map(item => `- ${item}`).join('\n')}`);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
console.log(`Publish verification passed: ${seen.size} runtime modules reachable.`);
|