Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve packages docs - document root package json and public API knowledge #31598

Merged
merged 4 commits into from
May 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ When creating a new package, you need to provide at least the following:
Initial release.
```

To ensure your package is recognised, you should also _manually_ add your new package to the root `package.json` file and then run `npm install` to update the dependencies.

## Managing Dependencies

There are two types of dependencies that you might want to add to one of the existing WordPress packages.
Expand Down Expand Up @@ -143,6 +145,10 @@ Content within the HTML comment will be replaced by the generated documentation.
<!-- END TOKEN(Autogenerated API docs|src/actions.js) -->`.
```

## Maintaining a Public API

It's very important to have a good plan for what a new package will include. All constants, methods, and components exposed from the package will ultimately become part of the public API in WordPress core (exposed via the `wp` global - eg: `wp.blockEditor`) and as such will need to be supported indefinitely. You should be very selective in what is exposed by your package and [ensure it is well documented](#maintaining-api-documentation).

## Maintaining Changelogs

In maintaining dozens of npm packages, it can be tough to keep track of changes. To simplify the release process, each package includes a `CHANGELOG.md` file which details all published releases and the unreleased ("Unreleased") changes, if any exist.
Expand Down