Skip to content

Commit

Permalink
migration to pnpm from yarn (#1157)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwray authored Oct 9, 2024
1 parent 9299897 commit a46bdc1
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 47 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Install pnpm
run: npm install -g pnpm

- name: Start Services
run: yarn test:services:start
run: pnpm test:services:start

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Build
run: pnpm build

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

- name: Code Coverage
uses: codecov/codecov-action@v3
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install pnpm
run: npm install -g pnpm

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Install Dependencies
run: yarn build
run: pnpm build

- name: Build Website
run: yarn website:build
run: pnpm website:build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Install pnpm
run: npm install -g pnpm

- name: Start Services
run: yarn test:services:start
run: pnpm test:services:start

- name: Install Dependencies
run: yarn
run: pnpm install

- name: Build
run: pnpm build

- name: Test Packages
run: yarn test
run: pnpm test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ packages/website/site/docs/**
!packages/website/site/docs/cacheing/**
packages/third-party/keyv-file.json
packages/keyv/test.db

# pnpm
pnpm-lock.yaml
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ You can contribute changes to this repo by opening a pull request:
1) After forking this repository to your Git account, make the proposed changes on your forked branch.
2) Run tests and linting locally.
- [Install and run Docker](https://docs.docker.com/get-docker/) if you aren't already.
- Run `yarn test:services:start`, allow for the services to come up.
- Run `yarn test`.
- Run `pnpm test:services:start`, allow for the services to come up.
- Run `pnpm test`.
3) Commit your changes and push them to your forked repository.
4) Navigate to the main `keyv` repository and select the *Pull Requests* tab.
5) Click the *New pull request* button, then select the option "Compare across forks"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ You can contribute changes to this repo by opening a pull request:
1) After forking this repository to your Git account, make the proposed changes on your forked branch.
2) Run tests and linting locally.
- [Install and run Docker](https://docs.docker.com/get-docker/) if you aren't already.
- Run `yarn test:services:start`, allow for the services to come up.
- Run `yarn test`.
- Run `pnpm test:services:start`, allow for the services to come up.
- Run `pnpm test`.
3) Commit your changes and push them to your forked repository.
4) Navigate to the main `keyv` repository and select the *Pull Requests* tab.
5) Click the *New pull request* button, then select the option "Compare across forks"
Expand Down
17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
"author": "Jared Wray <me@jaredwray.com>",
"license": "MIT",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"build:keyv:serialize": "cd packages/serialize && yarn build",
"build:keyv": "cd packages/keyv && yarn build",
"build": "yarn build:keyv:serialize && yarn build:keyv && yarn workspaces run build",
"test": "yarn build && c8 --reporter=lcov yarn workspaces run test:ci",
"build:keyv:serialize": "cd packages/serialize && pnpm build",
"build:keyv": "cd packages/keyv && pnpm build",
"build": "pnpm build:keyv:serialize && pnpm build:keyv && pnpm recursive run build",
"test": "pnpm build && c8 --reporter=lcov pnpm -r --workspace-concurrency 1 test:ci",
"test:services:start": "chmod +x ./test-services-start.sh && ./test-services-start.sh",
"test:services:stop": "chmod +x ./test-services-stop.sh && ./test-services-stop.sh",
"website:build": "yarn workspace @keyv/website run website:build",
"website:serve": "yarn workspace @keyv/website run website:serve",
"clean": "rimraf node_modules yarn.lock && yarn workspaces run clean"
"website:build": "pnpm recursive --filter @keyv/website run website:build",
"website:serve": "pnpm recursive --filter @keyv/website run website:serve",
"clean": "rimraf node_modules pnpm-lock.yaml && pnpm recursive run clean"
},
"devDependencies": {
"@types/node": "^22.7.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-brotli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/compress-gzip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf node_modules ./dist ./coverage ./test/testdb.sqlite"
Expand Down
2 changes: 1 addition & 1 deletion packages/etcd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
7 changes: 6 additions & 1 deletion packages/keyv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
Expand Down Expand Up @@ -79,6 +79,11 @@
"@keyv/serialize": "*"
},
"devDependencies": {
"@keyv/compress-brotli": "*",
"@keyv/compress-gzip": "*",
"@keyv/memcache": "*",
"@keyv/mongo": "*",
"@keyv/sqlite": "*",
"@keyv/test-suite": "*",
"rimraf": "^6.0.1",
"timekeeper": "^2.3.1",
Expand Down
4 changes: 0 additions & 4 deletions packages/memcache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
```shell
npm install --save @keyv/memcache
```
or
```
yarn add @keyv/memcache
```

## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/memcache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/mongo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/offline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
Expand Down
4 changes: 2 additions & 2 deletions packages/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ When testing you can use our `docker compose` postgresql instance by having dock

At the root of the Keyv mono repo:
```shell
yarn test:services:start
pnpm test:services:start
```

To just test the postgres adapter go to the postgres directory (packages/postgres) and run:
```shell
yarn test
pnpm test
```

## License
Expand Down
2 changes: 1 addition & 1 deletion packages/postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/redis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/serialize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/test-suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"type": "module",
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist ./test/testdb.sqlite"
Expand Down
2 changes: 1 addition & 1 deletion packages/tiered/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./test/testdb.sqlite ./dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/valkey/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"scripts": {
"build": "rimraf ./dist && tsup src/index.ts --format cjs,esm --dts --clean",
"prepare": "yarn build",
"prepare": "pnpm build",
"test": "xo --fix && vitest run --coverage",
"test:ci": "xo && vitest --run --sequence.setupFiles=list",
"clean": "rimraf ./node_modules ./coverage ./dist"
Expand Down
6 changes: 3 additions & 3 deletions packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"test:ci": "echo 'no tests needed'",
"test": "echo 'no tests needed'",
"generate-docs": "rimraf ./dist && ts-node ./src/docs.ts",
"build": "yarn website:build",
"website:build": "yarn generate-docs && docula build",
"build-serve": "yarn clean && yarn generate-docs && docula serve",
"build": "pnpm website:build",
"website:build": "pnpm generate-docs && docula build",
"build-serve": "pnpm clean && pnpm generate-docs && docula serve",
"clean": "rimraf ./dist ./docs/compression ./docs/test-suite ./docs/storage-adapters",
"website:serve": "docula serve"
},
Expand Down
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- 'packages/*'

0 comments on commit a46bdc1

Please sign in to comment.