diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml index 3d8e60c24..828d5e8ea 100644 --- a/.github/workflows/codecov.yaml +++ b/.github/workflows/codecov.yaml @@ -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 diff --git a/.github/workflows/deploy-website.yml b/.github/workflows/deploy-website.yml index 0ab928ebc..af5a035c2 100644 --- a/.github/workflows/deploy-website.yml +++ b/.github/workflows/deploy-website.yml @@ -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 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index aef88f211..8f3dd2135 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -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 \ No newline at end of file + run: pnpm test \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5f30bc40c..d4130c1fb 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9f3c23c0f..425ccc10a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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" diff --git a/README.md b/README.md index 0a897df2e..aa21adc58 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/package.json b/package.json index 33d3f0fdb..ebbc80c3c 100644 --- a/package.json +++ b/package.json @@ -7,19 +7,16 @@ "author": "Jared Wray ", "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", diff --git a/packages/compress-brotli/package.json b/packages/compress-brotli/package.json index 095f3cc55..e058854af 100644 --- a/packages/compress-brotli/package.json +++ b/packages/compress-brotli/package.json @@ -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" diff --git a/packages/compress-gzip/package.json b/packages/compress-gzip/package.json index dfb298ee4..daeb59aa2 100644 --- a/packages/compress-gzip/package.json +++ b/packages/compress-gzip/package.json @@ -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" diff --git a/packages/etcd/package.json b/packages/etcd/package.json index 011fd8791..512bef4c4 100644 --- a/packages/etcd/package.json +++ b/packages/etcd/package.json @@ -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" diff --git a/packages/keyv/package.json b/packages/keyv/package.json index d8fe69d40..a6230792f 100644 --- a/packages/keyv/package.json +++ b/packages/keyv/package.json @@ -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" @@ -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", diff --git a/packages/memcache/README.md b/packages/memcache/README.md index 01b33e314..71f606aea 100644 --- a/packages/memcache/README.md +++ b/packages/memcache/README.md @@ -13,10 +13,6 @@ ```shell npm install --save @keyv/memcache ``` -or -``` -yarn add @keyv/memcache -``` ## Usage diff --git a/packages/memcache/package.json b/packages/memcache/package.json index 55e898705..60acb7bb5 100644 --- a/packages/memcache/package.json +++ b/packages/memcache/package.json @@ -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" diff --git a/packages/mongo/package.json b/packages/mongo/package.json index 1b8c844c9..c29e84396 100644 --- a/packages/mongo/package.json +++ b/packages/mongo/package.json @@ -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" diff --git a/packages/mysql/package.json b/packages/mysql/package.json index ff96f83ec..bb7fc7c65 100644 --- a/packages/mysql/package.json +++ b/packages/mysql/package.json @@ -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" diff --git a/packages/offline/package.json b/packages/offline/package.json index 7a63e5891..2590ee823 100644 --- a/packages/offline/package.json +++ b/packages/offline/package.json @@ -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" diff --git a/packages/postgres/README.md b/packages/postgres/README.md index aaafed438..cbd45a3d5 100644 --- a/packages/postgres/README.md +++ b/packages/postgres/README.md @@ -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 diff --git a/packages/postgres/package.json b/packages/postgres/package.json index 45535181e..33db50a6b 100644 --- a/packages/postgres/package.json +++ b/packages/postgres/package.json @@ -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" diff --git a/packages/redis/package.json b/packages/redis/package.json index bc8a7f672..9788dbafa 100644 --- a/packages/redis/package.json +++ b/packages/redis/package.json @@ -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" diff --git a/packages/serialize/package.json b/packages/serialize/package.json index 620d168d6..31a7389e6 100644 --- a/packages/serialize/package.json +++ b/packages/serialize/package.json @@ -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" diff --git a/packages/sqlite/package.json b/packages/sqlite/package.json index 47d544a25..b70b221c6 100644 --- a/packages/sqlite/package.json +++ b/packages/sqlite/package.json @@ -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" diff --git a/packages/test-suite/package.json b/packages/test-suite/package.json index 3f25027c0..eeb5b7a8b 100644 --- a/packages/test-suite/package.json +++ b/packages/test-suite/package.json @@ -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" diff --git a/packages/tiered/package.json b/packages/tiered/package.json index 43cd01e98..96bf2053b 100644 --- a/packages/tiered/package.json +++ b/packages/tiered/package.json @@ -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" diff --git a/packages/valkey/package.json b/packages/valkey/package.json index 5df24f620..d62248d70 100644 --- a/packages/valkey/package.json +++ b/packages/valkey/package.json @@ -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" diff --git a/packages/website/package.json b/packages/website/package.json index eebd5e81d..8a5e35582 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -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" }, diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 000000000..4340350e1 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - 'packages/*' \ No newline at end of file