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
## Summary:
This PR migrates this repo from `yarn` to [pnpm](pnpm.io). The version of Yarn we are using is very outdated and is no longer supported. Khan Academy has made an engineering-wide decision to adopt pnpm as its "package manager of choice" and so let's adopt!
Notable changes:
* Use `workspace:` syntax for in-repo dependencies
* Use `catalog:` syntax for peer/dev dependencies (easier "global" upgrade of these) - and Github _just_ added support for `catalog:` support Dependabot [_yesterday_](https://github.blog/changelog/2025-02-04-dependabot-now-supports-pnpm-workspace-catalogs-ga/)!!
* Build system is simplified because we don't have to worry about build order
*
Issue: LEMS-2825
## Test plan:
`pnpm build`
`pnpm dev`
`pnpm start` # storybook
`pnpm cypress:ci`
Author: jeremywiebe
Reviewers: mark-fitzgerald, jeremywiebe, benchristel, handeyeco, jeresig, jandrade, kevinb-khan
Required Reviewers:
Approved By: mark-fitzgerald, handeyeco, benchristel
Checks: ✅ Publish npm snapshot (ubuntu-latest, 20.x), ✅ Check for .changeset entries for all changed files (ubuntu-latest, 20.x), ✅ Cypress (ubuntu-latest, 20.x), ✅ Lint, Typecheck, Format, and Test (ubuntu-latest, 20.x), ✅ Publish Storybook to Chromatic (ubuntu-latest, 20.x), ✅ Check builds for changes in size (ubuntu-latest, 20.x)
Pull Request URL: #2202
To install Perseus, you need to run the following commands:
26
26
27
-
#### `yarn`
27
+
#### `pnpm install`
28
28
29
29
Installs project dependencies and tooling
30
30
31
31
### Using Storybook
32
32
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 `yarn storybook`. This will start a server and give you a playground to use each component.
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.
34
34
35
35
### Using Changesets
36
36
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 `yarn changeset`. Commit and submit that with the PR.
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.
38
38
39
39
### Updating Dependencies
40
40
@@ -53,13 +53,13 @@ cd packages/perseus-editor
53
53
2. Run the following command to update the dev dependencies and the peer dependencies.
54
54
```
55
55
// All dependencies
56
-
yarn add --dev [dependency name]
56
+
pnpm add --dev [dependency name]
57
57
// Include this too if webapp is using this dependency
58
-
yarn add --peer [dependency name]
58
+
pnpm add --peer [dependency name]
59
59
60
60
// Example
61
-
yarn add --dev @khanacademy/wonder-blocks-button
62
-
yarn add --peer @khanacademy/wonder-blocks-button
61
+
pnpm add --dev @khanacademy/wonder-blocks-button
62
+
pnpm add --peer @khanacademy/wonder-blocks-button
63
63
```
64
64
65
65
## Contributing
@@ -79,14 +79,14 @@ Perseus is a monorepo - a single repository that ships multiple npm packages. Ge
79
79
3. ☢️ We don’t use deploy branches in Perseus
80
80
4. Start a dev server
81
81
82
-
a. `yarn start` will start [Storybook](https://storybook.js.org/) on [localhost:6006](http://localhost:6006)
82
+
a. `pnpm start` will start [Storybook](https://storybook.js.org/) on [localhost:6006](http://localhost:6006)
83
83
84
-
b. `yarn dev` will start the custom Dev UI on
84
+
b. `pnpm dev` will start the custom Dev UI on
85
85
[localhost:5173](http://localhost:5173/)
86
86
87
87
5. Do stuff
88
-
6.`yarn test` will run [Jest](https://jestjs.io/)/[RTL](https://testing-library.com/docs/react-testing-library/intro/) tests; `yarn cypress` will run [Cypress](https://www.cypress.io/) tests
89
-
7.`yarn changeset` will walk you through creating a [changeset](https://github.com/changesets/changesets) (we generally stick to [semver](https://semver.org/))
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
90
8. ☢️ Empty changesets should be considered an exception to the rule and should generally be avoided
91
91
9.`git add` and `git commit`
92
92
10.`git pull-request` will walk you through creating a pull request
0 commit comments