Skip to content

Commit

Permalink
feat(pnpm): pnpm (#2404)
Browse files Browse the repository at this point in the history
  • Loading branch information
sibelius authored Aug 9, 2024
1 parent 9a1a564 commit 5d8be76
Show file tree
Hide file tree
Showing 22 changed files with 19,644 additions and 15,627 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: yarn

- name: Test
run: yarn test
run: pnpm test

publish-npm:
needs: test-on-all-os
Expand All @@ -54,7 +54,7 @@ jobs:
run: yarn

- name: Compile
run: yarn build
run: pnpm build

- name: Publish
run: npm publish --access public
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ jobs:
with:
node-version: "16"
- run: yarn
- run: yarn lint
- run: yarn test
- run: yarn check-types
- run: pnpm lint
- run: pnpm test
- run: pnpm check-types
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,5 @@ package-lock.json
test.png
apps/web/public/sw.js.map
globalConfig.json
.vscode
.vscode
yarn.lock
4 changes: 3 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
save-exact=true
node-linker=hoisted
link-workspace-packages=true
prefer-workspace-packages=true
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@

## Getting Started

This project uses [classic Yarn 1.x Workspaces](https://classic.yarnpkg.com/en/docs/workspaces)

To setup a local development, you can clone and run Yarn in the root of the project:
This project uses [classic pnpm 1.x Workspaces](https://classic.yarnpkg.com/en/docs/workspaces)

To setup a local development, you can clone and run pnpm in the root of the project:

```bash
git clone https://github.com/sibelius/ccsseraphini
cd ccsseraphini
yarn install
pnpm install
```

This will install all dependencies for projects inside `apps/`

Now you can use `yarn workspace` API to start a project:
Now you can use `pnpm workspace` API to start a project:

```bash
yarn workspace web dev # this will run 'apps/web/package.json' script called 'dev'
pnpm workspace web dev # this will run 'apps/web/package.json' script called 'dev'
```
2 changes: 1 addition & 1 deletion apps/bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
## How to run

```
yarn start
pnpm start
```
16 changes: 8 additions & 8 deletions apps/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "bot",
"version": "0.0.1",
"scripts": {
"build": "yarn esbuild ./src/index.ts --bundle --platform=node --target=node10.4 --outfile=./build/bot.js",
"dev": "yarn es ./src/index.ts",
"build": "pnpm esbuild ./src/index.ts --bundle --platform=node --target=node10.4 --outfile=./build/bot.js",
"dev": "pnpm es ./src/index.ts",
"es": "node -r esbuild-register",
"start": "node ./build/bot.js",
"test": "jest"
Expand Down Expand Up @@ -32,12 +32,12 @@
},
"devDependencies": {
"@shelf/jest-mongodb": "^4.1.7",
"@types/luxon": "3.3.1",
"@types/node-schedule": "2.1.0",
"@types/supertest": "2.0.12",
"esbuild": "0.19.2",
"esbuild-register": "3.5.0",
"jest": "^29.6.2",
"@types/luxon": "3.4.2",
"@types/node-schedule": "2.1.7",
"@types/supertest": "6.0.2",
"esbuild": "0.23.0",
"esbuild-register": "3.6.0",
"jest": "^29.7.0",
"jest-fetch-mock": "3.0.3"
}
}
24 changes: 12 additions & 12 deletions apps/chrome-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ Base code for Chrome Extension
Run the following commands to install dependencies and start developing

```bash
yarn && yarn dev
pnpm && pnpm dev
```

**Scripts**

- `yarn dev` - run `webpack` in `watch` mode
- `yarn storybook` - runs the Storybook server
- `yarn build` - builds the production-ready unpacked extension
- `yarn test -u` - runs Jest + updates test snapshots
- `yarn lint` - runs EsLint
- `yarn prettify` - runs Prettier
- `pnpm dev` - run `webpack` in `watch` mode
- `pnpm storybook` - runs the Storybook server
- `pnpm build` - builds the production-ready unpacked extension
- `pnpm test -u` - runs Jest + updates test snapshots
- `pnpm lint` - runs EsLint
- `pnpm prettify` - runs Prettier

<details>
<summary>Loading the extension in Google Chrome</summary>

In [Google Chrome](https://www.google.com/chrome/), open up [chrome://extensions](chrome://extensions) in a new tab. Make sure the `Developer Mode` checkbox in the upper-right corner is turned on. Click `Load unpacked` and select the `dist` directory in this repository - your extension should now be loaded.

![Installed Extension in Google Chrome](https://i.imgur.com/ORuHbDR.png "Installed Extension in Google Chrome")
![Installed Extension in Google Chrome](https://i.imgur.com/ORuHbDR.png 'Installed Extension in Google Chrome')

</details>

Expand All @@ -33,7 +33,7 @@ In [Google Chrome](https://www.google.com/chrome/), open up [chrome://extensions

In [Brave](https://brave.com/), open up [brave://extensions](brave://extensions) in a new tab. Make sure the `Developer Mode` checkbox in the upper-right corner is turned on. Click `Load unpacked` and select the `dist` directory in this repository - your extension should now be loaded.

![Installed Extension in Brave](https://i.imgur.com/z8lW02m.png "Installed Extension in Brave")
![Installed Extension in Brave](https://i.imgur.com/z8lW02m.png 'Installed Extension in Brave')

</details>

Expand All @@ -42,11 +42,11 @@ In [Brave](https://brave.com/), open up [brave://extensions](brave://extensions)

In [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/), open up the [about:debugging](about:debugging) page in a new tab. Click the `Load Temporary Add-on...` button and select the `manfiest.json` from the `dist` directory in this repository - your extension should now be loaded.

![Installed Extension in Mozilla Firefox](https://i.imgur.com/gO2Lrb5.png "Installed Extension in Mozilla Firefox")
![Installed Extension in Mozilla Firefox](https://i.imgur.com/gO2Lrb5.png 'Installed Extension in Mozilla Firefox')

</details>

**Misc. References**

- [Chrome Extension Developer Guide](https://developer.chrome.com/extensions/devguide)
- [Firefox Extension Developer Guide](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension)
- [Chrome Extension Developer Guide](https://developer.chrome.com/extensions/devguide)
- [Firefox Extension Developer Guide](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension)
24 changes: 12 additions & 12 deletions apps/chrome-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"scripts": {
"build": "webpack --config webpack.prod.js",
"check-types": "tsc --noEmit",
"start": "webpack -w --config webpack.dev.js",
"prettier": "prettier --write --single-quote true --trailing-comma all --print-width 120"
"prettier": "prettier --write --single-quote true --trailing-comma all --print-width 120",
"start": "webpack -w --config webpack.dev.js"
},
"dependencies": {
"@ccsseraphini/ui": "0.0.1",
Expand All @@ -20,18 +20,18 @@
"regenerator-runtime": "0.14.0"
},
"devDependencies": {
"@babel/core": "7.22.19",
"@babel/preset-env": "7.22.10",
"@babel/preset-typescript": "7.23.0",
"@types/chrome": "0.0.246",
"@types/react-dom": "18.2.14",
"@babel/core": "7.25.2",
"@babel/preset-env": "7.25.3",
"@babel/preset-typescript": "7.24.7",
"@types/chrome": "0.0.269",
"@types/react-dom": "18.3.0",
"babel-loader": "9.1.3",
"css-loader": "6.8.1",
"style-loader": "3.3.3",
"ts-loader": "9.4.4",
"css-loader": "7.1.2",
"style-loader": "4.0.0",
"ts-loader": "9.5.1",
"webextension-polyfill-ts": "0.26.0",
"webpack": "5.88.2",
"webpack": "5.93.0",
"webpack-cli": "5.1.4",
"webpack-merge": "5.9.0"
"webpack-merge": "6.0.1"
}
}
12 changes: 6 additions & 6 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"check-types": "tsc --noEmit",
"cli": "tsc -p . && node ./lib/bin/cli.js",
"lint": "eslint '**/*.js'",
"prepare": "yarn build",
"prepare": "pnpm build",
"refresh": "rm -rf ./node_modules ./package-lock.json && npm install",
"test": "jest",
"watch": "tsc -w"
Expand All @@ -31,13 +31,13 @@
"yargs": "17.7.2"
},
"devDependencies": {
"@types/jest": "^29.5.3",
"@types/node": "^20.5.7",
"@types/jest": "^29.5.12",
"@types/node": "^22.1.0",
"babel-jest": "29.7.0",
"eslint": "8.51.0",
"jest": "29.6.2",
"eslint": "9.8.0",
"jest": "29.7.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
"typescript": "^5.5.4"
}
}
2 changes: 1 addition & 1 deletion apps/cli/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# pnpm lockfile v1


"@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7":
Expand Down
8 changes: 4 additions & 4 deletions apps/ranking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
},
"devDependencies": {
"@shelf/jest-mongodb": "^4.1.7",
"@types/luxon": "3.3.1",
"@types/node-schedule": "2.1.0",
"jest": "^29.6.2",
"@types/luxon": "3.4.2",
"@types/node-schedule": "2.1.7",
"jest": "^29.7.0",
"jest-fetch-mock": "3.0.3",
"ts-jest": "^29.1.1",
"typescript": "5.1.6"
"typescript": "5.5.4"
}
}
10 changes: 5 additions & 5 deletions apps/sseramemes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@
- `AWS_REGION`
- `AWS_BUCKET_NAME`

Once you have all the tokens, you can run the bot locally with `yarn start`.
Once you have all the tokens, you can run the bot locally with `pnpm start`.

## Server

We use PM2 to run and keep sseramemes online. To start the server, run:

```bash
yarn server:start
pnpm server:start
```

To check the logs, run:

```bash
yarn server:logs
pnpm server:logs
```

If you want to check only error logs, run:

```bash
yarn server:logs --err
pnpm server:logs --err
```

To check PM2 status, run:
Expand All @@ -62,7 +62,7 @@ pm2 status
As we're running on an EC2 instance, our deployment is a PM2 watch plus a cronjob to pull git changes. On crontab (`crontab -e`), we have:

```bash
*/5 * * * * cd ~/ccsseraphini && git pull && yarn >/dev/null 2>&1
*/5 * * * * cd ~/ccsseraphini && git pull && pnpm >/dev/null 2>&1
```

_Note: don't forget to add temp files to `ignore_watch` on `ecosystem.config.js` to avoid restarting the server._
10 changes: 5 additions & 5 deletions apps/sseramemes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"twitter-api-v2": "1.15.1"
},
"devDependencies": {
"@babel/core": "7.22.19",
"@babel/preset-env": "7.22.10",
"@babel/preset-typescript": "7.23.0",
"@babel/core": "7.25.2",
"@babel/preset-env": "7.25.3",
"@babel/preset-typescript": "7.24.7",
"babel-jest": "29.7.0",
"jest": "29.6.2",
"pm2": "5.3.0"
"jest": "29.7.0",
"pm2": "5.4.2"
}
}
4 changes: 2 additions & 2 deletions apps/vscode-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Base code for VSCode Extension
First, install the dependencies. Then run the debug server:

```bash
$ yarn install
$ pnpm install

# then

$ yarn watch
$ pnpm watch
```

## VSCode Commands
Expand Down
28 changes: 14 additions & 14 deletions apps/vscode-ext/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,31 @@
"watch": "concurrently \"rollup -c -w\" \"webpack --watch --config ./build/node-extension.webpack.config.js\""
},
"devDependencies": {
"@rollup/plugin-commonjs": "^25.0.5",
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-typescript": "^11.1.2",
"@tsconfig/svelte": "^5.0.2",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.2",
"@types/node": "^20.5.7",
"@types/node": "^22.1.0",
"@types/polka": "^0.5.1",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.62.0",
"concurrently": "^7.6.0",
"eslint": "^8.51.0",
"glob": "^10.3.10",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"concurrently": "^8.2.2",
"eslint": "^9.8.0",
"glob": "^11.0.0",
"mocha": "^10.2.0",
"rollup": "^3.29.2",
"rollup": "^4.20.0",
"rollup-plugin-svelte": "^7.1.6",
"rollup-plugin-terser": "^7.0.2",
"svelte": "^3.59.2",
"svelte": "^4.2.18",
"svelte-check": "^3.5.2",
"svelte-preprocess": "^5.0.4",
"ts-loader": "^9.4.4",
"typescript": "^5.1.6",
"vscode-test": "^1.4.1",
"webpack": "^5.88.2",
"svelte-preprocess": "^6.0.2",
"ts-loader": "^9.5.1",
"typescript": "^5.5.4",
"vscode-test": "^1.6.1",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
},
"engines": {
Expand Down
Loading

0 comments on commit 5d8be76

Please sign in to comment.