will do a separte PR for changes which would require code changes so
it's easier to review , didn't upgrade any deps for `@uppy/aws-s3` since
we'll merge the rewrite so I think we should do that upgrade in the
rewrite branch before merging.
update : Dependency upgrades which required code changes were raised
separately
- #6309
- #6310
---------
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fixes#6024.
### Problem
- `getPlugin()` defaults to `UnknownPlugin`, so methods like `openModal`
are not visible , since core is not aware of that plugin type
### Proposed change
- Introduce a types-only registry in core:
- `export interface PluginTypeRegistry<M extends Meta, B extends Body>
{}`
- Overload `getPlugin` to return a precise type when the id is a known
key of the registry.
- add `Dashboard` to PluginTypeRegistry through module augmentation:
- `'Dashboard': Dashboard<M, B>`.
- When a project imports from `@uppy/dashboard`, its module augmentation
extends PluginTypeRegistry, adding the correct type into it
- I've added Tests , kept them in a separate file so it's easier to
review , once this approach gets approved I'll add them to
`Uppy.test.ts`
Once this PR gets a positive review I'll add this for other plugins ,
currently only added for `@uppy/dashboard`
**Build with Local tarball can be checked here**
https://stackblitz.com/~/github.com/qxprakash/uppy-type-test?file=type_test.ts
Probably best reviewed commit by commit.
I also split UppyFile into two intefaces distinguished by the `isRemote`
boolean:
- LocalUppyFile
- RemoteUppyFile
Also:
- Removed the TagFile type
- Don't re-upload completed files - fixes#5930
- Clean up stored files on `complete` event *only* if *all* files
succeeded (no failed files). this allows the user to retry failed files
if the browser & upload get interrupted - fixes#5927, closes#5955
- Only set `isGhost` for non-successful files. it doesn't make sense for
successfully uploaded files to be ghosted because they're already done.
#5930fixes#6013
---------
Co-authored-by: Prakash <qxprakash@gmail.com>
- cleanup `@uppy/utils ` removed unused / redundant modules .
- migrated modules and tests from `.js` to `.ts`
- removed all the nested export paths
- updated `@uppy/utils` import paths for all packages
- `@uppy/angular` is still failing while running`yarn build` , I'm
looking into it.
---------
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
- Remove `e2e` folder entirely
- Remove all hacky resolutions and yarn patches
- Remove `@types/jasmine`, `js2ts` (convert a JS file to TS), and
`vue-template-compiler` from `private/`
- Remove e2e CI job
- Add browsers tests for vue, svelte, and react headless components and
hooks.
- Add new (browser) tests for transloadit, aws-s3, and dashboard.
- Remove final useless scripts from `package.json`, use direct
references in CI.
- Fix Dropzone component accessibility discovered during testing
- Clean up github workflows (move linters.yml into ci.yml, update
e2e.yml)
**Why Vitest Browser Mode?**
We could have used playwright but vitest browser mode uses it under the
hood and we get the use the vitest we know a love. No two entirely
different setups, no different assertions to relearn, write e2e tests as
if you're writing unit tests. Easy, fast, beautiful.
https://vitest.dev/guide/browser/
**Has every single e2e test been rewritten?**
No there were quite a few tests that have a lot overlap with existing or
newly added tests. There were also some tests that were so heavily
mocked inside and out you start to wonder what the value still is. Open
to discuss which tests still need to be added.
We sometimes where importing source files, which may not be available in
production. Instead we should target extension-less paths in `lib/`
folders so the generated `.d.ts` files are used.
* When Compressor changed file format, update file.meta.name
* only use the setFileState, update comment
* Use Compressor ESM, check for name and extension
* Add test with mocked compress()
* Test user changing the file.meta.name
* Update packages/@uppy/compressor/package.json
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Cleaner variables, remove excessive checks
* Fix package.json
---------
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
* Fix Compressor being broken when no name is in the compressed blob
* Update packages/@uppy/compressor/src/index.js
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Fix Compressor docs
* Remove unused test commands
* Add note that all options are passed
* Add event to types
* Update website/src/docs/compressor.md
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* Update packages/@uppy/compressor/types/index.d.ts
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* add files array as callback to compressor:complete
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
* Add Compressor plugin
* Set type in blob if it’s missing
* clear thumbnail-generator queue when cancel-all is called
* Add e2e test for @uppy/compressor
* Docs, types, readme, bundle, add event
* Update yarn.lock
* fix test
* Update e2e/cypress/integration/dashboard-compressor.spec.ts
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Update dashboard-compressor.spec.ts
* convert compressor to ESM
* Update e2e/clients/dashboard-compressor/index.html
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
* remove console.log
* uglierBytes
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>