You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packages: Add support for publishing stable release of pre-release package (#74332)
* Packages: Add support for publishing stable release of pre-release package
* Add code syntax highlighting for version specifiers
Co-authored-by: Marin Atanasov <[email protected]>
* Add test case for no effect on stable versions
* TypeScript-ify common bin script
* Revert "TypeScript-ify common bin script"
This reverts commit 96dbb11.
---------
Co-authored-by: Marin Atanasov <[email protected]>
Co-authored-by: aduth <[email protected]>
Co-authored-by: tyxla <[email protected]>
Copy file name to clipboardExpand all lines: packages/README.md
+41-14Lines changed: 41 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,31 +8,31 @@ Packages are the first layer of architecture and organization in Gutenberg. They
8
8
9
9
1.**Each package should have a single, clear purpose.**
10
10
11
-
It should be immediately obvious why the package exists.
11
+
It should be immediately obvious why the package exists.
12
12
13
13
2.**Every package must include a README.**
14
14
15
-
This is the first place contributors look to understand scope and usage.
15
+
This is the first place contributors look to understand scope and usage.
16
16
17
17
3.**Any prerequisites must be documented.**
18
18
19
-
Generic packages without prerequisites are better, but packages with some prerequisites are acceptable. Examples of prerequisites: API endpoints that must exist, authentication assumptions, environment dependencies. These should be clearly stated in the README.
19
+
Generic packages without prerequisites are better, but packages with some prerequisites are acceptable. Examples of prerequisites: API endpoints that must exist, authentication assumptions, environment dependencies. These should be clearly stated in the README.
20
20
21
21
4.**Public APIs should have documentation.**
22
22
23
-
Either inline in the README or linked to external docs.
23
+
Either inline in the README or linked to external docs.
24
24
25
25
5.**Avoid utility and kitchen-sink packages.**
26
26
27
-
They tend to grow without a coherent domain and become junk drawers.
27
+
They tend to grow without a coherent domain and become junk drawers.
28
28
29
29
6.**Avoid broad, catch-all scopes.**
30
30
31
-
For example: "Reusable WordPress components" or "Utilities for different use cases." These create unclear ownership and encourage uncontrolled growth. Instead, define a specific domain or purpose.
31
+
For example: "Reusable WordPress components" or "Utilities for different use cases." These create unclear ownership and encourage uncontrolled growth. Instead, define a specific domain or purpose.
32
32
33
33
7.**Default to bundled packages (no globals, no modules) unless necessary.**
34
34
35
-
In Gutenberg, we should default to "bundled" packages unless there's a specific need for globals or modules. See the [@wordpress/build README](../wp-build/README.md) for more information on package configuration.
35
+
In Gutenberg, we should default to "bundled" packages unless there's a specific need for globals or modules. See the [@wordpress/build README](../wp-build/README.md) for more information on package configuration.
36
36
37
37
For more information on the build system and package configuration, see the [@wordpress/build README](../wp-build/README.md).
38
38
@@ -141,14 +141,16 @@ Omit `wpScript` (or explicitly set to `false`) for packages designed solely as d
141
141
```
142
142
143
143
**Examples of packages that should not expose to the `wp` global:**
144
-
- Utility packages used internally by other packages
145
-
- Shared logic or helpers without a direct WordPress use case
146
-
- Intermediate packages intended only as dependencies of other `@wordpress/*` packages
144
+
145
+
- Utility packages used internally by other packages
146
+
- Shared logic or helpers without a direct WordPress use case
147
+
- Intermediate packages intended only as dependencies of other `@wordpress/*` packages
147
148
148
149
When a package omits `wpScript` or sets it to `false`, it:
149
-
- Will not be exposed as a WordPress script (not available via the `wp`global)
150
-
- Can still be used as a dependency by other packages (via npm imports)
151
-
- Should still be published to npm to support backporting to WordPress core releases
150
+
151
+
- Will not be exposed as a WordPress script (not available via the `wp`global)
152
+
- Can still be used as a dependency by other packages (via npm imports)
153
+
- Should still be published to npm to support backporting to WordPress core releases
152
154
153
155
### Truly Private Packages
154
156
@@ -270,14 +272,39 @@ _Example:_
270
272
- Fixed an off-by-one error with the `sum` function.
271
273
```
272
274
275
+
### Promoting a Pre-Release Package to Stable (1.0.0)
276
+
277
+
The automated package publishing workflow will at most bump the minor version of a pre-release package (those having a version like `0.x.x`), even if it includes breaking changes. This is consistent with semantic versioning, where `0.x` versions are intended for initial development where the API may change frequently.
278
+
279
+
When a package's API is considered stable and ready for production use, it should be promoted to version 1.0.0. This is done by adding a "Stable Release" section to the `CHANGELOG.md` file:
280
+
281
+
_Example:_
282
+
283
+
```md
284
+
## Unreleased
285
+
286
+
### Stable Release
287
+
288
+
This package is now considered stable and production-ready. The API will follow semantic versioning from this point forward.
289
+
290
+
### Breaking Changes
291
+
292
+
- Final API adjustments before 1.0.0 release.
293
+
```
294
+
295
+
The presence of the "Stable Release" heading will cause the automated release process to bump a pre-1.0 package to 1.0.0. The "Stable Release" heading should only be used for pre-1.0 packages, and from that point forward breaking changes will result in major version bumps as expected.
296
+
297
+
### Changelog Subsections
298
+
273
299
There are a number of common release subsections you can follow. Each is intended to align to a specific meaning in the context of the [Semantic Versioning (`semver`) specification](https://semver.org/) the project adheres to. It is important that you describe your changes accurately, since this is used in the packages release process to help determine the version of the next release.
274
300
275
-
-"Breaking Changes"-A backwards-incompatible change which requires specific attention of the impacted developers to reconcile (requires a major version bump).
301
+
- "Breaking Changes" - A backwards-incompatible change which requires specific attention of the impacted developers to reconcile (requires a major version bump for stable packages).
276
302
- "New Features" - The addition of a new backwards-compatible function or feature to the existing public API (requires a minor version bump).
277
303
- "Enhancements" - Backwards-compatible improvements to existing functionality (requires a minor version bump).
278
304
- "Deprecations" - Deprecation notices. These do not impact the public interface or behavior of the module (requires a minor version bump).
279
305
- "Bug Fixes" - Resolutions to existing buggy behavior (requires a patch version bump).
280
306
- "Internal" - Changes which do not have an impact on the public interface or behavior of the module (requires a patch version bump).
307
+
- "Stable Release" - Marks a pre-1.0 package as stable and production-ready. This should only be used for packages currently published as a 0.x pre-release, to intentionally communicate that a package's API is now stable and ready for production use.
281
308
282
309
While other section naming can be used when appropriate, it's important that are expressed clearly to avoid confusion for both the packages releaser and third-party consumers.
0 commit comments