Skip to content

Commit

Permalink
[BWP-117] Retype Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jdamner committed Jan 13, 2025
1 parent c011fb7 commit 1c2db2f
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 118 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Docs
on:
workflow_dispatch:
push:
branches:
- main

jobs:
publish:
name: Publish to retype branch
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
name: Checkout
- uses: actions/setup-dotnet@v1
name: Setup
with:
dotnet-version: 7.0.x
- uses: retypeapp/action-build@latest
name: Build
- uses: retypeapp/action-github-pages@latest
name: Publish
with:
update-branch: true
8 changes: 0 additions & 8 deletions docs/index.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/skeleton.md → docs/skeleton/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,3 @@ bin/docker/wp user update admin --user_pass=your_password_here

> You can read more about all of these features in [this post on the Box UK blog](https://www.boxuk.com/insight/how-we-develop-wordpress-sites/).
## Documentation

- [Docker](./skeleton/docker-setup.md)
- [Fixtures](./skeleton/fixtures.md)
- [HTTPS](./skeleton/https.md)
- [Non-Docker Setup](./skeleton/non-docker-setup.md)
- [Patched Plugins](./skeleton/patched-plugins.md)
- [Premium Plugins](./skeleton/premium-plugins.md)
- [PHP Versions](./skeleton/php-versions.md)
- [Quickstart](./skeleton/quickstart.md)
- [Setup Initial State](./skeleton/setup-initial-state.md)
- [Testing](./skeleton/testing.md)
- [Troubleshooting](./skeleton/troubleshooting.md)
- [Usage](./skeleton/usage.md)
- [WP-VIP](./skeleton/vip.md)
90 changes: 0 additions & 90 deletions docs/update-wp-packages.md

This file was deleted.

48 changes: 43 additions & 5 deletions packages/deps-auto-update/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ on:
- cron: '0 3 * * *'
workflow_dispatch:

env:
WORDPRESS_VERSION: ${{ vars.WORDPRESS_VERSION }}

jobs:
update-deps:
runs-on: ubuntu-latest
Expand All @@ -30,11 +27,52 @@ jobs:
- name: Run Update
uses: 'boxuk/wp-deps-auto-update@main'
with:
WP_VERSION: ${{ env.WORDPRESS_VERSION }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
You could use another technique to determine the WordPress version, such as reading from your `composer.json` file.
# Setting up your Project for WP Packages
WordPress bundles versions of certain dependancies from WordPress core, and when we use `wp-scripts` to compile our packages it strips out the versions we've defined in `package.json` and instead relies on the versions bundled by WordPress. This means that you should be using the same dependancy version as WordPress provides during development to make sure that you're building compatible code.

Because of this, you should not allow `dependabot` or other automated solutions to update an `@wordpress/` packages in your node package. Instead, the `wp-scripts` `packages-update` command should be used.

## Setting up your project

You should define a `WORDPRESS_VERSION` env value in your `.env` file. This should be the major and minor version ie, `6.6` or `7.2`.

> You could use another technique to determine the WordPress version, such as reading from your `composer.json` file.

Your `package.json` file should include a script which handles updating the the WP packages to the given version. If you're using
`turbo` to manage a mono-repo, this would typically look like:
```jsonc package.json
{
// ... rest of your package
"scripts": {
// ...any other scripts
"packages-update": "turbo run packages-update --concurrency=1 -- -- --dist-tag=wp-$WORDPRESS_VERSION",
}
}
```

Without `turbo` the command would look similar but without the concurrency and the extra `--` args.

## Setting up Dependabot

You should disable dependabot from updating the included deps, by adding the following to your `dependabot.yml` file:
```yml
# NodeJS Deps
- package-ecosystem: npm
directory: "/"
registries: "*"
schedule:
interval: daily
ignore:
# Ignore updates to the WordPress packages, we'll handle those manually.
- dependency-name: "@wordpress/*"
- dependency-name: "react"
- dependency-name: "react-dom"
```

## Contributing

Expand Down
12 changes: 12 additions & 0 deletions retype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
input: .
output: .retype
url: https://boxuk.github.io/wp-packages
branding:
title: BoxUK Wordpress Packages
label: Docs
exclude:
- .git
- packages/vendor
- node_modules/
- tests/
- hooks/

0 comments on commit 1c2db2f

Please sign in to comment.