Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/prebid/Prebid.js into pre…
Browse files Browse the repository at this point in the history
…built

* 'master' of https://github.com/prebid/Prebid.js: (95 commits)
  Specify --browsers when using gulp test --watch (prebid#1420)
  Added aliases for aol adapter. (prebid#1371)
  Added MobFox Adapter (prebid#1312)
  Fixed style error. (prebid#1419)
  Add native support for Criteo adapter (prebid#999)
  Update admediaBidAdapter.js (prebid#1395)
  Increment pre version (prebid#1413)
  Prebid 0.26.1 Release (prebid#1412)
  fix prebid#1410 - issue with ie and xhr.timeout (prebid#1411)
  Lint modules directory (prebid#1404)
  Set outstream mediaType based on renderer in response (prebid#1391)
  Fixing the BidAdjustmentEvent fire time (prebid#1399)
  Fix banner showing up in prebid-core.js (prebid#1388)
  Mention NodeJS 4.0 dependency in the README (prebid#1386)
  Increment pre version (prebid#1385)
  Prebid 0.26.0 Release (prebid#1384)
  PulsePoint Lite adapter - adding createNew method for aliasing. (prebid#1383)
  Modernizing build dependencies (prebid#1355)
  StickyAdsTV bidder adapter update (prebid#1311)
  Added CPM value as parameter for Vertoz Adapter (prebid#1306)
  ...
  • Loading branch information
Mat Brown committed Jul 28, 2017
2 parents 082e273 + 6069d9b commit c20df1b
Show file tree
Hide file tree
Showing 240 changed files with 12,648 additions and 5,710 deletions.
5 changes: 3 additions & 2 deletions .eslintrc → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
module.exports = {
"env": {
"browser": true,
"commonjs": true
Expand All @@ -23,6 +23,7 @@
"camelcase": "off",
"eqeqeq": "off",
"import/first": "off",
"new-cap": "off",
"no-control-regex": "off",
"no-mixed-operators": "off",
"no-multiple-empty-lines": "off",
Expand All @@ -39,4 +40,4 @@
"standard/object-curly-even-spacing": "off",
"valid-typeof": "off"
}
}
};
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ Thank you for your pull request. Please make sure this PR is scoped to one chang
}
}
```

Be sure to test the integration with your adserver using the [Hello World](/integrationExamples/gpt/hello_world.html) sample page.

- contact email of the adapter’s maintainer
- [ ] official adapter submission

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1
7.0
14 changes: 4 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
sudo: required
dist: trusty

language: node_js

node_js:
- "5.1"
- "7.0"

# See https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-the-Chrome-addon-in-the-headless-mode
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
chrome: stable

before_install:
- npm install -g gulp
- export CHROME_BIN=google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &

script:
- gulp run-tests
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Before a Pull Request will be considered for merge:
- All new and existing tests must pass
- Added or modified code must have greater than 80% coverage

If you are submitting an adapter, you can also use the [Hello World](integrationExamples/gpt/hello_world.html) example page to test integration with your server.

### Test Guidelines
When you are adding code to Prebid.js, or modifying code that isn't covered by an existing test, test the code according to these guidelines:

Expand Down
84 changes: 53 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ Working examples can be found in [the developer docs](http://prebid.org/dev-docs
$ cd Prebid.js
$ yarn install

Prebid also supports the `yarn` npm client. This is an alternative to using `npm` for package management, though `npm` will continue to work as before.
Prebid supports the `yarn` npm client. This is an alternative to using `npm` for package management, though `npm install` will continue to work as before.

For more info, see [the Yarn documentation](https://yarnpkg.com).

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

<a name="Build"></a>

## Build for Development
Expand All @@ -47,21 +49,13 @@ This runs some code quality checks, starts a web server at `http://localhost:999
+ `./build/dist/prebid.js` - Minified production code
+ `./prebid.js_<version>.zip` - Distributable zip archive

*Note:* You need to have `node.js` 4.x or greater installed to be able to run the `gulp build` commands.

### Build Optimization

The standard build output contains all the available bidder adapters listed in `adapters.json`.

You might want to exclude some/most of them from the final bundle. To make sure the build only includes the adapters you want, you can make your own adapters file.
The standard build output contains all the available modules from within the `modules` folder.

For example, in `path/to/your/list-of-adapters.json`, write:
You might want to exclude some/most of them from the final bundle. To make sure the build only includes the modules you want, you can specify the modules to be included with the `--modules` CLI argument.

[
"openx",
"rubicon",
"sovrn"
]
For example, when running the serve command: `gulp serve --modules=openxBidAdapter,rubiconBidAdapter,sovrnBidAdapter`

Building with just these adapters will result in a smaller bundle which should allow your pages to load faster.

Expand All @@ -71,26 +65,35 @@ Prebid now supports the `yarn` npm client. This is an alternative to using `npm`
For more info about yarn see https://yarnpkg.com

- Clone the repo, run `yarn install`
- Duplicate `adapters.json` to e.g. `list-of-adapters.json`
- Remove the unnecessary adapters from `list-of-adapters.json`
- Then run the build:

$ gulp build --adapters path/to/your/list-of-adapters.json
$ gulp build --modules=openxBidAdapter,rubiconBidAdapter,sovrnBidAdapter
Alternatively, a `.json` file can be specified that contains a list of modules you would like to include.

$ gulp build --modules=modules.json
With `modules.json` containing the following
```json modules.json
[
"openxBidAdapter",
"rubiconBidAdapter",
"sovrnBidAdapter"
]
```

**Build prebid.js using Yarn for bundling**

In case you'd like to explicitly show that your project uses `prebid.js` and want a reproducible build, consider adding it as an `yarn` dependency.

- Add `prebid.js` as a `yarn` dependency of your project: `yarn add prebid.js`
- Duplicate `node_modules/prebid.js/adapters.json` to under your project path, e.g. `path/to/your/list-of-adapters.json`
- Remove the unnecessary adapters
- Run the `prebid.js` build under the `node_modules/prebid.js/` folder

$ gulp build --adapters path/to/your/list-of-adapters.json
$ gulp build --modules=path/to/your/list-of-modules.json

Most likely your custom `prebid.js` will only change when there's:

- A change in your list of adapters
- A change in your list of modules
- A new release of `prebid.js`

Having said that, you are probably safe to check your custom bundle into your project. You can also generate it in your build process.
Expand All @@ -99,7 +102,26 @@ Having said that, you are probably safe to check your custom bundle into your pr

## Test locally

To configure Prebid.js to run locally, edit the example file `./integrationExamples/gpt/pbjs_example_gpt.html`:
To lint the code:

```bash
gulp lint
```

To run the unit tests:

```bash
gulp test
```

To generate and view the code coverage reports:

```bash
gulp test-coverage
gulp view-coverage
```

For end-to-end testing, edit the example file `./integrationExamples/gpt/pbjs_example_gpt.html`:

1. Change `{id}` values appropriately to set up ad units and bidders
2. Set the path to Prebid.js in your example file as shown below (see `pbs.src`).
Expand Down Expand Up @@ -128,21 +150,21 @@ For deployment:
})();
```

To run the project locally, use:
Build and run the project locally with:

$ gulp serve
```bash
gulp serve
```

This runs code quality checks, generates all the necessary files and starts a web server at `http://localhost:9999` serving from the project root. Navigate to your example implementation to test, and if your `prebid.js` file is sourced from the `./build/dev` directory you will have sourcemaps available in your browser's developer tools.
This runs `lint` and `test`, then starts a web server at `http://localhost:9999` serving from the project root.
Navigate to your example implementation to test, and if your `prebid.js` file is sourced from the `./build/dev`
directory you will have sourcemaps available in your browser's developer tools.

To run the example file, go to:

+ `http://localhost:9999/integrationExamples/gpt/pbjs_example_gpt.html`

To view a test coverage report, go to:

+ `http://localhost:9999/build/coverage/karma_html/report`

A watch is also in place that will run continuous tests in the terminal as you edit code and tests.
As you make code changes, the bundles will be rebuilt and the page reloaded automatically.

<a name="Contribute"></a>

Expand All @@ -156,7 +178,7 @@ Our PR review process can be found [here](https://github.com/prebid/Prebid.js/tr

### Add a Bidder Adapter

To add a bidder adapter, see the instructions in [How to add a bidder adaptor](http://prebid.org/dev-docs/bidder-adaptor.html).
To add a bidder adapter module, see the instructions in [How to add a bidder adaptor](http://prebid.org/dev-docs/bidder-adaptor.html).

Please **do NOT load Prebid.js inside your adapter**. If you do this, we will reject or remove your adapter as appropriate.

Expand All @@ -168,7 +190,7 @@ If you are contributing code, you should [configure your editor](http://eslint.o

### Unit Testing with Karma

$ gulp test --watch
$ gulp test --watch --browsers=chrome

This will run tests and keep the Karma test browser open. If your `prebid.js` file is sourced from the `./build/dev` directory you will also have sourcemaps available when using your browser's developer tools.

Expand All @@ -192,7 +214,7 @@ For instructions on writing tests for Prebid.js, see [Testing Prebid.js](http://

### Supported Browsers

Prebid.js is supported on IE9+ and modern browsers.
Prebid.js is supported on IE10+ and modern browsers.

### Governance
Review our governance model [here](https://github.com/prebid/Prebid.js/tree/master/governance.md).
147 changes: 0 additions & 147 deletions adapters.json

This file was deleted.

1 change: 0 additions & 1 deletion analytics.json

This file was deleted.

Loading

0 comments on commit c20df1b

Please sign in to comment.