Skip to content

Commit

Permalink
Merge pull request #2 from alleyinteractive/chore/make-script
Browse files Browse the repository at this point in the history
Run make script
  • Loading branch information
kevinfodness authored Jan 16, 2025
2 parents 99ccfc3 + 965232d commit d823982
Show file tree
Hide file tree
Showing 28 changed files with 95 additions and 1,004 deletions.
1 change: 1 addition & 0 deletions .github/workflows/all-pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
with:
php-version: '${{ matrix.php }}'
wordpress-version: '${{ matrix.wordpress }}'
skip-services: 'true'
skip-wordpress-install: 'true'
# This required job ensures that all PR checks have passed before merging.
all-pr-checks-passed:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/built-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ jobs:
release:
name: "Built Branch and Release"
runs-on: ubuntu-latest
if: github.repository != 'alleyinteractive/create-wordpress-plugin'
if: github.repository != 'alleyinteractive/wp-liveblog'
steps:
- uses: alleyinteractive/action-release@develop
40 changes: 0 additions & 40 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-liveblog.php'
upgrade-npm-dependencies: "true"
8 changes: 4 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-liveblog" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer standard for wp-liveblog.</description>

<!-- Include Alley Rules -->
<rule ref="Alley-Interactive" />
Expand Down Expand Up @@ -36,9 +36,9 @@
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array">
<element value="vendor_name" />
<element value="alleyinteractive" />
<element value="alley" />
<element value="create_wordpress_plugin" />
<element value="wp_liveblog" />
</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 Liveblog` will be documented in this file.

## 0.1.0 - 202X-XX-XX

Expand Down
6 changes: 0 additions & 6 deletions Makefile

This file was deleted.

55 changes: 13 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,8 @@
<!--delete-->
# Create WordPress Plugin
# WP Liveblog

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-liveblog

Stable tag: 0.0.0

Expand All @@ -43,27 +14,27 @@ Requires PHP: 8.2

License: GPL v2 or later

[![Testing Suite](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/all-pr-tests.yml/badge.svg)](https://github.com/alleyinteractive/create-wordpress-plugin/actions/workflows/all-pr-tests.yml)
[![Testing Suite](https://github.com/alleyinteractive/wp-liveblog/actions/workflows/all-pr-tests.yml/badge.svg)](https://github.com/alleyinteractive/wp-liveblog/actions/workflows/all-pr-tests.yml)

A skeleton WordPress plugin.
Adds liveblog functionality to your WordPress site..

## Installation

You can install the package via Composer:

```bash
composer require alleyinteractive/create-wordpress-plugin
composer require alleyinteractive/wp-liveblog
```

## Usage

Activate the plugin in WordPress and use it like so:

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

## Testing

Run `npm run test` to run Jest tests against JavaScript files. Run
Expand Down Expand Up @@ -134,15 +105,15 @@ must include both the major and minor version (e.g., `6.7`). For example:
```sh
npx wp-scripts packages-update --dist-tag=wp-6.7`
```
<!--/front-end-->


## Releasing the Plugin

The plugin uses
[action-release](https://github.com/alleyinteractive/action-release) via a
[built release workflow](./.github/workflows/built-release.yml) to compile and
tag releases. Whenever a new version is detected in the root plugin's headers in
the `plugin.php` file or in the `composer.json` file, the workflow will
the `wp-liveblog.php` file or in the `composer.json` file, the workflow will
automatically build the plugin and tag it with a new version. The built tag will
contain all the required front-end assets the plugin may require. This works
well for publishing to WordPress.org or for submodule-ing.
Expand All @@ -151,7 +122,7 @@ When you are ready to release a new version of the plugin, you can run
`npm run release`/`composer release` to start the process of setting up a new
release. If you want to do this manually you can follow these steps:

1. Change the `Version` in the `plugin.php` file to a new higher-level version.
1. Change the `Version` in the `wp-liveblog.php` file to a new higher-level version.

```diff
- * Version: 0.0.0
Expand All @@ -175,9 +146,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](https://github.com/Alley)
- [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-liveblog`. 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.
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-liveblog",
"description": "Adds liveblog functionality to your WordPress site.",
"type": "wordpress-plugin",
"keywords": [
"alleyinteractive",
"create-wordpress-plugin"
"wp-liveblog"
],
"homepage": "https://github.com/alleyinteractive/create-wordpress-plugin",
"homepage": "https://github.com/alleyinteractive/wp-liveblog",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "author_name",
"email": "email@domain.com"
"name": "Alley",
"email": "info@alley.com"
}
],
"require": {
Expand All @@ -34,13 +34,13 @@
},
"autoload-dev": {
"psr-4": {
"Alley\\WP\\Create_WordPress_Plugin\\Tests\\": "tests"
"Alley\\WP\\WP_Liveblog\\Tests\\": "tests"
}
},
"extra": {
"wordpress-autoloader": {
"autoload": {
"Alley\\WP\\Create_WordPress_Plugin\\": "src"
"Alley\\WP\\WP_Liveblog\\": "src"
}
}
},
Expand Down
Loading

0 comments on commit d823982

Please sign in to comment.