Files
plan2code/scripts/validate-char-count.js
T
jparkerweb 25d874d87d v1.15.2 — add Claude CLI status line, Zed support, rename 3b-review to review
- Status line: new src/statusline-claude/ (Planny box-star mascot icon),
  install/uninstall wiring in install.js, Install All (A) + Custom (S)
- Zed agent support across README, AGENTS, docs, init prompt, installer
- Rename /plan2code-3b-review to /plan2code-review (now a standalone
  utility workflow); update file, reference dir, and all cross-references
- install.js: fs.rmSync simplifications, async install, summary cleanup
- Bump to v1.15.2; CHANGELOG entries for v1.15.0/1/2
2026-06-01 16:39:35 -07:00

40 lines
1.2 KiB
JavaScript

#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const CHAR_LIMIT = 11000;
const srcDir = path.join(__dirname, '..', 'src');
// Note: readdirSync is non-recursive, so files in subdirectories like
// plan2code-review-references/ are automatically excluded from
// the character limit check. Reference files have no char limit.
const files = fs.readdirSync(srcDir)
.filter(f => f.startsWith('plan2code-') && f.endsWith('.md'))
.sort();
const failures = [];
for (const file of files) {
const filePath = path.join(srcDir, file);
const content = fs.readFileSync(filePath, 'utf8');
const charCount = content.length;
if (charCount > CHAR_LIMIT) {
failures.push({ file: path.join('src', file), charCount });
}
}
if (failures.length > 0) {
console.error('Character limit exceeded:');
console.error('');
for (const { file, charCount } of failures) {
console.error(` ${file}: ${charCount} / ${CHAR_LIMIT} (+${charCount - CHAR_LIMIT} over)`);
}
console.error('');
console.error(`${failures.length} file(s) over the ${CHAR_LIMIT} character limit.`);
process.exit(1);
}
console.log(`All ${files.length} files under ${CHAR_LIMIT} characters \u2713`);
process.exit(0);