diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6ebd9d8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish Package to NPM + +on: + release: + types: [published] + +jobs: + publish: + needs: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + + - run: yarn + - run: yarn build + - uses: JS-DevTools/npm-publish@v3 + id: publish + with: + token: ${{ secrets.NPM_TOKEN }} + + - if: ${{ steps.publish.outputs.type }} + run: echo "$PCKG_ID published to $PCKG_TAG, old version was [$OLD_VER]" + env: + OLD_VER: ${{ steps.publish.outputs.old-version }} + PCKG_ID: ${{ steps.publish.outputs.id }} + PCKG_TAG: ${{ steps.publish.outputs.tag }} diff --git a/package.json b/package.json index 868dc66..8b36ab0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "warp-contracts-redis", - "version": "0.3.4", + "version": "0.4.0", "description": "Redis implementation for Warp Contracts", "types": "./lib/types/index.d.ts", "main": "./lib/cjs/index.js", @@ -51,9 +51,11 @@ "LICENSE" ], "dependencies": { - "ioredis": "^5.3.2", - "safe-stable-stringify": "^2.4.3", - "warp-contracts": "^1.4.2" + "safe-stable-stringify": "^2.4.3" + }, + "peerDependencies": { + "warp-contracts": "^1.4.2", + "ioredis": "^5.3.2" }, "devDependencies": { "@types/jest": "^28.1.6", diff --git a/src/redisCache.ts b/src/redisCache.ts index b0836d2..81c3aa8 100644 --- a/src/redisCache.ts +++ b/src/redisCache.ts @@ -7,9 +7,10 @@ import stringify from "safe-stable-stringify"; import { luaScripts } from "./luaScripts"; import type { RedisOptions } from "./types/redisCache"; -/** A deleted value placeholder is to differentiate a `null` result that - * may belong to a deleted key or a non-existent key. This is required due to - * SortKeyCache logic. +/** + * A deleted value placeholder is to differentiate a `null` result + * that may belong to a deleted key or a non-existent key. + * This is required due to SortKeyCache logic. */ const DELETED_VALUE_PLACEHOLDER = ""; diff --git a/tsconfig.json b/tsconfig.json index 03f9aee..d68492d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,6 @@ "outDir": "./lib/cjs", "isolatedModules": false, "esModuleInterop": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "baseUrl": "./src",