Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,17 @@ module.exports = function(grunt) {
} );
} );

grunt.registerTask( 'verify:view-config-schema', 'Verifies the generated view-config REST schema PHP file is in sync with the canonical JSON Schema.', function() {
const done = this.async();
grunt.util.spawn( {
cmd: 'node',
args: [ 'tools/rest-api/gen-view-config-schema-php.mjs', '--check' ],
opts: { stdio: 'inherit' }
}, function( error ) {
done( ! error );
} );
} );

grunt.renameTask( 'watch', '_watch' );

grunt.registerTask( 'watch', function() {
Expand Down Expand Up @@ -1765,6 +1776,7 @@ module.exports = function(grunt) {
] );

grunt.registerTask( 'precommit:php', [
'verify:view-config-schema',
'phpstan',
'phpunit'
] );
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@
"typecheck:php:baselines": "node ./tools/local-env/scripts/docker.js run --rm php composer phpstan:baselines --",
"gutenberg:copy": "node tools/gutenberg/copy.js",
"gutenberg:verify": "node tools/gutenberg/utils.js",
"gutenberg:download": "node tools/gutenberg/download.js && grunt build:gutenberg"
"gutenberg:download": "node tools/gutenberg/download.js && grunt build:gutenberg",
"view-config-schema:generate": "node tools/rest-api/gen-view-config-schema-php.mjs",
"view-config-schema:check": "node tools/rest-api/gen-view-config-schema-php.mjs --check"
}
}
Loading
Loading