Skip to content

Comments

Make validation script self-contained with directory discovery#1

Closed
magicmark wants to merge 2 commits intoadd-validation-scriptfrom
self-contained-validation
Closed

Make validation script self-contained with directory discovery#1
magicmark wants to merge 2 commits intoadd-validation-scriptfrom
self-contained-validation

Conversation

@magicmark
Copy link
Owner

Summary

Implements Benjie's suggestion from graphql#3 (comment) to make the validation script self-contained by handling GAP directory discovery internally.

Changes

  • Modified scripts/validate-structure.js to discover GAP-* directories using Node.js's built-in readdirSync
  • When invoked without arguments, the script now automatically finds and validates all GAP directories in the repository root
  • Single directory can still be passed as an argument for targeted validation
  • Simplified package.json test:structure script to just invoke the script directly
  • Added success messages for each validated directory

Benefits

  • All logic is self-contained in the validation script
  • Simpler npm task (no find command needed)
  • Easier to test and maintain
  • Uses native Node.js APIs instead of shelling out to find

🤖 Generated with Claude Code

magicmark and others added 2 commits February 16, 2026 09:51
The find command now uses -maxdepth 1 to restrict the search to the top-level
directory only, preventing unintended matches in subdirectories like node_modules.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The script now handles directory discovery internally using Node.js's built-in
readdirSync, eliminating the need for find in the npm script. When invoked
without arguments, it automatically discovers and validates all GAP-* directories
in the repository root. A single directory can still be passed for targeted validation.

This keeps all logic self-contained in the script and simplifies the npm task.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@magicmark magicmark force-pushed the add-validation-script branch from 3d5499c to 852bbb9 Compare February 16, 2026 15:55
@magicmark magicmark closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant