Skip to content

Commit 47eeb8f

Browse files
authored
Modernize project structure (#161)
* disable package lock generation * use pre-commit and separate lint from testing remove types of ioredis * move types into types folder * make tap configuration like other projects
1 parent 6b38e80 commit 47eeb8f

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ jobs:
1414
test:
1515
uses: fastify/workflows/.github/workflows/plugins-ci-redis.yml@v3
1616
with:
17+
lint: true
1718
license-check: true
1819
license-check-allowed-additional: 'Apache*'

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.taprc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ flow: false
44
jobs: 1
55
coverage: true
66
check-coverage: true
7+
8+
files:
9+
- test/**/*.test.js

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
"version": "6.0.0",
44
"description": "Plugin to share a common Redis connection across Fastify.",
55
"main": "index.js",
6-
"types": "index.d.ts",
6+
"types": "types/index.d.ts",
77
"scripts": {
88
"lint": "standard",
99
"lint:fix": "standard --fix",
1010
"redis": "docker run -p 6379:6379 --rm redis",
11-
"test": "npm run lint && npm run unit && npm run typescript",
11+
"test": "npm run unit && npm run typescript",
1212
"typescript": "tsd",
13-
"unit": "tap test/test.js",
14-
"unit:report": "tap test/test.js --cov --coverage-report=html --coverage-report=cobertura",
15-
"unit:verbose": "tap test/test.js -Rspec"
13+
"unit": "tap",
14+
"unit:report": "tap --cov --coverage-report=html --coverage-report=cobertura",
15+
"unit:verbose": "tap -Rspec"
1616
},
1717
"repository": {
1818
"type": "git",
@@ -33,7 +33,7 @@
3333
},
3434
"homepage": "https://github.com/fastify/fastify-redis#readme",
3535
"devDependencies": {
36-
"@types/ioredis": "^4.27.4",
36+
"@fastify/pre-commit": "^2.0.2",
3737
"@types/node": "^18.0.0",
3838
"fastify": "^4.0.0-rc.2",
3939
"proxyquire": "^2.1.3",
@@ -46,10 +46,11 @@
4646
"fastify-plugin": "^4.0.0",
4747
"ioredis": "^5.0.0"
4848
},
49-
"tsd": {
50-
"directory": "test/types"
51-
},
5249
"publishConfig": {
5350
"access": "public"
54-
}
51+
},
52+
"pre-commit": [
53+
"lint",
54+
"test"
55+
]
5556
}
File renamed without changes.
File renamed without changes.

test/types/index.ts renamed to types/index.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Fastify, { FastifyInstance } from 'fastify'
22
import IORedis, { Redis } from 'ioredis'
33
import { expectAssignable, expectError, expectType } from 'tsd'
4-
import fastifyRedis, { FastifyRedis, FastifyRedisNamespacedInstance } from '../..'
4+
import fastifyRedis, { FastifyRedis, FastifyRedisNamespacedInstance } from '..'
55

66
const app: FastifyInstance = Fastify()
77
const redis: Redis = new IORedis({ host: 'localhost', port: 6379 })

0 commit comments

Comments
 (0)