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
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
Copy file name to clipboardExpand all lines: README.md
+35-70Lines changed: 35 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,96 +11,57 @@ Perseus is Khan Academy's exercise system. This repo contains the code needed to
11
11
12
12
<palign="center"><imgsrc="sample.png"alt="sample of Perseus in use"height="150px"/></p>
13
13
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
15
15
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
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
32
28
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.
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!
38
37
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.
40
39
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
44
41
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)
46
49
```
47
-
cd packages/[package-name]
48
50
49
-
// Example
50
-
cd packages/perseus-editor
51
-
```
51
+
Additionally, we use Khan Academy's Git extensions (OLC) to manage pull requests.
52
52
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
54
56
```
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
66
57
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
86
59
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.
93
61
94
-
### CI/CD aka Github
62
+
### Using Changesets
95
63
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.
104
65
105
66
### Releasing Perseus to npm
106
67
@@ -110,10 +71,14 @@ Perseus is a monorepo - a single repository that ships multiple npm packages. Ge
110
71
3. ☢️ If the CI/CD checks aren’t running, you might need to close and reopen the PR
111
72
4. After the release script runs, you should see the new releases on the [release page](https://github.com/Khan/perseus/releases)
112
73
113
-
## Random notes
74
+
###Random notes
114
75
115
76
- 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).
116
77
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.
0 commit comments