Skip to content

Start projects with more functionality - #207

Merged
dlh01 merged 10 commits into
productionfrom
feature/features
Sep 21, 2026
Merged

dlh01 merged 10 commits into
productionfrom
feature/features

Conversation

@dlh01

@dlh01 dlh01 commented Jun 4, 2026

Copy link
Copy Markdown
Member

The goals of this PR are to:

  1. Provide more commonly needed functionality to newly scaffolded projects than is included currently.
  2. Revise the implementation of the scaffolded project plugin to catch up with the starter plugin and with conventions that have proven useful over the last couple years of projects.

All of these changes are biased towards FIT's experiences, and I welcome feedback rooted in other teams' experience.

Fixes #193. Fixes #188. Fixes ##206.

Common dependencies

Commonly used dependencies are now set up in main(). More Composer packages are also installed by default to accommodate these. Some of these are dead code by default, but we have found that they eventually get used, so I opted to have them ready consistently. New projects could delete the lines if they didn't want them.

More features

This PR adds many features (plus a few non-features) to the plugin-templates directory. These are (almost) all classes that FIT has implemented project-by-project more than once. With this PR, they would be available out of the box.

Side note: Yes, this would result in duplication across projects. I have not found that the benefits of attempting to put these into a single shared repo outweigh the costs of higher maintenance effort and less flexibility for us to customize these features for their clients' needs. See alleyinteractive/wp-type-extensions#40.

Loading plugins

Plugins are now loaded in main(), which allows for integration features to be colocated with their plugins and for load order to be expressed declaratively. We generally find it useful to be able to instantiate a plugin loader multiple times, such as on a multisite where only some sites need specific plugins, and this requirement can be expressed in main() using Effect and other decorators.

create-wordpress-plugin compat

The approach to setting up main() in the configure script is updated, and block index.php files are also updated to catch up with block registration in bulk as happens now in the plugin.

TODO

  • Upgrade create-wordpress-plugin to Type Extensions 5
  • Upgrade create-wordpress-theme to Type Extensions 5
  • Verify that Type Extensions 5 is used when a new project is configured
  • Review remaining docs

@dlh01
dlh01 requested a review from a team as a code owner June 4, 2026 16:14

@jessicamgoddard jessicamgoddard left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started a "things I shouldn't have to do in a new project" list and you hit a few of them!

I only did a high-level review of this work to understand the changes being proposed. A couple of things to consider:

  • Should any of the features be put into sub-directories for better organization?
  • How can these best be documented so that devs and AI agents understand the functionality and don't duplicate efforts?

Comment thread plugin-templates/src/features/class-allowed-block-types.php
Comment thread plugin-templates/blocks/theme-faceted-search-facets/index.php
Comment thread plugin-templates/src/features/class-site-settings-page.php
Comment thread plugin-templates/src/main.php

@kaitlinbolling kaitlinbolling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍋 Looks good to me!

Comment thread plugin-templates/src/features/class-id-row-action.php
@dlh01

dlh01 commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Should any of the features be put into sub-directories for better organization?

On FIT, we haven't generally felt the need to do that, at least not in any way that I think is worth encoding in the starter project. Once in a while, we do, and once in a while, I wish we had 😄.

The structure in main() tends to tell a similar tale already. Reflecting on it now, I wonder how much stress I've saved myself by not worrying too much about subdirectories and namespaces. But again, similar to my other comment, I would really hope that teams develop a structure that makes sense for them.

How can these best be documented so that devs and AI agents understand the functionality and don't duplicate efforts?

An excellent question. I left out docs only because we're just beginning to approach this question in an AI-forward way on FIT, and so we don't have much prior art to offer. But maybe something to start with is better than nothing? I'll see what Claude comes up with and maybe include that.

@dlh01

dlh01 commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

@jessicamgoddard I added some documentation in 5723c90 with the help of the grill with docs skill, which comes with opinionated approach to how to organize the files. Do these seem helpful? Is there anything you'd consider adding, or maybe another skill to try instead?

@dlh01

dlh01 commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

(This link actually explains the skill: https://www.aihero.dev/grill-with-docs)

@jessicamgoddard

Copy link
Copy Markdown

@dlh01 I think the docs are a nice addition! It's a lot to digest, but I think it gives a good overview of where this project is and how we want to view it in the future. I especially appreciate default-features.md. I did see a lot of repetition with the concept of "everything that is included may not be used." I haven't used any other skills, but maybe a general pass by Claude to simplify the docs (especially project-plugin-bootstrap.md, docs/adr/0001-opinionated-default-features.md, and README.md) would be useful.

@dlh01

dlh01 commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Thank you for reviewing! I reviewed the files you called out and cut down on some of the duplication. I left a bit of it because the grill-with-docs skill describes its output as being intended for agents as well as humans, and I thought that some repetition might be useful if an agent doesn't read all the docs or in the expected order (same for humans!).

@dlh01
dlh01 merged commit a19f16d into production Sep 21, 2026
1 check passed
@dlh01
dlh01 deleted the feature/features branch September 21, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update to PHP 8.4 or 8.5 post-meta.json does not contain valid JSON

3 participants