Skip to content

Commit

Permalink
Merge branch 'main' into use-custom-block-margin-v3
Browse files Browse the repository at this point in the history
  • Loading branch information
stian-overasen committed Oct 16, 2024
2 parents 96c2ee4 + 890c1f9 commit eb82d73
Show file tree
Hide file tree
Showing 16 changed files with 10 additions and 162 deletions.
4 changes: 2 additions & 2 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ Run the following commands in the root directory to build the project:
composer install
npm ci && npm run build
```
(See `packages/themes/block-theme` or `packages/plugins/blueprint` for more details)
(See `packages/themes/block-theme` for more details)

## Extending Builds

Project Base uses [wp-scripts](https://github.com/WordPress/gutenberg/tree/trunk/packages/scripts) out of the box for building front-end/view and editor assets. wp-script will scan all `block.json` files in the `src/` folder to find available entries. This means that if you have a `src` folder with a `view.js` and a `editor.js`, you also need to add a `block.json` file at the same location. Have a look in the `block-theme` theme or the `blueprint` plugin for examples or read up on [wp-script auto discovery for Webpack entry points](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/utils/config.js#L198). For a more advanced setup, you can always customize builds by adding your own `webpack.config.js`.
Project Base uses [wp-scripts](https://github.com/WordPress/gutenberg/tree/trunk/packages/scripts) out of the box for building front-end/view and editor assets. wp-script will scan all `block.json` files in the `src/` folder to find available entries. This means that if you have a `src` folder with a `view.js` and a `editor.js`, you also need to add a `block.json` file at the same location. Have a look in the `block-theme` theme for example or read up on [wp-script auto discovery for Webpack entry points](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/utils/config.js#L198). For a more advanced setup, you can always customize builds by adding your own `webpack.config.js`.

### A quick overview of wp-scripts auto discovery:
1. Supply entry points manully to the CLI, e.g. `wp-scripts build src/view src/editor src/admin src/some-other-entry`. This will bypass 2 and 3.
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"boxuk/wp-muplugin-loader": "~2.2.0",
"composer/installers": "~2.3.0",
"dekode/block-theme": "~1.0.0",
"dekode/blueprint": "~1.0.0",
"dekodeinteraktiv/dekode-label-environment": "~1.0.0",
"inpsyde/wp-translation-downloader": "~2.5.0",
"roots/wordpress": "~6.6.2",
Expand Down
24 changes: 3 additions & 21 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions packages/plugins/blueprint/composer.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/plugins/blueprint/package.json

This file was deleted.

101 changes: 0 additions & 101 deletions packages/plugins/blueprint/plugin.php

This file was deleted.

6 changes: 0 additions & 6 deletions packages/plugins/blueprint/src/block.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/plugins/blueprint/src/editor.css

This file was deleted.

4 changes: 0 additions & 4 deletions packages/plugins/blueprint/src/editor.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/plugins/blueprint/src/view.css

This file was deleted.

4 changes: 0 additions & 4 deletions packages/plugins/blueprint/src/view.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/themes/block-theme/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

declare( strict_types = 1 );

defined( 'ABSPATH' ) || exit;

// Autoload package Composer dependencies.
Expand All @@ -15,3 +16,6 @@

// Require all files in includes folder.
\array_map( fn( $f ) => require_once $f, \glob( __DIR__ . '/includes/*.php' ) );

// Require all block.php files in build/ folder.
\array_map( fn( $f ) => require_once $f, \glob( __DIR__ . '/build/*/block.php' ) );
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"icon": "menu",
"description": "Example block",
"attributes": {},
"textdomain": "blueprint",
"textdomain": "block-theme",
"supports": {
"html": false,
"align": ["wide"]
Expand Down

0 comments on commit eb82d73

Please sign in to comment.