Skip to content

Commit

Permalink
Move wp-now's contributing instructions back to its README (#47)
Browse files Browse the repository at this point in the history
<!-- Thanks for contributing to WordPress Playground Tools! -->

## What?

Moves wp-now's contributing instructions back to its README.

## Why?

Each project has slightly different contributing instructions, so it
makes sense to localize the instructions on each relevant README.
  • Loading branch information
danielbachhuber authored Jun 1, 2023
1 parent ffa4ed3 commit 5503c3d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 51 deletions.
54 changes: 4 additions & 50 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,7 @@
# Contributing

We welcome contributions from the community!
Each project in WordPress Playground Tools has slightly different contributing instructions. Please refer to the corresponding README:

In order to contribute to `wp-now`, you'll need to first install a few global dependencies:

- Make sure you have `nvm` installed. If you need to install it first,
[follow these installation instructions](https://github.com/nvm-sh/nvm#installation).
- Install `nx` by running `npm install -g nx`.

Once the global dependencies are installed, you can start using the repo:

```bash
git clone [email protected]:playground-tools
cd playground-tools
nvm use
npm install
npm run build
nx preview wp-now start --path=/path/to/wordpress-plugin-or-theme
```

If you'd like to make the `wp-now` executable globally available when using this installation method, run `npm link`. It's not particularly reliable, however.

Please refer to the main [README.md](../../README.md) file for more detail on how to contribute to this project.

## Testing

To run the unit tests, use the following command:

```bash
nx test wp-now
```

## Publishing

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

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

```bash
npm login # this is required only once and it will store the credentials in ~/.npmrc file.
npm run release
```

### When publishing goes wrong

Internet connections drop, APIs stop responding, and GitHub rules are nasty. Stuff happens. If the publishing process fails, you may need to bump the version again and force a publish. To do so, execute the following command:

```bash
npm run release -- --force-publish
```
- [Interactive Code Block](packages/interactive-code-block/README.md)
- [VS Code](packages/vscode-extension/README.md)
- [wp-now](packages/wp-now/README.md)
50 changes: 49 additions & 1 deletion packages/wp-now/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,52 @@ Some similarities between `wp-env` and `wp-now` to be aware of:

## Contributing

See [Contributing](CONTRIBUTING.md)
We welcome contributions from the community!

In order to contribute to `wp-now`, you'll need to first install a few global dependencies:

- Make sure you have `nvm` installed. If you need to install it first,
[follow these installation instructions](https://github.com/nvm-sh/nvm#installation).
- Install `nx` by running `npm install -g nx`.

Once the global dependencies are installed, you can start using the repo:

```bash
git clone [email protected]:WordPress/playground-tools.git
cd playground-tools
nvm use
npm install
npm run build
nx preview wp-now start --path=/path/to/wordpress-plugin-or-theme
```

If you'd like to make the `wp-now` executable globally available when using this installation method, run `npm link`. It's not particularly reliable, however.

## Testing

To run the unit tests, use the following command:

```bash
nx test wp-now
```

## Publishing

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

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

```bash
npm login # this is required only once and it will store the credentials in ~/.npmrc file.
npm run release
```

### When publishing goes wrong

Internet connections drop, APIs stop responding, and GitHub rules are nasty. Stuff happens. If the publishing process fails, you may need to bump the version again and force a publish. To do so, execute the following command:

```bash
npm run release -- --force-publish
```

0 comments on commit 5503c3d

Please sign in to comment.