Stub project for initializing a Cinema6 JS project using ECMAScript 6 (ES6.) This will seed a web-app boilerplate organized to fit into the overall embedding architecture. It uses Grunt to run common development and build processes.
- Clone this repo:
$> git clone git@bitbucket.org:cinema6/es6-stub.git my-new-app
- Set up as a new git repo:
$> cd my-new-app && rm -rf .git && git init .
- Add GitHub as a remote
$> git remote add origin git@github.com:cinema6/my-new-app.git
- Initialize as a new NPM repo
$> npm init
- Add the files in the repo
$> git commit -am "Initial commit."
- Push to Github!
$> git push origin --all -u
- Install node
- Install Grunt
$> npm install -g grunt-cli
- Install dependenices
$> npm install
- Follow steps for installing development dependencies
- Clone the Closure Compiler Repo:
$> git clone git@github.com:google/closure-compiler.git
- Build the compiler
- Create an environment variable called
CLOSURE_PATH
that points to the location of the closure compiler git repository
There are many .jshintrc
files in the project (used to give different configuration to the differing environments.) To find them all, run this command:
$> find . -path ./node_modules -prune -o -name ".jshintrc" -print
This file should be stored in a location where it can be accessed by many applications (usually your home directory.) It should have the following properties:
- accessKeyId
- secretAccessKey
- region
The name and keywords in this file are used to configure certain application settings and defaults.
This task will generate and log a Cinema6-formatted UUID with the supplied prefix.
ex:
$> grunt genid:e
Running "genid:e" (genid) task
e-6c7ed80e3d68ac
$> grunt genid:o
Running "genid:o" (genid) task
o-df80d6438ab29c
This task will start a development server that uses c6embed. Your application will be embedded in a friendly iframe, and the Cinema6 postMessage API will be available.
ex:
$> grunt server
This task, in addition to starting a development server (just like the server
task,) will also run unit tests whenever a source/test file changes.
ex:
$> grunt server --tdd
This task will check your JS files for lint and execute the unit tests
ex:
$> grunt test:unit
This task will check your JS files for lint and execute the performance tests
ex:
$> grunt test:perf
This task will watch your JS files for changes. If a file is changed, the unit tests will be re-executed.
ex:
$> grunt tdd
This task will build and upload the application to the specified environment on S3.
ex:
$> grunt publish:staging #Upload app to staging server
$> grunt publish:production #Upload app to production server