@rigour-labs/core 5.5.1 → 5.5.2

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,4 +1,4 @@
1
- import { pathExists, stat } from 'fs-extra';
1
+ import fs from 'fs-extra';
2
2
  import path from 'path';
3
3
  const sourceExtensions = ['', '.ts', '.tsx', '.js', '.jsx', '.mjs', '.cjs', '.d.ts'];
4
4
  export async function resolveTsPathTarget(baseDir, candidatePattern, cwd, projectFiles) {
@@ -15,10 +15,10 @@ export async function resolveTsPathTarget(baseDir, candidatePattern, cwd, projec
15
15
  return true;
16
16
  for (const candidate of candidates) {
17
17
  const candidatePath = path.resolve(cwd, candidate);
18
- if (!await pathExists(candidatePath))
18
+ if (!await fs.pathExists(candidatePath))
19
19
  continue;
20
20
  try {
21
- if ((await stat(candidatePath)).isFile())
21
+ if ((await fs.stat(candidatePath)).isFile())
22
22
  return true;
23
23
  }
24
24
  catch { /* inaccessible targets do not resolve */ }
@@ -20,7 +20,7 @@ import { nodeToPattern } from './indexer-ts.js';
20
20
  // Configuration
21
21
  // ---------------------------------------------------------------------------
22
22
  const DEFAULT_CONFIG = {
23
- include: ['src/**/*', 'lib/**/*', 'app/**/*', 'components/**/*', 'utils/**/*', 'hooks/**/*', '**/tests/**/*', '**/test/**/*'],
23
+ include: ['**/src/**/*', 'lib/**/*', 'app/**/*', 'components/**/*', 'utils/**/*', 'hooks/**/*', '**/tests/**/*', '**/test/**/*'],
24
24
  exclude: [
25
25
  '**/node_modules/**', '**/dist/**', '**/build/**', '**/.git/**',
26
26
  '**/coverage/**', '**/venv/**', '**/.venv/**', '**/__pycache__/**',
@@ -38,6 +38,15 @@ export function formatDate(date: Date): string {
38
38
  expect(index.patterns[0].signature).toContain('date: Date');
39
39
  expect(index.patterns[0].description).toContain('Format a date');
40
40
  });
41
+ it('should index source files nested in monorepo packages', async () => {
42
+ const packageSrc = path.join(testDir, 'packages', 'api', 'src');
43
+ await fs.mkdir(packageSrc, { recursive: true });
44
+ await fs.writeFile(path.join(packageSrc, 'handler.ts'), 'export function handleRequest() {}');
45
+ const indexer = new PatternIndexer(testDir);
46
+ const index = await indexer.buildIndex();
47
+ expect(index.files.map(file => file.path)).toContain(path.join('packages', 'api', 'src', 'handler.ts'));
48
+ expect(index.patterns.some(pattern => pattern.name === 'handleRequest')).toBe(true);
49
+ });
41
50
  it('should index arrow functions', async () => {
42
51
  await fs.writeFile(path.join(testDir, 'src', 'helpers.ts'), `
43
52
  export const slugify = (text: string): string => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rigour-labs/core",
3
- "version": "5.5.1",
3
+ "version": "5.5.2",
4
4
  "description": "AI-native quality gate engine with local Bayesian learning. AST analysis, drift detection, Fix Packet generation, and agent self-healing across TypeScript, JavaScript, Python, Go, Ruby, and C#.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://rigour.run",
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "chalk": "^5.6.2",
54
54
  "execa": "^8.0.1",
55
- "fs-extra": "^11.3.3",
55
+ "fs-extra": "^11.4.0",
56
56
  "globby": "^14.1.0",
57
57
  "micromatch": "^4.0.8",
58
58
  "semver": "^7.7.3",
@@ -66,11 +66,11 @@
66
66
  "@xenova/transformers": "^2.17.2",
67
67
  "sqlite3": "^5.1.7",
68
68
  "openai": "^4.104.0",
69
- "@rigour-labs/brain-darwin-x64": "5.5.1",
70
- "@rigour-labs/brain-linux-arm64": "5.5.1",
71
- "@rigour-labs/brain-darwin-arm64": "5.5.1",
72
- "@rigour-labs/brain-win-x64": "5.5.1",
73
- "@rigour-labs/brain-linux-x64": "5.5.1"
69
+ "@rigour-labs/brain-darwin-arm64": "5.5.2",
70
+ "@rigour-labs/brain-linux-arm64": "5.5.2",
71
+ "@rigour-labs/brain-darwin-x64": "5.5.2",
72
+ "@rigour-labs/brain-linux-x64": "5.5.2",
73
+ "@rigour-labs/brain-win-x64": "5.5.2"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@types/fs-extra": "^11.0.4",