From 08e5b25b06563df013be635a74429c5a1a9abf37 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Thu, 5 Mar 2026 22:33:25 -0600 Subject: [PATCH] Update package development docs with configure script usage Co-Authored-By: Claude Opus 4.6 --- acorn/package-development.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/acorn/package-development.md b/acorn/package-development.md index ff9c11f3..2f7adb35 100644 --- a/acorn/package-development.md +++ b/acorn/package-development.md @@ -1,5 +1,5 @@ --- -date_modified: 2025-10-06 17:00 +date_modified: 2026-03-05 12:00 date_published: 2021-10-21 13:21 title: Developing Packages for Acorn description: Use the Acorn Example Package as a template for creating custom packages and reusable functionality for WordPress with Laravel architecture. @@ -24,6 +24,24 @@ We recommend referencing the [Laravel docs on Packages](https://laravel.com/docs From the [roots/acorn-example-package](https://github.com/roots/acorn-example-package) repo, click the **Use this template** button to create a new repo with the template. +After cloning your new repo, run the configure script to replace the placeholder names with your own: + +```shell +$ php configure.php +``` + +The script will prompt you for your vendor name, package name, namespace, and other details. You can also run it non-interactively: + +```shell +$ php configure.php --no-interaction --author-name="Your Name" --author-email="you@example.com" --vendor-slug="your-vendor" --vendor-namespace="YourVendor" --package-slug="your-package" --class-name="YourPackage" --package-description="Your package description" +``` + +To preview changes without modifying any files, use `--dry-run`: + +```shell +$ php configure.php --dry-run +``` + ## Developing an Acorn package Once your package is created, clone your new git repo somewhere on your machine that's accessible from a WordPress site with Acorn installed. To work on a package locally, you can require it by defining a new local repository from the `composer.json` file used for your site/theme: @@ -58,6 +76,6 @@ $ wp acorn package:discover roots/sage ....................... DONE ``` -::: warning -We have plans to [automate replacing the placeholders in the example package](https://github.com/roots/acorn/issues/271) in the future +::: tip +If you haven't already, run `php configure.php` from the root of your package to replace the placeholder names :::