diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml new file mode 100644 index 00000000..5465956a --- /dev/null +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -0,0 +1,34 @@ +name: Merge Develop to Scaffold Branch + +on: + push: + branches: + - develop + - remove-scaffold + +jobs: + merge-develop-to-scaffold: + name: merge develop to scaffold + runs-on: ubuntu-latest + + steps: + - name: Merge develop to scaffold + shell: bash + env: + DEVELOP_BRANCH: develop + SCAFFOLD_BRANCH: scaffold + + TOKEN: ${{ secrets.GH_TOKEN }} + run: | + git config --global user.name "$GITHUB_ACTOR" + git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" + + echo "Cloning alleyinteractive/create-wordpress-plugin..." + git clone --recursive --quiet https://$TOKEN@github.com/alleyinteractive/create-wordpress-plugin.git create-wordpress-plugin -b $SCAFFOLD_BRANCH + cd create-wordpress-plugin + + git fetch origin $DEVELOP_BRANCH + git fetch origin $SCAFFOLD_BRANCH + + git merge origin/$DEVELOP_BRANCH --no-edit + git push -u origin $SCAFFOLD_BRANCH diff --git a/README.md b/README.md index 87bcfe2d..c1461b55 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ happen when running development or production builds. Run `composer test` to run tests against PHPUnit and the PHP code in the plugin. ### The `entries` directory and entry points + All directories created in the `entries` directory can serve as entry points and will be compiled with [@wordpress/scripts](https://github.com/WordPress/gutenberg/blob/trunk/packages/scripts/README.md#scripts) into the `build` directory with an accompanied `index.asset.php` asset map. #### Enqueuing Entry Points diff --git a/blocks/README.md b/blocks/README.md index 2f7c4672..004bfbe6 100644 --- a/blocks/README.md +++ b/blocks/README.md @@ -2,7 +2,7 @@ Custom blocks in this directory can be created by running the `create-block` script. For understanding how blocks are architected, built, and enqueued refer to the [Block Editor Handbook | Anatomy of a Block](https://developer.wordpress.org/block-editor/getting-started/create-block/block-anatomy/). -### Scaffold a block with `create-block` +## Scaffold a block with `create-block` 1. In the root directory run `npm run create-block` 2. Follow the prompts to create a custom block. @@ -55,5 +55,6 @@ Block attributes should be defined in the `block.json` file. [Learn more about b Running `npm run build` will compile the JavaScript and copy the PHP files to a directory in the `build` folder using `@wordpress/scripts`. The blocks will be enqueued via `block.json` after block registration. The block `index.php` file will be read by the `load_scripts()` function found in the `function.php` file. -### Customize the block scaffolding templates. +## Customize the block scaffolding templates + The `bin/create-block` script and associated `.mustache` files replace default files included in the `@wordpress/create-block` script for scaffolding blocks. To learn more about external project templates and to customize different variations of scaffolded blocks refer to the [External Project Templates documentation](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/packages-create-block-external-template/) in the block editor handbook. diff --git a/config/post-meta.json b/config/post-meta.json deleted file mode 100644 index 1274af86..00000000 --- a/config/post-meta.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "create_wordpress_plugin_open_graph_description": { - "default": "", - "post_types": [ - "page", - "post" - ] - }, - "create_wordpress_plugin_open_graph_image": { - "default": 0, - "post_types": [ - "page", - "post" - ], - "type": "integer" - }, - "create_wordpress_plugin_open_graph_title": { - "default": "", - "post_types": [ - "page", - "post" - ] - } -} diff --git a/configure.php b/configure.php index 64d0478e..176e04db 100644 --- a/configure.php +++ b/configure.php @@ -264,6 +264,9 @@ function delete_files( string|array $paths ) { echo "\nWelcome friend to alleyinteractive/create-wordpress-plugin! 😀\nLet's setup your WordPress Plugin 🚀\n\n"; +// Always delete the 'merge-develop-to-scaffold.yml' file (this is never used in a scaffolded plugins). +delete_files( '.github/workflows/merge-develop-to-scaffold.yml' ); + $author_name = ask( question: 'Author name?', default: $args['author_name'] ?? run( 'git config user.name' ), diff --git a/functions.php b/functions.php deleted file mode 100644 index 795bfe40..00000000 --- a/functions.php +++ /dev/null @@ -1,16 +0,0 @@ -