WordPress.org

Make WordPress Core

Ticket #49196: 49196-block-folders_updated.diff

File 49196-block-folders_updated.diff, 6.1 KB (added by chipsnyder, 6 months ago)

adding the Updated diff from the changes in GitHub. This Diff fixes the build issues with the last diff

  • src/wp-settings.php

    diff --git a/src/wp-includes/blocks/archives.php b/src/wp-includes/blocks/archives/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/archives.php
    rename to src/wp-includes/blocks/archives/index.php
    diff --git a/src/wp-includes/blocks/block.php b/src/wp-includes/blocks/block/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/block.php
    rename to src/wp-includes/blocks/block/index.php
    diff --git a/src/wp-includes/blocks/calendar.php b/src/wp-includes/blocks/calendar/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/calendar.php
    rename to src/wp-includes/blocks/calendar/index.php
    diff --git a/src/wp-includes/blocks/categories.php b/src/wp-includes/blocks/categories/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/categories.php
    rename to src/wp-includes/blocks/categories/index.php
    diff --git a/src/wp-includes/blocks/latest-comments.php b/src/wp-includes/blocks/latest-comments/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/latest-comments.php
    rename to src/wp-includes/blocks/latest-comments/index.php
    diff --git a/src/wp-includes/blocks/latest-posts.php b/src/wp-includes/blocks/latest-posts/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/latest-posts.php
    rename to src/wp-includes/blocks/latest-posts/index.php
    diff --git a/src/wp-includes/blocks/rss.php b/src/wp-includes/blocks/rss/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/rss.php
    rename to src/wp-includes/blocks/rss/index.php
    diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/search.php
    rename to src/wp-includes/blocks/search/index.php
    diff --git a/src/wp-includes/blocks/shortcode.php b/src/wp-includes/blocks/shortcode/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/shortcode.php
    rename to src/wp-includes/blocks/shortcode/index.php
    diff --git a/src/wp-includes/blocks/tag-cloud.php b/src/wp-includes/blocks/tag-cloud/index.php
    similarity index 100%
    rename from src/wp-includes/blocks/tag-cloud.php
    rename to src/wp-includes/blocks/tag-cloud/index.php
    diff --git a/src/wp-settings.php b/src/wp-settings.php
    index cf4fffc6e7..5306fe9a4a 100644
    a b  
    257257require( ABSPATH . WPINC . '/class-wp-block-type-registry.php' );
    258258require( ABSPATH . WPINC . '/class-wp-block-parser.php' );
    259259require( ABSPATH . WPINC . '/blocks.php' );
    260 require( ABSPATH . WPINC . '/blocks/archives.php' );
    261 require( ABSPATH . WPINC . '/blocks/block.php' );
    262 require( ABSPATH . WPINC . '/blocks/calendar.php' );
    263 require( ABSPATH . WPINC . '/blocks/categories.php' );
    264 require( ABSPATH . WPINC . '/blocks/latest-comments.php' );
    265 require( ABSPATH . WPINC . '/blocks/latest-posts.php' );
    266 require( ABSPATH . WPINC . '/blocks/rss.php' );
    267 require( ABSPATH . WPINC . '/blocks/search.php' );
    268 require( ABSPATH . WPINC . '/blocks/shortcode.php' );
    269 require( ABSPATH . WPINC . '/blocks/tag-cloud.php' );
     260require( ABSPATH . WPINC . '/blocks/archives/index.php' );
     261require( ABSPATH . WPINC . '/blocks/block/index.php' );
     262require( ABSPATH . WPINC . '/blocks/calendar/index.php' );
     263require( ABSPATH . WPINC . '/blocks/categories/index.php' );
     264require( ABSPATH . WPINC . '/blocks/latest-comments/index.php' );
     265require( ABSPATH . WPINC . '/blocks/latest-posts/index.php' );
     266require( ABSPATH . WPINC . '/blocks/rss/index.php' );
     267require( ABSPATH . WPINC . '/blocks/search/index.php' );
     268require( ABSPATH . WPINC . '/blocks/shortcode/index.php' );
     269require( ABSPATH . WPINC . '/blocks/tag-cloud/index.php' );
    270270
    271271$GLOBALS['wp_embed'] = new WP_Embed();
    272272
  • tools/webpack/packages.js

    diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js
    index e58b5274f3..c2519eb467 100644
    a b const LiveReloadPlugin = require( 'webpack-livereload-plugin' ); 
    77const postcss = require( 'postcss' );
    88const UglifyJS = require( 'uglify-js' );
    99
    10 const { join, basename } = require( 'path' );
     10const { join, basename, dirname } = require( 'path' );
    1111const { get } = require( 'lodash' );
    1212
    1313/**
    module.exports = function( env = { environment: 'production', watch: false, buil 
    9696
    9797        const phpFiles = {
    9898                'block-serialization-default-parser/parser.php': 'wp-includes/class-wp-block-parser.php',
    99                 'block-library/src/archives/index.php': 'wp-includes/blocks/archives.php',
    100                 'block-library/src/block/index.php': 'wp-includes/blocks/block.php',
    101                 'block-library/src/calendar/index.php': 'wp-includes/blocks/calendar.php',
    102                 'block-library/src/categories/index.php': 'wp-includes/blocks/categories.php',
    103                 'block-library/src/latest-comments/index.php': 'wp-includes/blocks/latest-comments.php',
    104                 'block-library/src/latest-posts/index.php': 'wp-includes/blocks/latest-posts.php',
    105                 'block-library/src/rss/index.php': 'wp-includes/blocks/rss.php',
    106                 'block-library/src/search/index.php': 'wp-includes/blocks/search.php',
    107                 'block-library/src/shortcode/index.php': 'wp-includes/blocks/shortcode.php',
    108                 'block-library/src/tag-cloud/index.php': 'wp-includes/blocks/tag-cloud.php',
    10999        };
    110100
     101        const blockNames = [
     102                'archives',
     103                'block',
     104                'calendar',
     105                'categories',
     106                'latest-comments',
     107                'latest-posts',
     108                'rss',
     109                'search',
     110                'shortcode',
     111                'tag-cloud',
     112        ];
     113
    111114        const developmentCopies = mapVendorCopies( vendors, buildTarget );
    112115        const minifiedCopies = mapVendorCopies( minifiedVendors, buildTarget );
    113116        const minifyCopies = mapVendorCopies( minifyVendors, buildTarget ).map( ( copyCommand ) => {
    module.exports = function( env = { environment: 'production', watch: false, buil 
    152155                to: join( baseDir, `src/${ phpFiles[ filename ] }` ),
    153156        } ) );
    154157
     158        const blockCopies = blockNames.map( ( blockName ) => {
     159                return {
     160                        from: join( baseDir, `node_modules/@wordpress/block-library/src/${ blockName }/*.+(php|json)` ),
     161                        to: join( baseDir, `src/wp-includes/blocks/${ blockName }/` ),
     162                        flatten: true,
     163                };
     164        } );
     165
    155166        const config = {
    156167                mode,
    157168
    module.exports = function( env = { environment: 'production', watch: false, buil 
    231242                                        ...vendorCopies,
    232243                                        ...cssCopies,
    233244                                        ...phpCopies,
     245                                        ...blockCopies,
    234246                                ],
    235247                        ),
    236248                ],