Skip to content

wp-now: add instructions for publishing to npm - #340

Merged
adamziel merged 2 commits into
WordPress:trunkfrom
Automattic:docs/wp-now-publishing-documentation
May 15, 2023
Merged

adamziel merged 2 commits into
WordPress:trunkfrom
Automattic:docs/wp-now-publishing-documentation

Conversation

@sejas

@sejas sejas commented May 15, 2023

Copy link
Copy Markdown
Collaborator

What?

Add Publishing to npm section to packages/wp-now/README.md

Why?

It was asked here #231 (comment)

How?

I described the publishing instricutions to the wp-now Readme.

Testing Instructions

  1. Go to the changed files.
  2. Observe the new section at the bottom of the Readme: Publishing to npm
  3. Validate the instructions.

@adamziel

Copy link
Copy Markdown
Collaborator

Lovely, thank you!

@adamziel
adamziel merged commit 34db1a0 into WordPress:trunk May 15, 2023
Comment thread packages/wp-now/README.md

## Publishing to npm

The `wp-now` package is part of a larger monorepo, sharing its space with other sibiling packages. 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any steps required here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, Lerna does that automatically. The readme could be clearer about that though, @sejas

Comment thread packages/wp-now/README.md

Each package identifies a distinct organization in its `package.json` file. To publish the `wp-now` package, you need access to the npm organizations `@wp-playground`, `@php-wasm`, and `@wp-now`.

To initiate the publishing process for the all the modified packages, execute the following commands:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make it possible to only publish a single package?

@adamziel adamziel May 15, 2023 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lerna detects changes and only publishes the ones that changed. It is not possible to publish just a single package when it depends on other packages from the monorepo. You can always use npm publish for that if you feel confident and also bump the versions, add tags etc manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/wp-now/README.md

The `wp-now` package is part of a larger monorepo, sharing its space with other sibiling packages. 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.

Each package identifies a distinct organization in its `package.json` file. To publish the `wp-now` package, you need access to the npm organizations `@wp-playground`, `@php-wasm`, and `@wp-now`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who should publish releases?

@adamziel adamziel May 15, 2023 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to governance, I'll kick off that project soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants