From 1c7ede3cd4047a244d90d05f11c1cb47866f6e71 Mon Sep 17 00:00:00 2001 From: prakash Date: Mon, 15 Jun 2026 12:54:57 +0530 Subject: [PATCH] refactor(core): merge @uppy/store-default into core via ./store-default export --- packages/@uppy/core/package.json | 2 +- packages/@uppy/core/src/Uppy.ts | 2 +- packages/@uppy/core/src/index.ts | 2 +- .../src => core/src/store}/index.test.ts | 0 .../src => core/src/store}/index.ts | 2 +- packages/@uppy/core/tsconfig.build.json | 3 - packages/@uppy/core/tsconfig.json | 3 - packages/@uppy/store-default/.npmignore | 1 - packages/@uppy/store-default/CHANGELOG.md | 102 ------------------ packages/@uppy/store-default/LICENSE | 21 ---- packages/@uppy/store-default/README.md | 45 -------- packages/@uppy/store-default/package.json | 43 -------- .../@uppy/store-default/tsconfig.build.json | 10 -- packages/@uppy/store-default/tsconfig.json | 10 -- packages/uppy/package.json | 1 - packages/uppy/src/bundle.ts | 4 +- packages/uppy/tsconfig.build.json | 3 - packages/uppy/tsconfig.json | 3 - private/dev/tsconfig.json | 3 - yarn.lock | 13 --- 20 files changed, 6 insertions(+), 267 deletions(-) rename packages/@uppy/{store-default/src => core/src/store}/index.test.ts (100%) rename packages/@uppy/{store-default/src => core/src/store}/index.ts (94%) delete mode 100644 packages/@uppy/store-default/.npmignore delete mode 100644 packages/@uppy/store-default/CHANGELOG.md delete mode 100644 packages/@uppy/store-default/LICENSE delete mode 100644 packages/@uppy/store-default/README.md delete mode 100644 packages/@uppy/store-default/package.json delete mode 100644 packages/@uppy/store-default/tsconfig.build.json delete mode 100644 packages/@uppy/store-default/tsconfig.json diff --git a/packages/@uppy/core/package.json b/packages/@uppy/core/package.json index 540183e47..75c57afb8 100644 --- a/packages/@uppy/core/package.json +++ b/packages/@uppy/core/package.json @@ -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", diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 73d0dd812..8077616ff 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -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 = ( diff --git a/packages/@uppy/core/src/index.ts b/packages/@uppy/core/src/index.ts index 961bdd1a5..8382e6250 100644 --- a/packages/@uppy/core/src/index.ts +++ b/packages/@uppy/core/src/index.ts @@ -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 { diff --git a/packages/@uppy/store-default/src/index.test.ts b/packages/@uppy/core/src/store/index.test.ts similarity index 100% rename from packages/@uppy/store-default/src/index.test.ts rename to packages/@uppy/core/src/store/index.test.ts diff --git a/packages/@uppy/store-default/src/index.ts b/packages/@uppy/core/src/store/index.ts similarity index 94% rename from packages/@uppy/store-default/src/index.ts rename to packages/@uppy/core/src/store/index.ts index 5da7359cb..c7708dbcb 100644 --- a/packages/@uppy/store-default/src/index.ts +++ b/packages/@uppy/core/src/store/index.ts @@ -1,4 +1,4 @@ -import packageJson from '../package.json' with { type: 'json' } +import packageJson from '../../package.json' with { type: 'json' } export type GenericState = Record diff --git a/packages/@uppy/core/tsconfig.build.json b/packages/@uppy/core/tsconfig.build.json index 7af4ec3f9..5afe23c5a 100644 --- a/packages/@uppy/core/tsconfig.build.json +++ b/packages/@uppy/core/tsconfig.build.json @@ -7,9 +7,6 @@ "include": ["./src/**/*.*"], "exclude": ["./src/**/*.test.ts"], "references": [ - { - "path": "../store-default/tsconfig.build.json" - }, { "path": "../utils/tsconfig.build.json" } diff --git a/packages/@uppy/core/tsconfig.json b/packages/@uppy/core/tsconfig.json index 66c8a6882..9b315b7f0 100644 --- a/packages/@uppy/core/tsconfig.json +++ b/packages/@uppy/core/tsconfig.json @@ -7,9 +7,6 @@ }, "include": ["./package.json", "./src/**/*.*"], "references": [ - { - "path": "../store-default/tsconfig.build.json" - }, { "path": "../utils/tsconfig.build.json" } diff --git a/packages/@uppy/store-default/.npmignore b/packages/@uppy/store-default/.npmignore deleted file mode 100644 index 6c816673f..000000000 --- a/packages/@uppy/store-default/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tsconfig.* diff --git a/packages/@uppy/store-default/CHANGELOG.md b/packages/@uppy/store-default/CHANGELOG.md deleted file mode 100644 index 9d1e951f2..000000000 --- a/packages/@uppy/store-default/CHANGELOG.md +++ /dev/null @@ -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) diff --git a/packages/@uppy/store-default/LICENSE b/packages/@uppy/store-default/LICENSE deleted file mode 100644 index c23747330..000000000 --- a/packages/@uppy/store-default/LICENSE +++ /dev/null @@ -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. diff --git a/packages/@uppy/store-default/README.md b/packages/@uppy/store-default/README.md deleted file mode 100644 index e47ca538b..000000000 --- a/packages/@uppy/store-default/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# @uppy/store-default - -Uppy logo: a smiling puppy above a pink upwards arrow - -[![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 -Transloadit’s 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). diff --git a/packages/@uppy/store-default/package.json b/packages/@uppy/store-default/package.json deleted file mode 100644 index fcb615c1b..000000000 --- a/packages/@uppy/store-default/package.json +++ /dev/null @@ -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" - ] -} diff --git a/packages/@uppy/store-default/tsconfig.build.json b/packages/@uppy/store-default/tsconfig.build.json deleted file mode 100644 index d49e86d5f..000000000 --- a/packages/@uppy/store-default/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "outDir": "./lib", - "rootDir": "./src" - }, - "include": ["./src/**/*.*"], - "exclude": ["./src/**/*.test.ts"], - "references": [] -} diff --git a/packages/@uppy/store-default/tsconfig.json b/packages/@uppy/store-default/tsconfig.json deleted file mode 100644 index 4fc6da5a4..000000000 --- a/packages/@uppy/store-default/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.shared", - "compilerOptions": { - "emitDeclarationOnly": false, - "noEmit": true, - "types": ["preact", "node"] - }, - "include": ["./package.json", "./src/**/*.*"], - "references": [] -} diff --git a/packages/uppy/package.json b/packages/uppy/package.json index cafdb50c1..057d4b2e0 100644 --- a/packages/uppy/package.json +++ b/packages/uppy/package.json @@ -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:*", diff --git a/packages/uppy/src/bundle.ts b/packages/uppy/src/bundle.ts index 860c41d21..d87821cef 100644 --- a/packages/uppy/src/bundle.ts +++ b/packages/uppy/src/bundle.ts @@ -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' diff --git a/packages/uppy/tsconfig.build.json b/packages/uppy/tsconfig.build.json index f782a97d5..c9b5dd42c 100644 --- a/packages/uppy/tsconfig.build.json +++ b/packages/uppy/tsconfig.build.json @@ -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" }, diff --git a/packages/uppy/tsconfig.json b/packages/uppy/tsconfig.json index 1c9df8e7c..1796a88fa 100644 --- a/packages/uppy/tsconfig.json +++ b/packages/uppy/tsconfig.json @@ -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" }, diff --git a/private/dev/tsconfig.json b/private/dev/tsconfig.json index ff6a1ecec..c4f7c62e2 100644 --- a/private/dev/tsconfig.json +++ b/private/dev/tsconfig.json @@ -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" }, diff --git a/yarn.lock b/yarn.lock index cdb4fe9f2..b44ce4e23 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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:*"