@viberails/context 0.1.0 → 0.2.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/index.cjs CHANGED
@@ -53,10 +53,15 @@ function formatEnforcedRules(config) {
53
53
  lines.push(`- Source files use **${val}**: ${examples}.`);
54
54
  }
55
55
  if (rules.requireTests && structure.testPattern) {
56
- const srcDir = structure.srcDir ?? "src";
57
- lines.push(
58
- `- Every source file in \`${srcDir}/\` must have a corresponding \`${structure.testPattern}\` file.`
59
- );
56
+ if (structure.srcDir) {
57
+ lines.push(
58
+ `- Every source file in \`${structure.srcDir}/\` must have a corresponding \`${structure.testPattern}\` file.`
59
+ );
60
+ } else {
61
+ lines.push(
62
+ `- Every source file must have a corresponding \`${structure.testPattern}\` file.`
63
+ );
64
+ }
60
65
  }
61
66
  return lines;
62
67
  }
@@ -76,6 +81,11 @@ function generateContext(config) {
76
81
  } else {
77
82
  sections.push("_(No rules configured. Edit `viberails.config.json` to add rules.)_");
78
83
  }
84
+ const packageLines = formatPackageOverrides(config);
85
+ if (packageLines.length > 0) {
86
+ sections.push("");
87
+ sections.push(packageLines.join("\n"));
88
+ }
79
89
  const boundaryLines = formatBoundaryRules(config);
80
90
  if (boundaryLines.length > 0) {
81
91
  sections.push("");
@@ -85,6 +95,51 @@ function generateContext(config) {
85
95
  sections.push("Run `viberails check` before committing to catch violations early.\n");
86
96
  return sections.join("\n");
87
97
  }
98
+ function packageHeader(pkg) {
99
+ const framework = pkg.stack?.framework;
100
+ if (framework) {
101
+ const name = typeof framework === "string" ? framework.split("@")[0] : framework;
102
+ return `### ${pkg.path} (${name})`;
103
+ }
104
+ return `### ${pkg.path}`;
105
+ }
106
+ function formatPackageOverrides(config) {
107
+ if (!config.packages || config.packages.length === 0) return [];
108
+ const lines = [];
109
+ lines.push("## Per-package rules\n");
110
+ lines.push("The following packages have rules that differ from the global defaults:\n");
111
+ for (const pkg of config.packages) {
112
+ lines.push(packageHeader(pkg));
113
+ if (pkg.conventions?.fileNaming) {
114
+ const val = conventionValue(pkg.conventions.fileNaming);
115
+ const examples = NAMING_EXAMPLES[val] ?? `e.g. \`my-module.ts\``;
116
+ lines.push(`- Source files use **${val}**: ${examples}.`);
117
+ }
118
+ if (pkg.conventions?.componentNaming) {
119
+ const val = conventionValue(pkg.conventions.componentNaming);
120
+ lines.push(`- Components use **${val}** naming.`);
121
+ }
122
+ if (pkg.conventions?.hookNaming) {
123
+ const val = conventionValue(pkg.conventions.hookNaming);
124
+ lines.push(`- Hooks use **${val}** naming.`);
125
+ }
126
+ if (pkg.conventions?.importAlias) {
127
+ const val = conventionValue(pkg.conventions.importAlias);
128
+ lines.push(`- Import alias: \`${val}\`.`);
129
+ }
130
+ if (pkg.rules?.maxFileLines !== void 0 && pkg.rules.maxFileLines > 0) {
131
+ lines.push(
132
+ `- Files must not exceed **${pkg.rules.maxFileLines} lines**. Split into focused modules.`
133
+ );
134
+ }
135
+ if (pkg.rules?.maxFunctionLines !== void 0 && pkg.rules.maxFunctionLines > 0) {
136
+ lines.push(
137
+ `- Functions must not exceed **${pkg.rules.maxFunctionLines} lines**. Extract helpers for complex logic.`
138
+ );
139
+ }
140
+ }
141
+ return lines;
142
+ }
88
143
  function formatBoundaryRules(config) {
89
144
  if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {
90
145
  return [];
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/generate-context.ts"],"sourcesContent":["export { generateContext } from './generate-context.js';\n","import type { ConventionValue, ViberailsConfig } from '@viberails/types';\n\n/** Naming convention examples for directive formatting. */\nconst NAMING_EXAMPLES: Record<string, string> = {\n 'kebab-case': '`user-profile.ts`, not `UserProfile.ts`',\n camelCase: '`userProfile.ts`, not `user-profile.ts`',\n PascalCase: '`UserProfile.ts`, not `user-profile.ts`',\n snake_case: '`user_profile.ts`, not `UserProfile.ts`',\n};\n\n/**\n * Extract the effective value from a ConventionValue (string or object).\n */\nfunction conventionValue(cv: ConventionValue): string {\n return typeof cv === 'string' ? cv : cv.value;\n}\n\n/**\n * Build the list of enforced rules as markdown bullet points.\n */\nfunction formatEnforcedRules(config: ViberailsConfig): string[] {\n const { rules, conventions, structure } = config;\n const lines: string[] = [];\n\n if (rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n\n if (rules.enforceNaming && conventions.fileNaming) {\n const val = conventionValue(conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (rules.requireTests && structure.testPattern) {\n const srcDir = structure.srcDir ?? 'src';\n lines.push(\n `- Every source file in \\`${srcDir}/\\` must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n }\n\n return lines;\n}\n\n/**\n * Generate a rules-focused context document from a ViberailsConfig.\n *\n * The output tells AI agents what rules are enforced and that commits\n * will fail if they are violated. It does not describe the project's\n * stack, structure, or architecture — that is trivially discoverable.\n *\n * @param config - The viberails configuration\n * @returns Markdown string for `.viberails/context.md`\n */\nexport function generateContext(config: ViberailsConfig): string {\n const sections: string[] = [];\n\n sections.push('# viberails enforced rules\\n');\n\n if (config.enforcement === 'enforce') {\n sections.push('Commits will be rejected if these rules are violated:\\n');\n } else {\n sections.push(\n 'These rules are checked before commits. Violations will be **warned** but not blocked:\\n',\n );\n }\n\n const ruleLines = formatEnforcedRules(config);\n if (ruleLines.length > 0) {\n sections.push(ruleLines.join('\\n'));\n } else {\n sections.push('_(No rules configured. Edit `viberails.config.json` to add rules.)_');\n }\n\n const boundaryLines = formatBoundaryRules(config);\n if (boundaryLines.length > 0) {\n sections.push('');\n sections.push(boundaryLines.join('\\n'));\n }\n\n sections.push('');\n sections.push('Run `viberails check` before committing to catch violations early.\\n');\n\n return sections.join('\\n');\n}\n\n/**\n * Build the boundary rules section as markdown lines.\n * Only includes deny rules (allow: false).\n */\nfunction formatBoundaryRules(config: ViberailsConfig): string[] {\n if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {\n return [];\n }\n\n const denyRules = config.boundaries.filter((r) => !r.allow);\n if (denyRules.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Boundary rules\\n');\n lines.push('These import boundaries are enforced:\\n');\n\n for (const rule of denyRules) {\n const reason = rule.reason ? ` (${rule.reason})` : '';\n lines.push(`- \\`${rule.from}\\` must NOT import from \\`${rule.to}\\`${reason}`);\n }\n\n return lines;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAM,kBAA0C;AAAA,EAC9C,cAAc;AAAA,EACd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AACd;AAKA,SAAS,gBAAgB,IAA6B;AACpD,SAAO,OAAO,OAAO,WAAW,KAAK,GAAG;AAC1C;AAKA,SAAS,oBAAoB,QAAmC;AAC9D,QAAM,EAAE,OAAO,aAAa,UAAU,IAAI;AAC1C,QAAM,QAAkB,CAAC;AAEzB,MAAI,MAAM,eAAe,GAAG;AAC1B,UAAM;AAAA,MACJ,6BAA6B,MAAM,YAAY;AAAA,IACjD;AAAA,EACF;AAEA,MAAI,MAAM,mBAAmB,GAAG;AAC9B,UAAM;AAAA,MACJ,iCAAiC,MAAM,gBAAgB;AAAA,IACzD;AAAA,EACF;AAEA,MAAI,MAAM,iBAAiB,YAAY,YAAY;AACjD,UAAM,MAAM,gBAAgB,YAAY,UAAU;AAClD,UAAM,WAAW,gBAAgB,GAAG,KAAK;AACzC,UAAM,KAAK,wBAAwB,GAAG,OAAO,QAAQ,GAAG;AAAA,EAC1D;AAEA,MAAI,MAAM,gBAAgB,UAAU,aAAa;AAC/C,UAAM,SAAS,UAAU,UAAU;AACnC,UAAM;AAAA,MACJ,4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.ts"],"sourcesContent":["export { generateContext } from './generate-context.js';\n","import type { ConventionValue, PackageConfigOverrides, ViberailsConfig } from '@viberails/types';\n\n/** Naming convention examples for directive formatting. */\nconst NAMING_EXAMPLES: Record<string, string> = {\n 'kebab-case': '`user-profile.ts`, not `UserProfile.ts`',\n camelCase: '`userProfile.ts`, not `user-profile.ts`',\n PascalCase: '`UserProfile.ts`, not `user-profile.ts`',\n snake_case: '`user_profile.ts`, not `UserProfile.ts`',\n};\n\n/**\n * Extract the effective value from a ConventionValue (string or object).\n */\nfunction conventionValue(cv: ConventionValue): string {\n return typeof cv === 'string' ? cv : cv.value;\n}\n\n/**\n * Build the list of enforced rules as markdown bullet points.\n */\nfunction formatEnforcedRules(config: ViberailsConfig): string[] {\n const { rules, conventions, structure } = config;\n const lines: string[] = [];\n\n if (rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n\n if (rules.enforceNaming && conventions.fileNaming) {\n const val = conventionValue(conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (rules.requireTests && structure.testPattern) {\n if (structure.srcDir) {\n lines.push(\n `- Every source file in \\`${structure.srcDir}/\\` must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n } else {\n lines.push(\n `- Every source file must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n }\n }\n\n return lines;\n}\n\n/**\n * Generate a rules-focused context document from a ViberailsConfig.\n *\n * The output tells AI agents what rules are enforced and that commits\n * will fail if they are violated. It does not describe the project's\n * stack, structure, or architecture — that is trivially discoverable.\n *\n * @param config - The viberails configuration\n * @returns Markdown string for `.viberails/context.md`\n */\nexport function generateContext(config: ViberailsConfig): string {\n const sections: string[] = [];\n\n sections.push('# viberails enforced rules\\n');\n\n if (config.enforcement === 'enforce') {\n sections.push('Commits will be rejected if these rules are violated:\\n');\n } else {\n sections.push(\n 'These rules are checked before commits. Violations will be **warned** but not blocked:\\n',\n );\n }\n\n const ruleLines = formatEnforcedRules(config);\n if (ruleLines.length > 0) {\n sections.push(ruleLines.join('\\n'));\n } else {\n sections.push('_(No rules configured. Edit `viberails.config.json` to add rules.)_');\n }\n\n const packageLines = formatPackageOverrides(config);\n if (packageLines.length > 0) {\n sections.push('');\n sections.push(packageLines.join('\\n'));\n }\n\n const boundaryLines = formatBoundaryRules(config);\n if (boundaryLines.length > 0) {\n sections.push('');\n sections.push(boundaryLines.join('\\n'));\n }\n\n sections.push('');\n sections.push('Run `viberails check` before committing to catch violations early.\\n');\n\n return sections.join('\\n');\n}\n\n/**\n * Build the header for a package override section.\n */\nfunction packageHeader(pkg: PackageConfigOverrides): string {\n const framework = pkg.stack?.framework;\n if (framework) {\n const name = typeof framework === 'string' ? framework.split('@')[0] : framework;\n return `### ${pkg.path} (${name})`;\n }\n return `### ${pkg.path}`;\n}\n\n/**\n * Build the per-package overrides section as markdown lines.\n */\nfunction formatPackageOverrides(config: ViberailsConfig): string[] {\n if (!config.packages || config.packages.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Per-package rules\\n');\n lines.push('The following packages have rules that differ from the global defaults:\\n');\n\n for (const pkg of config.packages) {\n lines.push(packageHeader(pkg));\n\n if (pkg.conventions?.fileNaming) {\n const val = conventionValue(pkg.conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (pkg.conventions?.componentNaming) {\n const val = conventionValue(pkg.conventions.componentNaming);\n lines.push(`- Components use **${val}** naming.`);\n }\n\n if (pkg.conventions?.hookNaming) {\n const val = conventionValue(pkg.conventions.hookNaming);\n lines.push(`- Hooks use **${val}** naming.`);\n }\n\n if (pkg.conventions?.importAlias) {\n const val = conventionValue(pkg.conventions.importAlias);\n lines.push(`- Import alias: \\`${val}\\`.`);\n }\n\n if (pkg.rules?.maxFileLines !== undefined && pkg.rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${pkg.rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (pkg.rules?.maxFunctionLines !== undefined && pkg.rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${pkg.rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n }\n\n return lines;\n}\n\n/**\n * Build the boundary rules section as markdown lines.\n * Only includes deny rules (allow: false).\n */\nfunction formatBoundaryRules(config: ViberailsConfig): string[] {\n if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {\n return [];\n }\n\n const denyRules = config.boundaries.filter((r) => !r.allow);\n if (denyRules.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Boundary rules\\n');\n lines.push('These import boundaries are enforced:\\n');\n\n for (const rule of denyRules) {\n const reason = rule.reason ? ` (${rule.reason})` : '';\n lines.push(`- \\`${rule.from}\\` must NOT import from \\`${rule.to}\\`${reason}`);\n }\n\n return lines;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAM,kBAA0C;AAAA,EAC9C,cAAc;AAAA,EACd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AACd;AAKA,SAAS,gBAAgB,IAA6B;AACpD,SAAO,OAAO,OAAO,WAAW,KAAK,GAAG;AAC1C;AAKA,SAAS,oBAAoB,QAAmC;AAC9D,QAAM,EAAE,OAAO,aAAa,UAAU,IAAI;AAC1C,QAAM,QAAkB,CAAC;AAEzB,MAAI,MAAM,eAAe,GAAG;AAC1B,UAAM;AAAA,MACJ,6BAA6B,MAAM,YAAY;AAAA,IACjD;AAAA,EACF;AAEA,MAAI,MAAM,mBAAmB,GAAG;AAC9B,UAAM;AAAA,MACJ,iCAAiC,MAA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AA,QACJ,iCAAiC,IAAI,MAAM,gBAAgB;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAMA,SAAS,oBAAoB,QAAmC;AAC9D,MAAI,CAAC,OAAO,MAAM,qBAAqB,CAAC,OAAO,cAAc,OAAO,WAAW,WAAW,GAAG;AAC3F,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,YAAY,OAAO,WAAW,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK;AAC1D,MAAI,UAAU,WAAW,EAAG,QAAO,CAAC;AAEpC,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,qBAAqB;AAChC,QAAM,KAAK,yCAAyC;AAEpD,aAAW,QAAQ,WAAW;AAC5B,UAAM,SAAS,KAAK,SAAS,KAAK,KAAK,MAAM,MAAM;AACnD,UAAM,KAAK,OAAO,KAAK,IAAI,6BAA6B,KAAK,EAAE,KAAK,MAAM,EAAE;AAAA,EAC9E;AAEA,SAAO;AACT;","names":[]}
package/dist/index.js CHANGED
@@ -27,10 +27,15 @@ function formatEnforcedRules(config) {
27
27
  lines.push(`- Source files use **${val}**: ${examples}.`);
28
28
  }
29
29
  if (rules.requireTests && structure.testPattern) {
30
- const srcDir = structure.srcDir ?? "src";
31
- lines.push(
32
- `- Every source file in \`${srcDir}/\` must have a corresponding \`${structure.testPattern}\` file.`
33
- );
30
+ if (structure.srcDir) {
31
+ lines.push(
32
+ `- Every source file in \`${structure.srcDir}/\` must have a corresponding \`${structure.testPattern}\` file.`
33
+ );
34
+ } else {
35
+ lines.push(
36
+ `- Every source file must have a corresponding \`${structure.testPattern}\` file.`
37
+ );
38
+ }
34
39
  }
35
40
  return lines;
36
41
  }
@@ -50,6 +55,11 @@ function generateContext(config) {
50
55
  } else {
51
56
  sections.push("_(No rules configured. Edit `viberails.config.json` to add rules.)_");
52
57
  }
58
+ const packageLines = formatPackageOverrides(config);
59
+ if (packageLines.length > 0) {
60
+ sections.push("");
61
+ sections.push(packageLines.join("\n"));
62
+ }
53
63
  const boundaryLines = formatBoundaryRules(config);
54
64
  if (boundaryLines.length > 0) {
55
65
  sections.push("");
@@ -59,6 +69,51 @@ function generateContext(config) {
59
69
  sections.push("Run `viberails check` before committing to catch violations early.\n");
60
70
  return sections.join("\n");
61
71
  }
72
+ function packageHeader(pkg) {
73
+ const framework = pkg.stack?.framework;
74
+ if (framework) {
75
+ const name = typeof framework === "string" ? framework.split("@")[0] : framework;
76
+ return `### ${pkg.path} (${name})`;
77
+ }
78
+ return `### ${pkg.path}`;
79
+ }
80
+ function formatPackageOverrides(config) {
81
+ if (!config.packages || config.packages.length === 0) return [];
82
+ const lines = [];
83
+ lines.push("## Per-package rules\n");
84
+ lines.push("The following packages have rules that differ from the global defaults:\n");
85
+ for (const pkg of config.packages) {
86
+ lines.push(packageHeader(pkg));
87
+ if (pkg.conventions?.fileNaming) {
88
+ const val = conventionValue(pkg.conventions.fileNaming);
89
+ const examples = NAMING_EXAMPLES[val] ?? `e.g. \`my-module.ts\``;
90
+ lines.push(`- Source files use **${val}**: ${examples}.`);
91
+ }
92
+ if (pkg.conventions?.componentNaming) {
93
+ const val = conventionValue(pkg.conventions.componentNaming);
94
+ lines.push(`- Components use **${val}** naming.`);
95
+ }
96
+ if (pkg.conventions?.hookNaming) {
97
+ const val = conventionValue(pkg.conventions.hookNaming);
98
+ lines.push(`- Hooks use **${val}** naming.`);
99
+ }
100
+ if (pkg.conventions?.importAlias) {
101
+ const val = conventionValue(pkg.conventions.importAlias);
102
+ lines.push(`- Import alias: \`${val}\`.`);
103
+ }
104
+ if (pkg.rules?.maxFileLines !== void 0 && pkg.rules.maxFileLines > 0) {
105
+ lines.push(
106
+ `- Files must not exceed **${pkg.rules.maxFileLines} lines**. Split into focused modules.`
107
+ );
108
+ }
109
+ if (pkg.rules?.maxFunctionLines !== void 0 && pkg.rules.maxFunctionLines > 0) {
110
+ lines.push(
111
+ `- Functions must not exceed **${pkg.rules.maxFunctionLines} lines**. Extract helpers for complex logic.`
112
+ );
113
+ }
114
+ }
115
+ return lines;
116
+ }
62
117
  function formatBoundaryRules(config) {
63
118
  if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {
64
119
  return [];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generate-context.ts"],"sourcesContent":["import type { ConventionValue, ViberailsConfig } from '@viberails/types';\n\n/** Naming convention examples for directive formatting. */\nconst NAMING_EXAMPLES: Record<string, string> = {\n 'kebab-case': '`user-profile.ts`, not `UserProfile.ts`',\n camelCase: '`userProfile.ts`, not `user-profile.ts`',\n PascalCase: '`UserProfile.ts`, not `user-profile.ts`',\n snake_case: '`user_profile.ts`, not `UserProfile.ts`',\n};\n\n/**\n * Extract the effective value from a ConventionValue (string or object).\n */\nfunction conventionValue(cv: ConventionValue): string {\n return typeof cv === 'string' ? cv : cv.value;\n}\n\n/**\n * Build the list of enforced rules as markdown bullet points.\n */\nfunction formatEnforcedRules(config: ViberailsConfig): string[] {\n const { rules, conventions, structure } = config;\n const lines: string[] = [];\n\n if (rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n\n if (rules.enforceNaming && conventions.fileNaming) {\n const val = conventionValue(conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (rules.requireTests && structure.testPattern) {\n const srcDir = structure.srcDir ?? 'src';\n lines.push(\n `- Every source file in \\`${srcDir}/\\` must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n }\n\n return lines;\n}\n\n/**\n * Generate a rules-focused context document from a ViberailsConfig.\n *\n * The output tells AI agents what rules are enforced and that commits\n * will fail if they are violated. It does not describe the project's\n * stack, structure, or architecture — that is trivially discoverable.\n *\n * @param config - The viberails configuration\n * @returns Markdown string for `.viberails/context.md`\n */\nexport function generateContext(config: ViberailsConfig): string {\n const sections: string[] = [];\n\n sections.push('# viberails enforced rules\\n');\n\n if (config.enforcement === 'enforce') {\n sections.push('Commits will be rejected if these rules are violated:\\n');\n } else {\n sections.push(\n 'These rules are checked before commits. Violations will be **warned** but not blocked:\\n',\n );\n }\n\n const ruleLines = formatEnforcedRules(config);\n if (ruleLines.length > 0) {\n sections.push(ruleLines.join('\\n'));\n } else {\n sections.push('_(No rules configured. Edit `viberails.config.json` to add rules.)_');\n }\n\n const boundaryLines = formatBoundaryRules(config);\n if (boundaryLines.length > 0) {\n sections.push('');\n sections.push(boundaryLines.join('\\n'));\n }\n\n sections.push('');\n sections.push('Run `viberails check` before committing to catch violations early.\\n');\n\n return sections.join('\\n');\n}\n\n/**\n * Build the boundary rules section as markdown lines.\n * Only includes deny rules (allow: false).\n */\nfunction formatBoundaryRules(config: ViberailsConfig): string[] {\n if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {\n return [];\n }\n\n const denyRules = config.boundaries.filter((r) => !r.allow);\n if (denyRules.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Boundary rules\\n');\n lines.push('These import boundaries are enforced:\\n');\n\n for (const rule of denyRules) {\n const reason = rule.reason ? ` (${rule.reason})` : '';\n lines.push(`- \\`${rule.from}\\` must NOT import from \\`${rule.to}\\`${reason}`);\n }\n\n return lines;\n}\n"],"mappings":";AAGA,IAAM,kBAA0C;AAAA,EAC9C,cAAc;AAAA,EACd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AACd;AAKA,SAAS,gBAAgB,IAA6B;AACpD,SAAO,OAAO,OAAO,WAAW,KAAK,GAAG;AAC1C;AAKA,SAAS,oBAAoB,QAAmC;AAC9D,QAAM,EAAE,OAAO,aAAa,UAAU,IAAI;AAC1C,QAAM,QAAkB,CAAC;AAEzB,MAAI,MAAM,eAAe,GAAG;AAC1B,UAAM;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AC;AAAA,EACV;AAEA,QAAM,YAAY,OAAO,WAAW,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK;AAC1D,MAAI,UAAU,WAAW,EAAG,QAAO,CAAC;AAEpC,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,qBAAqB;AAChC,QAAM,KAAK,yCAAyC;AAEpD,aAAW,QAAQ,WAAW;AAC5B,UAAM,SAAS,KAAK,SAAS,KAAK,KAAK,MAAM,MAAM;AACnD,UAAM,KAAK,OAAO,KAAK,IAAI,6BAA6B,KAAK,EAAE,KAAK,MAAM,EAAE;AAAA,EAC9E;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/generate-context.ts"],"sourcesContent":["import type { ConventionValue, PackageConfigOverrides, ViberailsConfig } from '@viberails/types';\n\n/** Naming convention examples for directive formatting. */\nconst NAMING_EXAMPLES: Record<string, string> = {\n 'kebab-case': '`user-profile.ts`, not `UserProfile.ts`',\n camelCase: '`userProfile.ts`, not `user-profile.ts`',\n PascalCase: '`UserProfile.ts`, not `user-profile.ts`',\n snake_case: '`user_profile.ts`, not `UserProfile.ts`',\n};\n\n/**\n * Extract the effective value from a ConventionValue (string or object).\n */\nfunction conventionValue(cv: ConventionValue): string {\n return typeof cv === 'string' ? cv : cv.value;\n}\n\n/**\n * Build the list of enforced rules as markdown bullet points.\n */\nfunction formatEnforcedRules(config: ViberailsConfig): string[] {\n const { rules, conventions, structure } = config;\n const lines: string[] = [];\n\n if (rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n\n if (rules.enforceNaming && conventions.fileNaming) {\n const val = conventionValue(conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (rules.requireTests && structure.testPattern) {\n if (structure.srcDir) {\n lines.push(\n `- Every source file in \\`${structure.srcDir}/\\` must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n } else {\n lines.push(\n `- Every source file must have a corresponding \\`${structure.testPattern}\\` file.`,\n );\n }\n }\n\n return lines;\n}\n\n/**\n * Generate a rules-focused context document from a ViberailsConfig.\n *\n * The output tells AI agents what rules are enforced and that commits\n * will fail if they are violated. It does not describe the project's\n * stack, structure, or architecture — that is trivially discoverable.\n *\n * @param config - The viberails configuration\n * @returns Markdown string for `.viberails/context.md`\n */\nexport function generateContext(config: ViberailsConfig): string {\n const sections: string[] = [];\n\n sections.push('# viberails enforced rules\\n');\n\n if (config.enforcement === 'enforce') {\n sections.push('Commits will be rejected if these rules are violated:\\n');\n } else {\n sections.push(\n 'These rules are checked before commits. Violations will be **warned** but not blocked:\\n',\n );\n }\n\n const ruleLines = formatEnforcedRules(config);\n if (ruleLines.length > 0) {\n sections.push(ruleLines.join('\\n'));\n } else {\n sections.push('_(No rules configured. Edit `viberails.config.json` to add rules.)_');\n }\n\n const packageLines = formatPackageOverrides(config);\n if (packageLines.length > 0) {\n sections.push('');\n sections.push(packageLines.join('\\n'));\n }\n\n const boundaryLines = formatBoundaryRules(config);\n if (boundaryLines.length > 0) {\n sections.push('');\n sections.push(boundaryLines.join('\\n'));\n }\n\n sections.push('');\n sections.push('Run `viberails check` before committing to catch violations early.\\n');\n\n return sections.join('\\n');\n}\n\n/**\n * Build the header for a package override section.\n */\nfunction packageHeader(pkg: PackageConfigOverrides): string {\n const framework = pkg.stack?.framework;\n if (framework) {\n const name = typeof framework === 'string' ? framework.split('@')[0] : framework;\n return `### ${pkg.path} (${name})`;\n }\n return `### ${pkg.path}`;\n}\n\n/**\n * Build the per-package overrides section as markdown lines.\n */\nfunction formatPackageOverrides(config: ViberailsConfig): string[] {\n if (!config.packages || config.packages.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Per-package rules\\n');\n lines.push('The following packages have rules that differ from the global defaults:\\n');\n\n for (const pkg of config.packages) {\n lines.push(packageHeader(pkg));\n\n if (pkg.conventions?.fileNaming) {\n const val = conventionValue(pkg.conventions.fileNaming);\n const examples = NAMING_EXAMPLES[val] ?? `e.g. \\`my-module.ts\\``;\n lines.push(`- Source files use **${val}**: ${examples}.`);\n }\n\n if (pkg.conventions?.componentNaming) {\n const val = conventionValue(pkg.conventions.componentNaming);\n lines.push(`- Components use **${val}** naming.`);\n }\n\n if (pkg.conventions?.hookNaming) {\n const val = conventionValue(pkg.conventions.hookNaming);\n lines.push(`- Hooks use **${val}** naming.`);\n }\n\n if (pkg.conventions?.importAlias) {\n const val = conventionValue(pkg.conventions.importAlias);\n lines.push(`- Import alias: \\`${val}\\`.`);\n }\n\n if (pkg.rules?.maxFileLines !== undefined && pkg.rules.maxFileLines > 0) {\n lines.push(\n `- Files must not exceed **${pkg.rules.maxFileLines} lines**. Split into focused modules.`,\n );\n }\n\n if (pkg.rules?.maxFunctionLines !== undefined && pkg.rules.maxFunctionLines > 0) {\n lines.push(\n `- Functions must not exceed **${pkg.rules.maxFunctionLines} lines**. Extract helpers for complex logic.`,\n );\n }\n }\n\n return lines;\n}\n\n/**\n * Build the boundary rules section as markdown lines.\n * Only includes deny rules (allow: false).\n */\nfunction formatBoundaryRules(config: ViberailsConfig): string[] {\n if (!config.rules.enforceBoundaries || !config.boundaries || config.boundaries.length === 0) {\n return [];\n }\n\n const denyRules = config.boundaries.filter((r) => !r.allow);\n if (denyRules.length === 0) return [];\n\n const lines: string[] = [];\n lines.push('## Boundary rules\\n');\n lines.push('These import boundaries are enforced:\\n');\n\n for (const rule of denyRules) {\n const reason = rule.reason ? ` (${rule.reason})` : '';\n lines.push(`- \\`${rule.from}\\` must NOT import from \\`${rule.to}\\`${reason}`);\n }\n\n return lines;\n}\n"],"mappings":";AAGA,IAAM,kBAA0C;AAAA,EAC9C,cAAc;AAAA,EACd,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAC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7C;AAEA,QAAI,IAAI,aAAa,aAAa;AAChC,YAAM,MAAM,gBAAgB,IAAI,YAAY,WAAW;AACvD,YAAM,KAAK,qBAAqB,GAAG,KAAK;AAAA,IAC1C;AAEA,QAAI,IAAI,OAAO,iBAAiB,UAAa,IAAI,MAAM,eAAe,GAAG;AACvE,YAAM;AAAA,QACJ,6BAA6B,IAAI,MAAM,YAAY;AAAA,MACrD;AAAA,IACF;AAEA,QAAI,IAAI,OAAO,qBAAqB,UAAa,IAAI,MAAM,mBAAmB,GAAG;AAC/E,YAAM;AAAA,QACJ,iCAAiC,IAAI,MAAM,gBAAgB;AAAA,MAC7D;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAMA,SAAS,oBAAoB,QAAmC;AAC9D,MAAI,CAAC,OAAO,MAAM,qBAAqB,CAAC,OAAO,cAAc,OAAO,WAAW,WAAW,GAAG;AAC3F,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,YAAY,OAAO,WAAW,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK;AAC1D,MAAI,UAAU,WAAW,EAAG,QAAO,CAAC;AAEpC,QAAM,QAAkB,CAAC;AACzB,QAAM,KAAK,qBAAqB;AAChC,QAAM,KAAK,yCAAyC;AAEpD,aAAW,QAAQ,WAAW;AAC5B,UAAM,SAAS,KAAK,SAAS,KAAK,KAAK,MAAM,MAAM;AACnD,UAAM,KAAK,OAAO,KAAK,IAAI,6BAA6B,KAAK,EAAE,KAAK,MAAM,EAAE;AAAA,EAC9E;AAEA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viberails/context",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "AI context file generation for viberails",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -25,8 +25,8 @@
25
25
  "access": "public"
26
26
  },
27
27
  "dependencies": {
28
- "@viberails/types": "0.1.0",
29
- "@viberails/config": "0.1.0"
28
+ "@viberails/types": "0.2.0",
29
+ "@viberails/config": "0.2.0"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsup",