mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-22 02:56:52 +03:00
Exempt hidden dirs that conventionally hold UI source from the skip rule
Greptile's review correctly flagged a regression in the blanket hidden-dir skip: .vitepress/theme/*.vue and .storybook/ preview files are real UI source that the walker scanned before this branch. Both the walker and the scan-target filter now carry a two-entry allowlist (HIDDEN_SOURCE_DIRS) for those conventional locations; every other hidden dir keeps being skipped. Prepared with AI assistance (Claude Code), directed by @pbakaus. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Code
parent
9f008ebf82
commit
a1a6441ba1
@@ -152,6 +152,23 @@ describe('gatherSignals', () => {
|
||||
assert.deepEqual(s.scan.targets, ['src/Hero.tsx']); // harness path filtered out
|
||||
});
|
||||
|
||||
it('keeps hidden-source-dir files (VitePress/Storybook) in scan targets', async () => {
|
||||
const { execFileSync } = await import('node:child_process');
|
||||
const git = (...args) => execFileSync('git', args, { cwd: scratch, stdio: 'ignore' });
|
||||
git('init', '-q');
|
||||
git('config', 'user.email', 't@example.com');
|
||||
git('config', 'user.name', 'Test');
|
||||
write('.vitepress/theme/Layout.vue', '<template><div/></template>\n');
|
||||
write('.claude/skills/impeccable/scripts/detector.js', 'export const x = 1;\n');
|
||||
git('add', '.');
|
||||
git('commit', '-qm', 'init');
|
||||
write('.vitepress/theme/Layout.vue', '<template><span/></template>\n'); // real UI source
|
||||
write('.claude/skills/impeccable/scripts/detector.js', 'export const x = 2;\n'); // vendored
|
||||
const s = await gatherSignals(scratch);
|
||||
assert.equal(s.scan.via, 'git-changes');
|
||||
assert.deepEqual(s.scan.targets, ['.vitepress/theme/Layout.vue']);
|
||||
});
|
||||
|
||||
it('falls through to source dirs when only harness files changed (#303)', async () => {
|
||||
const { execFileSync } = await import('node:child_process');
|
||||
const git = (...args) => execFileSync('git', args, { cwd: scratch, stdio: 'ignore' });
|
||||
|
||||
@@ -1846,8 +1846,17 @@ describe('walkDir', () => {
|
||||
write('.cursor/skills/impeccable/example.css');
|
||||
write('.impeccable/live/preview.html');
|
||||
write('node_modules/pkg/index.js');
|
||||
const files = walkDir(tmp);
|
||||
expect(files).toEqual([path.join(tmp, 'src', 'app.css')]);
|
||||
// Hidden dirs that conventionally hold real UI source are the
|
||||
// exception: VitePress themes and Storybook preview files must keep
|
||||
// being scanned (they were before the hidden-dir rule existed).
|
||||
write('.vitepress/theme/Layout.vue');
|
||||
write('.storybook/preview.css');
|
||||
const files = walkDir(tmp).sort();
|
||||
expect(files).toEqual([
|
||||
path.join(tmp, '.storybook', 'preview.css'),
|
||||
path.join(tmp, '.vitepress', 'theme', 'Layout.vue'),
|
||||
path.join(tmp, 'src', 'app.css'),
|
||||
]);
|
||||
} finally {
|
||||
fs.rmSync(tmp, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user