Skip to content

Commit 501ab17

Browse files
committed
yarn -> pnpm, update docker-compose
1 parent 39f4f82 commit 501ab17

File tree

6 files changed

+5133
-5756
lines changed

6 files changed

+5133
-5756
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ jobs:
3030
- uses: actions/setup-node@v2
3131
with:
3232
node-version: ${{ matrix.node-version }}
33+
- run: corepack enable
3334
- name: Install dependencies
34-
run: yarn install --ignore-engines
35+
run: pnpm install
3536
- name: Full CI suite
36-
run: yarn test
37+
run: pnpm test
3738
if: matrix.node-version == '12.x'
3839
- name: Jest tests only
39-
run: yarn jest
40+
run: pnpm jest
4041
if: matrix.node-version == '10.x'
4142
- uses: codecov/codecov-action@v2
4243
if: matrix.node-version == '12.x'

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Most of the package is generated by running sample commands from the redis docum
128128

129129
The client is generated from the [redis-doc](https://github.com/redis/redis-doc) repo.
130130

131-
- `yarn codegen` generates code:
131+
- `pnpm codegen` generates code:
132132
- `generate-schema`:
133133
- [commands.json](./docs/redis-doc/commands.json) is used to output a commands file with json-schema arguments and return types.
134134
- Argument lists are modeled as arrays, which are flattened when sent to the underlying client. e.g. `SET` might have args `['foo', 'bar', ['EX', 60]]` corresponding to the CLI command `SET foo bar EX 60`
@@ -150,19 +150,19 @@ From all the code-generation only the [interface file](./src/generated/interface
150150
```cli
151151
git clone https://github.com/mmkal/handy-redis
152152
cd handy-redis
153-
yarn
153+
pnpm install
154154
```
155-
Make sure you have docker installed and `docker-compose` is on your path, and start up a redis server in the background with `yarn redis:up -d`.
155+
Make sure you have docker installed and `docker-compose` is on your path, and start up a redis server in the background with `pnpm redis:up -d`.
156156

157157
To fully test the package as it is on your machine, the same way CI does:
158158

159159
```cli
160-
yarn test
160+
pnpm test
161161
```
162162

163-
`yarn test` runs the build, test and lint scripts. It removes all generated code before, and after checks that your git status is clean. This is to allow tracking changes to the generated client over time, to make what the published package contains more visible, and to make sure that generated code hasn't been modified without auditing first. You should not manually edit any files under a `*/generated/*` path. If `yarn test` fails for you because you deliberately changed the way the codegen works, take a look at the git changes, check them in and run `yarn test` again.
163+
`pnpm test` runs the build, test and lint scripts. It removes all generated code before, and after checks that your git status is clean. This is to allow tracking changes to the generated client over time, to make what the published package contains more visible, and to make sure that generated code hasn't been modified without auditing first. You should not manually edit any files under a `*/generated/*` path. If `pnpm test` fails for you because you deliberately changed the way the codegen works, take a look at the git changes, check them in and run `pnpm test` again.
164164

165-
The `build` script generates the client before using TypeScript to compile it. If you want to run the tests without rebuilding, linting etc., use `yarn jest`.
165+
The `build` script generates the client before using TypeScript to compile it. If you want to run the tests without rebuilding, linting etc., use `pnpm jest`.
166166

167167
There are some more scripts in `package.json` which can be useful for local development.
168168

@@ -174,6 +174,6 @@ git subtree pull --prefix docs/redis-doc https://github.com/redis/redis-doc mast
174174

175175
### Testing
176176

177-
If a snapshot test fails, it's possible it just needs to be updated. Make sure your git status is clean and run `yarn jest -u`.
177+
If a snapshot test fails, it's possible it just needs to be updated. Make sure your git status is clean and run `pnpm jest -u`.
178178

179179
Types are tested using [expect-type](https://npmjs.com/package/expect-type).

docker-compose.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
redis:
2-
image: redis:6.2.4
3-
container_name: handy_redis
4-
ports:
5-
- "6379:6379"
1+
services:
2+
redis:
3+
image: redis:6.2.4
4+
container_name: handy_redis
5+
ports:
6+
- "6379:6379"

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "handy-redis",
33
"version": "2.3.1",
4+
"packageManager": "[email protected]",
45
"description": "A redis client with first-class Promise and TypeScript support, and extensive documentation.",
56
"keywords": [
67
"redis",
@@ -32,22 +33,22 @@
3233
],
3334
"scripts": {
3435
"_": "echo \"these pass-through-to-docker scripts are mostly just as a hint for when I come back to this in a few weeks and forget what I'm supposed to do.\"",
35-
"prebuild": "yarn codegen",
36-
"build": "yarn typecheck && yarn compile",
36+
"prebuild": "pnpm codegen",
37+
"build": "pnpm typecheck && pnpm compile",
3738
"check-clean": "git diff --exit-code || (echo 'Git changes detect. Stash, stage or commit then and re-run if this is expected.' && exit 1)",
3839
"preclean": "del-cli temp/backup-test-generated && mkdir -p temp && cp -r test/generated temp/backup-test-generated",
3940
"clean": "del-cli 'dist' 'ts34' 'src/generated' 'test/generated'",
4041
"codegen": "ts-node codegen/generate-schema && ts-node codegen/generate-client && ts-node codegen/generate-tests",
4142
"compile": "tsc -p tsconfig.lib.json",
4243
"postcompile": "node downlevel",
43-
"coverage": "yarn jest --coverage",
44-
"coveralls": "yarn coverage --coverageReporters=text-lcov | coveralls",
44+
"coverage": "pnpm jest --coverage",
45+
"coveralls": "pnpm coverage --coverageReporters=text-lcov | coveralls",
4546
"jest": "jest --runInBand --forceExit",
4647
"lint": "eslint --max-warnings 0 --ext .ts,.js,.md .",
4748
"redis-cli": "docker-compose exec redis redis-cli",
4849
"redis:down": "docker-compose down",
4950
"redis:up": "docker-compose up",
50-
"test": "run-s clean build coverage lint check-clean",
51+
"test": "run-s clean codegen build coverage lint check-clean",
5152
"tsn": "ts-node --transpile-only",
5253
"typecheck": "tsc -p ."
5354
},
@@ -59,6 +60,7 @@
5960
"@types/eslint": "7.29.0",
6061
"@types/glob": "7.2.0",
6162
"@types/jest": "27.4.1",
63+
"@types/json-schema": "^7.0.15",
6264
"@types/lodash": "4.14.181",
6365
"@types/node": "16.11.27",
6466
"@types/redis-mock": "0.17.1",

0 commit comments

Comments
 (0)