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

Migrate to pnpm #225

Merged
merged 5 commits into from
Aug 3, 2022
Merged
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
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
# `setup-node` already caches npm
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Build package
run: npm run build:only
run: pnpm run build
- name: Run Test
run: npm run test:ci
run: pnpm run test:ci
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,39 @@ If you want to work on any of these issues, just drop a message such as "I'd lik

Jest Preview repository has some npm scripts to help you develop efficiently.

- `npm install`: install all dependencies
- `npm run build:watch`: build `jest-preview` and rebuild it when changes are made
- `npm run types`: emit types, usually only need to run only once
- `npm run server`: start Jest Preview Server
- `npm run test:dev`: run Jest at `/demo/__tests__/App.test.tsx` (you will work with this file most of the time)
- `pnpm install`: install all dependencies
- `pnpm run build:watch`: build `jest-preview` and rebuild it when changes are made
- `pnpm run types`: emit types, usually only need to run only once
- `pnpm run server`: start Jest Preview Server
- `pnpm run test:dev`: run Jest at `/demo/__tests__/App.test.tsx` (you will work with this file most of the time)

## Run locally

Install dependencies:

```bash
npm install
pnpm install
```

Run the real demo app:

```bash
npm run dev
pnpm run dev
```

Run jest tests and Jest Preview server simultaneously:

```bash
npm run test
pnpm run test
```

Open chrome at <http://localhost:3336> to see the preview

However, it's recommended to run jest tests and Jest Preview server separately:

```bash
npm run server # Run jest-preview server
npm run test:dev # Run jest
pnpm run server # Run jest-preview server
pnpm run test:dev # Run jest
```

Whenever `preview.debug()` is triggered, or whenever a test fails, you will see the changes reflected on the browser immediately.
Expand Down
2 changes: 2 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
package-lock.json
pnpm-lock.yaml
yarn.lock
Loading