Skip to content

Commit 38ed1b1

Browse files
committed
Revert "First attempt at some documentation updates"
This reverts commit 4a74468.
1 parent 5cb6e82 commit 38ed1b1

File tree

3 files changed

+129
-180
lines changed

3 files changed

+129
-180
lines changed

docs/monorepo.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,19 @@ All projects should be compatible with PHP versions WordPress supports. That's c
4747

4848
First time working with the monorepo? We got you covered.
4949

50-
Install the Jetpack CLI:
50+
For the first time only:
5151

52-
```bash
53-
npm install -g @automattic/jetpack-cli
54-
```
52+
* From the root of the repo, run `pnpm install && pnpm jetpack cli link` (if you want the `jetpack` CLI tool installed globally) or `pnpm install` (if you don't).
53+
* That’s it. You won’t need to do that again unless you nuke your node_modules directory.
5554

56-
Once installed, you can run `jp` anywhere in the Jetpack repo. Run `jp --help` to see all available commands.
55+
Once you’ve done that, it’s easy: run `jetpack` (or `pnpm jetpack`) while anywhere in the Jetpack repo. To explore on your own, run `jetpack --help` to see the available commands.
5756

5857
## Jetpack Generate Wizard
5958

6059
Starting a new project? Great! Let the Jetpack Generate Wizard help jumpstart the files you need. To get started:
6160

6261
* Make sure you're checked out to the branch you want.
63-
* Use the CLI command `jp generate` to start the process.
62+
* Use the CLI command `jetpack generate` to start the process.
6463
* The wizard will walk you through the steps of starting a new package, plugin, or Github action.
6564

6665
### Accepted Arguments
@@ -70,7 +69,7 @@ The wizard accepts a few arguments to speed things up:
7069
* `[project type]` - Accepted values: `package`, `plugin`, `github-action`
7170
* `--name`, `--n` - The name of your project (no spaces)
7271

73-
Example: `jp generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins`
72+
Example: `jetpack generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins`
7473

7574
### What's Included
7675

@@ -457,29 +456,29 @@ The body is separated from the headers by a blank line, and is the text that act
457456
458457
The changelogger tool can be used via [Jetpack's CLI tool](#first-time). You may use the following command to generate changelog entries for each project that needs one:
459458
460-
`jp changelog add`
459+
`jetpack changelog add`
461460
462461
**Does it matter what the change file is named?** Starting the file name with `.` should not be used. Also consider avoiding names that have extensions like `.php` or `.js` to avoid confusing other tools.
463462
464-
**What if a change is so trivial that it doesn't need a changelog entry?** The change file is still required. If you specify the significance as "patch", changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the "Comment" header instead, for example:
463+
**What if a change is so trivial that it doesnt need a changelog entry?** The change file is still required. If you specify the significance as patch, changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the Comment header instead, for example:
465464
466-
```bash
465+
```
467466
Significance: patch
468467
Type: compat
469468
Comment: Update composer.lock, no need for a changelog entry
470469
```
471470
472-
**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning "minor" or "major" change to any projects that use semantic versioning.
471+
**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning minor or major change to any projects that use semantic versioning.
473472
474-
The "Linting / Changelogger validity" GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`.
473+
The Linting / Changelogger validity GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`.
475474
476-
Within a single project, changlogger's `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers.
475+
Within a single project, changloggers `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers.
477476
478477
## New Projects
479478
480479
To begin,
481480
* For Automatticians, drop us a line in #jetpack-crew to discuss your needs, just to be sure we don't have something already. For others, it would probably be best to open an issue to discuss it.
482-
* Use the `jp generate` command to create a skeleton project.
481+
* Use the `jetpack generate` command to create a skeleton project.
483482
* Create your project based on the skeleton and submit a PR as usual.
484483
485484
Once we're sure that the project will be created and what its name will be, someone (you or the Crew team) does the following:

docs/quick-start.md

+80-57
Original file line numberDiff line numberDiff line change
@@ -2,93 +2,116 @@
22

33
## Overview
44

5-
This guide will get you up and running with Jetpack development as quickly as possible using our recommended tools.
5+
This guide is designed to get you up and running working with the Jetpack Monorepo quickly following recommended and supported guidelines.
66

7-
**Prerequisites**: You'll need:
8-
- Node.js installed (any recent LTS version)
9-
- Git installed and configured
10-
- Docker installed and running
7+
**This guide assumes you are using MacOS or a Linux machine and are an Automattician**. For more detailed information, including setting up local dev environments for all contributors, running unit tests, best coding practices, and more, you can use the [full Development Environment guide here](development-environment.md#clone-the-repository).
118

129
## Installation
1310

14-
1. Install the Jetpack CLI:
15-
```bash
16-
npm install -g @automattic/jetpack-cli
17-
```
11+
### Using the installation script
1812

19-
2. Initialize Jetpack:
20-
```bash
21-
jp init
22-
```
13+
To speed up the installation process, you may use our monorepo installation script. To do so:
2314

24-
This will:
25-
- Clone the Jetpack monorepo to your chosen location
26-
- Guide you through the next steps to get started
15+
- Clone the Jetpack Monorepo:
16+
- Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone [email protected]:Automattic/jetpack.git`
17+
- Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git`
18+
- Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks.
19+
- `cd` into the cloned `jetpack` folder.
20+
- Run `tools/install-monorepo.sh` from the monorepo root.
21+
- You can use the [environment checker script](#check-if-your-environment-is-ready-for-jetpack-development) to confirm that all required tools are installed.
2722

28-
## Development Workflow
23+
Once the installation is complete, continue onto the section [Running Jetpack locally](#running-jetpack-locally).
2924

30-
Build and test your changes:
31-
```bash
32-
# Build a specific project with dependencies
33-
jp build plugins/jetpack --deps
25+
### Installing manually
3426

35-
# Or watch for changes
36-
jp watch plugins/jetpack
27+
Prior to installation, we recommend using [`Homebrew`](https://brew.sh/) to manage installations and [`nvm`](https://github.com/nvm-sh/nvm/) to manage Node.js versions. If you don't already have those installed, you can do so by copy/pasting each of the following commands and running them in your terminal:
3728

38-
# Run tests
39-
jp test
40-
```
29+
- Homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`
30+
- nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash`
4131

42-
## Testing with Docker
32+
The Jetpack Monorepo requires various software to be installed on your machine.
4333

44-
Jetpack includes a testing environment using Docker. To start testing:
34+
- Clone the Jetpack Monorepo:
35+
- Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone [email protected]:Automattic/jetpack.git`
36+
- Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git`
37+
- Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks.
38+
- This software needs to be installed or updated system-wide:
39+
- Bash (will need to be updated from default Mac version): `brew install bash`
40+
- jq (JSON processor used in scripts): `brew install jq`
41+
- To install or update the following software, cd into the Jetpack directory that was created when cloning the repo: `cd jetpack`:
42+
- Node.js (used for build process and our CLI): `nvm install && nvm use`
43+
- PNPM (a Node.js package manager): `npm install -g pnpm`
44+
- PHP (the language at the core of the WordPress ecosystem): `source .github/versions.sh && brew install php@$PHP_VERSION`
45+
- Composer (our PHP package manager): `brew install composer`
46+
- Jetpack CLI (an internal tool that assists with development): `pnpm install && pnpm jetpack cli link`
47+
- [You can read more about using the CLI here](https://github.com/Automattic/jetpack/blob/trunk/tools/cli/README.md).
4548

46-
1. Start the testing environment:
47-
```bash
48-
jp docker up -d
49-
```
49+
### Check if your environment is ready for Jetpack development
5050

51-
2. Install WordPress (first time only):
52-
```bash
53-
jp docker install
51+
We provide a script to help you in assessing if everything's ready on your system to contribute to Jetpack.
52+
53+
```sh
54+
tools/check-development-environment.sh
5455
```
5556

56-
3. Visit http://localhost to see your site!
57+
Running the script will tell you if you have your environment already set up and what you need to do in order to get it ready for Jetpack development:
5758

58-
## Testing WordPress.com Features
59+
- All green `YES` or `OK` messages mean you're ready to start
60+
- Red `NO` messages mean something is wrong or missing, and a link will be provided to help you with a fix.
61+
- Yellow messages indicate something optional is broken or missing.
5962

60-
To test features requiring a WordPress.com connection:
63+
## Running Jetpack locally
6164

62-
### For Automatticians:
63-
Use Jurassic Tube:
64-
```bash
65-
jp docker jt-up
66-
```
65+
After everything is installed, you're ready to run Jetpack locally! While there are other supported methods of doing this, we recommend and support using Docker containers.
6766

68-
### For External Contributors:
69-
Use ngrok:
70-
```bash
71-
jp docker ngrok-up
72-
```
67+
To setup Docker:
68+
- Install Docker:
69+
- Mac: `brew install --cask docker` (This will take a while!)
70+
- Linux: `brew install docker`
71+
- `open -a Docker` (or open the app from your Applications folder) to open the GUI application. You will likely need to enter your device password and accept their terms for a first time setup.
72+
- Copy the settings file from within the monorepo root: `cp tools/docker/default.env tools/docker/.env`
73+
- Open `tools/docker/.env` and make any modifications you'd like.
74+
- It's strongly recommend you at least change `WP_ADMIN_PASSWORD` to something more secure.
75+
- Start the Docker container using `jetpack docker up -d` (this may take some time for the first setup)
76+
- Install WordPress in your Docker container using `jetpack docker install`
77+
- Open up http://localhost to see your site!
78+
79+
For more in depth Docker instructions, follow the [Docker environment for Jetpack Development guide](../tools/docker/README.md).
7380

7481
## Setting up Jurassic Tube
7582

7683
In order to test features that require a WordPress.com connection and other network related Jetpack features, you'll need a test site that can create local HTTP tunnels. If you're an Automattician, we recommend using Jurassic Tube.
7784

7885
Note: This is for Automattician use only. For other methods, check out [ngrok](../tools/docker/README.md#using-ngrok-with-jetpack) or [another similar service](https://alternativeto.net/software/ngrok/).
7986

80-
**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jp docker jt-up` when needed for testing things that require
81-
the site to be publicly accessible, and `jp docker jt-down` when completed.**
87+
**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jetpack docker jt-up` when needed for testing things that require the site to be publicly accessible, and `jetpack docker jt-down` when completed.**
8288

8389
- Visit the [jurassic.tube](https://jurassic.tube/) homepage to create a subdomain
84-
- Make sure you've run `npm install -g @automattic/jetpack-cli`
85-
- Make sure Docker is running `jp docker up -d`
90+
- Make sure you've run `pnpm install && pnpm jetpack cli link`
91+
- Make sure Docker is running `jetpack docker up -d`
8692
- Stand on the monorepo root in your terminal and run `mkdir tools/docker/bin/jt`
87-
- Stop and restart the docker env: `jp docker stop && jp docker up -d`
93+
- Stop and restart the docker env: `jetpack docker stop && jetpack docker up -d`
8894
- Download and run the installation script: `curl "https://jurassic.tube/get-installer.php?env=jetpack" -o tools/docker/bin/jt/installer.sh && chmod +x tools/docker/bin/jt/installer.sh && tools/docker/bin/jt/installer.sh`
89-
- Set your username: `jp docker jt-config username [your-username-here e.g david]`
90-
- Set your subdomain: `jp docker jt-config subdomain [your-subdomain-here e.g. spaceman]`
91-
- Now, you can start your site with `jp docker jt-up`
95+
- Set your username: `jetpack docker jt-config username [your-username-here e.g david]`
96+
- Set your subdomain: `jetpack docker jt-config subdomain [your-subdomain-here e.g. spaceman]`
97+
- Now, you can start your site with `jetpack docker jt-up`
9298
- Your site should be available at `https://custom-subdomain.jurassic.tube`
9399

94-
That's all! For more detailed information, see the [Development Environment guide](development-environment.md).
100+
## Development Workflow
101+
102+
Once you have a local copy of Jetpack and all development tools installed, you can start developing.
103+
104+
1. Make sure the plugin you're developing is activated on your WordPress site.
105+
2. [Build your project](development-environment.md#building-your-project) using `jetpack build [type/project]` and including its dependencies, such as `jetpack build plugins/jetpack --deps`
106+
3. Access the plugin's dashboard in your browser.
107+
108+
By default the development build above will run once and if you change any of the files, you need to run `jetpack build` again to see the changes on the site. If you want to avoid that, you can run a continuous build that will rebuild anytime it sees any changes on your local filesystem. To run it, use:
109+
110+
```sh
111+
jetpack watch
112+
```
113+
### Running Tests
114+
115+
To run PHP, JS, and coverage tests, you can use the Jetpack CLI: `jetpack test` and then choose the project and type of test you'd like to run.
116+
117+
That's all!

0 commit comments

Comments
 (0)