Prechádzať zdrojové kódy

Merge pull request #906 from transloadit/feature/lerna

Lerna.js
Artur Paikin 6 rokov pred
rodič
commit
0d3f1b6a65
100 zmenil súbory, kde vykonal 1946 pridanie a 546 odobranie
  1. 0 1
      .babelrc
  2. 4 6
      .eslintignore
  3. 1 0
      .gitignore
  4. 1 1
      CHANGELOG.md
  5. 8 8
      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. 10 11
      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. 4 4
      examples/custom-provider/client/MyCustomProvider.js
  24. 0 7
      examples/custom-provider/client/aliasify.js
  25. 4 4
      examples/custom-provider/client/main.js
  26. 5 1
      examples/custom-provider/package.json
  27. 3 3
      examples/digitalocean-spaces/main.js
  28. 2 2
      examples/digitalocean-spaces/server.js
  29. 0 7
      examples/multiple-instances/aliasify.js
  30. 3 3
      examples/multiple-instances/main.js
  31. 537 0
      examples/multiple-instances/package-lock.json
  32. 5 1
      examples/multiple-instances/package.json
  33. 4 4
      examples/react-example/App.js
  34. 0 7
      examples/react-example/aliasify.js
  35. 5 1
      examples/react-example/package.json
  36. 0 7
      examples/redux/aliasify.js
  37. 4 4
      examples/redux/main.js
  38. 5 1
      examples/redux/package.json
  39. 0 7
      examples/xhr-bundle/aliasify.js
  40. 3 3
      examples/xhr-bundle/main.js
  41. 5 1
      examples/xhr-bundle/package.json
  42. 8 0
      lerna.json
  43. 3 0
      locales/README.md
  44. 0 0
      locales/cs_CZ.js
  45. 0 0
      locales/de_DE.js
  46. 0 0
      locales/en_US.js
  47. 0 0
      locales/es_ES.js
  48. 0 0
      locales/fi_FI.js
  49. 0 0
      locales/id_ID.js
  50. 0 0
      locales/it_IT.js
  51. 0 0
      locales/nb_NO.js
  52. 0 0
      locales/pl_PL.js
  53. 0 0
      locales/pt_BR.js
  54. 0 0
      locales/ru_RU.js
  55. 0 0
      locales/tr_TR.js
  56. 0 0
      locales/zh_CN.js
  57. 321 216
      package-lock.json
  58. 28 82
      package.json
  59. 21 0
      packages/@uppy/aws-s3-multipart/LICENSE
  60. 41 0
      packages/@uppy/aws-s3-multipart/README.md
  61. 37 0
      packages/@uppy/aws-s3-multipart/package.json
  62. 0 0
      packages/@uppy/aws-s3-multipart/src/MultipartUploader.js
  63. 6 7
      packages/@uppy/aws-s3-multipart/src/index.js
  64. 22 0
      packages/@uppy/aws-s3-multipart/types/index.d.ts
  65. 21 0
      packages/@uppy/aws-s3/LICENSE
  66. 42 0
      packages/@uppy/aws-s3/README.md
  67. 36 0
      packages/@uppy/aws-s3/package.json
  68. 4 4
      packages/@uppy/aws-s3/src/index.js
  69. 19 0
      packages/@uppy/aws-s3/types/index.d.ts
  70. 21 0
      packages/@uppy/core/LICENSE
  71. 43 0
      packages/@uppy/core/README.md
  72. 33 0
      packages/@uppy/core/package.json
  73. 1 1
      packages/@uppy/core/src/Plugin.js
  74. 0 0
      packages/@uppy/core/src/__snapshots__/index.test.js.snap
  75. 0 0
      packages/@uppy/core/src/_common.scss
  76. 0 0
      packages/@uppy/core/src/_utils.scss
  77. 0 0
      packages/@uppy/core/src/_variables.scss
  78. 7 7
      packages/@uppy/core/src/index.js
  79. 8 8
      packages/@uppy/core/src/index.test.js
  80. 3 0
      packages/@uppy/core/src/style.scss
  81. 125 0
      packages/@uppy/core/types/index.d.ts
  82. 21 0
      packages/@uppy/dashboard/LICENSE
  83. 50 0
      packages/@uppy/dashboard/README.md
  84. 42 0
      packages/@uppy/dashboard/package.json
  85. 0 0
      packages/@uppy/dashboard/src/ActionBrowseTagline.js
  86. 1 1
      packages/@uppy/dashboard/src/Dashboard.js
  87. 0 0
      packages/@uppy/dashboard/src/FileCard.js
  88. 3 3
      packages/@uppy/dashboard/src/FileItem.js
  89. 0 0
      packages/@uppy/dashboard/src/FileItemProgress.js
  90. 0 0
      packages/@uppy/dashboard/src/FileList.js
  91. 0 0
      packages/@uppy/dashboard/src/FilePreview.js
  92. 0 0
      packages/@uppy/dashboard/src/Tabs.js
  93. 0 0
      packages/@uppy/dashboard/src/getFileTypeIcon.js
  94. 0 0
      packages/@uppy/dashboard/src/icons.js
  95. 7 7
      packages/@uppy/dashboard/src/index.js
  96. 2 2
      packages/@uppy/dashboard/src/index.test.js
  97. 8 3
      packages/@uppy/dashboard/src/style.scss
  98. 35 0
      packages/@uppy/dashboard/types/index.d.ts
  99. 21 0
      packages/@uppy/drag-drop/LICENSE
  100. 42 0
      packages/@uppy/drag-drop/README.md

+ 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

+ 1 - 1
CHANGELOG.md

@@ -88,7 +88,7 @@ What we need to do to release Uppy 1.0
 - [ ] feature: preset for Transloadit that mimics jQuery SDK, check https://github.com/transloadit/jquery-sdk docs (@goto-bus-stop)
 - [ ] 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)
-- [x] QA: make it so that all integration tests use `npm pack` and `npm install` first (@ife)
+- [ ] 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
 - [x] feature: easy integration with React (UppyReact components)

+ 8 - 8
README.md

@@ -26,12 +26,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' })
@@ -174,9 +174,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

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

@@ -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('@uppy/core')
+const Dashboard = require('@uppy/dashboard')
+const Instagram = require('@uppy/instagram')
+const GoogleDrive = require('@uppy/google-drive')
+const Webcam = require('@uppy/webcam')
+const Tus = require('@uppy/tus')
+const Form = require('@uppy/form')
 
 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"
+    }
+  }
+}

+ 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/lib/Plugin')
+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"

+ 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


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 321 - 216
package-lock.json


+ 28 - 82
package.json

@@ -1,57 +1,18 @@
 {
-  "name": "uppy",
-  "version": "0.25.6",
+  "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/",
-    "types/"
-  ],
   "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": {
+    "aliasify": "^2.1.0",
     "autoprefixer": "^7.2.5",
     "babel-cli": "^6.26.0",
     "babel-core": "^6.26.0",
     "babel-jest": "^22.0.6",
-    "babel-plugin-es6-promise": "^1.1.1",
     "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",
@@ -67,6 +28,7 @@
     "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",
@@ -83,6 +45,7 @@
     "isomorphic-fetch": "2.2.1",
     "jest": "^22.0.6",
     "json3": "^3.3.2",
+    "lerna": "^2.11.0",
     "lint-staged": "^6.0.0",
     "minify-stream": "^1.1.0",
     "mkdirp": "0.5.1",
@@ -90,6 +53,7 @@
     "next-update": "^3.6.0",
     "nock": "^9.3.2",
     "node-sass": "^4.9.0",
+    "npm-auth-to-token": "^1.0.0",
     "npm-run-all": "^4.1.2",
     "onchange": "^3.3.0",
     "postcss": "^6.0.16",
@@ -104,63 +68,45 @@
     "tinyify": "^2.4.0",
     "typescript": "^2.8.1",
     "uppy-server": "^0.13.1",
+    "verdaccio": "^3.2.0",
     "watchify": "^3.9.0",
     "wdio-mocha-framework": "^0.5.12",
     "wdio-sauce-service": "^0.4.6",
     "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"
-  },
   "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:type": "tsc -p packages/uppy/types",
+    "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: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",
@@ -169,14 +115,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.25.5",
+  "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.25.5",
+    "@uppy/utils": "^0.25.5",
+    "resolve-url": "^0.2.1"
+  },
+  "devDependencies": {
+    "@uppy/core": "^0.25.5"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 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/lib/Plugin')
+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)
 

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

@@ -0,0 +1,22 @@
+import { Plugin, PluginOptions, Uppy } from '@uppy/core';
+
+export interface AwsS3Part {
+  PartNumber: number;
+  Size: number;
+  ETag: string;
+}
+
+export interface AwsS3MultipartOptions extends PluginOptions {
+  serverUrl: string;
+  createMultipartUpload(file: object): Promise<{uploadId: string, key: string}>;
+  listParts(opts: {uploadId: string, key: string}): Promise<AwsS3Part>;
+  prepareUploadPart(partData: {uploadId: string, key: string, body: Blob, number: number}): Promise<{url: string}>;
+  abortMultipartUpload(opts: {uploadId: string, key: string}): Promise<void>;
+  completeMultipartUpload(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>);
+}

+ 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.25.5",
+  "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.25.5",
+    "@uppy/xhr-upload": "^0.25.5",
+    "resolve-url": "^0.2.1"
+  },
+  "devDependencies": {
+    "@uppy/core": "^0.25.5"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 4 - 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/lib/Plugin')
+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')

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

@@ -0,0 +1,19 @@
+import { Plugin, PluginOptions, Uppy } 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: object): Promise<AwsS3UploadParameters>;
+  timeout: number;
+  limit: number;
+}
+
+export default class AwsS3 extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<AwsS3Options>);
+}

+ 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.25.5",
+  "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.25.5",
+    "@uppy/utils": "^0.25.5",
+    "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


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


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


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


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

@@ -1,15 +1,15 @@
-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')
 
 /**
  * Uppy Core module.

+ 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';

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

@@ -0,0 +1,125 @@
+// TODO actually use the properties here
+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 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: Array<UppyFile>;
+  failed: Array<UppyFile>;
+}
+
+type LogLevel = 'info' | 'warning' | 'error';
+export class Uppy {
+  constructor(opts?: Partial<UppyOptions>);
+  on(event: 'upload-success', callback: (file: UppyFile, body: any, uploadURL: string) => any): Uppy;
+  on(event: 'complete', callback: (result: UploadResult) => void): Uppy;
+  on(event: string, callback: (...args: any[]) => any): 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: any): void;
+  getFile(fileID: string): UppyFile;
+  getFiles(): UppyFile[];
+  addFile(file: object): 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(plugin: typeof Plugin, opts: any): Uppy;
+  getPlugin(name: string): Plugin;
+  iteratePlugins(method: any): 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<any>;
+  addResultData(uploadID: string, data: any): void;
+  upload(): Promise<any>;
+}
+
+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.25.5",
+  "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.25.5",
+    "@uppy/provider-views": "^0.25.5",
+    "@uppy/status-bar": "^0.25.5",
+    "@uppy/thumbnail-generator": "^0.25.5",
+    "@uppy/utils": "^0.25.5",
+    "classnames": "^2.2.6",
+    "drag-drop": "^2.14.0",
+    "preact": "^8.2.9",
+    "prettier-bytes": "^1.0.4"
+  },
+  "devDependencies": {
+    "@uppy/core": "^0.25.5"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 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('@uppy/utils/lib/truncateString')
+const copyToClipboard = require('@uppy/utils/lib/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/plugins/Dashboard/getFileTypeIcon.js → packages/@uppy/dashboard/src/getFileTypeIcon.js


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


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

@@ -1,12 +1,12 @@
-const Plugin = require('../../core/Plugin')
-const Translator = require('../../core/Translator')
+const Plugin = require('@uppy/core/lib/Plugin')
+const Translator = require('@uppy/utils/lib/Translator')
 const dragDrop = require('drag-drop')
 const DashboardUI = require('./Dashboard')
-const StatusBar = require('../StatusBar')
-const Informer = require('../Informer')
-const ThumbnailGenerator = require('../ThumbnailGenerator')
-const findAllDOMElements = require('../../utils/findAllDOMElements')
-const toArray = require('../../utils/toArray')
+const StatusBar = require('@uppy/status-bar')
+const Informer = require('@uppy/informer')
+const ThumbnailGenerator = require('@uppy/thumbnail-generator')
+const findAllDOMElements = require('@uppy/utils/lib/findAllDOMElements')
+const toArray = require('@uppy/utils/lib/toArray')
 const prettyBytes = require('prettier-bytes')
 const { defaultTabIcon } = require('./icons')
 

+ 2 - 2
src/plugins/Dashboard/index.test.js → packages/@uppy/dashboard/src/index.test.js

@@ -1,6 +1,6 @@
-const Core = require('../../core')
+const Core = require('@uppy/core')
 const DashboardPlugin = require('./index')
-const StatusBarPlugin = require('../StatusBar')
+const StatusBarPlugin = require('@uppy/status-bar')
 
 describe('Dashboard', () => {
   it('can safely be added together with the StatusBar without id conflicts', () => {

+ 8 - 3
src/scss/_dashboard.scss → packages/@uppy/dashboard/src/style.scss

@@ -1,3 +1,8 @@
+@import '@uppy/core/src/style.scss';
+@import '@uppy/informer/src/style.scss';
+@import '@uppy/status-bar/src/style.scss';
+@import '@uppy/provider-views/src/style.scss';
+
 .uppy-Dashboard--modal {
   z-index: $zIndex-2;
 }
@@ -37,7 +42,7 @@
       from { transform: translate3d(0, 0, 0); opacity: 1; }
       to { transform: translate3d(0, -20%, 0); opacity: 0; }
     }
-  
+
   .uppy-Dashboard--modal.uppy-Dashboard--animateOpenClose > .uppy-Dashboard-inner {
     animation: uppy-Dashboard-slideDownAndFadeIn--small 0.3s cubic-bezier(0, 0, .2, 1);
 
@@ -152,7 +157,7 @@
 }
 
 .uppy-Dashboard-close:hover {
-  color: $color-cornflower-blue; 
+  color: $color-cornflower-blue;
 }
 
 
@@ -1028,7 +1033,7 @@
 .uppy-DashboardFileCard {
   transform: translate3d(0, 0, 0);
   transition: transform 0.2s ease-in-out;
-  
+
   width: 100%;
   height: 100%;
   position: absolute;

+ 35 - 0
packages/@uppy/dashboard/types/index.d.ts

@@ -0,0 +1,35 @@
+import { Plugin, PluginOptions, Uppy } from '@uppy/core';
+
+export interface DashboardOptions extends PluginOptions {
+  onRequestCloseModal: () => void;
+  disablePageScrollWhenModalOpen: boolean;
+  closeModalOnClickOutside: boolean;
+  trigger: string | HTMLElement;
+  inline: boolean;
+  defaultTabIcon: string;
+  hideUploadButton: boolean;
+  width: string;
+  height: string;
+  note: string;
+  showLinkToFileUploadResult: boolean;
+  proudlyDisplayPoweredByUppy: boolean;
+  metaFields: string[];
+  plugins: string[];
+  disableStatusBar: boolean;
+  showProgressDetails: boolean;
+  hideProgressAfterFinish: boolean;
+  disableInformer: boolean;
+  disableThumbnailGenerator: boolean;
+}
+
+export default class Dashboard extends Plugin {
+  constructor(uppy: Uppy, opts: Partial<DashboardOptions>);
+  addTarget(plugin: Plugin): HTMLElement;
+  hideAllPanels(): void;
+  openModal(): void;
+  closeModal(): void;
+  isModalOpen(): boolean;
+  render(state: object): void;
+  install(): void;
+  uninstall(): void;
+}

+ 21 - 0
packages/@uppy/drag-drop/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/drag-drop/README.md

@@ -0,0 +1,42 @@
+# @uppy/drag-drop
+
+<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/drag-drop"><img src="https://img.shields.io/npm/v/@uppy/drag-drop.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>
+
+Droppable zone UI for Uppy. Drag and drop files into it to upload.
+
+**[Read the docs](https://uppy.io/docs/dragdrop)** | **[Try it](https://uppy.io/examples/dragdrop/)**
+
+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 DragDrop = require('@uppy/drag-drop')
+
+const uppy = Uppy()
+uppy.use(DragDrop, {
+  target: '#upload'
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/drag-drop --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/dragdrop).
+
+## License
+
+[The MIT License](./LICENSE).

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov