Skip to content

Commit

Permalink
Merge pull request #9 from prebid/master
Browse files Browse the repository at this point in the history
PR to SA
  • Loading branch information
SeedingAllianceTech authored Apr 5, 2022
2 parents 85072ca + 1153c70 commit 097defa
Show file tree
Hide file tree
Showing 512 changed files with 71,369 additions and 28,990 deletions.
26 changes: 1 addition & 25 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -1,25 +1 @@

let path = require('path');

function useLocal(module) {
return require.resolve(module, {
paths: [
__dirname
]
})
}

module.exports = {
"presets": [
[
useLocal('@babel/preset-env'),
{
"useBuiltIns": "entry"
}
]
],
"plugins": [
path.resolve(__dirname, './plugins/pbjsGlobals.js'),
useLocal('babel-plugin-transform-object-assign')
]
};
module.exports = require('./babelConfig.js')();
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#

aliases:
aliases:
- &environment
docker:
# specify the version you desire here
- image: circleci/node:12.16.1
- image: circleci/node:12.16.1-browsers
resource_class: xlarge
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
build:
<<: *environment
steps: *unit_test_steps

e2etest:
<<: *environment
steps: *endtoend_test_steps
Expand Down
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ module.exports = {
'BROWSERSTACK_USERNAME': false,
'BROWSERSTACK_KEY': false
},
// use babel as parser for fancy syntax
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2018,
},

rules: {
'comma-dangle': 'off',
semi: 'off',
Expand All @@ -49,5 +52,9 @@ module.exports = {
rules: {
'prebid/validate-imports': ['error', allowedModules[key]]
}
}))
})).concat([{
// code in other packages (such as plugins/eslint) is not "seen" by babel and its parser will complain.
files: 'plugins/*/**/*.js',
parser: 'esprima'
}])
};
89 changes: 89 additions & 0 deletions .github/workflows/issue_tracker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Issue tracking
on:
issues:
types:
- opened
jobs:
track_issue:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@36464acb844fc53b9b8b2401da68844f6b05ebb0
with:
app_id: ${{ secrets.ISSUE_APP_ID }}
private_key: ${{ secrets.ISSUE_APP_PEM }}

- name: Get project data
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ORGANIZATION: prebid
DATE_FIELD: Created on
PROJECT_NUMBER: 2
run: |
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectNext(number: $number) {
id
fields(first:100) {
nodes {
id
name
settings
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "'"$DATE_FIELD"'") | .id' project_data.json) >> $GITHUB_ENV
- name: Add issue to project
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
ISSUE_ID: ${{ github.event.issue.node_id }}
run: |
gh api graphql -f query='
mutation($project:ID!, $issue:ID!) {
addProjectNextItem(input: {projectId: $project, contentId: $issue}) {
projectNextItem {
id,
content {
... on Issue {
createdAt
}
... on PullRequest {
createdAt
}
}
}
}
}' -f project=$PROJECT_ID -f issue=$ISSUE_ID > issue_data.json
echo 'ITEM_ID='$(jq '.data.addProjectNextItem.projectNextItem.id' issue_data.json) >> $GITHUB_ENV
echo 'ITEM_CREATION_DATE='$(jq '.data.addProjectNextItem.projectNextItem.content.createdAt' issue_data.json) >> $GITHUB_ENV
- name: Set fields
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
gh api graphql -f query='
mutation (
$project: ID!
$item: ID!
$date_field: ID!
$date_value: String!
) {
set_creation_date: updateProjectNextItemField(input: {
projectId: $project
itemId: $item
fieldId: $date_field
value: $date_value
}) {
projectNextItem {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f date_field=$DATE_FIELD_ID -f date_value=$ITEM_CREATION_DATE --silent
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,22 @@ Once setup, run the following command to globally install the `gulp-cli` package

## Build for Development

To build the project on your local machine, run:
To build the project on your local machine we recommend, running:

$ gulp serve
$ gulp serve-and-test --file <spec_file.js>

This runs some code quality checks, starts a web server at `http://localhost:9999` serving from the project root and generates the following files:
This will run testing but not linting. A web server will start at `http://localhost:9999` serving from the project root and generates the following files:

+ `./build/dev/prebid.js` - Full source code for dev and debug
+ `./build/dev/prebid.js.map` - Source map for dev and debug
+ `./build/dist/prebid.js` - Minified production code
+ `./prebid.js_<version>.zip` - Distributable zip archive
+ `./build/dev/prebid-core.js`
+ `./build/dev/prebid-core.js.map`


Development may be a bit slower but if you prefer linting and additional watch files you can also still run just:

$ gulp serve


### Build Optimization

Expand Down
68 changes: 5 additions & 63 deletions RELEASE_SCHEDULE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
- [Release Process](#release-process)
- [1. Make sure that all PRs have been named and labeled properly per the PR Process](#1-make-sure-that-all-prs-have-been-named-and-labeled-properly-per-the-pr-process)
- [2. Make sure all browserstack tests are passing](#2-make-sure-all-browserstack-tests-are-passing)
- [3. Prepare Prebid Code](#3-prepare-prebid-code)
- [4. Verify the Release](#4-verify-the-release)
- [5. Create a GitHub release](#5-create-a-github-release)
- [6. Update coveralls _(skip for legacy)_](#6-update-coveralls-skip-for-legacy)
- [7. Distribute the code](#7-distribute-the-code)
- [8. Increment Version for Next Release](#8-increment-version-for-next-release)
- [3. Start the release](#3-start-the-release)
- [Beta Releases](#beta-releases)
- [FAQs](#faqs)

Expand All @@ -21,12 +16,10 @@ it will be about a week before the Prebid Org [Download Page](http://prebid.org/

You can determine what is in a given build using the [releases page](https://github.com/prebid/Prebid.js/releases)

Announcements regarding releases will be made to the #headerbidding-dev channel in subredditadops.slack.com.
Announcements regarding releases will be made to the #prebid-js channel in prebid.slack.com.

## Release Process

_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 that all PRs have been named and labeled properly per the [PR Process](https://github.com/prebid/Prebid.js/blob/master/PR_REVIEW.md#general-pr-review-process)
* Do this by checking the latest draft release from the [releases page](https://github.com/prebid/Prebid.js/releases) and make sure nothing appears in the first section called "In This Release". If they do, please open the PRs and add the appropriate labels.
* Do a quick check that all the titles/descriptions look ok, and if not, adjust the PR title.
Expand Down Expand Up @@ -57,61 +50,10 @@ _Note: If `github.com/prebid/Prebid.js` is not configured as the git origin for
```


### 3. Prepare Prebid Code

Update the package.json version to become the current release. Then commit your changes.

```
git commit -m "Prebid 4.x.x Release"
git push
```

### 4. Verify the Release

Make sure your there are no more merges to master branch. Prebid code is clean and up to date.

### 5. Create a GitHub release

Edit the most recent [release notes](https://github.com/prebid/Prebid.js/releases) draft and make sure the correct version is set and the master branch is selected in the dropdown. Click `Publish release`. GitHub will create release tag.

Pull these changes locally by running command
```
git pull
git fetch --tags
```

and verify the tag.

### 6. Update coveralls _(skip for legacy)_

We use https://coveralls.io/ to show parts of code covered by unit tests.

Set the environment variables. You may want to add these to your `~/.bashrc` for convenience.
```
export COVERALLS_SERVICE_NAME="travis-ci"
export COVERALLS_REPO_TOKEN="talk to Matt Kendall"
```

Run `gulp coveralls` to update code coverage history.

### 7. Distribute the code

_Note: do not go to step 8 until step 7 has been verified completed._

Reach out to any of the Appnexus folks to trigger the jenkins job.

// TODO:
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.

### 8. Increment Version for Next Release

Update the version by manually editing Prebid's `package.json` to become "4.x.x-pre" (using the values for the next release). Then commit your changes.
```
git commit -m "Increment pre version"
git push
```
### 3. Start the release

Follow the instructions at https://github.com/prebid/prebidjs-releaser. Note that you will need to be a member of the [https://github.com/orgs/prebid/teams/prebidjs-release](prebidjs-release) GitHub team.

## Beta Releases

Prebid.js features may be released as Beta or as Generally Available (GA).
Expand Down
7 changes: 0 additions & 7 deletions allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@

const sharedWhiteList = [
'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
'core-js-pure/web/url-search-params' // no ie11
];

module.exports = {
Expand Down
30 changes: 30 additions & 0 deletions babelConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

let path = require('path');

function useLocal(module) {
return require.resolve(module, {
paths: [
__dirname
]
})
}

module.exports = function (test = false) {
return {
'presets': [
[
useLocal('@babel/preset-env'),
{
'useBuiltIns': 'entry',
'corejs': '3.13.0',
// a lot of tests use sinon.stub & others that stopped working on ES6 modules with webpack 5
'modules': test ? 'commonjs' : 'auto',
}
]
],
'plugins': [
path.resolve(__dirname, './plugins/pbjsGlobals.js'),
useLocal('babel-plugin-transform-object-assign'),
],
}
}
Loading

0 comments on commit 097defa

Please sign in to comment.