Skip to content

Commit

Permalink
Merge branch 'main' into missing-types
Browse files Browse the repository at this point in the history
* main:
  Upgrade size-limit to 7.0.5 (#3445)
  Unsplash: UI improvements (#3438)
  @uppy/thumbnail-generator: exifr: remove legacy IE support (#3382)
  Default to HEAD requests when the Companion looks to get meta information about a URL (#3417)
  check if info array is empty (#3442)
  dev: fix Vite custom plugin (#3437)
  website: add legacy bundle to CDN example (#3433)
  meta: remove unused lerna and npm files (#3436)
  meta: replace browserify with esbuild (#3363)
  Release: [email protected] (#3432)
  @uppy/transloadit: fix handling of Tus errors and rate limiting (#3429)
  Add Unsplash to website dashboard example (#3431)
  • Loading branch information
Murderlon committed Feb 1, 2022
2 parents 029d88e + a74ae35 commit a6eb595
Show file tree
Hide file tree
Showing 55 changed files with 2,343 additions and 1,328 deletions.
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1,353 changes: 1,353 additions & 0 deletions .yarn/patches/exifr-npm-7.1.3-e3f1c7a57d

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion BUNDLE-README.md
Original file line number Diff line number Diff line change
@@ -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.4.0/uppy.min.js"></script>`) or bundle it with your webapp.
this from a CDN (`<script src="https://releases.transloadit.com/uppy/v2.4.1/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
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ Please add your entries in this format:

In the current stage we aim to release a new version at least every month.

## 2.4.1

Released: 2022-01-12

| Package | Version | Package | Version |
| ----------------- | ------- | ----------------- | ------- |
| @uppy/transloadit | 2.1.1 | uppy | 2.4.1 |
| @uppy/robodog | 2.2.1 | | |

- @uppy/transloadit: fix handling of Tus errors and rate limiting (Antoine du Hamel / #3429)
- meta: Add Unsplash to website dashboard example (Merlijn Vos / #3431)
- meta: dev: move configuration to a `.env` file (Antoine du Hamel / #3430)
- meta: Update ci.yml (Kevin van Zonneveld / #3428)
- @uppy/transloadit: simplify `#onTusError` (Antoine du Hamel / #3419)
- meta: Force include babel numeric separator (Merlijn Vos / #3422)


## 2.4.0

Released: 2022-01-10
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
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.4.0/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.4.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.

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.4.0/uppy.min.css" rel="stylesheet">
<link href="https://releases.transloadit.com/uppy/v2.4.1/uppy.min.css" rel="stylesheet">

<!-- 2. Add JS before the closing `</body>` -->
<script src="https://releases.transloadit.com/uppy/v2.4.0/uppy.min.js"></script>
<script src="https://releases.transloadit.com/uppy/v2.4.1/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.4.0/uppy.legacy.min.js"></script>
<script src="https://releases.transloadit.com/uppy/v2.4.1/uppy.legacy.min.js"></script>
```
## FAQ
Expand Down Expand Up @@ -263,17 +263,17 @@ Use Uppy in your project? [Let us know](https://github.com/transloadit/uppy/issu
:---: |:---: |:---: |:---: |:---: |:---: |
[tim-kos](https://github.com/tim-kos) |[janko](https://github.com/janko) |[wilkoklak](https://github.com/wilkoklak) |[oliverpool](https://github.com/oliverpool) |[Botz](https://github.com/Botz) |[mcallistertyler](https://github.com/mcallistertyler) |
[<img alt="mokutsu-coursera" src="https://avatars.githubusercontent.com/u/65177495?v=4&s=117" width="117">](https://github.com/mokutsu-coursera) |[<img alt="YukeshShr" src="https://avatars.githubusercontent.com/u/71844521?v=4&s=117" width="117">](https://github.com/YukeshShr) |[<img alt="DJWassink" src="https://avatars.githubusercontent.com/u/1822404?v=4&s=117" width="117">](https://github.com/DJWassink) |[<img alt="taoqf" src="https://avatars.githubusercontent.com/u/15901911?v=4&s=117" width="117">](https://github.com/taoqf) |[<img alt="tuoxiansp" src="https://avatars.githubusercontent.com/u/3960056?v=4&s=117" width="117">](https://github.com/tuoxiansp) |[<img alt="dominiceden" src="https://avatars.githubusercontent.com/u/6367692?v=4&s=117" width="117">](https://github.com/dominiceden) |
[<img alt="mokutsu-coursera" src="https://avatars.githubusercontent.com/u/65177495?v=4&s=117" width="117">](https://github.com/mokutsu-coursera) |[<img alt="YukeshShr" src="https://avatars.githubusercontent.com/u/71844521?v=4&s=117" width="117">](https://github.com/YukeshShr) |[<img alt="DJWassink" src="https://avatars.githubusercontent.com/u/1822404?v=4&s=117" width="117">](https://github.com/DJWassink) |[<img alt="taoqf" src="https://avatars.githubusercontent.com/u/15901911?v=4&s=117" width="117">](https://github.com/taoqf) |[<img alt="github-actions[bot]" src="https://avatars.githubusercontent.com/in/15368?v=4&s=117" width="117">](https://github.com/apps/github-actions) |[<img alt="tuoxiansp" src="https://avatars.githubusercontent.com/u/3960056?v=4&s=117" width="117">](https://github.com/tuoxiansp) |
:---: |:---: |:---: |:---: |:---: |:---: |
[mokutsu-coursera](https://github.com/mokutsu-coursera) |[YukeshShr](https://github.com/YukeshShr) |[DJWassink](https://github.com/DJWassink) |[taoqf](https://github.com/taoqf) |[tuoxiansp](https://github.com/tuoxiansp) |[dominiceden](https://github.com/dominiceden) |
[mokutsu-coursera](https://github.com/mokutsu-coursera) |[YukeshShr](https://github.com/YukeshShr) |[DJWassink](https://github.com/DJWassink) |[taoqf](https://github.com/taoqf) |[github-actions[bot]](https://github.com/apps/github-actions) |[tuoxiansp](https://github.com/tuoxiansp) |
[<img alt="elenalape" src="https://avatars.githubusercontent.com/u/22844059?v=4&s=117" width="117">](https://github.com/elenalape) |[<img alt="mejiaej" src="https://avatars.githubusercontent.com/u/4699893?v=4&s=117" width="117">](https://github.com/mejiaej) |[<img alt="gavboulton" src="https://avatars.githubusercontent.com/u/3900826?v=4&s=117" width="117">](https://github.com/gavboulton) |[<img alt="Hawxy" src="https://avatars.githubusercontent.com/u/975824?v=4&s=117" width="117">](https://github.com/Hawxy) |[<img alt="bertho-zero" src="https://avatars.githubusercontent.com/u/8525267?v=4&s=117" width="117">](https://github.com/bertho-zero) |[<img alt="tranvansang" src="https://avatars.githubusercontent.com/u/13043196?v=4&s=117" width="117">](https://github.com/tranvansang) |
[<img alt="dominiceden" src="https://avatars.githubusercontent.com/u/6367692?v=4&s=117" width="117">](https://github.com/dominiceden) |[<img alt="elenalape" src="https://avatars.githubusercontent.com/u/22844059?v=4&s=117" width="117">](https://github.com/elenalape) |[<img alt="mejiaej" src="https://avatars.githubusercontent.com/u/4699893?v=4&s=117" width="117">](https://github.com/mejiaej) |[<img alt="gavboulton" src="https://avatars.githubusercontent.com/u/3900826?v=4&s=117" width="117">](https://github.com/gavboulton) |[<img alt="Hawxy" src="https://avatars.githubusercontent.com/u/975824?v=4&s=117" width="117">](https://github.com/Hawxy) |[<img alt="bertho-zero" src="https://avatars.githubusercontent.com/u/8525267?v=4&s=117" width="117">](https://github.com/bertho-zero) |
:---: |:---: |:---: |:---: |:---: |:---: |
[elenalape](https://github.com/elenalape) |[mejiaej](https://github.com/mejiaej) |[gavboulton](https://github.com/gavboulton) |[Hawxy](https://github.com/Hawxy) |[bertho-zero](https://github.com/bertho-zero) |[tranvansang](https://github.com/tranvansang) |
[dominiceden](https://github.com/dominiceden) |[elenalape](https://github.com/elenalape) |[mejiaej](https://github.com/mejiaej) |[gavboulton](https://github.com/gavboulton) |[Hawxy](https://github.com/Hawxy) |[bertho-zero](https://github.com/bertho-zero) |
[<img alt="ap--" src="https://avatars.githubusercontent.com/u/1463443?v=4&s=117" width="117">](https://github.com/ap--) |[<img alt="github-actions[bot]" src="https://avatars.githubusercontent.com/in/15368?v=4&s=117" width="117">](https://github.com/apps/github-actions) |[<img alt="mrbatista" src="https://avatars.githubusercontent.com/u/6544817?v=4&s=117" width="117">](https://github.com/mrbatista) |[<img alt="MikeKovarik" src="https://avatars.githubusercontent.com/u/3995401?v=4&s=117" width="117">](https://github.com/MikeKovarik) |[<img alt="pauln" src="https://avatars.githubusercontent.com/u/574359?v=4&s=117" width="117">](https://github.com/pauln) |[<img alt="toadkicker" src="https://avatars.githubusercontent.com/u/523330?v=4&s=117" width="117">](https://github.com/toadkicker) |
[<img alt="tranvansang" src="https://avatars.githubusercontent.com/u/13043196?v=4&s=117" width="117">](https://github.com/tranvansang) |[<img alt="ap--" src="https://avatars.githubusercontent.com/u/1463443?v=4&s=117" width="117">](https://github.com/ap--) |[<img alt="mrbatista" src="https://avatars.githubusercontent.com/u/6544817?v=4&s=117" width="117">](https://github.com/mrbatista) |[<img alt="MikeKovarik" src="https://avatars.githubusercontent.com/u/3995401?v=4&s=117" width="117">](https://github.com/MikeKovarik) |[<img alt="pauln" src="https://avatars.githubusercontent.com/u/574359?v=4&s=117" width="117">](https://github.com/pauln) |[<img alt="toadkicker" src="https://avatars.githubusercontent.com/u/523330?v=4&s=117" width="117">](https://github.com/toadkicker) |
:---: |:---: |:---: |:---: |:---: |:---: |
[ap--](https://github.com/ap--) |[github-actions[bot]](https://github.com/apps/github-actions) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |
[tranvansang](https://github.com/tranvansang) |[ap--](https://github.com/ap--) |[mrbatista](https://github.com/mrbatista) |[MikeKovarik](https://github.com/MikeKovarik) |[pauln](https://github.com/pauln) |[toadkicker](https://github.com/toadkicker) |
[<img alt="ofhope" src="https://avatars.githubusercontent.com/u/1826459?v=4&s=117" width="117">](https://github.com/ofhope) |[<img alt="johnnyperkins" src="https://avatars.githubusercontent.com/u/16482282?v=4&s=117" width="117">](https://github.com/johnnyperkins) |[<img alt="dargmuesli" src="https://avatars.githubusercontent.com/u/4778485?v=4&s=117" width="117">](https://github.com/dargmuesli) |[<img alt="juliangruber" src="https://avatars.githubusercontent.com/u/10247?v=4&s=117" width="117">](https://github.com/juliangruber) |[<img alt="manuelkiessling" src="https://avatars.githubusercontent.com/u/206592?v=4&s=117" width="117">](https://github.com/manuelkiessling) |[<img alt="nndevstudio" src="https://avatars.githubusercontent.com/u/22050968?v=4&s=117" width="117">](https://github.com/nndevstudio) |
:---: |:---: |:---: |:---: |:---: |:---: |
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = (api) => {
useBuiltIns: false, // Don't add polyfills automatically.
// We can uncomment the following line if we start adding polyfills to the non-legacy dist files.
// corejs: { version: '3.15', proposals: true },
modules: false,
}],
],
plugins: [
Expand Down
136 changes: 0 additions & 136 deletions bin/build-bundle.js

This file was deleted.

101 changes: 101 additions & 0 deletions bin/build-bundle.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env node

import fs from 'node:fs/promises'
import path from 'node:path'
import chalk from 'chalk'

import esbuild from 'esbuild'
import babel from 'esbuild-plugin-babel'

const UPPY_ROOT = new URL('../', import.meta.url)
const PACKAGES_ROOT = new URL('./packages/', UPPY_ROOT)

function buildBundle (srcFile, bundleFile, { minify = true, standalone = '', plugins, target } = {}) {
return esbuild.build({
bundle: true,
sourcemap: true,
entryPoints: [srcFile],
outfile: bundleFile,
banner: {
js: '"use strict";',
},
minify,
plugins,
target,
}).then(() => {
if (minify) {
console.info(chalk.green(`✓ Built Minified Bundle [${standalone}]:`), chalk.magenta(bundleFile))
} else {
console.info(chalk.green(`✓ Built Bundle [${standalone}]:`), chalk.magenta(bundleFile))
}
})
}

await fs.mkdir(new URL('./uppy/dist', PACKAGES_ROOT), { recursive: true })
await fs.mkdir(new URL('./@uppy/robodog/dist', PACKAGES_ROOT), { recursive: true })
await fs.mkdir(new URL('./@uppy/locales/dist', PACKAGES_ROOT), { recursive: true })

const methods = [
buildBundle(
'./packages/uppy/index.js',
'./packages/uppy/dist/uppy.min.js',
{ standalone: 'Uppy' },
),
buildBundle(
'./packages/uppy/bundle.js',
'./packages/uppy/dist/uppy.legacy.min.js',
{
standalone: 'Uppy (with polyfills)',
target: 'es5',
plugins:[babel({
config:{
compact: false,
highlightCode: false,
inputSourceMap: true,

browserslistEnv: 'legacy',
presets: [['@babel/preset-env', {
loose: false,
targets: { ie:11 },
useBuiltIns: 'entry',
corejs: { version: '3.15', proposals: true },
}]],
},
})],
},
),
buildBundle(
'./packages/@uppy/robodog/bundle.js',
'./packages/@uppy/robodog/dist/robodog.min.js',
{ standalone: 'Robodog' },
),
]

// Build minified versions of all the locales
const localesModules = await fs.opendir(new URL('./@uppy/locales/src/', PACKAGES_ROOT))
for await (const dirent of localesModules) {
if (!dirent.isDirectory() && dirent.name.endsWith('.js')) {
const localeName = path.basename(dirent.name, '.js')
methods.push(
buildBundle(
`./packages/@uppy/locales/src/${localeName}.js`,
`./packages/@uppy/locales/dist/${localeName}.min.js`,
{ minify: true },
),
)
}
}

// Add BUNDLE-README.MD
methods.push(
fs.copyFile(
new URL('./BUNDLE-README.md', UPPY_ROOT),
new URL('./uppy/dist/README.md', PACKAGES_ROOT),
),
)

Promise.all(methods).then(() => {
console.info(chalk.yellow('✓ JS bundles 🎉'))
}, (err) => {
console.error(chalk.red('✗ Error:'), chalk.red(err.message))
})
5 changes: 2 additions & 3 deletions bin/build-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const glob = promisify(require('glob'))
const fs = require('fs')
const path = require('path')

const transformFile = promisify(babel.transformFile)
const { mkdir, stat, writeFile } = fs.promises

const SOURCE = 'packages/{*,@uppy/*}/src/**/*.js'
Expand Down Expand Up @@ -52,7 +51,7 @@ async function buildLib () {
}
}

const { code, map } = await transformFile(file, { sourceMaps: true })
const { code, map } = await babel.transformFileAsync(file, { sourceMaps: true })
await mkdir(path.dirname(libFile), { recursive: true })
await Promise.all([
writeFile(libFile, code),
Expand All @@ -66,6 +65,6 @@ async function buildLib () {
console.log('Using Babel version:', require('@babel/core/package.json').version)

buildLib().catch((err) => {
console.error(err.stack)
console.error(err)
process.exit(1)
})
Loading

0 comments on commit a6eb595

Please sign in to comment.