0.6.16 • Published 5 years ago

playground-custom-ads-library v0.6.16

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Playground Ads Library

This is a space where plugins for our formats can be built in a reusable, maintainable and component-based fashion.

Get Started

  1. Clone the Repo in your local machine git clone https://github.com/playground-xyz/ads-library.git
  2. Install NPM package manager if it hasn't been installed before. https://www.npmjs.com/get-npm
  3. Install required node modules by running npm install in your terminal.
  4. Punch git checkout -b {origin_branch} {new_dev_branch} to start your own branch for your app.
  5. Punch npm run start to start your local development.
  6. Once development is completed, run npm run build. It will create a minified bundled JavaScript file in the /dist folder which will be ready to be used in our ads.

Directory Layout

This library uses a Component Based Architecture(CBA), all components used in the app is indivisual and has its own responsibility. The struture of the top level Application is shown as below, feel free to use whatever structure you want in your sub-applications.

.
├── build                   # Configuration Files for building the dev enviroment. ie. (Webpack Configs)
├── src                     # Source files for the top level builder interface
├── router                  # Navigation thru different Apps
├── apps                    # Where all the actual application sits
├── dist                    # Webpack generates the bundled file for each application
└── README.md

Deployment

Check in your code and create a new version using npm version <patch|minor|major>...

Not sure whether it's a patch / minor / major? From https://semver.org/:

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.

Deploy the project in #dev-deploy using the command hubot deploy ads-library and your new library will be available at https://static.playground.xyz/adlib/x.x.x/bundle_name.min.js.

X-Range URLs

The deployment script creates x-range URLs such that e.g. the following URL:

https://static.playground.xyz/adlib/4.x.x/bundle_name.min.js

will resolve to the LATEST published bundle with a major version of 4.

Note that cache headers are currently set to 4 hours, which means that some devices MAY continue to use a stale x-range bundle for up to 4 hours.