Skip to content

Commit

Permalink
Merge branch 'ts-packages-support' into utils-to-ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 authored Sep 26, 2023
2 parents 676708b + 6c9586e commit ea1eb9e
Show file tree
Hide file tree
Showing 87 changed files with 1,249 additions and 698 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
.git
website
assets
private
e2e
.env
61 changes: 61 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,67 @@ Releases are managed by GitHub Actions, here’s an overview of the process to r

If you don’t have access to the transloadit.com source code ping @arturi or @goto-bus-stop and we’ll pick it up. :sparkles:

### Releasing hotfix patch

#### Companion hotfix

First checkout the tag of the version you want to patch:
```bash
git checkout @uppy/[email protected]
```

Now create a branch for your hotfix:
```bash
git checkout -b x.y.z-hotfix
```

Run yarn to make sure all packages are consistent:
```bash
corepack yarn
```

Now navigate to the Companion workspace:
```bash
cd packages/@uppy/companion
```

**Now cherry pick your desired commits**

Next edit `CHANGELOG.md` and then commit it:
```bash
git add CHANGELOG.md
git commit -m 'Update changelog'
```

Now let's create the version & tag
```bash
mkdir -p .git && npm version --workspaces-update=false --tag-version-prefix='@uppy/companion@' patch
```

Run a "dry-run" first:

```bash
corepack yarn pack
```

If the previous command succeeded, let's publish!

```bash
corepack yarn npm publish --access public --tag=none
```

Now we can push our branch and tags.

```bash
git push && git push --tags
```

#### Hotfix other packages

For other Uppy packages, the process should be similar to Companion,
but hasn't been documented yet. Make sure to remember to run `yarn` as well as building the package first, then you can release it.
If you do release any other packages, please update this doc.

## CSS guidelines

The CSS standards followed in this project closely resemble those from [Medium’s CSS Guidelines](https://gist.github.com/fat/a47b882eb5f84293c4ed). If something is not mentioned here, follow their guidelines.
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/companion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ jobs:
run: corepack yarn workspaces focus @uppy/companion
- name: Run tests
run: corepack yarn run test:companion
- name: Run type checks in focused workspace
run: corepack yarn run build:companion

25 changes: 0 additions & 25 deletions .yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch

This file was deleted.

4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ RUN if [ "$(uname -m)" == "aarch64" ]; then mkdir -p /usr/local/sbin/ && ln -s /

WORKDIR /app

COPY package.json .yarnrc.yml /app/
COPY .yarn /app/.yarn
COPY packages/@uppy/companion /app/packages/@uppy/companion
COPY . /app/

RUN apk --update add --virtual native-dep \
make gcc g++ python3 libgcc libstdc++ git && \
Expand Down
24 changes: 4 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"adm-zip": "^0.5.5",
"autoprefixer": "^10.2.6",
"aws-sdk": "^2.1038.0",
"babel-jest": "^29.0.0",
"babel-plugin-inline-package-json": "^2.0.0",
"chalk": "^5.0.0",
"concat-stream": "^2.0.0",
Expand All @@ -80,8 +79,7 @@
"eslint-plugin-unicorn": "^46.0.0",
"github-contributors-list": "^1.2.4",
"glob": "^8.0.0",
"jest": "^29.0.0",
"jest-environment-jsdom": "^29.0.0",
"jsdom": "^22.1.0",
"lint-staged": "^13.0.0",
"mime-types": "^2.1.26",
"nodemon": "^2.0.8",
Expand All @@ -104,6 +102,7 @@
"tar": "^6.1.0",
"tsd": "^0.28.0",
"typescript": "~5.1",
"vitest": "^0.34.5",
"vue-template-compiler": "workspace:*"
},
"scripts": {
Expand Down Expand Up @@ -144,8 +143,8 @@
"test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused",
"test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings",
"test:type": "yarn workspaces foreach -piv --include '@uppy/*' --exclude '@uppy/{angular,react-native,locales,companion,provider-views,robodog,svelte}' exec tsd",
"test:unit": "yarn run build:lib && NODE_OPTIONS=--experimental-vm-modules jest --env jsdom",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --env jsdom --watch --no-coverage",
"test:unit": "yarn run build:lib && yarn test:watch",
"test:watch": "vitest --environment jsdom --dir packages/@uppy",
"test": "npm-run-all lint test:locale-packs:unused test:unit test:type test:companion",
"uploadcdn": "yarn node ./bin/upload-to-cdn.js",
"version": "yarn node ./bin/after-version-bump.js",
Expand All @@ -155,25 +154,10 @@
"watch:js": "npm-run-all --parallel watch:js:bundle watch:js:lib",
"watch": "npm-run-all --parallel watch:css watch:js"
},
"jest": {
"automock": false,
"collectCoverage": true,
"collectCoverageFrom": [
"packages/**/src/**/*.js"
],
"testMatch": [
"**/packages/**/*.test.js"
],
"testPathIgnorePatterns": [
"/packages/@uppy/companion/"
]
},
"resolutions": {
"@types/eslint@^7.2.13": "^8.2.0",
"@types/react": "^17",
"@types/webpack-dev-server": "^4",
"jest-environment-jsdom": "patch:jest-environment-jsdom@npm:29.5.0#.yarn/patches/jest-environment-jsdom-npm-29.5.0-fc600add1e.patch",
"p-queue": "patch:p-queue@npm%3A7.3.4#./.yarn/patches/p-queue-npm-7.3.4-c746a7f1ae.patch",
"pre-commit": "patch:pre-commit@npm:1.2.2#.yarn/patches/pre-commit-npm-1.2.2-f30af83877.patch",
"preact": "patch:preact@npm:10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch",
"start-server-and-test": "patch:start-server-and-test@npm:1.14.0#.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/audio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"preact": "^10.5.13"
},
"devDependencies": {
"@jest/globals": "^29.0.0"
"vitest": "^0.34.5"
},
"peerDependencies": {
"@uppy/core": "workspace:^"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/audio/src/formatSeconds.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import formatSeconds from './formatSeconds.js'

describe('formatSeconds', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/audio/src/supportsMediaRecorder.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-classes-per-file */
import { describe, expect, it } from '@jest/globals'
import { describe, expect, it } from 'vitest'
import supportsMediaRecorder from './supportsMediaRecorder.js'

describe('supportsMediaRecorder', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/aws-s3-multipart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"devDependencies": {
"@aws-sdk/client-s3": "^3.362.0",
"@aws-sdk/s3-request-presigner": "^3.362.0",
"@jest/globals": "^29.0.0",
"nock": "^13.1.0",
"vitest": "^0.34.5",
"whatwg-fetch": "3.6.2"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, beforeEach, afterEach } from '@jest/globals'
import { describe, it, beforeEach, afterEach } from 'vitest'
import assert from 'node:assert'
import { S3Client, UploadPartCommand, PutObjectCommand } from '@aws-sdk/client-s3'
import { getSignedUrl } from '@aws-sdk/s3-request-presigner'
Expand Down
Loading

0 comments on commit ea1eb9e

Please sign in to comment.