Skip to content

Commit

Permalink
feat: create interest groups (#30)
Browse files Browse the repository at this point in the history
* chore(docs): remove tech spec in favor of wiki

* chore(test): set up unit tests

* chore: fix Jest to support ES Modules

* chore: set required node version

* chore: fix busted return tests

* feat: `joinAdInterestGroup` & `leaveAdInterestGroup` functions (#31)

* feat: initial checks for function parameters

* fix: validate util passing incorrect arg

* chore: add utils unit tests

* fix: avoid calculating ms per day as per feedback

* chore: clean up error message for clarity as per feedback

* chore: clean up test language

* chore: remove stub function

* chore: remove all constants calculations

* fix: import using relative path with file suffix

* chore: add in jsdocs

* chore: remove unnecessary constants abstraction file

* chore: move tests out of source directory

* chore: ignore mocks file from tests

* chore: move unit tests to subdirectory

* chore: create API docs

* fix: main exports require file suffix

* chore: rename dir to match github standards

* feat: interest group storage helpers (#35)

* feat: create helpers for indexed db

* chore: turn off eslint console warnings

* feat: add in dist task with rollup

* chore: fix async tests

* chore: comment out consoles

* chore: remove deps

* chore: remove another dep

* chore: jest is stupid and requires this empty file for some reason

* chore: remove node 12 from tests

* chore: add in babel config for CI

* chore: fix the tests

* chore: remove unneeded babel config file

* chore: update docs

* chore: add in utils README

* chore: add language highlights to README

* chore(test): create integration test framework (#32)

Co-authored-by: Newton Koumantzelis <[email protected]>

* chore(deps-dev): bump @theholocron/jest-preset from 0.2.3 to 0.3.0 (#38)

Bumps [@theholocron/jest-preset](https://github.com/the-holocron/threepio) from 0.2.3 to 0.3.0.
- [Release notes](https://github.com/the-holocron/threepio/releases)
- [Commits](https://github.com/the-holocron/threepio/compare/@theholocron/[email protected]...@theholocron/[email protected])

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore: update package

* chore: fix actions names

* chore: add coverage reports

* chore: fix actions

* chore: fix test job

* chore: tweak coverage directory

* chore: fix coverage report

Co-authored-by: Brad Rodriguez <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Apr 19, 2021
1 parent 94d3f65 commit 0ef68ca
Show file tree
Hide file tree
Showing 54 changed files with 5,135 additions and 1,337 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
push:
branches:
- '**'
- '!main'
pull_request:
branches:
- '**'
- '!main'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: Install dependencies
env:
CI: true
run: npm ci
- name: Lint
run: npm run lint
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
strategy:
matrix:
node:
- 12
- 13
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: '14'
check-latest: true
- name: Install dependencies
env:
CI: true
Expand All @@ -47,11 +47,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 13
node-version: '14'
check-latest: true
registry-url: https://registry.npmjs.org
- name: Install
env:
Expand Down
46 changes: 30 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,51 @@ on:
- '!main'

jobs:
prepare:
unit:
name: Unit test
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[skip ci]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: Install dependencies
env:
CI: true
run: npm ci
- name: Unit Test
run: npm run test:unit -- --ci --coverage
- name: Send Coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/
flags: unittests
verbose: true

test:
needs: prepare
name: Test on node ${{ matrix.node }} and ${{ matrix.os }}
e2e:
name: End-to-End test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node:
- 12
- 13
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- name: checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
node-version: '14'
check-latest: true
- name: Install dependencies
env:
CI: true
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: e2e Test
run: npm run test:e2e
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,32 @@ npm install --save @magnite/fledge.polyfill

## Usage

<!-- insert usage -->
### Directly in a browser

```html
<script type="module">
import { fledge } from "./node_modules/@magnite/fledge.polyfill/esm/index.js";
const options = {
owner: "www.buyer.com",
name: "an-interest-group",
bidding_logic_url: "https://dsp.com/bidding",
};
// join an interest group
fledge.joinAdInterestGroup(options, 864000000).then(response => console.log(response));
// leave an interest group
fledge.leaveAdInterestGroup(options).then(response => console.log(response));
</script>
```

## Where to Find Documentation

The best way to find out what's available is to dig through source code, as each directory has a README file to describe each feature.

* [Interest Groups](./src/interest-groups/README.md)

## How We Track Changes [![Keep a Changelog](https://img.shields.io/badge/Keep%20a%20Changelog-1.0.0-orange)](https://keepachangelog.com/en/1.0.0/)

This project uses a CHANGELOG and [GitHub releases](https://help.github.com/en/github/administering-a-repository/about-releases) which contains a curated, chronologically ordered list of notable changes for each version of a project. [Read more about changelogs](https://keepachangelog.com/en/1.0.0/).
Expand Down
11 changes: 0 additions & 11 deletions __spec__/README.md

This file was deleted.

184 changes: 0 additions & 184 deletions __spec__/auctions.md

This file was deleted.

Loading

0 comments on commit 0ef68ca

Please sign in to comment.