Skip to content

Commit 98491e1

Browse files
committed
fix: Fixed missing declaration files in dist
1 parent cf259f4 commit 98491e1

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@
2020
"typescript": "^5.5.4"
2121
},
2222
"scripts": {
23-
"build": "tsc",
23+
"build": "tsc && cp src/**/*.d.ts dist/",
2424
"prepare": "yarn build",
2525
"test": "xo"
2626
},
2727
"dependencies": {
2828
"cache-manager": "^5.7.6",
2929
"eslint-plugin-th-rules": "^1.14.0",
3030
"lodash": "^4.17.21",
31-
"reflect-metadata": "^0.2.2"
31+
"reflect-metadata": "^0.2.2",
32+
"typescript": "^5.5.4"
3233
},
3334
"packageManager": "yarn@4.4.1"
3435
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
type CachedFunctionInitializerOptions, type CachedFunctionOptions, type CacheableFunction, type ArgumentPaths,
99
type Logger,
1010
type CachedFunctionResult,
11-
} from './index.d';
11+
} from './types';
1212

1313
let cache: Cache | undefined;
1414
let logger: Logger = {

src/index.d.ts renamed to src/types.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable sonarjs/todo-tag */
2+
/* eslint-disable no-warning-comments */
3+
/* eslint-disable sonarjs/redundant-type-aliases */
14
/* eslint-disable @typescript-eslint/no-explicit-any */
25
import {
36
type Store,

tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {memoryStore} from 'cache-manager';
66
import {
77
getOrInitializeCache, selectorToCacheKey, cachedFunction, resetCache,
88
} from '../src/index';
9-
import type {CachedFunctionInitializerOptions, CachedFunctionOptions} from '../src/index.d';
9+
import type {CachedFunctionInitializerOptions, CachedFunctionOptions} from '../src/types';
1010

1111
describe('initializeCache', () => {
1212
beforeEach(() => {

tests/redis.test_.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
import {random} from 'lodash';
33
import {type RedisStore, redisStore} from 'cache-manager-ioredis-yet';
44
import {cachedFunction, CacheOptions, getOrInitializeCache} from '../src';
5-
import { selectorToCacheKey } from '../src/index';
65

76
const cache = await getOrInitializeCache<RedisStore>({
87
store: await redisStore({
98
host: 'localhost',
109
port: 6379,
1110
}),
12-
logger: console
11+
logger: console,
1312
});
1413

1514
type Person = {

tsconfig.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"compilerOptions": {
3-
"lib": ["ESNext"],
3+
"lib": [
4+
"ESNext"
5+
],
46
"module": "esnext",
57
"target": "esnext",
68
"moduleResolution": "bundler",
79
"moduleDetection": "force",
8-
"noEmit": false,
10+
"noEmit": false,
911
"outDir": "dist",
1012
"rootDir": "src",
1113
"composite": true,
@@ -20,8 +22,15 @@
2022
"bun-types"
2123
],
2224
"emitDecoratorMetadata": true,
23-
"experimentalDecorators": true
25+
"experimentalDecorators": true,
26+
"declaration": true
2427
},
25-
"include": ["src/**/*.ts"],
26-
"exclude": ["node_modules", "**/*.test.ts"]
28+
"include": [
29+
"src/**/*.ts",
30+
"src/**/*.d.ts"
31+
],
32+
"exclude": [
33+
"node_modules",
34+
"**/*.test.ts"
35+
]
2736
}

yarn.lock

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3124,6 +3124,7 @@ __metadata:
31243124
eslint-plugin-th-rules: "npm:^1.14.0"
31253125
lodash: "npm:^4.17.21"
31263126
reflect-metadata: "npm:^0.2.2"
3127+
typescript: "npm:^5.5.4"
31273128
xo: "npm:^0.59.3"
31283129
peerDependencies:
31293130
typescript: ^5.5.4
@@ -8848,7 +8849,7 @@ __metadata:
88488849
languageName: node
88498850
linkType: hard
88508851

8851-
"typescript@npm:*, typescript@npm:^5.5.3":
8852+
"typescript@npm:*, typescript@npm:^5.5.3, typescript@npm:^5.5.4":
88528853
version: 5.6.2
88538854
resolution: "typescript@npm:5.6.2"
88548855
bin:
@@ -8858,7 +8859,7 @@ __metadata:
88588859
languageName: node
88598860
linkType: hard
88608861

8861-
"typescript@patch:typescript@npm%3A*#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.3#optional!builtin<compat/typescript>":
8862+
"typescript@patch:typescript@npm%3A*#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.3#optional!builtin<compat/typescript>, typescript@patch:typescript@npm%3A^5.5.4#optional!builtin<compat/typescript>":
88628863
version: 5.6.2
88638864
resolution: "typescript@patch:typescript@npm%3A5.6.2#optional!builtin<compat/typescript>::version=5.6.2&hash=8c6c40"
88648865
bin:

0 commit comments

Comments
 (0)