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
{{ message }}
Repository navigation
Local Environment: Follow Semantic Versioning and include release notes when publishing #31
To publish the wp-now package to npm, you must first understand the automated release process facilitated by lerna. This process includes automatically incrementing the version number, creating a new tag, and publishing all modified packages to npm simultaneously. Notably, all published packages share the same version number.
To the end user of wp-now, the package version number will seem somewhat random. It may receive a major version change when some other package receives a breaking change.
Using separate versions for each package in a monorepo gets very messy very quickly, as outlined in WordPress/gutenberg#46693. It is very convenient to advance versions of all packages in a monorepo together, even if that means an occasional version bump that has no merit on its own. It is a trade-off, but one with an overwhelming amount of benefits – see the discussion and this comment from @noahtallen and this comment from @jsnajdr.
I'm not against semantic versioning in wp-now, but I'd consider a separate repository – even if it would contain just a shell package for publishing purposes.
I think that mostly matters when you have a ton of packages which all depend on each other, and you have to install a lot of them in the same project. (Which definitely describes most of the editor packages!) But something like wp-env is semantically versioned with a changelog, and that wouldn't need to match the other @wordpress/ packages.
It just gets so easy have implicit dependencies. If you need to install both package A and B, and A starts relying on a new feature in package B -- but at the same time, package B doesn't work if there are two copies of it at runtime -- things will break. Then you do need to update both simultaneously or you'll break things. That relationship is hard to encode with versioning, but it's more straightforward to manage when it's just "ahh everything needs to on the same version"
Thank you @noahtallen! The VS code extension depends on wp-now and I anticipate more such packages. There are good reasons to import both wp-now and other packages from this repo - e.g. TypeScript types for Blueprints and PHP.
Here's the current project graph, to visualise how hard it would be to maintaining separate versions of interdependent packages:
How about splitting wp-now in two different packages?
wp-now, the library – uses the pinned monorepo version, can be imported by other packages.
wp-now, the executable – uses semantic versioning, nothing imports it, gets bundled and shipped to npm with no dependencies on other packages. Just like @wp-playground/client:
Oh, that reminds me about executables and npx. For example, if I wanted to run wp-env through npx without installing it, you'd have to do npx @wordpress/env start, which is kind of weird. (Or for this project, npx @wp-now/wp-now) So maybe it makes sense to publish the wp-now executable without the namespace?
Activity
adamziel commentedon May 16, 2023
Using separate versions for each package in a monorepo gets very messy very quickly, as outlined in WordPress/gutenberg#46693. It is very convenient to advance versions of all packages in a monorepo together, even if that means an occasional version bump that has no merit on its own. It is a trade-off, but one with an overwhelming amount of benefits – see the discussion and this comment from @noahtallen and this comment from @jsnajdr.
I'm not against semantic versioning in wp-now, but I'd consider a separate repository – even if it would contain just a shell package for publishing purposes.
danielbachhuber commentedon May 16, 2023
We can wait and see what sort of feedback we get.
noahtallen commentedon May 17, 2023
I think that mostly matters when you have a ton of packages which all depend on each other, and you have to install a lot of them in the same project. (Which definitely describes most of the editor packages!) But something like
wp-envis semantically versioned with a changelog, and that wouldn't need to match the other@wordpress/packages.It just gets so easy have implicit dependencies. If you need to install both package A and B, and A starts relying on a new feature in package B -- but at the same time, package B doesn't work if there are two copies of it at runtime -- things will break. Then you do need to update both simultaneously or you'll break things. That relationship is hard to encode with versioning, but it's more straightforward to manage when it's just "ahh everything needs to on the same version"
I have no clue how that applies to wp-now though!
adamziel commentedon May 17, 2023
Thank you @noahtallen! The VS code extension depends on wp-now and I anticipate more such packages. There are good reasons to import both wp-now and other packages from this repo - e.g. TypeScript types for Blueprints and PHP.
Here's the current project graph, to visualise how hard it would be to maintaining separate versions of interdependent packages:
How about splitting
wp-nowin two different packages?wp-now, the library – uses the pinned monorepo version, can be imported by other packages.wp-now, the executable – uses semantic versioning, nothing imports it, gets bundled and shipped to npm with no dependencies on other packages. Just like@wp-playground/client:noahtallen commentedon May 17, 2023
Oh, that reminds me about executables and npx. For example, if I wanted to run wp-env through npx without installing it, you'd have to do
npx @wordpress/env start, which is kind of weird. (Or for this project,npx @wp-now/wp-now) So maybe it makes sense to publish thewp-nowexecutable without the namespace?danielbachhuber commentedon May 17, 2023
I'd be fine with this approach (as long as it isn't a total mess)
How do we do this if https://www.npmjs.com/package/wp-now already exists?
noahtallen commentedon May 17, 2023
🙃
Scoped WordPress instances to support multiple browser tabs (WordPres…