@rigour-labs/core 2.17.2 → 2.18.0
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/dist/discovery.js +1 -0
- package/dist/discovery.test.js +23 -0
- package/dist/templates/index.d.ts +1 -0
- package/dist/templates/index.js +47 -0
- package/package.json +1 -1
- package/src/discovery.test.ts +27 -0
- package/src/discovery.ts +1 -0
- package/src/templates/index.ts +48 -0
package/dist/discovery.js
CHANGED
|
@@ -32,6 +32,7 @@ export class DiscoveryService {
|
|
|
32
32
|
paradigm: extension.paradigm || base.paradigm,
|
|
33
33
|
commands: { ...base.commands, ...extension.commands },
|
|
34
34
|
gates: { ...base.gates, ...extension.gates },
|
|
35
|
+
ignore: [...new Set([...(base.ignore || []), ...(extension.ignore || [])])],
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
async findFirstMarker(cwd, markers, searchContent = false) {
|
package/dist/discovery.test.js
CHANGED
|
@@ -54,4 +54,27 @@ describe('DiscoveryService', () => {
|
|
|
54
54
|
const result = await service.discover('/test');
|
|
55
55
|
expect(result.matches.paradigm?.name).toBe('oop');
|
|
56
56
|
});
|
|
57
|
+
it('should include project-type-aware ignore patterns for API preset', async () => {
|
|
58
|
+
const service = new DiscoveryService();
|
|
59
|
+
// Mock finding requirements.txt (Python API marker)
|
|
60
|
+
vi.mocked(fs.pathExists).mockImplementation(async (p) => p.includes('requirements.txt'));
|
|
61
|
+
vi.mocked(fs.readdir).mockResolvedValue(['requirements.txt']);
|
|
62
|
+
vi.mocked(fs.readFile).mockResolvedValue('flask==2.0.0');
|
|
63
|
+
const result = await service.discover('/test');
|
|
64
|
+
expect(result.matches.preset?.name).toBe('api');
|
|
65
|
+
expect(result.config.ignore).toContain('venv/**');
|
|
66
|
+
expect(result.config.ignore).toContain('__pycache__/**');
|
|
67
|
+
expect(result.config.ignore).toContain('*.pyc');
|
|
68
|
+
});
|
|
69
|
+
it('should include project-type-aware ignore patterns for UI preset', async () => {
|
|
70
|
+
const service = new DiscoveryService();
|
|
71
|
+
// Mock finding next.config.js (UI marker)
|
|
72
|
+
vi.mocked(fs.pathExists).mockImplementation(async (p) => p.includes('next.config.js'));
|
|
73
|
+
vi.mocked(fs.readdir).mockResolvedValue(['next.config.js']);
|
|
74
|
+
vi.mocked(fs.readFile).mockResolvedValue('module.exports = {}');
|
|
75
|
+
const result = await service.discover('/test');
|
|
76
|
+
expect(result.matches.preset?.name).toBe('ui');
|
|
77
|
+
expect(result.config.ignore).toContain('node_modules/**');
|
|
78
|
+
expect(result.config.ignore).toContain('.next/**');
|
|
79
|
+
});
|
|
57
80
|
});
|
package/dist/templates/index.js
CHANGED
|
@@ -14,6 +14,17 @@ export const TEMPLATES = [
|
|
|
14
14
|
],
|
|
15
15
|
config: {
|
|
16
16
|
preset: 'ui',
|
|
17
|
+
ignore: [
|
|
18
|
+
'.git/**',
|
|
19
|
+
'node_modules/**',
|
|
20
|
+
'dist/**',
|
|
21
|
+
'build/**',
|
|
22
|
+
'.next/**',
|
|
23
|
+
'.nuxt/**',
|
|
24
|
+
'.svelte-kit/**',
|
|
25
|
+
'coverage/**',
|
|
26
|
+
'.turbo/**',
|
|
27
|
+
],
|
|
17
28
|
gates: {
|
|
18
29
|
max_file_lines: 300,
|
|
19
30
|
required_files: ['docs/SPEC.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -39,6 +50,23 @@ export const TEMPLATES = [
|
|
|
39
50
|
],
|
|
40
51
|
config: {
|
|
41
52
|
preset: 'api',
|
|
53
|
+
ignore: [
|
|
54
|
+
'.git/**',
|
|
55
|
+
// Node.js
|
|
56
|
+
'node_modules/**',
|
|
57
|
+
'dist/**',
|
|
58
|
+
// Python
|
|
59
|
+
'venv/**',
|
|
60
|
+
'.venv/**',
|
|
61
|
+
'__pycache__/**',
|
|
62
|
+
'*.pyc',
|
|
63
|
+
'.tox/**',
|
|
64
|
+
'.pytest_cache/**',
|
|
65
|
+
'.mypy_cache/**',
|
|
66
|
+
'*.egg-info/**',
|
|
67
|
+
// Go
|
|
68
|
+
'vendor/**',
|
|
69
|
+
],
|
|
42
70
|
gates: {
|
|
43
71
|
max_file_lines: 400,
|
|
44
72
|
required_files: ['docs/SPEC.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -61,6 +89,14 @@ export const TEMPLATES = [
|
|
|
61
89
|
],
|
|
62
90
|
config: {
|
|
63
91
|
preset: 'infra',
|
|
92
|
+
ignore: [
|
|
93
|
+
'.git/**',
|
|
94
|
+
'.terraform/**',
|
|
95
|
+
'*.tfstate',
|
|
96
|
+
'*.tfstate.backup',
|
|
97
|
+
'.terragrunt-cache/**',
|
|
98
|
+
'charts/**/*.tgz',
|
|
99
|
+
],
|
|
64
100
|
gates: {
|
|
65
101
|
max_file_lines: 300,
|
|
66
102
|
required_files: ['docs/RUNBOOK.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -78,6 +114,17 @@ export const TEMPLATES = [
|
|
|
78
114
|
],
|
|
79
115
|
config: {
|
|
80
116
|
preset: 'data',
|
|
117
|
+
ignore: [
|
|
118
|
+
'.git/**',
|
|
119
|
+
'.ipynb_checkpoints/**',
|
|
120
|
+
'__pycache__/**',
|
|
121
|
+
'*.pyc',
|
|
122
|
+
'dbt_packages/**',
|
|
123
|
+
'target/**',
|
|
124
|
+
'logs/**',
|
|
125
|
+
'*.parquet',
|
|
126
|
+
'*.csv',
|
|
127
|
+
],
|
|
81
128
|
gates: {
|
|
82
129
|
max_file_lines: 500,
|
|
83
130
|
required_files: ['docs/DATA_DICTIONARY.md', 'docs/PIPELINE.md', 'README.md'],
|
package/package.json
CHANGED
package/src/discovery.test.ts
CHANGED
|
@@ -58,4 +58,31 @@ describe('DiscoveryService', () => {
|
|
|
58
58
|
const result = await service.discover('/test');
|
|
59
59
|
expect(result.matches.paradigm?.name).toBe('oop');
|
|
60
60
|
});
|
|
61
|
+
|
|
62
|
+
it('should include project-type-aware ignore patterns for API preset', async () => {
|
|
63
|
+
const service = new DiscoveryService();
|
|
64
|
+
// Mock finding requirements.txt (Python API marker)
|
|
65
|
+
vi.mocked(fs.pathExists).mockImplementation(async (p: string) => p.includes('requirements.txt'));
|
|
66
|
+
vi.mocked(fs.readdir).mockResolvedValue(['requirements.txt'] as any);
|
|
67
|
+
vi.mocked(fs.readFile).mockResolvedValue('flask==2.0.0' as any);
|
|
68
|
+
|
|
69
|
+
const result = await service.discover('/test');
|
|
70
|
+
expect(result.matches.preset?.name).toBe('api');
|
|
71
|
+
expect(result.config.ignore).toContain('venv/**');
|
|
72
|
+
expect(result.config.ignore).toContain('__pycache__/**');
|
|
73
|
+
expect(result.config.ignore).toContain('*.pyc');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should include project-type-aware ignore patterns for UI preset', async () => {
|
|
77
|
+
const service = new DiscoveryService();
|
|
78
|
+
// Mock finding next.config.js (UI marker)
|
|
79
|
+
vi.mocked(fs.pathExists).mockImplementation(async (p: string) => p.includes('next.config.js'));
|
|
80
|
+
vi.mocked(fs.readdir).mockResolvedValue(['next.config.js'] as any);
|
|
81
|
+
vi.mocked(fs.readFile).mockResolvedValue('module.exports = {}' as any);
|
|
82
|
+
|
|
83
|
+
const result = await service.discover('/test');
|
|
84
|
+
expect(result.matches.preset?.name).toBe('ui');
|
|
85
|
+
expect(result.config.ignore).toContain('node_modules/**');
|
|
86
|
+
expect(result.config.ignore).toContain('.next/**');
|
|
87
|
+
});
|
|
61
88
|
});
|
package/src/discovery.ts
CHANGED
|
@@ -46,6 +46,7 @@ export class DiscoveryService {
|
|
|
46
46
|
paradigm: extension.paradigm || base.paradigm,
|
|
47
47
|
commands: { ...base.commands, ...extension.commands },
|
|
48
48
|
gates: { ...base.gates, ...extension.gates },
|
|
49
|
+
ignore: [...new Set([...(base.ignore || []), ...(extension.ignore || [])])],
|
|
49
50
|
};
|
|
50
51
|
}
|
|
51
52
|
|
package/src/templates/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface Template {
|
|
|
9
9
|
commands?: Partial<Commands>;
|
|
10
10
|
gates?: Partial<Gates>;
|
|
11
11
|
planned?: string[];
|
|
12
|
+
ignore?: string[];
|
|
12
13
|
};
|
|
13
14
|
}
|
|
14
15
|
|
|
@@ -28,6 +29,17 @@ export const TEMPLATES: Template[] = [
|
|
|
28
29
|
],
|
|
29
30
|
config: {
|
|
30
31
|
preset: 'ui',
|
|
32
|
+
ignore: [
|
|
33
|
+
'.git/**',
|
|
34
|
+
'node_modules/**',
|
|
35
|
+
'dist/**',
|
|
36
|
+
'build/**',
|
|
37
|
+
'.next/**',
|
|
38
|
+
'.nuxt/**',
|
|
39
|
+
'.svelte-kit/**',
|
|
40
|
+
'coverage/**',
|
|
41
|
+
'.turbo/**',
|
|
42
|
+
],
|
|
31
43
|
gates: {
|
|
32
44
|
max_file_lines: 300,
|
|
33
45
|
required_files: ['docs/SPEC.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -53,6 +65,23 @@ export const TEMPLATES: Template[] = [
|
|
|
53
65
|
],
|
|
54
66
|
config: {
|
|
55
67
|
preset: 'api',
|
|
68
|
+
ignore: [
|
|
69
|
+
'.git/**',
|
|
70
|
+
// Node.js
|
|
71
|
+
'node_modules/**',
|
|
72
|
+
'dist/**',
|
|
73
|
+
// Python
|
|
74
|
+
'venv/**',
|
|
75
|
+
'.venv/**',
|
|
76
|
+
'__pycache__/**',
|
|
77
|
+
'*.pyc',
|
|
78
|
+
'.tox/**',
|
|
79
|
+
'.pytest_cache/**',
|
|
80
|
+
'.mypy_cache/**',
|
|
81
|
+
'*.egg-info/**',
|
|
82
|
+
// Go
|
|
83
|
+
'vendor/**',
|
|
84
|
+
],
|
|
56
85
|
gates: {
|
|
57
86
|
max_file_lines: 400,
|
|
58
87
|
required_files: ['docs/SPEC.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -75,6 +104,14 @@ export const TEMPLATES: Template[] = [
|
|
|
75
104
|
],
|
|
76
105
|
config: {
|
|
77
106
|
preset: 'infra',
|
|
107
|
+
ignore: [
|
|
108
|
+
'.git/**',
|
|
109
|
+
'.terraform/**',
|
|
110
|
+
'*.tfstate',
|
|
111
|
+
'*.tfstate.backup',
|
|
112
|
+
'.terragrunt-cache/**',
|
|
113
|
+
'charts/**/*.tgz',
|
|
114
|
+
],
|
|
78
115
|
gates: {
|
|
79
116
|
max_file_lines: 300,
|
|
80
117
|
required_files: ['docs/RUNBOOK.md', 'docs/ARCH.md', 'README.md'],
|
|
@@ -92,6 +129,17 @@ export const TEMPLATES: Template[] = [
|
|
|
92
129
|
],
|
|
93
130
|
config: {
|
|
94
131
|
preset: 'data',
|
|
132
|
+
ignore: [
|
|
133
|
+
'.git/**',
|
|
134
|
+
'.ipynb_checkpoints/**',
|
|
135
|
+
'__pycache__/**',
|
|
136
|
+
'*.pyc',
|
|
137
|
+
'dbt_packages/**',
|
|
138
|
+
'target/**',
|
|
139
|
+
'logs/**',
|
|
140
|
+
'*.parquet',
|
|
141
|
+
'*.csv',
|
|
142
|
+
],
|
|
95
143
|
gates: {
|
|
96
144
|
max_file_lines: 500,
|
|
97
145
|
required_files: ['docs/DATA_DICTIONARY.md', 'docs/PIPELINE.md', 'README.md'],
|