From a2ace7b3c1d11f78561219c9c6cd651ebf9cb58c Mon Sep 17 00:00:00 2001 From: vyron Date: Sat, 25 Jun 2022 23:46:24 +0800 Subject: [PATCH] feat(storage): init storage package --- README.md | 9 ++--- docs/TODO.md | 5 ++- packages/storage/LICENSE | 21 ++++++++++++ packages/storage/README.md | 43 ++++++++++++++++++++++++ packages/storage/__tests__/index.spec.ts | 2 ++ packages/storage/api-extractor.json | 7 ++++ packages/storage/index.js | 5 +++ packages/storage/package.json | 27 +++++++++++++++ packages/storage/src/index.ts | 8 +++++ 9 files changed, 122 insertions(+), 5 deletions(-) create mode 100644 packages/storage/LICENSE create mode 100644 packages/storage/README.md create mode 100644 packages/storage/__tests__/index.spec.ts create mode 100644 packages/storage/api-extractor.json create mode 100644 packages/storage/index.js create mode 100644 packages/storage/package.json create mode 100644 packages/storage/src/index.ts diff --git a/README.md b/README.md index 50e84c0..a2acc4a 100644 --- a/README.md +++ b/README.md @@ -45,10 +45,11 @@ With CDN ## All Packages -| package | desc | -| ------------- | ------------------------- | -| @vyron/utils | JavaScript utils | -| @vyron/vhooks | Vue composition api hooks | +| package | desc | +| -------------- | ------------------------- | +| @vyron/utils | JavaScript utils | +| @vyron/vhooks | Vue composition api hooks | +| @vyron/storage | Javascript storage utils | ## License diff --git a/docs/TODO.md b/docs/TODO.md index 331eea9..7751059 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -4,7 +4,7 @@ Not_started ❎ Wip ⛽️ -Done ✅ +Done ✅ ## Todo List @@ -16,3 +16,6 @@ Done ✅ | utils | add `isStream isURLSearchParams isFile isBlob isArrayBufferView isFormData` method | ✅ | 2022-05-19 | | vhooks | init vhooks(vue-hooks) project | ✅ | 2022-05-20 | | utils | add `get set` method | ✅ | 2022-05-21 | +| storage | init storage package | ✅ | 2022-06-25 | +| storage | list storage feature | ❎ | 2022-06-26 | +| | | | | diff --git a/packages/storage/LICENSE b/packages/storage/LICENSE new file mode 100644 index 0000000..4d5af1f --- /dev/null +++ b/packages/storage/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Vyron + +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/storage/README.md b/packages/storage/README.md new file mode 100644 index 0000000..570826a --- /dev/null +++ b/packages/storage/README.md @@ -0,0 +1,43 @@ +# @vyron/storage + +JavaScript utility functions. + +## Install + +With npm + +```zsh +# npm +npm install @vyron/storage + +# yarn +yarn add @vyron/storage + +# pnpm +pnpm install @vyron/storage + +``` + +With CDN + +```html + + + + + + + storage + + + + + + +``` + +## License + +[MIT](./LICENSE) diff --git a/packages/storage/__tests__/index.spec.ts b/packages/storage/__tests__/index.spec.ts new file mode 100644 index 0000000..0fba6e6 --- /dev/null +++ b/packages/storage/__tests__/index.spec.ts @@ -0,0 +1,2 @@ +// eslint-disable-next-line @typescript-eslint/no-empty-function +describe('storage', () => {}) diff --git a/packages/storage/api-extractor.json b/packages/storage/api-extractor.json new file mode 100644 index 0000000..201bdaa --- /dev/null +++ b/packages/storage/api-extractor.json @@ -0,0 +1,7 @@ +{ + "extends": "../../api-extractor.json", + "mainEntryPointFilePath": "./dist/packages//src/index.d.ts", + "dtsRollup": { + "publicTrimmedFilePath": "./dist/.d.ts" + } +} \ No newline at end of file diff --git a/packages/storage/index.js b/packages/storage/index.js new file mode 100644 index 0000000..9844c1a --- /dev/null +++ b/packages/storage/index.js @@ -0,0 +1,5 @@ +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/storage.prod.cjs.js') +} else { + module.exports = require('./dist/storage.cjs.js') +} diff --git a/packages/storage/package.json b/packages/storage/package.json new file mode 100644 index 0000000..1b2397b --- /dev/null +++ b/packages/storage/package.json @@ -0,0 +1,27 @@ +{ + "name": "@vyron/storage", + "version": "0.1.0", + "main": "index.js", + "module": "dist/storage.esm.js", + "types": "dist/storage.d.ts", + "globalPackageName": "storage", + "description": "javaScript storage utils", + "keywords": [ + "storage", + "javascript", + "typescript" + ], + "files": [ + "dist", + "LICENSE", + "index.js", + "README.md", + "package.json" + ], + "author": "vyron", + "license": "MIT", + "publishConfig": { + "access": "public", + "registry": "https://registry.npmjs.org/" + } +} \ No newline at end of file diff --git a/packages/storage/src/index.ts b/packages/storage/src/index.ts new file mode 100644 index 0000000..b516e2f --- /dev/null +++ b/packages/storage/src/index.ts @@ -0,0 +1,8 @@ +/* + * @Author: vyron + * @Date: 2022-05-19 17:57:31 + * @LastEditTime: 2022-06-25 23:45:45 + * @LastEditors: vyron + * @Description: 融合汇聚工具类导出 + * @FilePath: /utils/packages/storage/src/index.ts + */