Skip to content

Commit

Permalink
Decrease package size; Move fastify dep to devDep
Browse files Browse the repository at this point in the history
  • Loading branch information
denbon05 committed Nov 29, 2022
1 parent bcd11e5 commit 3faad6f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ci:
npm ci

test:
npm test

Expand Down
2 changes: 1 addition & 1 deletion lib/lcache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FastifyInstance, FastifyPluginCallback } from 'fastify';
import type { FastifyInstance, FastifyPluginCallback } from 'fastify';
import fp from 'fastify-plugin';
import type { ICacheOptions } from './types/lcache';
import { formatOptions, shouldBeCached } from './helpers';
Expand Down
3 changes: 2 additions & 1 deletion lib/types/fastify.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import 'fastify';
import { IStorage } from './storage';

declare module 'fastify' {
interface FastifyInstance {
lcache: IStorage
lcache: IStorage;
}
}
7 changes: 5 additions & 2 deletions lib/types/lcache.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// <reference types="node" />
import { FastifyPluginCallback } from 'fastify';
import type { FastifyPluginCallback } from 'fastify';
import type { IStorageOptions } from './storage';

export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
Expand All @@ -18,6 +18,9 @@ export interface ICacheOptions<> {
excludeRoutes?: string[];
}

declare const _default: FastifyPluginCallback<ICacheOptions, import('http').Server>;
declare const _default: FastifyPluginCallback<
ICacheOptions,
import('http').Server
>;

export default _default;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fastify-lcache",
"version": "1.1.0",
"version": "1.1.1",
"description": "Light cache plugin for fastify",
"main": "dist/lcache.js",
"types": "lib/types/lcache.d.ts",
Expand Down Expand Up @@ -38,10 +38,10 @@
"jest": "^28.1.1",
"ts-jest": "^28.0.4",
"ts-node": "^10.8.1",
"typescript": "^4.7.3"
"typescript": "^4.7.3",
"fastify": "^4.2.1"
},
"dependencies": {
"fastify": "^4.2.1",
"fastify-plugin": "^4.0.0"
}
}

0 comments on commit 3faad6f

Please sign in to comment.