From e3e4200375708d631cf771e11d119448802160b4 Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Thu, 14 Jun 2018 11:14:02 -0400 Subject: [PATCH] Move `FileInput` plugin to `@uppy/file-input`. Steps taken: ```bash cp -R package-template packages/@uppy/file-input vim packages/@uppy/file-input/{README.md,package.json} # figure out how to exit vim packages/@uppy/file-input/package.json # Update descriptions ``` --- packages/@uppy/file-input/LICENSE | 21 ++++++++++ packages/@uppy/file-input/README.md | 42 +++++++++++++++++++ packages/@uppy/file-input/package.json | 30 +++++++++++++ .../@uppy/file-input/src/index.js | 0 packages/@uppy/file-input/types/index.d.ts | 0 src/index.js | 2 +- 6 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 packages/@uppy/file-input/LICENSE create mode 100644 packages/@uppy/file-input/README.md create mode 100644 packages/@uppy/file-input/package.json rename src/plugins/FileInput.js => packages/@uppy/file-input/src/index.js (100%) create mode 100644 packages/@uppy/file-input/types/index.d.ts diff --git a/packages/@uppy/file-input/LICENSE b/packages/@uppy/file-input/LICENSE new file mode 100644 index 000000000..c23747330 --- /dev/null +++ b/packages/@uppy/file-input/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. diff --git a/packages/@uppy/file-input/README.md b/packages/@uppy/file-input/README.md new file mode 100644 index 000000000..e3a1cfbb1 --- /dev/null +++ b/packages/@uppy/file-input/README.md @@ -0,0 +1,42 @@ +# @uppy/file-input + +Uppy logo: a superman puppy in a pink suit + + +Build Status + +FileInput is the most barebones UI for selecting files—it shows a single button that, when clicked, opens up the browser’s file selector. + +**[Read the docs](https://uppy.io/docs/fileinput)** | **[Try it](https://uppy.io/examples/xhrupload/)** + +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 FileInput = require('@uppy/file-input') + +const uppy = Uppy() +uppy.use(FileInput, { + // Options +}) +``` + +## Installation + +```bash +$ npm install @uppy/file-input --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/fileinput). + +## License + +[The MIT License](./LICENSE). diff --git a/packages/@uppy/file-input/package.json b/packages/@uppy/file-input/package.json new file mode 100644 index 000000000..3959bbfa5 --- /dev/null +++ b/packages/@uppy/file-input/package.json @@ -0,0 +1,30 @@ +{ + "name": "@uppy/file-input", + "description": "Simple UI of a file input button that works with Uppy right out of the box", + "version": "0.25.5", + "license": "MIT", + "main": "lib/index.js", + "jsnext:main": "src/index.js", + "types": "types/index.d.ts", + "keywords": [ + "file uploader", + "upload", + "uppy", + "uppy-plugin", + "file-input" + ], + "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" + }, + "peerDependencies": { + "@uppy/core": "^0.25.5" + } +} diff --git a/src/plugins/FileInput.js b/packages/@uppy/file-input/src/index.js similarity index 100% rename from src/plugins/FileInput.js rename to packages/@uppy/file-input/src/index.js diff --git a/packages/@uppy/file-input/types/index.d.ts b/packages/@uppy/file-input/types/index.d.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/index.js b/src/index.js index bd2c3f646..ddd0ad0cf 100644 --- a/src/index.js +++ b/src/index.js @@ -12,7 +12,7 @@ const Plugin = require('@uppy/core/lib/Plugin') // Acquirers const Dashboard = require('@uppy/dashboard') const DragDrop = require('@uppy/drag-drop') -const FileInput = require('./plugins/FileInput') +const FileInput = require('@uppy/file-input') const GoogleDrive = require('./plugins/GoogleDrive') const Dropbox = require('./plugins/Dropbox') const Instagram = require('@uppy/instagram')