@vibe-validate/cli 0.9.10 → 0.10.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/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +151 -38
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +228 -109
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/config-loader.d.ts +3 -7
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +7 -19
- package/dist/utils/config-loader.js.map +1 -1
- package/dist/utils/git-detection.d.ts +41 -0
- package/dist/utils/git-detection.d.ts.map +1 -0
- package/dist/utils/git-detection.js +109 -0
- package/dist/utils/git-detection.js.map +1 -0
- package/dist/utils/runner-adapter.js +3 -3
- package/dist/utils/runner-adapter.js.map +1 -1
- package/dist/utils/setup-checks/gitignore-check.d.ts +23 -0
- package/dist/utils/setup-checks/gitignore-check.d.ts.map +1 -0
- package/dist/utils/setup-checks/gitignore-check.js +156 -0
- package/dist/utils/setup-checks/gitignore-check.js.map +1 -0
- package/dist/utils/setup-checks/hooks-check.d.ts +27 -0
- package/dist/utils/setup-checks/hooks-check.d.ts.map +1 -0
- package/dist/utils/setup-checks/hooks-check.js +175 -0
- package/dist/utils/setup-checks/hooks-check.js.map +1 -0
- package/dist/utils/setup-checks/workflow-check.d.ts +22 -0
- package/dist/utils/setup-checks/workflow-check.d.ts.map +1 -0
- package/dist/utils/setup-checks/workflow-check.js +147 -0
- package/dist/utils/setup-checks/workflow-check.js.map +1 -0
- package/dist/utils/setup-engine.d.ts +155 -0
- package/dist/utils/setup-engine.d.ts.map +1 -0
- package/dist/utils/setup-engine.js +31 -0
- package/dist/utils/setup-engine.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Setup Check
|
|
3
|
+
*
|
|
4
|
+
* Ensures that .github/workflows/validate.yml exists and is configured
|
|
5
|
+
* to run vibe-validate validation in CI.
|
|
6
|
+
*
|
|
7
|
+
* This check reuses the existing workflow generation logic from the
|
|
8
|
+
* generate-workflow command to create a standard GitHub Actions workflow.
|
|
9
|
+
*/
|
|
10
|
+
import { writeFile, mkdir } from 'fs/promises';
|
|
11
|
+
import { existsSync } from 'fs';
|
|
12
|
+
import { join } from 'path';
|
|
13
|
+
import { generateWorkflow } from '../../commands/generate-workflow.js';
|
|
14
|
+
import { loadConfig } from '../config-loader.js';
|
|
15
|
+
export class WorkflowSetupCheck {
|
|
16
|
+
id = 'workflow';
|
|
17
|
+
name = 'GitHub Actions Workflow Setup';
|
|
18
|
+
async check(options) {
|
|
19
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
20
|
+
const githubDir = join(cwd, '.github');
|
|
21
|
+
const workflowsDir = join(githubDir, 'workflows');
|
|
22
|
+
const workflowPath = join(workflowsDir, 'validate.yml');
|
|
23
|
+
// Check if .github directory exists
|
|
24
|
+
if (!existsSync(githubDir)) {
|
|
25
|
+
return {
|
|
26
|
+
passed: false,
|
|
27
|
+
message: '.github directory not found',
|
|
28
|
+
suggestion: 'Create .github/workflows/validate.yml with vibe-validate workflow',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Check if workflows directory exists
|
|
32
|
+
if (!existsSync(workflowsDir)) {
|
|
33
|
+
return {
|
|
34
|
+
passed: false,
|
|
35
|
+
message: '.github/workflows directory not found',
|
|
36
|
+
suggestion: 'Create .github/workflows/validate.yml',
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Check if validate.yml exists
|
|
40
|
+
if (!existsSync(workflowPath)) {
|
|
41
|
+
return {
|
|
42
|
+
passed: false,
|
|
43
|
+
message: 'validate.yml workflow not found',
|
|
44
|
+
suggestion: 'Create .github/workflows/validate.yml',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
passed: true,
|
|
49
|
+
message: 'GitHub Actions workflow exists',
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async preview(options) {
|
|
53
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
54
|
+
// Check current state
|
|
55
|
+
const checkResult = await this.check(options);
|
|
56
|
+
if (checkResult.passed) {
|
|
57
|
+
return {
|
|
58
|
+
description: 'GitHub Actions workflow already exists',
|
|
59
|
+
filesAffected: [],
|
|
60
|
+
changes: [],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// Load config to generate workflow content
|
|
64
|
+
const config = await loadConfig(cwd);
|
|
65
|
+
if (!config) {
|
|
66
|
+
return {
|
|
67
|
+
description: 'Cannot generate workflow: No vibe-validate config found',
|
|
68
|
+
filesAffected: [],
|
|
69
|
+
changes: [],
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const workflowContent = await this.generateWorkflowContent(cwd);
|
|
73
|
+
return {
|
|
74
|
+
description: 'Create GitHub Actions workflow for vibe-validate',
|
|
75
|
+
filesAffected: ['.github/workflows/validate.yml'],
|
|
76
|
+
changes: [
|
|
77
|
+
{
|
|
78
|
+
file: '.github/workflows/validate.yml',
|
|
79
|
+
action: 'create',
|
|
80
|
+
content: workflowContent,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
async fix(options) {
|
|
86
|
+
const cwd = options?.cwd ?? process.cwd();
|
|
87
|
+
const githubDir = join(cwd, '.github');
|
|
88
|
+
const workflowsDir = join(githubDir, 'workflows');
|
|
89
|
+
const workflowPath = join(workflowsDir, 'validate.yml');
|
|
90
|
+
const dryRun = options?.dryRun ?? false;
|
|
91
|
+
// Check current state
|
|
92
|
+
const checkResult = await this.check(options);
|
|
93
|
+
if (checkResult.passed && !options?.force) {
|
|
94
|
+
return {
|
|
95
|
+
success: true,
|
|
96
|
+
message: 'GitHub Actions workflow already exists',
|
|
97
|
+
filesChanged: [],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (dryRun) {
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
message: '[dry-run] Would create .github/workflows/validate.yml',
|
|
104
|
+
filesChanged: [],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
// Generate workflow content
|
|
108
|
+
const workflowContent = await this.generateWorkflowContent(cwd);
|
|
109
|
+
// Ensure .github/workflows directory exists
|
|
110
|
+
if (!existsSync(workflowsDir)) {
|
|
111
|
+
await mkdir(workflowsDir, { recursive: true });
|
|
112
|
+
}
|
|
113
|
+
// Don't overwrite existing workflow unless force is true
|
|
114
|
+
if (existsSync(workflowPath) && !options?.force) {
|
|
115
|
+
return {
|
|
116
|
+
success: true,
|
|
117
|
+
message: 'GitHub Actions workflow already exists (use --force to overwrite)',
|
|
118
|
+
filesChanged: [],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
// Write workflow file
|
|
122
|
+
await writeFile(workflowPath, workflowContent, 'utf-8');
|
|
123
|
+
return {
|
|
124
|
+
success: true,
|
|
125
|
+
message: 'Created .github/workflows/validate.yml',
|
|
126
|
+
filesChanged: ['.github/workflows/validate.yml'],
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Generate workflow content using the existing workflow generator
|
|
131
|
+
*/
|
|
132
|
+
async generateWorkflowContent(cwd) {
|
|
133
|
+
// Load config
|
|
134
|
+
const config = await loadConfig(cwd);
|
|
135
|
+
if (!config) {
|
|
136
|
+
throw new Error('No vibe-validate configuration found. Run `vibe-validate init` first.');
|
|
137
|
+
}
|
|
138
|
+
// Generate workflow with default options
|
|
139
|
+
const options = {
|
|
140
|
+
nodeVersions: ['20'], // Single version (no matrix) for simplicity
|
|
141
|
+
os: ['ubuntu-latest'],
|
|
142
|
+
packageManager: undefined, // Auto-detect
|
|
143
|
+
};
|
|
144
|
+
return generateWorkflow(config, options);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=workflow-check.js.map
|
|
@@ -0,0 +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,EAAE,CAAC,gCAAgC,CAAC;SACjD,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,uBAAuB,CAAC,GAAW;QAC/C,cAAc;QACd,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;QAC3F,CAAC;QAED,yCAAyC;QACzC,MAAM,OAAO,GAA4B;YACvC,YAAY,EAAE,CAAC,IAAI,CAAC,EAAG,4CAA4C;YACnE,EAAE,EAAE,CAAC,eAAe,CAAC;YACrB,cAAc,EAAE,SAAS,EAAG,cAAc;SAC3C,CAAC;QAEF,OAAO,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Engine - Core types and interfaces for idempotent setup operations
|
|
3
|
+
*
|
|
4
|
+
* This module provides the foundation for focused init modes that can be run
|
|
5
|
+
* independently and repeatedly without side effects.
|
|
6
|
+
*
|
|
7
|
+
* Design principles:
|
|
8
|
+
* - Idempotent: Running a setup check multiple times produces the same result
|
|
9
|
+
* - Composable: Setup checks can be combined and run together
|
|
10
|
+
* - Previewable: All changes can be previewed before applying
|
|
11
|
+
* - Testable: All setup checks are fully unit-testable
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const gitignoreCheck = new GitignoreSetupCheck();
|
|
16
|
+
*
|
|
17
|
+
* // Check current state
|
|
18
|
+
* const result = await gitignoreCheck.check();
|
|
19
|
+
* if (!result.passed) {
|
|
20
|
+
* // Preview changes
|
|
21
|
+
* const preview = await gitignoreCheck.preview();
|
|
22
|
+
* console.log(preview.description);
|
|
23
|
+
*
|
|
24
|
+
* // Apply fix
|
|
25
|
+
* const fixResult = await gitignoreCheck.fix();
|
|
26
|
+
* console.log(fixResult.message);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Result of a setup check operation
|
|
32
|
+
*/
|
|
33
|
+
export interface CheckResult {
|
|
34
|
+
/**
|
|
35
|
+
* Whether the check passed (setup is already complete)
|
|
36
|
+
*/
|
|
37
|
+
passed: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Human-readable message describing the check result
|
|
40
|
+
*/
|
|
41
|
+
message: string;
|
|
42
|
+
/**
|
|
43
|
+
* Optional suggestion for how to fix the issue (if check failed)
|
|
44
|
+
*/
|
|
45
|
+
suggestion?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Optional details about what was found
|
|
48
|
+
*/
|
|
49
|
+
details?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Result of a fix operation
|
|
53
|
+
*/
|
|
54
|
+
export interface FixResult {
|
|
55
|
+
/**
|
|
56
|
+
* Whether the fix was successful
|
|
57
|
+
*/
|
|
58
|
+
success: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Human-readable message describing what was done
|
|
61
|
+
*/
|
|
62
|
+
message: string;
|
|
63
|
+
/**
|
|
64
|
+
* List of files that were created or modified
|
|
65
|
+
*/
|
|
66
|
+
filesChanged: string[];
|
|
67
|
+
/**
|
|
68
|
+
* Optional error if fix failed
|
|
69
|
+
*/
|
|
70
|
+
error?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Result of a preview operation
|
|
74
|
+
*/
|
|
75
|
+
export interface PreviewResult {
|
|
76
|
+
/**
|
|
77
|
+
* Human-readable description of changes that would be made
|
|
78
|
+
*/
|
|
79
|
+
description: string;
|
|
80
|
+
/**
|
|
81
|
+
* List of files that would be created or modified
|
|
82
|
+
*/
|
|
83
|
+
filesAffected: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Optional preview of file contents that would be created/modified
|
|
86
|
+
*/
|
|
87
|
+
changes?: Array<{
|
|
88
|
+
file: string;
|
|
89
|
+
action: 'create' | 'modify';
|
|
90
|
+
content?: string;
|
|
91
|
+
diff?: string;
|
|
92
|
+
}>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Options for fix operations
|
|
96
|
+
*/
|
|
97
|
+
export interface FixOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Working directory (defaults to process.cwd())
|
|
100
|
+
*/
|
|
101
|
+
cwd?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Whether to force the fix even if check passes
|
|
104
|
+
*/
|
|
105
|
+
force?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Dry-run mode: preview changes without applying
|
|
108
|
+
*/
|
|
109
|
+
dryRun?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Base interface for all setup checks
|
|
113
|
+
*
|
|
114
|
+
* Each setup check represents a specific aspect of the vibe-validate
|
|
115
|
+
* setup that can be verified, previewed, and fixed independently.
|
|
116
|
+
*/
|
|
117
|
+
export interface SetupCheck {
|
|
118
|
+
/**
|
|
119
|
+
* Unique identifier for this setup check
|
|
120
|
+
*/
|
|
121
|
+
readonly id: string;
|
|
122
|
+
/**
|
|
123
|
+
* Human-readable name for this setup check
|
|
124
|
+
*/
|
|
125
|
+
readonly name: string;
|
|
126
|
+
/**
|
|
127
|
+
* Check if the setup is complete
|
|
128
|
+
*
|
|
129
|
+
* This operation should be read-only and have no side effects.
|
|
130
|
+
*
|
|
131
|
+
* @param _options - Optional configuration
|
|
132
|
+
* @returns Result indicating whether setup is complete
|
|
133
|
+
*/
|
|
134
|
+
check(_options?: FixOptions): Promise<CheckResult>;
|
|
135
|
+
/**
|
|
136
|
+
* Preview what changes would be made by fix()
|
|
137
|
+
*
|
|
138
|
+
* This operation should be read-only and have no side effects.
|
|
139
|
+
*
|
|
140
|
+
* @param _options - Optional configuration
|
|
141
|
+
* @returns Description of changes that would be made
|
|
142
|
+
*/
|
|
143
|
+
preview(_options?: FixOptions): Promise<PreviewResult>;
|
|
144
|
+
/**
|
|
145
|
+
* Apply the fix to complete the setup
|
|
146
|
+
*
|
|
147
|
+
* This operation should be idempotent - running it multiple times
|
|
148
|
+
* should produce the same result.
|
|
149
|
+
*
|
|
150
|
+
* @param _options - Optional configuration
|
|
151
|
+
* @returns Result of the fix operation
|
|
152
|
+
*/
|
|
153
|
+
fix(_options?: FixOptions): Promise<FixResult>;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=setup-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-engine.d.ts","sourceRoot":"","sources":["../../src/utils/setup-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAEnD;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAEvD;;;;;;;;OAQG;IACH,GAAG,CAAC,QAAQ,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;CAChD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Engine - Core types and interfaces for idempotent setup operations
|
|
3
|
+
*
|
|
4
|
+
* This module provides the foundation for focused init modes that can be run
|
|
5
|
+
* independently and repeatedly without side effects.
|
|
6
|
+
*
|
|
7
|
+
* Design principles:
|
|
8
|
+
* - Idempotent: Running a setup check multiple times produces the same result
|
|
9
|
+
* - Composable: Setup checks can be combined and run together
|
|
10
|
+
* - Previewable: All changes can be previewed before applying
|
|
11
|
+
* - Testable: All setup checks are fully unit-testable
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const gitignoreCheck = new GitignoreSetupCheck();
|
|
16
|
+
*
|
|
17
|
+
* // Check current state
|
|
18
|
+
* const result = await gitignoreCheck.check();
|
|
19
|
+
* if (!result.passed) {
|
|
20
|
+
* // Preview changes
|
|
21
|
+
* const preview = await gitignoreCheck.preview();
|
|
22
|
+
* console.log(preview.description);
|
|
23
|
+
*
|
|
24
|
+
* // Apply fix
|
|
25
|
+
* const fixResult = await gitignoreCheck.fix();
|
|
26
|
+
* console.log(fixResult.message);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=setup-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-engine.js","sourceRoot":"","sources":["../../src/utils/setup-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibe-validate/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Command-line interface for vibe-validate validation framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"chalk": "^5.3.0",
|
|
58
58
|
"yaml": "^2.6.1",
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
|
-
"@vibe-validate/
|
|
61
|
-
"@vibe-validate/config": "0.
|
|
62
|
-
"@vibe-validate/
|
|
60
|
+
"@vibe-validate/git": "0.10.0",
|
|
61
|
+
"@vibe-validate/config": "0.10.0",
|
|
62
|
+
"@vibe-validate/core": "0.10.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/node": "^20.14.8",
|