From 8125983934524cad15f73627bbf072a6605a40e1 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:19:03 -0500 Subject: [PATCH 1/8] Remove all references to the alley-scaffolder --- README.md | 1 + blocks/README.md | 5 +++-- config/post-meta.json | 24 ------------------------ functions.php | 16 ---------------- package.json | 1 - plugin.php | 1 - 6 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 config/post-meta.json delete mode 100644 functions.php 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/functions.php b/functions.php deleted file mode 100644 index 795bfe40..00000000 --- a/functions.php +++ /dev/null @@ -1,16 +0,0 @@ - Date: Mon, 12 Dec 2022 15:29:19 -0500 Subject: [PATCH 2/8] Add workflow to automatically merge devlop into scaffold --- .../workflows/merge-develop-to-scaffold.yml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/merge-develop-to-scaffold.yml diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml new file mode 100644 index 00000000..1ef946e6 --- /dev/null +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -0,0 +1,31 @@ +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: + TOKEN: ${{ secrets.GITHUB_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 + + git fetch origin develop + git fetch origin scaffold + + git checkout scaffold + git merge origin/develop --no-edit + git push -u origin scaffold From 263cca49ab3b0f94e8f7abda8555196ae204b37b Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:31:11 -0500 Subject: [PATCH 3/8] Using remove-scaffold for now --- .github/workflows/merge-develop-to-scaffold.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml index 1ef946e6..1b1e5763 100644 --- a/.github/workflows/merge-develop-to-scaffold.yml +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -15,6 +15,10 @@ jobs: - name: Merge develop to scaffold shell: bash env: + # DEVELOP_BRANCH: develop + DEVELOP_BRANCH: remove-scaffold + SCAFFOLD_BRANCH: scaffold + TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | git config --global user.name "$GITHUB_ACTOR" @@ -22,10 +26,11 @@ jobs: echo "Cloning alleyinteractive/create-wordpress-plugin..." git clone --recursive --quiet https://$TOKEN@github.com/alleyinteractive/create-wordpress-plugin.git create-wordpress-plugin + cd create-wordpress-plugin - git fetch origin develop - git fetch origin scaffold + git fetch origin $DEVELOP_BRANCH + git fetch origin $SCAFFOLD_BRANCH - git checkout scaffold - git merge origin/develop --no-edit - git push -u origin scaffold + git checkout $SCAFFOLD_BRANCH + git merge origin/$DEVELOP_BRANCH --no-edit + git push -u origin $SCAFFOLD_BRANCH From fb34cc44df70d67f801faffd154bf019be84343e Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:33:28 -0500 Subject: [PATCH 4/8] Checkout branch directly --- .github/workflows/merge-develop-to-scaffold.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml index 1b1e5763..d614267a 100644 --- a/.github/workflows/merge-develop-to-scaffold.yml +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -25,12 +25,11 @@ jobs: 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 + 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 checkout $SCAFFOLD_BRANCH git merge origin/$DEVELOP_BRANCH --no-edit git push -u origin $SCAFFOLD_BRANCH From 8baa6dc1fdacbe2cb216081a32d89e23d143ef9c Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:37:32 -0500 Subject: [PATCH 5/8] Using GH_TOKEN --- .github/workflows/merge-develop-to-scaffold.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml index d614267a..8f4b6ea6 100644 --- a/.github/workflows/merge-develop-to-scaffold.yml +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -19,7 +19,7 @@ jobs: DEVELOP_BRANCH: remove-scaffold SCAFFOLD_BRANCH: scaffold - TOKEN: ${{ secrets.GITHUB_TOKEN }} + TOKEN: ${{ secrets.GH_TOKEN }} run: | git config --global user.name "$GITHUB_ACTOR" git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" From bead181eddf764f3d6e0738769e0d3ec5a9e72c8 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:45:33 -0500 Subject: [PATCH 6/8] Testing Github actions From cc77c67f8c5b1aa6e81f4e440c66422a661f0b50 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 15:50:56 -0500 Subject: [PATCH 7/8] Finishing .github/workflows/merge-develop-to-scaffold.ym --- .github/workflows/merge-develop-to-scaffold.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/merge-develop-to-scaffold.yml b/.github/workflows/merge-develop-to-scaffold.yml index 8f4b6ea6..5465956a 100644 --- a/.github/workflows/merge-develop-to-scaffold.yml +++ b/.github/workflows/merge-develop-to-scaffold.yml @@ -15,8 +15,7 @@ jobs: - name: Merge develop to scaffold shell: bash env: - # DEVELOP_BRANCH: develop - DEVELOP_BRANCH: remove-scaffold + DEVELOP_BRANCH: develop SCAFFOLD_BRANCH: scaffold TOKEN: ${{ secrets.GH_TOKEN }} From 0a20fa113acc0bf7446b0d0d89a72d271e08c8e3 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Mon, 12 Dec 2022 16:13:11 -0500 Subject: [PATCH 8/8] Remove action when scaffolding --- configure.php | 3 +++ 1 file changed, 3 insertions(+) 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' ),