From 3cc8df8c4f6096f3627542d961ec5cf3074f0612 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 22 May 2024 12:28:22 +0300 Subject: [PATCH 1/3] meta: improve changelog generator (#5190) We are regularly using `e2e`, `examples`, or `docs` as subsystems. We are no longer using `website`. --- private/release/formatChangeLog.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/private/release/formatChangeLog.js b/private/release/formatChangeLog.js index 4ca94cd86..5ddb9189c 100644 --- a/private/release/formatChangeLog.js +++ b/private/release/formatChangeLog.js @@ -4,12 +4,12 @@ import { spawn } from 'node:child_process' import prompts from 'prompts' -const atUppyPackagePath = /^packages\/(@uppy\/[a-z0-9-]+)\// +const subsystem = /((?<=^packages\/)@uppy\/[a-z0-9-]+|(?<=^)(?:docs|e2e|examples))\// async function inferPackageForCommit (sha, spawnOptions) { const cp = spawn('git', ['--no-pager', 'log', '-1', '--name-only', sha], spawnOptions) const candidates = {} for await (const path of createInterface({ input: cp.stdout })) { - const match = atUppyPackagePath.exec(path) + const match = subsystem.exec(path) if (match != null) { candidates[match[1]] ??= 0 candidates[match[1]]++ @@ -39,7 +39,7 @@ export default async function formatChangeLog ( '--format="%H::%s::%an"', `${LAST_RELEASE_COMMIT}..HEAD`, ], spawnOptions) - const expectedFormat = /^"([a-f0-9]+)::(?:((?:@uppy\/[a-z0-9-]+(?:,@uppy\/[a-z0-9-]+)*)|meta|website):\s?)?(.+?)(\s\(#\d+\))?::(.+)"$/ // eslint-disable-line max-len + const expectedFormat = /^"([a-f0-9]+)::(?:((?:@uppy\/[a-z0-9-]+(?:,@uppy\/[a-z0-9-]+)*)|meta|docs|e2e|examples):\s?)?(.+?)(\s\(#\d+\))?::(.+)"$/ // eslint-disable-line max-len for await (const log of createInterface({ input: gitLog.stdout })) { const [, sha, packageName, title, PR, authorName] = expectedFormat.exec(log) @@ -71,6 +71,7 @@ export default async function formatChangeLog ( message: 'Which package(s) does this commit belong to?', min: 1, choices: [ + { title: 'Docs', value: 'docs' }, { title: 'Meta', value: 'meta' }, ...Object.entries(candidates) .sort((a, b) => a[1] > b[1]) From 67bd2fdd9529e153793770d75612cf54539c3000 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 22 May 2024 14:39:59 +0300 Subject: [PATCH 2/3] @uppy/xhr-upload: fix regression for lowercase HTTP methods (#5179) Co-authored-by: Merlijn Vos --- docs/uploader/xhr.mdx | 9 ++++++++- packages/@uppy/xhr-upload/src/index.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/uploader/xhr.mdx b/docs/uploader/xhr.mdx index 1b1a429ff..92eef3707 100644 --- a/docs/uploader/xhr.mdx +++ b/docs/uploader/xhr.mdx @@ -87,7 +87,14 @@ URL of the HTTP server (`string`, default: `null`). #### `method` Configures which HTTP method to use for the upload (`string`, default: -`'post'`). +`'POST'`). + +:::note + +Uppy is not following the standard and will uppercase the method name. This +behavior will be removed in a future version to align Uppy with the web APIs. + +::: #### `formData` diff --git a/packages/@uppy/xhr-upload/src/index.ts b/packages/@uppy/xhr-upload/src/index.ts index e0fa70c11..cd5cafbc4 100644 --- a/packages/@uppy/xhr-upload/src/index.ts +++ b/packages/@uppy/xhr-upload/src/index.ts @@ -214,6 +214,7 @@ export default class XHRUpload< try { const res = await fetcher(url, { ...options, + method: options?.method?.toUpperCase(), onTimeout: (timeout) => { const seconds = Math.ceil(timeout / 1000) const error = new Error(this.i18n('uploadStalled', { seconds })) From 2597bb98dc3cb6e17c9a1c4012114621a83af65b Mon Sep 17 00:00:00 2001 From: Merlijn Vos Date: Wed, 22 May 2024 13:40:35 +0200 Subject: [PATCH 3/3] @uppy/transloadit: do not cancel assembly when removing all files (#5191) --- packages/@uppy/transloadit/src/index.ts | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/@uppy/transloadit/src/index.ts b/packages/@uppy/transloadit/src/index.ts index aab1df33f..89eb84365 100644 --- a/packages/@uppy/transloadit/src/index.ts +++ b/packages/@uppy/transloadit/src/index.ts @@ -524,19 +524,12 @@ export default class Transloadit< } else if (fileRemoved.id in updatedFiles) { delete updatedFiles[fileRemoved.id] const nbOfRemainingFiles = Object.keys(updatedFiles).length - if (nbOfRemainingFiles === 0) { - assembly.close() - this.#cancelAssembly(newAssembly).catch(() => { + + this.client + .updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles) + .catch(() => { /* ignore potential errors */ }) - this.uppy.off('file-removed', fileRemovedHandler) - } else { - this.client - .updateNumberOfFilesInAssembly(newAssembly, nbOfRemainingFiles) - .catch(() => { - /* ignore potential errors */ - }) - } } } this.uppy.on('file-removed', fileRemovedHandler)