@vibe-validate/config 0.10.3 → 0.11.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/schema.js CHANGED
@@ -16,6 +16,8 @@ export const ValidationStepSchema = z.object({
16
16
  name: z.string().min(1, 'Step name cannot be empty'),
17
17
  /** Command to execute (e.g., "npm run typecheck") */
18
18
  command: z.string().min(1, 'Command cannot be empty'),
19
+ /** Optional: Description of what this step does (for documentation) */
20
+ description: z.string().optional(),
19
21
  /** Optional: Custom timeout in milliseconds (default: inherited from phase) */
20
22
  timeout: z.number().positive().optional(),
21
23
  /** Optional: Continue on failure (default: false) */
@@ -24,7 +26,7 @@ export const ValidationStepSchema = z.object({
24
26
  env: z.record(z.string(), z.string()).optional(),
25
27
  /** Optional: Working directory for this step (default: project root) */
26
28
  cwd: z.string().optional(),
27
- });
29
+ }).strict();
28
30
  /**
29
31
  * Validation Phase Schema
30
32
  *
@@ -36,43 +38,22 @@ export const ValidationPhaseSchema = z.object({
36
38
  name: z.string().min(1, 'Phase name cannot be empty'),
37
39
  /** Execute steps in parallel (default: false) */
38
40
  parallel: z.boolean().optional().default(false),
39
- /** Optional: Phase names this phase depends on */
40
- dependsOn: z.array(z.string()).optional(),
41
41
  /** Steps to execute in this phase */
42
42
  steps: z.array(ValidationStepSchema).min(1, 'Phase must have at least one step'),
43
43
  /** Optional: Default timeout for all steps (milliseconds, default: 300000 = 5min) */
44
44
  timeout: z.number().positive().optional().default(300000),
45
45
  /** Optional: Fail fast - stop on first error (default: true) */
46
46
  failFast: z.boolean().optional().default(true),
47
- });
48
- /**
49
- * Caching Strategy Schema
50
- */
51
- export const CachingStrategySchema = z.enum([
52
- 'git-tree-hash', // Content-based hashing (default)
53
- 'timestamp', // File modification time
54
- 'disabled', // No caching
55
- ]);
47
+ }).strict();
56
48
  /**
57
49
  * Validation Config Schema
58
50
  */
59
51
  export const ValidationConfigSchema = z.object({
60
52
  /** Validation phases to execute */
61
53
  phases: z.array(ValidationPhaseSchema).min(1, 'At least one phase required'),
62
- /** Caching configuration */
63
- caching: z.object({
64
- /** Caching strategy (default: git-tree-hash) */
65
- strategy: CachingStrategySchema.default('git-tree-hash'),
66
- /** Enable caching (default: true) */
67
- enabled: z.boolean().default(true),
68
- /** State file path (default: .vibe-validate-state.yaml) */
69
- statePath: z.string().default('.vibe-validate-state.yaml'),
70
- }).optional().default({
71
- strategy: 'git-tree-hash',
72
- enabled: true,
73
- statePath: '.vibe-validate-state.yaml',
74
- }),
75
- });
54
+ /** Optional: Fail fast - stop all validation on first phase failure (default: true) */
55
+ failFast: z.boolean().optional().default(true),
56
+ }).strict();
76
57
  /**
77
58
  * Git Config Schema
78
59
  */
@@ -85,18 +66,7 @@ export const GitConfigSchema = z.object({
85
66
  autoSync: z.boolean().default(GIT_DEFAULTS.AUTO_SYNC),
86
67
  /** Warn if branch is behind remote (default: true) */
87
68
  warnIfBehind: z.boolean().default(GIT_DEFAULTS.WARN_IF_BEHIND),
88
- });
89
- /**
90
- * Output Config Schema
91
- */
92
- export const OutputConfigSchema = z.object({
93
- /** Show progress indicators (default: true) */
94
- showProgress: z.boolean().default(true),
95
- /** Verbose logging (default: false) */
96
- verbose: z.boolean().default(false),
97
- /** Suppress ANSI colors (default: false) */
98
- noColor: z.boolean().default(false),
99
- });
69
+ }).strict();
100
70
  /**
101
71
  * CI/CD Configuration Schema
102
72
  */
@@ -109,7 +79,7 @@ export const CIConfigSchema = z.object({
109
79
  failFast: z.boolean().optional(),
110
80
  /** Enable coverage reporting (default: false) */
111
81
  coverage: z.boolean().optional(),
112
- });
82
+ }).strict();
113
83
  /**
114
84
  * Hooks Configuration Schema
115
85
  */
@@ -120,11 +90,11 @@ export const HooksConfigSchema = z.object({
120
90
  enabled: z.boolean().default(true),
121
91
  /** Custom pre-commit command (default: 'npx vibe-validate pre-commit') */
122
92
  command: z.string().default('npx vibe-validate pre-commit'),
123
- }).optional().default({
93
+ }).strict().optional().default({
124
94
  enabled: true,
125
95
  command: 'npx vibe-validate pre-commit',
126
96
  }),
127
- });
97
+ }).strict();
128
98
  /**
129
99
  * Full Configuration Schema
130
100
  *
@@ -140,12 +110,6 @@ export const VibeValidateConfigSchema = z.object({
140
110
  autoSync: GIT_DEFAULTS.AUTO_SYNC,
141
111
  warnIfBehind: GIT_DEFAULTS.WARN_IF_BEHIND,
142
112
  }),
143
- /** Output formatting configuration */
144
- output: OutputConfigSchema.optional().default({
145
- showProgress: true,
146
- verbose: false,
147
- noColor: false,
148
- }),
149
113
  /** CI/CD configuration (for GitHub Actions workflow generation) */
150
114
  ci: CIConfigSchema.optional(),
151
115
  /** Hooks configuration (pre-commit, etc.) */
@@ -155,11 +119,7 @@ export const VibeValidateConfigSchema = z.object({
155
119
  command: 'npx vibe-validate pre-commit',
156
120
  },
157
121
  }),
158
- /** Optional: Preset name (typescript-library, typescript-nodejs, etc.) */
159
- preset: z.string().optional(),
160
- /** Optional: Extend another config file */
161
- extends: z.string().optional(),
162
- });
122
+ }).strict();
163
123
  /**
164
124
  * Validate configuration object
165
125
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vibe-validate/config",
3
- "version": "0.10.3",
4
- "description": "Configuration system for vibe-validate with TypeScript-first design and framework presets",
3
+ "version": "0.11.0",
4
+ "description": "Configuration system for vibe-validate with TypeScript-first design and config templates",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "validation",
20
20
  "config",
21
21
  "typescript",
22
- "presets",
22
+ "config-templates",
23
23
  "framework"
24
24
  ],
25
25
  "author": "Jeff Dutton",
@@ -30,12 +30,11 @@
30
30
  "directory": "packages/config"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/js-yaml": "^4.0.9",
34
33
  "typescript": "^5.7.2"
35
34
  },
36
35
  "dependencies": {
37
- "js-yaml": "^4.1.0",
38
36
  "tsx": "^4.20.6",
37
+ "yaml": "^2.6.1",
39
38
  "zod": "^3.24.1",
40
39
  "zod-to-json-schema": "^3.24.6"
41
40
  },
@@ -20,12 +20,6 @@
20
20
  "type": "boolean",
21
21
  "default": false
22
22
  },
23
- "dependsOn": {
24
- "type": "array",
25
- "items": {
26
- "type": "string"
27
- }
28
- },
29
23
  "steps": {
30
24
  "type": "array",
31
25
  "items": {
@@ -39,6 +33,9 @@
39
33
  "type": "string",
40
34
  "minLength": 1
41
35
  },
36
+ "description": {
37
+ "type": "string"
38
+ },
42
39
  "timeout": {
43
40
  "type": "number",
44
41
  "exclusiveMinimum": 0
@@ -82,33 +79,9 @@
82
79
  },
83
80
  "minItems": 1
84
81
  },
85
- "caching": {
86
- "type": "object",
87
- "properties": {
88
- "strategy": {
89
- "type": "string",
90
- "enum": [
91
- "git-tree-hash",
92
- "timestamp",
93
- "disabled"
94
- ],
95
- "default": "git-tree-hash"
96
- },
97
- "enabled": {
98
- "type": "boolean",
99
- "default": true
100
- },
101
- "statePath": {
102
- "type": "string",
103
- "default": ".vibe-validate-state.yaml"
104
- }
105
- },
106
- "additionalProperties": false,
107
- "default": {
108
- "strategy": "git-tree-hash",
109
- "enabled": true,
110
- "statePath": ".vibe-validate-state.yaml"
111
- }
82
+ "failFast": {
83
+ "type": "boolean",
84
+ "default": true
112
85
  }
113
86
  },
114
87
  "required": [
@@ -144,29 +117,6 @@
144
117
  "warnIfBehind": true
145
118
  }
146
119
  },
147
- "output": {
148
- "type": "object",
149
- "properties": {
150
- "showProgress": {
151
- "type": "boolean",
152
- "default": true
153
- },
154
- "verbose": {
155
- "type": "boolean",
156
- "default": false
157
- },
158
- "noColor": {
159
- "type": "boolean",
160
- "default": false
161
- }
162
- },
163
- "additionalProperties": false,
164
- "default": {
165
- "showProgress": true,
166
- "verbose": false,
167
- "noColor": false
168
- }
169
- },
170
120
  "ci": {
171
121
  "type": "object",
172
122
  "properties": {
@@ -220,12 +170,6 @@
220
170
  "command": "npx vibe-validate pre-commit"
221
171
  }
222
172
  }
223
- },
224
- "preset": {
225
- "type": "string"
226
- },
227
- "extends": {
228
- "type": "string"
229
173
  }
230
174
  },
231
175
  "required": [
@@ -1,27 +0,0 @@
1
- /**
2
- * Built-in Framework Presets
3
- *
4
- * Pre-configured validation setups for common TypeScript project types.
5
- */
6
- export { typescriptLibraryPreset } from './typescript-library.js';
7
- export { typescriptNodejsPreset } from './typescript-nodejs.js';
8
- export { typescriptReactPreset } from './typescript-react.js';
9
- import type { VibeValidateConfig } from '../schema.js';
10
- /**
11
- * Map of preset name to configuration
12
- */
13
- export declare const PRESETS: Record<string, VibeValidateConfig>;
14
- /**
15
- * Get a preset by name
16
- *
17
- * @param name - Preset name
18
- * @returns Preset configuration or undefined if not found
19
- */
20
- export declare function getPreset(name: string): VibeValidateConfig | undefined;
21
- /**
22
- * List all available preset names
23
- *
24
- * @returns Array of preset names
25
- */
26
- export declare function listPresets(): string[];
27
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAKvD;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAItD,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC"}
@@ -1,36 +0,0 @@
1
- /**
2
- * Built-in Framework Presets
3
- *
4
- * Pre-configured validation setups for common TypeScript project types.
5
- */
6
- export { typescriptLibraryPreset } from './typescript-library.js';
7
- export { typescriptNodejsPreset } from './typescript-nodejs.js';
8
- export { typescriptReactPreset } from './typescript-react.js';
9
- import { typescriptLibraryPreset } from './typescript-library.js';
10
- import { typescriptNodejsPreset } from './typescript-nodejs.js';
11
- import { typescriptReactPreset } from './typescript-react.js';
12
- /**
13
- * Map of preset name to configuration
14
- */
15
- export const PRESETS = {
16
- 'typescript-library': typescriptLibraryPreset,
17
- 'typescript-nodejs': typescriptNodejsPreset,
18
- 'typescript-react': typescriptReactPreset,
19
- };
20
- /**
21
- * Get a preset by name
22
- *
23
- * @param name - Preset name
24
- * @returns Preset configuration or undefined if not found
25
- */
26
- export function getPreset(name) {
27
- return PRESETS[name];
28
- }
29
- /**
30
- * List all available preset names
31
- *
32
- * @returns Array of preset names
33
- */
34
- export function listPresets() {
35
- return Object.keys(PRESETS);
36
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * Preset: TypeScript Library
3
- *
4
- * Default preset for TypeScript libraries (npm packages).
5
- * Includes type checking, linting, testing, and build validation.
6
- */
7
- import type { VibeValidateConfig } from '../schema.js';
8
- export declare const typescriptLibraryPreset: VibeValidateConfig;
9
- //# sourceMappingURL=typescript-library.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript-library.d.ts","sourceRoot":"","sources":["../../src/presets/typescript-library.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,eAAO,MAAM,uBAAuB,EA8D/B,kBAAkB,CAAC"}
@@ -1,67 +0,0 @@
1
- /**
2
- * Preset: TypeScript Library
3
- *
4
- * Default preset for TypeScript libraries (npm packages).
5
- * Includes type checking, linting, testing, and build validation.
6
- */
7
- import { GIT_DEFAULTS } from '../constants.js';
8
- export const typescriptLibraryPreset = {
9
- preset: 'typescript-library',
10
- validation: {
11
- phases: [
12
- {
13
- name: 'Phase 1: Pre-Qualification',
14
- parallel: true,
15
- failFast: true,
16
- steps: [
17
- {
18
- name: 'TypeScript type checking',
19
- command: 'tsc --noEmit',
20
- },
21
- {
22
- name: 'ESLint code checking',
23
- command: 'eslint .',
24
- },
25
- ],
26
- },
27
- {
28
- name: 'Phase 2: Testing',
29
- parallel: true,
30
- dependsOn: ['Phase 1: Pre-Qualification'],
31
- steps: [
32
- {
33
- name: 'Unit tests',
34
- command: 'npm test',
35
- },
36
- ],
37
- },
38
- {
39
- name: 'Phase 3: Build',
40
- parallel: false,
41
- dependsOn: ['Phase 2: Testing'],
42
- steps: [
43
- {
44
- name: 'Build package',
45
- command: 'npm run build',
46
- },
47
- ],
48
- },
49
- ],
50
- caching: {
51
- strategy: 'git-tree-hash',
52
- enabled: true,
53
- statePath: '.vibe-validate-state.yaml',
54
- },
55
- },
56
- git: {
57
- mainBranch: GIT_DEFAULTS.MAIN_BRANCH,
58
- remoteOrigin: GIT_DEFAULTS.REMOTE_ORIGIN,
59
- autoSync: GIT_DEFAULTS.AUTO_SYNC,
60
- warnIfBehind: GIT_DEFAULTS.WARN_IF_BEHIND,
61
- },
62
- output: {
63
- showProgress: true,
64
- verbose: false,
65
- noColor: false,
66
- },
67
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Preset: TypeScript Node.js Application
3
- *
4
- * Preset for Node.js applications with TypeScript.
5
- * Includes type checking, linting, unit/integration tests, and build validation.
6
- */
7
- import type { VibeValidateConfig } from '../schema.js';
8
- export declare const typescriptNodejsPreset: VibeValidateConfig;
9
- //# sourceMappingURL=typescript-nodejs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript-nodejs.d.ts","sourceRoot":"","sources":["../../src/presets/typescript-nodejs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,eAAO,MAAM,sBAAsB,EA2D9B,kBAAkB,CAAC"}
@@ -1,64 +0,0 @@
1
- /**
2
- * Preset: TypeScript Node.js Application
3
- *
4
- * Preset for Node.js applications with TypeScript.
5
- * Includes type checking, linting, unit/integration tests, and build validation.
6
- */
7
- import { GIT_DEFAULTS } from '../constants.js';
8
- export const typescriptNodejsPreset = {
9
- preset: 'typescript-nodejs',
10
- validation: {
11
- phases: [
12
- {
13
- name: 'Phase 1: Pre-Qualification + Build',
14
- parallel: true,
15
- failFast: true,
16
- steps: [
17
- {
18
- name: 'TypeScript type checking',
19
- command: 'tsc --noEmit',
20
- },
21
- {
22
- name: 'ESLint code checking',
23
- command: 'eslint .',
24
- },
25
- {
26
- name: 'Build',
27
- command: 'npm run build',
28
- },
29
- ],
30
- },
31
- {
32
- name: 'Phase 2: Testing',
33
- parallel: true,
34
- dependsOn: ['Phase 1: Pre-Qualification + Build'],
35
- steps: [
36
- {
37
- name: 'Unit tests',
38
- command: 'npm run test:unit',
39
- },
40
- {
41
- name: 'Integration tests',
42
- command: 'npm run test:integration',
43
- },
44
- ],
45
- },
46
- ],
47
- caching: {
48
- strategy: 'git-tree-hash',
49
- enabled: true,
50
- statePath: '.vibe-validate-state.yaml',
51
- },
52
- },
53
- git: {
54
- mainBranch: GIT_DEFAULTS.MAIN_BRANCH,
55
- remoteOrigin: GIT_DEFAULTS.REMOTE_ORIGIN,
56
- autoSync: GIT_DEFAULTS.AUTO_SYNC,
57
- warnIfBehind: GIT_DEFAULTS.WARN_IF_BEHIND,
58
- },
59
- output: {
60
- showProgress: true,
61
- verbose: false,
62
- noColor: false,
63
- },
64
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * Preset: TypeScript React Application
3
- *
4
- * Preset for React applications with TypeScript.
5
- * Includes type checking, linting, component tests, and build validation.
6
- */
7
- import type { VibeValidateConfig } from '../schema.js';
8
- export declare const typescriptReactPreset: VibeValidateConfig;
9
- //# sourceMappingURL=typescript-react.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"typescript-react.d.ts","sourceRoot":"","sources":["../../src/presets/typescript-react.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGvD,eAAO,MAAM,qBAAqB,EAoE7B,kBAAkB,CAAC"}
@@ -1,73 +0,0 @@
1
- /**
2
- * Preset: TypeScript React Application
3
- *
4
- * Preset for React applications with TypeScript.
5
- * Includes type checking, linting, component tests, and build validation.
6
- */
7
- import { GIT_DEFAULTS } from '../constants.js';
8
- export const typescriptReactPreset = {
9
- preset: 'typescript-react',
10
- validation: {
11
- phases: [
12
- {
13
- name: 'Phase 1: Pre-Qualification',
14
- parallel: true,
15
- failFast: true,
16
- steps: [
17
- {
18
- name: 'TypeScript type checking',
19
- command: 'tsc --noEmit',
20
- },
21
- {
22
- name: 'ESLint code checking',
23
- command: 'eslint .',
24
- },
25
- ],
26
- },
27
- {
28
- name: 'Phase 2: Testing',
29
- parallel: true,
30
- dependsOn: ['Phase 1: Pre-Qualification'],
31
- steps: [
32
- {
33
- name: 'Unit tests',
34
- command: 'npm run test:unit',
35
- },
36
- {
37
- name: 'Component tests',
38
- command: 'npm run test:components',
39
- continueOnError: true, // Optional if component tests are in progress
40
- },
41
- ],
42
- },
43
- {
44
- name: 'Phase 3: Build',
45
- parallel: false,
46
- dependsOn: ['Phase 2: Testing'],
47
- steps: [
48
- {
49
- name: 'Production build',
50
- command: 'npm run build',
51
- timeout: 600000, // 10 minutes for React builds
52
- },
53
- ],
54
- },
55
- ],
56
- caching: {
57
- strategy: 'git-tree-hash',
58
- enabled: true,
59
- statePath: '.vibe-validate-state.yaml',
60
- },
61
- },
62
- git: {
63
- mainBranch: GIT_DEFAULTS.MAIN_BRANCH,
64
- remoteOrigin: GIT_DEFAULTS.REMOTE_ORIGIN,
65
- autoSync: GIT_DEFAULTS.AUTO_SYNC,
66
- warnIfBehind: GIT_DEFAULTS.WARN_IF_BEHIND,
67
- },
68
- output: {
69
- showProgress: true,
70
- verbose: false,
71
- noColor: false,
72
- },
73
- };