Skip to content

Commit 4ac2473

Browse files
author
James Amner
authored
Merge pull request #304 from boxuk/BWP-117
[BWP-117] Add docs URL to readme
2 parents 9204c63 + a905e6a commit 4ac2473

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Readme.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# BoxUK WP Packages Mono Repo
22

3-
This is the BoxUK mono-repo for our WordPress packages. The [WordPress Skeleton](https://github.com/boxuk/wp-project-skeleton) uses these packages to add functionality.
3+
This is the BoxUK mono-repo for our WordPress packages. The [WordPress Skeleton](https://github.com/boxuk/wp-project-skeleton) uses these packages to add functionality. All packages provide their own documentation:
44

5-
## How to use
5+
## [📚 Read the docs](https://boxuk.github.io/wp-packages/)
6+
7+
---
8+
9+
## Working on the packages mono-repo
10+
11+
### How to use
612

713
This mono repo allows you to develop any of the packages. To start a WordPress development environment to test against, either:
814

@@ -14,11 +20,11 @@ and you'll be able to access WordPress at [http://localhost:8000](http://localho
1420

1521
We use [Monorepo Builder](https://github.com/symplify/monorepo-builder) tools to manage the mono-repo dependancies.
1622

17-
## Structure
23+
### Structure
1824

1925
Each of the packages within the `packages` directory is an individual package. These should be standalone, and any dependancies they have (with another package or external) should be loaded via composer.
2026

21-
## Adding Dependancies
27+
### Adding Dependancies
2228

2329
Dependancies for each package should be defined in the package's `composer.json` file. Once the file has been altered, from the root of the project run the following commands:
2430

@@ -29,20 +35,20 @@ bin/composer run mono:merge
2935
bin/composer install <package-name>
3036
```
3137

32-
## Adding a package
38+
### Adding a package
3339

3440
To create a package, you can run `bin/create-package <package-name>` and this will scaffold out all the necessary changes needed. In order for your package to be published, you'll also need to modify `/.github/workflows/packages.yml` to configure the package name and the target repository for publishing. This will automate pushing changes of the package out to the target repository, but you may need further work to ensure that repository is available via `composer` in your projects.
3541

36-
## Tests
42+
### Tests
3743

3844
All packages need to have 100% test coverage. During CI they will be tested for this capability.
3945

40-
## Javascript
46+
### Javascript
4147

4248
If your package requires javascript, you can also setup a `package.json` file in the root of the package. Much like `composer.json`, this will be merged automatically at the root level.
4349

4450
To run `npm` commands directly in your package run `bin/npm -w packages/<package-name>` with your command. For example `bin/npm -w packages/iconography run test` would run tests specifically in the iconography package.
4551

4652
Commands can also be run globally across all packages using `turbo`. This is setup so that if you run `bin/npm run test` it will run test in every package that has a `package.json` file with a `test` script. You should try to keep naming consistent across packages to support this work. All currently supported scripts in `turbo` are listed in the `turbo.json` file at the root.
4753

48-
During CI, the `lint`, `test` and `build` NPM scripts are run to validate the package quality. You should ensure your package supports these.
54+
During CI, the `lint`, `test` and `build` NPM scripts are run to validate the package quality. You should ensure your package supports these.

0 commit comments

Comments
 (0)