ソースを参照

Move `GoldenRetriever` into `@uppy/golden-retriever` package

Artur Paikin 6 年 前
コミット
b41a53bb90

+ 21 - 0
packages/@uppy/golden-retriever/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.

+ 40 - 0
packages/@uppy/golden-retriever/README.md

@@ -0,0 +1,40 @@
+# @uppy/golden-retriever
+
+<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/golden-retriever"><img src="https://img.shields.io/npm/v/@uppy/golden-retriever.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 GoldenRetriever plugin saves selected files in your browser cache (Local Storage for metadata, then Service Worker for all blobs + IndexedDB for small blobs), so that if the browser crashes, Uppy can restore everything and continue uploading like nothing happened. Read more about it [on the blog](https://uppy.io/blog/2017/07/golden-retriever/).
+
+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 GoldenRetriever = require('@uppy/golden-retriever')
+
+const uppy = Uppy()
+uppy.use(GoldenRetriever, {
+  // Options
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/golden-retriever --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/golden-retriever).
+
+## License
+
+[The MIT License](./LICENSE).

+ 33 - 0
packages/@uppy/golden-retriever/package.json

@@ -0,0 +1,33 @@
+{
+  "name": "@uppy/golden-retriever",
+  "description": "The GoldenRetriever Uppy plugin saves selected files in browser cache to seamlessly resume uploding after browser crash or accidentally closed tab",
+  "version": "0.25.5",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "restore files",
+    "crash recovery",
+    "golden retriever",
+    "resumable uploads",
+    "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",
+    "prettier-bytes": "1.0.4"
+  },
+  "peerDependencies": {
+    "@uppy/core": "^0.25.5"
+  }
+}

+ 0 - 0
src/plugins/GoldenRetriever/IndexedDBStore.js → packages/@uppy/golden-retriever/src/IndexedDBStore.js


+ 0 - 0
src/plugins/GoldenRetriever/MetaDataStore.js → packages/@uppy/golden-retriever/src/MetaDataStore.js


+ 0 - 0
src/plugins/GoldenRetriever/ServiceWorker.js → packages/@uppy/golden-retriever/src/ServiceWorker.js


+ 2 - 0
src/plugins/GoldenRetriever/ServiceWorkerStore.js → packages/@uppy/golden-retriever/src/ServiceWorkerStore.js

@@ -1,3 +1,5 @@
+/*eslint-disable */
+
 const isSupported = typeof navigator !== 'undefined' && 'serviceWorker' in navigator
 
 function waitForServiceWorker () {

+ 0 - 0
src/plugins/GoldenRetriever/cleanup.js → packages/@uppy/golden-retriever/src/cleanup.js


+ 0 - 0
src/plugins/GoldenRetriever/index.js → packages/@uppy/golden-retriever/src/index.js


+ 0 - 0
packages/@uppy/golden-retriever/types/index.d.ts


+ 1 - 1
src/index.js

@@ -33,7 +33,7 @@ const AwsS3 = require('@uppy/aws-s3')
 // Helpers and utilities
 const Form = require('@uppy/form')
 const ThumbnailGenerator = require('@uppy/thumbnail-generator')
-const GoldenRetriever = require('./plugins/GoldenRetriever')
+const GoldenRetriever = require('@uppy/golden-retriever')
 const ReduxDevTools = require('./plugins/ReduxDevTools')
 
 module.exports = {