Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Melody Li committed Oct 15, 2019
2 parents 8729d7c + 3965d3a commit 32c1c68
Show file tree
Hide file tree
Showing 263 changed files with 19,350 additions and 2,886 deletions.
128 changes: 86 additions & 42 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,93 @@
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#

aliases:
- &environment
docker:
# specify the version you desire here
- image: circleci/node:8.9.0

# 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

- &restore_dep_cache
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- &save_dep_cache
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

- &install
name: Install gulp cli
command: sudo npm install -g gulp-cli

- &run_unit_test
name: BrowserStack testing
command: gulp test --browserstack --nolintfix

- &run_endtoend_test
name: BrowserStack End to end testing
command: echo "127.0.0.1 test.localhost" | sudo tee -a /etc/hosts && gulp e2e-test --host=test.localhost

# Download and run BrowserStack local
- &setup_browserstack
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} &
- &unit_test_steps
- checkout
- restore_cache: *restore_dep_cache
- run: npm install
- save_cache: *save_dep_cache
- run: *install
- run: *setup_browserstack
- run: *run_unit_test

- &endtoend_test_steps
- checkout
- restore_cache: *restore_dep_cache
- run: npm install
- save_cache: *save_dep_cache
- run: *install
- run: *setup_browserstack
- run: *run_endtoend_test

version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:7.10
<<: *environment
steps: *unit_test_steps

# 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 --nolintfix
e2etest:
<<: *environment
steps: *endtoend_test_steps

workflows:
version: 2
commit:
jobs:
- build
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- e2etest
32 changes: 5 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@

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
];
const allowedModules = require("./allowedModules");

module.exports = {
"env": {
Expand Down Expand Up @@ -45,25 +38,10 @@ module.exports = {
"no-undef": "off",
"no-useless-escape": "off",
},
"overrides": [{
"files": "modules/**/*.js",
"overrides": Object.keys(allowedModules).map((key) => ({
"files": key + "/**/*.js",
"rules": {
"prebid/validate-imports": ["error", [
...sharedWhiteList,
"jsencrypt",
"crypto-js"
]]
"prebid/validate-imports": ["error", allowedModules[key]]
}
}, {
"files": "src/**/*.js",
"rules": {
"prebid/validate-imports": ["error", [
...sharedWhiteList,
"fun-hooks/no-eval",
"just-clone",
"dlv",
"dset"
]]
}
}]
}))
};
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ build/coverage/
.idea/
# if you remove the above rule, at least ignore the following:

# VS Code
.vscode/

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0
8.9
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
}
```

Or for Babel 6 and/or Node v8.6.0 and less:
Or for Babel 6:
```javascript
// you must manually install and specify the presets and plugins yourself
options: {
Expand Down Expand Up @@ -112,9 +112,9 @@ prebid.requestBids({
$ cd Prebid.js
$ npm install

*Note:* You need to have `NodeJS` 6.x or greater installed.
*Note:* You need to have `NodeJS` 8.9.x 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 compily 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 it's setup.
*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.

If you have a previous version of `gulp` installed globally, you'll need to remove it before installing `gulp-cli`. You can check if this is installed by running `gulp -v` and seeing the version that's listed in the `CLI` field of the output. If you have the `gulp` package installed globally, it's likely the same version that you'll see in the `Local` field. If you already have `gulp-cli` installed, it should be a lower major version (it's at version `2.0.1` at the time of the transition).

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

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
];

module.exports = {
'modules': [
...sharedWhiteList,
'jsencrypt',
'crypto-js'
],
'src': [
...sharedWhiteList,
'fun-hooks/no-eval',
'just-clone',
'dlv',
'dset'
]
};
26 changes: 13 additions & 13 deletions browsers.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"bs_edge_16_windows_10": {
"bs_edge_17_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "edge",
"browser_version": "16.0",
"browser_version": "17.0",
"device": null,
"os": "Windows"
},
"bs_edge_17_windows_10": {
"bs_edge_16_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "edge",
"browser_version": "17.0",
"browser_version": "16.0",
"device": null,
"os": "Windows"
},
Expand All @@ -23,35 +23,35 @@
"device": null,
"os": "Windows"
},
"bs_chrome_72_windows_10": {
"bs_chrome_74_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "chrome",
"browser_version": "72.0",
"browser_version": "74.0",
"device": null,
"os": "Windows"
},
"bs_chrome_71_windows_10": {
"bs_chrome_75_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "chrome",
"browser_version": "71.0",
"browser_version": "75.0",
"device": null,
"os": "Windows"
},
"bs_firefox_65_windows_10": {
"bs_firefox_66_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "firefox",
"browser_version": "65.0",
"browser_version": "66.0",
"device": null,
"os": "Windows"
},
"bs_firefox_64_windows_10": {
"bs_firefox_67_windows_10": {
"base": "BrowserStack",
"os_version": "10",
"browser": "firefox",
"browser_version": "64.0",
"browser_version": "67.0",
"device": null,
"os": "Windows"
},
Expand All @@ -71,4 +71,4 @@
"device": null,
"os": "OS X"
}
}
}
5 changes: 4 additions & 1 deletion gulpHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ module.exports = {
}
return Object.assign(externalModules.reduce((memo, module) => {
try {
var modulePath = require.resolve(module);
// prefer internal project modules before looking at project dependencies
var modulePath = require.resolve(module, {paths: ['./modules']});
if (modulePath === '') modulePath = require.resolve(module);

memo[modulePath] = module;
} catch (err) {
// do something
Expand Down
Loading

0 comments on commit 32c1c68

Please sign in to comment.