Skip to content

Commit

Permalink
Merge pull request #104 from alleyinteractive/remove-scaffold
Browse files Browse the repository at this point in the history
Remove all references to the alley scaffolder
  • Loading branch information
srtfisher authored Dec 12, 2022
2 parents 51b6e96 + 0a20fa1 commit 5d58589
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 44 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/merge-develop-to-scaffold.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
echo "Cloning alleyinteractive/create-wordpress-plugin..."
git clone --recursive --quiet https://[email protected]/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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
24 changes: 0 additions & 24 deletions config/post-meta.json

This file was deleted.

3 changes: 3 additions & 0 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand Down
16 changes: 0 additions & 16 deletions functions.php

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"prestylelint": "check-node-version --package",
"pretest:watch": "check-node-version --package",
"pretest": "check-node-version --package",
"scaffold": "scaffold dir ./scaffold --theme=./",
"start": "wp-scripts start --webpack-copy-php --webpack-src-dir=blocks",
"stylelint:fix": "stylelint --fix \"**/*.scss\"",
"stylelint": "stylelint \"**/*.scss\" --allow-empty-input",
Expand Down
1 change: 0 additions & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ function() {
require_once __DIR__ . '/vendor/autoload.php';

// Load the plugin's main files.
require_once __DIR__ . '/functions.php';
require_once __DIR__ . '/src/assets.php';
require_once __DIR__ . '/src/meta.php';

Expand Down

0 comments on commit 5d58589

Please sign in to comment.