Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update some documentation for pnpm #3063

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Enforce yarn

# Enforce pnpm
engine-strict = true
auto-install-peers = true
strict-peer-dependencies=false
61 changes: 36 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,53 +18,62 @@ This will use the local version of Toolpad as built in the monorepo. This is rec
1. Install dependencies:

```bash
yarn install
pnpm install
```

1. Run the build in watch mode

```bash
yarn dev
pnpm dev
```

1. Run Toolpad

```bash
yarn toolpad dev test/integration/backend-basic/fixture/toolpad --dev
pnpm toolpad dev test/integration/backend-basic/fixture/toolpad --dev
```

**Note:** It's important to note the difference between `yarn toolpad dev` and the `--dev` parameter. The first instruction runs Toolpad in dev mode. The `--dev` parameter is one for contributors only and runs the underlying next.js app that powers the editor in dev mode. The latter makes sure the development build of React is being used and the editor frontend application runs in watch mode.
**Note:** It's important to note the difference between `pnpm toolpad dev` and the `--dev` parameter. The first instruction runs Toolpad in dev mode. The `--dev` parameter is one for contributors only and runs the underlying next.js app that powers the editor in dev mode. The latter makes sure the development build of React is being used and the editor frontend application runs in watch mode.

If your application has dependencies other than `@mui/toolpad`, you have to temporarily add it to the workspace:

1. update `package.json` (in the workspace root, not in your app), add your app folder to `workspaces.packages`. e.g. for `examples/qr-generator` which has a dependency on `qrcode` this would be:
1. update `pnpm-workspace.yaml` (in the workspace root, not in your app), add your app folder to list. e.g. for `examples/qr-generator` which has a dependency on `qrcode` this would be:

```yaml
# ./pnpm-workspace.yaml
packages:
- 'packages/*'
- 'docs'
- 'test'
- 'examples/qr-generator'
```

You may then also want to ignore the workspace when running the `dev`/`build`command as in:

```json
"workspaces": {
"packages": [
"packages/*",
"docs",
"examples/qr-generator"
]
},
```
pnpm dev --ignore qr-generator
```

You may also temporarily remove/rename the `dev`/`build` commands in `examples/qr-generator/package.json` to avoid them getting picked up automatically by `lerna`.
This prevents the scripts in the workspace from being picked up by `lerna`.

1. Run

```bash
yarn install
pnpm install
```

1. Make sure to start the build in watch mode again and the run the app with

```bash
yarn toolpad dev examples/qr-generator --dev
pnpm toolpad dev examples/qr-generator --dev
```

### Linking Toolpad in a folder on your system (advanced)

<!--

TODO: how would this work with pnpm (https://pnpm.io/package_json#dependenciesmetainjected)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still use this workflow, I guess I can try it out.


<details>
<summary>Expand instructions</summary>

Expand Down Expand Up @@ -134,22 +143,24 @@ yarn install

</details>

-->

## Running integration tests

The playwright tests can be run in one of two modes:

1. Build the production target, then run the integration tests in production mode:

```bash
yarn release:build
yarn test:integration --project chromium
pnpm release:build
pnpm test:integration --project chromium
```

2. Toolpad in dev watchmode and run the integration tests in dev mode with the `TOOLPAD_NEXT_DEV` environment variable (slower)

```bash
yarn dev
TOOLPAD_NEXT_DEV=1 yarn test:integration --project chromium
pnpm dev
TOOLPAD_NEXT_DEV=1 pnpm test:integration --project chromium
```

Use the `--ui` flag to run the tests interactively.
Expand All @@ -159,13 +170,13 @@ Use the `--ui` flag to run the tests interactively.
1. If you haven't already, install the project dependencies using

```bash
yarn
pnpm
```

1. To start the documentation application in dev mode run

```bash
yarn docs:dev
pnpm docs:dev
```

If all goes well it should print
Expand All @@ -182,13 +193,13 @@ Use the `--ui` flag to run the tests interactively.
- Run to build the project

```bash
yarn && yarn release:build
pnpm && pnpm release:build
```

- Run it on your project of choice

```bash
yarn toolpad dev /path/to/my/toolpad/project
pnpm toolpad dev /path/to/my/toolpad/project
```

## Using CodeSandbox CI
Expand All @@ -214,7 +225,7 @@ Each pull request is built on [CodeSandbox CI](https://codesandbox.io/docs/learn
5. Run

```bash
yarn --force
pnpm
```

You'll now be able to explore your project with the Toolpad version from the GitHub PR.
Expand Down
14 changes: 7 additions & 7 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
1. Generate a new version using:

```bash
yarn release:version
pnpm release:version
```

This command will bump the version in every package of the project.

1. Generate the changelog using:

```bash
yarn release:changelog
pnpm release:changelog
```

Running this command requires a [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) with the `public_repo` scope.
Expand All @@ -38,10 +38,10 @@
1. Run

```bash
npx https://pkg.csb.dev/mui/mui-toolpad/commit/<build>/create-toolpad-app smoke
npx --use-pnpm https://pkg.csb.dev/mui/mui-toolpad/commit/<build>/create-toolpad-app smoke
cd smoke
yarn add https://pkg.csb.dev/mui/mui-toolpad/commit/<build>/@mui/toolpad -S
yarn && yarn dev
pnpm add https://pkg.csb.dev/mui/mui-toolpad/commit/<build>/@mui/toolpad -S
pnpm && pnpm dev
```

And verify the editor works
Expand All @@ -59,13 +59,13 @@
1. Publish to `npm`

```bash
yarn release:publish
pnpm release:publish
```

If you've created a prerelease, then instead use

```bash
yarn release:publish-canary
pnpm release:publish-canary
```

1. Publish the documentation. The documentation must be updated on the `docs-latest` branch.
Expand Down
6 changes: 1 addition & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ This is the documentation website of MUI Toolpad.
To start the docs site in development mode, from the project root, run:

```bash
yarn && yarn docs:dev
pnpm && pnpm docs:dev
```

If you do not have yarn installed, select your OS and follow the instructions on the [Yarn website](https://yarnpkg.com/lang/en/docs/install/#mac-stable).

_DO NOT USE NPM, use Yarn to install the dependencies._

Visit the [MUI Toolpad documentation](https://mui.com/toolpad/getting-started/).

## How can I add a new demo to the documentation?
Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/autocomplete.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Autocomplete

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/button.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Button

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/chart.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Chart

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/checkbox.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Checkbox

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/container.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Container

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/data-grid.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# DataGrid

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/date-picker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# DatePicker

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/file-picker.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# FilePicker

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/form.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Form

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/image.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Image

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/list.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# List

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"//": "This file has been auto-generated using `yarn docs:build:api`.",
"//": "This file has been auto-generated using `pnpm docs:build:api`.",
"pages": [
{
"pathname": "/toolpad/reference/components",
Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/metric.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Metric

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/page-column.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# PageColumn

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/page-row.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# PageRow

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/paper.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Paper

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/select.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Select

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/stack.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Stack

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/tabs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Tabs

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/text-field.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# TextField

Expand Down
2 changes: 1 addition & 1 deletion docs/data/toolpad/reference/components/text.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- This file has been auto-generated using `yarn docs:build:api`. -->
<!-- This file has been auto-generated using `pnpm docs:build:api`. -->

# Text

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/autocomplete.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/chart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/checkbox.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/container.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/data-grid.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/date-picker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/file-picker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/toolpad/reference/components/form.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* This file has been auto-generated using `yarn docs:build:api`. */
/* This file has been auto-generated using `pnpm docs:build:api`. */

import * as React from 'react';
import MarkdownDocs from '@mui/monorepo/docs/src/modules/components/MarkdownDocs';
Expand Down
Loading
Loading