From bd40b393bd773d413b9d38a76ae99163c8c67ad1 Mon Sep 17 00:00:00 2001 From: Marc Harter Date: Mon, 22 Jan 2024 08:24:19 -0700 Subject: [PATCH] Fix broken windows (#409) Includes: - Update dependencies - Add Node v20 as a test environment --- .github/workflows/build.yml | 2 +- index.ts | 2 +- index_test.ts | 8 +++++--- package.json | 26 +++++++++++++------------- readme.md | 2 +- tsconfig.json | 4 ++-- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 310d583..45c1925 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [16, 18] + node: [16, 18, 20] name: Node v${{ matrix.node }} steps: - uses: actions/checkout@v3 diff --git a/index.ts b/index.ts index 8079b17..4f0b15b 100644 --- a/index.ts +++ b/index.ts @@ -153,7 +153,7 @@ class RedisStore extends Store { let keys = await this._getAllKeys() return cb( null, - keys.map((k) => k.substring(len)) + keys.map((k) => k.substring(len)), ) } catch (err) { return cb(err) diff --git a/index_test.ts b/index_test.ts index 483bf14..9adc5f4 100644 --- a/index_test.ts +++ b/index_test.ts @@ -6,7 +6,9 @@ import {createClient} from "redis" import RedisStore from "./" import * as redisSrv from "./testdata/server" -test("setup", redisSrv.connect) +test("setup", async () => { + await redisSrv.connect() +}) test("defaults", async (t) => { let client = createClient({url: `redis://localhost:${redisSrv.port}`}) @@ -44,7 +46,7 @@ test("teardown", redisSrv.disconnect) async function lifecycleTest( store: RedisStore, client: any, - t: test.Test + t: test.Test, ): Promise { const P = (f: any) => promisify(f).bind(store) let res = await P(store.clear)() @@ -85,7 +87,7 @@ async function lifecycleTest( {id: "123", foo: "bar"}, {id: "456", cookie: {expires}}, ], - "stored two keys data" + "stored two keys data", ) await P(store.destroy)("456") diff --git a/package.json b/package.json index 67a024e..d188fc3 100644 --- a/package.json +++ b/package.json @@ -29,22 +29,22 @@ "url": "git@github.com:tj/connect-redis.git" }, "devDependencies": { - "@types/blue-tape": "^0.1.33", - "@types/express-session": "^1.17.6", - "@types/node": "^18.13.0", - "@typescript-eslint/eslint-plugin": "^5.52.0", - "@typescript-eslint/parser": "^5.52.0", + "@types/blue-tape": "^0.1.36", + "@types/express-session": "^1.17.10", + "@types/node": "^20.11.5", + "@typescript-eslint/eslint-plugin": "^6.19.0", + "@typescript-eslint/parser": "^6.19.0", "blue-tape": "^1.0.0", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.6.0", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", "express-session": "^1.17.3", - "ioredis": "^5.3.1", + "ioredis": "^5.3.2", "nyc": "^15.1.0", - "prettier": "^2.8.4", - "prettier-plugin-organize-imports": "^3.2.2", - "redis": "^4.6.4", - "ts-node": "^10.9.1", - "typescript": "^4.9.5" + "prettier": "^3.2.4", + "prettier-plugin-organize-imports": "^3.2.4", + "redis": "^4.6.12", + "ts-node": "^10.9.2", + "typescript": "^5.3.3" }, "peerDependencies": { "express-session": ">=1" diff --git a/readme.md b/readme.md index 9c18802..131b258 100644 --- a/readme.md +++ b/readme.md @@ -63,7 +63,7 @@ app.use( resave: false, // required: force lightweight session keep alive (touch) saveUninitialized: false, // recommended: only save session when data exists secret: "keyboard cat", - }) + }), ) ``` diff --git a/tsconfig.json b/tsconfig.json index da1c546..525d29b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ "declaration": true, "outDir": "./dist/cjs", "esModuleInterop": true, - "resolveJsonModule": true + "resolveJsonModule": true, }, - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist"], }