diff --git a/.circleci/config.yml b/.circleci/config.yml
new file mode 100644
index 00000000000..fbf7e77e10f
--- /dev/null
+++ b/.circleci/config.yml
@@ -0,0 +1,50 @@
+# Javascript Node CircleCI 2.0 configuration file
+#
+# Check https://circleci.com/docs/2.0/language-javascript/ for more details
+#
+version: 2
+jobs:
+ build:
+ docker:
+ # specify the version you desire here
+ - image: circleci/node:7.10
+
+ # Specify service dependencies here if necessary
+ # CircleCI maintains a library of pre-built images
+ # documented at https://circleci.com/docs/2.0/circleci-images/
+ # - image: circleci/mongo:3.4.4
+
+ working_directory: ~/Prebid.js
+
+ steps:
+ - checkout
+
+ # Download and cache dependencies
+ - restore_cache:
+ keys:
+ - v1-dependencies-{{ checksum "package.json" }}
+ # fallback to using the latest cache if no exact match is found
+ - v1-dependencies-
+
+ - run: npm install
+
+ - save_cache:
+ paths:
+ - node_modules
+ key: v1-dependencies-{{ checksum "package.json" }}
+
+ - run: sudo npm install -g gulp-cli
+ # Download and run BrowserStack local
+ - run:
+ name : Download BrowserStack Local binary and start it.
+ command : |
+ # Download the browserstack binary file
+ wget "https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
+ # Unzip it
+ unzip BrowserStackLocal-linux-x64.zip
+ # Run the file with user's access key
+ ./BrowserStackLocal ${BROWSERSTACK_ACCESS_KEY} &
+ # run tests!
+ - run:
+ name: BrowserStack testing
+ command: gulp test --browserstack
diff --git a/.eslintrc.js b/.eslintrc.js
index e6975951f06..02ff81614c7 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -26,7 +26,6 @@ module.exports = {
// Violations of these styles should be fixed, and the exceptions removed over time.
//
// See Issue #1111.
- "camelcase": "off",
"eqeqeq": "off",
"no-return-assign": "off",
"no-throw-literal": "off",
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 4501da64c99..00000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-sudo: required
-dist: trusty
-language: node_js
-node_js:
-- '7.0'
-env:
-- BROWSERSTACK_USERNAME=info184
-addons:
- chrome: stable,
- browserstack:
- username: info184
- access_key:
- secure: Ru286R4pMcEIRKwb2AoaaJY6lEKIzeZraxY7CtbOP4ykNk7uqsnyitk4QwxpCCh0n35b71m30okW6ZmZnl0lJXhOMdYoSOYBAnUw2Vn7Y93oMSKIC5dc2/qmtF1t2b1qX65/Ont2iJUj+UY8VQw5Hk2vIT4/5wifYPBnV5ILK4AI7SVk/ma7OzK4rkp3WThlouddctAd7tx4O3YIyJKDi9lkfcMA0pnH4OZSOlDClRLIy50Q1NE+iyqHtWFZK1TwJ+IhQbSsCLbuyQJBRnyJJEftNmtrs5MCZt/9pwFDj7c8+o11F6HCsTBYFkehFRfbKnmhCc1G+bsNXY8OxIWwEHeuVmSGK7TDPYcPPQBc03mcQ1fY/IPNQOdsVJ/n8RsG2u0IU2CF2hhkuNFzeov7dOHljanc45NKOrLdjwzP1aZCAUvLquOTzvmdF23nJhMs8UO+Du4kTK5VfmKyz1MC91E40a0Q15+O4qmS39rNOlwhxPJSfuxxL1jKVPJ7PsFbTkGM8M/XPJ6dyGLufy225HjdLdJTAOa5BZ4st+nXH/AzqHzy6a2I5vTmAz1j4gHLgVU+iNxAkX8znb25s3Rs1ZuFVj+aBSBmNoQA1FA5f/uXWeruTdDig7ksp+XdjsjLm9Md8cWwYaEn04FYj1ztJrylrEMfnc0Kcs6zQ3fll1g=
-before_install:
-- npm install -g gulp
-- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
-script: |-
- if [[ ${TRAVIS_PULL_REQUEST} == "false" ]]; then
- gulp test --browserstack
- else
- gulp run-tests
- fi
-notifications:
- slack:
- on_success: never
- on_failure: always
- on_pull_requests: false
- rooms:
- - secure: C4O77VtABLE5DiPDeKGqUcsBdTBMNjQRLc8iBfSp231e95K1rA/JXJJEQN/lVhhiFJyPhxueE0i6cR0zD8uAMC8HRShGGfPjEZ7f6glawPzap2wFwjAyVkknYV+BMKcX0jvn7CiSKBj+zTbHQfn/Uj3nMSbDZQIdbNDiFGh4NuDr3/Yd/efhsw/miExlSPSWqGVCKV3WPpTrU3BRpLNDq4sZMXP9ORZxGK7ER3tsMiD2z05YpvC+mibESJxaY0qsuQu1y1Gu65QLPe5ocw405btJwqYn+b4YFpUd2GbLNhjtLzsc+OKrD0DWuEI0bxePQUYDga5wR6g4cdZaXU3ixDjee7sJbDeVJAuykGlfZ4A1k+fQIgPs3s9XMHaeG9AfDhFiZ/UoNdonzos1iSa/Y1TzHIXp1wnbHKT5HUWWPFNb5PzJxHEtHbm3jwOH4iK8VAq94ec16M2aqUAj7muiqcrTlYa5rs6jRlXo/TRymFnbQRdBT7eLmLNDQD35yR1Y+4mxHqKi+3189yG9RE+uwIlB+9HZFgNbioOApB+jarKC6M0qEgn0bHxkpJBP8JmNCA84U0ZUzyPvuMGsRbisAmKoUsU8C6cq59QDfBTcCTvKXK6r+6f23iRGieoGSbTxYQj46QkykpbWU0WstQDQsZL3L316uZecOVZmWKBRxPs=
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index dc8d80ec384..7f4127cf3ba 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -55,7 +55,7 @@ When you are adding code to Prebid.js, or modifying code that isn't covered by a
Prebid.js already has many tests. Read them to see how Prebid.js is tested, and for inspiration:
- Look in `test/spec` and its subdirectories
-- Tests for bidder adaptors are located in `test/spec/adapters`
+- Tests for bidder adaptors are located in `test/spec/modules`
A test module might have the following general structure:
diff --git a/PREBID_VERSIONING_DEPRECATION.md b/PREBID_VERSIONING_DEPRECATION.md
new file mode 100644
index 00000000000..f006922259b
--- /dev/null
+++ b/PREBID_VERSIONING_DEPRECATION.md
@@ -0,0 +1,25 @@
+# Prebid versioning and deprecation policy
+
+## Goals
+Provide clear definitions and policy around versioning and breaking changes to APIs that are both publisher and demand partner facing.
+
+ - Limit the number of breaking changes.
+ - Ensure significant time for updates for breaking changes so that publisher or demand partners do not break.
+ - Provide a path to deprecation and reduce technical debt and increase security.
+ - Major versions should not be changed more than once per 30 days.
+
+## Versioning
+
+Follow semantic versioning so that all breaking changes occur within a major release. A breaking change includes both demand partner internal APIs* and publisher facing APIs (global APIs).
+
+*Demand partner APIs may be excluded from breaking change policy at the core teams discretion if the changes are made so to be transparent to the bidders (such as internal refactoring).
+
+## Deprecation process
+
+ - Open an issue with an "intent to implement" and "API impact" labels.
+ - Allow 2 weeks for discussion.
+ - Announce breaking change to the mailing list (TBD needs to be created).
+ - At least 2 core members needs to provide explicit approval for the deprecation.
+ - Open a PR against current master for console warning for possible breakage.
+ - Support the previous major version for a minimum of 30 days.
+ - Coordinate with the core team to ensure clean merging into feature branch if applicable (future major version branch).
diff --git a/PR_REVIEW.md b/PR_REVIEW.md
index 012a2d8b501..d5799472377 100644
--- a/PR_REVIEW.md
+++ b/PR_REVIEW.md
@@ -18,6 +18,7 @@ For modules and core platform updates, the initial reviewer should request an ad
- Once there is 2 `LGTM` on the PR, merge to master
- Ask the submitter to add a PR for documentation if applicable.
- Add a line into the [draft release](https://github.com/prebid/Prebid.js/releases) notes for this submission. If no draft release is available, create one using [this template]( https://gist.github.com/mkendall07/c3af6f4691bed8a46738b3675cb5a479)
+- Add the PR to the appropriate project board (I.E. 1.23.0 Release) for the week, [see](https://github.com/prebid/Prebid.js/projects)
### New Adapter or updates to adapter process
- Follow steps above for general review process. In addition, please verify the following:
@@ -39,9 +40,9 @@ 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:
-- Review issues and PRs at least once per weekday for new items.
+- 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 Issues: try to address questions and troubleshooting requests on your own, assigning them to others as needed.
+- 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.
diff --git a/README.md b/README.md
index 946d6755774..a89f68b8abc 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,10 @@
-[![Build Status](https://travis-ci.org/prebid/Prebid.js.svg?branch=master)](https://travis-ci.org/prebid/Prebid.js)
+[![Build Status](https://circleci.com/gh/prebid/Prebid.js.svg?style=svg)](https://circleci.com/gh/prebid/Prebid.js)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/prebid/Prebid.js.svg)](http://isitmaintained.com/project/prebid/Prebid.js "Percentage of issues still open")
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/prebid/Prebid.js.svg)](http://isitmaintained.com/project/prebid/Prebid.js "Average time to resolve an issue")
[![Code Climate](https://codeclimate.com/github/prebid/Prebid.js/badges/gpa.svg)](https://codeclimate.com/github/prebid/Prebid.js)
[![Coverage Status](https://coveralls.io/repos/github/prebid/Prebid.js/badge.svg)](https://coveralls.io/github/prebid/Prebid.js)
[![devDependencies Status](https://david-dm.org/prebid/Prebid.js/dev-status.svg)](https://david-dm.org/prebid/Prebid.js?type=dev)
+[![Total Alerts](https://img.shields.io/lgtm/alerts/g/prebid/Prebid.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/prebid/Prebid.js/alerts/)
# Prebid.js
@@ -29,6 +30,8 @@ Working examples can be found in [the developer docs](http://prebid.org/dev-docs
$ npm install
*Note:* You need to have `NodeJS` 4.x or greater installed.
+*Note:* Because we have transitioned to using gulp 4.0 - you need to have `gulp-cli` installed globally prior to running the general `npm install`. Run the following command to perform the install: `npm install gulp-cli -g`
+If you have a previous version of `gulp` installed globally, you'll need to remove it before installing `gulp-cli`. This removal can be done with the command: `npm rm gulp -g`
@@ -167,7 +170,7 @@ Many SSPs, bidders, and publishers have contributed to this project. [60+ Bidder
For guidelines, see [Contributing](./CONTRIBUTING.md).
-Our PR review process can be found [here](https://github.com/prebid/Prebid.js/tree/master/pr_review.md).
+Our PR review process can be found [here](https://github.com/prebid/Prebid.js/tree/master/PR_REVIEW.md).
### Add a Bidder Adapter
diff --git a/RELEASE_SCHEDULE.md b/RELEASE_SCHEDULE.md
index efdc45f7f9f..611a98473ff 100644
--- a/RELEASE_SCHEDULE.md
+++ b/RELEASE_SCHEDULE.md
@@ -1,6 +1,7 @@
**Table of Contents**
- [Release Schedule](#release-schedule)
- [Release Process](#release-process)
+- [Beta Releases](#beta-releases)
- [FAQs](#faqs)
## Release Schedule
@@ -16,13 +17,17 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
## Release Process
-1. Make Sure all browserstack tests are passing. On PR merge to master travis will run unit tests on browserstack. Checking the last travis build [here](https://travis-ci.org/prebid/Prebid.js/branches) for master branch will show you detailed results.
+_Note: If `github.com/prebid/Prebid.js` is not configured as the git origin for your repo, all of the following git commands will have to be modified to reference the proper remote (e.g. `upstream`)_
+
+1. Make Sure all browserstack tests are passing. On PR merge to master CircleCI will run unit tests on browserstack. Checking the last CircleCI build [here](https://circleci.com/gh/prebid/Prebid.js) for master branch will show you detailed results.
In case of failure do following,
- Try to fix the failing tests.
- If you are not able to fix tests in time. Skip the test, create issue and tag contributor.
#### How to run tests in browserstack
+
+ _Note: the following browserstack information is only relevant for debugging purposes, if you will not be debugging then it can be skipped._
Set the environment variables. You may want to add these to your `~/.bashrc` for convenience.
@@ -58,11 +63,12 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
Pull these changes locally by running command
```
git pull
+ git fetch --tags
```
and verify the tag.
-5. Update coveralls
+5. Update coveralls _(skip for legacy)_
We use https://coveralls.io/ to show parts of code covered by unit tests.
@@ -74,7 +80,9 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
Run `gulp coveralls` to update code coverage history.
-6. Distribute the code
+6. Distribute the code
+
+ _Note: do not go to step 7 until step 6 has been verified completed._
Reach out to any of the Appnexus folks to trigger the jenkins job.
@@ -82,7 +90,7 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
Jenkins job is moving files to appnexus cdn, pushing prebid.js to npm, purging cache and sending notification to slack.
Move all the files from Appnexus CDN to jsDelivr and create bash script to do above tasks.
-7. Post Release Steps
+7. Post Release Version
Update the version
Manually edit Prebid's package.json to become "1.x.x-pre" (using the values for the next release). Then commit your changes.
@@ -90,6 +98,32 @@ Announcements regarding releases will be made to the #headerbidding-dev channel
git commit -m "Increment pre version"
git push
```
+
+8. Create new release draft
+
+ Go to [github releases](https://github.com/prebid/Prebid.js/releases) and add a new draft for the next version of Prebid.js with the following template:
+```
+## 🚀New Features
+
+## 🛠Maintenance
+
+## 🐛Bug Fixes
+```
+
+## Beta Releases
+
+Prebid.js features may be released as Beta or as Generally Available (GA).
+
+Characteristics of a `Beta` release:
+- May be a partial implementation (e.g. more work needed to flesh out the feature)
+- May not be fully tested with other features
+- Limited documentation, focused on technical aspects
+- Few users
+
+Characteristics of a `GA` release:
+- Complete set of functionality
+- Significant user base with no major issues for at least a month
+- Decent documentation that includes business need, use cases, and examples
## FAQs
diff --git a/browsers.json b/browsers.json
index cb523addc7e..703bf44d41d 100644
--- a/browsers.json
+++ b/browsers.json
@@ -62,21 +62,5 @@
"browser_version": "8.0",
"device": null,
"os": "OS X"
- },
- "bs_ios_9": {
- "base": "BrowserStack",
- "os": "ios",
- "os_version": "9.1",
- "browser": "iphone",
- "device": "iPhone 6S",
- "browser_version": null
- },
- "bs_ios_8": {
- "base": "BrowserStack",
- "os": "ios",
- "os_version": "8.3",
- "browser": "iphone",
- "device": "iPhone 6",
- "browser_version": null
}
}
\ No newline at end of file
diff --git a/governance.md b/governance.md
index 9f8a1fe1e13..3d00f067194 100644
--- a/governance.md
+++ b/governance.md
@@ -2,10 +2,10 @@
This document describes the governance model for the Prebid project. The Prebid project’s stated mission is to facilitate fair, transparent, and effective header bidding across the industry, and is responsible for creating and maintaining such projects as [Prebid.js](https://github.com/prebid/Prebid.js).
-1. A single Tech Lead oversees the technical direction of the project and appoints Core Team members
+1. A single Tech Lead (PMC Chair) oversees the technical direction of the project and appoints Core Team members
2. The Core Team members maintain the project on an ongoing basis with direction from the Tech Lead.
3. In the event of any disagreements, the Tech Lead will make a final decision.
-4. If there is no Tech Lead available to perform his/her duties, AppNexus Inc. will appoint one.
+4. If there is no Tech Lead available to perform his/her duties, Prebid.org will appoint one.
### Roles and Responsibilities:
- **User:** Any individual who consumes / uses the Prebid.js library.
@@ -15,9 +15,9 @@ This document describes the governance model for the Prebid project. The Prebid
### Current Prebid.js Core Team
- @mkendall07 (Tech Lead)
-- @protonate
+- @jsnellbaker
- @matthewlane
- @jaiminpanchal27
- @snapwich
- @harpere
-- @dbemiller
+- @mike-chowla
diff --git a/gulpfile.js b/gulpfile.js
index d2955f7d777..ced29b266a7 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -5,18 +5,15 @@ var argv = require('yargs').argv;
var gulp = require('gulp');
var gutil = require('gulp-util');
var connect = require('gulp-connect');
-var path = require('path');
var webpack = require('webpack');
var webpackStream = require('webpack-stream');
var uglify = require('gulp-uglify');
-var clean = require('gulp-clean');
+var gulpClean = require('gulp-clean');
var KarmaServer = require('karma').Server;
var karmaConfMaker = require('./karma.conf.maker');
var opens = require('open');
var webpackConfig = require('./webpack.conf');
var helpers = require('./gulpHelpers');
-var del = require('del');
-var gulpDocumentation = require('gulp-documentation');
var concat = require('gulp-concat');
var header = require('gulp-header');
var footer = require('gulp-footer');
@@ -36,23 +33,131 @@ var banner = '/* <%= prebid.name %> v<%= prebid.version %>\n' + dateString + ' *
var analyticsDirectory = '../analytics';
var port = 9999;
-// Tasks
-gulp.task('default', ['webpack']);
+// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
+var explicitModules = [
+ 'pre1api'
+];
-gulp.task('serve', ['lint', 'build-bundle-dev', 'watch', 'test']);
+// all the following functions are task functions
+function bundleToStdout() {
+ nodeBundle().then(file => console.log(file));
+}
+bundleToStdout.displayName = 'bundle-to-stdout';
-gulp.task('serve-nw', ['lint', 'watch', 'e2etest']);
+function clean() {
+ return gulp.src(['build'], {
+ read: false,
+ allowEmpty: true
+ })
+ .pipe(gulpClean());
+}
+
+function e2etestReport() {
+ var reportPort = 9010;
+ var targetDestinationDir = './e2etest-report';
+ helpers.createEnd2EndTestReport(targetDestinationDir);
+ connect.server({
+ port: reportPort,
+ root: './',
+ livereload: true
+ });
-gulp.task('run-tests', ['lint', 'test-coverage']);
+ setTimeout(function() {
+ opens('http://localhost:' + reportPort + '/' + targetDestinationDir.slice(2) + '/results.html');
+ }, 5000);
+};
+e2etestReport.displayName = 'e2etest-report';
-gulp.task('build', ['build-bundle-prod']);
+// Dependant task for building postbid. It escapes postbid-config file.
+function escapePostbidConfig() {
+ gulp.src('./integrationExamples/postbid/oas/postbid-config.js')
+ .pipe(jsEscape())
+ .pipe(gulp.dest('build/postbid/'));
+};
+escapePostbidConfig.displayName = 'escape-postbid-config';
-gulp.task('clean', function () {
- return gulp.src(['build'], {
- read: false
- })
- .pipe(clean());
-});
+function lint() {
+ return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'])
+ .pipe(eslint())
+ .pipe(eslint.format('stylish'))
+ .pipe(eslint.failAfterError());
+};
+
+// View the code coverage report in the browser.
+function viewCoverage(done) {
+ var coveragePort = 1999;
+
+ connect.server({
+ port: coveragePort,
+ root: 'build/coverage/karma_html',
+ livereload: false
+ });
+ opens('http://localhost:' + coveragePort);
+ done();
+};
+viewCoverage.displayName = 'view-coverage';
+
+// Watch Task with Live Reload
+function watch(done) {
+ var mainWatcher = gulp.watch([
+ 'src/**/*.js',
+ 'modules/**/*.js',
+ 'test/spec/**/*.js',
+ '!test/spec/loaders/**/*.js'
+ ]);
+ var loaderWatcher = gulp.watch([
+ 'loaders/**/*.js',
+ 'test/spec/loaders/**/*.js'
+ ]);
+
+ connect.server({
+ https: argv.https,
+ port: port,
+ root: './',
+ livereload: true
+ });
+
+ mainWatcher.on('all', gulp.series(clean, gulp.parallel(lint, 'build-bundle-dev', test)));
+ loaderWatcher.on('all', gulp.series(lint));
+ done();
+};
+
+function makeDevpackPkg() {
+ var cloned = _.cloneDeep(webpackConfig);
+ cloned.devtool = 'source-map';
+ var externalModules = helpers.getArgModules();
+
+ const analyticsSources = helpers.getAnalyticsSources(analyticsDirectory);
+ const moduleSources = helpers.getModulePaths(externalModules);
+
+ return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
+ .pipe(helpers.nameModules(externalModules))
+ .pipe(webpackStream(cloned, webpack))
+ .pipe(replace('$prebid.version$', prebid.version))
+ .pipe(gulp.dest('build/dev'))
+ .pipe(connect.reload());
+}
+
+function makeWebpackPkg() {
+ var cloned = _.cloneDeep(webpackConfig);
+
+ delete cloned.devtool;
+
+ var externalModules = helpers.getArgModules();
+
+ const analyticsSources = helpers.getAnalyticsSources(analyticsDirectory);
+ const moduleSources = helpers.getModulePaths(externalModules);
+
+ return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
+ .pipe(helpers.nameModules(externalModules))
+ .pipe(webpackStream(cloned, webpack))
+ .pipe(replace('$prebid.version$', prebid.version))
+ .pipe(uglify())
+ .pipe(gulpif(file => file.basename === 'prebid-core.js', header(banner, { prebid: prebid })))
+ .pipe(optimizejs())
+ .pipe(gulp.dest('build/dist'))
+ .pipe(connect.reload());
+}
function gulpBundle(dev) {
return bundle(dev).pipe(gulp.dest('build/' + (dev ? 'dev' : 'dist')));
@@ -71,20 +176,15 @@ function nodeBundle(modules) {
});
}
-// these modules must be explicitly listed in --modules to be included in the build, won't be part of "all" modules
-var explicitModules = [
- 'pre1api'
-];
-
function bundle(dev, moduleArr) {
- var modules = moduleArr || helpers.getArgModules(),
- allModules = helpers.getModuleNames(modules);
+ var modules = moduleArr || helpers.getArgModules();
+ var allModules = helpers.getModuleNames(modules);
- if(modules.length === 0) {
- modules = allModules.filter(module => !explicitModules.includes(module));
+ if (modules.length === 0) {
+ modules = allModules.filter(module => explicitModules.indexOf(module) === -1);
} else {
var diff = _.difference(modules, allModules);
- if(diff.length !== 0) {
+ if (diff.length !== 0) {
throw new gutil.PluginError({
plugin: 'bundle',
message: 'invalid modules: ' + diff.join(', ')
@@ -106,13 +206,13 @@ function bundle(dev, moduleArr) {
gutil.log('Generating bundle:', outputFileName);
return gulp.src(
- entries
- )
+ entries
+ )
.pipe(gulpif(dev, sourcemaps.init({loadMaps: true})))
.pipe(concat(outputFileName))
.pipe(gulpif(!argv.manualEnable, footer('\n<%= global %>.processQueue();', {
- global: prebid.globalVarName
- }
+ global: prebid.globalVarName
+ }
)))
.pipe(gulpif(dev, sourcemaps.write('.')));
}
@@ -125,7 +225,8 @@ function newKarmaCallback(done) {
done(new Error('Karma tests failed with exit code ' + exitCode));
} else {
if (argv.browserstack) {
- process.exit(0);
+ // process.exit(0);
+ done(); // test this with travis (or circleci)
} else {
done();
}
@@ -133,51 +234,6 @@ function newKarmaCallback(done) {
}
}
-gulp.task('build-bundle-dev', ['devpack'], gulpBundle.bind(null, true));
-gulp.task('build-bundle-prod', ['webpack'], gulpBundle.bind(null, false));
-gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
-
-gulp.task('bundle-to-stdout', function() {
- nodeBundle().then(file => console.log(file));
-});
-
-gulp.task('devpack', ['clean'], function () {
- var cloned = _.cloneDeep(webpackConfig);
- cloned.devtool = 'source-map';
- var externalModules = helpers.getArgModules();
-
- const analyticsSources = helpers.getAnalyticsSources(analyticsDirectory);
- const moduleSources = helpers.getModulePaths(externalModules);
-
- return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
- .pipe(helpers.nameModules(externalModules))
- .pipe(webpackStream(cloned, webpack))
- .pipe(replace('$prebid.version$', prebid.version))
- .pipe(gulp.dest('build/dev'))
- .pipe(connect.reload());
-});
-
-gulp.task('webpack', ['clean'], function () {
- var cloned = _.cloneDeep(webpackConfig);
-
- delete cloned.devtool;
-
- var externalModules = helpers.getArgModules();
-
- const analyticsSources = helpers.getAnalyticsSources(analyticsDirectory);
- const moduleSources = helpers.getModulePaths(externalModules);
-
- return gulp.src([].concat(moduleSources, analyticsSources, 'src/prebid.js'))
- .pipe(helpers.nameModules(externalModules))
- .pipe(webpackStream(cloned, webpack))
- .pipe(replace('$prebid.version$', prebid.version))
- .pipe(uglify())
- .pipe(gulpif(file => file.basename === 'prebid-core.js', header(banner, { prebid: prebid })))
- .pipe(optimizejs())
- .pipe(gulp.dest('build/dist'))
- .pipe(connect.reload());
-});
-
// Run the unit tests.
//
// By default, this runs in headless chrome.
@@ -186,41 +242,33 @@ gulp.task('webpack', ['clean'], function () {
// If --file "" is given, the task will only run tests in the specified file.
// If --browserstack is given, it will run the full suite of currently supported browsers.
// If --browsers is given, browsers can be chosen explicitly. e.g. --browsers=chrome,firefox,ie9
-gulp.task('test', ['clean'], function (done) {
- var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch, argv.file);
+// If --notest is given, it will immediately skip the test task (useful for developing changes with `gulp serve --notest`)
+function test(done) {
+ if (argv.notest) {
+ done();
+ } else {
+ var karmaConf = karmaConfMaker(false, argv.browserstack, argv.watch, argv.file);
- var browserOverride = helpers.parseBrowserArgs(argv).map(helpers.toCapitalCase);
- if (browserOverride.length > 0) {
- karmaConf.browsers = browserOverride;
- }
+ var browserOverride = helpers.parseBrowserArgs(argv).map(helpers.toCapitalCase);
+ if (browserOverride.length > 0) {
+ karmaConf.browsers = browserOverride;
+ }
- new KarmaServer(karmaConf, newKarmaCallback(done)).start();
-});
+ new KarmaServer(karmaConf, newKarmaCallback(done)).start();
+ }
+}
// If --file "" is given, the task will only run tests in the specified file.
-gulp.task('test-coverage', ['clean'], function(done) {
+function testCoverage(done) {
new KarmaServer(karmaConfMaker(true, false, false, argv.file), newKarmaCallback(done)).start();
-});
-
-// View the code coverage report in the browser.
-gulp.task('view-coverage', function (done) {
- var coveragePort = 1999;
-
- connect.server({
- port: coveragePort,
- root: 'build/coverage/karma_html',
- livereload: false
- });
- opens('http://localhost:' + coveragePort);
- done();
-});
+}
-gulp.task('coveralls', ['test-coverage'], function() { // 2nd arg is a dependency: 'test' must be finished
+function coveralls() { // 2nd arg is a dependency: 'test' must be finished
// first send results of istanbul's test coverage to coveralls.io.
return gulp.src('gulpfile.js', { read: false }) // You have to give it a file, but you don't
// have to read it.
.pipe(shell('cat build/coverage/lcov.info | node_modules/coveralls/bin/coveralls.js'));
-});
+}
// Watch Task with Live Reload
gulp.task('watch', function () {
@@ -229,7 +277,7 @@ gulp.task('watch', function () {
'modules/**/*.js',
'test/spec/**/*.js',
'!test/spec/loaders/**/*.js'
- ], ['lint', 'build-bundle-dev', 'test']);
+ ], ['build-bundle-dev', 'test']);
gulp.watch([
'loaders/**/*.js',
'test/spec/loaders/**/*.js'
@@ -242,29 +290,9 @@ gulp.task('watch', function () {
});
});
-gulp.task('lint', () => {
- return gulp.src(['src/**/*.js', 'modules/**/*.js', 'test/**/*.js'])
- .pipe(eslint())
- .pipe(eslint.format('stylish'))
- .pipe(eslint.failAfterError());
-});
-
-gulp.task('clean-docs', function () {
- del(['docs']);
-});
-
-gulp.task('docs', ['clean-docs'], function () {
- return gulp.src('src/prebid.js')
- .pipe(gulpDocumentation('md'))
- .on('error', function (err) {
- gutil.log('`gulp-documentation` failed:', err.message);
- })
- .pipe(gulp.dest('docs'));
-});
-
-gulp.task('e2etest', ['devpack', 'webpack'], function() {
+function e2eTest() {
var cmdQueue = [];
- if(argv.browserstack) {
+ if (argv.browserstack) {
var browsers = require('./browsers.json');
delete browsers['bs_ie_9_windows_7'];
@@ -276,11 +304,11 @@ gulp.task('e2etest', ['devpack', 'webpack'], function() {
var startWith = 'bs';
- Object.keys(browsers).filter(function(v){
+ Object.keys(browsers).filter(function(v) {
return v.substring(0, startWith.length) === startWith && browsers[v].browser !== 'iphone';
- }).map(function(v,i,arr) {
- var newArr = (i%2 === 0) ? arr.slice(i,i+2) : null;
- if(newArr) {
+ }).map(function(v, i, arr) {
+ var newArr = (i % 2 === 0) ? arr.slice(i, i + 2) : null;
+ if (newArr) {
var cmd = 'nightwatch --env ' + newArr.join(',') + cmdStr;
cmdQueue.push(cmd);
}
@@ -289,38 +317,50 @@ gulp.task('e2etest', ['devpack', 'webpack'], function() {
return gulp.src('')
.pipe(shell(cmdQueue.join(';')));
-});
-
-gulp.task('e2etest-report', function() {
- var reportPort = 9010;
- var targetDestinationDir = './e2etest-report';
- helpers.createEnd2EndTestReport(targetDestinationDir);
- connect.server({
- port: reportPort,
- root: './',
- livereload: true
- });
-
- setTimeout(function() {
- opens('http://localhost:' + reportPort + '/' + targetDestinationDir.slice(2) + '/results.html');
- }, 5000);
-});
+}
// This task creates postbid.js. Postbid setup is different from prebid.js
// More info can be found here http://prebid.org/overview/what-is-post-bid.html
-gulp.task('build-postbid', ['escape-postbid-config'], function() {
+
+function buildPostbid() {
var fileContent = fs.readFileSync('./build/postbid/postbid-config.js', 'utf8');
return gulp.src('./integrationExamples/postbid/oas/postbid.js')
.pipe(replace('\[%%postbid%%\]', fileContent))
.pipe(gulp.dest('build/postbid/'));
-});
+}
-// Dependant task for building postbid. It escapes postbid-config file.
-gulp.task('escape-postbid-config', function() {
- gulp.src('./integrationExamples/postbid/oas/postbid-config.js')
- .pipe(jsEscape())
- .pipe(gulp.dest('build/postbid/'));
-});
+// support tasks
+gulp.task(lint);
+gulp.task(watch);
+
+gulp.task(clean);
+
+gulp.task(escapePostbidConfig);
+
+gulp.task('build-bundle-dev', gulp.series(makeDevpackPkg, gulpBundle.bind(null, true)));
+gulp.task('build-bundle-prod', gulp.series(makeWebpackPkg, gulpBundle.bind(null, false)));
+
+// public tasks (dependencies are needed for each task since they can be ran on their own)
+gulp.task('test', gulp.series(clean, lint, test));
+
+gulp.task('test-coverage', gulp.series(clean, testCoverage));
+gulp.task(viewCoverage);
+
+gulp.task('coveralls', gulp.series('test-coverage', coveralls));
+
+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('default', gulp.series(clean, makeWebpackPkg));
+
+gulp.task(e2etestReport);
+gulp.task('e2etest', gulp.series(clean, gulp.parallel(makeDevpackPkg, makeWebpackPkg), e2eTest));
+
+// other tasks
+gulp.task(bundleToStdout);
+gulp.task('bundle', gulpBundle.bind(null, false)); // used for just concatenating pre-built files with no build step
+gulp.task('serve-nw', gulp.parallel(lint, watch, 'e2etest'));
module.exports = nodeBundle;
diff --git a/integrationExamples/gpt/hello_world.html b/integrationExamples/gpt/hello_world.html
index a5949b87c56..e1cdaa0dc29 100644
--- a/integrationExamples/gpt/hello_world.html
+++ b/integrationExamples/gpt/hello_world.html
@@ -1,98 +1,101 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Prebid.js Test
- Div-1
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Prebid.js Test
+ Div-1
+
+
+
+
\ No newline at end of file
diff --git a/integrationExamples/gpt/pbjs_example_gpt.html b/integrationExamples/gpt/pbjs_example_gpt.html
index f1ec912fd26..536bc5a655d 100644
--- a/integrationExamples/gpt/pbjs_example_gpt.html
+++ b/integrationExamples/gpt/pbjs_example_gpt.html
@@ -269,6 +269,13 @@
placement_id: 0
}
},
+ {
+ bidder: 'weborama',
+ params: {
+ placementId: 0,
+ traffic: 'banner'
+ }
+ },
{
bidder: 'pollux',
params: {
@@ -281,7 +288,22 @@
pubId: 50357, //REQUIRED
host: 'dsp-staging.adkernel.com' //OPTIONAL
}
+ },
+ {
+ bidder: 'bizzclick',
+ params: {
+ placementId: 0,
+ type: "banner"
+ }
+ },
+ {
+ bidder: 'zedo',
+ params: {
+ channelCode: 2264002816, //REQUIRED
+ dimId: 9 //REQUIRED
+ }
}
+
]
}, {
code: 'div-gpt-ad-12345678-1',
@@ -413,6 +435,13 @@
params: {
zone: '276' // REQUIRED Zone Id (276 is a test zone)
}
+ },
+ {
+ bidder: 'bizzclick',
+ params: {
+ placementId: 0,
+ type: "banner"
+ }
}
]
}
diff --git a/integrationExamples/gpt/pbjs_ucfunnel_gpt.html b/integrationExamples/gpt/pbjs_ucfunnel_gpt.html
deleted file mode 100644
index cda2af03b18..00000000000
--- a/integrationExamples/gpt/pbjs_ucfunnel_gpt.html
+++ /dev/null
@@ -1,97 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Prebid.js Test
-Div-1
-
-
-
-
-
-
-
-
diff --git a/integrationExamples/gpt/prebidServer_example.html b/integrationExamples/gpt/prebidServer_example.html
index 2f91c2b966f..f13c93963c6 100644
--- a/integrationExamples/gpt/prebidServer_example.html
+++ b/integrationExamples/gpt/prebidServer_example.html
@@ -4,7 +4,6 @@
var PREBID_TIMEOUT = 3000;
var googletag = googletag || {};
- var sizes = [[728, 90],[300, 250], [300,600]];
googletag.cmd = googletag.cmd || [];
function initAdserver() {
@@ -37,12 +36,12 @@
pbjs.que.push(function() {
var adUnits = [{
code: 'div-gpt-ad-1460505748561-0',
- sizes: [[300, 250], [300,600]],
+ sizes: [[300, 250]],
bids: [
{
bidder: 'appnexus',
params: {
- placementId: '10433394'
+ placementId: '13144370'
}
}
]
@@ -56,7 +55,7 @@
bidders : ['appnexus'],
timeout : 1000, //default value is 1000
adapter : 'prebidServer', //if we have any other s2s adapter, default value is s2s
- endpoint : 'https://prebid.adnxs.com/pbs/v1/auction?url_override=http%3A%2F%2Fwww.nytimes.com'
+ endpoint : 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction'
}
});
@@ -72,7 +71,7 @@
-
+