Skip to content

Commit

Permalink
add publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
iona-andras-nemes committed Dec 13, 2024
1 parent 140624a commit 618334c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"parserOptions": {
"project": [
"./tsconfig.json",
"./tsconfig-test.json"
"./tsconfig-test.json",
"./tsconfig.build.json"
]
}
}
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"test": "ts-mocha --recursive \"./test/unit/**/*.spec.ts\"",
"test:integration": "docker run -d -p 6379:6379 --name leprechaun-redis redis && ts-mocha --recursive \"./test/integration/**/*.spec.ts\"; docker stop leprechaun-redis; docker rm leprechaun-redis",
"test:integration-nodocker": "ts-mocha --recursive \"./test/integration/**/*.spec.ts\"",
"build-package": "rm -rf ./dist && tsc --skipLibCheck -p ./tsconfig.build.json ",
"build-and-publish-pre-release": "npm run test && npm run build-package && npm publish --tag pre-release",
"build-and-publish": "npm run build-package && npm publish",
"acuris-eslint": "npx acuris-eslint"
},
"husky": {
Expand Down Expand Up @@ -71,6 +74,6 @@
"sinon": "^7.5.0",
"sinon-chai": "^3.3.0",
"ts-mocha": "^6.0.0",
"typescript": "^3.7.2"
"typescript": "^5.7.2"
}
}
5 changes: 4 additions & 1 deletion src/storage/redis-cache-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class RedisCacheStore<T extends Cacheable = Cacheable> implements CacheSt

public async get(key: string): Promise<CacheItem<T> | null> {
const result = await this.redisClient.get(key)
return JSON.parse(result)
if (result) {
return JSON.parse(result)
}
return null
}

public async set(key: string, data: CacheItem<T>, ttl: number): Promise<boolean> {
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"compilerOptions": {
"outDir": "dist",
"noEmit": false,
"declaration": true,
"charset": ""
},
"include": ["src/**/*"],
"exclude": ["test", "node_modules"],
"extends": "./tsconfig.json"
}
12 changes: 5 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
{
"extends": "@acuris/eslint-config/tsconfig.json",
"compilerOptions": {
"noEmit": false,
"module": "commonjs",
"target": "es2017",
"declaration": true,
"outDir": "./dist"
"target": "ES6",
"noEmit": true,
"charset": ""
},
"include": ["src/**/*"]
"include": ["src/**/*", "typings/**/*", "test/**/*"],
"extends": "@acuris/eslint-config/tsconfig.json"
}

0 comments on commit 618334c

Please sign in to comment.