Skip to content

Commit 40b0dc8

Browse files
committed
feat: implement comprehensive SCF JSON schema validation framework with tests and documentation
- Add SCF_JSON_Validator wrapper class (350+ lines) with comprehensive validation logic - Add 4 test files with 60+ test methods covering schema, save/load, meta, and fixtures - Add 5 test fixtures (1 valid complete, 4 invalid demonstrating common errors) - Add 5 comprehensive SCF example field groups covering all field types: * Basic fields (text, textarea, email, url, number, password) * Content fields (wysiwyg, oembed, image, file, gallery) * Choice fields (select, checkbox, radio, button_group, true_false) * Relational fields (link, post_object, page_link, relationship, taxonomy, user) * Date/time fields (date_picker, date_time_picker, time_picker, color_picker) * Advanced fields (group, repeater, flexible_content with layouts) - Add 3 npm scripts for validation: test:scf, test:scf:verbose, validate:scf - Enhance TESTING.md with 350+ lines of comprehensive SCF validation documentation - Add README.md files to all directories with development guidance Validation Features: - Root structure validation (required properties: key, title, fields, location) - Field group key format (must start with 'group_') - Field type enumeration validation (40+ field types) - Field key format validation (non-layout fields must start with 'field_') - Location rules validation (param, operator, value requirements) - Display properties validation (position, style, label_placement, hide_on_screen) - Sub-fields validation for containers (group, repeater, flexible_content) - Layout validation for flexible_content fields Test Coverage: - test-scf-json-schema-validation.php: 20+ methods covering schema structure - test-scf-json-save-load.php: 9 methods covering file I/O operations - test-scf-json-meta.php: 11 methods covering meta setup and reset - test-scf-json-fixtures.php: 16 methods covering real-world fixture validation Documentation: - Comprehensive TESTING.md section with validation overview - Field group structure examples (minimal and complete) - Common validation issues with solutions - CI/CD integration guidance - npm script usage instructions
1 parent 22c1505 commit 40b0dc8

File tree

81 files changed

+5778
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+5778
-56
lines changed

.devcontainer/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Dev Container Configuration
3+
description: Docker development environment setup
4+
category: Project
5+
type: Reference
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# Development Container
211

312
This directory contains configuration for VS Code Dev Containers, providing a consistent Docker-based development environment.

.github/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: GitHub Configuration
3+
description: GitHub-specific configuration files
4+
category: Project
5+
type: Index
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# GitHub Configuration
211

312
This directory contains GitHub-specific configuration files for the {{name}} multi-block plugin.

.github/agents/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Agents Directory
3+
description: Automation agents and specifications
4+
category: Project
5+
type: Index
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# AI Agents
211

312
This directory contains AI agent configurations for automated multi-block plugin development tasks.

.github/copilot-tasks.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Copilot Tasklist
3+
description: Tracked tasks and audit items for automation
4+
category: Project
5+
type: Index
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# Copilot Tasklist - Multi-Block Plugin Scaffold
211

312
> **Status**: 🔄 Initial scaffold setup

.github/custom-instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Custom AI Instructions
3+
description: Custom instructions for AI assistants and Copilot
4+
category: Project
5+
type: Guide
6+
audience: AI Assistants, Developers
7+
date: 2025-12-01
8+
---
9+
110
# Multi-Block Plugin Scaffold: AI, Copilot, and Development Instructions
211

312
## Overview & Related Files

.github/instructions/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Instructions Directory
3+
description: Developer and AI instruction files
4+
category: Project
5+
type: Index
6+
audience: Developers, AI Assistants
7+
date: 2025-12-01
8+
---
9+
110
# Development Instructions
211

312
This directory contains detailed instructions and guidelines for AI-assisted multi-block plugin development.

.github/instructions/block-json.instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Block JSON Instructions
3+
description: Standards for block.json configuration
4+
category: Project
5+
type: Guide
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# block.json Instructions
211

312
## Essentials

.github/instructions/blocks.instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: Blocks Instructions
3+
description: Standards for WordPress block development
4+
category: Project
5+
type: Guide
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# Block Development Essentials
211

312
- Complete block.json; separate editor/front; prefer supports; i18n via `@wordpress/i18n`; efficient render callbacks.

.github/instructions/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Instructions Index
3+
description: Central index for all instruction files
4+
category: Project
5+
type: Reference
6+
audience: Developers, AI Assistants
7+
date: 2025-12-01
8+
---
9+

.github/instructions/php-block.instructions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
---
2+
title: PHP Block Instructions
3+
description: Standards for PHP in WordPress blocks
4+
category: Project
5+
type: Guide
6+
audience: Developers
7+
date: 2025-12-01
8+
---
9+
110
# PHP Block & Template Instructions
211

312
## Pattern Registration

0 commit comments

Comments
 (0)