Bladeren bron

Merge branch 'master' of https://github.com/transloadit/uppy into font_family

todd 6 jaren geleden
bovenliggende
commit
1f8e52106e
100 gewijzigde bestanden met toevoegingen van 2068 en 671 verwijderingen
  1. 0 1
      .babelrc
  2. 4 6
      .eslintignore
  3. 1 0
      .gitignore
  4. 37 9
      CHANGELOG.md
  5. 11 13
      README.md
  6. 0 13
      bin/build-css
  7. 66 52
      bin/build-css.js
  8. 2 2
      bin/build-js.js
  9. 35 0
      bin/build-lib.js
  10. 1 1
      bin/disc.js
  11. 20 17
      bin/endtoend-build
  12. 57 0
      bin/endtoend-build-ci
  13. 1 1
      bin/gzip.js
  14. 29 0
      bin/release
  15. 11 12
      bin/upload-to-cdn.sh
  16. 3 3
      examples/aws-presigned-url/main.js
  17. 2 2
      examples/aws-presigned-url/serve.js
  18. 0 7
      examples/aws-uppy-server/aliasify.js
  19. 5 5
      examples/aws-uppy-server/main.js
  20. 5 1
      examples/aws-uppy-server/package.json
  21. 9 7
      examples/bundled-example/main.js
  22. 16 0
      examples/bundled-example/package.json
  23. 2 2
      examples/cdn-example/index.html
  24. 4 4
      examples/custom-provider/client/MyCustomProvider.js
  25. 0 7
      examples/custom-provider/client/aliasify.js
  26. 4 4
      examples/custom-provider/client/main.js
  27. 5 1
      examples/custom-provider/package.json
  28. 3 3
      examples/digitalocean-spaces/main.js
  29. 2 2
      examples/digitalocean-spaces/server.js
  30. 0 7
      examples/multiple-instances/aliasify.js
  31. 3 3
      examples/multiple-instances/main.js
  32. 537 0
      examples/multiple-instances/package-lock.json
  33. 5 1
      examples/multiple-instances/package.json
  34. 4 4
      examples/react-example/App.js
  35. 0 7
      examples/react-example/aliasify.js
  36. 5 1
      examples/react-example/package.json
  37. 0 7
      examples/redux/aliasify.js
  38. 4 4
      examples/redux/main.js
  39. 5 1
      examples/redux/package.json
  40. 2 2
      examples/uppy-with-server/client/index.html
  41. 0 7
      examples/xhr-bundle/aliasify.js
  42. 3 3
      examples/xhr-bundle/main.js
  43. 5 1
      examples/xhr-bundle/package.json
  44. 8 0
      lerna.json
  45. 3 0
      locales/README.md
  46. 0 0
      locales/cs_CZ.js
  47. 0 0
      locales/de_DE.js
  48. 0 0
      locales/en_US.js
  49. 0 0
      locales/es_ES.js
  50. 0 0
      locales/fi_FI.js
  51. 0 0
      locales/id_ID.js
  52. 0 0
      locales/it_IT.js
  53. 0 0
      locales/nb_NO.js
  54. 0 0
      locales/pl_PL.js
  55. 0 0
      locales/pt_BR.js
  56. 0 0
      locales/ru_RU.js
  57. 0 0
      locales/tr_TR.js
  58. 0 0
      locales/zh_CN.js
  59. 398 304
      package-lock.json
  60. 58 113
      package.json
  61. 21 0
      packages/@uppy/aws-s3-multipart/LICENSE
  62. 41 0
      packages/@uppy/aws-s3-multipart/README.md
  63. 37 0
      packages/@uppy/aws-s3-multipart/package.json
  64. 0 0
      packages/@uppy/aws-s3-multipart/src/MultipartUploader.js
  65. 6 7
      packages/@uppy/aws-s3-multipart/src/index.js
  66. 34 0
      packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts
  67. 28 0
      packages/@uppy/aws-s3-multipart/types/index.d.ts
  68. 21 0
      packages/@uppy/aws-s3/LICENSE
  69. 42 0
      packages/@uppy/aws-s3/README.md
  70. 36 0
      packages/@uppy/aws-s3/package.json
  71. 9 4
      packages/@uppy/aws-s3/src/index.js
  72. 11 0
      packages/@uppy/aws-s3/types/aws-s3-tests.ts
  73. 25 0
      packages/@uppy/aws-s3/types/index.d.ts
  74. 21 0
      packages/@uppy/core/LICENSE
  75. 43 0
      packages/@uppy/core/README.md
  76. 33 0
      packages/@uppy/core/package.json
  77. 1 1
      packages/@uppy/core/src/Plugin.js
  78. 0 0
      packages/@uppy/core/src/__snapshots__/index.test.js.snap
  79. 5 0
      packages/@uppy/core/src/_common.scss
  80. 0 0
      packages/@uppy/core/src/_utils.scss
  81. 0 0
      packages/@uppy/core/src/_variables.scss
  82. 9 7
      packages/@uppy/core/src/index.js
  83. 8 8
      packages/@uppy/core/src/index.test.js
  84. 3 0
      packages/@uppy/core/src/style.scss
  85. 13 0
      packages/@uppy/core/types/core-tests.ts
  86. 129 0
      packages/@uppy/core/types/index.d.ts
  87. 21 0
      packages/@uppy/dashboard/LICENSE
  88. 50 0
      packages/@uppy/dashboard/README.md
  89. 42 0
      packages/@uppy/dashboard/package.json
  90. 0 0
      packages/@uppy/dashboard/src/ActionBrowseTagline.js
  91. 1 1
      packages/@uppy/dashboard/src/Dashboard.js
  92. 0 0
      packages/@uppy/dashboard/src/FileCard.js
  93. 3 3
      packages/@uppy/dashboard/src/FileItem.js
  94. 0 0
      packages/@uppy/dashboard/src/FileItemProgress.js
  95. 0 0
      packages/@uppy/dashboard/src/FileList.js
  96. 0 0
      packages/@uppy/dashboard/src/FilePreview.js
  97. 0 0
      packages/@uppy/dashboard/src/Tabs.js
  98. 0 0
      packages/@uppy/dashboard/src/copyToClipboard.js
  99. 0 0
      packages/@uppy/dashboard/src/copyToClipboard.test.js
  100. 0 0
      packages/@uppy/dashboard/src/getFileTypeIcon.js

+ 0 - 1
.babelrc

@@ -7,7 +7,6 @@
   ],
   "plugins": [
     "transform-object-assign",
-    "es6-promise",
     ["transform-react-jsx", { "pragma":"h" }]
   ]
 }

+ 4 - 6
.eslintignore

@@ -1,10 +1,8 @@
-dist/**
-lib/**
-src/vendor/**
-node_modules/**
+node_modules
+lib
+dist
+coverage/**
 test/lib/**
-playground/**
-website/node_modules/**
 website/private_modules/hexo-renderer-uppyexamples/node_modules/**
 website/public/**
 website/themes/uppy/source/js/smooth-scroll.min.js

+ 1 - 0
.gitignore

@@ -23,3 +23,4 @@ nohup.out
 
 examples/bundled-example/bundle.js
 uppy-*.tgz
+.eslintcache

+ 37 - 9
CHANGELOG.md

@@ -70,23 +70,28 @@ PRs are welcome! Please do open an issue to discuss first if it's a big feature,
 - [ ] core: I think there is a use case for having a single-use mode or something for Uppy, where pressing "Upload" locks it down (no new files can be added) and once the upload is finished it's just done. especially with the Form plugin
 - [] dashboard: hiding pause/resume from the UI by default (with option) would be good too probably (we could auto pause and show a resume button when detecting a network change to a metered network using https://devdocs.io/dom/networkinformation/type)
 - [ ] test: Add a prepublish test that checks if `npm pack` is not massive
+- [ ] Add release documentation. eg: test on transloadit website, check examples on the uppy.io website
 
 ## 1.0 Goals
 
 What we need to do to release Uppy 1.0
 
 - [ ] website: big release blog post
+- [ ] website: add 2 real world demos (avatar, form elements: github-comment-style-textarea)
 - [ ] chore: hunt down all `@TODO`s and either fix, or remove, or move to github issues/changelog backlog
 - [ ] chore: remove dead code/commented blocks
+- [ ] chore: remove the not-working npm scripts
 - [ ] chore: rewrite all code based on prettier+standardjs.com
-- [ ] ~refactoring: Make `uppy-server` module live in main Uppy repo in `./server` as a second stage todo (after Lerna is done and we're happy) (@ife)
+- [ ] core: uppy should not crash or be slow for many files. Specifically: be able to drop 5 files (or 7mb) without the upload button to take 2 seconds to appear
 - [ ] QA: manually test in multiple browsers and mobile devices again (SauceLabs can do Android/iOS too) (@nqst)
-- [ ] QA: add one integration test that uses a Webpack and React/Redux environment (e.g. via `create-react-app`) (@goto-bus-stop)
 - [ ] QA: add one integration test that uses a Provider (investigate if possible with a dedicated Google Drive API key for uppy server, so _with_ oauth dance) (@ife)
 - [ ] QA: add one integration test that uses more exotic (tus) options such as `useFastRemoteRetry` (@arturi)
 - [ ] feature: preset for Transloadit that mimics jQuery SDK, check https://github.com/transloadit/jquery-sdk docs (@goto-bus-stop)
+- [ ] dashboard: implement Alex' redesign (@arturi)
 - [ ] feature: basic React Native support (@arturi owner+ios, @ife android)
-- [ ] refactoring: split uppy into small packages, Lerna.js repo? and figure out how to share styles (during work, maybe add PR warning in `.github/*`? use `git mv` for everything) (@goto-bus-stop, @arturi)
+- [ ] QA: add one integration test that uses a Webpack and React/Redux environment (e.g. via `create-react-app`) (@goto-bus-stop)
+- [ ] refactoring: Make `uppy-server` module live in main Uppy repo in `./server` as a second stage todo (after Lerna is done and we're happy) (@ife)
+- [x] refactoring: split uppy into small packages, Lerna.js repo? and figure out how to share styles (during work, maybe add PR warning in `.github/*`? use `git mv` for everything) (@goto-bus-stop, @arturi)
 - [x] QA: make it so that all integration tests use `npm pack` and `npm install` first (@ife)
 - [x] docs: on using plugins, all options, list of plugins, i18n
 - [x] feature: beta file recovering after closed tab / browser crash
@@ -105,9 +110,7 @@ What we need to do to release Uppy 1.0
 
 # next
 
-# 0.26.0
-
-To Be Released: 2018-06-28.
+## 0.27.0
 
 - [ ] dashboard: allow minimizing the Dashboard during upload (Uppy then becomes just a tiny progress indicator) (@arturi)
 - [ ] core: customizing metadata fields, boolean metadata; see #809, #454 and related (@arturi)
@@ -123,8 +126,30 @@ To Be Released: 2018-06-28.
 - [ ] core: look into utilizing https://github.com/que-etc/resize-observer-polyfill for responsive components. See also https://github.com/transloadit/uppy/issues/750
 - [ ] core: use Browserslist config to share between PostCSS, Autoprefixer and Babel https://github.com/browserslist/browserslist, https://github.com/amilajack/eslint-plugin-compat (@arturi)
 - [ ] core: utilize https://github.com/jonathantneal/postcss-preset-env, maybe https://github.com/jonathantneal/postcss-normalize (@arturi)
-- [x] thumbnailgenerator: Polyfill Math.log2 since IE11 doesn't support this method (#892 / @DJWassink)
-- [x] xhrupload: Add `withCredentials` option (#874 / @tuoxiansp)
+- [ ] core: default `autoProceed` to `false`
+
+## 0.26.0
+
+Released: 2018-06-28.
+
+- ⚠️ **breaking** split into many packages (#906 / @goto-bus-stop, @arturi)
+- xhr-upload: Add `withCredentials` option (#874 / @tuoxiansp)
+- utils: Move single-use utils into their appropriate packages. (#926 / @goto-bus-stop)
+- core: Export Plugin class from @uppy/core (#924 / @goto-bus-stop)
+- Typescript typings improvements (#923 / @goto-bus-stop)
+- core: change focus to solid line for all elements (ade214e5aab822e1fc3ab8e0fac80c4fc04d7bc3 / @arturi)
+- dashboard: fix Dashboards tabs overflow by adding scroll; improve scroll (b974244c7f4e01adcf2478b7f651dada63d342f1 / @arturi)
+
+## 0.25.6
+
+Released: 2018-06-25.
+
+- core: ⚠️ **breaking** rename `host` option to `serverUrl` (#905 / @ifedapoolarewaju)
+- dashboard: added browser back button listening (#575 / @zcallan)
+- core: Split utils into separate files (#899 / @goto-bus-stop)
+- providers: Better provider errors (#895 / @arturi)
+- instagram: better thumbnail quality for ig (#901, #887 / @ifedapoolarewaju)
+- core: add `types` to uppy npm package (#0c2d66e8ac005d6a4200948de1bc3a44057f0393 / @arturi)
 
 ## 0.25.5
 
@@ -147,7 +172,7 @@ Released: 2018-06-12.
 - tests: run integration tests with npm-installed uppy (#880 / @ifedapoolarewaju)
 - xhrupload: add withCredentials option (#874 / @tuoxiansp, @b1ncer)
 - xhrupload: Move .withCredentials assignment to after open(): IE 10 doesn't allow setting it before open() is called (#2698b599d716743bbf7ed3ac70c648fef0fd8976 / @goto-bus-stop)
-- thumbnailgenerator: Updated ThumbnailGenerator to work with IE (#4ddc9da47b13c9dfe49155d8c3bcd76b9fa494f2 / @DJWassink)
+- thumbnailgenerator: Polyfill Math.log2 since IE11 doesn't support this method (#4ddc9da47b13c9dfe49155d8c3bcd76b9fa494f2. #892 / @DJWassink)
 - core: add eslint-plugin-compat (@goto-bus-stop, #894)
 - dashboard: remove Dashboard bottom margin, since “powered by” has been moved (#a561e4e7a2c18f5092ba03185e0836ffa6796d04 / @arturi)
 - dashboard: fix Dashboard open/close animation on small screen (#982d27f62693c0eb026e381d10157afffe1eeb64 / @arturi)
@@ -216,6 +241,9 @@ Changed strings:
 - webcam: swap record/stop button icons, fixes #859 (#fdcca95 / @arturi)
 - xhrupload: fix bytesUploaded and bytesTotal for bundled progress (#864 / @arturi)
 - xhrupload: fix retry/timer issues, add timer.done() to `cancel-all` events; disable progress throttling in Core; Ignore progress events in timeout tracker after upload was aborted (#864 / @goto-bus-stop, @arturi)
+- Server: Allow custom headers to be set for remote multipart uploads (@ifedapoolarewaju)
+- Server: Add type to metadata as `filetype`
+- uppy/uppy-server: refactor oauth flow tonot use cookies anymore (@ifedapoolarewaju)
 
 ## 0.24.4
 

+ 11 - 13
README.md

@@ -17,8 +17,6 @@ Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly wit
 
 Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
 
-⚠️**ATTENTION** ☢️Uppy [is transitioning](https://github.com/transloadit/uppy/issues/862) into a [Lerna repo](https://lernajs.io/) this/next week, please wait with new PRs to avoid conflicts 💛
-
 ## Example
 
 <img width="700" alt="Uppy UI Demo: modal dialog with a few selected files and an upload button" src="https://github.com/transloadit/uppy/raw/master/uppy-screenshot.jpg">
@@ -26,12 +24,12 @@ Uppy is being developed by the folks at [Transloadit](https://transloadit.com),
 Code used in the above example:
 
 ```js
-const Uppy = require('uppy/lib/core')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
-const Instagram = require('uppy/lib/plugins/Instagram')
-const Webcam = require('uppy/lib/plugins/Webcam')
-const Tus = require('uppy/lib/plugins/Tus')
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const GoogleDrive = require('@uppy/google-drive')
+const Instagram = require('@uppy/instagram')
+const Webcam = require('@uppy/webcam')
+const Tus = require('@uppy/Tus')
 
 const uppy = Uppy({ autoProceed: false })
   .use(Dashboard, { trigger: '#select-files' })
@@ -67,7 +65,7 @@ $ npm install uppy --save
 
 We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
 
-Add CSS [uppy.min.css](https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.css), either to `<head>` of your HTML page or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.
+Add CSS [uppy.min.css](https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.css), either to `<head>` of your HTML page or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.
 
 Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object.
 
@@ -76,12 +74,12 @@ Alternatively, you can also use a pre-built bundle from Transloadit's CDN: Edgly
 1\. Add a script to the bottom of `<body>`:
 
 ``` html
-<script src="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.js"></script>
+<script src="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.js"></script>
 ```
 
 2\. Add CSS to `<head>`:
 ``` html
-<link href="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.css" rel="stylesheet">
+<link href="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.css" rel="stylesheet">
 ```
 
 3\. Initialize:
@@ -174,9 +172,9 @@ And you’ll need [`uppy-server`](https://github.com/transloadit/uppy-server) if
 
  - Contributor’s guide in [`website/src/docs/contributing.md`](website/src/docs/contributing.md)
  - Changelog to track our release progress (we aim to roll out a release every month): [`CHANGELOG.md`](CHANGELOG.md)
- 
+
 ## Used by
- 
+
 Uppy is used by: [Photobox](http://photobox.com), [Law Insider](https://lawinsider.com), [Cool Tabs](https://cool-tabs.com), [Soundoff](https://soundoff.io), [Scrumi](https://www.scrumi.io/) and others.
 
 Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issues/769)!

+ 0 - 13
bin/build-css

@@ -1,13 +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)"
-
-node_modules/.bin/node-sass src/scss/ \
-  --output dist/

+ 66 - 52
bin/build-css.js

@@ -1,64 +1,78 @@
-var sass = require('node-sass')
-var postcss = require('postcss')
-var autoprefixer = require('autoprefixer')
-var cssnano = require('cssnano')
-var safeImportant = require('postcss-safe-important')
-var chalk = require('chalk')
-var fs = require('fs')
-var path = require('path')
-var mkdirp = require('mkdirp')
+const sass = require('node-sass')
+const postcss = require('postcss')
+const autoprefixer = require('autoprefixer')
+const cssnano = require('cssnano')
+const safeImportant = require('postcss-safe-important')
+const chalk = require('chalk')
+const { promisify } = require('util')
+const fs = require('fs')
+const path = require('path')
+const resolve = require('resolve')
+const mkdirp = promisify(require('mkdirp'))
+const glob = promisify(require('glob'))
 
-mkdirp.sync('./dist/')
+const renderScss = promisify(sass.render)
+const writeFile = promisify(fs.writeFile)
+
+const cwd = process.cwd()
 
 function handleErr (err) {
   console.error(chalk.red('✗ Error:'), chalk.red(err.message))
 }
 
-function minifyCSS () {
-  return new Promise(function (resolve) {
-    fs.readFile('./dist/uppy.css', function (err, css) {
-      if (err) handleErr(err)
-      postcss([ cssnano ])
-        .process(css, { from: path.join(__dirname, '../dist/uppy.css') })
-        .then(function (postCSSResult) {
-          postCSSResult.warnings().forEach(function (warn) {
-            console.warn(warn.toString())
-          })
-          fs.writeFile('./dist/uppy.min.css', postCSSResult.css, function (err) {
-            if (err) handleErr(err)
-            console.info(chalk.green('✓ Minified Bundle CSS:'), chalk.magenta('uppy.min.css'))
-            resolve()
-          })
+async function compileCSS () {
+  const files = await glob('packages/{,@uppy/}*/src/style.scss')
+  for (const file of files) {
+    const scssResult = await renderScss({
+      file,
+      importedFiles: new Set(),
+      importer (url, from, done) {
+        resolve(url, {
+          basedir: path.dirname(from),
+          filename: from,
+          extensions: ['.scss']
+        }, (err, res) => {
+          if (err) return done(err)
+
+          res = fs.realpathSync(res)
+
+          if (this.options.importedFiles.has(res)) return done({ contents: '' })
+          this.options.importedFiles.add(res)
+
+          done({ file: res })
         })
-        .catch(err => handleErr(err))
+      }
     })
-  })
-}
 
-function compileCSS () {
-  return new Promise(function (resolve) {
-    sass.render({file: './src/scss/uppy.scss'}, function (err, sassResult) {
-      if (err) handleErr(err)
-      postcss([ autoprefixer, safeImportant ])
-        .process(sassResult.css, { from: path.join(__dirname, '../src/scss/uppy.scss') })
-        .then(function (postCSSResult) {
-          postCSSResult.warnings().forEach(function (warn) {
-            console.warn(warn.toString())
-          })
-          fs.writeFile('./dist/uppy.css', postCSSResult.css, function (err) {
-            if (err) handleErr(err)
-            console.info(chalk.green('✓ Built Uppy CSS:'), chalk.magenta('uppy.css'))
-            resolve()
-          })
-        })
-        .catch(err => handleErr(err))
+    const postcssResult = await postcss([ autoprefixer, safeImportant ])
+      .process(scssResult.css, { from: file })
+    postcssResult.warnings().forEach(function (warn) {
+      console.warn(warn.toString())
+    })
+
+    const outdir = path.join(path.dirname(file), '../dist')
+    // Save the `uppy` package's CSS as `uppy.css`, the rest as `style.css`.
+    const outfile = path.join(outdir, outdir.includes('packages/uppy/') ? 'uppy.css' : 'style.css')
+    await mkdirp(outdir)
+    await writeFile(outfile, postcssResult.css)
+    console.info(
+      chalk.green('✓ Built Uppy CSS:'),
+      chalk.magenta(path.relative(cwd, outfile))
+    )
+
+    const minifiedResult = await postcss([ cssnano ])
+        .process(postcssResult.css, { from: outfile })
+    minifiedResult.warnings().forEach(function (warn) {
+      console.warn(warn.toString())
     })
-  })
+    await writeFile(outfile.replace(/\.css$/, '.min.css'), minifiedResult.css)
+    console.info(
+      chalk.green('✓ Minified Bundle CSS:'),
+      chalk.magenta(path.relative(cwd, outfile).replace(/\.css$/, '.min.css'))
+    )
+  }
 }
 
-compileCSS()
-  .then(minifyCSS)
-  .then(function () {
-    console.info(chalk.yellow('✓ CSS Bundle 🎉'))
-  })
-  .catch(err => handleErr(err))
+compileCSS().then(() => {
+  console.info(chalk.yellow('✓ CSS Bundles 🎉'))
+}, handleErr)

+ 2 - 2
bin/build-js.js

@@ -7,8 +7,8 @@ var tinyify = require('tinyify')
 var browserify = require('browserify')
 var exorcist = require('exorcist')
 
-var distPath = './dist'
-var srcPath = './src'
+var distPath = './packages/uppy/dist'
+var srcPath = './packages/uppy'
 
 function handleErr (err) {
   console.error(chalk.red('✗ Error:'), chalk.red(err.message))

+ 35 - 0
bin/build-lib.js

@@ -0,0 +1,35 @@
+const chalk = require('chalk')
+const babel = require('babel-core')
+const { promisify } = require('util')
+const glob = promisify(require('glob'))
+const mkdirp = promisify(require('mkdirp'))
+const fs = require('fs')
+const path = require('path')
+
+const transformFile = promisify(babel.transformFile)
+const writeFile = promisify(fs.writeFile)
+
+const SOURCE = 'packages/{*,@uppy/*}/src/**/*.js'
+// Files not to build (such as tests)
+const IGNORE = /\.test\.js$|__mocks__/
+
+async function buildLib () {
+  const files = await glob(SOURCE)
+  for (const file of files) {
+    if (IGNORE.test(file)) continue
+
+    const libFile = file.replace('/src/', '/lib/')
+    const { code, map } = await transformFile(file, {})
+    await mkdirp(path.dirname(libFile))
+    await Promise.all([
+      writeFile(libFile, code),
+      writeFile(libFile + '.map', JSON.stringify(map))
+    ])
+    console.log(chalk.green('Compiled lib:'), chalk.magenta(libFile))
+  }
+}
+
+buildLib().catch((err) => {
+  console.error(err.stack)
+  process.exit(1)
+})

+ 1 - 1
bin/disc.js

@@ -16,7 +16,7 @@ function minifyify () {
   })
 }
 
-const bundler = browserify(path.join(__dirname, '../src/index.js'), {
+const bundler = browserify(path.join(__dirname, '../packages/uppy/index.js'), {
   fullPaths: true,
   standalone: 'Uppy'
 })

+ 20 - 17
bin/endtoend-build

@@ -1,23 +1,26 @@
 #!/usr/bin/env bash
 
-echo "Preparing for end to end test: copying static HTML and CSS, building JS"
-rm -rf ./test/endtoend/dist && mkdir ./test/endtoend/dist
-rm -rf ./test/endtoend/node_modules
+set -o pipefail
+set -o errexit
+set -o nounset
+set -o xtrace
 
-npm run prepublishOnly
-# archive the uppy package
-echo "Creating archive for Uppy package"
-npm pack
+# 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)"
 
-UPPY_VERSION=$(node -e 'console.log(require("./package.json").version)')
-# install from the archived uppy package
-echo "Installing Uppy from archived file uppy-${UPPY_VERSION}.tgz"
-npm install --prefix ./test/endtoend uppy-${UPPY_VERSION}.tgz
+echo "Preparing for end to end test: copying static HTML and CSS, building JS"
+rm -rf "${__root}/test/endtoend/dist" && mkdir "${__root}/test/endtoend/dist"
+rm -rf "${__root}/test/endtoend/node_modules"
 
-# removing package-lock.json because we do not need it.
-rm ./test/endtoend/package-lock.json
+npm run build
 
-cp ./test/endtoend/node_modules/uppy/dist/uppy.min.css ./test/endtoend/dist
-cp ./test/endtoend/src/index.html ./test/endtoend/dist
-browserify ./test/endtoend/src/main.js -o ./test/endtoend/dist/bundle.js -t babelify
-rm -rf ./test/endtoend/node_modules
+cp "${__root}/packages/uppy/dist/uppy.min.css" "${__root}/test/endtoend/dist"
+cp "${__root}/test/endtoend/src/index.html" "${__root}/test/endtoend/dist"
+browserify "${__root}/test/endtoend/src/main.js" \
+  -o "${__root}/test/endtoend/dist/bundle.js" \
+  -t babelify \
+  -t aliasify
+rm -rf "${__root}/test/endtoend/node_modules"

+ 57 - 0
bin/endtoend-build-ci

@@ -0,0 +1,57 @@
+#!/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)"
+
+VERDACCIO_REGISTRY=http://localhost:4002
+
+cleanup() {
+  rm -rf "${__root}/test/endtoend/node_modules"
+  rm -rf "${__root}/test/endtoend/tmp"
+}
+
+echo "Preparing for end to end test: copying static HTML and CSS, building JS"
+rm -rf "${__root}/test/endtoend/dist" && mkdir "${__root}/test/endtoend/dist"
+rm -rf "${__root}/test/endtoend/node_modules"
+
+PACKAGES="$(for pkg in packages/@uppy/*; do echo "${pkg#packages/}"; done)"
+
+cleanup
+npm run build
+
+# https://github.com/facebook/create-react-app/pull/4626
+(cd && npm-auth-to-token -u user -p password -e user@example.com -r "$VERDACCIO_REGISTRY")
+
+# Simulate a publish of everything, to the local registry,
+# without changing things in git
+# Use --cd-version to skip version prompts
+lerna publish --yes \
+  --force-publish="*" \
+  --registry="$VERDACCIO_REGISTRY" \
+  --npm-client=npm \
+  --skip-git \
+  --cd-version=prerelease
+
+# revert version changes
+git checkout -- packages/*/package.json packages/@uppy/*/package.json
+
+# install all packages to the endtoend folder
+# (Don't use the npm cache, don't generate a package-lock, don't save dependencies to any package.json)
+(cd "${__root}/test/endtoend" && npm install --prefer-online --registry "$VERDACCIO_REGISTRY" --no-package-lock --no-save uppy $PACKAGES)
+
+cp "${__root}/packages/uppy/dist/uppy.min.css" "${__root}/test/endtoend/dist"
+cp "${__root}/test/endtoend/src/index.html" "${__root}/test/endtoend/dist"
+
+browserify "${__root}/test/endtoend/src/main.js" \
+  -o "${__root}/test/endtoend/dist/bundle.js" \
+  -t babelify
+
+cleanup

+ 1 - 1
bin/gzip.js

@@ -25,7 +25,7 @@ function gzip (file) {
 
 function gzipDist () {
   return new Promise(function (resolve) {
-    glob('./dist/**/*.*(css|js)', function (err, files) {
+    glob('./packages/uppy/dist/**/*.*(css|js)', function (err, files) {
       if (err) console.log(err)
       var gzipPromises = []
       files.forEach(function (file) {

+ 29 - 0
bin/release

@@ -0,0 +1,29 @@
+#!/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)"
+
+# Add readme file to the main `uppy` package.
+cp README.md packages/uppy/README.md
+
+npm run clean
+npm run build
+
+lerna publish --message="Release" --exact
+
+# Replace version numbers in URLs
+version_files="./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/"
+main_package_version=$(node -p "require('./packages/uppy/package.json').version")
+replace-x -r 'uppy/v\d+\.\d+\.\d+/dist' "uppy/v$main_package_version/dist" $version_files --exclude=node_modules
+git commit -m "Change Uppy version references to v$main_package_version" $version_files
+
+git push
+git push --tags

+ 11 - 12
bin/upload-to-cdn.sh

@@ -8,7 +8,7 @@
 #  - Checks if a tag is being built (on Travis - otherwise opts to continue execution regardless)
 #  - Installs AWS CLI if needed
 #  - Assumed a fully built uppy is in root dir (unless a specific tag was specified, then it's fetched from npm)
-#  - Runs npm pack, and stores files to e.g. https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.css
+#  - Runs npm pack, and stores files to e.g. https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.css
 #  - Uses local package by default, if [version] argument was specified, takes package from npm
 #
 # Run as:
@@ -60,7 +60,7 @@ pushd "${__root}" > /dev/null 2>&1
   remoteVersion="${1:-}"
   version="${remoteVersion}"
   if [ -z "${remoteVersion}" ]; then
-    localVersion=$(node -pe "require('./package.json').version")
+    localVersion=$(node -pe "require('./packages/uppy/package.json').version")
     echo "${localVersion}"
     version="${localVersion}"
   fi
@@ -77,16 +77,18 @@ pushd "${__root}" > /dev/null 2>&1
   echo "✅"
 
   echo "--> Obtain relevant npm files for uppy ${version} ... "
-  if [ -z "${remoteVersion}" ]; then
-    npm pack || fatal "Unable to fetch "
-  else
-    npm pack "uppy@${remoteVersion}"
-  fi
+  pushd packages/uppy
+    if [ -z "${remoteVersion}" ]; then
+      npm pack || fatal "Unable to fetch "
+    else
+      npm pack "uppy@${remoteVersion}"
+    fi
+  popd > /dev/null 2>&1
   echo "✅"
   rm -rf /tmp/uppy-to-edgly
   mkdir -p /tmp/uppy-to-edgly
-  cp -af "uppy-${version}.tgz" /tmp/uppy-to-edgly/
-  tar zxvf "uppy-${version}.tgz" -C /tmp/uppy-to-edgly/
+  cp -af "packages/uppy/uppy-${version}.tgz" /tmp/uppy-to-edgly/
+  tar zxvf "packages/uppy/uppy-${version}.tgz" -C /tmp/uppy-to-edgly/
 
   echo "--> Upload to edgly.net CDN"
   pushd /tmp/uppy-to-edgly/package
@@ -96,10 +98,7 @@ pushd "${__root}" > /dev/null 2>&1
       AWS_SECRET_ACCESS_KEY="${EDGLY_SECRET}" \
     aws s3 sync \
       --region="us-east-1" \
-      --exclude 'website/*' \
       --exclude 'node_modules/*' \
-      --exclude 'test/*/node_modules/*' \
-      --exclude 'examples/*/node_modules/*' \
     ./ "s3://crates.edgly.net/756b8efaed084669b02cb99d4540d81f/default/releases/uppy/v${version}"
     echo "Saved https://transloadit.edgly.net/releases/uppy/v${version}/"
   popd > /dev/null 2>&1

+ 3 - 3
examples/aws-presigned-url/main.js

@@ -1,6 +1,6 @@
-const Uppy = require('uppy/lib/core/Core.js')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const AwsS3 = require('uppy/lib/plugins/AwsS3')
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const AwsS3 = require('@uppy/aws-s3')
 
 const uppy = Uppy({
   debug: true,

+ 2 - 2
examples/aws-presigned-url/serve.js

@@ -20,8 +20,8 @@ b.plugin(watchify)
 
 b.transform(babelify)
 b.transform(aliasify, {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
+  aliases: {
+    '@uppy': path.join(__dirname, '../../packages/@uppy')
   }
 })
 

+ 0 - 7
examples/aws-uppy-server/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 5 - 5
examples/aws-uppy-server/main.js

@@ -1,8 +1,8 @@
-const Uppy = require('uppy/lib/core')
-const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
-const Webcam = require('uppy/lib/plugins/Webcam')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const AwsS3 = require('uppy/lib/plugins/AwsS3')
+const Uppy = require('@uppy/core')
+const GoogleDrive = require('@uppy/google-drive')
+const Webcam = require('@uppy/webcam')
+const Dashboard = require('@uppy/dashboard')
+const AwsS3 = require('@uppy/aws-s3')
 
 const uppy = Uppy({
   debug: true,

+ 5 - 1
examples/aws-uppy-server/package.json

@@ -7,7 +7,11 @@
     "start:server": "node server.js",
     "start": "npm-run-all --serial copy --parallel start:*"
   },
-  "aliasify": "./aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {
     "aliasify": "^2.1.0",
     "babelify": "^7.3.0",

+ 9 - 7
examples/bundled-example/main.js

@@ -1,10 +1,10 @@
-const Uppy = require('../../src/core')
-const Dashboard = require('../../src/plugins/Dashboard')
-const Instagram = require('../../src/plugins/Instagram')
-const GoogleDrive = require('../../src/plugins/GoogleDrive')
-const Webcam = require('../../src/plugins/Webcam')
-const Tus = require('../../src/plugins/Tus')
-const Form = require('../../src/plugins/Form')
+const Uppy = require('./../../packages/@uppy/core/src')
+const Dashboard = require('./../../packages/@uppy/dashboard/src')
+const Instagram = require('./../../packages/@uppy/instagram/src')
+const GoogleDrive = require('./../../packages/@uppy/google-drive/src')
+const Webcam = require('./../../packages/@uppy/webcam/src')
+const Tus = require('./../../packages/@uppy/tus/src')
+const Form = require('./../../packages/@uppy/form/src')
 
 const TUS_ENDPOINT = 'https://master.tus.io/files/'
 
@@ -45,6 +45,7 @@ uppy.on('complete', (result) => {
   console.log('failed files:', result.failed)
 })
 
+/* eslint-disable compat/compat */
 if ('serviceWorker' in navigator) {
   navigator.serviceWorker
     .register('/sw.js')
@@ -55,6 +56,7 @@ if ('serviceWorker' in navigator) {
       console.log('Registration failed with ' + error)
     })
 }
+/* eslint-enable */
 
 var modalTrigger = document.querySelector('#pick-files')
 if (modalTrigger) modalTrigger.click()

+ 16 - 0
examples/bundled-example/package.json

@@ -0,0 +1,16 @@
+{
+  "dependencies": {
+    "aliasify": "^2.1.0",
+    "babel-core": "^6.26.3",
+    "babelify": "^8.0.0",
+    "watchify": "^3.11.0"
+  },
+  "scripts": {
+    "watch": "watchify -t babelify -t aliasify main.js -o bundle.js -vd"
+  },
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  }
+}

+ 2 - 2
examples/cdn-example/index.html

@@ -4,11 +4,11 @@
     <title></title>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link href="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.css" rel="stylesheet">
+    <link href="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.css" rel="stylesheet">
   </head>
   <body>
     <button id="uppyModalOpener">Open Modal</button>
-    <script src="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.js"></script>
+    <script src="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.js"></script>
     <script>
       const uppy = Uppy.Core({debug: true, autoProceed: false})
         .use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })

+ 4 - 4
examples/custom-provider/client/MyCustomProvider.js

@@ -1,6 +1,6 @@
-const Plugin = require('uppy/lib/core/Plugin')
-const { Provider } = require('uppy/lib/server')
-const { ProviderView } = require('uppy/lib/views')
+const { Plugin } = require('@uppy/core')
+const { Provider } = require('@uppy/server-utils')
+const ProviderViews = require('@uppy/provider-views')
 const { h } = require('preact')
 
 module.exports = class MyCustomProvider extends Plugin {
@@ -29,7 +29,7 @@ module.exports = class MyCustomProvider extends Plugin {
   }
 
   install () {
-    this.view = new ProviderView(this)
+    this.view = new ProviderViews(this)
     // Set default state
     this.setPluginState({
       authenticated: false,

+ 0 - 7
examples/custom-provider/client/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../../src/$1')
-  }
-}

+ 4 - 4
examples/custom-provider/client/main.js

@@ -1,8 +1,8 @@
-const Uppy = require('uppy/lib/core')
-const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
-const Tus = require('uppy/lib/plugins/Tus')
+const Uppy = require('@uppy/core')
+const GoogleDrive = require('@uppy/google-drive')
+const Tus = require('@uppy/tus')
 const MyCustomProvider = require('./MyCustomProvider')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
+const Dashboard = require('@uppy/dashboard')
 
 const uppy = Uppy({
   debug: true,

+ 5 - 1
examples/custom-provider/package.json

@@ -7,7 +7,11 @@
     "start:server": "node server/index.js",
     "start": "npm-run-all --serial copy --parallel start:*"
   },
-  "aliasify": "client/aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {
     "aliasify": "^2.1.0",
     "babelify": "^7.3.0",

+ 3 - 3
examples/digitalocean-spaces/main.js

@@ -1,6 +1,6 @@
-const Uppy = require('uppy/lib/core')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const AwsS3 = require('uppy/lib/plugins/AwsS3')
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const AwsS3 = require('@uppy/aws-s3')
 
 const uppy = Uppy({
   debug: true,

+ 2 - 2
examples/digitalocean-spaces/server.js

@@ -58,8 +58,8 @@ budo(path.join(__dirname, 'main.js'), {
     transform: [
       'babelify',
       ['aliasify', {
-        replacements: {
-          '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
+        aliases: {
+          '@uppy': path.join(__dirname, '../../packages/@uppy')
         }
       }]
     ]

+ 0 - 7
examples/multiple-instances/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 3 - 3
examples/multiple-instances/main.js

@@ -1,6 +1,6 @@
-const Uppy = require('uppy/lib/core')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const GoldenRetriever = require('uppy/lib/plugins/GoldenRetriever')
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const GoldenRetriever = require('@uppy/golden-retriever')
 
 // Initialise two Uppy instances with the GoldenRetriever plugin,
 // but with different `id`s.

+ 537 - 0
examples/multiple-instances/package-lock.json

@@ -636,6 +636,7 @@
       "requires": {
         "anymatch": "1.3.2",
         "async-each": "1.0.1",
+        "fsevents": "1.2.4",
         "glob-parent": "2.0.0",
         "inherits": "2.0.3",
         "is-binary-path": "1.0.1",
@@ -1143,6 +1144,535 @@
       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
       "dev": true
     },
+    "fsevents": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz",
+      "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "nan": "2.10.0",
+        "node-pre-gyp": "0.10.0"
+      },
+      "dependencies": {
+        "abbrev": {
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "ansi-regex": {
+          "version": "2.1.1",
+          "bundled": true,
+          "dev": true
+        },
+        "aproba": {
+          "version": "1.2.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "are-we-there-yet": {
+          "version": "1.1.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "delegates": "1.0.0",
+            "readable-stream": "2.3.6"
+          }
+        },
+        "balanced-match": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true
+        },
+        "brace-expansion": {
+          "version": "1.1.11",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "balanced-match": "1.0.0",
+            "concat-map": "0.0.1"
+          }
+        },
+        "chownr": {
+          "version": "1.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "code-point-at": {
+          "version": "1.1.0",
+          "bundled": true,
+          "dev": true
+        },
+        "concat-map": {
+          "version": "0.0.1",
+          "bundled": true,
+          "dev": true
+        },
+        "console-control-strings": {
+          "version": "1.1.0",
+          "bundled": true,
+          "dev": true
+        },
+        "core-util-is": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "debug": {
+          "version": "2.6.9",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ms": "2.0.0"
+          }
+        },
+        "deep-extend": {
+          "version": "0.5.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "delegates": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "detect-libc": {
+          "version": "1.0.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "fs-minipass": {
+          "version": "1.2.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minipass": "2.2.4"
+          }
+        },
+        "fs.realpath": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "gauge": {
+          "version": "2.7.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "aproba": "1.2.0",
+            "console-control-strings": "1.1.0",
+            "has-unicode": "2.0.1",
+            "object-assign": "4.1.1",
+            "signal-exit": "3.0.2",
+            "string-width": "1.0.2",
+            "strip-ansi": "3.0.1",
+            "wide-align": "1.1.2"
+          }
+        },
+        "glob": {
+          "version": "7.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "fs.realpath": "1.0.0",
+            "inflight": "1.0.6",
+            "inherits": "2.0.3",
+            "minimatch": "3.0.4",
+            "once": "1.4.0",
+            "path-is-absolute": "1.0.1"
+          }
+        },
+        "has-unicode": {
+          "version": "2.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "iconv-lite": {
+          "version": "0.4.21",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safer-buffer": "2.1.2"
+          }
+        },
+        "ignore-walk": {
+          "version": "3.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minimatch": "3.0.4"
+          }
+        },
+        "inflight": {
+          "version": "1.0.6",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "once": "1.4.0",
+            "wrappy": "1.0.2"
+          }
+        },
+        "inherits": {
+          "version": "2.0.3",
+          "bundled": true,
+          "dev": true
+        },
+        "ini": {
+          "version": "1.3.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "is-fullwidth-code-point": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "number-is-nan": "1.0.1"
+          }
+        },
+        "isarray": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "minimatch": {
+          "version": "3.0.4",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "brace-expansion": "1.1.11"
+          }
+        },
+        "minimist": {
+          "version": "0.0.8",
+          "bundled": true,
+          "dev": true
+        },
+        "minipass": {
+          "version": "2.2.4",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "safe-buffer": "5.1.1",
+            "yallist": "3.0.2"
+          }
+        },
+        "minizlib": {
+          "version": "1.1.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minipass": "2.2.4"
+          }
+        },
+        "mkdirp": {
+          "version": "0.5.1",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "minimist": "0.0.8"
+          }
+        },
+        "ms": {
+          "version": "2.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "needle": {
+          "version": "2.2.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "debug": "2.6.9",
+            "iconv-lite": "0.4.21",
+            "sax": "1.2.4"
+          }
+        },
+        "node-pre-gyp": {
+          "version": "0.10.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "detect-libc": "1.0.3",
+            "mkdirp": "0.5.1",
+            "needle": "2.2.0",
+            "nopt": "4.0.1",
+            "npm-packlist": "1.1.10",
+            "npmlog": "4.1.2",
+            "rc": "1.2.7",
+            "rimraf": "2.6.2",
+            "semver": "5.5.0",
+            "tar": "4.4.1"
+          }
+        },
+        "nopt": {
+          "version": "4.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "abbrev": "1.1.1",
+            "osenv": "0.1.5"
+          }
+        },
+        "npm-bundled": {
+          "version": "1.0.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "npm-packlist": {
+          "version": "1.1.10",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ignore-walk": "3.0.1",
+            "npm-bundled": "1.0.3"
+          }
+        },
+        "npmlog": {
+          "version": "4.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "are-we-there-yet": "1.1.4",
+            "console-control-strings": "1.1.0",
+            "gauge": "2.7.4",
+            "set-blocking": "2.0.0"
+          }
+        },
+        "number-is-nan": {
+          "version": "1.0.1",
+          "bundled": true,
+          "dev": true
+        },
+        "object-assign": {
+          "version": "4.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "once": {
+          "version": "1.4.0",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "wrappy": "1.0.2"
+          }
+        },
+        "os-homedir": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "os-tmpdir": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "osenv": {
+          "version": "0.1.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "os-homedir": "1.0.2",
+            "os-tmpdir": "1.0.2"
+          }
+        },
+        "path-is-absolute": {
+          "version": "1.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "process-nextick-args": {
+          "version": "2.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "rc": {
+          "version": "1.2.7",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "deep-extend": "0.5.1",
+            "ini": "1.3.5",
+            "minimist": "1.2.0",
+            "strip-json-comments": "2.0.1"
+          },
+          "dependencies": {
+            "minimist": {
+              "version": "1.2.0",
+              "bundled": true,
+              "dev": true,
+              "optional": true
+            }
+          }
+        },
+        "readable-stream": {
+          "version": "2.3.6",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "core-util-is": "1.0.2",
+            "inherits": "2.0.3",
+            "isarray": "1.0.0",
+            "process-nextick-args": "2.0.0",
+            "safe-buffer": "5.1.1",
+            "string_decoder": "1.1.1",
+            "util-deprecate": "1.0.2"
+          }
+        },
+        "rimraf": {
+          "version": "2.6.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "glob": "7.1.2"
+          }
+        },
+        "safe-buffer": {
+          "version": "5.1.1",
+          "bundled": true,
+          "dev": true
+        },
+        "safer-buffer": {
+          "version": "2.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "sax": {
+          "version": "1.2.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "semver": {
+          "version": "5.5.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "set-blocking": {
+          "version": "2.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "signal-exit": {
+          "version": "3.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "string-width": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "code-point-at": "1.1.0",
+            "is-fullwidth-code-point": "1.0.0",
+            "strip-ansi": "3.0.1"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safe-buffer": "5.1.1"
+          }
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "bundled": true,
+          "dev": true,
+          "requires": {
+            "ansi-regex": "2.1.1"
+          }
+        },
+        "strip-json-comments": {
+          "version": "2.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "tar": {
+          "version": "4.4.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chownr": "1.0.1",
+            "fs-minipass": "1.2.5",
+            "minipass": "2.2.4",
+            "minizlib": "1.1.0",
+            "mkdirp": "0.5.1",
+            "safe-buffer": "5.1.1",
+            "yallist": "3.0.2"
+          }
+        },
+        "util-deprecate": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "wide-align": {
+          "version": "1.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "string-width": "1.0.2"
+          }
+        },
+        "wrappy": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true
+        },
+        "yallist": {
+          "version": "3.0.2",
+          "bundled": true,
+          "dev": true
+        }
+      }
+    },
     "function-bind": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -1903,6 +2433,13 @@
       "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
       "dev": true
     },
+    "nan": {
+      "version": "2.10.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz",
+      "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==",
+      "dev": true,
+      "optional": true
+    },
     "normalize-package-data": {
       "version": "2.4.0",
       "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",

+ 5 - 1
examples/multiple-instances/package.json

@@ -5,7 +5,11 @@
     "css": "cp ../../dist/uppy.min.css .",
     "start": "npm run css && budo main.js:bundle.js -- -t babelify -g aliasify"
   },
-  "aliasify": "./aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {},
   "devDependencies": {
     "aliasify": "^2.1.0",

+ 4 - 4
examples/react-example/App.js

@@ -1,9 +1,9 @@
 /* eslint-disable */
 const React = require('react')
-const Uppy = require('uppy/lib/core')
-const Tus = require('uppy/lib/plugins/Tus')
-const GoogleDrive = require('uppy/lib/plugins/GoogleDrive')
-const { Dashboard, DashboardModal, DragDrop, ProgressBar } = require('uppy/lib/react')
+const Uppy = require('@uppy/core')
+const Tus = require('@uppy/tus')
+const GoogleDrive = require('@uppy/google-drive')
+const { Dashboard, DashboardModal, DragDrop, ProgressBar } = require('@uppy/react')
 
 module.exports = class App extends React.Component {
   constructor (props) {

+ 0 - 7
examples/react-example/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 5 - 1
examples/react-example/package.json

@@ -5,7 +5,11 @@
     "css": "cp ../../dist/uppy.min.css .",
     "start": "npm run css && budo main.js:bundle.js -- -r react:react -r react-dom:react-dom -t babelify -g aliasify"
   },
-  "aliasify": "./aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {
     "babel-preset-react": "^6.24.1",
     "react": "^15.6.1",

+ 0 - 7
examples/redux/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 4 - 4
examples/redux/main.js

@@ -1,9 +1,9 @@
 const { createStore, compose, combineReducers, applyMiddleware } = require('redux')
 const logger = require('redux-logger').default
-const Uppy = require('uppy/lib/core')
-const uppyReduxStore = require('uppy/lib/store/ReduxStore')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const Tus = require('uppy/lib/plugins/Tus')
+const Uppy = require('@uppy/core')
+const uppyReduxStore = require('@uppy/store-redux')
+const Dashboard = require('@uppy/dashboard')
+const Tus = require('@uppy/tus')
 
 function counter (state = 0, action) {
   switch (action.type) {

+ 5 - 1
examples/redux/package.json

@@ -5,7 +5,11 @@
     "css": "cp ../../dist/uppy.min.css .",
     "start": "npm run css && budo main.js:bundle.js -- -t babelify -g aliasify"
   },
-  "aliasify": "./aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {
     "redux": "^3.7.2",
     "redux-logger": "^3.0.6"

+ 2 - 2
examples/uppy-with-server/client/index.html

@@ -4,11 +4,11 @@
     <title></title>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link href="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.css" rel="stylesheet">
+    <link href="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.css" rel="stylesheet">
   </head>
   <body>
     <button id="uppyModalOpener">Open Modal</button>
-    <script src="https://transloadit.edgly.net/releases/uppy/v0.25.5/dist/uppy.min.js"></script>
+    <script src="https://transloadit.edgly.net/releases/uppy/v0.26.0/dist/uppy.min.js"></script>
     <script>
       const uppy = Uppy.Core({debug: true, autoProceed: false})
         .use(Uppy.Dashboard, { trigger: '#uppyModalOpener' })

+ 0 - 7
examples/xhr-bundle/aliasify.js

@@ -1,7 +0,0 @@
-const path = require('path')
-
-module.exports = {
-  replacements: {
-    '^uppy/lib/(.*?)$': path.join(__dirname, '../../src/$1')
-  }
-}

+ 3 - 3
examples/xhr-bundle/main.js

@@ -1,6 +1,6 @@
-const Uppy = require('uppy/lib/core')
-const Dashboard = require('uppy/lib/plugins/Dashboard')
-const XHRUpload = require('uppy/lib/plugins/XHRUpload')
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const XHRUpload = require('@uppy/xhr-upload')
 
 const uppy = Uppy({
   autoProceed: false,

+ 5 - 1
examples/xhr-bundle/package.json

@@ -7,7 +7,11 @@
     "start:server": "node serve.js",
     "start": "run-p start:*"
   },
-  "aliasify": "./aliasify.js",
+  "aliasify": {
+    "aliases": {
+      "@uppy": "../../packages/@uppy"
+    }
+  },
   "dependencies": {
     "cors": "^2.8.4",
     "express": "^4.16.2",

+ 8 - 0
lerna.json

@@ -0,0 +1,8 @@
+{
+  "lerna": "2.11.0",
+  "packages": [
+    "packages/*",
+    "packages/@uppy/*"
+  ],
+  "version": "independent"
+}

+ 3 - 0
locales/README.md

@@ -0,0 +1,3 @@
+# Unused
+
+These locale files are not currently used by Uppy. We are keeping them around because they will, hopefully, be used in the future.

+ 0 - 0
src/locales/cs_CZ.js → locales/cs_CZ.js


+ 0 - 0
src/locales/de_DE.js → locales/de_DE.js


+ 0 - 0
src/locales/en_US.js → locales/en_US.js


+ 0 - 0
src/locales/es_ES.js → locales/es_ES.js


+ 0 - 0
src/locales/fi_FI.js → locales/fi_FI.js


+ 0 - 0
src/locales/id_ID.js → locales/id_ID.js


+ 0 - 0
src/locales/it_IT.js → locales/it_IT.js


+ 0 - 0
src/locales/nb_NO.js → locales/nb_NO.js


+ 0 - 0
src/locales/pl_PL.js → locales/pl_PL.js


+ 0 - 0
src/locales/pt_BR.js → locales/pt_BR.js


+ 0 - 0
src/locales/ru_RU.js → locales/ru_RU.js


+ 0 - 0
src/locales/tr_TR.js → locales/tr_TR.js


+ 0 - 0
src/locales/zh_CN.js → locales/zh_CN.js


File diff suppressed because it is too large
+ 398 - 304
package-lock.json


+ 58 - 113
package.json

@@ -1,165 +1,110 @@
 {
-  "name": "uppy",
-  "version": "0.25.5",
+  "private": true,
+  "name": "uppy-build",
   "description": "Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
-  "main": "lib/index.js",
-  "jsnext:main": "src/index.js",
-  "unpkg": "dist/uppy.min.js",
-  "types": "types/index.d.ts",
-  "files": [
-    "src/",
-    "lib/",
-    "dist/",
-    "test/",
-    "bin/",
-    "examples/"
-  ],
   "lint-staged": {
     "*.js": "eslint"
   },
   "pre-commit": "lint-staged",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/transloadit/uppy.git"
-  },
-  "keywords": [
-    "file uploader",
-    "drag-drop",
-    "progress",
-    "preview",
-    "resumable uploads",
-    "xhr",
-    "tus",
-    "s3",
-    "google drive",
-    "dropbox",
-    "webcam"
-  ],
   "license": "MIT",
-  "bugs": {
-    "url": "https://github.com/transloadit/uppy/issues"
-  },
-  "homepage": "https://uppy.io",
-  "jest": {
-    "testPathIgnorePatterns": [
-      "lib"
-    ]
-  },
   "devDependencies": {
-    "autoprefixer": "^7.2.5",
+    "aliasify": "^2.1.0",
+    "autoprefixer": "^7.2.6",
     "babel-cli": "^6.26.0",
-    "babel-core": "^6.26.0",
-    "babel-jest": "^22.0.6",
-    "babel-plugin-es6-promise": "^1.1.1",
+    "babel-core": "^6.26.3",
+    "babel-jest": "^22.4.4",
     "babel-plugin-transform-object-assign": "^6.22.0",
     "babel-plugin-transform-proto-to-assign": "^6.26.0",
     "babel-plugin-transform-react-jsx": "^6.24.1",
     "babel-polyfill": "^6.26.0",
-    "babel-preset-env": "^1.6.1",
+    "babel-preset-env": "^1.7.0",
     "babel-register": "^6.26.0",
     "babelify": "^8.0.0",
-    "browser-sync": "^2.23.5",
-    "browserify": "^15.1.0",
+    "browser-sync": "^2.24.5",
+    "browserify": "^16.2.2",
     "chai": "^4.1.2",
-    "chalk": "1.1.3",
+    "chalk": "^2.4.1",
     "cssnano": "^3.10.0",
     "disc": "^1.3.3",
     "enzyme": "^3.3.0",
     "enzyme-adapter-react-16": "^1.1.1",
+    "es6-promise": "^4.2.4",
     "eslint": "^3.19.0",
     "eslint-config-standard": "^10.2.1",
     "eslint-config-standard-preact": "^1.1.6",
-    "eslint-plugin-compat": "^2.3.0",
-    "eslint-plugin-import": "^2.8.0",
-    "eslint-plugin-jest": "^21.6.2",
+    "eslint-plugin-compat": "^2.4.0",
+    "eslint-plugin-import": "^2.13.0",
+    "eslint-plugin-jest": "^21.17.0",
     "eslint-plugin-node": "^4.2.3",
-    "eslint-plugin-promise": "^3.6.0",
-    "eslint-plugin-standard": "^3.0.1",
-    "exorcist": "^1.0.0",
+    "eslint-plugin-promise": "^3.8.0",
+    "eslint-plugin-standard": "^3.1.0",
+    "exorcist": "^1.0.1",
     "fakefile": "0.0.9",
     "github-contributors-list": "1.2.3",
     "glob": "^7.1.2",
     "isomorphic-fetch": "2.2.1",
-    "jest": "^22.0.6",
+    "jest": "^22.4.4",
     "json3": "^3.3.2",
-    "lint-staged": "^6.0.0",
-    "minify-stream": "^1.1.0",
+    "lerna": "^2.11.0",
+    "lint-staged": "^6.1.1",
+    "minify-stream": "^1.2.0",
     "mkdirp": "0.5.1",
     "multi-glob": "1.0.1",
-    "next-update": "^3.6.0",
-    "nock": "^9.3.2",
+    "nock": "^9.3.3",
     "node-sass": "^4.9.0",
-    "npm-run-all": "^4.1.2",
-    "onchange": "^3.3.0",
-    "postcss": "^6.0.16",
+    "npm-auth-to-token": "^1.0.0",
+    "npm-run-all": "^4.1.3",
+    "onchange": "^4.0.0",
+    "postcss": "^6.0.23",
     "postcss-safe-important": "^1.1.0",
     "pre-commit": "^1.2.2",
-    "react": "^16.4.0",
-    "react-dom": "^16.4.0",
-    "redux": "^3.7.2",
+    "react": "^16.4.1",
+    "react-dom": "^16.4.1",
+    "redux": "^4.0.0",
     "replace-x": "^1.5.0",
-    "sass": "0.5.0",
     "temp-write": "^3.4.0",
-    "tinyify": "^2.4.0",
-    "typescript": "^2.8.1",
-    "uppy-server": "^0.13.1",
-    "watchify": "^3.9.0",
-    "wdio-mocha-framework": "^0.5.12",
-    "wdio-sauce-service": "^0.4.6",
+    "tinyify": "^2.4.3",
+    "typescript": "^2.9.2",
+    "uppy-server": "^0.13.4",
+    "verdaccio": "^3.2.0",
+    "watchify": "^3.11.0",
+    "wdio-mocha-framework": "^0.5.13",
+    "wdio-sauce-service": "^0.4.9",
     "wdio-static-server-service": "^1.0.1",
-    "webdriverio": "^4.10.1"
-  },
-  "dependencies": {
-    "classnames": "^2.2.5",
-    "cuid": "^2.0.2",
-    "drag-drop": "2.13.2",
-    "es6-promise": "^4.2.2",
-    "get-form-data": "^2.0.0",
-    "lodash.throttle": "4.1.1",
-    "mime-match": "^1.0.2",
-    "namespace-emitter": "^2.0.0",
-    "preact": "^8.2.7",
-    "prettier-bytes": "1.0.4",
-    "prop-types": "^15.5.10",
-    "resolve-url": "^0.2.1",
-    "socket.io-client": "^2.0.4",
-    "tus-js-client": "^1.4.5",
-    "url-parse": "^1.2.0",
-    "whatwg-fetch": "2.0.3"
+    "webdriverio": "^4.13.1"
   },
   "scripts": {
     "build:bundle": "node ./bin/build-js.js",
     "build:css": "node ./bin/build-css.js",
     "build:gzip": "node ./bin/gzip.js",
-    "size": "echo 'JS Bundle mingz:' && cat ./dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./dist/uppy.min.css | gzip | wc -c",
-    "build:js": "npm-run-all build:bundle build:lib",
-    "build:lib": "babel --version && babel src --source-maps -d lib --ignore '*.test.js'",
+    "size": "echo 'JS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.css | gzip | wc -c",
+    "build:js": "npm-run-all build:lib build:bundle",
+    "build:lib": "babel --version && node ./bin/build-lib.js",
     "build": "npm-run-all --parallel build:js build:css --serial build:gzip size",
-    "clean": "rm -rf lib && rm -rf dist",
-    "lint:fix": "eslint src test website/scripts website/build-examples.js website/update.js website/themes/uppy/source/js/common.js --fix",
-    "lint": "eslint src test website/scripts website/build-examples.js website/update.js website/themes/uppy/source/js/common.js",
+    "clean": "rm -rf packages/*/lib packages/@uppy/*/lib && rm -rf packages/uppy/dist",
+    "lint:fix": "npm run lint -- --fix",
+    "lint": "eslint . --cache",
     "lint-staged": "lint-staged",
-    "release:major": "env SEMANTIC=major npm run release",
-    "release:minor": "env SEMANTIC=minor npm run release",
-    "release:patch": "env SEMANTIC=patch npm run release",
-    "replace:versions": "replace-x -r 'uppy/v\\d+\\.\\d+\\.\\d+/dist' \"uppy/v$npm_package_version/dist\" ./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/ --exclude=node_modules",
-    "replace:versions:commit": "git commit -m \"Change Uppy version references to v$npm_package_version\" ./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/",
-    "release": "npm version ${SEMANTIC:-patch} -m \"Release %s\" && npm run replace:versions && npm run replace:versions:commit && git push && git push --tags && npm publish",
+    "release": "./bin/release",
     "start:server": "node bin/start-server",
     "start": "npm-run-all --parallel watch start:server web:preview",
-    "test:acceptance": "./bin/endtoend-build && wdio test/endtoend/wdio.remote.conf.js",
-    "test:acceptance:local": "./bin/endtoend-build && wdio test/endtoend/wdio.local.conf.js",
+    "test:registry": "verdaccio --listen 4002 --config test/endtoend/verdaccio.yaml",
+    "test:build": "./bin/endtoend-build",
+    "test:build-ci": "./bin/endtoend-build-ci",
+    "test:prepare-ci": "npm-run-all --parallel --race test:registry test:build-ci",
+    "test:acceptance": "npm run test:prepare-ci && wdio test/endtoend/wdio.remote.conf.js",
+    "test:acceptance:local": "npm run test:build && wdio test/endtoend/wdio.local.conf.js",
     "test:unit": "jest --testPathPattern=./src --coverage",
     "test:type": "tsc -p .",
-    "test": "npm run lint && npm run test:unit",
+    "test": "npm run lint && npm run test:unit && npm run test:type",
     "test:watch": "jest --watch --testPathPattern=src",
     "travis:deletecache": "travis cache --delete",
-    "watch:css": "onchange 'src/scss/**/*.scss' --initial --verbose -- npm run build:css",
-    "watch:js": "onchange 'src/**/*.js' --initial --verbose -- npm run build:bundle",
+    "watch:css": "onchange 'packages/**/*.scss' --initial --verbose -- npm run build:css",
+    "watch:js": "onchange 'packages/{@uppy/,}*/src/**/*.js' --initial --verbose -- npm run build:bundle",
     "watch": "npm-run-all --parallel watch:js watch:css",
     "watch:fast": "npm-run-all --parallel watch:css web:preview",
-    "watch:example:browsersync": "browser-sync start --server examples/bundled-example --port 3452 --serveStatic dist --files \"examples/bundled-example/bundle.js, dist/uppy.min.css\"",
-    "watch:example:js": "watchify -t babelify examples/bundled-example/main.js -o examples/bundled-example/bundle.js -vd",
+    "watch:example:browsersync": "browser-sync start --server examples/bundled-example --port 3452 --serveStatic packages/uppy/dist --files \"examples/bundled-example/bundle.js, packages/uppy/dist/uppy.min.css\"",
+    "watch:example:js": "cd examples/bundled-example && npm run watch",
     "watch:example": "npm-run-all --parallel watch:example:js watch:css watch:example:browsersync",
     "dev": "npm-run-all --parallel watch:example:js watch:css watch:example:browsersync",
     "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",
@@ -168,14 +113,14 @@
     "web:generated-docs": "cd website && node node_modules/documentation/bin/documentation.js readme ../src/index.js --readme-file=src/docs/api.md --section 'Uppy Core & Plugins' -q --github -c doc-order.json",
     "web:disc": "node ./bin/disc.js",
     "web:install": "cd website && npm install",
-    "web:bundle:update:watch": "onchange 'dist/**/*.css' 'dist/**/*.js' --initial --verbose -- node website/update.js",
+    "web:bundle:update:watch": "onchange 'packages/uppy/dist/**/*.css' 'packages/uppy/dist/**/*.js' --initial --verbose -- node website/update.js",
     "web:examples:watch": "cd website && node build-examples.js watch",
     "web:serve": "cd website && ./node_modules/.bin/hexo server",
-    "web:preview": "npm-run-all --parallel web:examples:watch web:bundle:update:watch web:serve",
+    "web:preview": "npm-run-all build:lib --parallel web:examples:watch web:bundle:update:watch web:serve",
     "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-all web:clean web:build",
     "uploadcdn": "bin/upload-to-cdn.sh",
-    "prepublishOnly": "npm-run-all clean build",
+    "prepare": "lerna bootstrap --hoist",
     "contributors": "githubcontrib --owner transloadit --repo uppy --cols 6 $([ \"${GITHUB_TOKEN:-}\" == \"\" ] && echo \"\" || echo \"--authToken ${GITHUB_TOKEN}\") --showlogin true --sortOrder desc",
     "contributors:save": "replace-x -m '<!--contributors-->[\\s\\S]+<!--/contributors-->' \"<!--contributors-->\n## Contributors\n\n$(npm run --silent contributors)\n<!--/contributors-->\" README.md"
   }

+ 21 - 0
packages/@uppy/aws-s3-multipart/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Transloadit
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 41 - 0
packages/@uppy/aws-s3-multipart/README.md

@@ -0,0 +1,41 @@
+# @uppy/aws-s3-multipart
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/aws-s3-multipart"><img src="https://img.shields.io/npm/v/@uppy/aws-s3-multipart.svg?style=flat-square"></a>
+<a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/master.svg?style=flat-square" alt="Build Status"></a>
+
+The AwsS3Multipart plugin can be used to upload files directly to an S3 bucket using S3’s Multipart upload strategy. With this strategy, files are chopped up in parts of 5MB+ each, so they can be uploaded concurrently. It’s also very reliable: if a single part fails to upload, only that 5MB has to be retried.
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```js
+const Uppy = require('@uppy/core')
+const AwsS3Multipart = require('@uppy/aws-s3-multipart')
+
+const uppy = Uppy()
+uppy.use(AwsS3Multipart, {
+  limit: 2,
+  serverUrl: 'https://uppy-server.myapp.com/'
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/aws-s3-multipart --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/aws-s3-multipart).
+
+## License
+
+[The MIT License](./LICENSE).

+ 37 - 0
packages/@uppy/aws-s3-multipart/package.json

@@ -0,0 +1,37 @@
+{
+  "name": "@uppy/aws-s3-multipart",
+  "description": "Upload to Amazon S3 with Uppy and S3's Multipart upload strategy",
+  "version": "0.26.0",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "aws s3",
+    "amazon s3",
+    "s3",
+    "uppy",
+    "uppy-plugin",
+    "multipart"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  },
+  "dependencies": {
+    "@uppy/server-utils": "0.26.0",
+    "@uppy/utils": "0.26.0",
+    "resolve-url": "^0.2.1"
+  },
+  "devDependencies": {
+    "@uppy/core": "0.26.0"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.26.0"
+  }
+}

+ 0 - 0
src/plugins/AwsS3/MultipartUploader.js → packages/@uppy/aws-s3-multipart/src/MultipartUploader.js


+ 6 - 7
src/plugins/AwsS3/Multipart.js → packages/@uppy/aws-s3-multipart/src/index.js

@@ -1,9 +1,8 @@
-const Plugin = require('../../core/Plugin')
-const RequestClient = require('../../server/RequestClient')
-const UppySocket = require('../../core/UppySocket')
-const emitSocketProgress = require('../../utils/emitSocketProgress')
-const getSocketHost = require('../../utils/getSocketHost')
-const limitPromises = require('../../utils/limitPromises')
+const { Plugin } = require('@uppy/core')
+const { Socket, RequestClient } = require('@uppy/server-utils')
+const emitSocketProgress = require('@uppy/utils/lib/emitSocketProgress')
+const getSocketHost = require('@uppy/utils/lib/getSocketHost')
+const limitPromises = require('@uppy/utils/lib/limitPromises')
 const Uploader = require('./MultipartUploader')
 
 /**
@@ -286,7 +285,7 @@ module.exports = class AwsS3Multipart extends Plugin {
     return new Promise((resolve, reject) => {
       const token = file.serverToken
       const host = getSocketHost(file.remote.serverUrl)
-      const socket = new UppySocket({ target: `${host}/api/${token}` })
+      const socket = new Socket({ target: `${host}/api/${token}` })
       this.uploaderSockets[socket] = socket
       this.uploaderEvents[file.id] = createEventTracker(this.uppy)
 

+ 34 - 0
packages/@uppy/aws-s3-multipart/types/aws-s3-multipart-tests.ts

@@ -0,0 +1,34 @@
+import Uppy, { UppyFile } from '@uppy/core';
+import AwsS3Multipart, { AwsS3Part } from '../';
+
+{
+  const uppy = Uppy();
+  uppy.use(AwsS3Multipart, {
+    createMultipartUpload(file) {
+      file // $ExpectType UppyFile
+    },
+    listParts(file, opts) {
+      file // $ExpectType UppyFile
+      opts.uploadId // $ExpectType string
+      opts.key // $ExpectType string
+    },
+    prepareUploadPart(file, part) {
+      file // $ExpectType UppyFile
+      part.uploadId // $ExpectType string
+      part.key // $ExpectType string
+      part.body // $ExpectType Blob
+      part.number // $ExpectType number
+    },
+    abortMultipartUpload(file, opts) {
+      file // $ExpectType UppyFile
+      opts.uploadId // $ExpectType string
+      opts.key // $ExpectType string
+    },
+    completeMultipartUpload(file, opts) {
+      file // $ExpectType UppyFile
+      opts.uploadId // $ExpectType string
+      opts.key // $ExpectType string
+      opts.parts[0] // $ExpectType AwsS3Part
+    },
+  });
+}

+ 28 - 0
packages/@uppy/aws-s3-multipart/types/index.d.ts

@@ -0,0 +1,28 @@
+import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
+
+export interface AwsS3Part {
+  PartNumber: number;
+  Size: number;
+  ETag: string;
+}
+
+export interface AwsS3MultipartOptions extends PluginOptions {
+  serverUrl: string;
+  createMultipartUpload(file: UppyFile): Promise<{uploadId: string, key: string}>;
+  listParts(file: UppyFile, opts: {uploadId: string, key: string}): Promise<AwsS3Part>;
+  prepareUploadPart(file: UppyFile, partData: {uploadId: string, key: string, body: Blob, number: number}): Promise<{url: string}>;
+  abortMultipartUpload(file: UppyFile, opts: {uploadId: string, key: string}): Promise<void>;
+  completeMultipartUpload(file: UppyFile, opts: {uploadId: string, key: string, parts: AwsS3Part[]}): Promise<{location?: string}>;
+  timeout: number;
+  limit: number;
+}
+
+export default class AwsS3Multipart extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<AwsS3MultipartOptions>);
+}
+
+declare module '@uppy/core' {
+  export interface Uppy {
+    use(pluginClass: typeof AwsS3Multipart, opts: Partial<AwsS3MultipartOptions>): Uppy;
+  }
+}

+ 21 - 0
packages/@uppy/aws-s3/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Transloadit
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 42 - 0
packages/@uppy/aws-s3/README.md

@@ -0,0 +1,42 @@
+# @uppy/aws-s3
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/aws-s3"><img src="https://img.shields.io/npm/v/@uppy/aws-s3.svg?style=flat-square"></a>
+<a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/master.svg?style=flat-square" alt="Build Status"></a>
+
+The AwsS3 plugin can be used to upload files directly to an S3 bucket. Uploads can be signed using Uppy Server or a custom signing function.
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```js
+const Uppy = require('@uppy/core')
+const AwsS3 = require('@uppy/aws-s3')
+
+const uppy = Uppy()
+uppy.use(AwsS3, {
+  limit: 2,
+  timeout: ms('1 minute'),
+  serverUrl: 'https://uppy-server.myapp.com/'
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/aws-s3 --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/aws-s3).
+
+## License
+
+[The MIT License](./LICENSE).

+ 36 - 0
packages/@uppy/aws-s3/package.json

@@ -0,0 +1,36 @@
+{
+  "name": "@uppy/aws-s3",
+  "description": "Upload to Amazon S3 with Uppy",
+  "version": "0.26.0",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "aws s3",
+    "amazon s3",
+    "s3",
+    "uppy",
+    "uppy-plugin"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  },
+  "dependencies": {
+    "@uppy/utils": "0.26.0",
+    "@uppy/xhr-upload": "0.26.0",
+    "resolve-url": "^0.2.1"
+  },
+  "devDependencies": {
+    "@uppy/core": "0.26.0"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.26.0"
+  }
+}

+ 9 - 4
src/plugins/AwsS3/index.js → packages/@uppy/aws-s3/src/index.js

@@ -1,8 +1,8 @@
 const resolveUrl = require('resolve-url')
-const Plugin = require('../../core/Plugin')
-const Translator = require('../../core/Translator')
-const limitPromises = require('../../utils/limitPromises')
-const XHRUpload = require('../XHRUpload')
+const { Plugin } = require('@uppy/core')
+const Translator = require('@uppy/utils/lib/Translator')
+const limitPromises = require('@uppy/utils/lib/limitPromises')
+const XHRUpload = require('@uppy/xhr-upload')
 
 function isXml (xhr) {
   const contentType = xhr.headers ? xhr.headers['content-type'] : xhr.getResponseHeader('Content-Type')
@@ -175,6 +175,11 @@ module.exports = class AwsS3 extends Plugin {
             return { location: null }
           }
 
+          // responseURL is not available in older browsers.
+          if (!xhr.responseURL) {
+            return { location: null }
+          }
+
           // Trim the query string because it's going to be a bunch of presign
           // parameters for a PUT request—doing a GET request with those will
           // always result in an error

+ 11 - 0
packages/@uppy/aws-s3/types/aws-s3-tests.ts

@@ -0,0 +1,11 @@
+import Uppy, { UppyFile } from '@uppy/core';
+import AwsS3 from '../';
+
+{
+  const uppy = Uppy();
+  uppy.use(AwsS3, {
+    getUploadParameters(file) {
+      file // $ExpectType UppyFile
+    }
+  });
+}

+ 25 - 0
packages/@uppy/aws-s3/types/index.d.ts

@@ -0,0 +1,25 @@
+import { Plugin, PluginOptions, Uppy, UppyFile } from '@uppy/core';
+
+export interface AwsS3UploadParameters {
+  method?: string;
+  url: string;
+  fields?: { [type: string]: string };
+  headers?: { [type: string]: string };
+}
+
+export interface AwsS3Options extends PluginOptions {
+  serverUrl: string;
+  getUploadParameters(file: UppyFile): Promise<AwsS3UploadParameters>;
+  timeout: number;
+  limit: number;
+}
+
+export default class AwsS3 extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<AwsS3Options>);
+}
+
+declare module '@uppy/core' {
+  export interface Uppy {
+    use(pluginClass: typeof AwsS3, opts: Partial<AwsS3Options>): Uppy;
+  }
+}

+ 21 - 0
packages/@uppy/core/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Transloadit
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 43 - 0
packages/@uppy/core/README.md

@@ -0,0 +1,43 @@
+# @uppy/core
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/core"><img src="https://img.shields.io/npm/v/@uppy/core.svg?style=flat-square"></a>
+<a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/master.svg?style=flat-square" alt="Build Status"></a>
+
+Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. It’s fast, easy to use and lets you worry about more important problems than building a file uploader.
+
+- **Fetch** files from local disk, remote urls, Google Drive, Dropbox, Instagram, or snap and record selfies with a camera;
+- **Preview** and edit metadata with a nice interface;
+- **Upload** to the final destination, optionally process/encode
+
+**[Read the docs](https://uppy.io/docs)** | **[Try Uppy](https://uppy.io/examples/dashboard/)**
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```js
+const Uppy = require('@uppy/core')
+
+const uppy = Uppy({ autoProceed: false })
+uppy.use(SomePlugin)
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/core --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/uppy).
+
+## License
+
+[The MIT License](./LICENSE).

+ 33 - 0
packages/@uppy/core/package.json

@@ -0,0 +1,33 @@
+{
+  "name": "@uppy/core",
+  "description": "Core module for the extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:",
+  "version": "0.26.0",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "style": "dist/style.min.css",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "uppy",
+    "uppy-plugin"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  },
+  "dependencies": {
+    "@uppy/store-default": "0.26.0",
+    "@uppy/utils": "0.26.0",
+    "cuid": "^2.1.1",
+    "lodash.throttle": "^4.1.1",
+    "mime-match": "^1.0.2",
+    "namespace-emitter": "^2.0.1",
+    "preact": "^8.2.9",
+    "prettier-bytes": "^1.0.4"
+  }
+}

+ 1 - 1
src/core/Plugin.js → packages/@uppy/core/src/Plugin.js

@@ -1,5 +1,5 @@
 const preact = require('preact')
-const findDOMElement = require('../utils/findDOMElement')
+const findDOMElement = require('@uppy/utils/lib/findDOMElement')
 
 /**
  * Defer a frequent call to the microtask queue.

+ 0 - 0
src/core/__snapshots__/Core.test.js.snap → packages/@uppy/core/src/__snapshots__/index.test.js.snap


+ 5 - 0
src/scss/_common.scss → packages/@uppy/core/src/_common.scss

@@ -18,6 +18,11 @@
 //   outline: 0;
 // }
 
+.uppy-Root *:focus {
+  outline: 2px solid $color-cornflower-blue;
+  outline-offset: 3px;
+}
+
 // https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
 
 .UppyIcon {

+ 0 - 0
src/scss/_utils.scss → packages/@uppy/core/src/_utils.scss


+ 0 - 0
src/scss/_variables.scss → packages/@uppy/core/src/_variables.scss


+ 9 - 7
src/core/Core.js → packages/@uppy/core/src/index.js

@@ -1,15 +1,16 @@
-const Translator = require('../core/Translator')
+const Translator = require('@uppy/utils/lib/Translator')
 const ee = require('namespace-emitter')
 const cuid = require('cuid')
 // const throttle = require('lodash.throttle')
 const prettyBytes = require('prettier-bytes')
 const match = require('mime-match')
-const DefaultStore = require('../store/DefaultStore')
-const getFileType = require('../utils/getFileType')
-const getFileNameAndExtension = require('../utils/getFileNameAndExtension')
-const generateFileID = require('../utils/generateFileID')
-const isObjectURL = require('../utils/isObjectURL')
-const getTimeStamp = require('../utils/getTimeStamp')
+const DefaultStore = require('@uppy/store-default')
+const getFileType = require('@uppy/utils/lib/getFileType')
+const getFileNameAndExtension = require('@uppy/utils/lib/getFileNameAndExtension')
+const generateFileID = require('@uppy/utils/lib/generateFileID')
+const isObjectURL = require('@uppy/utils/lib/isObjectURL')
+const getTimeStamp = require('@uppy/utils/lib/getTimeStamp')
+const Plugin = require('./Plugin') // Exported from here.
 
 /**
  * Uppy Core module.
@@ -1220,3 +1221,4 @@ module.exports = function (opts) {
 
 // Expose class constructor.
 module.exports.Uppy = Uppy
+module.exports.Plugin = Plugin

+ 8 - 8
src/core/Core.test.js → packages/@uppy/core/src/index.test.js

@@ -1,21 +1,21 @@
 const fs = require('fs')
 const path = require('path')
-const Core = require('./Core')
+const Core = require('./index')
 const Plugin = require('./Plugin')
-const AcquirerPlugin1 = require('../../test/mocks/acquirerPlugin1')
-const AcquirerPlugin2 = require('../../test/mocks/acquirerPlugin2')
-const InvalidPlugin = require('../../test/mocks/invalidPlugin')
-const InvalidPluginWithoutId = require('../../test/mocks/invalidPluginWithoutId')
-const InvalidPluginWithoutType = require('../../test/mocks/invalidPluginWithoutType')
+const AcquirerPlugin1 = require('../../../../test/mocks/acquirerPlugin1')
+const AcquirerPlugin2 = require('../../../../test/mocks/acquirerPlugin2')
+const InvalidPlugin = require('../../../../test/mocks/invalidPlugin')
+const InvalidPluginWithoutId = require('../../../../test/mocks/invalidPluginWithoutId')
+const InvalidPluginWithoutType = require('../../../../test/mocks/invalidPluginWithoutType')
 
 jest.mock('cuid', () => {
   return () => 'cjd09qwxb000dlql4tp4doz8h'
 })
-jest.mock('../utils/findDOMElement', () => {
+jest.mock('@uppy/utils/lib/findDOMElement', () => {
   return () => null
 })
 
-const sampleImage = fs.readFileSync(path.join(__dirname, '../../test/resources/image.jpg'))
+const sampleImage = fs.readFileSync(path.join(__dirname, '../../../../test/resources/image.jpg'))
 
 describe('src/Core', () => {
   const RealCreateObjectUrl = global.URL.createObjectURL

+ 3 - 0
packages/@uppy/core/src/style.scss

@@ -0,0 +1,3 @@
+@import './_variables.scss';
+@import './_utils.scss';
+@import './_common.scss';

+ 13 - 0
packages/@uppy/core/types/core-tests.ts

@@ -0,0 +1,13 @@
+import Uppy, { UppyFile } from '../';
+
+{
+  const uppy = Uppy();
+  uppy.addFile({
+    data: new Blob([new ArrayBuffer(1024)], { type: 'application/octet-stream' })
+  });
+
+  uppy.upload().then((result) => {
+    result.successful[0]; // $ExpectType UppyFile
+    result.failed[0]; // $ExpectType UppyFile
+  });
+}

+ 129 - 0
packages/@uppy/core/types/index.d.ts

@@ -0,0 +1,129 @@
+export interface UppyFile {
+  data: Blob | File;
+  extension: string;
+  id: string;
+  isPaused: boolean;
+  isRemote: boolean;
+  meta: {
+    name: string;
+    type?: string;
+  };
+  name: string;
+  preview?: string;
+  progress?: {
+    uploadStarted: number;
+    uploadComplete: boolean;
+    percentage: number;
+    bytesUploaded: number;
+    bytesTotal: number;
+  };
+  remote?: {
+    host: string;
+    url: string;
+    body?: object;
+  };
+  size: number;
+  source?: string;
+  type?: string;
+  uploadURL?: string;
+}
+
+export interface AddFileOptions extends Partial<UppyFile> {
+  // `.data` is the only required property here.
+  data: Blob | File;
+}
+
+export interface PluginOptions {
+  id?: string;
+}
+
+export class Plugin {
+  constructor(uppy: Uppy, opts?: PluginOptions);
+  getPluginState(): object;
+  setPluginState(update: any): object;
+  update(state?: object): void;
+  mount(target: any, plugin: any): void;
+  render(state: object): void;
+  addTarget(plugin: any): void;
+  unmount(): void;
+  install(): void;
+  uninstall(): void;
+}
+
+export interface Store {
+  getState(): object;
+  setState(patch: object): void;
+  subscribe(listener: any): () => void;
+}
+
+export interface UppyOptions {
+  id: string;
+  autoProceed: boolean;
+  debug: boolean;
+  restrictions: {
+    maxFileSize: false,
+    maxNumberOfFiles: false,
+    minNumberOfFiles: false,
+    allowedFileTypes: false
+  };
+  target: string | Plugin;
+  meta: any;
+  // onBeforeFileAdded: (currentFile, files) => currentFile,
+  // onBeforeUpload: (files) => files,
+  locale: any;
+  store: Store;
+}
+
+export interface UploadResult {
+  successful: UppyFile[];
+  failed: UppyFile[];
+}
+
+type LogLevel = 'info' | 'warning' | 'error';
+export class Uppy {
+  constructor(opts?: Partial<UppyOptions>);
+  on(event: 'upload-success', callback: (file: UppyFile, body: any, uploadURL: string) => void): Uppy;
+  on(event: 'complete', callback: (result: UploadResult) => void): Uppy;
+  on(event: string, callback: (...args: any[]) => void): Uppy;
+  off(event: string, callback: any): Uppy;
+  updateAll(state: object): void;
+  setState(patch: object): void;
+  getState(): object;
+  readonly state: object;
+  setFileState(fileID: string, state: object): void;
+  resetProgress(): void;
+  addPreProcessor(fn: any): void;
+  removePreProcessor(fn: any): void;
+  addPostProcessor(fn: any): void;
+  removePostProcessor(fn: any): void;
+  addUploader(fn: any): void;
+  removeUploader(fn: any): void;
+  setMeta(data: any): void;
+  setFileMeta(fileID: string, data: object): void;
+  getFile(fileID: string): UppyFile;
+  getFiles(): UppyFile[];
+  addFile(file: AddFileOptions): void;
+  removeFile(fileID: string): void;
+  pauseResume(fileID: string): boolean;
+  pauseAll(): void;
+  resumeAll(): void;
+  retryAll(): void;
+  cancelAll(): void;
+  retryUpload(fileID: string): any;
+  reset(): void;
+  getID(): string;
+  use<T extends typeof Plugin>(pluginClass: T, opts: object): Uppy;
+  getPlugin(name: string): Plugin;
+  iteratePlugins(callback: (plugin: Plugin) => void): void;
+  removePlugin(instance: Plugin): void;
+  close(): void;
+  info(message: string | { message: string; details: string; }, type?: LogLevel, duration?: number): void;
+  hideInfo(): void;
+  log(msg: string, type?: LogLevel): void;
+  run(): Uppy;
+  restore(uploadID: string): Promise<UploadResult>;
+  addResultData(uploadID: string, data: object): void;
+  upload(): Promise<UploadResult>;
+}
+
+export default function createUppy(opts?: Partial<UppyOptions>): Uppy;

+ 21 - 0
packages/@uppy/dashboard/LICENSE

@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2018 Transloadit
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 50 - 0
packages/@uppy/dashboard/README.md

@@ -0,0 +1,50 @@
+# @uppy/dashboard
+
+<img src="https://uppy.io/images/logos/uppy-dog-head-arrow.svg" width="120" alt="Uppy logo: a superman puppy in a pink suit" align="right">
+
+<a href="https://www.npmjs.com/package/@uppy/dashboard"><img src="https://img.shields.io/npm/v/@uppy/dashboard.svg?style=flat-square"></a>
+<a href="https://travis-ci.org/transloadit/uppy"><img src="https://img.shields.io/travis/transloadit/uppy/master.svg?style=flat-square" alt="Build Status"></a>
+
+Dashboard is a universal UI plugin for Uppy:
+
+ * Drag and Drop, paste, select from local disk / my device
+ * UI for Webcam and remote sources: Google Drive, Dropbox, Instagram (all optional, added via plugins)
+ * File previews and info
+ * Metadata editor
+ * Progress: total and for individual files
+ * Ability to pause/resume or cancel (depending on uploader plugin) individual or all files
+
+**[Read the docs](https://uppy.io/docs/dashboard/)** | **[Try it](https://uppy.io/examples/dashboard/)**
+
+Uppy is being developed by the folks at [Transloadit](https://transloadit.com), a versatile file encoding service.
+
+## Example
+
+```js
+const Uppy = require('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+
+const uppy = Uppy()
+uppy.use(Dashboard, {
+  target: 'body',
+  inline: true
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/dashboard --save
+```
+
+We recommend installing from npm and then using a module bundler such as [Webpack](http://webpack.github.io/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).
+
+Alternatively, you can also use this plugin in a pre-built bundle from Transloadit's CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object. See the [main Uppy documentation](https://uppy.io/docs/#Installation) for instructions.
+
+## Documentation
+
+Documentation for this plugin can be found on the [Uppy website](https://uppy.io/docs/dashboard).
+
+## License
+
+[The MIT License](./LICENSE).

+ 42 - 0
packages/@uppy/dashboard/package.json

@@ -0,0 +1,42 @@
+{
+  "name": "@uppy/dashboard",
+  "description": "Universal UI plugin for Uppy.",
+  "version": "0.26.0",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "style": "dist/style.min.css",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "uppy",
+    "uppy-plugin",
+    "dashboard",
+    "ui"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  },
+  "dependencies": {
+    "@uppy/informer": "0.26.0",
+    "@uppy/provider-views": "0.26.0",
+    "@uppy/status-bar": "0.26.0",
+    "@uppy/thumbnail-generator": "0.26.0",
+    "@uppy/utils": "0.26.0",
+    "classnames": "^2.2.6",
+    "drag-drop": "^2.14.0",
+    "preact": "^8.2.9",
+    "prettier-bytes": "^1.0.4"
+  },
+  "devDependencies": {
+    "@uppy/core": "0.26.0"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.26.0"
+  }
+}

+ 0 - 0
src/plugins/Dashboard/ActionBrowseTagline.js → packages/@uppy/dashboard/src/ActionBrowseTagline.js


+ 1 - 1
src/plugins/Dashboard/Dashboard.js → packages/@uppy/dashboard/src/Dashboard.js

@@ -2,7 +2,7 @@ const FileList = require('./FileList')
 const Tabs = require('./Tabs')
 const FileCard = require('./FileCard')
 const classNames = require('classnames')
-const isTouchDevice = require('../../utils/isTouchDevice')
+const isTouchDevice = require('@uppy/utils/lib/isTouchDevice')
 const { h } = require('preact')
 
 // http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog

+ 0 - 0
src/plugins/Dashboard/FileCard.js → packages/@uppy/dashboard/src/FileCard.js


+ 3 - 3
src/plugins/Dashboard/FileItem.js → packages/@uppy/dashboard/src/FileItem.js

@@ -1,6 +1,6 @@
-const getFileNameAndExtension = require('../../utils/getFileNameAndExtension')
-const truncateString = require('../../utils/truncateString')
-const copyToClipboard = require('../../utils/copyToClipboard')
+const getFileNameAndExtension = require('@uppy/utils/lib/getFileNameAndExtension')
+const truncateString = require('./truncateString')
+const copyToClipboard = require('./copyToClipboard')
 const prettyBytes = require('prettier-bytes')
 const FileItemProgress = require('./FileItemProgress')
 const getFileTypeIcon = require('./getFileTypeIcon')

+ 0 - 0
src/plugins/Dashboard/FileItemProgress.js → packages/@uppy/dashboard/src/FileItemProgress.js


+ 0 - 0
src/plugins/Dashboard/FileList.js → packages/@uppy/dashboard/src/FileList.js


+ 0 - 0
src/plugins/Dashboard/FilePreview.js → packages/@uppy/dashboard/src/FilePreview.js


+ 0 - 0
src/plugins/Dashboard/Tabs.js → packages/@uppy/dashboard/src/Tabs.js


+ 0 - 0
src/utils/copyToClipboard.js → packages/@uppy/dashboard/src/copyToClipboard.js


+ 0 - 0
src/utils/copyToClipboard.test.js → packages/@uppy/dashboard/src/copyToClipboard.test.js


+ 0 - 0
src/plugins/Dashboard/getFileTypeIcon.js → packages/@uppy/dashboard/src/getFileTypeIcon.js


Some files were not shown because too many files changed in this diff