Skip to content

Commit

Permalink
Merge pull request #6 from alleyinteractive/feature/configure
Browse files Browse the repository at this point in the history
initial configure
  • Loading branch information
mogmarsh authored Sep 19, 2023
2 parents 2f9769d + 6656626 commit 1aa9f0a
Show file tree
Hide file tree
Showing 23 changed files with 85 additions and 1,096 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/merge-develop-to-scaffold.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/upgrade-wordpress-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- uses: actions/checkout@v4
- uses: alleyinteractive/[email protected]
with:
plugin-file: 'plugin.php'
plugin-file: 'wp-conditional-blocks.php'
upgrade-npm-dependencies: "true"
9 changes: 5 additions & 4 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="create-wordpress-plugin" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer standard for create-wordpress-plugin.</description>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="wp-conditional-blocks" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer standard for wp-conditional-blocks.</description>

<!-- Include Alley Rules -->
<rule ref="Alley-Interactive" />
Expand Down Expand Up @@ -36,8 +36,9 @@
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="vendor_name" />
<element value="create_wordpress_plugin" />
<element value="alleyinteractive" />
<element value="wp_conditional_blocks" />
<element value="Alley" />
</property>
</properties>
</rule>
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to `Create WordPress Plugin` will be documented in this file.
All notable changes to `WP Conditional Blocks` will be documented in this file.

## 0.1.0 - 202X-XX-XX

Expand Down
4 changes: 0 additions & 4 deletions Makefile

This file was deleted.

51 changes: 11 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
<!--delete-->
# Create WordPress Plugin
# WP Conditional Blocks

This is a skeleton WordPress plugin that can scaffold a WordPress plugin. This
template includes a base plugin file, autoloaded PHP files, unit tests powered
by [Mantle](https://mantle.alley.com/), front-end assets compiled via Webpack,
and Continuous Integration [via GitHub Actions](.github/workflows). Actions are
configured to test the plugin and also build it for releases. A built tag
workflow will create `*-built` branches as well as a built release workflow that
will build and tag/release the plugin automatically. The built branches and
releases will include any compiled front-end assets (if using them).
Contributors: alleyinteractive

The plugin supports front-end assets which can be enqueued inside
`src/assets.php` or from within an entry points `index.php` file. For plugins
that don't require front-end assets, the configuration script below will prompt
you to delete the front-end files if you don't wish to use them.

## Getting Started

Follow these steps to get started:

1. Press the "Use template" button at the top of this repo to create a new repo
with the contents of this skeleton.
2. Run `make` (or `php ./configure.php`) to run a script that will replace all
placeholders throughout all the files.
3. Have fun creating your plugin! 🎊

<!--/delete-->

# Create WordPress Plugin

Contributors: author_username

Tags: vendor_name, create-wordpress-plugin
Tags: alleyinteractive, wp-conditional-blocks

Stable tag: 0.1.0

Expand All @@ -43,28 +14,28 @@ Requires PHP: 8.0

License: GPL v2 or later

[![Coding Standards](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/coding-standards.yml)
[![Testing Suite](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/unit-test.yml/badge.svg)](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/unit-test.yml)
[![Coding Standards](https://github.com/alleyinteractive/wp-conditional-blocks/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/alleyinteractive/wp-conditional-blocks/actions/workflows/coding-standards.yml)
[![Testing Suite](https://github.com/alleyinteractive/wp-conditional-blocks/actions/workflows/unit-test.yml/badge.svg)](https://github.com/alleyinteractive/wp-conditional-blocks/actions/workflows/unit-test.yml)

A skeleton WordPress plugin.
WordPress blocks that can be shown based on conditions.

## Installation

You can install the package via composer:

```bash
composer require alleyinteractive/create-wordpress-plugin
composer require alleyinteractive/wp-conditional-blocks
```

## Usage

Activate the plugin in WordPress and use it like so:

```php
$plugin = Create_WordPress_Plugin\Skeleton\Example_Plugin();
$plugin = Alley\WP\WP_Conditional_Blocks\WP_Conditional_Blocks\WP_Conditional_Blocks();
$plugin->perform_magic();
```
<!--front-end-->

## Testing

Run `npm run test` to run Jest tests against JavaScript files. Run
Expand Down Expand Up @@ -156,9 +127,9 @@ This project is actively maintained by [Alley
Interactive](https://github.com/alleyinteractive). Like what you see? [Come work
with us](https://alley.co/careers/).

- [author_name](https://github.com/author_name)
- [Alley Interactive](https://github.com/Alley Interactive)
- [All Contributors](../../contributors)

## License

The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.
The GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.
4 changes: 2 additions & 2 deletions blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Custom blocks in this directory can be created by running the `create-block` scr

The `create-block` script will create the block files in a the block directory using the `slug` field entered from the prompts when scaffolding the block.

The script uses the [@alleyinteractive/create-block](https://github.com/alleyinteractive/alley-scripts/tree/main/packages/create-block) script with the `--namespace` flag for scaffolding block files with the plugin namespace of `create-wordpress-plugin`. See the `create-block` script in `package.json`.
The script uses the [@alleyinteractive/create-block](https://github.com/alleyinteractive/alley-scripts/tree/main/packages/create-block) script with the `--namespace` flag for scaffolding block files with the plugin namespace of `wp-conditional-blocks`. See the `create-block` script in `package.json`.

For **dynmanic blocks** the following files will be generated:

Expand All @@ -30,4 +30,4 @@ The `index.php` contains the PHP block registration and will be autoloaded with

Block attributes should be defined in the `block.json` file. [Learn more about block.json in the block editor handbook.](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/)

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 `src/assets.php` file.
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 `src/assets.php` file.
174 changes: 0 additions & 174 deletions buddy.yml

This file was deleted.

16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "alleyinteractive/create-wordpress-plugin",
"description": "A skeleton WordPress plugin",
"name": "alleyinteractive/wp-conditional-blocks",
"description": "WordPress blocks that can be shown based on conditions",
"type": "wordpress-plugin",
"keywords": [
"alleyinteractive",
"create-wordpress-plugin"
"wp-conditional-blocks"
],
"homepage": "https://github.com/alleyinteractive/create-wordpress-plugin",
"homepage": "https://github.com/alleyinteractive/wp-conditional-blocks",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "author_name",
"email": "email@domain.com"
"name": "Alley Interactive",
"email": "info@alley.com"
}
],
"require": {
Expand All @@ -34,10 +34,10 @@
"extra": {
"wordpress-autoloader": {
"autoload": {
"Create_WordPress_Plugin\\": "src"
"Alley\\WP\\WP_Conditional_Blocks": "src"
},
"autoload-dev": {
"Create_WordPress_Plugin\\Tests\\": "tests"
"Alley\\WP\\WP_Conditional_Blocks\\Tests": "tests"
}
}
},
Expand Down
Loading

0 comments on commit 1aa9f0a

Please sign in to comment.