Skip to content

Commit

Permalink
Merge pull request #242 from leapmotion/update-2020
Browse files Browse the repository at this point in the history
[FEAT] Prune and Upgrade Dependencies; Add Github Actions
  • Loading branch information
RecursiveCptHook authored Nov 23, 2020
2 parents 56576ce + dad1d3b commit f2c4856
Show file tree
Hide file tree
Showing 46 changed files with 33,955 additions and 39,048 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: leapjs - Build Library and Run Unit Tests

on: [push, pull_request]

jobs:
build:
name: Build Library and Run Unit Tests
runs-on: ubuntu-latest
steps:

# Checkout
- name: Checkout repository
uses: actions/checkout@v2

# Install Node
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'

# Install Dependencies
- name: Install NPM Dependencies
run: npm ci

# Build and Run Tests
- name: Build Library and Run Tests
run: ./node_modules/.bin/grunt test

# Commit All Build Artifacts
- name: Commit Build Artifacts
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
set +e
git add *
git diff-index --quiet HEAD || git commit -m "Build Leap.js"
# Push Build Artifacts
- name: Push Changes to branch
id: push-build
uses: ad-m/github-push-action@master
continue-on-error: true
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

# Reenable Errors
- name: Clean Up
if: steps.push-build.outcome == 'success' && steps.push-build.conclusion == 'success'
run: set -e
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function(grunt){
\n * LeapJS v<%= pkg.version %> \
\n * http://github.com/leapmotion/leapjs/ \
\n * \
\n * Copyright 2013 LeapMotion, Inc. and other contributors \
\n * Copyright 2020 Ultraleap, Inc. and other contributors \
\n * Released under the Apache-2.0 license \
\n * http://github.com/leapmotion/leapjs/blob/master/LICENSE \
\n */";
Expand Down Expand Up @@ -95,9 +95,9 @@ module.exports = function(grunt){

},
exec: {
'test-browser': './node_modules/.bin/mocha-chrome -R dot test/helpers/browser.html',
'test-browser': '"./node_modules/.bin/mocha-headless-chrome" -r dot -f test/helpers/browser.html',
// -i -g stands for inverse grep. Tests tagged browser-only will be excluded.
'test-node': './node_modules/.bin/mocha lib/index.js test/helpers/node.js test/*.js -R dot -i -g browser-only',
'test-node': '"./node_modules/.bin/mocha" lib/index.js test/helpers/node.js test/*.js -R dot -i -g browser-only',
'test-integration': 'node integration_test/reconnection.js && node integration_test/protocol_versions.js'
}
});
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test: build test-only
test-only: test-node test-browser test-integration

test-browser:
./node_modules/.bin/mocha-chrome -R dot test/helpers/browser.html
"./node_modules/.bin/mocha-headless-chrome" -r dot -f test/helpers/browser.html

test-node:
./node_modules/.bin/mocha lib/index.js test/helpers/node.js test/*.js -R dot
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "leapjs",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/leapmotion/leapjs",
"description": "JavaScript client for the Leap Motion Controller",
"main": "leap-1.0.0.js",
"main": "leap-1.1.0.js",
"keywords": [
"leap",
"leapmotion",
Expand Down
2 changes: 1 addition & 1 deletion examples/css-visualizer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<title>DOM Visualizer - Leap</title>
<script src="../leap-1.0.0.js"></script>
<script src="../leap-1.1.0.js"></script>
<script>
function moveFinger(Finger, posX, posY, posZ) {
Finger.style.webkitTransform = "translate3d("+posX+"px, "+posY+"px, "+posZ+"px)";
Expand Down
2 changes: 1 addition & 1 deletion examples/dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
</style>
-->
<script src="../leap-1.0.0.js"></script>
<script src="../leap-1.1.0.js"></script>
<script>

var controller = (new Leap.Controller);
Expand Down
4 changes: 2 additions & 2 deletions examples/dumper.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<title>Dumper - Leap</title>
<script src="../leap-1.0.0.js"></script>
<script src="../leap-1.1.0.js"></script>
<script>
console.log("LeapJS v" + Leap.version.full);
var state = 'play';
Expand All @@ -15,7 +15,7 @@
}
};
var haveLoggedFrame = false;
var controller = new Leap.Controller({enableGestures: true});
var controller = new Leap.Controller();
controller.loop(function(frame) {
if (state == 'paused') return;
if (state == 'pausing') {
Expand Down
99 changes: 0 additions & 99 deletions examples/gestures.html

This file was deleted.

2 changes: 1 addition & 1 deletion examples/iframe.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<html>
<head>
<title>iFrame - Leap</title>
<script src="../leap-1.0.0.js"></script>
<script src="../leap-1.1.0.js"></script>
</head>
<body>
<!-- Demonstrates https://github.com/leapmotion/leapjs/issues/176 -->
Expand Down
3 changes: 1 addition & 2 deletions examples/lib/leap-plugins-0.1.6.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ function Recording (options){
'id',
'timestamp',
// this should be replace/upgraded with a whitelist instead of a blacklist.
// leaving out r,s,y, and gestures
// leaving out r,s,y
{hands: [[
'id',
'type',
Expand Down Expand Up @@ -1699,7 +1699,6 @@ Recording.prototype = {
finalFrame.hands = [];
finalFrame.fingers = [];
finalFrame.pointables = [];
finalFrame.tools = [];
this.sendImmediateFrame(finalFrame);
},

Expand Down
Loading

0 comments on commit f2c4856

Please sign in to comment.