Skip to content

Fix/10up block theme readme#321

Open
pdavies88 wants to merge 21 commits intotrunkfrom
fix/10up-block-theme-readme
Open

Fix/10up block theme readme#321
pdavies88 wants to merge 21 commits intotrunkfrom
fix/10up-block-theme-readme

Conversation

@pdavies88
Copy link
Copy Markdown
Contributor

Description of the Change

For the 10up-block-theme it performs the following:

  • Adds in READMEs for context on the theme
  • Update dependencies to latest versions
  • Converts JS to TS
  • Provides Example Custom Block
  • Fixes naming mismatching in Theme

Closes: N/A

How to test the Change

Can be pulled into a local WP build and run and function as normal

Changelog Entry

Added - README for 10up-Block-Theme and a Example Custom Block
Changed - JS file to TS, theme naming mismatching, and updated dependencies in the theme
Removed - styles folder as it could cause confusion between assets folder

Credits

Props @pdavies88

Checklist:

@pdavies88 pdavies88 self-assigned this Mar 25, 2026
@pdavies88 pdavies88 requested a review from fabiankaegy March 25, 2026 05:01
@pdavies88
Copy link
Copy Markdown
Contributor Author

@fabiankaegy will add some time on our calendar to chat further. But at least wanted to get a draft started of a robust README on the Theme itself as team members may use it on a one off and want to know how it works. Also saw we hadn't updated the dependencies for awhile and the project was still using JS. Anywho feel free to add comments and guidance but wanted to get the wheels turning to get your thoughts.

Copy link
Copy Markdown
Member

@fabiankaegy fabiankaegy left a comment

Choose a reason for hiding this comment

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

Thanks so much for getting this started @pdavies88 🚀

Left a bunch of notes inline and also pinned @darylldoyle & @claytoncollie for additional thoughts :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Big fan of making this change official in the theme here 👍

Something I always needed to do in projects though is add the following to the .eslintrc file:

{
	"parser": "@typescript-eslint/parser",
	"extends": ["@10up/eslint-config/wordpress"],
	"plugins": ["@typescript-eslint"],
	"rules": {}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you really think there is value in having the example block back in here?

Part of the reason why I removed it was that I ended up seeing it nor removed on client projects. And since we have the scaffold:block command in the theme here I always found it nicer / easier to just have that present.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd actually be in favor or removing this because it's also something we always have to remove and folks forget that :/

Comment thread themes/10up-block-theme/blocks/example-block/index.ts Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I know it goes against what I was saying above, but I would like to keep these here.

Section styles is an under utilized feature in my opinion so I want users of this theme to wonder about it and start to learn more about them.

See https://ignitewp.10uplabs.com/block-styling-and-css/#section-styles-in-ignite

Comment thread themes/10up-block-theme/README.md Outdated
- `register_theme_blocks()` scans `dist/blocks/*/block.json` and calls `register_block_type_from_metadata()` for each found block.
- `allowed_block_types_all` filter extends allowed blocks with theme blocks.
- `enqueue_theme_block_styles()` scans `dist/blocks/autoenqueue/**/*.css` and registers/enqueues style/script for each block with assets info from `GetAssetInfo`.
- includes block render filter for TenUp navigation block (removes ARIA roles for fallback markup compatibility).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure I understand what's meant by this

Comment thread themes/10up-block-theme/README.md Outdated
- `enqueue_theme_block_styles()` scans `dist/blocks/autoenqueue/**/*.css` and registers/enqueues style/script for each block with assets info from `GetAssetInfo`.
- includes block render filter for TenUp navigation block (removes ARIA roles for fallback markup compatibility).

### 6.2 Blocks directory structure
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's mention the scaffold command here

Comment thread themes/10up-block-theme/README.md Outdated

### 7.2 Theme script inclusion

- `src/ThemeCore::theme_setup()` calls `add_theme_support('editor-styles')` and `add_editor_style('/dist/css/frontend.css')`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is only for editor stuff. From the heading I would have expected something about the Asset trait from the framework and how to enqueue things

Comment thread themes/10up-block-theme/README.md Outdated
Comment thread themes/10up-block-theme/README.md Outdated

## 16. Further notes

- This theme is designed around a 10up block theme pattern (colors, spacing, utilities, templates).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure I understand what is meant by this

pdavies88 and others added 6 commits April 9, 2026 20:44
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
Co-authored-by: Fabian Kägy <mail@fabian-kaegy.de>
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.

@pdavies88 I don't agree with having smaller readme's throughout the codebase that can easily become out of date. I think this either should be a CLAUDE.md file (still run into same out of date issue) or place all of this into the root README/CLAUDE.md files.

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.

@pdavies88 I agree with @fabiankaegy that we should not provide an example block here as people do not take ownership and make sure it gets deleted. We have so many resources to scaffold this ou either with a cli or the documentation at gutenberg.10up.com

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.

@pdavies88 same thing here. Either a CLAUDE.md file or we consilidate into the main readme

Comment thread themes/10up-block-theme/package.json Outdated
"blocksDir": "./blocks"
}
},
"optionalDependencies": {
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.

@fabiankaegy Does 10up toolkit already load these?

Comment thread themes/10up-block-theme/README.md Outdated

## 2. Requirements

- PHP >= 8.2
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.

@fabiankaegy we should bump this to 8.4 IMO cc @pdavies88

Comment thread themes/10up-block-theme/README.md Outdated
## 2. Requirements

- PHP >= 8.2
- Node >= 18
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.

@fabiankaegy we should bump this to v24 IMO cc @pdavies88

Comment thread themes/10up-block-theme/README.md Outdated

- PHP >= 8.2
- Node >= 18
- Composer
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.

@pdavies88 if we are putting versions, this should be Composer 2

Comment thread themes/10up-block-theme/README.md Outdated
npm run build
```

### 4.2 Local development
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.

@pdavies88 this totally ignore PHP commands in composer.json. we should treat both PHP and JS/CSS as equal partners

Comment thread themes/10up-block-theme/README.md Outdated
### 4.2 Local development

- `npm run watch` (or `npm start`) → 10up-toolkit watch with HMR/hot-refresh
- `composer exec phpcs -- --standard=WordPress` → PHP lint
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.

@pdavies88 should be composer run lint

Comment thread themes/10up-block-theme/README.md Outdated
### 4.3 Common gotchas

- Always build `dist/` after changing source assets (`assets/`, `blocks/`, `src/`).
- If using a check-in strategy for `dist/`, ensure CI runs `npm run build` before release.
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.

@pdavies88 this is very nuanced and vague. I think we remove. this assumes too much about deployment which can be varied

Comment thread themes/10up-block-theme/README.md Outdated
- Always build `dist/` after changing source assets (`assets/`, `blocks/`, `src/`).
- If using a check-in strategy for `dist/`, ensure CI runs `npm run build` before release.
- `theme.json` is the source of truth for editor styles, palette, and layout. Adjust there for global styles.
- Some references may still use legacy naming in older helper docs; prefer 10up-block-theme naming in code changes.
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.

@pdavies88 can we remove this? I though we caught all of the instances.

Comment thread themes/10up-block-theme/README.md Outdated
### 4.1 Quick start (repeat for copy/paste)

```bash
cd /path/to/themes/10up-block-theme
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.

@pdavies88 you should not have to do this operation. Both NPM and Composer work from the wp-content directory to install and build all assets, not just the theme

Comment thread themes/10up-block-theme/README.md Outdated

1. Clone the repository:
```bash
git clone <repo-url> 10up-block-theme
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.

@pdavies88 I think we are getting too specific here for a theme only setup, and not sticking to the original intent of the repo which covers a large majority of use cases. Most projects use this entire scaffold, not just the theme cc @fabiankaegy

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.

@pdavies88 sorry, i am just not seeing this is the theme readme. I think this is going to throw people off the main path. I appreciate that some projects only use the theme, but a vast majority will use the entire scaffold. Fabian has spent a lot of time making things run from the wp-content directory link install and built and scaffold commands and now we are bypassing all of that work. I think it is fine to explain this theme, but then say to reference the main readme for scaffold and install instructions. cc @fabiankaegy

Comment thread themes/10up-block-theme/README.md Outdated

---

## 5. Core bootstrapping path
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.

@pdavies88 Similar to what we are finding with AGENTS.md and CLAUDE.md file, this information can go stale over time. I think all of this function reference should be removed from here in favor of docblocks on the class or methods it relates to.

Comment thread themes/10up-block-theme/README.md Outdated
Comment thread themes/10up-block-theme/README.md Outdated

---

## 16. Further notes
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.

@pdavies88 I think we can remove this section. feels redundant after all that is said eariler

Comment thread themes/10up-block-theme/README.md Outdated

---

## 15. Helpful commands summary
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.

@pdavies88 I think we can remove this section. This is the third instance where we are listing the same commands.

Comment thread themes/10up-block-theme/README.md Outdated

---

## 14. Key entrypoints quick map
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.

@pdavies88 do we need an entry point for CSS?

Comment thread themes/10up-block-theme/README.md Outdated

---

## 13. Maintenance tasks
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.

@pdavies88 can we consolidate these commands into the earlier list at the start of this file?

@pdavies88 pdavies88 marked this pull request as ready for review April 15, 2026 01:08
@pdavies88
Copy link
Copy Markdown
Contributor Author

@claytoncollie @fabiankaegy this PR has been heavily overhauled via our chat today.
Right now the PR does the following:

  1. Converts JS files over to TS - This also applies to the block generator
  2. Adds in TS support into the 10up-block-theme. Additional dev dependencies help resolve any TS warnings that may occur
  3. README inside of the 10up-block-theme has been updated but kept trim to help folks focus on the basics
  4. Used https://www.npmjs.com/package/@ravi.nder/wp-gutenberg-compat to add in the ability to check @wordpress/* projects for when they are added to be in line with the WordPress version.
  5. Reran npm i which is where the bulk of the line changes seems to come from but it looks like we need to commit the package-lock for our GHAs to actually work properly

@pdavies88
Copy link
Copy Markdown
Contributor Author

@fabiankaegy @claytoncollie adjustments have been made to also align 10up-theme as well to use TS as the default. In that theme I aligned it with the 10up-block-theme for the theme.json, adding of custom blocks, and example pattern. I also added a clean command in the root of the repo to clear out stale package-lock and node_modules.

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.

3 participants