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

README: added more instructions for local dev #497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,62 @@ Then, download the Preact Devtools extension for your browser:

## Contributing

**NOTE:** This repo currently uses a mix of yarn and npm.
Copy link
Member

Choose a reason for hiding this comment

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

We can stick to just yarn commands, this repo only has a yarn lock file


To set up a local dev environment, clone this repo and use
[yarn](https://yarnpkg.com/getting-started/install) to install dependencies:

```bash
git clone https://github.com/preactjs/preact-devtools.git
cd preact-devtools
yarn install
```

### Development

Preact Devtools aims to maintain compatibility with all Preact releases
since 10.1.0. For testing purposes, the dev server needs at least one
Preact release package in the `test-e2e/fixtures/vendor/preact` directory.

To download a full set of Preact release packages, run:

```bash
node tools/fetch-preact-versions.mjs
```

Then:

- Use `npm run dev` to start a demo page
- Use `npm run watch` to rebuild all extensions on any code changes

### Linting & testing

To run the linter:

```bash
yarn lint
```

To run the unit tests:

```bash
yarn test
```

To run browser tests, first ensure that Playwright is installed:

```bash
npx playwright install
```

then:

- `npm run test:e2e:10` to run browser tests with Preact 10
- `npm run test:e2e:11` to run browser tests with Preact 11
- `npm run test:e2e:git` to run browser tests with a local checkout of Preact

### Building

- Use `npm run build:firefox` or `npm run build:chrome` to create a release build

Chrome:
Expand Down