Skip to content

Commit

Permalink
Merge branch 'main' into tus-retry-fix
Browse files Browse the repository at this point in the history
* main: (30 commits)
  Refactor locale scripts & generate types and docs (#3276)
  Remove references of incorrect `options` argument for `companion.socket` (#3307)
  Upgrade linting to 2.0.0-0 (#3280)
  Release uppy@2.1.2, @uppy/robodog@2.1.3
  @uppy/core@2.1.2
  meta: update version references in docs
  Release @uppy/robodog@2.1.2
  @uppy/unsplash@2.0.3
  @uppy/aws-s3: use `Promise.allSettled` insead of custom utils (#3079)
  Convert sets to arrays prior to using spread operator to enable transpilation to ES5 (#3297)
  Add showRecordingLength to webcam types (#3303)
  Required meta fields UI (#3285)
  Update BACKLOG.md
  Release uppy@2.2.2
  @uppy/provider-views@2.0.5
  fix: @uppy/utils - `getFileType()` always returns a string (#3294)
  Remove yarn file
  @uppy/companion: fix Dockerfiles (#3291)
  @uppy/companion: use Node.js 16.x for Dockerfile (#3289)
  if an item is checked, it can’t be disabled (#3288)
  ...
  • Loading branch information
Murderlon committed Nov 11, 2021
2 parents 3668c8c + 00094af commit 0f1d625
Show file tree
Hide file tree
Showing 247 changed files with 3,647 additions and 2,577 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -19,3 +19,4 @@ website/src/_posts/2021-03-*.md
website/src/_posts/2021-04-*.md
website/src/_posts/2021-05-*.md
website/src/_posts/2021-06-*.md
website/src/docs/react-dashboard.md
2 changes: 1 addition & 1 deletion .eslintrc.js
Expand Up @@ -43,7 +43,6 @@ module.exports = {
rules: {
// transloadit rules we are actually ok with in the uppy repo
'import/extensions': 'off',
'no-await-in-loop': 'off',
'object-shorthand': ['error', 'always'],
'strict': 'off',
'key-spacing': 'off',
Expand Down Expand Up @@ -79,6 +78,7 @@ module.exports = {
'global-require': ['warn'],
'import/no-unresolved': ['warn'],
'import/order': ['warn'],
'max-classes-per-file': ['warn'],
'no-mixed-operators': ['warn'],
'no-param-reassign': ['warn'],
'no-redeclare': ['warn'],
Expand Down
13 changes: 6 additions & 7 deletions .github/CONTRIBUTING.md
Expand Up @@ -153,7 +153,6 @@ If you have two-factor authentication enabled on your account, Lerna will ask fo

Other things to keep in mind during release:

* When doing a major release >= 1.0, of the `@uppy/core` package, the `peerDependency` of the plugin packages needs to be updated first. Eg when updating from 1.y.z to 2.0.0, the peerDependency of each should be `"@uppy/core": "^2.0.0"` before doing `npm run release`.
* When adding a new package, add the following key to its package.json:
```json
"publishConfig": { "access": "public" }
Expand Down Expand Up @@ -326,15 +325,15 @@ Your `package.json` should resemble something like this:
{
"name": "@uppy/framework",
"dependencies": {
"@uppy/dashboard": "workspace:*",
"@uppy/drag-drop": "workspace:*",
"@uppy/progress-bar": "workspace:*",
"@uppy/status-bar": "workspace:*",
"@uppy/utils": "workspace:*",
"@uppy/dashboard": "workspace:^",
"@uppy/drag-drop": "workspace:^",
"@uppy/progress-bar": "workspace:^",
"@uppy/status-bar": "workspace:^",
"@uppy/utils": "workspace:^",
"prop-types": "^15.6.1"
},
"peerDependencies": {
"@uppy/core": "^2.0.0"
"@uppy/core": "workspace:^"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [12.x, 14.x, 16.x, 17.x]
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/companion-deploy.yml
Expand Up @@ -2,7 +2,7 @@ name: Companion Deploy

on:
push:
branches: [master]
branches: [main]

jobs:
docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/companion.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.20.1, 12.x, 14.x, 16.x]
node-version: [10.20.1, 12.x, 14.x, 16.x, 17.x]
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand Down
337 changes: 260 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

24 changes: 2 additions & 22 deletions BACKLOG.md
Expand Up @@ -5,32 +5,12 @@
These are ideas that are planned for specific versions or act as a backlog without a clear date.
PRs are welcome! Please do open an issue to discuss first if it's a big feature, priorities may have changed after something was added here.

## `2.0.0`

- [x] Drop IE10 (officially), drop IE11 polyfills? (@aduh95)
- [x] *: upgrade to Preact X (@murderlon)
- [x] chore: hunt down most `@TODO`s and either fix, or remove, or move to github issues/changelog backlog (@murderlon)
- [x] core: consider removing Preact from `Plugin` (maybe have a `(ui)Plugin extends BasePlugin`?) as pointed out on Reddit https://www.reddit.com/r/javascript/comments/bhkx5k/uppy_10_your_best_friend_in_file_uploading/ (@murderlon)
- [x] core: force the `new` keyword when instantiating Uppy — now we support both `new Uppy()` and `Uppy()` which is harder to maintain and might lead to confusion (@arturi)
- [ ] core: maybe we remove `file.name` and only keep `file.meta.name`; we can change the file.name here actually because it's just a plain object. we can't change the file.data.name where data is a File instance from an input or something. For XHRUpload, where we put the File instance in a FormData object and it uses the unchangeable .name property (@arturi)
- [x] core: pass full file object to `onBeforeFileAdded`. Maybe also check restrictions before calling the callbacks: https://github.com/transloadit/uppy/pull/1594 (@arturi)
- [x] core/dashboard: replace `poweredBy` and `exceedsSize` locale keys by word order aware versions, see PR #2077 (@goto-bus-stop)
- [x] dashboard: set default `trigger: null`, see https://github.com/transloadit/uppy/pull/2144#issuecomment-600581690 (@arturi)
- [x] form: make the `multipleResults` option `true` by default (@arturi)
- [x] locales: Remove the old es_GL name alias for gl_ES. Keep gl_ES only (@arturi)
- [x] providers: remove `serverHeaders` https://github.com/transloadit/uppy/pull/1861 (@mifi)
- [x] transloadit: remove `UPPY_SERVER` constant (@mifi)
- [x] tus: set the `limit` option to a sensible default, like 5 (10?) (@arturi)
- [x] xhr: set the `limit` option to a sensible default, like 5 (10?) (@arturi)
- [x] xhr: change default name depending on whether `bundle` is set `files[]` (`true`) vs `file` (default) (#782) (@aduh95)
- [x] providers: allow changing provider name title through locale https://github.com/transloadit/uppy/issues/2279 (@goto-bus-stop)
- [x] tus: remove `autoRetry` option (throw error at runtime if it is explicitly given) (@aduh95)
- [x] dashboard: showing links to files should be turned off by default (it's great for devs, they can opt-in, but for end-user UI it's weird and can even lead to problems) (@arturi)

## `3.0.0`

- [ ] Switch to ES Modules (ESM)
- [ ] @uppy/image-editor: Remove silly hack to work around non-ESM.
- [ ] Consider updating the name of @uppy/aws-s3 and @uppy/aws-s3-multipart to reflect it also supports Google Cloud Storage, Wasabi, and other cloud providers.
- [ ] Consider fixing all locale files to follow the bcp-47 standard (nl_NL --> nl-NL)

## `4.0.0`

Expand Down
2 changes: 1 addition & 1 deletion BUNDLE-README.md
@@ -1,7 +1,7 @@
# Uppy

Hi, thanks for trying out the bundled version of the Uppy File Uploader. You can use
this from a CDN (`<script src="https://releases.transloadit.com/uppy/v2.2.1/uppy.min.js"></script>`) or bundle it with your webapp.
this from a CDN (`<script src="https://releases.transloadit.com/uppy/v2.2.3/uppy.min.js"></script>`) or bundle it with your webapp.

Note that the recommended way to use Uppy is to install it with yarn/npm and use a
bundler like Webpack so that you can create a smaller custom build with only the
Expand Down
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -69,18 +69,18 @@ $ npm install @uppy/core @uppy/dashboard @uppy/tus

We recommend installing from npm and then using a module bundler such as [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Rollup.js](http://rollupjs.org/).

Add CSS [uppy.min.css](https://releases.transloadit.com/uppy/v2.2.1/uppy.min.css), either to your HTML page’s `<head>` or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.
Add CSS [uppy.min.css](https://releases.transloadit.com/uppy/v2.2.3/uppy.min.css), either to your HTML page’s `<head>` or include in JS, if your bundler of choice supports it — transforms and plugins are available for Browserify and Webpack.

Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Edgly. In that case `Uppy` will attach itself to the global `window.Uppy` object.

> ⚠️ The bundle consists of most Uppy plugins, so this method is not recommended for production, as your users will have to download all plugins when you are likely using only a few.
```html
<!-- 1. Add CSS to `<head>` -->
<link href="https://releases.transloadit.com/uppy/v2.2.1/uppy.min.css" rel="stylesheet">
<link href="https://releases.transloadit.com/uppy/v2.2.3/uppy.min.css" rel="stylesheet">

<!-- 2. Add JS before the closing `</body>` -->
<script src="https://releases.transloadit.com/uppy/v2.2.1/uppy.min.js"></script>
<script src="https://releases.transloadit.com/uppy/v2.2.3/uppy.min.js"></script>

<!-- 3. Initialize -->
<div class="UppyDragDrop"></div>
Expand Down Expand Up @@ -190,7 +190,7 @@ If you’re using Uppy from CDN, those polyfills are already included in the leg
bundle, so no need to include anything additionally:
```html
<script src="https://releases.transloadit.com/uppy/v2.2.1/uppy.min.js"></script>
<script src="https://releases.transloadit.com/uppy/v2.2.3/uppy.legacy.min.js"></script>
```
## FAQ
Expand Down
8 changes: 0 additions & 8 deletions bin/after-version-bump.js
Expand Up @@ -13,7 +13,6 @@
// NOTE this _amends_ the previous commit, which should
// already be a "Release" commit generated by bin/release.

const lastCommitMessage = require('last-commit-message')
const { spawn } = require('child_process')
const { readFile, writeFile } = require('fs/promises')
const once = require('events.once')
Expand Down Expand Up @@ -43,7 +42,6 @@ async function updateVersions (files, packageName) {
console.log('replacing', replacements, 'in', files.length, 'files')

for (const f of files) {
// eslint-disable-next-line no-await-in-loop
await replaceInFile(f, replacements)
}
}
Expand Down Expand Up @@ -78,12 +76,6 @@ async function main () {
process.exit(0)
}

const message = await lastCommitMessage()
if (message.trim() !== 'Release') {
console.error(`Last commit is not a release commit, but '${message}'`)
process.exit(1)
}

const files = await globby([
'README.md',
'BUNDLE-README.md',
Expand Down
14 changes: 7 additions & 7 deletions bin/build-bundle.js
Expand Up @@ -96,17 +96,17 @@ const methods = [
buildBundle(
'./packages/uppy/index.js',
'./packages/uppy/dist/uppy.js',
{ standalone: 'Uppy' }
{ standalone: 'Uppy' },
).then(minifyBundle),
buildBundle(
'./packages/uppy/bundle.js',
'./packages/uppy/dist/uppy.legacy.js',
{ standalone: 'Uppy (with polyfills)' }
{ standalone: 'Uppy (with polyfills)' },
).then(transpileDownForIE),
buildBundle(
'./packages/@uppy/robodog/bundle.js',
'./packages/@uppy/robodog/dist/robodog.js',
{ standalone: 'Robodog' }
{ standalone: 'Robodog' },
).then(minifyBundle),
]

Expand All @@ -118,17 +118,17 @@ glob.sync(localePackagePath).forEach((localePath) => {
buildBundle(
`./packages/@uppy/locales/src/${localeName}.js`,
`./packages/@uppy/locales/dist/${localeName}.min.js`,
{ minify: true }
)
{ minify: true },
),
)
})

// Add BUNDLE-README.MD
methods.push(
fs.promises.copyFile(
`${__dirname}/../BUNDLE-README.md`,
`./packages/uppy/dist/README.md`
)
`./packages/uppy/dist/README.md`,
),
)

Promise.all(methods).then(() => {
Expand Down
6 changes: 2 additions & 4 deletions bin/build-css.js
Expand Up @@ -23,7 +23,6 @@ function handleErr (err) {
async function compileCSS () {
const files = await glob('packages/{,@uppy/}*/src/style.scss')

/* eslint-disable no-await-in-loop */
for (const file of files) {
const importedFiles = new Set()
const scssResult = await renderScss({
Expand Down Expand Up @@ -78,7 +77,7 @@ async function compileCSS () {
await writeFile(outfile, postcssResult.css)
console.info(
chalk.green('✓ Built Uppy CSS:'),
chalk.magenta(path.relative(cwd, outfile))
chalk.magenta(path.relative(cwd, outfile)),
)

const minifiedResult = await postcss([
Expand All @@ -90,10 +89,9 @@ async function compileCSS () {
await writeFile(outfile.replace(/\.css$/, '.min.css'), minifiedResult.css)
console.info(
chalk.green('✓ Minified Bundle CSS:'),
chalk.magenta(path.relative(cwd, outfile).replace(/\.css$/, '.min.css'))
chalk.magenta(path.relative(cwd, outfile).replace(/\.css$/, '.min.css')),
)
}
/* eslint-enable no-await-in-loop */
}

compileCSS().then(() => {
Expand Down
4 changes: 2 additions & 2 deletions bin/build-lib.js
Expand Up @@ -34,7 +34,7 @@ async function buildLib () {
const metaMtime = Math.max(...metaMtimes)

const files = await glob(SOURCE)
/* eslint-disable no-await-in-loop, no-continue */
/* eslint-disable no-continue */
for (const file of files) {
if (IGNORE.test(file)) {
continue
Expand All @@ -60,7 +60,7 @@ async function buildLib () {
])
console.log(chalk.green('Compiled lib:'), chalk.magenta(libFile))
}
/* eslint-enable no-await-in-loop, no-continue */
/* eslint-enable no-continue */
}

console.log('Using Babel version:', require('@babel/core/package.json').version)
Expand Down

0 comments on commit 0f1d625

Please sign in to comment.