Skip to content

Commit

Permalink
Merge pull request #21 from immint023/chore/replace-npm-with-pnpm
Browse files Browse the repository at this point in the history
chore: replace npm with pnpm
  • Loading branch information
davidnguyen11 authored Sep 27, 2022
2 parents 1993322 + 9139d1b commit bcd244e
Show file tree
Hide file tree
Showing 10 changed files with 6,796 additions and 26,230 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/workflow-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,28 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
id: checkout
- name: Installing pnpm
uses: pnpm/[email protected]
with:
version: 7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node_modules
uses: actions/cache@v2
id: cache
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
cache: 'pnpm'
- name: Installing packages...🏃‍♂️ 🏃‍♂️ 🏃‍♂️
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
run: pnpm install
- name: Running typecheck... 🩺 🔬 🔭
run: npm run code:typecheck
run: pnpm code:typecheck
- name: Running eslint... 👀
run: npm run code:lint
run: pnpm code:lint
- name: Running unit test... 🤞 🚑 💊
run: npm run test:unit -- --runInBand --coverage
run: pnpm test:unit --runInBand --coverage
- name: Trigger codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Run build Chrome
run: npm run app:chrome
run: pnpm app:chrome
- name: Run build Firefox
run: npm run app:firefox
run: pnpm app:firefox
- name: Run build Edge
run: npm run app:edge
run: pnpm app:edge
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint-staged
pnpm lint-staged
6 changes: 3 additions & 3 deletions .husky/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
. "$(dirname -- "$0")/_/husky.sh"

echo "Running eslint... 👀"
npm run code:lint
pnpm code:lint

echo "Running unit test... 🤞 🚑 💊"
npm run test:unit -- --coverage
pnpm test:unit --coverage

echo "Running typecheck... 🩺 🔬 🔭"
npm run code:typecheck
pnpm code:typecheck
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.20.0
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,50 +15,58 @@ This boilerplate provides a skeleton to start developing cross-browser web exten
[![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/davidnguyen179/web-extension-boilerplate/pulls)
![ci/cd](https://github.com/davidnguyen179/web-extension-boilerplate/workflows/ci/cd/badge.svg) [![by](https://raw.githubusercontent.com/webuild-community/badge/master/svg/by.svg)](https://github.com/davidnguyen179/web-extension-boilerplate)

## Prerequisites

You need to install [**pnpm**](https://pnpm.io/installation)

## Development

```bash
npm i
npm install -g pnpm
```

```bash
pnpm i
```

**Chrome**

```bash
npm run app:chrome-dev
pnpm app:chrome-dev
```

**Edge**

```bash
npm run app:edge-dev
pnpm app:edge-dev
```

**Firefox**

```bash
npm run app:firefox-dev
pnpm app:firefox-dev
```

## Production

```bash
npm i
pnpm i
```

```bash
npm run app:chrome
pnpm app:chrome
```

**Edge**

```bash
npm run app:edge
pnpm app:edge
```

**Firefox**

```bash
npm run app:firefox
pnpm app:firefox
```

## Load package to browsers
Expand Down
Loading

0 comments on commit bcd244e

Please sign in to comment.