mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
Working : - Simple uploads (putObject) - Multipart uploads - Pause / Resume / Abort , Resume works using listParts as before - Progress tracking per chunk ( `#onProgress` ) - this is temporary , until we implement xhr based progress tracking as - before. **added new examples to examples/aws-nodejs to test the rewrite , old examples will eventually be removed** Not Yet Implemented - Rate limiting – Currently uploads are sequential - Retries - Remote file uploads – Files from Google Drive, Dropbox, etc. XHR progress - full wiring with uppy state ( I saw few state bugs while testing it manually ) --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Murderlon <merlijn@soverin.net>
249 lines
8.1 KiB
YAML
249 lines
8.1 KiB
YAML
name: Bundlers
|
|
|
|
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'
|
|
|
|
env:
|
|
YARN_ENABLE_GLOBAL_CACHE: false
|
|
|
|
jobs:
|
|
isolate_uppy:
|
|
name: Isolate Uppy packages
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v6
|
|
- name: Get yarn cache directory path
|
|
id: yarn-cache-dir-path
|
|
run:
|
|
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
|
- uses: actions/cache@v5
|
|
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@v6
|
|
with:
|
|
node-version: lts/*
|
|
- name: Install dependencies
|
|
run:
|
|
corepack yarn install
|
|
env:
|
|
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
|
|
CYPRESS_INSTALL_BINARY: 0
|
|
- name: Build
|
|
run: corepack yarn run build
|
|
- name: Make Uppy bundle use local version
|
|
run: |
|
|
node <<'EOF'
|
|
const pkg = require('./packages/uppy/package.json');
|
|
pkg.overrides = {};
|
|
(async () => {
|
|
for await (const { name } of await require('node:fs/promises').opendir('./packages/@uppy/')) {
|
|
pkg.overrides["@uppy/" + name] = `/tmp/packages/@uppy-${name}-${{ github.sha }}.tgz`;
|
|
}
|
|
for(const key of Object.keys(pkg.dependencies)) {
|
|
if (key in pkg.overrides) {
|
|
pkg.dependencies[key] = pkg.overrides[key];
|
|
}
|
|
}
|
|
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 --all
|
|
--no-private pack --install-if-needed -o /tmp/artifacts/%s-${{
|
|
github.sha }}.tgz
|
|
- name: Debug packaged uppy dependencies
|
|
run: |
|
|
rm -rf /tmp/uppy-debug
|
|
mkdir -p /tmp/uppy-debug
|
|
tar -xzf /tmp/artifacts/uppy-${{ github.sha }}.tgz --strip-components 1 -C /tmp/uppy-debug
|
|
node -e 'const pkg=require("/tmp/uppy-debug/package.json");const fields=["dependencies","peerDependencies","optionalDependencies","devDependencies"];let found=false;for(const f of fields){if(!pkg[f])continue;for(const [k,v] of Object.entries(pkg[f])){if(String(v).startsWith("workspace:")){console.log(`${f}: ${k}=${v}`);found=true;}}}if(!found)console.log("No workspace:* entries in packaged uppy package.json");'
|
|
- name: Upload artifact
|
|
if: success()
|
|
uses: actions/upload-artifact@v6
|
|
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@v7
|
|
with:
|
|
name: packages
|
|
path: /tmp/packages/
|
|
- 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/plugin-json rollup@${{matrix.bundler-version}}
|
|
- run: npx rollup --version
|
|
- name: Create Rollup config file
|
|
run: >-
|
|
echo ' import cjs from "@rollup/plugin-commonjs"; import { nodeResolve
|
|
} from "@rollup/plugin-node-resolve"; import json from
|
|
"@rollup/plugin-json";
|
|
|
|
export default {
|
|
input: "./lib/index.js",
|
|
output: {
|
|
file: "/dev/null",
|
|
},
|
|
plugins: [
|
|
json(),
|
|
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@v7
|
|
with:
|
|
name: packages
|
|
path: /tmp/packages/
|
|
- 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}}
|
|
- run: npx webpack --version
|
|
- name: Create Webpack config file
|
|
run: |
|
|
echo 'export default {
|
|
mode: "production",
|
|
target: "web",
|
|
entry: "./lib/index.js",
|
|
resolve: {
|
|
fallback: {
|
|
fs: false,
|
|
path: false,
|
|
stream: false,
|
|
util: false,
|
|
assert: false,
|
|
constants: false,
|
|
crypto: false,
|
|
http: false,
|
|
https: false,
|
|
url: false
|
|
}
|
|
}
|
|
}' > 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@v7
|
|
with:
|
|
name: packages
|
|
path: /tmp/packages/
|
|
- 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}}
|
|
- run: npx parcel --version
|
|
- name: Bundle
|
|
run: npx parcel build lib/index.js
|
|
|
|
vite:
|
|
needs: isolate_uppy
|
|
name: Vite
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
bundler-version: [latest]
|
|
steps:
|
|
- name: Download uppy tarball
|
|
uses: actions/download-artifact@v7
|
|
with:
|
|
name: packages
|
|
path: /tmp/packages/
|
|
- 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}}
|
|
- run: npx vite --version
|
|
- name: Create index.html
|
|
run:
|
|
echo '<!doctype html><html><head><script type="module"
|
|
src="./lib/index.js"></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@v7
|
|
with:
|
|
name: packages
|
|
path: /tmp/packages/
|
|
- 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}}
|
|
- run: npx esbuild --version
|
|
- name: Bundle
|
|
run: npx esbuild lib/index.js --bundle --outfile=/dev/null
|
|
|
|
# Browserify: doesn't support ESM.
|