diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..eb5b7ff --- /dev/null +++ b/.npmignore @@ -0,0 +1,2 @@ +src/ +test/ \ No newline at end of file diff --git a/README.md b/README.md index 8682378..bb027aa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SuperJWT -![npm version](https://img.shields.io/badge/npm-0.0.7-brightgreen) +![npm version](https://img.shields.io/badge/npm-0.0.9-brightgreen) Super-JWT is a Node.js package that helps authenticate users based on Superfluid streams using JSON Web Tokens (JWT). @@ -9,7 +9,7 @@ Super-JWT is a Node.js package that helps authenticate users based on Superfluid To install Super-JWT, use npm: ```shell -npm install super-jwt +npm install super-jwt@latest ``` ## Usage @@ -119,11 +119,17 @@ type Chain = To publish a new version of the package to npm, run the following command: ```shell +npm run build + npm publish ``` ### Change Log +#### 0.0.9 + +- Omit source and test files when publishing to npm to reduce package size. + #### 0.0.7 - Added more chains to the supported chains list. see [supported chains](#supported-chains) for more information. diff --git a/package.json b/package.json index 844c4f9..1333bec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "super-jwt", - "version": "0.0.7", + "version": "0.0.9", "description": "Super-JWT helps to authenticate your users based on Superfluid streams using JSON Web Tokens (JWT)", "author": "Salman Dabbakuti", "license": "MIT", diff --git a/src/index.ts b/src/index.ts index 16842c9..14ebbdb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -102,7 +102,7 @@ export async function authenticateWithStream( ): Promise { const requiredParams = ["chain", "sender", "receiver", "token"]; - if (!requiredParams.every((param) => param in streamPayload)) { + if (!requiredParams.every((param) => streamPayload.hasOwnProperty(param))) { throw new Error( "super-jwt: Missing required stream payload params: chain, sender, receiver, token" ); diff --git a/tsconfig.json b/tsconfig.json index 5acf119..7321e31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,6 @@ "include": ["src"], "exclude": ["./test/", "./node_modules/", "./dist/"], "compilerOptions": { - "allowImportingTsExtensions": true, "target": "es5", "module": "commonjs", "importHelpers": true, @@ -12,7 +11,7 @@ // output .js.map sourcemap files for consumers "sourceMap": true, // match output dir to input dir. e.g. dist/index instead of dist/src/index - "rootDir": "./src", + "rootDir": "src", "outDir": "dist", // stricter type-checking for stronger correctness. Recommended by TS "strict": true, @@ -31,7 +30,6 @@ // error out if import and file system have a casing mismatch. Recommended by TS "forceConsistentCasingInFileNames": true, // `tsdx build` ignores this option, but it is commonly used when type-checking separately with `tsc` - "noEmit": false, - "emitDeclarationOnly": true + "noEmit": false } }