Skip to content

Work in progress (home to the new playground, previous is in wearscript/server)

Notifications You must be signed in to change notification settings

wearscript/wearscript-playground

Repository files navigation

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
```bash
git clone [email protected]:OpenShades/wearscript-playground.git
cd wearscript-playground
git submodule update --init
```
  1. Configure API server
```bash
cp server/config.go.example server/config.go
```

Edit server/config.go to be in single user mode.
  1. Compile API Server (requires a working Go environment)
```bash
mkdir $HOME/go
cd server
sh install.sh
cd ..
```
  1. Install CLI tools
```bash
sudo npm install -g grunt-cli grunt bower yo generator-angular
```
  1. Install client and grunt build dependencies
```bash
bower install
npm install
```
  1. 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)
```bash
bower install
npm install
```
  1. Compile
```bash
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

About

Work in progress (home to the new playground, previous is in wearscript/server)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published