Skip to content

Commit

Permalink
Migrate from NPM to PNPM
Browse files Browse the repository at this point in the history
  • Loading branch information
SkwalExe committed Jul 17, 2024
1 parent d9bb48b commit 43d5b7f
Show file tree
Hide file tree
Showing 6 changed files with 3,416 additions and 4,850 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ on:
- 'main'
paths:
- 'package.json'
- 'package-lock.json'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install --include=dev
- run: npm run build
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
10 changes: 7 additions & 3 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ jobs:
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: pnpm ci
- name: Check linting
run: npm run lint
run: pnpm run lint
- name: Check type errors
run: npm run check-types
run: pnpm run check-types
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ This is a simple library that can create Windows message boxes on a web page. It
- ESLint for linting.
- Prettier.js for formatting.


This library uses `pnpm` as a package manager. You can install it with:

```bash
sudo npm install -g pnpm
```

## Setting up the development environment 🖥️

- [Fork this repository to your own GitHub account.](https://github.com/SkwalExe/WinMB.js/fork)
Expand All @@ -117,17 +124,17 @@ git clone https://github.com/YOUR_USERNAME/WinMB.js
cd ./WinMB.js
```

- Install devDependencies
- Install (dev)dependencies

```bash
npm install --include=dev
pnpm install
```

- Run the npm `serve` script to start a local development server on port `10001`
- Run the pnpm `serve` script to start a local development server on port `10001`
- This will continuously rebuild the UMD bundle and reload the page.

```bash
npm run serve
pnpm run serve
```

- Open the local development server on `https://localhost:10001/` and open the project in your IDE.
Expand Down Expand Up @@ -172,9 +179,9 @@ git checkout -b my-new-feature
- When you finished your changes, you must check your code's formatting and linting and fix all the errors.

```bash
npm run lint:fix # check for linting errors
npm run check-types # check for type errors
npm run format # comply with foramtting rules
pnpm run lint:fix # check for linting errors
pnpm run check-types # check for type errors
pnpm run format # comply with foramtting rules
```

- After that, add your changes to `CHANGELOG.md` and update the README if needed.
Expand All @@ -191,7 +198,7 @@ git push -u origin my-new-feature

- Finally, you can create your pull request from your fork repo's github page.

## NPM scripts
## PNPM scripts

- `lint`: Perform ESLint checks.
- `format`: Format codebase with prettier.
Expand Down
Loading

0 comments on commit 43d5b7f

Please sign in to comment.