Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	CHANGELOG.md
Artur Paikin 9 years ago
parent
commit
b0edc3006e
12 changed files with 200 additions and 108 deletions
  1. 2 0
      .gitignore
  2. 26 21
      .travis.yml
  3. 0 8
      .zuul.yml
  4. 21 19
      CHANGELOG.md
  5. 0 27
      bin/test
  6. 77 0
      bin/test-acceptance
  7. 24 1
      env.example.sh
  8. 24 24
      package.json
  9. 1 1
      src/plugins/Dropbox.js
  10. 23 5
      src/plugins/GoogleDrive.js
  11. 1 1
      test/multipart.spec.js
  12. 1 1
      website/themes/uppy/source/js/uppy.js

+ 2 - 0
.gitignore

@@ -19,3 +19,5 @@ npm-debug.log*
 website/themes/uppy/_config.yml
 
 config/
+
+nohup.out

+ 26 - 21
.travis.yml

@@ -1,36 +1,41 @@
 language: node_js
-
 node_js:
-  - 4.2.2
-
+- 4.2.2
 addons:
   apt:
     sources:
-      - ubuntu-toolchain-r-test
+    - ubuntu-toolchain-r-test
     packages:
-      - g++-4.8
-
+    - g++-4.8
+    - libnss3-dev
+    - libgconf-2-4
 cache:
   apt: true
   directories:
-    - node_modules
-    - website/node_modules
-
+  - node_modules
+  - website/node_modules
+before_script:
+- export PATH=${PATH}:${HOME}/bin
+- export DISPLAY=:99.0
+- /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile
+  --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16
 script:
-  - npm run build
-  - npm run test
-  # Automatically deploy website onto gh-pages (if master and not PR)
-  # Don't do this in `after_success`, because then failures won't bubble up
-  - git config --global user.name 'Uppy Bot'
-  - git config --global user.email 'uppybot@uppy.io'
-  - if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ]; then npm run web:deploy --quiet; else echo "Skipping for non-master/prs"; fi
-
+- npm run build
+- npm run test
+- npm run test:acceptance || true
+- git config --global user.name 'Uppy Bot'
+- git config --global user.email 'uppybot@uppy.io'
+- if [ "${TRAVIS_PULL_REQUEST}" == "false" ] && [ "${TRAVIS_BRANCH}" == "master" ];
+  then npm run web:deploy --quiet; else echo "Skipping for non-master/prs"; fi
 env:
   global:
-    - CXX=g++-4.8
-    # travis encrypt GHPAGES_URL=https://secret_access_token@github.com/transloadit/uppy.git
-    - secure: "Z+Twmk8/yo4FbeHqk3TcLVK4fR+KUoevrUxkRM6SLckVeCwlFnoD1kQ4JTVHuS2LbW9r2T4VJ/SC6yDtdjqMRvD/ZtPw//vMw9mKyBEMZN4uxOhmHp4hltkBErqeHbZpgd4eSwSVrqDwliK27Q42wIs+Rjilc3UXqddWEmmw/VuxGR3SRpACILqe2Fqm/g73iX/7PNNASuXwmWi6Vf5ZeBQTGiCfPETblBa4WSCrPpsBv5flUEGNM9uFoXXqjAC2TyZrS4yiFGxJNf5/UPp9xipr+RhoEp8NX2GP0W2jDDfUTHFGfcUyF2lluVJKpkHjYQYrYBknjTFcQHL+aE7GWU7f6kh4g3i6e9qktVFV7yNPPokxuvVG+AxExVhZHK3wBTh2ZWs5vjcd0u5w+IV9+v+d/CZWl/zGRcHDILt2eUW9KZwoGtgrcaPnlVtYPCRBXPpsoD+lE3uOuGGGS/V5lmhBnCLexj+2rzztyb8zhQgZB2rLKF1zQ5JiBE+z0ykjHtZWMECE7r4H8K4hoaeOlIG9suPSgwQgl5HFniFUBzHWXqdsOA/tAwGAtdYSlSNAPrkiMYqXjb+1Je2uhYnfV2roBolufLmgYjmDkpVtaY968Zi3qSYTDX7gkx4NEdkiZDLJK8iXXF5RlcHHaUlno+4ytvcNMpf6V9EpTVeLaIs="
-
+  - CXX=g++-4.8
+  - secure: o92bhAYmfSq6G4cpWcd8pbvmcL3cQFNXvXNmrdhWsbyaDJm29MHGNfM5d0AwRhw1X/mrIB7COG8QgK9OSYvFjFsHMKUhsryl5AWJS54535RzSV/NjQAZZvFJIf4SUhu5OEPxyMFrkCaaK1yWiWRaDRTwcjmHnkCJnhrcrtiOXPnbK+oTv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aOrfiFtwLctI2rFh37slDpAfk5idv3ycxcoG5rbCxgyg5i6dpQqrqHxnyglgHg2/nZ+YA5okeS7nJJNtU/4S6AFRWOUUWMVVY0VBEV+8w+uurl0PDy80RUY3uyK64qAgQ8U0M81/Ys1oyWyn78TqHcbby7V2Ws5I9Yakrq8D+mdfsWYCio8F6LXHSwJ0mt2FanJtdDvpPk9sAwsXZN0n8xhELt5TiRp3bzVIQ0IPUgF54dTG9/zWRvC1P4TFaFU/2fg73ZEUC5aWJoFMnLSZjbZvp5gwpCVd0MjSBk80nF9dHYcavIgJ0wMGI3BMb8Nn6+T11Gw/ycr7OGU4NMkj7i8vSFgKF74piWZyiNW8orkMN6XZgM+o=

+ 0 - 8
.zuul.yml

@@ -1,8 +0,0 @@
-ui: tape
-browsers:
-  - name: chrome
-    version: 27..latest
-  - name: ie
-    version: latest
-  - name: iphone
-    version: 6.1

+ 21 - 19
CHANGELOG.md

@@ -19,7 +19,6 @@ first Monday of every new month.
 Ideas that will be planned and find their way into a release at one point
 
 - [ ] build: go through it together again, remove unnecessary commands, simplify (related to “clean up package.json”). Discuss how contributors might use it, add to contributing and/or readme (https://github.com/sapegin/social-likes/blob/next/Contributing.md#building-and-running-tests) (@arturi, @hedgerh, @kvz)
-- [ ] build: investigate Rollup someday, for tree-shaking and smaller dist https://github.com/substack/node-browserify/issues/1379#issuecomment-183383199, https://github.com/nolanlawson/rollupify
 - [ ] build: look into using https://www.npmjs.com/package/npm-run-all instead of parallelshell
 - [ ] build: minification of the bundle
 - [ ] build: sourcemaps for everything (compiled es6->es5 module as well as bundle) (@arturi)
@@ -28,7 +27,6 @@ Ideas that will be planned and find their way into a release at one point
 - [ ] core: consider `virtual-dom` + `main-loop` or `yo-yo` for rendering and state management
 - [ ] core: Make sure Uppy works well in VR
 - [ ] instagram: Add basic Instagram plugin example (#21)
-- [ ] meta: Create an Uppy logo
 - [ ] modal: Avoid duplicating event listeners
 - [ ] modal: State: which tab is open? get parameters?
 - [ ] presets: Add basic preset that mimics Transloadit's jQuery plugin (#28)
@@ -40,49 +38,53 @@ Ideas that will be planned and find their way into a release at one point
 
 ## 0.0.5 (May 02, 2016)
 
-- [ ] build: try adding rollupify transform to “tree-shake” bundles
+- [ ] meta: Create an Uppy logo (@markstory)
+- [ ] build: investigate Rollup someday, for tree-shaking and smaller dist https://github.com/substack/node-browserify/issues/1379#issuecomment-183383199, https://github.com/nolanlawson/rollupify
 - [ ] core: Try to make Uppy work with React (add basic example) to remain aware of possible issues (@hedgerh), look at https://github.com/akiran/react-slick
 - [ ] meta: Consider using <waffle.io> instead of Markdown task tracking. Some discussion [here](https://transloadit.slack.com/archives/general/p1455693654000062) (@hedgerh, @arturi, @tim-kos, @kvz)
 - [ ] modal: polish on mobile
 - [ ] website: scrollbars on code samples (can’t reproduce!) (@arturi)
 - [ ] progressdrawer: let user cancel uploads in progress (@arturi)
+- [ ] test: Let Travis use the Remote WebDriver instead of the Firefox WebDriver (https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-Sauce-Labs), so Saucelabs can run our acceptance tests against a bunch of real browsers. Local acceptance tests keep using Firefox
 
 ## 0.0.4 (April 04, 2016)
 
-- [x] core: re-think running architecture: allow for `acquiring` while `uploading` (@arturi)
-- [x] core: allow for continuous `acquiring`, even after all plugins have “run” (@arturi, @hedgerh)
-- [x] core: start on component & event-based state management with `yo-yo` (@arturi)
-- [x] core: come up with a draft standard file format for internal file handling (@arturi)
 - [ ] google: Add basic Google Drive plugin example (working both in Modal, as without, via `target: "div#on-my-page"` (@hedgerh)
-- [ ] google: make use of server.uppy.io in examples; it's live now via Frey (@hedgerh)
-- [x] modal: covert to component & event-based state management (@arturi)
+- [ ] google: make use of http://server.uppy.io in examples; it's live now via Frey (@hedgerh)
 - [ ] modal: `focus` on the first input field / button in tab panel (@arturi)
-- [ ] presenter: show uploaded files with `yo-yo` (@arturi)
+- [ ] modal: show selected files, show uploaded files preview in presenter (@arturi)
 - [ ] progressdrawer: show file type names/icons for non-image files (@arturi)
-- [x] progressdrawer: show selected files (@arturi)
-- [x] progressdrawer: implement basic version, show upload progress for individual files (@arturi)
-- [x] progressdrawer: show previews for images (@arturi)
-- [x] server: Add a deploy target for uppy-server so we can use it in demos (#39, @kvz)
-- [ ] test: Add acceptance tests to Travis so they are run on every change
-- [ ] test: Fix and enable Saucelabs acceptance test. Write one actual test (e.g. Multipart). Enable it in `npm run test` so it's ran on Travis automatically (#2, #23, @hedgerh)
-- [x] test: Get saucelabs account https://saucelabs.com/beta/signup/OSS/None (@hedgerh)
+- [ ] test: Get Firefox acceptance tests up and running both local and on Travis CI. Currently both failing on `StaleElementReferenceError: Element not found in the cache - perhaps the page has changed since it was looked up` https://travis-ci.org/transloadit/uppy/builds/121175389#L478
 - [ ] test: Setup one modal/dragdrop acceptance test (@arturi)
+- [x] test: Write one actual test (e.g. Multipart) (#2, #23, @hedgerh)
+- [x] test: Switch to using Firefox for acceptable tests as Travis CI supports that (https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI) (@kvz)
+- [x] test: Add acceptance tests to Travis so they are run on every change (@kvz)
+- [x] allow for continuous `acquiring`, even after all plugins have “run” (@arturi, @hedgerh)
 - [x] build: clean up package.json. We've accumulated duplication and weirdness by hacking just for our current problem without keeping a wider view of what was already there (@arturi)
 - [x] build: fix browsersync & browserify double reloading issue (@arturi)
 - [x] build: sourcemaps for examples (@arturi)
 - [x] complete: `Complete` Plugin of type/stage: `presenter`. "You have successfully uploaded `3 files`". Button: Close modal. (@arturi)
+- [x] core: allow for continuous `acquiring`, even after all plugins have “run” (@arturi, @hedgerh)
+- [x] core: come up with a draft standard file format for internal file handling (@arturi)
 - [x] core: Pluralize collections (locales, just l like plugins) (@kvz)
+- [x] core: re-think running architecture: allow for `acquiring` while `uploading` (@arturi)
 - [x] core: Rename `progress` to `progressindicator` (@kvz)
 - [x] core: Rename `selecter` to `acquirer` (@kvz)
 - [x] core: Rename `view` to `orchestrator` (@kvz)
+- [x] core: start on component & event-based state management with `yo-yo` (@arturi)
 - [x] dragdrop: Fix 405 Not Allowed, (error) handling when you press Upload with no files (#60, @arturi, thx @hpvd)
 - [x] modal: `UppyModal [type=submit] { display: none }`, use Modal's own Proceed button to progress to next stage (@arturi)
-- [x] modal: Make sure modal renders under one dom node (@arturi, @hedgerh) — modal does, should everything else too?
+- [x] modal: covert to component & event-based state management (@arturi)
+- [x] modal: Make sure modal renders under one dom node — modal does, should everything else too? (@arturi, @hedgerh)
 - [x] modal: refactor and improve (@arturi)
+- [x] progressdrawer: implement basic version, show upload progress for individual files (@arturi)
+- [x] progressdrawer: show previews for images (@arturi)
+- [x] server: Add a deploy target for uppy-server so we can use it in demos (#39, @kvz)
+- [x] test: Get saucelabs account https://saucelabs.com/beta/signup/OSS/None (@hedgerh)
+- [x] test: Install chromedriver ()
 - [x] tus: Resolve promise when all uploads are done or failed, not earlier (currently you get to see '1 file uploaded' and can close the modal while the upload is in progress) (@arturi)
 - [x] website: Filter taglines (@kvz)
 - [x] website: utilize browserify index exposers to rid ourselves of `../../../..` in examples (@kvz)
-allow for continuous `acquiring`, even after all plugins have “run” (@arturi, @hedgerh)
 
 ## 0.0.3 (March 01, 2016)
 

+ 0 - 27
bin/test

@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-set -o pipefail
-set -o errexit
-set -o nounset
-set -o xtrace
-
-# Set magic variables for current file & dir
-__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
-__base="$(basename ${__file} .sh)"
-
-# Move into a known directory
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-cd ${DIR}/..
-
-npm run test:phantom
-result=${?}
-if [ "$result" = 0 ]; then
-  if [ "${CI}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
-    npm run zuul-test
-    result=$?
-  else
-    echo "Skipping zuul-test as this is not a master CI branch test run"
-  fi
-fi
-
-exit ${result}

+ 77 - 0
bin/test-acceptance

@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+set -o pipefail
+set -o errexit
+set -o nounset
+# set -o xtrace
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
+__root="$(cd "$(dirname "${__dir}")" && pwd)"
+
+if [ ! -f "${__root}/env.sh" ]; then
+  cp "${__root}/env.example.sh" "${__root}/env.sh"
+fi
+if [ "${UPPYSERVER_DROPBOX_KEY:-}" = "" ] || [ "${UPPYSERVER_DROPBOX_KEY:-***}" = "***" ]; then
+  source "${__root}/env.sh"
+fi
+if [ "${UPPYSERVER_DROPBOX_KEY:-}" = "" ] || [ "${UPPYSERVER_DROPBOX_KEY:-***}" = "***" ]; then
+  echo "Env var UPPYSERVER_DROPBOX_KEY still had the example value '${UPPYSERVER_DROPBOX_KEY:-}'. "
+  echo "Please save the actual secrets in '${__root}/env.sh' and try again"
+  exit 1
+fi
+
+function killProcessListeningOnPort () {
+  local port="${1}"
+  lsof -n -i4TCP:${port} | awk '/LISTEN/ {print $2}' |xargs kill -9
+}
+
+function waitForPortOpen () {
+  local port="${1}"
+  local limit="${2:-60}"
+  local attempts=0
+  echo "waiting on port ${port} to open... "
+  while ! echo exit | nc localhost ${port}; do
+    let "attempts = attempts + 1"
+    echo "still waiting on port ${port} to open... (${attempts} / ${limit}) "
+    sleep 1
+    if [ "${attempts}" -ge "${limit}" ]; then
+      echo "--> Port did not open for ${limit} seconds. Aborting. "
+      exit 1
+    fi
+  done
+}
+
+rm -f nohup.out || true
+
+echo "--> Killing any server listening on port 4000"
+killProcessListeningOnPort 4000 || true
+echo "--> Killing any server listening on port 8080"
+killProcessListeningOnPort 8080 || true
+
+echo "--> Start webserver and uppy-server in the background"
+nohup npm run start &
+
+function dump_logs_before_exit () {
+  echo "--> Killing any server listening on port 4000"
+  killProcessListeningOnPort 4000 || true
+
+  echo "--> Killing any server listening on port 8080"
+  killProcessListeningOnPort 8080 || true
+
+  if [ -f nohup.out ]; then
+    echo "--> Dumping server logs"
+    cat nohup.out
+  fi
+}
+trap dump_logs_before_exit EXIT
+
+echo "--> Wait for hexo webserver to come online"
+waitForPortOpen 4000
+
+echo "--> Wait for uppy-server to come online"
+waitForPortOpen 8080
+
+echo "--> Running acceptance tests"
+node test/multipart.spec.js

+ 24 - 1
env.example.sh

@@ -1 +1,24 @@
-export GHPAGES_URL=https://GITHUB_SECRET_ACCESS_TOKEN@github.com/transloadit/uppy.git
+# Rename this file to env.sh, it will be kept out of Git.
+# So suitable for adding secret keys and such
+
+# Set magic variables for current FILE & DIR
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
+__rootdir="${__dir}"
+
+export NODE_ENV="${NODE_ENV:-development}"
+export UPPYSERVER_DROPBOX_KEY="***"
+export UPPYSERVER_DROPBOX_SECRET="***"
+export UPPYSERVER_GOOGLE_KEY="***"
+export UPPYSERVER_GOOGLE_SECRET="***"
+export UPPYSERVER_INSTAGRAM_KEY="***"
+export UPPYSERVER_INSTAGRAM_SECRET="***"
+
+# source env.sh
+# travis encrypt --add env.global "UPPYSERVER_DROPBOX_KEY=${UPPYSERVER_DROPBOX_KEY}"
+# travis encrypt --add env.global "UPPYSERVER_DROPBOX_SECRET=${UPPYSERVER_DROPBOX_SECRET}"
+# travis encrypt --add env.global "UPPYSERVER_GOOGLE_KEY=${UPPYSERVER_GOOGLE_KEY}"
+# travis encrypt --add env.global "UPPYSERVER_GOOGLE_SECRET=${UPPYSERVER_GOOGLE_SECRET}"
+# travis encrypt --add env.global "UPPYSERVER_INSTAGRAM_KEY=${UPPYSERVER_INSTAGRAM_KEY}"
+# travis encrypt --add env.global "UPPYSERVER_INSTAGRAM_SECRET=${UPPYSERVER_INSTAGRAM_SECRET}"

+ 24 - 24
package.json

@@ -4,39 +4,41 @@
   "description": "Almost as cute as a Puppy :dog:",
   "main": "src/index.js",
   "scripts": {
-    "start": "parallelshell 'npm run watch' 'npm run start:server' 'npm run web:preview'",
-    "start:server": "uppy-server --port 3002",
-    "clean": "rm -rf lib && rm -rf dist",
-    "docs": "cd website && documentation readme ../src/index.js --readme-file=src/api/docs.md --section 'Uppy Core & Plugins' -q --github -c doc-order.json",
-    "lint": "eslint .",
-    "lint:fix": "eslint . --fix",
-    "test": "npm run lint && npm run test:unit",
-    "test:acceptance": "node test/multipart.spec.js",
-    "test:unit": "node test/index.js",
-    "build": "npm run build:lib && npm run build:bundle && npm run build:bundle:min && npm run build:css",
-    "build:js": "npm run build:lib && npm run build:bundle && npm run build:bundle:min",
-    "build:css": "bin/build-css",
-    "build:lib": "babel src -d lib --stage 0",
     "build:bundle:fullpath": "env OUT=uppy-fp.js ./bin/build-bundle --full-paths",
     "build:bundle:min": "./bin/build-bundle",
     "build:bundle": "./bin/build-bundle && ./bin/build-bundle-locales",
-    "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish",
+    "build:css": "bin/build-css",
+    "build:js": "npm run build:lib && npm run build:bundle && npm run build:bundle:min",
+    "build:lib": "babel src -d lib --stage 0",
+    "build": "npm run build:lib && npm run build:bundle && npm run build:bundle:min && npm run build:css",
+    "clean": "rm -rf lib && rm -rf dist",
+    "docs": "cd website && documentation readme ../src/index.js --readme-file=src/api/docs.md --section 'Uppy Core & Plugins' -q --github -c doc-order.json",
+    "install": "npm run web:install",
+    "lint:fix": "eslint . --fix",
+    "lint": "eslint .",
     "release:major": "env SEMANTIC=major npm run release",
     "release:minor": "env SEMANTIC=minor npm run release",
     "release:patch": "env SEMANTIC=patch npm run release",
-    "watch": "parallelshell 'npm run watch:js' 'npm run watch:css' && node website/update.js",
+    "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && git push && git push --tags && npm publish",
+    "start:server": "uppy-server --port 8080",
+    "start": "parallelshell 'npm run watch' 'npm run start:server' 'npm run web:preview'",
+    "test:acceptance": "bin/test-acceptance",
+    "test:unit": "node test/index.js",
+    "test": "npm run lint && npm run test:unit",
+    "travis:deletecache": "travis cache --delete",
+    "watch:css": "nodemon --watch src --ext scss -x 'npm run build:css && node website/update.js'",
     "watch:fast": "parallelshell 'npm run watch:css' 'npm run web:preview'",
     "watch:js": "nodemon --watch src --ext js -x 'npm run build:bundle && node website/update.js'",
-    "watch:css": "nodemon --watch src --ext scss -x 'npm run build:css && node website/update.js'",
-    "web": "npm run web:install && npm run web:clean && npm run web:build",
-    "web:kill": "killall -9 node; lsof -n -i4TCP:4000 | awk '/LISTEN/ {print $2}' |xargs kill -9",
-    "web:preview": "cd website && parallelshell 'node build-examples.js watch' './node_modules/.bin/hexo server'",
+    "watch": "parallelshell 'npm run watch:js' 'npm run watch:css' && node website/update.js",
     "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",
     "web:clean": "cd website && ./node_modules/.bin/hexo clean",
     "web:deploy": "npm run web:install && npm run web:disc && npm run docs && npm run web:build && ./bin/web-deploy",
     "web:disc": "npm run build:bundle:fullpath && discify dist/uppy-fp.js --output website/src/_disc.html && echo '---\nlayout: false\n---\n' |cat - website/src/_disc.html > website/src/disc.html && rm website/src/_disc.html",
     "web:install": "cd website && npm install",
-    "web:update:frontpage:code:sample": "cd website && ./node_modules/.bin/hexo generate && cp -f public/frontpage-code-sample.html ./themes/uppy/layout/partials/frontpage-code-sample.html"
+    "web:kill": "killall -9 node; lsof -n -i4TCP:4000 | awk '/LISTEN/ {print $2}' |xargs kill -9",
+    "web:preview": "cd website && parallelshell 'node build-examples.js watch' './node_modules/.bin/hexo server'",
+    "web:update:frontpage:code:sample": "cd website && ./node_modules/.bin/hexo generate && cp -f public/frontpage-code-sample.html ./themes/uppy/layout/partials/frontpage-code-sample.html",
+    "web": "npm run web:clean && npm run web:build"
   },
   "repository": {
     "type": "git",
@@ -66,12 +68,10 @@
     "node-sass": "3.4.2",
     "nodemon": "1.8.1",
     "parallelshell": "2.0.0",
-    "phantomjs": "1.9.18",
     "selenium-webdriver": "^2.52.0",
     "tape": "4.4.0",
-    "uppy-server": "0.0.1",
-    "watchify": "3.6.1",
-    "zuul": "3.7.2"
+    "uppy-server": "0.0.2",
+    "watchify": "3.6.1"
   },
   "dependencies": {
     "drag-drop": "2.11.0",

+ 1 - 1
src/plugins/Dropbox.js

@@ -24,7 +24,7 @@ export default class Dropbox extends Plugin {
   }
 
   getDirectory () {
-    // request.get('//localhost:3002/dropbox/readdir')
+    // request.get('//localhost:8080/dropbox/readdir')
     //   .query(opts)
     //   .set('Content-Type', 'application/json')
     //   .end((err, res) => {

+ 23 - 5
src/plugins/GoogleDrive.js

@@ -1,3 +1,4 @@
+import yo from 'yo-yo'
 import Utils from '../core/Utils'
 import Plugin from './Plugin'
 
@@ -130,14 +131,31 @@ export default class Google extends Plugin {
     return
   }
 
+  render (state) {
+    if (state.authenticated) {
+      this.renderBrowser()
+    } else {
+      this.renderAuth(state)
+    }
+  }
+
   renderAuth () {
-    return `<div><h1>Authenticate With Google Drive</h1><a href=${this.authUrl || '#'}>Authenticate</a></div>`
+    return yo`
+      <div>
+        <h1>Authenticate With Google Drive</h1>
+        <a href=${this.authUrl || '#'}>Authenticate</a>
+      </div>
+    `
   }
 
-  renderBrowser (data) {
-    const folders = data.folders.map((folder) => `<li>Folder<button class="GoogleDriveFolder" data-id="${folder.id}" data-title="${folder.title}">${folder.title}</button></li>`)
-    const files = data.files.map((file) => `<li><button class="GoogleDriveFile" data-id="${file.id}" data-title="${file.title}">${file.title}</button></li>`)
-    return `<ul>${folders}</ul><ul>${files}</ul>`
+  renderBrowser (state) {
+    const folders = state.folders.map((folder) => `<li>Folder<button class="GoogleDriveFolder" data-id="${folder.id}" data-title="${folder.title}">${folder.title}</button></li>`)
+    const files = state.files.map((file) => `<li><button class="GoogleDriveFile" data-id="${file.id}" data-title="${file.title}">${file.title}</button></li>`)
+
+    return yo`
+      <ul>${folders}</ul>
+      <ul>${files}</ul>
+    `
   }
 
   renderError (err) {

+ 1 - 1
test/multipart.spec.js

@@ -6,7 +6,7 @@ var By = webdriver.By
 test('upload two files', function (t) {
   // Create a new webdriver instance
   var driver = new webdriver.Builder()
-    .withCapabilities(webdriver.Capabilities.chrome())
+    .withCapabilities(webdriver.Capabilities.firefox())
     .build()
 
   driver.get('http://localhost:4000/examples/multipart/')

+ 1 - 1
website/themes/uppy/source/js/uppy.js

@@ -2375,7 +2375,7 @@ var Dropbox = (function (_Plugin) {
       var opts = {
         dir: 'pizza'
       };
-      _superagent2['default'].get('//localhost:3002/dropbox/readdir').query(opts).set('Content-Type', 'application/json').end(function (err, res) {
+      _superagent2['default'].get('//localhost:8080/dropbox/readdir').query(opts).set('Content-Type', 'application/json').end(function (err, res) {
         console.log(err);
         console.log('yo!');
         console.log(res);