فهرست منبع

Move `DefaultStore` to `@uppy/store-default` package.

Steps taken:

```bash
cp -R package-template packages/@uppy/store-default
git mv src/store/DefaultStore.js packages/@uppy/store-default/src/index.js
git mv src/store/DefaultStore.test.js packages/@uppy/store-default/src/index.test.js
vim src/core/Core.js # update the require() call
vim packages/@uppy/store-default/src/index.test.js # update the require() call
```
Renée Kooi 6 سال پیش
والد
کامیت
045bf2e886

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

+ 39 - 0
packages/@uppy/store-default/README.md

@@ -0,0 +1,39 @@
+# @uppy/store-default
+
+<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/store-default"><img src="https://img.shields.io/npm/v/@uppy/store-default.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>
+
+A simple object-based store for Uppy. This one is used by default, you do not need to add it manually.
+
+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 DefaultStore = require('@uppy/store-default')
+
+const uppy = Uppy({
+  store: DefaultStore()
+})
+```
+
+## Installation
+
+```bash
+$ npm install @uppy/store-default --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 package 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/DOC_PAGE_HERE).
+
+## License
+
+[The MIT License](./LICENSE).

+ 22 - 0
packages/@uppy/store-default/package.json

@@ -0,0 +1,22 @@
+{
+  "name": "@uppy/store-default",
+  "description": "The default simple object-based store for Uppy.",
+  "version": "0.25.5",
+  "license": "MIT",
+  "main": "lib/index.js",
+  "jsnext:main": "src/index.js",
+  "types": "types/index.d.ts",
+  "keywords": [
+    "file uploader",
+    "uppy",
+    "uppy-store"
+  ],
+  "homepage": "https://uppy.io",
+  "bugs": {
+    "url": "https://github.com/transloadit/uppy/issues"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/transloadit/uppy.git"
+  }
+}

+ 0 - 0
src/store/DefaultStore.js → packages/@uppy/store-default/src/index.js


+ 1 - 1
src/store/DefaultStore.test.js → packages/@uppy/store-default/src/index.test.js

@@ -1,4 +1,4 @@
-const DefaultStore = require('./DefaultStore')
+const DefaultStore = require('./index')
 
 describe('DefaultStore', () => {
   it('can be created with or without new', () => {

+ 0 - 0
packages/@uppy/store-default/types/index.d.ts


+ 1 - 1
src/core/Core.js

@@ -4,7 +4,7 @@ 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 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')