From be59d070a10169413924ba3d740cbae779f32392 Mon Sep 17 00:00:00 2001 From: Dan Caragea Date: Tue, 20 Mar 2018 15:34:02 +0200 Subject: [PATCH 1/3] Make eslint aware of the custom import paths By default eslint doesn't know what `src/Renderer` means in the following import: `import { Renderer } from 'src/Renderer';` This changes makes it aware that `src/Renderer` means `/src/Renderer.js` --- .eslintrc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index dadfb1f0433..e6975951f06 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,13 @@ module.exports = { "browser": true, "commonjs": true }, + "settings": { + "import/resolver": { + "node": { + "moduleDirectory": ["node_modules", "./"] + } + } + }, "extends": "standard", "globals": { "$$PREBID_GLOBAL$$": false From 7f0cbdb2c5642018c31ad1c6025c9a63b017d114 Mon Sep 17 00:00:00 2001 From: Dan Caragea Date: Sat, 14 Apr 2018 07:25:25 +0300 Subject: [PATCH 2/3] fix: fix import paths in sonobiBidAdapter.js --- modules/sonobiBidAdapter.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 4db35807edd..170228dde7a 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -1,6 +1,5 @@ import { registerBidder } from 'src/adapters/bidderFactory'; -import { getTopWindowLocation, parseSizesInput } from 'src/utils'; -import * as utils from '../src/utils'; +import * as utils from 'src/utils'; import { BANNER, VIDEO } from '../src/mediaTypes'; import find from 'core-js/library/fn/array/find'; @@ -47,7 +46,7 @@ export const spec = { const payload = { 'key_maker': JSON.stringify(data), - 'ref': getTopWindowLocation().host, + 'ref': utils.getTopWindowLocation().host, 's': utils.generateUUID(), 'pv': PAGEVIEW_ID, }; @@ -139,9 +138,9 @@ export const spec = { function _validateSize (bid) { if (bid.params.sizes) { - return parseSizesInput(bid.params.sizes).join(','); + return utils.parseSizesInput(bid.params.sizes).join(','); } - return parseSizesInput(bid.sizes).join(','); + return utils.parseSizesInput(bid.sizes).join(','); } function _validateSlot (bid) { @@ -162,12 +161,12 @@ const _creative = (mediaType) => (sbi_dc, sbi_aid) => { if (mediaType === 'video') { return _videoCreative(sbi_dc, sbi_aid) } - const src = 'https://' + sbi_dc + 'apex.go.sonobi.com/sbi.js?aid=' + sbi_aid + '&as=null' + '&ref=' + getTopWindowLocation().host; + const src = 'https://' + sbi_dc + 'apex.go.sonobi.com/sbi.js?aid=' + sbi_aid + '&as=null' + '&ref=' + utils.getTopWindowLocation().host; return ''; } function _videoCreative(sbi_dc, sbi_aid) { - return `https://${sbi_dc}apex.go.sonobi.com/vast.xml?vid=${sbi_aid}&ref=${getTopWindowLocation().host}` + return `https://${sbi_dc}apex.go.sonobi.com/vast.xml?vid=${sbi_aid}&ref=${utils.getTopWindowLocation().host}` } function _getBidIdFromTrinityKey (key) { From 9d565890571780fd89ad70bd6a6138ba044db62a Mon Sep 17 00:00:00 2001 From: Dan Caragea Date: Sat, 14 Apr 2018 07:52:27 +0300 Subject: [PATCH 3/3] fix: imports in bidderFactory.js --- src/adapters/bidderFactory.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/adapters/bidderFactory.js b/src/adapters/bidderFactory.js index 2cf0a8f7253..7540a3a3398 100644 --- a/src/adapters/bidderFactory.js +++ b/src/adapters/bidderFactory.js @@ -2,7 +2,6 @@ import Adapter from 'src/adapter'; import adaptermanager from 'src/adaptermanager'; import { config } from 'src/config'; import bidfactory from 'src/bidfactory'; -import { STATUS } from 'src/constants'; import { userSync } from 'src/userSync'; import { nativeBidIsValid } from 'src/native'; import { isValidVideoBid } from 'src/video'; @@ -304,7 +303,7 @@ export function newBidder(spec) { function addBidUsingRequestMap(bid) { const bidRequest = bidRequestMap[bid.requestId]; if (bidRequest) { - const prebidBid = Object.assign(bidfactory.createBid(STATUS.GOOD, bidRequest), bid); + const prebidBid = Object.assign(bidfactory.createBid(CONSTANTS.STATUS.GOOD, bidRequest), bid); addBidWithCode(bidRequest.adUnitCode, prebidBid); } else { logWarn(`Bidder ${spec.code} made bid for unknown request ID: ${bid.requestId}. Ignoring.`);