WordPress.org

Making WordPress.org

Changeset 8779


Ignore:
Timestamp:
05/10/2019 10:24:19 PM (7 months ago)
Author:
coreymckrill
Message:

WordCamp Blocks: File and folder reorganization

This moves things around so that the files and folders more closely match
the structure used by Gutenberg and other modern JS projects. It also
reorganizes many of the PHP files so that it's easier to correlate them with
their JS counterparts.

Additionally:

Location:
sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks
Files:
81 added
7 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/blocks.php

    r8737 r8779  
    11<?php
    22namespace WordCamp\Blocks;
     3
    34defined( 'WPINC' ) || die();
    45
     
    1112 * @return void
    1213 */
    13 function load() {
    14     require_once PLUGIN_DIR . 'includes/shared/content.php';
    15     require_once PLUGIN_DIR . 'includes/shared/definitions.php';
    16     require_once PLUGIN_DIR . 'includes/shared/featured-image.php';
    17     require_once PLUGIN_DIR . 'includes/shared/post-list.php';
     14function load_includes() {
     15    $includes_dir = PLUGIN_DIR . 'includes/';
    1816
    19     require_once PLUGIN_DIR . 'includes/organizers.php';
    20     require_once PLUGIN_DIR . 'includes/sessions.php';
    21     require_once PLUGIN_DIR . 'includes/speakers.php';
    22     require_once PLUGIN_DIR . 'includes/sponsors.php';
     17    require_once $includes_dir . 'definitions.php';
     18
     19    // Utilities.
     20    require_once $includes_dir . 'utilities/content.php';
     21
     22    // Components.
     23    require_once $includes_dir . 'components/block-content.php';
     24    require_once $includes_dir . 'components/featured-image.php';
     25    require_once $includes_dir . 'components/post-list.php';
     26
     27    // Blocks.
     28    require_once $includes_dir . 'blocks/organizers.php';
     29    require_once $includes_dir . 'blocks/sessions.php';
     30    require_once $includes_dir . 'blocks/speakers.php';
     31    require_once $includes_dir . 'blocks/sponsors.php';
    2332
    2433}
    25 add_action( 'plugins_loaded', __NAMESPACE__ . '\load' );
     34
     35add_action( 'plugins_loaded', __NAMESPACE__ . '\load_includes' );
    2636
    2737/**
     
    5363    wp_register_style(
    5464        'wordcamp-blocks',
    55         PLUGIN_URL . 'assets/blocks.min.css',
     65        PLUGIN_URL . 'build/blocks.min.css',
    5666        [],
    57         filemtime( PLUGIN_DIR . 'assets/blocks.min.css' )
     67        filemtime( PLUGIN_DIR . 'build/blocks.min.css' )
    5868    );
    5969
    6070    wp_register_script(
    6171        'wordcamp-blocks',
    62         PLUGIN_URL . 'assets/blocks.min.js',
     72        PLUGIN_URL . 'build/blocks.min.js',
    6373        array(
    6474            'lodash',
     
    7484            'wp-url',
    7585        ),
    76         filemtime( PLUGIN_DIR . 'assets/blocks.min.js' ),
     86        filemtime( PLUGIN_DIR . 'build/blocks.min.js' ),
    7787        false
    7888    );
  • sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js

    r8611 r8779  
    2424
    2525    entry: {
    26         blocks: path.resolve( __dirname, 'assets/src/blocks.js' ),
     26        blocks: path.resolve( __dirname, 'source/blocks.js' ),
    2727    },
    2828
    2929    output: {
    3030        filename : '[name].min.js',
    31         path     : path.resolve( __dirname, 'assets' ),
     31        path     : path.resolve( __dirname, 'build' ),
    3232    },
    3333
Note: See TracChangeset for help on using the changeset viewer.