-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into transloadit-deprecated-options
* 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
Showing
233 changed files
with
5,274 additions
and
4,486 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.