Git Product home page Git Product logo

generator-videojs-plugin's Introduction

generator-videojs-plugin

This is an opinionated Yeoman generator for video.js plugins. It is based on the recommendations of the video.js core team as well as tools and conventions for developing plugins at Brightcove.

To learn more about video.js plugins and this generator's standards and opinions, check out:

Table of Contents

Getting Started

If you don't know what Yeoman is or what generators are, check out the Yeoman Getting Started document. Long story short, make sure you have Yeoman and this generator installed globally:

$ npm install -g yo generator-videojs-plugin

Then, creating the foundation for your video.js plugin is as simple as:

$ yo videojs-plugin

You will be walked through several options and finish with a working, buildable, testable video.js plugin. Of course, this plugin won't do anything out of the box - that part is left to your creativity!

Options

Install

By default, the generator will run npm install after it is finished. This can be a slow process and you may not always need it; so, it can be disabled (this option is provided by Yeoman itself, but it's useful and worth documenting here).

Turn installation off with: yo videojs-plugin --skip-install

Prompt

By default, the generator will present the user with a series of prompts to choose various settings. This can be disabled if you've previously selected values and don't want to change them.

Turn prompts off with: yo videojs-plugin --skip-prompt

Hurry

If you don't want to change configuration, but just want to update an existing plugin and skip all the other stuff (prompts, installation, "yosay"s), you can use this option to do that. You may need to run the installation manually if dependencies changed!

Turn prompts off with: yo videojs-plugin --hurry

Brightcove Defaults

Set certain values automatically for Brightcove-authored plugins. Has the following effects:

  • Sets the author to "Brightcove, Inc."
  • Limits open-source license options to Apache-2.0 only.

Turn on these Brightcove defaults with: yo videojs-plugin --bcov

Updating an Existing Project

Running a Yeoman generator in an empty directory poses no difficulties; however, running it against an existing project can cause conflicts. Yeoman provides a mechanism, which can be confusing because it's not clearly documented, for resolving these conflicts. It will prompt you to choose one of:

  • Y: yes (default)
  • n: no
  • a: yes to all
  • x: exit
  • d: diff
  • h: help

Recommendations

Most of what this generator does is localized to the package.json file. Luckily, the generator does a good job of merging your existing contents with the generated contents. In general, it's safe to select Y for the package.json in your project.

Other files you'll usually want to select n on - particularly those files plugin authors will edit the most: anything in src/ or test/.

However, files that are not commonly edited by plugin authors may deserve a diff check (d) if you've made changes to these sorts of files. For example, anything in scripts/.

Extra Tools

This generator provides some simple CLI programs that go beyond the basic generator behavior.

These programs can be used on any plugin project - not just those using the generator! They do not provide prompts or accept arguments or options; they do one thing only. The only expectation is that they are run in the project root of a video.js plugin (process.cwd()).

Cleanup with vjsgenclean

The generator is non-destructive: it will only add to or update your project. This script will remove files and package.json fields that were removed since the previous major version of the generator.

For example, if 1.x produced the file foo/bar.js, but 2.x does not, this script will delete it.

$ vjsgenclean

Validation with vjsplugincheck

This script supports validating a directory as following current video.js Plugin Standards. Using it is very simple; run the following command:

$ vjsplugincheck

License

Apache 2.0

generator-videojs-plugin's People

Contributors

brandonocasey avatar dmlap avatar incompl avatar misteroneill avatar soviut avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.