Skip to content

Commit

Permalink
Merge branch 'master' of github.com:prebid/Prebid.js
Browse files Browse the repository at this point in the history
  • Loading branch information
uditalias committed Jun 8, 2020
2 parents 84df14e + 461fea9 commit bdeebe4
Show file tree
Hide file tree
Showing 407 changed files with 42,426 additions and 16,914 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aliases:
- &environment
docker:
# specify the version you desire here
- image: circleci/node:8.9.0
- image: circleci/node:12.16.1

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -92,3 +92,6 @@ workflows:
- master
jobs:
- e2etest

experimental:
pipelines: true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.9
12.16.1
13 changes: 9 additions & 4 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,16 @@ For modules and core platform updates, the initial reviewer should request an ad

## Ticket Coordinator

Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. That person should:
Each week, Prebid Org assigns one person to keep an eye on incoming issues and PRs. Every Monday morning a reminder is
sent to the prebid-js slack channel with a link to the spreadsheet. If you're on rotation, please check that list each
Monday to see if you're on-duty.

When on-duty:
- Review issues and PRs at least once per weekday for new items. Encourage a 48 "SLA" on PRs/issues assigned. Aim for touchpoint once every 48/hours.
- For PRs: assign PRs to individuals on the PR review list. Try to be equitable -- not all PRs are created equally. Use the "Assigned" field and add the "Needs Review" label.
- For PRs: assign PRs to individuals on the **PR review list**. Try to be equitable -- not all PRs are created equally. Use the "Assigned" field and add the "Needs Review" label.
- For Issues: try to address questions and troubleshooting requests on your own, assigning them to others as needed. Please add labels as appropriate (I.E. bug, question, backlog etc).
- Issues that are questions or troubleshooting requests may be closed if the originator doesn't respond within a week to requests for confirmation or details.
- Issues that are bug reports should be left open and assigned to someone in PR rotation to confirm or deny the bug status.
- It's polite to check with others before assigning them large tasks.
- If possible, check in on older items and see if they can be unstuck.
- It's polite to check with others before assigning them extra-large tasks.
- If possible, check in on older PRs and Issues and see if they can be unstuck.
- Perform the weekly Prebid.js release per instructions at https://github.com/prebid/Prebid.js/blob/master/RELEASE_SCHEDULE.md . This generally takes place on Tues or Weds.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ prebid.requestBids({
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 8.9.x or greater installed.
*Note:* You need to have `NodeJS` 12.16.1 or greater installed.

*Note:* In the 1.24.0 release of Prebid.js we have transitioned to using gulp 4.0 from using gulp 3.9.1. To comply with gulp's recommended setup for 4.0, you'll need to have `gulp-cli` installed globally prior to running the general `npm install`. This shouldn't impact any other projects you may work on that use an earlier version of gulp in its setup.

Expand Down
12 changes: 6 additions & 6 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

const sharedWhiteList = [
'core-js/library/fn/array/find', // no ie11
'core-js/library/fn/array/includes', // no ie11
'core-js/library/fn/set', // ie11 supports Set but not Set#values
'core-js/library/fn/string/includes', // no ie11
'core-js/library/fn/number/is-integer', // no ie11,
'core-js/library/fn/array/from' // no ie11
'core-js-pure/features/array/find', // no ie11
'core-js-pure/features/array/includes', // no ie11
'core-js-pure/features/set', // ie11 supports Set but not Set#values
'core-js-pure/features/string/includes', // no ie11
'core-js-pure/features/number/is-integer', // no ie11,
'core-js-pure/features/array/from' // no ie11
];

module.exports = {
Expand Down
4 changes: 3 additions & 1 deletion gulpHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ module.exports = {
if (fs.lstatSync(modulePath).isDirectory()) {
modulePath = path.join(modulePath, 'index.js')
}
memo[modulePath] = moduleName;
if (fs.existsSync(modulePath)) {
memo[modulePath] = moduleName;
}
return memo;
}, {});
} catch (err) {
Expand Down
47 changes: 33 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
'use strict';

var _ = require('lodash');
Expand Down Expand Up @@ -32,8 +33,8 @@ var prebid = require('./package.json');
var dateString = 'Updated : ' + (new Date()).toISOString().substring(0, 10);
var banner = '/* <%= prebid.name %> v<%= prebid.version %>\n' + dateString + ' */\n';
var port = 9999;
const mockServerPort = 4444;
const host = argv.host ? argv.host : 'localhost';
const FAKE_SERVER_HOST = argv.host ? argv.host : 'localhost';
const FAKE_SERVER_PORT = 4444;
const { spawn } = require('child_process');

// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
Expand Down Expand Up @@ -238,25 +239,25 @@ function test(done) {
];
}

//run mock-server
const mockServer = spawn('node', ['./test/mock-server/index.js', '--port=' + mockServerPort]);
mockServer.stdout.on('data', (data) => {
// run fake-server
const fakeServer = spawn('node', ['./test/fake-server/index.js', `--port=${FAKE_SERVER_PORT}`]);
fakeServer.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
mockServer.stderr.on('data', (data) => {
fakeServer.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});

execa(wdioCmd, wdioOpts, { stdio: 'inherit' })
.then(stdout => {
// kill mock server
mockServer.kill('SIGINT');
// kill fake server
fakeServer.kill('SIGINT');
done();
process.exit(0);
})
.catch(err => {
// kill mock server
mockServer.kill('SIGINT');
// kill fake server
fakeServer.kill('SIGINT');
done(new Error(`Tests failed with error: ${err}`));
process.exit(1);
});
Expand Down Expand Up @@ -326,11 +327,27 @@ function setupE2e(done) {
done();
}

gulp.task('updatepath', function () {
function injectFakeServerEndpoint() {
return gulp.src(['build/dist/*.js'])
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', 'http://' + host + ':' + mockServerPort + '/'))
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', `http://${FAKE_SERVER_HOST}:${FAKE_SERVER_PORT}`))
.pipe(gulp.dest('build/dist'));
});
}

function injectFakeServerEndpointDev() {
return gulp.src(['build/dev/*.js'])
.pipe(replace('https://ib.adnxs.com/ut/v3/prebid', `http://${FAKE_SERVER_HOST}:${FAKE_SERVER_PORT}`))
.pipe(gulp.dest('build/dev'));
}

function startFakeServer() {
const fakeServer = spawn('node', ['./test/fake-server/index.js', `--port=${FAKE_SERVER_PORT}`]);
fakeServer.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
fakeServer.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
}

// support tasks
gulp.task(lint);
Expand All @@ -355,9 +372,11 @@ gulp.task('build', gulp.series(clean, 'build-bundle-prod'));
gulp.task('build-postbid', gulp.series(escapePostbidConfig, buildPostbid));

gulp.task('serve', gulp.series(clean, lint, gulp.parallel('build-bundle-dev', watch, test)));
gulp.task('serve-fake', gulp.series(clean, gulp.parallel('build-bundle-dev', watch), injectFakeServerEndpointDev, test, startFakeServer));

gulp.task('default', gulp.series(clean, makeWebpackPkg));

gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-prod', watch), 'updatepath', test));
gulp.task('e2e-test', gulp.series(clean, setupE2e, gulp.parallel('build-bundle-prod', watch), injectFakeServerEndpoint, test));
// other tasks
gulp.task(bundleToStdout);
gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<!-- Test page for Size Mapping V2 module. Don't forget to include that module in the build before you run this page!
Feel free to play around with different settings and configurations for size mapping v2 -->

<!DOCTYPE html>
<html>

Expand All @@ -8,15 +11,16 @@
const FAILSAFE_TIMEOUT = 3300;
const PREBID_TIMEOUT = 1000;

// Example of a multi-format ad unit setup with uses the module `sizeMappingV2.js`.
const adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
mediaTypes: {
banner: {
sizeConfig: [
{ minViewPort: [0, 0], sizes: [] }, // remove if < 750px
{ minViewPort: [750, 0], sizes: [[300, 250], [300, 600]] }, // between 750px and 1199px
{ minViewPort: [1200, 0], sizes: [[970, 90], [728, 90], [300, 250]] }, // between 1200px and 1599px
{ minViewPort: [1600, 0], sizes: [[1000, 300], [970, 90], [728, 90], [300, 250]] } // greater than 1600px
{ minViewPort: [750, 0], sizes: [[300, 250], [300, 600]] }, // between 750px and 1199px, use sizes: [[300, 250], [300, 600]]
{ minViewPort: [1200, 0], sizes: [[970, 90], [728, 90], [300, 250]] }, // between 1200px and 1599px, use sizes: [[970, 90], [728, 90], [300, 250]]
{ minViewPort: [1600, 0], sizes: [[1000, 300], [970, 90], [728, 90], [300, 250]] } // greater than 1600px, use sizes: [[1000, 300], [970, 90], [728, 90], [300, 250]]
]
},
video: {
Expand All @@ -31,9 +35,9 @@
required: true,
sizes: [150, 50]
},

// native media type enters auction only if device width is > 600px
sizeConfig: [
{ minViewPort: [0, 0], active: false },
{ minViewPort: [0, 0], active: false },
{ minViewPort: [600, 0], active: true }
]
}
Expand All @@ -54,12 +58,33 @@
siteId: 70608,
zoneId: 498816
},
// example of a bidder level size config. In the scenario below, bidder 'rubicon' enters auction only if the device width
// is between 850-1200 and it'll only send request for the 'native' media type.
sizeConfig: [
{ minViewPort: [0, 0], relevantMediaTypes: ['none'] },
{ minViewPort: [850, 0], relevantMediaTypes: ['native'] },
{ minViewPort: [1200, 0], relevantMediaTypes: ['none'] }
]
}]
}, {
// Example of an 'Identical Ad Unit' (same 'code' as previous ad unit but different 'mediaTypes' object)
// Ad Unit makes use of the 'labelAll' operator. (the label operators can be applied at the bidder lever as well)
code: 'div-gpt-ad-1460505748561-0',
labelAll: ['tablet'], // Label check fails since labels passed to pbjs.requestBids() equals ['mobile']. This disables the entire ad unit.
mediaTypes: {
banner: {
sizeConfig: [
{ minViewPort: [800, 0], sizes: [[360, 400], [640, 200]] },
{ minViewPort: [1000, 0], sizes: [] }
]
}
},
bids: [{
bidder: 'appnexus',
params: {
placementId: 4232323
}
}]
}];
var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];
Expand All @@ -75,9 +100,11 @@

pbjs.que.push(function () {
pbjs.addAdUnits(adUnits);
pbjs.setConfig({debug: true});
pbjs.requestBids({
bidsBackHandler: sendAdserverRequest,
timeout: PREBID_TIMEOUT
timeout: PREBID_TIMEOUT,
labels: ['mobile']
});
});

Expand Down
83 changes: 0 additions & 83 deletions integrationExamples/gpt/audienceNetwork_dfp.html

This file was deleted.

9 changes: 9 additions & 0 deletions integrationExamples/gpt/digitrust_Simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@
}
else {
console.error('Digitrust init failed');
if(digiTrustResult.err){
console.error(digiTrustResult.err);
}
}
}
},
Expand All @@ -157,6 +160,12 @@
expires: 60
}
}]
},
userIdTargeting: {
"GAM": true,
"GAM_KEYS": {
"tdid": "TTD_ID" // send tdid as TTD_ID
}
}
});
pbjs.addAdUnits(adUnits);
Expand Down
2 changes: 1 addition & 1 deletion integrationExamples/gpt/revcontent_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
apiKey: '8a33fa9cf220ae685dcc3544f847cdda858d3b1c',
userId: 673,
domain: 'test.com',
endpoint: 'trends-s0.revcontent.com'
endpoint: 'trends.revcontent.com'
}
}]
}];
Expand Down
4 changes: 1 addition & 3 deletions integrationExamples/gpt/x-domain/creative.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
var urlParser = document.createElement('a');
urlParser.href = '%%PATTERN:url%%';
var publisherDomain = urlParser.protocol + '//' + urlParser.hostname;
var adServerDomain = windowLocation.protocol + '//tpc.googlesyndication.com';

function renderAd(ev) {
var key = ev.message ? 'message' : 'data';
Expand Down Expand Up @@ -58,8 +57,7 @@
function requestAdFromPrebid() {
var message = JSON.stringify({
message: 'Prebid Request',
adId: '%%PATTERN:hb_adid%%',
adServerDomain: adServerDomain
adId: '%%PATTERN:hb_adid%%'
});
window.parent.postMessage(message, publisherDomain);
}
Expand Down
Loading

0 comments on commit bdeebe4

Please sign in to comment.