Skip to content

Commit

Permalink
Merge branch 'aws-shouldUseMultipart' of https://github.com/aduh95/uppy
Browse files Browse the repository at this point in the history
… into aws-shouldUseMultipart
  • Loading branch information
arturi committed May 2, 2023
2 parents ecee9f6 + 7e4608b commit 228101f
Show file tree
Hide file tree
Showing 1,644 changed files with 6,605 additions and 36,413 deletions.
92 changes: 0 additions & 92 deletions .browsersync.js

This file was deleted.

1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ COMPANION_AWS_SECRET="YOUR AWS SECRET"
# COMPANION_AWS_SECRET_FILE="PATH/TO/AWS/SECRET/FILE"
COMPANION_AWS_BUCKET="YOUR AWS S3 BUCKET"
COMPANION_AWS_REGION="AWS REGION"
COMPANION_AWS_PREFIX="OPTIONAL PREFIX"
# 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: 800)
Expand Down
14 changes: 0 additions & 14 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,6 @@ lib
dist
coverage
test/lib/**
website/public/**
website/src/examples/**/*.html
website/themes/uppy/source/js/smooth-scroll.min.js
website/themes/uppy/source/js/uppy.js
website/themes/uppy/source/uppy/**
test/endtoend/*/build
examples/svelte-example/public/build/
bundle-legacy.js
website/src/_posts/201*.md
website/src/_posts/2020-*.md
website/src/_posts/2021-01-*.md
website/src/_posts/2021-02-*.md
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
53 changes: 11 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ module.exports = {
ignore: svgPresentationAttributes,
}],

// Special rules for CI:
...(process.env.CI && {
// Some imports are available only after a full build, which we don't do on CI.
'import/no-unresolved': 'off',
}),

// rules we want to enforce
'array-callback-return': 'error',
'func-names': 'error',
'implicit-arrow-linebreak': 'error',
'import/no-dynamic-require': 'error',
'import/no-extraneous-dependencies': 'error',
Expand All @@ -76,25 +83,8 @@ module.exports = {
'prefer-spread': 'error',
'unicorn/prefer-node-protocol': 'error',

// transloadit rules we would like to enforce in the future
// but will require separate PRs to gradually get there
// and so the meantime: just warn
'class-methods-use-this': ['warn'],
'consistent-return': ['warn'],
'default-case': ['warn'],
'global-require': ['warn'],
'import/no-unresolved': ['warn'],
'import/order': ['warn'],
'no-mixed-operators': ['warn'],
'no-param-reassign': ['warn'],
'no-redeclare': ['warn'],
'no-shadow': ['warn'],
'no-use-before-define': ['warn', { 'functions': false }],
'radix': ['warn'],
'react/button-has-type': 'error',
'react/destructuring-assignment': ['warn'],
'react/forbid-prop-types': 'error',
'react/jsx-props-no-spreading': ['warn'],
'react/no-access-state-in-setstate': 'error',
'react/no-array-index-key': 'error',
'react/no-deprecated': 'error',
Expand Down Expand Up @@ -122,8 +112,8 @@ module.exports = {
// jsdoc
'jsdoc/check-alignment': 'error',
'jsdoc/check-examples': 'off', // cannot yet be supported for ESLint 8, see https://github.com/eslint/eslint/issues/14745
'jsdoc/check-param-names': ['warn'],
'jsdoc/check-syntax': ['warn'],
'jsdoc/check-param-names': 'error',
'jsdoc/check-syntax': 'error',
'jsdoc/check-tag-names': ['error', { jsxTags: true }],
'jsdoc/check-types': 'error',
'jsdoc/newline-after-description': 'error',
Expand Down Expand Up @@ -201,6 +191,7 @@ module.exports = {
'examples/php-xhr/*.js',
'examples/python-xhr/*.js',
'examples/react-example/*.js',
'examples/redux/*.js',
'examples/transloadit/*.js',
'examples/transloadit-markdown-bin/*.js',
'examples/xhr-bundle/*.js',
Expand Down Expand Up @@ -252,7 +243,6 @@ module.exports = {
'packages/@uppy/webcam/src/**/*.js',
'packages/@uppy/xhr-upload/src/**/*.js',
'packages/@uppy/zoom/src/**/*.js',
'website/src/examples/*/*.es6',
],
parser: 'espree',
parserOptions: {
Expand Down Expand Up @@ -358,20 +348,10 @@ module.exports = {
'no-use-before-define': 'warn',
},
},
{
files: [
'website/src/examples/*/*.es6',
],
rules: {
'import/no-extraneous-dependencies': 'off',
'no-console': 'off',
},
},
{
files: [
'*.test.js',
'test/endtoend/*.js',
'website/*.js',
'bin/**.js',
],
rules: {
Expand All @@ -382,17 +362,15 @@ module.exports = {
files: [
'bin/**.js',
'bin/**.mjs',
'examples/**/*.config.js',
'examples/**/*.cjs',
'examples/**/*.js',
'packages/@uppy/companion/test/**/*.js',
'test/**/*.js',
'test/**/*.ts',
'*.test.js',
'*.test-d.ts',
'postcss.config.js',
'.eslintrc.js',
'website/*.js',
'website/**/*.js',
'private/**/*.js',
],
rules: {
Expand All @@ -414,15 +392,6 @@ module.exports = {
},
},

{
files: [
'website/themes/uppy/source/js/*.js',
],
rules: {
'prefer-const': ['off'],
},
},

{
files: ['test/endtoend/*/*.mjs', 'test/endtoend/*/*.ts'],
rules: {
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/bundlers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ jobs:
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`;
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`;
}
}
require('node:fs').writeFileSync('./packages/uppy/package.json', JSON.stringify(pkg));
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 --no-private pack --install-if-needed -o /tmp/artifacts/%s-${{ github.sha }}.tgz
Expand Down Expand Up @@ -85,6 +91,7 @@ jobs:
npm i --save-dev
@rollup/plugin-commonjs @rollup/plugin-node-resolve
rollup@${{matrix.bundler-version}}
- run: npx rollup --version
- name: Create Rollup config file
run: >-
echo '
Expand Down Expand Up @@ -120,6 +127,7 @@ jobs:
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 'module.exports={mode:"production",target:"web",entry:"./index.mjs"}' > webpack.config.js
- name: Bundle
Expand Down Expand Up @@ -150,6 +158,7 @@ jobs:
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 index.mjs

Expand All @@ -169,6 +178,7 @@ jobs:
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="./index.mjs"></script></head></html>' > index.html
- name: Bundle
Expand All @@ -190,6 +200,7 @@ jobs:
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 index.mjs --bundle --outfile=/dev/null

Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/companion-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,20 @@ jobs:
file: Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

heroku:
name: Heroku
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Alter dockerfile
run: |
sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
- name: Deploy to heroku
uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: companion-demo
heroku_email: ${{secrets.HEROKU_EMAIL}}
usedocker: true
19 changes: 0 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,3 @@ jobs:
file: Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}

heroku:
name: Heroku
needs: release
if: ${{ needs.release.outputs.companionWasReleased }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Alter dockerfile
run: |
sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
- name: Deploy to heroku
uses: akhileshns/heroku-deploy@v3.12.12
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: companion-demo
heroku_email: ${{secrets.HEROKU_EMAIL}}
usedocker: true
Loading

0 comments on commit 228101f

Please sign in to comment.