refactor(core): merge @uppy/store-default into core via ./store-default export

This commit is contained in:
prakash 2026-06-15 12:54:57 +05:30
parent 52cc4b3e5e
commit 1c7ede3cd4
No known key found for this signature in database
20 changed files with 6 additions and 267 deletions

View file

@ -38,11 +38,11 @@
"./css/style.min.css": "./dist/style.min.css",
"./css/style.css": "./dist/style.css",
"./css/style.scss": "./src/style.scss",
"./store-default": "./lib/store/index.js",
"./package.json": "./package.json"
},
"dependencies": {
"@transloadit/prettier-bytes": "^1.1.0",
"@uppy/store-default": "workspace:^",
"@uppy/utils": "workspace:^",
"lodash": "^4.18.1",
"mime-match": "^1.0.2",

View file

@ -1,6 +1,5 @@
/* global AggregateError */
import DefaultStore, { type Store } from '@uppy/store-default'
import type {
Body,
CompanionClientProvider,
@ -40,6 +39,7 @@ import {
Restricter,
RestrictionError,
} from './Restricter.js'
import DefaultStore, { type Store } from './store/index.js'
import supportsUploadProgress from './supportsUploadProgress.js'
type Processor = (

View file

@ -1,4 +1,3 @@
export type { Store } from '@uppy/store-default'
export type {
Body,
Meta,
@ -11,6 +10,7 @@ export { default as EventManager } from './EventManager.js'
export { debugLogger } from './loggers.js'
export type { Restrictions, ValidateableFile } from './Restricter.js'
export { RestrictionError } from './Restricter.js'
export type { Store } from './store/index.js'
export type { PluginTarget, UIPluginOptions } from './UIPlugin.js'
export { default as UIPlugin } from './UIPlugin.js'
export type {

View file

@ -1,4 +1,4 @@
import packageJson from '../package.json' with { type: 'json' }
import packageJson from '../../package.json' with { type: 'json' }
export type GenericState = Record<string, unknown>

View file

@ -7,9 +7,6 @@
"include": ["./src/**/*.*"],
"exclude": ["./src/**/*.test.ts"],
"references": [
{
"path": "../store-default/tsconfig.build.json"
},
{
"path": "../utils/tsconfig.build.json"
}

View file

@ -7,9 +7,6 @@
},
"include": ["./package.json", "./src/**/*.*"],
"references": [
{
"path": "../store-default/tsconfig.build.json"
},
{
"path": "../utils/tsconfig.build.json"
}

View file

@ -1 +0,0 @@
tsconfig.*

View file

@ -1,102 +0,0 @@
# @uppy/store-default
## 5.0.0
### Major Changes
- c5b51f6: ### Export maps for all packages
All packages now have export maps. This is a breaking change in two cases:
1. The css imports have changed from `@uppy[package]/dist/styles.min.css` to `@uppy[package]/css/styles.min.css`
2. You were importing something that wasn't exported from the root, for instance `@uppy/core/lib/foo.js`. You can now only import things we explicitly exported.
#### Changed imports for `@uppy/react`, `@uppy/vue`, and `@uppy/svelte`
Some components, like Dashboard, require a peer dependency to work but since all components were exported from a single file you were forced to install all peer dependencies. Even if you never imported, for instance, the status bar component.
Every component that requires a peer dependency has now been moved to a subpath, such as `@uppy/react/dashboard`, so you only need to install the peer dependencies you need.
**Example for `@uppy/react`:**
**Before:**
```javascript
import { Dashboard, StatusBar } from "@uppy/react";
```
**Now:**
```javascript
import Dashboard from "@uppy/react/dashboard";
import StatusBar from "@uppy/react/status-bar";
```
## 4.3.2
### Patch Changes
- 1b1a9e3: Define "files" in package.json
## 4.3.0
### Minor Changes
- 0c24c5a: Use TypeScript compiler instead of Babel
## 4.1.2
Released: 2024-12-05
Included in: Uppy v4.8.0
- @uppy/audio,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: cleanup tsconfig (Mikael Finstad / #5520)
## 4.1.1
Released: 2024-10-31
Included in: Uppy v4.6.0
- @uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/google-photos,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react-native,@uppy/react,@uppy/redux-dev-tools,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: Fix links (Anthony Veaudry / #5492)
## 4.1.0
Released: 2024-07-30
Included in: Uppy v4.1.0
- @uppy/core,@uppy/store-default: export `Store` type (Merlijn Vos / #5373)
## 3.1.0
Released: 2023-11-24
Included in: Uppy v3.20.0
- @uppy/store-default: refactor to typescript (Antoine du Hamel / #4785)
## 3.0.2
Released: 2022-09-25
Included in: Uppy v3.1.0
- @uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/companion-client,@uppy/companion,@uppy/compressor,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/drop-target,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/locales,@uppy/onedrive,@uppy/progress-bar,@uppy/provider-views,@uppy/react,@uppy/redux-dev-tools,@uppy/remote-sources,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/svelte,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/utils,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: add missing entries to changelog for individual packages (Antoine du Hamel / #4092)
## 3.0.0
Released: 2022-08-22
Included in: Uppy v3.0.0
- Switch to ESM
## 3.0.0-beta.2
Released: 2022-08-03
Included in: Uppy v3.0.0-beta.4
- @uppy/store-default: export the class, don't expose `.callbacks` (Antoine du Hamel / #3928)
## 2.1.0
Released: 2022-05-30
Included in: Uppy v2.11.0
- @uppy/angular,@uppy/audio,@uppy/aws-s3-multipart,@uppy/aws-s3,@uppy/box,@uppy/core,@uppy/dashboard,@uppy/drag-drop,@uppy/dropbox,@uppy/facebook,@uppy/file-input,@uppy/form,@uppy/golden-retriever,@uppy/google-drive,@uppy/image-editor,@uppy/informer,@uppy/instagram,@uppy/onedrive,@uppy/progress-bar,@uppy/react,@uppy/redux-dev-tools,@uppy/robodog,@uppy/screen-capture,@uppy/status-bar,@uppy/store-default,@uppy/store-redux,@uppy/thumbnail-generator,@uppy/transloadit,@uppy/tus,@uppy/unsplash,@uppy/url,@uppy/vue,@uppy/webcam,@uppy/xhr-upload,@uppy/zoom: doc: update bundler recommendation (Antoine du Hamel / #3763)
- @uppy/store-default: refactor to ESM (Antoine du Hamel / #3746)

View file

@ -1,21 +0,0 @@
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.

View file

@ -1,45 +0,0 @@
# @uppy/store-default
<img src="https://uppy.io/img/logo.svg" width="120" alt="Uppy logo: a smiling puppy above a pink upwards arrow" align="right">
[![npm version](https://img.shields.io/npm/v/@uppy/store-default.svg?style=flat-square)](https://www.npmjs.com/package/@uppy/store-default)
![CI status for Uppy tests](https://github.com/transloadit/uppy/workflows/CI/badge.svg)
![CI status for Companion tests](https://github.com/transloadit/uppy/workflows/Companion/badge.svg)
![CI status for browser tests](https://github.com/transloadit/uppy/workflows/End-to-end%20tests/badge.svg)
A basic 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
import Uppy from '@uppy/core'
import DefaultStore from '@uppy/store-default'
const uppy = new Uppy({
store: new DefaultStore(),
})
```
## Installation
```bash
$ npm install @uppy/store-default
```
Alternatively, you can also use this package in a pre-built bundle from
Transloadits CDN: Smart CDN. 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/guides/custom-stores#defaultstore).
## License
[The MIT License](./LICENSE).

View file

@ -1,43 +0,0 @@
{
"name": "@uppy/store-default",
"description": "The default simple object-based store for Uppy.",
"version": "5.0.0",
"license": "MIT",
"main": "lib/index.js",
"type": "module",
"sideEffects": false,
"scripts": {
"build": "tsc --build tsconfig.build.json",
"typecheck": "tsc --build",
"test": "vitest run --environment=jsdom --silent='passed-only'"
},
"keywords": [
"file uploader",
"uppy",
"uppy-store"
],
"homepage": "https://uppy.io",
"bugs": {
"url": "https://github.com/transloadit/uppy/issues"
},
"devDependencies": {
"@types/node": "^20.19.0",
"jsdom": "^29.1.1",
"typescript": "^5.8.3",
"vitest": "^4.1.6"
},
"repository": {
"type": "git",
"url": "git+https://github.com/transloadit/uppy.git"
},
"exports": {
".": "./lib/index.js",
"./package.json": "./package.json"
},
"files": [
"src",
"lib",
"dist",
"CHANGELOG.md"
]
}

View file

@ -1,10 +0,0 @@
{
"extends": "../../../tsconfig.shared",
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src"
},
"include": ["./src/**/*.*"],
"exclude": ["./src/**/*.test.ts"],
"references": []
}

View file

@ -1,10 +0,0 @@
{
"extends": "../../../tsconfig.shared",
"compilerOptions": {
"emitDeclarationOnly": false,
"noEmit": true,
"types": ["preact", "node"]
},
"include": ["./package.json", "./src/**/*.*"],
"references": []
}

View file

@ -61,7 +61,6 @@
"@uppy/remote-sources": "workspace:*",
"@uppy/screen-capture": "workspace:*",
"@uppy/status-bar": "workspace:*",
"@uppy/store-default": "workspace:*",
"@uppy/thumbnail-generator": "workspace:*",
"@uppy/transloadit": "workspace:*",
"@uppy/tus": "workspace:*",

View file

@ -23,6 +23,8 @@ export { default as AwsS3 } from '@uppy/aws-s3'
export { default as Box } from '@uppy/box'
// Miscellaneous
export { default as Compressor } from '@uppy/compressor'
// Stores
export { default as DefaultStore } from '@uppy/core/store-default'
// UI plugins
export { default as Dashboard } from '@uppy/dashboard'
export { default as DragDrop } from '@uppy/drag-drop'
@ -39,8 +41,6 @@ export { default as OneDrive } from '@uppy/onedrive'
export { default as RemoteSources } from '@uppy/remote-sources'
export { default as ScreenCapture } from '@uppy/screen-capture'
export { default as StatusBar } from '@uppy/status-bar'
// Stores
export { default as DefaultStore } from '@uppy/store-default'
export { default as ThumbnailGenerator } from '@uppy/thumbnail-generator'
export { default as Transloadit } from '@uppy/transloadit'
export { default as Tus } from '@uppy/tus'

View file

@ -67,9 +67,6 @@
{
"path": "../@uppy/screen-capture/tsconfig.build.json"
},
{
"path": "../@uppy/store-default/tsconfig.build.json"
},
{
"path": "../@uppy/thumbnail-generator/tsconfig.build.json"
},

View file

@ -66,9 +66,6 @@
{
"path": "../@uppy/screen-capture/tsconfig.build.json"
},
{
"path": "../@uppy/store-default/tsconfig.build.json"
},
{
"path": "../@uppy/thumbnail-generator/tsconfig.build.json"
},

View file

@ -7,9 +7,6 @@
},
"include": ["./package.json", "./*.ts", "./*.js"],
"references": [
{
"path": "../../packages/@uppy/store-default/tsconfig.build.json"
},
{
"path": "../../packages/@uppy/utils/tsconfig.build.json"
},

View file

@ -9237,7 +9237,6 @@ __metadata:
"@transloadit/prettier-bytes": "npm:^1.1.0"
"@types/deep-freeze": "npm:^0"
"@types/node": "npm:^20.19.0"
"@uppy/store-default": "workspace:^"
"@uppy/utils": "workspace:^"
cssnano: "npm:^8.0.1"
deep-freeze: "npm:^0.0.1"
@ -9608,17 +9607,6 @@ __metadata:
languageName: unknown
linkType: soft
"@uppy/store-default@workspace:*, @uppy/store-default@workspace:^, @uppy/store-default@workspace:packages/@uppy/store-default":
version: 0.0.0-use.local
resolution: "@uppy/store-default@workspace:packages/@uppy/store-default"
dependencies:
"@types/node": "npm:^20.19.0"
jsdom: "npm:^29.1.1"
typescript: "npm:^5.8.3"
vitest: "npm:^4.1.6"
languageName: unknown
linkType: soft
"@uppy/svelte@workspace:*, @uppy/svelte@workspace:packages/@uppy/svelte":
version: 0.0.0-use.local
resolution: "@uppy/svelte@workspace:packages/@uppy/svelte"
@ -23475,7 +23463,6 @@ __metadata:
"@uppy/remote-sources": "workspace:*"
"@uppy/screen-capture": "workspace:*"
"@uppy/status-bar": "workspace:*"
"@uppy/store-default": "workspace:*"
"@uppy/thumbnail-generator": "workspace:*"
"@uppy/transloadit": "workspace:*"
"@uppy/tus": "workspace:*"