Skip to content

Commit

Permalink
Merge branch 'main' into transloadit-deprecated-options
Browse files Browse the repository at this point in the history
* main: (110 commits)
  @uppy/aws-s3-multipart: handle slow connections better (#4213)
  @uppy/companion-client: treat `*` the same as missing header (#4221)
  @uppy/utils: fix types (#4212)
  @uppy/companion: send expire info for non-multipart uploads (#4214)
  docs: fix `allowedMetaFields` documentation (#4216)
  meta: add more bundlers for automated testing (#4100)
  @uppy/aws-s3-multipart: Fix typo in url check (#4211)
  meta: use current version of packages when testing bundlers (#4208)
  meta: do not use the set-output command in workflows (#4175)
  Release: uppy@3.3.0 (#4207)
  Companion: change default S3 expiry from 300 to 800 seconds (#4206)
  Dashboard: Single file mode (#4188)
  Fix UZ locale (#4178)
  @uppy/utils: update typings for `RateLimitedQueue` (#4204)
  @uppy/aws-s3-multipart: empty the queue when pausing (#4203)
  image-editor: add checkered background (#4194)
  @uppy/aws-s3-multipart: refactor rate limiting approach (#4187)
  @uppy/companion: send expiry time along side S3 signed requests (#4202)
  @uppy/companion-client: add support for `AbortSignal` (#4201)
  @uppy/companion-client: prevent preflight race condition (#4182)
  ...
  • Loading branch information
Murderlon committed Nov 25, 2022
2 parents 50173d2 + e69e235 commit 38d3d35
Show file tree
Hide file tree
Showing 233 changed files with 5,274 additions and 4,486 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ COMPANION_AWS_BUCKET="YOUR AWS S3 BUCKET"
COMPANION_AWS_REGION="AWS REGION"
# to enable S3 Transfer Acceleration (default: false)
# COMPANION_AWS_USE_ACCELERATE_ENDPOINT="false"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 300)
# COMPANION_AWS_EXPIRES="300"
# to set X-Amz-Expires query param in presigned urls (in seconds, default: 800)
# COMPANION_AWS_EXPIRES="800"
# to set a canned ACL for uploaded objects: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
# COMPANION_AWS_ACL="public-read"

Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ module.exports = {
'*.mjs',
'e2e/clients/**/*.js',
'examples/aws-companion/*.js',
'examples/aws-presigned-url/*.js',
'examples/aws-php/*.js',
'examples/bundled/*.js',
'examples/custom-provider/client/*.js',
'examples/digitalocean-spaces/*.js',
Expand Down
193 changes: 193 additions & 0 deletions .github/workflows/bundlers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
name: Test different bundlers with Uppy

on:
push:
branches: [ main ]
pull_request:
# We want all branches so we configure types to be the GH default again
types: [ opened, synchronize, reopened ]
paths-ignore:
- '**.md'
- '**.d.ts'
- 'examples/**'
- 'private/**'
- 'website/**'
- '.github/**'
- '!.github/workflows/bundlers.yml'

jobs:
isolate_uppy:
name: Isolate Uppy package
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Build lib
run: corepack yarn run build:lib
- name: Make Uppy bundle use local version
run: |
node <<'EOF'
const pkg = require('./packages/uppy/package.json');
for(const key of Object.keys(pkg.dependencies)) {
if (key.startsWith('@uppy/')) {
pkg.dependencies[key] = `/tmp/packages/${key.replace('/', '-')}-${{ github.sha }}.tgz`;
}
}
require('node:fs').writeFileSync('./packages/uppy/package.json', JSON.stringify(pkg));
EOF
- name: Eject public packages from repo
run: mkdir /tmp/artifacts && corepack yarn workspaces foreach --no-private pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
- name: Upload artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: packages
path: /tmp/artifacts/

rollup:
needs: isolate_uppy
name: Rollup
runs-on: ubuntu-latest
strategy:
matrix:
bundler-version: [latest]
steps:
- name: Download uppy tarball
uses: actions/download-artifact@v3
with:
path: /tmp/
- name: Extract tarball
run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Rollup as a dev dependency
run: >-
npm i --save-dev
@rollup/plugin-commonjs @rollup/plugin-node-resolve
rollup@${{matrix.bundler-version}}
- name: Create Rollup config file
run: >-
echo '
import cjs from "@rollup/plugin-commonjs";
import { nodeResolve } from "@rollup/plugin-node-resolve";
export default {
input: "./index.mjs",
output: {
file: "/dev/null",
},
plugins: [
cjs(),
nodeResolve({ browser: true, exportConditions: ["browser"] }),
],
};' > rollup.config.mjs
- name: Bundle
run: npx rollup -c

webpack:
needs: isolate_uppy
name: Webpack
runs-on: ubuntu-latest
strategy:
matrix:
bundler-version: [latest]
steps:
- name: Download uppy tarball
uses: actions/download-artifact@v3
with:
path: /tmp/
- name: Extract tarball
run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Webpack as a dev dependency
run: npm i --save-dev webpack-cli webpack@${{matrix.bundler-version}}
- name: Create Webpack config file
run: echo 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}' > webpack.config.js
- name: Bundle
run: npx webpack

parcel:
needs: isolate_uppy
name: Parcel
runs-on: ubuntu-latest
strategy:
matrix:
bundler-version: [latest]
steps:
- name: Download uppy tarball
uses: actions/download-artifact@v3
with:
path: /tmp/
- name: Extract tarball
run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Fix package.json to work with Parcel
run: |
node <<'EOF'
const pkg = require('./package.json');
delete pkg.main
delete pkg.types
pkg.module = 'output.mjs'
require('node:fs').writeFileSync('./package.json', JSON.stringify(pkg));
EOF
- name: Add Parcel as a dev dependency
run: npm i --save-dev parcel@${{matrix.bundler-version}}
- name: Bundle
run: npx parcel build index.mjs

vite:
needs: isolate_uppy
name: Vite
runs-on: ubuntu-latest
strategy:
matrix:
bundler-version: [latest]
steps:
- name: Download uppy tarball
uses: actions/download-artifact@v3
with:
path: /tmp/
- name: Extract tarball
run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add Vite as a dev dependency
run: npm i --save-dev vite@${{matrix.bundler-version}}
- name: Create index.html
run: echo '<!doctype html><html><head><script type="module" src="./index.mjs"></script></head></html>' > index.html
- name: Bundle
run: npx vite build

esbuild:
needs: isolate_uppy
name: ESBuild
runs-on: ubuntu-latest
strategy:
matrix:
bundler-version: [latest]
steps:
- name: Download uppy tarball
uses: actions/download-artifact@v3
with:
path: /tmp/
- name: Extract tarball
run: tar -xzf /tmp/packages/uppy-${{ github.sha }}.tgz --strip-components 1
- name: Add ESBuild as a dev dependency
run: npm i --save-dev esbuild@${{matrix.bundler-version}}
- name: Bundle
run: npx esbuild index.mjs --bundle --outfile=/dev/null

# Browserify: doesn't support ESM.
84 changes: 28 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,27 @@ name: CI
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'assets/**'
- 'e2e/**'
- 'examples/**'
- 'private/**'
- 'website/**'
- '.github/**'
- '!.github/workflows/ci.yml'
pull_request:
# We want all branches so we configure types to be the GH default again
types: [ opened, synchronize, reopened ]
paths-ignore:
- '**.md'
- 'assets/**'
- 'e2e/**'
- 'examples/**'
- 'private/**'
- 'website/**'
- '.github/**'
- '!.github/workflows/ci.yml'

jobs:
unit_tests:
Expand All @@ -19,7 +37,7 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand All @@ -33,62 +51,13 @@ jobs:
with:
node-version: ${{matrix.node-version}}
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
- name: Run tests
run: corepack yarn run test:unit

lint_js:
name: Lint JavaScript/TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
- name: Run linter
run: corepack yarn run lint

lint_md:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
- name: Run linter
run: corepack yarn run lint:markdown

types:
name: Type tests
runs-on: ubuntu-latest
Expand All @@ -97,7 +66,7 @@ jobs:
uses: actions/checkout@v3
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
run: echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
Expand All @@ -111,7 +80,10 @@ jobs:
with:
node-version: lts/*
- name: Install dependencies
run: corepack yarn install --immutable
run: corepack yarn workspaces focus $(corepack yarn workspaces list --json | jq -r .name | awk '/^@uppy-example/{ next } { if ($0!="uppy.io") print $0 }')
env:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
CYPRESS_INSTALL_BINARY: 0
# Need to do a bunch of work to generate the locale typings 🙃
- name: Prepare type declarations
run: |
Expand Down
Loading

0 comments on commit 38d3d35

Please sign in to comment.