Skip to content

Commit 41d8352

Browse files
committed
chore: transform to esm module
1 parent 732c863 commit 41d8352

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+10535
-14813
lines changed

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ task('cleanModules', function() {
88
});
99

1010
task('cleanTmp', function() {
11-
return del(['./ts-cacche/.tmp', './storages/*/.tmp']);
11+
return del(['./ts-cache/.tmp', './storages/*/.tmp']);
1212
});
1313

1414
task('cleanDist', function() {

package-lock.json

Lines changed: 9995 additions & 13904 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"check-package-updates": "ncu -u && gulp updatePackages"
1313
},
1414
"devDependencies": {
15-
"@hokify/eslint-config": "^2.1.5",
15+
"@hokify/eslint-config": "^2.2.1",
1616
"@types/mocha": "9.0.0",
17-
"@types/node": "16.10.2",
17+
"@types/node": "16.11.9",
1818
"lerna": "^4.0.0",
19-
"mocha": "9.1.2",
20-
"ts-node": "10.2.1",
21-
"typescript": "4.4.3"
19+
"mocha": "9.1.3",
20+
"ts-node": "10.4.0",
21+
"typescript": "4.5.2"
2222
},
2323
"dependencies": {
2424
"del": "^6.0.0",

storages/lru-redis/package-lock.json

Lines changed: 25 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storages/lru-redis/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"publishConfig": {
55
"access": "public"
66
},
7+
"type": "module",
8+
"engines": {
9+
"node": ">=16.0.0"
10+
},
711
"description": "Simple and extensible caching module supporting decorators",
812
"main": "dist/index.js",
913
"scripts": {
10-
"test": "mocha -r ts-node/register test/**/*.test.ts",
14+
"test": "mocha --loader=ts-node/esm test/**/*.test.ts",
1115
"build": "tsc -p .",
1216
"prepublishOnly": "tsc -p .",
1317
"clean": "git clean -fdx src",
@@ -46,13 +50,13 @@
4650
"homepage": "https://github.com/hokify/node-ts-cache/tree/master/storages/lru-redis#readme",
4751
"dependencies": {
4852
"@hokify/node-ts-cache": "^5.6.0",
49-
"ioredis": "^4.27.10",
53+
"ioredis": "^4.28.0",
5054
"lru-cache": "^6.0.0"
5155
},
5256
"devDependencies": {
53-
"@types/ioredis": "^4.27.6",
57+
"@types/ioredis": "^4.28.1",
5458
"@types/lru-cache": "^5.1.1",
55-
"ioredis-mock": "^5.6.0"
59+
"ioredis-mock": "^5.8.0"
5660
},
5761
"gitHead": "c938eba762060f940a34bc192bec03bc76ea4017"
5862
}

storages/lru-redis/src/LRUWithRedisStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { IAsynchronousCacheType } from '@hokify/node-ts-cache';
22

3-
import * as LRU from 'lru-cache';
3+
import LRU from 'lru-cache';
44
import * as Redis from 'ioredis';
55

66
export class LRUWithRedisStorage implements IAsynchronousCacheType {

storages/lru-redis/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export { LRUWithRedisStorage as default } from './LRUWithRedisStorage';
1+
import { LRUWithRedisStorage } from './LRUWithRedisStorage.js';
2+
3+
export default LRUWithRedisStorage;

storages/lru-redis/test/lru.storage.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as Assert from "assert";
2-
import LRURedisStorage from "../src";
2+
import LRURedisStorage from "../src/index.js";
33

44

55
// @ts-ignore
6-
import * as RedisMock from "ioredis-mock";
6+
import RedisMock from "ioredis-mock";
77

88
const MockedRedis = new RedisMock({
99
host: "host",

storages/lru/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
"publishConfig": {
55
"access": "public"
66
},
7+
"type": "module",
8+
"engines": {
9+
"node": ">=16.0.0"
10+
},
711
"description": "Simple and extensible caching module supporting decorators",
812
"main": "dist/index.js",
913
"scripts": {
10-
"test": "mocha -r ts-node/register test/**/*.test.ts",
14+
"test": "mocha --loader=ts-node/esm test/**/*.test.ts",
1115
"build": "tsc -p .",
1216
"prepublishOnly": "tsc -p .",
1317
"clean": "git clean -fdx src",

storages/lru/src/LRUStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { IMultiSynchronousCacheType, ISynchronousCacheType } from '@hokify/node-ts-cache';
22

3-
import * as LRU from 'lru-cache';
3+
import LRU from 'lru-cache';
44

55
export class LRUStorage implements ISynchronousCacheType, IMultiSynchronousCacheType {
66
myCache: LRU<string, any>;

0 commit comments

Comments
 (0)