Commit graph

723 commits

Author SHA1 Message Date
Mikael Finstad
aa6eb0a318
meta: fix yarn build:clean (#4840) 2023-12-28 11:57:58 +01:00
Antoine du Hamel
fefcb1c311
meta: fix "e2e" script 2023-12-15 23:13:16 +01:00
Mikael Finstad
c66ad287ac
meta: fix clean script (#4820)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-12-14 11:10:54 +01:00
Mikael Finstad
ec4bc58508
Provider user sessions (#4619)
New concept "simple auth" - authentication that happens immediately (in one http request) without redirecting to any third party.

uppyAuthToken initially used to simply contain an encrypted & json encoded OAuth2 access_token for a specific provider. Then we added refresh tokens as well inside uppyAuthToken #4448. Now we also allow storing other state or parameters needed for that specific provider, like username, password, host name, webdav URL etc... This is needed for providers like webdav, ftp etc, where the user needs to give some more input data while authenticating

Companion:
- `providerTokens` has been renamed to `providerUserSession` because it now includes not only tokens, but a user's session with a provider.

Companion `Provider` class:
- New `hasSimpleAuth` static boolean property - whether this provider uses simple auth
- uppyAuthToken expiry default 24hr again for providers that don't support refresh tokens
- make uppyAuthToken expiry configurable per provider - new `authStateExpiry` static property (defaults to 24hr)
- new static property `grantDynamicToUserSession`, allows providers to specify which state from Grant `dynamic` to include into the provider's `providerUserSession`.
2023-12-05 22:55:41 +01:00
Antoine du Hamel
f55b24c378
@uppy/companion-client: avoid unnecessary preflight requests (#4462)
According to https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests, we have so many preflight requests because we add `Uppy-Versions` header and `Content-Type: application/json` to each request. It's particularly not useful for for requests with no body / an empty body because the remote Companion doesn't check `Content-Type`.

It was added in b25f243627, and since f0f1105ef0, it is only used for log 
purposes.

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-12-05 12:30:41 +01:00
Trivikram Kamat
736a1bc926
meta: migrate AWS SDK v2 to v3 in bin/uploadcdn (#4776) 2023-11-14 10:51:36 +01:00
Artur Paikin
440b8a9f9a
Revert "@uppy/react: add useUppyState (#4711)" (#4789)
This reverts commit 12e08ada02.
2023-11-12 02:03:55 +01:00
Merlijn Vos
12e08ada02
@uppy/react: add useUppyState (#4711) 2023-10-24 08:58:58 +02:00
Antoine du Hamel
773c8cb9a1
meta: add support for TypeScript plugins (#4640) 2023-10-17 15:38:15 +02:00
dependabot[bot]
a458e9bf57
Bump postcss from 8.4.16 to 8.4.31 (#4723)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.16 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.16...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-11 07:00:10 +01:00
Antoine du Hamel
f4ea454919
e2e: update Parcel (#4726) 2023-10-05 19:01:25 +02:00
Antoine du Hamel
4b1bc4bcc3
meta: check for formatting in CI (#4714) 2023-09-29 11:33:59 +02:00
Antoine du Hamel
2f691acd3f
meta: add Prettier (#4707)
JS files are ignored for now because we want to migrate them to TS
anyway.
MD files are also ignored to minimize the diff.

ESLint is run twice twice on TS files in case it conflicts with Prettier.
2023-09-28 16:47:52 +02:00
Mikael Finstad
4282f3dc89
meta: update linter config to cover more files (#4706)
* fix missing lint

fixes https://github.com/transloadit/uppy/pull/4704#issuecomment-1735929961

* Update package.json

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>

---------

Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2023-09-28 12:41:54 +08:00
Antoine du Hamel
2c432b12cd
test: migrate to Vitest for Uppy core and Uppy plugins (#4700) 2023-09-26 17:23:17 +02:00
Antoine du Hamel
eddc105fcc
@uppy/angular: upgrade to Angular 16.x (#4642) 2023-08-30 17:57:45 +02:00
Dominik Schmidt
22d9381dd2
@uppy/companion: Unify redis initialization (#4597)
* Unify redis initialization

* Incorporate PR feedback

* Remove comment that made sense when redisOptions was set to null

---------

Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2023-07-31 16:36:34 +02:00
Antoine du Hamel
a83373b83d
@uppy/aws-s3-multipart: add support for signing on the client (#4519) 2023-07-13 12:16:13 +02:00
dependabot[bot]
5cf756d6ef
meta: upgrade dev dependencies
Yarn: 3.2.1 -> 3.6.1
Stylelint: 14.11.0 -> 15.10.0

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-07-10 16:36:06 +02:00
Antoine du Hamel
eba604e8fb
meta: use corepack yarn instead of npm to launch E2E (#4545) 2023-07-05 16:02:59 +02:00
Antoine du Hamel
71e3f062b7
meta: disallow use of .only in tests (#4494)
It is useful for local testing, but should never be committed. This lint
rule should help catch that during code reviews.
2023-06-15 19:09:57 +01:00
Antoine du Hamel
3d59e78e11
meta: make pre-commit use corepack yarn instead of npm run (#4495) 2023-06-10 11:47:23 +02:00
dependabot[bot]
947421b91c
meta: bump babel, esbuild, and vite (#4485)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-06-09 12:06:59 +02:00
Mikael Finstad
90f7fb9197
@uppy/core: improve performance of validating & uploading files (#4402)
* show how many files are added when loading

remake of https://github.com/transloadit/uppy/pull/4388

* add french (cherry pick)

* implement concurrent file listing

* refactor / fix lint

* refactor/reduce duplication

* pull out totals validation

don't do it for every file added, as it's very slow
instead do the check at the end when all files are added.
this allows us to easily work with 10k+ files
fixes #4389

* Update packages/@uppy/core/src/Uppy.js

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

* make restricter.validate validate everything

instead make more specific methods for sub-validation
also rename validateTotals to validateAggregateRestrictions

* improve errors and user feedback

- handle errors centrally so that we can limit the amount of toasts (informers) sent to the users (prevent flooding hundreds/thousands of them)
- introduce FileRestrictionError which is a restriction error for a specific file
- introduce isUserFacing field for RestrictionError

* fix performance issue reintroduced

* improvements

- show "%{count} additional restrictions were not fulfilled" for any restriction errors more than 4
- refactor/rename methods
- improve ghost logic/comments

* improve performance when uploading

- introduce new event "upload-start"  that can contain multiple files
- make a new patchFilesState method to allow updating more files
- unify "upload-start" logic in all plugins (send it before files start uploading)
- defer slicing buffer until we need the data
- refactor to reuse code

* fix e2e build issue

* try to upgrade cypress

maybe it fixes the error

* Revert "fix e2e build issue"

This reverts commit ff3e580c0f.

* upgrade parcel

* move mutation logic to end

* remove FileRestrictionError

merge it with RestrictionError

* fix silly bug

looks like the e2e tests are doing its job 👏

---------

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-04-15 23:50:19 +08:00
Antoine du Hamel
0a7eceac21
meta: fix all ESLint warnings and turn them into errors (#4398) 2023-04-04 15:54:13 +02:00
Merlijn Vos
6430a00aa9
Remove the website (#4369) 2023-03-24 00:33:46 +08:00
Mikael Finstad
e966fa7540
meta: use load balancer for companion in e2e tests (#4228) 2023-02-02 11:25:50 +01:00
Antoine du Hamel
141eb248be
meta: upgrade to Vite 4 and ESBuild 0.16 (#4243) 2022-12-13 15:07:19 +01:00
Antoine du Hamel
a0eeb22458
meta: upgrade to Jest 29 (#4049) 2022-08-30 17:25:19 +02:00
Antoine du Hamel
f7d0d5b3cd
meta: upgrade to TypeScript 4.8 (#4048) 2022-08-30 11:46:45 +02:00
Antoine du Hamel
ea1c0760ff
@uppy/thumbnail-generator: fix exifr import (#4054)
Fixes: https://github.com/transloadit/uppy/issues/4052
2022-08-29 16:54:26 +02:00
Antoine du Hamel
51da2b5a79
e2e: add tests for AWS (#3665)
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2022-08-23 18:43:46 +02:00
Artur Paikin
4108aa6aa3
build: Remove size-limit for now (#4003)
* Remove size-limit for now

* lock

* lock

* lock lock lock
2022-08-18 17:41:54 +01:00
Antoine du Hamel
5044230bf1
meta: upgrade all dev dependencies (#3903) 2022-08-16 22:39:28 +02:00
Merlijn Vos
9733e5a064
aws-s3-multipart: make headers part indexed too in prepareUploadParts (#3895)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-26 13:10:31 +02:00
Antoine du Hamel
aee4d3f371
@uppy/companion: upgrade redis to version 4.x (#3589)
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-07-25 15:14:13 +02:00
Antoine du Hamel
7b0db7d3a0
meta: use node: protocol when using Node.js built-in core modules (#3871)
`node:` protocol is available as of Node.js 14.18.0 LTS. Since we are
dropping support for all Node.js versions below that, we can take
advantage of this prefix to help differentiate built-in modules from npm
modules.
2022-07-18 14:09:03 +02:00
Antoine du Hamel
91e08c191f
example: update Vue2 example (#3802) 2022-06-02 20:11:32 +02:00
Antoine du Hamel
9d178a0ce7
meta: do not test on EOL versions of Node.js (#3786) 2022-05-30 18:33:01 +02:00
Merlijn Vos
afe5d1b19b
Apply bin/update-yarn.sh (#3775) 2022-05-24 12:45:55 +02:00
Antoine du Hamel
b01a52e368
meta: remove vite-plugin-jsx-commonjs plugin on dev env (#3749)
Now that we removed all JSX and CJS from `.js` files,
there's no need to run Babel on every files, which speeds up greatly the
time it takes for Vite to get ready.
2022-05-23 16:50:45 +02:00
Artur Paikin
b0e01ff082
Fix Compressor docs, pass files array to compressor:complete event (#3682)
* 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>
2022-05-18 19:29:08 +01:00
Antoine du Hamel
f325fb2163
e2e: run CI on PRs that modify the workflow file (#3740)
…and add the option to skip build when spawning e2e locally
2022-05-16 15:35:03 +02:00
Antoine du Hamel
52ec5b8c7f
locale-pack: refactor to use more parallel processing (#3630) 2022-04-25 16:56:29 +02:00
Antoine du Hamel
666f6acd88
@uppy/angular: update ng version (#3503)
* @uppy/angular: update ng version

* hack to allow the publish of the Angular package

* fix @types/webpack-dev-server resolution (the package is deprecated anyway)

* Add Storybook back

* Fix default value of Input

* Update README

* Apply suggestions from code review

* fix @types/react version conflict

* Update packages/@uppy/angular/.storybook/tsconfig.json
2022-03-02 11:20:38 +01:00
Mikael Finstad
5cfb9fe7a5
fix unpslash author meta, sanitize metadata to strings and improve companion tests (#3478)
* fix broken npm run test

* improve jest / companion

add `npm run test:companion:watch`

move env variables into code to make testing easier
this allows for watching (source is causing problems with npm scripts)
also now we can run `corepack yarn test:companion -t 'single test'`

* fix root project jest

make sure we don't run companion tests on npm run test:unit (as they don't work in a browser/jsdom environment)

* improve validation logic

previously incorrect options gives an Uploader object in an incorrect state

* rewrite uploader to make it more testable

* add test for xhr

* check that metadata values are strings

* fix nested meta

causing error #3477

* convert meta to strings instead

like the official FormData spec does

* fix broken companion dev #3473

* fix botched merge

* fix botched merge and remove --fix

* fix botchedf merge

* quick fix

* .

* remove eslint fix
2022-02-17 17:43:44 +00:00
Antoine du Hamel
f4f1b810b7
meta: use a single .env file for config (#3498)
Fixes: https://github.com/transloadit/uppy/issues/3473
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2022-02-17 15:47:15 +01:00
Antoine du Hamel
a6e36217ad
meta: add support for ESM sources in build script (#3468) 2022-02-15 17:46:14 +01:00
Antoine du Hamel
f08b71d48b
meta: consolidate ENV files and fix contributing guidelines (#3475)
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>
2022-02-14 15:13:38 +01:00
Merlijn Vos
6da874ed3a
meta: Make E2E Great Again (#3444)
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-02-08 17:37:27 +01:00