Skip to content

Commit

Permalink
Move to the pnpm package manager
Browse files Browse the repository at this point in the history
Yarn 1, what the project used before, has been deprecated for a while.
Updating to Yarn Berry (4) would be possible, but it is not that
widespread yet.
pnpm is another alternative package manager which many projects have now
switched to. It is a lot faster than yarn, and offers safer dependency
management
  • Loading branch information
CommandMC committed May 13, 2024
1 parent c13bef1 commit 9c8d6da
Show file tree
Hide file tree
Showing 7 changed files with 3,363 additions and 2,716 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
skip = ./node_modules,./build,yarn.lock
skip = ./node_modules,./build,pnpm-lock.yaml
contex=6
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2
updates:
# Maintain dependencies for our yarn packages.
# Maintain dependencies for our npm packages.
- package-ecosystem: "npm"
directory: "/"
schedule:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,25 @@ jobs:
env:
NODE_ENV: ${{ matrix.node-env }}
steps:
- name: Checkout
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 18

- run: yarn install
- uses: pnpm/action-setup@v4
with:
version: 9

- run: pnpm install

- run: yarn build
- run: pnpm build

- run: yarn lint
- run: pnpm lint
if: ${{ matrix.node-env == 'development' }}

- run: yarn test
- run: pnpm test
if: ${{ matrix.node-env == 'development' }}

4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ repos:
- repo: local
hooks:
- id: lint
name: running yarn lint to ensure changes will pass linting on CI
entry: yarn lint
name: running pnpm lint to ensure changes will pass linting on CI
entry: pnpm lint
language: system
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ This is the source for the SerenityOS Discord Bot.

### Setup

The bot is written in [TypeScript](https://www.typescriptlang.org), `nodejs` and `yarn` are pre-requisites.
The bot is written in [TypeScript](https://www.typescriptlang.org), `nodejs` and `pnpm` are pre-requisites.

Then setup your environment:

```
$ git clone https://github.com/SerenityOS/discord-bot
$ cd discord-bot
$ yarn install
$ yarn build
$ pnpm install
$ pnpm build
```

### Configuration
Expand All @@ -23,16 +23,7 @@ guild_id=<your-guild-id-goes-here>
```
See: https://www.writebots.com/discord-bot-token/

Now you can run `yarn start:dev` and the bot will startup, and then restart as you save changes to the source files:
```
$ yarn start:dev
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): src/**/*
[nodemon] watching extensions: ts,js
[nodemon] starting `ts-node ./src/index.ts`
Buggie bot has started
```
Now you can run `pnpm start:dev` and the bot will startup, and then restart as you save changes to the source files.

### Running Tests

Expand Down
Loading

0 comments on commit 9c8d6da

Please sign in to comment.