wearscript / wearscript-playground

Work in progress (home to the new playground, previous is in wearscript/server)
6 stars 10 forks source link

Wearscript Playground

http://github.com/OpenShades/wearscript-playground

About

The web-based IDE for WearScript. Write code, pair glass, save, and enjoy.

Requirements

Development

Initial Setup

  1. Clone repo and submodules

    git clone git@github.com:OpenShades/wearscript-playground.git
    cd wearscript-playground
    git submodule update --init
  2. Configure API server

    cp server/config.go.example server/config.go

    Edit server/config.go to be in single user mode.

  3. Compile API Server (requires a working Go environment)

    mkdir $HOME/go
    cd server
    sh install.sh
    cd ..
  4. Install CLI tools

    sudo npm install -g grunt-cli grunt bower yo generator-angular
  5. Install client and grunt build dependencies

    bower install
    npm install
  6. Find and install an 'editorconfig' plugin in your IDE of choice

    Optional but reccommended for code consistancy.

    See: http://editorconfig.org/#download

Building

  1. Install latest dependencies (if *.json files have changed)

    bower install
    npm install
  2. Compile

    grunt build

    Built version of application will be availible in the 'dist' directory.

Serving

To serve live uncompressed tree with live-reload on change:

grunt serve

To serve live compiled version:

grunt serve:dist

By default application will be accessible at http://YOUR_IP:9000

Extending

This setup is compatable with the yo angular generator.

You can use any "yo angular" commands to generate boilerplate complete with tests relevant to extension you want to make. You can of course just write anything by hand and these are only here as optional helpers.

Some common commands:

# Route
yo angular:route someroute

# Controller
yo angular:controller controllerName

# Directive
yo angular:directive directiveName

# Service
yo angular:service serviceName

# View
yo angular:view someview

Dependency Management

In order to manage third party open source dependencies and ensure compatibility and cross-dependency sanity, please use package managers.

As a general rule of thumb, if it is code you did not write and your project needs it, it probably should be handeled by a package manager and not committed to the repo. It also makes sure the git-stats are accurate which is valuable to track team progress.

To add a client-side javascript dependency do:

bower install some-awesome-library --save

This will update the 'bower.json' file and ensure other developers install this as well. It will also make best efforts to install a version of a library that is compatible with existing libraries being used in the project.

Testing

To run all current tests:

grunt test

To run e2e testing

grunt test:e2e

If you run into errors please ensure you have gconf and chromedriver installed globally

sudo npm install -g chromedriver
sudo apt-get install gconf

Further Reading

AngularJS Docs

AngularJS Book

AngularJS Style Guide

Angular Yo Generator Docs

Grunt Docs

Bower Docs