Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move types to types-folder, tests into test folder, update typings #107

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .taprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
files:
- test/**/*.test.js
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "4.0.0",
"description": "Fastify basic auth plugin",
"main": "index.js",
"types": "index.d.ts",
"types": "types/index.d.ts",
"scripts": {
"lint": "standard",
"test": "npm run test:unit && npm run test:types",
"test:unit": "tap test.js",
"test:unit": "tap",
"test:types": "tsd"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion test.js → test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { test } = require('tap')
const Fastify = require('fastify')
const basicAuth = require('./index')
const basicAuth = require('..')
const fastifyAuth = require('@fastify/auth')

test('Basic', t => {
Expand Down
5 changes: 2 additions & 3 deletions index.d.ts → types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import {
FastifyRequest,
FastifyPlugin,
FastifyPluginAsync,
FastifyReply,
onRequestHookHandler,
preParsingHookHandler,
preValidationHookHandler,
preHandlerHookHandler,
FastifyInstance
Expand All @@ -30,5 +29,5 @@ export interface FastifyBasicAuthOptions {
header?: string;
}

declare const fastifyBasicAuth: FastifyPlugin<FastifyBasicAuthOptions>
declare const fastifyBasicAuth: FastifyPluginAsync<FastifyBasicAuthOptions>
export default fastifyBasicAuth;
2 changes: 1 addition & 1 deletion index.test-d.ts → types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import fastify, {
preHandlerHookHandler,
FastifyInstance
} from 'fastify'
import fastifyBasicAuth from '.'
import fastifyBasicAuth from '..'

const app = fastify()

Expand Down