@devilsdev/rag-pipeline-utils 2.1.5 โ 2.1.8
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/LICENSE +674 -674
- package/README.md +395 -179
- package/bin/cli.js +14 -62
- package/contracts/embedder-contract.json +52 -0
- package/contracts/llm-contract.json +36 -0
- package/contracts/loader-contract.json +43 -0
- package/contracts/retriever-contract.json +68 -0
- package/dist/index.cjs +67 -0
- package/dist/index.mjs +51 -0
- package/package.json +108 -22
- package/.codecov.yml +0 -21
- package/.dockerignore +0 -14
- package/.eslintignore +0 -5
- package/.eslintrc.json +0 -28
- package/.github/PROJECT_ROADMAP.md +0 -102
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
- package/.github/release-template.md +0 -20
- package/.github/workflows/changelog-auto-commit.yml +0 -37
- package/.github/workflows/ci.yml +0 -53
- package/.github/workflows/docs-ci.yml +0 -46
- package/.github/workflows/docs-deploy.yml +0 -55
- package/.github/workflows/enforce-release-review.yml +0 -47
- package/.github/workflows/publish-release-blog.yml +0 -47
- package/.github/workflows/release-sync.yml +0 -50
- package/.github/workflows/roadmap-label-sync.yml +0 -35
- package/.github/workflows/roadmap-labels.yml +0 -67
- package/.github/workflows/roadmap-sync.yml +0 -44
- package/.github/workflows/sync-roadmap.yml +0 -62
- package/.husky/pre-commit +0 -6
- package/CHANGELOG.md +0 -97
- package/Dockerfile +0 -22
- package/Use-Cases.md +0 -134
- package/__tests__/fixtures/.ragrc.json +0 -8
- package/__tests__/fixtures/invalid-ragrc.json +0 -4
- package/__tests__/fixtures/sample-eval-dataset.json +0 -15
- package/__tests__/fixtures/sample.pdf +0 -1
- package/__tests__/fixtures/src/mocks/openai-embedder.js +0 -16
- package/__tests__/fixtures/src/mocks/openai-llm.js +0 -9
- package/__tests__/fixtures/src/mocks/pdf-loader.js +0 -17
- package/__tests__/fixtures/src/mocks/pinecone-retriever.js +0 -26
- package/__tests__/fixtures/valid-ragrc.json +0 -16
- package/__tests__/integration/cli/config-flow.test.js +0 -98
- package/__tests__/integration/config/load-config.test.js +0 -67
- package/__tests__/scripts/ensure-roadmap-labels.test.js +0 -64
- package/__tests__/unit/config/validate-schema.test.js +0 -121
- package/__tests__/unit/core/plugin-registry.test.js +0 -55
- package/__tests__/unit/reranker/__snapshots__/reranker.snapshot.test.js.snap +0 -15
- package/__tests__/unit/reranker/llm-reranker.test.js +0 -18
- package/__tests__/unit/reranker/reranker.enriched.test.js +0 -19
- package/__tests__/unit/reranker/reranker.fallback.test.js +0 -15
- package/__tests__/unit/reranker/reranker.snapshot.test.js +0 -15
- package/__tests__/unit/reranker/reranker.structured-output.test.js +0 -17
- package/codecov +0 -0
- package/codecov.SHA256SUM +0 -1
- package/codecov.SHA256SUM.sig +0 -16
- package/docs-site/README.md +0 -41
- package/docs-site/blog/2025-04-18-architecture-overview.md +0 -16
- package/docs-site/blog/2025-04-18-release-v2.1.1.md +0 -13
- package/docs-site/blog/2025-04-19-prompt-engineering-best-practices.md +0 -16
- package/docs-site/blog/2025-04-20-image-showcase.md +0 -14
- package/docs-site/blog/2025-04-20-release-2.1.1.md +0 -21
- package/docs-site/blog/2025-04-21-release-v2.1.3.md +0 -13
- package/docs-site/blog/2025-04-21-release-v2.1.4.md +0 -13
- package/docs-site/blog/authors.yml +0 -5
- package/docs-site/blog/tags.yml +0 -60
- package/docs-site/docs/Architecture.md +0 -76
- package/docs-site/docs/CLI.md +0 -69
- package/docs-site/docs/Evaluation.md +0 -61
- package/docs-site/docs/FAQ.md +0 -50
- package/docs-site/docs/Introduction.md +0 -58
- package/docs-site/docs/Plugins.md +0 -61
- package/docs-site/docs/Tutorials.md +0 -106
- package/docs-site/docs/Usage.md +0 -72
- package/docs-site/docs/Use-Cases.md +0 -77
- package/docs-site/docs/intro.mdx +0 -6
- package/docs-site/docusaurus.config.js +0 -88
- package/docs-site/package-lock.json +0 -17914
- package/docs-site/package.json +0 -47
- package/docs-site/sidebars.js +0 -39
- package/docs-site/src/components/HomepageFeatures/index.js +0 -56
- package/docs-site/src/components/HomepageFeatures/index.module.css +0 -57
- package/docs-site/src/components/HomepageHeader/index.js +0 -46
- package/docs-site/src/components/HomepageHeader/index.module.css +0 -77
- package/docs-site/src/css/custom.css +0 -104
- package/docs-site/src/pages/index.js +0 -20
- package/docs-site/src/pages/index.module.css +0 -23
- package/docs-site/src/pages/markdown-page.md +0 -7
- package/docs-site/static/.nojekyll +0 -0
- package/docs-site/static/img/authors/ali.jpg +0 -0
- package/docs-site/static/img/hero.jpg +0 -0
- package/docs-site/static/img/logo.png +0 -0
- package/docs-site/static/img/logo.svg +0 -6
- package/docs-site/static/img/social-card.jpg +0 -0
- package/jest.config.js +0 -24
- package/plugin.config.json +0 -14
- package/public/index.html +0 -0
- package/public/results/sample-eval.json +0 -0
- package/public/src/App.jsx +0 -57
- package/release.config.js +0 -36
- package/scripts/banner-injector.js +0 -102
- package/scripts/ci-runner.js +0 -51
- package/scripts/close-done-roadmap-issues.js +0 -65
- package/scripts/create-roadmap-issues.js +0 -47
- package/scripts/ensure-roadmap-labels.js +0 -73
- package/scripts/fix-mdx-blog-imports.js +0 -50
- package/scripts/fix-mdx-image-imports.js +0 -27
- package/scripts/generate-release-note.js +0 -40
- package/scripts/label-roadmap-issues.js +0 -125
- package/scripts/manual-test-checklist.md +0 -90
- package/scripts/repair-fixtures.js +0 -30
- package/scripts/setup.js +0 -31
- package/scripts/sync-labels.js +0 -71
- package/scripts/sync-roadmap-labels.js +0 -21
- package/scripts/tag-release.js +0 -64
- package/scripts/test-global-setup.js +0 -18
- package/scripts/validate-changelog-version.js +0 -48
- package/scripts/verify-fixture-mocks.js +0 -45
- package/scripts/verify-fixtures.js +0 -36
- package/server.js +0 -31
- package/src/config/load-config.js +0 -33
- package/src/config/load-plugin-config.js +0 -56
- package/src/config/validate-plugin-schema.js +0 -28
- package/src/config/validate-schema.js +0 -107
- package/src/core/create-pipeline.js +0 -96
- package/src/core/plugin-contracts.js +0 -21
- package/src/core/plugin-registry.js +0 -48
- package/src/dag/dag-engine.js +0 -70
- package/src/evaluate/evaluator.js +0 -44
- package/src/evaluate/scoring.js +0 -74
- package/src/loader/csv-loader.js +0 -30
- package/src/loader/directory-loader.js +0 -38
- package/src/loader/html-loader.js +0 -57
- package/src/loader/markdown-loader.js +0 -58
- package/src/mocks/openai-embedder.js +0 -30
- package/src/mocks/openai-llm.js +0 -18
- package/src/mocks/pdf-loader.js +0 -17
- package/src/mocks/pinecone-retriever.js +0 -25
- package/src/reranker/llm-reranker.js +0 -34
- package/src/utils/ci/diagnostic-reporter.js +0 -36
- package/src/utils/logger.js +0 -29
- package/src/utils/retry.js +0 -42
- package/src/utils/validate-plugin-contract.js +0 -36
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 1.0.0
|
|
3
|
-
* Description: Syncs roadmap items from a structured Markdown file into GitHub Issues with labels and assignees.
|
|
4
|
-
* Author: Ali Kahwaji
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import { Octokit } from 'octokit';
|
|
10
|
-
import dotenv from 'dotenv';
|
|
11
|
-
|
|
12
|
-
dotenv.config();
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* GitHub Personal Access Token required via .env or CI secrets
|
|
16
|
-
* Ensure the token has 'repo' scope for private issue creation.
|
|
17
|
-
*/
|
|
18
|
-
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
|
19
|
-
const GITHUB_REPO = process.env.GITHUB_REPO; // e.g. DevilsDev/rag-pipeline-utils
|
|
20
|
-
const ROADMAP_PATH = path.resolve('.github/PROJECT_ROADMAP.md');
|
|
21
|
-
|
|
22
|
-
if (!GITHUB_TOKEN || !GITHUB_REPO) {
|
|
23
|
-
console.error('โ GITHUB_TOKEN and GITHUB_REPO must be defined in environment.');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const octokit = new Octokit({ auth: GITHUB_TOKEN });
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Parse roadmap Markdown file into structured issue definitions
|
|
31
|
-
*/
|
|
32
|
-
function parseRoadmapMarkdown(markdown) {
|
|
33
|
-
const lines = markdown.split('\n');
|
|
34
|
-
const issues = [];
|
|
35
|
-
|
|
36
|
-
for (const line of lines) {
|
|
37
|
-
if (line.startsWith('|')) {
|
|
38
|
-
const cells = line.split('|').map(c => c.trim());
|
|
39
|
-
|
|
40
|
-
if (cells.length < 6 || cells[0] === 'Phase') continue;
|
|
41
|
-
|
|
42
|
-
const [, phase, priority, feature, group, tags] = cells;
|
|
43
|
-
|
|
44
|
-
issues.push({
|
|
45
|
-
title: `${phase.trim()}: ${feature.trim()}`,
|
|
46
|
-
body: `**Feature Group:** ${group}\n**Priority:** ${priority}`,
|
|
47
|
-
labels: [phase, priority, ...tags.split(',').map(tag => tag.trim())].filter(Boolean),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return issues;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Create an issue in GitHub if it doesn't already exist
|
|
57
|
-
*/
|
|
58
|
-
async function createOrUpdateIssues(issues) {
|
|
59
|
-
const [owner, repo] = GITHUB_REPO.split('/');
|
|
60
|
-
|
|
61
|
-
const { data: existingIssues } = await octokit.rest.issues.listForRepo({
|
|
62
|
-
owner,
|
|
63
|
-
repo,
|
|
64
|
-
state: 'all',
|
|
65
|
-
per_page: 100,
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
for (const issue of issues) {
|
|
69
|
-
const exists = existingIssues.find(i => i.title === issue.title);
|
|
70
|
-
if (exists) {
|
|
71
|
-
console.log(`โ
Skipped (exists): ${issue.title}`);
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
await octokit.rest.issues.create({
|
|
76
|
-
owner,
|
|
77
|
-
repo,
|
|
78
|
-
title: issue.title,
|
|
79
|
-
body: issue.body,
|
|
80
|
-
labels: issue.labels,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
console.log(`โ Created: ${issue.title}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Entrypoint
|
|
89
|
-
*/
|
|
90
|
-
async function main() {
|
|
91
|
-
try {
|
|
92
|
-
const roadmap = fs.readFileSync(ROADMAP_PATH, 'utf-8');
|
|
93
|
-
const issues = parseRoadmapMarkdown(roadmap);
|
|
94
|
-
await createOrUpdateIssues(issues);
|
|
95
|
-
console.log(`๐ฏ Synced ${issues.length} roadmap issues.`);
|
|
96
|
-
} catch (err) {
|
|
97
|
-
console.error('๐จ Roadmap sync failed:', err.message);
|
|
98
|
-
process.exit(1);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
main();
|
package/scripts/ci-runner.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 1.1.0
|
|
3
|
-
* Description: CI runner for linting, mock validation, testing and coverage
|
|
4
|
-
* Author: Ali Kahwaji
|
|
5
|
-
* File: scripts/ci-runner.js
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { execSync } from 'child_process';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
import { pathToFileURL } from 'url';
|
|
11
|
-
import fs from 'fs';
|
|
12
|
-
|
|
13
|
-
// Entry helpers
|
|
14
|
-
const ROOT = path.resolve();
|
|
15
|
-
const resolveScript = (relPath) => pathToFileURL(path.resolve(ROOT, relPath)).href;
|
|
16
|
-
|
|
17
|
-
const run = (label, command) => {
|
|
18
|
-
console.log(`\n๐ง Running: ${label}`);
|
|
19
|
-
try {
|
|
20
|
-
execSync(command, { stdio: 'inherit', cwd: ROOT });
|
|
21
|
-
console.log(`โ
${label} passed`);
|
|
22
|
-
} catch (err) {
|
|
23
|
-
console.error(`โ ${label} failed`);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const runDynamicModule = async (label, modulePath) => {
|
|
29
|
-
console.log(`\n๐ Validating: ${label}`);
|
|
30
|
-
try {
|
|
31
|
-
const mod = await import(resolveScript(modulePath));
|
|
32
|
-
if (typeof mod.default === 'function') await mod.default();
|
|
33
|
-
console.log(`โ
${label} passed`);
|
|
34
|
-
} catch (err) {
|
|
35
|
-
console.error(`โ ${label} failed:\n${err.message}`);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
(async () => {
|
|
41
|
-
// Step 1: Lint
|
|
42
|
-
run('Lint', 'npx eslint . --ext .js,.ts');
|
|
43
|
-
|
|
44
|
-
// Step 2: Verify mocks for required interface methods
|
|
45
|
-
await runDynamicModule('Fixture Mock Interface Validation', 'scripts/verify-fixture-mocks.js');
|
|
46
|
-
|
|
47
|
-
// Step 3: Test and coverage
|
|
48
|
-
run('Unit + Integration Tests w/ Coverage', 'cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage');
|
|
49
|
-
|
|
50
|
-
console.log('\n๐ CI runner completed successfully.\n');
|
|
51
|
-
})();
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 1.1.0
|
|
3
|
-
* Description: Closes GitHub issues marked as โ
Done in the PROJECT_ROADMAP.md
|
|
4
|
-
* Author: Ali Kahwaji
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import { Octokit } from 'octokit';
|
|
9
|
-
|
|
10
|
-
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
|
|
11
|
-
const OWNER = 'DevilsDev';
|
|
12
|
-
const REPO = 'rag-pipeline-utils';
|
|
13
|
-
const ROADMAP_PATH = '.github/PROJECT_ROADMAP.md';
|
|
14
|
-
|
|
15
|
-
const octokit = new Octokit({ auth: GITHUB_TOKEN });
|
|
16
|
-
|
|
17
|
-
async function closeDoneIssues() {
|
|
18
|
-
const content = fs.readFileSync(ROADMAP_PATH, 'utf-8');
|
|
19
|
-
const lines = content.split('\n').filter(line => line.startsWith('|'));
|
|
20
|
-
if (lines.length < 3) {
|
|
21
|
-
console.log('โ ๏ธ No roadmap rows found to evaluate.');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const rows = lines.slice(2); // Skip header and separator
|
|
26
|
-
|
|
27
|
-
const { data: issues } = await octokit.rest.issues.listForRepo({
|
|
28
|
-
owner: OWNER,
|
|
29
|
-
repo: REPO,
|
|
30
|
-
state: 'open',
|
|
31
|
-
per_page: 100
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
for (const row of rows) {
|
|
35
|
-
const cols = row.split('|').map(col => col.trim());
|
|
36
|
-
const [, , , title, , status] = cols;
|
|
37
|
-
|
|
38
|
-
const safeStatus = status?.toLowerCase?.();
|
|
39
|
-
if (!safeStatus || !safeStatus.includes('โ
')) continue;
|
|
40
|
-
|
|
41
|
-
const match = issues.find(issue => issue.title.trim() === title.trim());
|
|
42
|
-
if (!match) continue;
|
|
43
|
-
|
|
44
|
-
await octokit.rest.issues.createComment({
|
|
45
|
-
owner: OWNER,
|
|
46
|
-
repo: REPO,
|
|
47
|
-
issue_number: match.number,
|
|
48
|
-
body: 'โ
Automatically closed from roadmap sync.'
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
await octokit.rest.issues.update({
|
|
52
|
-
owner: OWNER,
|
|
53
|
-
repo: REPO,
|
|
54
|
-
issue_number: match.number,
|
|
55
|
-
state: 'closed'
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
console.log(`๐ Closed: #${match.number} "${title}"`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
closeDoneIssues().catch(error => {
|
|
63
|
-
console.error('โ Error closing roadmap issues:', error);
|
|
64
|
-
process.exit(1);
|
|
65
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// scripts/create-roadmap-issues.js
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Version: 2.0.0
|
|
5
|
-
* Description: Parses PROJECT_ROADMAP.md and syncs GitHub issues
|
|
6
|
-
* Author: Ali Kahwaji
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import fs from 'fs/promises';
|
|
10
|
-
import path from 'path';
|
|
11
|
-
import { Octokit } from 'octokit';
|
|
12
|
-
import yaml from 'js-yaml';
|
|
13
|
-
|
|
14
|
-
const roadmapPath = new URL('../.github/PROJECT_ROADMAP.md', import.meta.url);
|
|
15
|
-
|
|
16
|
-
export async function createRoadmapIssues({ token, owner, repo }) {
|
|
17
|
-
const octokit = new Octokit({ auth: token });
|
|
18
|
-
const content = await fs.readFile(roadmapPath, 'utf-8');
|
|
19
|
-
|
|
20
|
-
const blocks = content.split(/^##\s+/gm).slice(1);
|
|
21
|
-
|
|
22
|
-
for (const block of blocks) {
|
|
23
|
-
const [header, ...bodyLines] = block.trim().split('\n');
|
|
24
|
-
const title = header.trim();
|
|
25
|
-
const metadata = {};
|
|
26
|
-
const description = [];
|
|
27
|
-
|
|
28
|
-
for (const line of bodyLines) {
|
|
29
|
-
if (line.includes(':') && line.includes('**')) {
|
|
30
|
-
const [key, val] = line.split(':');
|
|
31
|
-
metadata[key.trim()] = val.replace(/\*\*/g, '').trim();
|
|
32
|
-
} else {
|
|
33
|
-
description.push(line);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const issue = await octokit.rest.issues.create({
|
|
38
|
-
owner,
|
|
39
|
-
repo,
|
|
40
|
-
title,
|
|
41
|
-
body: description.join('\n'),
|
|
42
|
-
labels: [metadata.Priority, metadata.Group].filter(Boolean),
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
console.log(`โ
Created: ${issue.data.title}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 2.0.1
|
|
3
|
-
* Path: scripts/ensure-roadmap-labels.js
|
|
4
|
-
* Description: Ensures consistent GitHub labels for roadmap tracking and automation.
|
|
5
|
-
* Author: Ali Kahwaji
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { Octokit } from 'octokit';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Label definitions for roadmap tracking.
|
|
13
|
-
* Modify this array to add or update roadmap labels.
|
|
14
|
-
* Each object must include: name, color (hex), description.
|
|
15
|
-
*/
|
|
16
|
-
const roadmapLabels = [
|
|
17
|
-
{ name: 'priority: high', color: 'e11d48', description: 'High priority roadmap item' },
|
|
18
|
-
{ name: 'priority: medium', color: 'f59e0b', description: 'Medium priority roadmap item' },
|
|
19
|
-
{ name: 'priority: low', color: '10b981', description: 'Low priority roadmap item' },
|
|
20
|
-
{ name: 'group: docs', color: '6366f1', description: 'Documentation features' },
|
|
21
|
-
{ name: 'group: devx', color: '06b6d4', description: 'Developer experience improvements' },
|
|
22
|
-
{ name: 'group: community', color: 'ec4899', description: 'Community tools & engagement' },
|
|
23
|
-
{ name: 'group: blog', color: 'f97316', description: 'Blog & SEO enhancements' },
|
|
24
|
-
{ name: 'group: infra', color: '64748b', description: 'Infrastructure & deployment features' },
|
|
25
|
-
{ name: 'group: hydra', color: '9333ea', description: 'Hydra runtime & configuration' },
|
|
26
|
-
{ name: 'status: done', color: '10b981', description: 'Issue has been completed' }
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Ensures all roadmap labels are present in the target GitHub repository.
|
|
31
|
-
* Skips label creation if already present.
|
|
32
|
-
*
|
|
33
|
-
* @param {Object} params
|
|
34
|
-
* @param {string} params.token - GitHub access token
|
|
35
|
-
* @param {string} params.owner - Repository owner
|
|
36
|
-
* @param {string} params.repo - Repository name
|
|
37
|
-
*/
|
|
38
|
-
async function ensureRoadmapLabels({ token, owner, repo }) {
|
|
39
|
-
const octokit = new Octokit({ auth: token });
|
|
40
|
-
|
|
41
|
-
const { data: existingLabels } = await octokit.rest.issues.listLabelsForRepo({
|
|
42
|
-
owner,
|
|
43
|
-
repo
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const existingNames = new Set(existingLabels.map((label) => label.name));
|
|
47
|
-
|
|
48
|
-
for (const label of roadmapLabels) {
|
|
49
|
-
if (!existingNames.has(label.name)) {
|
|
50
|
-
await octokit.rest.issues.createLabel({ owner, repo, ...label });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// CLI support
|
|
56
|
-
if (process.argv[1] === new URL(import.meta.url).pathname) {
|
|
57
|
-
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split('/') || [];
|
|
58
|
-
const token = process.env.GITHUB_TOKEN;
|
|
59
|
-
|
|
60
|
-
if (!token || !owner || !repo) {
|
|
61
|
-
console.error('Missing required GITHUB_TOKEN or GITHUB_REPOSITORY');
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
ensureRoadmapLabels({ token, owner, repo })
|
|
66
|
-
.then(() => console.log('โ
Roadmap labels ensured'))
|
|
67
|
-
.catch((err) => {
|
|
68
|
-
console.error('Label sync failed:', err);
|
|
69
|
-
process.exit(1);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export { ensureRoadmapLabels, roadmapLabels };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 1.0.0
|
|
3
|
-
* Description: Rewrites blog .mdx files to use SSR-safe BlogImage.jsx import
|
|
4
|
-
* Author: Ali Kahwaji
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
|
|
10
|
-
const BLOG_DIR = path.resolve('docs-site', 'blog');
|
|
11
|
-
const TARGET_IMPORT = 'import BlogImage from \'../src/components/BlogImage\'';
|
|
12
|
-
const OLD_IMPORT_REGEX = /import\s+BlogImage\s+from\s+['"].+BlogImage[^'"]*['"];/g;
|
|
13
|
-
|
|
14
|
-
function fixImportInFile(filePath) {
|
|
15
|
-
let content = fs.readFileSync(filePath, 'utf-8');
|
|
16
|
-
|
|
17
|
-
// If already correct, skip
|
|
18
|
-
if (content.includes(TARGET_IMPORT)) {
|
|
19
|
-
console.log(`โ๏ธ ${path.basename(filePath)} already uses safe import.`);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const replaced = content.replace(OLD_IMPORT_REGEX, TARGET_IMPORT);
|
|
24
|
-
|
|
25
|
-
if (replaced !== content) {
|
|
26
|
-
fs.writeFileSync(filePath, replaced);
|
|
27
|
-
console.log(`โ
Updated: ${path.basename(filePath)}`);
|
|
28
|
-
} else {
|
|
29
|
-
// No previous import, insert at top
|
|
30
|
-
fs.writeFileSync(filePath, `${TARGET_IMPORT}\n\n${content}`);
|
|
31
|
-
console.log(`โ Injected import: ${path.basename(filePath)}`);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function walkDir(dir) {
|
|
36
|
-
const files = fs.readdirSync(dir);
|
|
37
|
-
for (const f of files) {
|
|
38
|
-
const fullPath = path.join(dir, f);
|
|
39
|
-
const stat = fs.statSync(fullPath);
|
|
40
|
-
if (stat.isDirectory()) {
|
|
41
|
-
walkDir(fullPath);
|
|
42
|
-
} else if (f.endsWith('.mdx')) {
|
|
43
|
-
fixImportInFile(fullPath);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
console.log('๐ Scanning MDX blog files...');
|
|
49
|
-
walkDir(BLOG_DIR);
|
|
50
|
-
console.log('๐ Import rewrite complete.');
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// fix-mdx-image-imports.js
|
|
2
|
-
// Version: 1.0.0
|
|
3
|
-
// Description: Auto-wrap all BlogImage imports with SafeImageWrapper to avoid SSR issues.
|
|
4
|
-
|
|
5
|
-
import fs from 'fs';
|
|
6
|
-
import path from 'path';
|
|
7
|
-
import glob from 'glob';
|
|
8
|
-
|
|
9
|
-
const blogDir = path.resolve('docs-site', 'blog');
|
|
10
|
-
|
|
11
|
-
glob(`${blogDir}/**/*.mdx`, (err, files) => {
|
|
12
|
-
if (err) throw err;
|
|
13
|
-
|
|
14
|
-
files.forEach((file) => {
|
|
15
|
-
let content = fs.readFileSync(file, 'utf8');
|
|
16
|
-
|
|
17
|
-
if (content.includes('from \'@site/src/components/BlogImage\'')) {
|
|
18
|
-
content = content
|
|
19
|
-
.replace(/from '@site\/src\/components\/BlogImage'/g, 'from \'@site/src/components/SafeImageWrapper\'')
|
|
20
|
-
.replace(/<BlogImage/g, '<SafeImageWrapper')
|
|
21
|
-
.replace(/<\/BlogImage>/g, '</SafeImageWrapper>');
|
|
22
|
-
|
|
23
|
-
fs.writeFileSync(file, content, 'utf8');
|
|
24
|
-
console.log(`โ๏ธ Updated: ${file}`);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// File: scripts/generate-release-note.js
|
|
2
|
-
/**
|
|
3
|
-
* Version: 1.2.0
|
|
4
|
-
* Description: Injects release metadata into markdown template
|
|
5
|
-
* Author: Ali Kahwaji
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
const { execSync } = require('child_process');
|
|
11
|
-
|
|
12
|
-
const [,, version, previousTag] = process.argv;
|
|
13
|
-
|
|
14
|
-
if (!version || !previousTag) {
|
|
15
|
-
console.error('Usage: node scripts/generate-release-note.js <version> <previousTag>');
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const templatePath = path.join(__dirname, '../.github/release-template.md');
|
|
20
|
-
const outputPath = path.join(__dirname, `../docs-site/blog/${new Date().toISOString().split('T')[0]}-release-${version}.md`);
|
|
21
|
-
|
|
22
|
-
const template = fs.readFileSync(templatePath, 'utf-8');
|
|
23
|
-
|
|
24
|
-
// Count contributors
|
|
25
|
-
const contributors = execSync(`git shortlog -sne ${previousTag}..HEAD | wc -l`).toString().trim();
|
|
26
|
-
// Count commits
|
|
27
|
-
const commits = execSync(`git rev-list --count ${previousTag}..HEAD`).toString().trim();
|
|
28
|
-
// ISO date
|
|
29
|
-
const date = new Date().toISOString().split('T')[0];
|
|
30
|
-
|
|
31
|
-
// Inject into template
|
|
32
|
-
const filled = template
|
|
33
|
-
.replace(/{{VERSION}}/g, version)
|
|
34
|
-
.replace(/{{PREVIOUS_TAG}}/g, previousTag)
|
|
35
|
-
.replace(/{{DATE}}/g, date)
|
|
36
|
-
.replace(/{{CONTRIBUTORS}}/g, contributors)
|
|
37
|
-
.replace(/{{COMMITS}}/g, commits);
|
|
38
|
-
|
|
39
|
-
fs.writeFileSync(outputPath, filled);
|
|
40
|
-
console.log(`โ
Generated release blog: ${outputPath}`);
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version: 2.0.0
|
|
3
|
-
* Description: Auto-label roadmap issues and clean up outdated items
|
|
4
|
-
* Author: Ali Kahwaji
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { Octokit } from 'octokit';
|
|
8
|
-
import fs from 'fs/promises';
|
|
9
|
-
import 'dotenv/config';
|
|
10
|
-
|
|
11
|
-
const repo = process.env.GITHUB_REPO;
|
|
12
|
-
const token = process.env.GITHUB_TOKEN;
|
|
13
|
-
const ROADMAP_FILE = '.github/PROJECT_ROADMAP.md';
|
|
14
|
-
const CLOSE_STALE = true;
|
|
15
|
-
|
|
16
|
-
if (!repo || !token) {
|
|
17
|
-
console.error('Missing GITHUB_REPO or GITHUB_TOKEN env vars');
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const [owner, repoName] = repo.split('/');
|
|
22
|
-
const octokit = new Octokit({ auth: token });
|
|
23
|
-
|
|
24
|
-
const PRIORITY_LABELS = {
|
|
25
|
-
High: 'priority: high',
|
|
26
|
-
Medium: 'priority: medium',
|
|
27
|
-
Low: 'priority: low',
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const GROUP_LABELS = {
|
|
31
|
-
'Documentation': 'group: docs',
|
|
32
|
-
'Developer Experience': 'group: devx',
|
|
33
|
-
'Community': 'group: community',
|
|
34
|
-
'Blog & SEO': 'group: blog',
|
|
35
|
-
'Infrastructure': 'group: infra',
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
function parseRoadmapMarkdown(content) {
|
|
39
|
-
const lines = content.split('\n').filter(l => l.includes('|'));
|
|
40
|
-
const titles = new Set();
|
|
41
|
-
|
|
42
|
-
for (const line of lines) {
|
|
43
|
-
const parts = line.split('|').map(p => p.trim());
|
|
44
|
-
if (parts.length < 4 || parts[0] === 'Phase') continue;
|
|
45
|
-
const title = parts[3];
|
|
46
|
-
titles.add(title);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return titles;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function run() {
|
|
53
|
-
const roadmapRaw = await fs.readFile(ROADMAP_FILE, 'utf8');
|
|
54
|
-
const roadmapTitles = parseRoadmapMarkdown(roadmapRaw);
|
|
55
|
-
|
|
56
|
-
const issues = await octokit.paginate(octokit.rest.issues.listForRepo, {
|
|
57
|
-
owner,
|
|
58
|
-
repo: repoName,
|
|
59
|
-
state: 'open',
|
|
60
|
-
per_page: 100,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
for (const issue of issues) {
|
|
64
|
-
if (issue.pull_request) continue;
|
|
65
|
-
|
|
66
|
-
const title = issue.title.trim();
|
|
67
|
-
const body = issue.body || '';
|
|
68
|
-
const labels = new Set(issue.labels.map(l => typeof l === 'string' ? l : l.name));
|
|
69
|
-
|
|
70
|
-
const priority = Object.keys(PRIORITY_LABELS).find(p => body.includes(`Priority: ${p}`));
|
|
71
|
-
const group = Object.keys(GROUP_LABELS).find(g => body.includes(`Group: ${g}`));
|
|
72
|
-
|
|
73
|
-
const expectedLabels = [
|
|
74
|
-
...(priority ? [PRIORITY_LABELS[priority]] : []),
|
|
75
|
-
...(group ? [GROUP_LABELS[group]] : [])
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
const currentRoadmap = roadmapTitles.has(title);
|
|
79
|
-
|
|
80
|
-
// Update Labels
|
|
81
|
-
const labelsToAdd = expectedLabels.filter(label => !labels.has(label));
|
|
82
|
-
const labelsToRemove = [...labels].filter(label =>
|
|
83
|
-
Object.values(PRIORITY_LABELS).includes(label) ||
|
|
84
|
-
Object.values(GROUP_LABELS).includes(label)
|
|
85
|
-
).filter(label => !expectedLabels.includes(label));
|
|
86
|
-
|
|
87
|
-
if (labelsToAdd.length > 0 || labelsToRemove.length > 0) {
|
|
88
|
-
console.log(`๐ Updating labels for issue #${issue.number}: ${title}`);
|
|
89
|
-
if (labelsToAdd.length) {
|
|
90
|
-
await octokit.rest.issues.addLabels({
|
|
91
|
-
owner,
|
|
92
|
-
repo: repoName,
|
|
93
|
-
issue_number: issue.number,
|
|
94
|
-
labels: labelsToAdd,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
if (labelsToRemove.length) {
|
|
98
|
-
for (const label of labelsToRemove) {
|
|
99
|
-
await octokit.rest.issues.removeLabel({
|
|
100
|
-
owner,
|
|
101
|
-
repo: repoName,
|
|
102
|
-
issue_number: issue.number,
|
|
103
|
-
name: label,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Optionally Close stale issues
|
|
110
|
-
if (CLOSE_STALE && !currentRoadmap) {
|
|
111
|
-
console.log(`๐งน Closing stale issue #${issue.number} (${title}) โ not in roadmap`);
|
|
112
|
-
await octokit.rest.issues.update({
|
|
113
|
-
owner,
|
|
114
|
-
repo: repoName,
|
|
115
|
-
issue_number: issue.number,
|
|
116
|
-
state: 'closed',
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
run().catch(err => {
|
|
123
|
-
console.error('โ Label script failed:', err);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
});
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# โ
Manual Test Checklist for RAG Pipeline Utils
|
|
2
|
-
|
|
3
|
-
This document outlines manual test points for validating roadmap automation, documentation builds, CI/CD, blog sync, and changelog generation.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. ๐ Roadmap Sync + Label Automation
|
|
8
|
-
|
|
9
|
-
| โ
Task | Command or Trigger | Notes |
|
|
10
|
-
|--------|--------------------|-------|
|
|
11
|
-
| Sync `PROJECT_ROADMAP.md` to GitHub Issues | `git push` or `workflow_dispatch` for `sync-roadmap.yml` | Issues, assignees, labels should match |
|
|
12
|
-
| Auto-create missing roadmap labels | `sync-roadmap.yml` step: `ensure-roadmap-labels.js` | Should not error even if labels exist |
|
|
13
|
-
| Label updates reflect correct color & description | Rerun roadmap sync | Existing labels should be updated |
|
|
14
|
-
| Roadmap issue closed on โ
Done status | Modify `PROJECT_ROADMAP.md` status and sync | Corresponding issue should be auto-closed |
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 2. ๐งญ CLI + Manual Utilities
|
|
19
|
-
|
|
20
|
-
| โ
Task | Command | Notes |
|
|
21
|
-
|--------|---------|-------|
|
|
22
|
-
| Create roadmap issues manually | `node scripts/create-roadmap-issues.js` | Creates GitHub Issues |
|
|
23
|
-
| Ensure labels via CLI | `node scripts/ensure-roadmap-labels.js` | Must succeed with idempotency |
|
|
24
|
-
| Generate changelog and preview | `npm run release:tag` | Prompt for tag + generate CHANGELOG |
|
|
25
|
-
| Preview auto-generated blog post | Preview `.md` file in `/docs-site/blog` before push |
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 3. ๐ Docs + Deployment
|
|
30
|
-
|
|
31
|
-
| โ
Task | Command | Notes |
|
|
32
|
-
|--------|---------|-------|
|
|
33
|
-
| Build Docusaurus | `npm run docs:build` | No broken links, light/dark theme OK |
|
|
34
|
-
| Deploy to GitHub Pages | `npm run docs:deploy` | Check rendered site at `/rag-pipeline-utils` |
|
|
35
|
-
| Verify CHANGELOG link works | Test `/blog` page post link to `CHANGELOG.md` |
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 4. ๐งช CI/CD Validation
|
|
40
|
-
|
|
41
|
-
| โ
Task | Check | Notes |
|
|
42
|
-
|--------|-------|-------|
|
|
43
|
-
| CI Lint + Test runs | โ
`ci.yml` | Lint passes, all Jest tests green |
|
|
44
|
-
| Docs CI runs correctly | โ
`docs-ci.yml` | No script missing error, build valid |
|
|
45
|
-
| Docs auto-deploys on push | โ
`docs-deploy.yml` | Publishes to GitHub Pages |
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 5. ๐ท GitHub Releases
|
|
50
|
-
|
|
51
|
-
| โ
Task | Trigger | Notes |
|
|
52
|
-
|--------|---------|-------|
|
|
53
|
-
| Generate blog post on release | Publish GitHub tag | `publish-release-blog.yml` should commit new `.md` |
|
|
54
|
-
| Auto-fill blog content | From `CHANGELOG.md` and compare link | Author + commit stats populated |
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## 6. ๐ก Release Gatekeeping & Metadata
|
|
59
|
-
|
|
60
|
-
| โ
Task | Outcome | Notes |
|
|
61
|
-
|--------|---------|-------|
|
|
62
|
-
| Badge renders in README | `![Release Review Passed]` | Should point to last workflow run |
|
|
63
|
-
| Protected branch config for PRs | Status check on `release:review` | Prevents push without passing review |
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## 7. ๐งพ Filesystem and Cleanup
|
|
68
|
-
|
|
69
|
-
| โ
Task | Notes |
|
|
70
|
-
|--------|-------|
|
|
71
|
-
| `src/stories/` removed | No Storybook assets in GH Pages |
|
|
72
|
-
| `postcss.config.cjs` & `tailwind.config.js` removed | Confirm no broken styling or build errors |
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## ๐ Optional Manual Commands
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# Sync roadmap manually
|
|
80
|
-
node scripts/create-roadmap-issues.js
|
|
81
|
-
|
|
82
|
-
# Ensure roadmap labels
|
|
83
|
-
node scripts/ensure-roadmap-labels.js
|
|
84
|
-
|
|
85
|
-
# Trigger changelog + blog post flow
|
|
86
|
-
npm run release:tag
|
|
87
|
-
|
|
88
|
-
# Build and deploy docs
|
|
89
|
-
npm run docs:build && npm run docs:deploy
|
|
90
|
-
```
|