- 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.
- Add `typecheck` command to all packages.
- Use turbo to build and watch concurrently with caches.
- Remove root `bin/` folder with last global scripts
- `bin/companion.sh` -> `@uppy/companion/start-dev` (`yarn
start:companion` still works)
- `bin/build-components.mjs` -> `@uppy/components/migrate.mjs` (`yarn
migrate:components` can be used to run it). This only needs to be ran
for new components, not changing existing ones, so that's why it's not
part of the build process.
turbo is smart enough to build dependencies within a package first
before building the package itself (e.g if wanting to build @uppy/audio,
build @uppy/utils first). Unfortunately @uppy/core is a peer dep
everywhere turbo does not take it into account, yet it must be build
first to avoid race conditions. Therefor I added a turbo.json to each
package, which you normally never need, but this is an odd case I
suppose. Other solutions ran into cyclic dep errors.
Another PR would move over the test commands to turbo too.
And use `pull_request_target` event instead of `pull_request` to use secrets from forks.
Fixes: https://github.com/transloadit/uppy/issues/3473
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
* types: stronger typings
* Remove remaining `declare module` things for uppy.use
* Format types standard-style-like
* Add `target` properties to plugin typings
* Add type for `replaceTargetContent` option
* xhr-upload: allow lowercase method
* opt in to stricter typechecks
* use the strictly typed version in all typings tests
* endtoend: use strict types in typescript test
* Add some comments to the typings file so IDEs will warn about untyped use()
* informer: remove obsolete option from typings
* react: generate prop types based on actual options types
* react: update types
* react: fix import in typings test
* companion-client: add `pluginId` property to ProviderOptions type
Co-Authored-By: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
* core: remove some `any` types
* *: add locale string types
* *: generate locale typings
* core: fix LocaleStrings<> type
* dashboard: add locale string type tests
* tus: inherit options typings from tus-js-client
* transloadit: add missing options types
* ci: do the required build steps before testing typings
* Support TokenStorage in types, add `title?: string` options
* form: update typings
* types: put TokenStorage type in dependents
* Document Uppy.StrictTypes
* if we pin at least we should use the latest
* Allow document.querySelector
I think it's a eslint-plugin-compat bug that it's marking querySelector
as not available in Android Chrome 78.
Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
* Add a method to update options in Core
* Add a method to update options in Plugin (for any plugins)
* Allow re-initializing i18n locales after they’ve been updated with .setOptions
* use rest spread instead of Object.assign
* override setOptions in plugins to include i18nInit
* merge restrictions object in setOptions
* check that newOpts exists
* add spread ...
* don’t double merge
* add i18nInit to all plugins that use translation strings
* add setOptions tests to Core and Dashboard
* add setOptions docs for Core and Plugins
* fix tests for thumbnail-generator by adding plugins: {} to mock core
cause ThumbnailGenerator now calls this.setPluginState, which expects `core.state.plugins`
* also update meta with setOptions if it’s passed, change the way this.opts is set in core
@goto-bus-stop does this look ok? merging restrictions opts in core
* if locale was passed to setOptions(), call plugin.setOptions() on all plugins, so that i18n updates
* add Dashboard test that checks if locale is updated from Core via setOptions()
* Reafactor website Dashboard example to use setOptions and allow selecting a locale
🎉
* /examples/dev - added drag-drop plugin dev environment
* @uppy/drag-drop - moved isDragDropSupported() to @uppy/utils
* @uppy/drag-drop - got rid of drag-drop npm library
* examples/dev - made compiled files placed in /output instead of /lib
* ~/examples/dev - made watchify only watch files once
* @uppy/drag-drop - add onPaste
* /examples/dev - readded html css override-attempts
* @uppy/drag-drop - made whole area clickable, and made it accessible
* @uppy/drag-drop - removed excessive outline in firefox
* REVERTED last 2 commits
* Upload Uppy releases to Edgly.net CDN
* Install AWS CLI if needed
* Remove unpkg from docs
a) Good citizenship to pay for production bandwidth ourselves
b) Nice to have a CDN that will exist exactly as long we will :)
* Fix typos (thx @goto-bus-stop)
Adds tests for src/core/Utils
Ports translator tests to jest
Adds tests for core/index
Added code coverage report
Adds tests for core/UppySocket
Adds tests to src/core and cleanup of test directory
Switched from import to require as the project supports node v4
Runs tests using Babel for backwards compatibilty
Adds src/core state tests
Adds src/core reset & close tests
Updates stagnant snapshot
Adds tests for preprocessors and postprocessors in src/core/Core.js
Adds tests for uploaders and metadata in src/core/Core
Adds tests for adding and removing files in src/core/Core
Adds test for getFile