From a3b701cb88a4adaebb915fcd8fde2cacf1e9283b Mon Sep 17 00:00:00 2001 From: x-ror <16686943+x-ror@users.noreply.github.com> Date: Wed, 16 Dec 2020 00:28:02 +0200 Subject: [PATCH] back to common --- dist/index.cjs | 2 ++ dist/{modern.js.map => index.cjs.map} | 2 +- dist/index.js | 2 -- dist/index.js.map | 1 - dist/modern.js | 2 -- package.json | 6 +++--- rollup.config.js | 7 +------ tsconfig.json | 2 +- 8 files changed, 8 insertions(+), 16 deletions(-) create mode 100644 dist/index.cjs rename dist/{modern.js.map => index.cjs.map} (86%) delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 dist/modern.js diff --git a/dist/index.cjs b/dist/index.cjs new file mode 100644 index 0000000..eae11f3 --- /dev/null +++ b/dist/index.cjs @@ -0,0 +1,2 @@ +"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("node-fetch"),e=require("passport-oauth2");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=r(t),i=r(e);class o extends i.default{constructor(t,e){super({...t,authorizationURL:"https://id.twitch.tv/oauth2/authorize",tokenURL:"https://id.twitch.tv/oauth2/token"},e),this.name="twitch",this.clientID=t.clientID,this._oauth2.setAuthMethod("Bearer"),this._oauth2.useAuthorizationHeaderforGET(!0)}userProfile(t,e){return a.default("https://api.twitch.tv/helix/users",{method:"GET",headers:{"Client-ID":this.clientID,Accept:"application/vnd.twitchtv.v5+json",Authorization:"Bearer "+t}}).then(t=>{if(t.ok)return t.json();throw new i.default.InternalOAuthError("failed to fetch user profile",t)}).then(t=>{const r=t.data[0];return r.provider="twitch",r.display_name&&(r.displayName=r.display_name,delete r.display_name),e(null,r)}).catch(t=>e(t,null))}authenticate(t,e){super.authenticate(t,e)}authorizationParams(t){return{force_verify:"boolean"==typeof t.forceVerify&&t.forceVerify}}}const n=o;exports.OAuth2Strategy=n,exports.Strategy=o; +//# sourceMappingURL=index.cjs.map diff --git a/dist/modern.js.map b/dist/index.cjs.map similarity index 86% rename from dist/modern.js.map rename to dist/index.cjs.map index 55ae63c..f0dc392 100644 --- a/dist/modern.js.map +++ b/dist/index.cjs.map @@ -1 +1 @@ -{"version":3,"file":"modern.js","sources":["../src/twitch-strategy.ts","../src/index.ts"],"sourcesContent":["import fetch from \"node-fetch\";\r\nimport OAuth2Strategy from \"passport-oauth2\";\r\n\r\ninterface Options {\r\n clientID: string;\r\n clientSecret: string;\r\n callbackURL: string;\r\n scope: string;\r\n}\r\n\r\nexport class Strategy extends OAuth2Strategy {\r\n private clientID: string;\r\n public name: string;\r\n /**\r\n * `Strategy` constructor.\r\n *\r\n * The Twitch authentication strategy authenticates requests by delegating to\r\n * Twitch using the OAuth 2.0 protocol.\r\n *\r\n * Applications must supply a `verify` callback which accepts an `accessToken`,\r\n * `refreshToken` and service-specific `profile`, and then calls the `done`\r\n * callback supplying a `user`, which should be set to `false` if the\r\n * credentials are not valid. If an exception occured, `err` should be set.\r\n *\r\n * Options:\r\n * - `clientID` your Twitch application\"s client id\r\n * - `clientSecret` your Twitch application\"s client secret\r\n * - `callbackURL` URL to which Twitch will redirect the user after granting authorization\r\n *\r\n * Examples:\r\n *\r\n * passport.use(new TwitchStrategy({\r\n * clientID: \"123-456-789\",\r\n * clientSecret: \"shhh-its-a-secret\"\r\n * callbackURL: \"https://www.example.net/auth/twitch/callback\"\r\n * },\r\n * function(accessToken, refreshToken, profile, done) {\r\n * User.findOrCreate(..., function (err, user) {\r\n * done(err, user);\r\n * });\r\n * }\r\n * ));\r\n *\r\n * @param {Options} options\r\n * @param {Function} verify\r\n */\r\n constructor(options: Options, verify: Function) {\r\n const params: OAuth2Strategy._StrategyOptionsBase = {\r\n ...options,\r\n authorizationURL: 'https://id.twitch.tv/oauth2/authorize',\r\n tokenURL: 'https://id.twitch.tv/oauth2/token'\r\n }\r\n super(params, verify as OAuth2Strategy.VerifyFunction | OAuth2Strategy.VerifyFunctionWithRequest);\r\n this.name = 'twitch';\r\n this.clientID = options.clientID;\r\n this._oauth2.setAuthMethod('Bearer');\r\n this._oauth2.useAuthorizationHeaderforGET(true);\r\n }\r\n\r\n /**\r\n * Retrieve user profile from Twitch.\r\n * This function constructs a normalized profile, with the following properties:\r\n * - `provider` always set to `twitch`\r\n * - `id`\r\n * - `login`\r\n * - `displayName`\r\n * @param {String} accessToken\r\n * @param {Function} done\r\n * @api protected\r\n */\r\n userProfile(accessToken: string, done: (err?: Error | null, profile?: any) => void) {\r\n return fetch('https://api.twitch.tv/helix/users', {\r\n method: 'GET',\r\n headers: {\r\n 'Client-ID': this.clientID,\r\n 'Accept': 'application/vnd.twitchtv.v5+json',\r\n 'Authorization': 'Bearer ' + accessToken\r\n }\r\n }).then(response => {\r\n if (!response.ok) throw new OAuth2Strategy.InternalOAuthError(\"failed to fetch user profile\", response);\r\n else return response.json();\r\n }).then(json => {\r\n const body = json.data[0];\r\n body.provider = 'twitch';\r\n if (body.display_name) {\r\n body.displayName = body.display_name;\r\n delete body.display_name;\r\n }\r\n return done(null, body);\r\n }).catch(error => {\r\n return done(error, null);\r\n });\r\n }\r\n\r\n authenticate(req: any, args?: any): void {\r\n super.authenticate(req, args);\r\n }\r\n\r\n /**\r\n * Return extra parameters to be included in the authorization request.\r\n * @param {{ forceVerify?: boolean }} options\r\n * @return {Object}\r\n * @api protected\r\n */\r\n authorizationParams(options: { forceVerify?: boolean }): object {\r\n return {\r\n force_verify: (typeof options.forceVerify !== 'boolean') ? false : options.forceVerify\r\n };\r\n }\r\n}\r\n\r\nexport default Strategy;","import { Strategy } from './twitch-strategy';\r\n\r\nconst OAuth2Strategy = Strategy;\r\nexport { Strategy, OAuth2Strategy };"],"names":["Strategy","OAuth2Strategy","[object Object]","options","verify","super","authorizationURL","tokenURL","this","name","clientID","_oauth2","setAuthMethod","useAuthorizationHeaderforGET","accessToken","done","fetch","method","headers","Client-ID","Accept","Authorization","then","response","ok","json","InternalOAuthError","body","data","provider","display_name","displayName","catch","error","req","args","authenticate","force_verify","forceVerify"],"mappings":"+DAUaA,UAAiBC,EAoC1BC,YAAYC,EAAkBC,GAM1BC,qCAJOF,IACHG,iBAAkB,wCAClBC,SAAU,sCAEAH,GACdI,KAAKC,KAAO,SACZD,KAAKE,SAAWP,EAAQO,SACxBF,KAAKG,QAAQC,cAAc,UAC3BJ,KAAKG,QAAQE,8BAA6B,GAc9CX,YAAYY,EAAqBC,GAC7B,OAAOC,EAAM,oCAAqC,CAC9CC,OAAQ,MACRC,QAAS,CACLC,YAAaX,KAAKE,SAClBU,OAAU,mCACVC,cAAiB,UAAYP,KAElCQ,KAAKC,IACJ,GAAKA,EAASC,GACT,OAAOD,EAASE,OADH,MAAM,IAAIxB,EAAeyB,mBAAmB,+BAAgCH,KAE/FD,KAAKG,IACJ,MAAME,EAAOF,EAAKG,KAAK,GAMvB,OALAD,EAAKE,SAAW,SACZF,EAAKG,eACLH,EAAKI,YAAcJ,EAAKG,oBACjBH,EAAKG,cAETf,EAAK,KAAMY,KACnBK,MAAMC,GACElB,EAAKkB,EAAO,OAI3B/B,aAAagC,EAAUC,GACnB9B,MAAM+B,aAAaF,EAAKC,GAS5BjC,oBAAoBC,GAChB,MAAO,CACHkC,aAA8C,kBAAxBlC,EAAQmC,aAAqCnC,EAAQmC,oBCxGjFrC,EAAiBD"} \ No newline at end of file +{"version":3,"file":"index.cjs","sources":["../src/twitch-strategy.ts","../src/index.ts"],"sourcesContent":["import fetch from \"node-fetch\";\r\nimport OAuth2Strategy from \"passport-oauth2\";\r\n\r\ninterface Options {\r\n clientID: string;\r\n clientSecret: string;\r\n callbackURL: string;\r\n scope: string;\r\n}\r\n\r\nexport class Strategy extends OAuth2Strategy {\r\n private clientID: string;\r\n public name: string;\r\n /**\r\n * `Strategy` constructor.\r\n *\r\n * The Twitch authentication strategy authenticates requests by delegating to\r\n * Twitch using the OAuth 2.0 protocol.\r\n *\r\n * Applications must supply a `verify` callback which accepts an `accessToken`,\r\n * `refreshToken` and service-specific `profile`, and then calls the `done`\r\n * callback supplying a `user`, which should be set to `false` if the\r\n * credentials are not valid. If an exception occured, `err` should be set.\r\n *\r\n * Options:\r\n * - `clientID` your Twitch application\"s client id\r\n * - `clientSecret` your Twitch application\"s client secret\r\n * - `callbackURL` URL to which Twitch will redirect the user after granting authorization\r\n *\r\n * Examples:\r\n *\r\n * passport.use(new TwitchStrategy({\r\n * clientID: \"123-456-789\",\r\n * clientSecret: \"shhh-its-a-secret\"\r\n * callbackURL: \"https://www.example.net/auth/twitch/callback\"\r\n * },\r\n * function(accessToken, refreshToken, profile, done) {\r\n * User.findOrCreate(..., function (err, user) {\r\n * done(err, user);\r\n * });\r\n * }\r\n * ));\r\n *\r\n * @param {Options} options\r\n * @param {Function} verify\r\n */\r\n constructor(options: Options, verify: Function) {\r\n const params: OAuth2Strategy._StrategyOptionsBase = {\r\n ...options,\r\n authorizationURL: 'https://id.twitch.tv/oauth2/authorize',\r\n tokenURL: 'https://id.twitch.tv/oauth2/token'\r\n }\r\n super(params, verify as OAuth2Strategy.VerifyFunction | OAuth2Strategy.VerifyFunctionWithRequest);\r\n this.name = 'twitch';\r\n this.clientID = options.clientID;\r\n this._oauth2.setAuthMethod('Bearer');\r\n this._oauth2.useAuthorizationHeaderforGET(true);\r\n }\r\n\r\n /**\r\n * Retrieve user profile from Twitch.\r\n * This function constructs a normalized profile, with the following properties:\r\n * - `provider` always set to `twitch`\r\n * - `id`\r\n * - `login`\r\n * - `displayName`\r\n * @param {String} accessToken\r\n * @param {Function} done\r\n * @api protected\r\n */\r\n userProfile(accessToken: string, done: (err?: Error | null, profile?: any) => void) {\r\n return fetch('https://api.twitch.tv/helix/users', {\r\n method: 'GET',\r\n headers: {\r\n 'Client-ID': this.clientID,\r\n 'Accept': 'application/vnd.twitchtv.v5+json',\r\n 'Authorization': 'Bearer ' + accessToken\r\n }\r\n }).then(response => {\r\n if (!response.ok) throw new OAuth2Strategy.InternalOAuthError(\"failed to fetch user profile\", response);\r\n else return response.json();\r\n }).then(json => {\r\n const body = json.data[0];\r\n body.provider = 'twitch';\r\n if (body.display_name) {\r\n body.displayName = body.display_name;\r\n delete body.display_name;\r\n }\r\n return done(null, body);\r\n }).catch(error => {\r\n return done(error, null);\r\n });\r\n }\r\n\r\n authenticate(req: any, args?: any): void {\r\n super.authenticate(req, args);\r\n }\r\n\r\n /**\r\n * Return extra parameters to be included in the authorization request.\r\n * @param {{ forceVerify?: boolean }} options\r\n * @return {Object}\r\n * @api protected\r\n */\r\n authorizationParams(options: { forceVerify?: boolean }): object {\r\n return {\r\n force_verify: (typeof options.forceVerify !== 'boolean') ? false : options.forceVerify\r\n };\r\n }\r\n}\r\n\r\nexport default Strategy;","import { Strategy } from './twitch-strategy';\r\n\r\nconst OAuth2Strategy = Strategy;\r\nexport { Strategy, OAuth2Strategy };"],"names":["Strategy","OAuth2Strategy","[object Object]","options","verify","super","authorizationURL","tokenURL","this","name","clientID","_oauth2","setAuthMethod","useAuthorizationHeaderforGET","accessToken","done","fetch","method","headers","Client-ID","Accept","Authorization","then","response","ok","json","InternalOAuthError","body","data","provider","display_name","displayName","catch","error","req","args","authenticate","force_verify","forceVerify"],"mappings":"6NAUaA,UAAiBC,UAoC1BC,YAAYC,EAAkBC,GAM1BC,MALoD,IAC7CF,EACHG,iBAAkB,wCAClBC,SAAU,qCAEAH,GACdI,KAAKC,KAAO,SACZD,KAAKE,SAAWP,EAAQO,SACxBF,KAAKG,QAAQC,cAAc,UAC3BJ,KAAKG,QAAQE,8BAA6B,GAc9CX,YAAYY,EAAqBC,GAC7B,OAAOC,UAAM,oCAAqC,CAC9CC,OAAQ,MACRC,QAAS,CACLC,YAAaX,KAAKE,SAClBU,OAAU,mCACVC,cAAiB,UAAYP,KAElCQ,KAAKC,IACJ,GAAKA,EAASC,GACT,OAAOD,EAASE,OADH,MAAM,IAAIxB,UAAeyB,mBAAmB,+BAAgCH,KAE/FD,KAAKG,IACJ,MAAME,EAAOF,EAAKG,KAAK,GAMvB,OALAD,EAAKE,SAAW,SACZF,EAAKG,eACLH,EAAKI,YAAcJ,EAAKG,oBACjBH,EAAKG,cAETf,EAAK,KAAMY,KACnBK,MAAMC,GACElB,EAAKkB,EAAO,OAI3B/B,aAAagC,EAAUC,GACnB9B,MAAM+B,aAAaF,EAAKC,GAS5BjC,oBAAoBC,GAChB,MAAO,CACHkC,aAA8C,kBAAxBlC,EAAQmC,aAAqCnC,EAAQmC,oBCxGjFrC,EAAiBD"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index c6c0044..0000000 --- a/dist/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("node-fetch"),e=require("passport-oauth2");function r(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=r(t),i=r(e);class o extends i.default{constructor(t,e){super(Object.assign(Object.assign({},t),{authorizationURL:"https://id.twitch.tv/oauth2/authorize",tokenURL:"https://id.twitch.tv/oauth2/token"}),e),this.name="twitch",this.clientID=t.clientID,this._oauth2.setAuthMethod("Bearer"),this._oauth2.useAuthorizationHeaderforGET(!0)}userProfile(t,e){return a.default("https://api.twitch.tv/helix/users",{method:"GET",headers:{"Client-ID":this.clientID,Accept:"application/vnd.twitchtv.v5+json",Authorization:"Bearer "+t}}).then(t=>{if(t.ok)return t.json();throw new i.default.InternalOAuthError("failed to fetch user profile",t)}).then(t=>{const r=t.data[0];return r.provider="twitch",r.display_name&&(r.displayName=r.display_name,delete r.display_name),e(null,r)}).catch(t=>e(t,null))}authenticate(t,e){super.authenticate(t,e)}authorizationParams(t){return{force_verify:"boolean"==typeof t.forceVerify&&t.forceVerify}}}const n=o;exports.OAuth2Strategy=n,exports.Strategy=o; -//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f030b84..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sources":["../src/twitch-strategy.ts","../src/index.ts"],"sourcesContent":["import fetch from \"node-fetch\";\r\nimport OAuth2Strategy from \"passport-oauth2\";\r\n\r\ninterface Options {\r\n clientID: string;\r\n clientSecret: string;\r\n callbackURL: string;\r\n scope: string;\r\n}\r\n\r\nexport class Strategy extends OAuth2Strategy {\r\n private clientID: string;\r\n public name: string;\r\n /**\r\n * `Strategy` constructor.\r\n *\r\n * The Twitch authentication strategy authenticates requests by delegating to\r\n * Twitch using the OAuth 2.0 protocol.\r\n *\r\n * Applications must supply a `verify` callback which accepts an `accessToken`,\r\n * `refreshToken` and service-specific `profile`, and then calls the `done`\r\n * callback supplying a `user`, which should be set to `false` if the\r\n * credentials are not valid. If an exception occured, `err` should be set.\r\n *\r\n * Options:\r\n * - `clientID` your Twitch application\"s client id\r\n * - `clientSecret` your Twitch application\"s client secret\r\n * - `callbackURL` URL to which Twitch will redirect the user after granting authorization\r\n *\r\n * Examples:\r\n *\r\n * passport.use(new TwitchStrategy({\r\n * clientID: \"123-456-789\",\r\n * clientSecret: \"shhh-its-a-secret\"\r\n * callbackURL: \"https://www.example.net/auth/twitch/callback\"\r\n * },\r\n * function(accessToken, refreshToken, profile, done) {\r\n * User.findOrCreate(..., function (err, user) {\r\n * done(err, user);\r\n * });\r\n * }\r\n * ));\r\n *\r\n * @param {Options} options\r\n * @param {Function} verify\r\n */\r\n constructor(options: Options, verify: Function) {\r\n const params: OAuth2Strategy._StrategyOptionsBase = {\r\n ...options,\r\n authorizationURL: 'https://id.twitch.tv/oauth2/authorize',\r\n tokenURL: 'https://id.twitch.tv/oauth2/token'\r\n }\r\n super(params, verify as OAuth2Strategy.VerifyFunction | OAuth2Strategy.VerifyFunctionWithRequest);\r\n this.name = 'twitch';\r\n this.clientID = options.clientID;\r\n this._oauth2.setAuthMethod('Bearer');\r\n this._oauth2.useAuthorizationHeaderforGET(true);\r\n }\r\n\r\n /**\r\n * Retrieve user profile from Twitch.\r\n * This function constructs a normalized profile, with the following properties:\r\n * - `provider` always set to `twitch`\r\n * - `id`\r\n * - `login`\r\n * - `displayName`\r\n * @param {String} accessToken\r\n * @param {Function} done\r\n * @api protected\r\n */\r\n userProfile(accessToken: string, done: (err?: Error | null, profile?: any) => void) {\r\n return fetch('https://api.twitch.tv/helix/users', {\r\n method: 'GET',\r\n headers: {\r\n 'Client-ID': this.clientID,\r\n 'Accept': 'application/vnd.twitchtv.v5+json',\r\n 'Authorization': 'Bearer ' + accessToken\r\n }\r\n }).then(response => {\r\n if (!response.ok) throw new OAuth2Strategy.InternalOAuthError(\"failed to fetch user profile\", response);\r\n else return response.json();\r\n }).then(json => {\r\n const body = json.data[0];\r\n body.provider = 'twitch';\r\n if (body.display_name) {\r\n body.displayName = body.display_name;\r\n delete body.display_name;\r\n }\r\n return done(null, body);\r\n }).catch(error => {\r\n return done(error, null);\r\n });\r\n }\r\n\r\n authenticate(req: any, args?: any): void {\r\n super.authenticate(req, args);\r\n }\r\n\r\n /**\r\n * Return extra parameters to be included in the authorization request.\r\n * @param {{ forceVerify?: boolean }} options\r\n * @return {Object}\r\n * @api protected\r\n */\r\n authorizationParams(options: { forceVerify?: boolean }): object {\r\n return {\r\n force_verify: (typeof options.forceVerify !== 'boolean') ? false : options.forceVerify\r\n };\r\n }\r\n}\r\n\r\nexport default Strategy;","import { Strategy } from './twitch-strategy';\r\n\r\nconst OAuth2Strategy = Strategy;\r\nexport { Strategy, OAuth2Strategy };"],"names":["Strategy","OAuth2Strategy","[object Object]","options","verify","super","authorizationURL","tokenURL","this","name","clientID","_oauth2","setAuthMethod","useAuthorizationHeaderforGET","accessToken","done","fetch","method","headers","Client-ID","Accept","Authorization","then","response","ok","json","InternalOAuthError","body","data","provider","display_name","displayName","catch","error","req","args","authenticate","force_verify","forceVerify"],"mappings":"6NAUaA,UAAiBC,UAoC1BC,YAAYC,EAAkBC,GAM1BC,qCAJOF,IACHG,iBAAkB,wCAClBC,SAAU,sCAEAH,GACdI,KAAKC,KAAO,SACZD,KAAKE,SAAWP,EAAQO,SACxBF,KAAKG,QAAQC,cAAc,UAC3BJ,KAAKG,QAAQE,8BAA6B,GAc9CX,YAAYY,EAAqBC,GAC7B,OAAOC,UAAM,oCAAqC,CAC9CC,OAAQ,MACRC,QAAS,CACLC,YAAaX,KAAKE,SAClBU,OAAU,mCACVC,cAAiB,UAAYP,KAElCQ,KAAKC,IACJ,GAAKA,EAASC,GACT,OAAOD,EAASE,OADH,MAAM,IAAIxB,UAAeyB,mBAAmB,+BAAgCH,KAE/FD,KAAKG,IACJ,MAAME,EAAOF,EAAKG,KAAK,GAMvB,OALAD,EAAKE,SAAW,SACZF,EAAKG,eACLH,EAAKI,YAAcJ,EAAKG,oBACjBH,EAAKG,cAETf,EAAK,KAAMY,KACnBK,MAAMC,GACElB,EAAKkB,EAAO,OAI3B/B,aAAagC,EAAUC,GACnB9B,MAAM+B,aAAaF,EAAKC,GAS5BjC,oBAAoBC,GAChB,MAAO,CACHkC,aAA8C,kBAAxBlC,EAAQmC,aAAqCnC,EAAQmC,oBCxGjFrC,EAAiBD"} \ No newline at end of file diff --git a/dist/modern.js b/dist/modern.js deleted file mode 100644 index 954ac79..0000000 --- a/dist/modern.js +++ /dev/null @@ -1,2 +0,0 @@ -import t from"node-fetch";import e from"passport-oauth2";class r extends e{constructor(t,e){super(Object.assign(Object.assign({},t),{authorizationURL:"https://id.twitch.tv/oauth2/authorize",tokenURL:"https://id.twitch.tv/oauth2/token"}),e),this.name="twitch",this.clientID=t.clientID,this._oauth2.setAuthMethod("Bearer"),this._oauth2.useAuthorizationHeaderforGET(!0)}userProfile(r,i){return t("https://api.twitch.tv/helix/users",{method:"GET",headers:{"Client-ID":this.clientID,Accept:"application/vnd.twitchtv.v5+json",Authorization:"Bearer "+r}}).then(t=>{if(t.ok)return t.json();throw new e.InternalOAuthError("failed to fetch user profile",t)}).then(t=>{const e=t.data[0];return e.provider="twitch",e.display_name&&(e.displayName=e.display_name,delete e.display_name),i(null,e)}).catch(t=>i(t,null))}authenticate(t,e){super.authenticate(t,e)}authorizationParams(t){return{force_verify:"boolean"==typeof t.forceVerify&&t.forceVerify}}}const i=r;export{i as OAuth2Strategy,r as Strategy}; -//# sourceMappingURL=modern.js.map diff --git a/package.json b/package.json index 1bba8ed..66382f6 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "passport-twitch-strategy", "version": "2.1.1", - "exports": "./dist/modern.js", - "main": "./dist/index.js", + "main": "./dist/index.cjs", + "description": "Twitch (OAuth) authentication strategies for Passport. v5", "scripts": { "prepublishOnly": "rollup -c" @@ -56,4 +56,4 @@ "publishConfig": { "registry": "https://registry.npmjs.org" } -} +} \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index 49f8805..6464104 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -10,12 +10,7 @@ export default { file: pkg.main, format: 'cjs', sourcemap: true - }, - { - file: pkg.exports, - format: 'es', - sourcemap: true - }, + } ], external: [ ...Object.keys(pkg.dependencies || {}), diff --git a/tsconfig.json b/tsconfig.json index a0345d4..c6a74e9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "lib": [], - "target": "ES2015", + "target": "ES2020", "module": "ESNext", "outDir": "dist", "esModuleInterop": true,