Skip to content

Commit e117370

Browse files
authored
Tidy and update README.md (#2656)
Some of the info was out of date, and some was duplicated, either within the README itself or in our Confluence docs. Issue: none ## Test plan: Read the README. It should make sense and reflect our current dev process. Author: benchristel Reviewers: benchristel, jeremywiebe, Myranae Required Reviewers: Approved By: jeremywiebe Checks: ✅ 8 checks were successful Pull Request URL: #2656
1 parent ed51d32 commit e117370

File tree

2 files changed

+37
-70
lines changed

2 files changed

+37
-70
lines changed

.changeset/selfish-singers-allow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

README.md

Lines changed: 35 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -11,96 +11,57 @@ Perseus is Khan Academy's exercise system. This repo contains the code needed to
1111

1212
<p align="center"><img src="sample.png" alt="sample of Perseus in use" height="150px"/></p>
1313

14-
This repo is a constellation of sub-repos for showing exercise content. Please see individual projects in in the `packages/` folder for more information about each sub-project.
14+
## Development
1515

16-
## Getting started
16+
Perseus is a monorepo - a single repository that ships multiple npm packages. Generally you can treat Perseus as a single code base; things should generally just work as you expect them to during the development process. We use scripts and a tool called changesets to keep package inter-dependencies organized, release the one repo to multiple npm packages, and version changes appropriately.
17+
18+
For a slightly more detailed overview, see the ["Shipping a Change to Perseus"] document in Confluence.
19+
20+
["Shipping a Change to Perseus"]: https://khanacademy.atlassian.net/wiki/spaces/LC/pages/2384887922/Shipping+a+Change+to+Perseus
1721

1822
### Prerequisites
1923

2024
- [Node.js v20](https://nodejs.org/en/blog/announcements/v20-release-announce)
2125
- [pnpm](https://pnpm.io/)
2226

23-
### Installation
24-
25-
To install Perseus, you need to run the following commands:
26-
27-
#### `pnpm install`
28-
29-
Installs project dependencies and tooling
30-
31-
### Using Storybook
27+
### Getting started
3228

33-
The components and widgets of Perseus are developed using [Storybook](https://github.com/storybookjs/storybook). After you clone the project and get dependencies installed, the next step is to start storybook by running `pnpm storybook`. This will start a server and give you a playground to use each component.
29+
```bash
30+
ka-clone [email protected]:Khan/perseus
31+
pnpm install
32+
```
3433

35-
### Using Changesets
34+
### Branching strategy
3635

37-
We use [changesets](https://github.com/changesets/changesets) to help manage our versioning/releases. Before pushing a new PR, add a changeset by running `pnpm changeset`. Commit and submit that with the PR.
36+
Our shared development branch is `main`. **`main` should always be releasable**. Don't land changes to `main` that you're not ready to ship!
3837

39-
### Updating Dependencies
38+
To make changes to Perseus, create a new branch based on `main`, commit your changes, and open a pull request on GitHub.
4039

41-
If you want to use another library in Perseus, you will need up update the dependencies.
42-
Use `peerDependencies` and `devDependencies` for dependencies that
43-
khan/frontend is already using, such as Wonder Blocks or React.
40+
### Everyday commands
4441

45-
1. `cd` into to the package in which you would like to update the dependency.
42+
```bash
43+
pnpm tsc -w # run the typechecker in watch mode
44+
pnpm test # run all tests
45+
pnpm lint # find problems
46+
pnpm lint --fix # fix problems
47+
pnpm storybook # open component gallery
48+
pnpm changeset # create a changeset file (see below)
4649
```
47-
cd packages/[package-name]
4850

49-
// Example
50-
cd packages/perseus-editor
51-
```
51+
Additionally, we use Khan Academy's Git extensions (OLC) to manage pull requests.
5252

53-
2. Run the following command to update the dev dependencies and the peer dependencies.
53+
```bash
54+
git pr # open a pull request for the current branch
55+
git land # land the pull request for the current branch
5456
```
55-
// All dependencies
56-
pnpm add --dev [dependency name]
57-
// Include this too if khan/frontend is using this dependency
58-
pnpm add --peer [dependency name]
59-
60-
// Example
61-
pnpm add --dev @khanacademy/wonder-blocks-button
62-
pnpm add --peer @khanacademy/wonder-blocks-button
63-
```
64-
65-
## Contributing
6657

67-
The Perseus project is not accepting external contributions. We’re releasing the code for others to refer to and learn from, but we are not open to pull requests or issues at this time.
68-
69-
## KA Contribution Guide
70-
71-
For a slightly more detailed overview, see the "Shipping a Change to Perseus" document in Confluence.
72-
73-
Perseus is a monorepo - a single repository that ships multiple npm packages. Generally you can treat Perseus as a single code base; things should generally just work as you expect them to during the development process. We use scripts and a tool called changesets to keep package inter-dependencies organized, release the one repo to multiple npm packages, and version changes appropriately.
74-
75-
### Working
76-
77-
1. `git checkout main; git pull`
78-
2. `git checkout -b [FEATURE_BRANCH_NAME]`
79-
3. ☢️ We don’t use deploy branches in Perseus
80-
4. Start a dev server
81-
82-
a. `pnpm start` will start [Storybook](https://storybook.js.org/) on [localhost:6006](http://localhost:6006)
83-
84-
b. `pnpm dev` will start the custom Dev UI on
85-
[localhost:5173](http://localhost:5173/)
58+
### Using Storybook
8659

87-
5. Do stuff
88-
6. `pnpm test` will run [Jest](https://jestjs.io/)/[RTL](https://testing-library.com/docs/react-testing-library/intro/) tests; `pnpm cypress` will run [Cypress](https://www.cypress.io/) tests
89-
7. `pnpm changeset` will walk you through creating a [changeset](https://github.com/changesets/changesets) (we generally stick to [semver](https://semver.org/))
90-
8. ☢️ Empty changesets should be considered an exception to the rule and should generally be avoided
91-
9. `git add` and `git commit`
92-
10. `git pull-request` will walk you through creating a pull request
60+
The components and widgets of Perseus are developed using [Storybook](https://github.com/storybookjs/storybook). After you clone the project and get dependencies installed, the next step is to start storybook by running `pnpm storybook`. This will start a server and give you a playground to use each component.
9361

94-
### CI/CD aka Github
62+
### Using Changesets
9563

96-
1. When you create/update a PR, we run a series of checks against your code
97-
- Gerald requests reviewers (there’s a “perseus” user group that primary maintainers are in)
98-
- Linting/Types/Tests; checks to make sure code is properly covered
99-
- Check for a changeset
100-
2. 🍀 A [snapshot release](https://github.com/changesets/changesets/blob/main/docs/snapshot-releases.md) is made and can be used to check changes before merging/releasing
101-
3. Once checks pass and code is approved, land your changes into `main` using `git land`
102-
4. 🚨 `main` should always be releasable! Don’t land code to main that you’re not ready to ship!
103-
5. 🍀 Use stacked feature branches if you’re working on a big change that depends on multiple PRs
64+
We use [changesets](https://github.com/changesets/changesets) to help manage our versioning/releases. Each pull request must include a changeset file stating which packages changed and how their versions should be incremented. Run `pnpm changeset` to generate and commit a changeset file.
10465

10566
### Releasing Perseus to npm
10667

@@ -110,10 +71,14 @@ Perseus is a monorepo - a single repository that ships multiple npm packages. Ge
11071
3. ☢️ If the CI/CD checks aren’t running, you might need to close and reopen the PR
11172
4. After the release script runs, you should see the new releases on the [release page](https://github.com/Khan/perseus/releases)
11273

113-
## Random notes
74+
### Random notes
11475

11576
- We use `v8` to track Jest coverage. There's some old legacy code that we don't want coverage for, so we ignore that with `c8 ignore`. It might look like `c8` isn't be used, but it's used by the `v8` `coverageProvider` (defined in config/test/test.config.js).
11677

78+
## Contributing
79+
80+
The Perseus project is not accepting external contributions. We’re releasing the code for others to refer to and learn from, but we are not open to pull requests or issues at this time.
81+
11782
## License
11883

11984
[MIT License](http://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)