@@ -284,28 +284,40 @@ function remove_assets_require(): void {
284284 return ;
285285 }
286286
287- file_put_contents (
288- $ plugin_file ,
289- trim ( (string ) preg_replace ( '/require_once __DIR__ \. \'\/src\/assets.php \'; \\n/s ' , '' , $ contents ) ?: $ contents ) . PHP_EOL ,
290- );
287+ // Remove the assets.php require.
288+ $ contents = (string ) ( preg_replace ( '/require_once __DIR__ \. \'\/src\/assets.php \'; \\n/s ' , '' , $ contents ) ?: $ contents );
289+
290+ // Remove the load_scripts() call.
291+ $ contents = str_replace ( "load_scripts(); \n" , '' , $ contents );
292+
293+ file_put_contents ( $ plugin_file , trim ( $ contents ) . PHP_EOL );
291294}
292295
293- /* Remove the node tests from within the all-pr-tests.yml file . */
296+ /* Remove the tests that support front-end assets . */
294297function remove_assets_test (): void {
295298 $ file = __DIR__ . '/.github/workflows/all-pr-tests.yml ' ;
296299
297- if ( ! file_exists ( $ file ) ) {
298- return ;
300+ if ( file_exists ( $ file ) ) {
301+ $ contents = preg_replace (
302+ '/(- name: Run Node Tests.*)(- name: Run)/s ' ,
303+ '$2 ' ,
304+ file_get_contents ( $ file ),
305+ );
306+
307+ file_put_contents ( $ file , $ contents );
299308 }
300309
310+ // Replace the phpstan paths.
311+ if ( file_exists ( 'phpstan.neon ' ) ) {
312+ $ phpstan_contents = file_get_contents ( 'phpstan.neon ' );
301313
302- $ contents = preg_replace (
303- '/(- name: Run Node Tests.*)(- name:)/s ' ,
304- '$2 ' ,
305- file_get_contents ( $ file ),
306- );
314+ if ( ! empty ( $ phpstan_contents ) ) {
315+ $ phpstan_contents = str_replace ( '- blocks/ ' , '# - blocks/ ' , $ phpstan_contents );
316+ $ phpstan_contents = str_replace ( '- entries/ ' , '# - entries/ ' , $ phpstan_contents );
307317
308- file_put_contents ( $ file , $ contents );
318+ file_put_contents ( 'phpstan.neon ' , $ phpstan_contents );
319+ }
320+ }
309321}
310322
311323function determine_separator ( string $ path ): string {
@@ -814,7 +826,7 @@ function enable_sqlite_testing(): void {
814826// Offer some information about built releases if the workflow still exists.
815827if ( file_exists ( '.github/workflows/built-release.yml ' ) ) {
816828 echo <<<INFO
817- When you are ready to release the plugin, you can run `npm run release`
829+ When you are ready to release the plugin, you can run `composer release`
818830to generate a new release.
819831
820832The Built Release workflow will take care of the rest by building the plugin's
0 commit comments