-
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 'provider-user-sessions' into webdav-provider-poc
# Conflicts: # private/dev/Dashboard.js # yarn.lock
- Loading branch information
Showing
294 changed files
with
5,114 additions
and
3,532 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
.git | ||
website | ||
assets | ||
private | ||
e2e | ||
.env |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
## Uppy development | ||
## Contributing to Uppy | ||
|
||
Fork the repository into your own account first. See the [GitHub Help](https://help.github.com/articles/fork-a-repo/) article for instructions. | ||
|
||
|
@@ -9,66 +9,46 @@ git clone https://github.com/transloadit/uppy.git | |
cd uppy | ||
``` | ||
|
||
We are using [Corepack][] to manage version of [Yarn][]. Corepack comes pre-installed with Node.js >=16.x, or can be installed through `npm`. You can run `corepack enable` to install a `yarn` executable in your `$PATH`, or prefix all yarn commands with `corepack yarn`. | ||
We are using [Corepack][] to manage versions of [Yarn][]. | ||
Corepack comes pre-installed with Node.js >=16.x, or can be installed through `npm`: | ||
|
||
```sh | ||
corepack -v || npm i -g corepack | ||
yarn -v || corepack enable | ||
yarn install || corepack yarn install | ||
corepack enable | ||
``` | ||
|
||
[Corepack]: https://nodejs.org/api/corepack.html | ||
|
||
[Yarn]: https://yarnpkg.com/ | ||
|
||
Our website’s examples section is also our playground, please read the [Local Previews](#Local-previews) section to get up and running. | ||
|
||
### Requiring files | ||
|
||
* If we are `require()`ing a file from the same subpackage, we can freely use relative imports as long as the required file is under the `src` directory (for example to import `@uppy/dashboard/src/utils/hi.js` from `@uppy/dashboard/src/index.js`, use `require('./utils/hi.js')`). | ||
* But if we want to `require()` some file from another subpackage - we should use global @uppy requires, and they should always be in the form of `@uppy/:packageName/(lib instead of src)/(same path).js` | ||
|
||
## Tests | ||
|
||
### Unit tests | ||
## Development | ||
|
||
Unit tests are using Jest and can be run with: | ||
First of all, install Uppy dependencies: | ||
|
||
```bash | ||
yarn run test:unit | ||
yarn install | ||
``` | ||
|
||
### End-to-End tests | ||
|
||
We use [Cypress](https://www.cypress.io/) for our e2e test suite. Be sure to checkout “[Writing your first test](https://docs.cypress.io/guides/getting-started/writing-your-first-test#Add-a-test-file)” and the “[Introduction to Cypress](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Cypress-Can-Be-Simple-Sometimes)”. You should also be aware of the “[Best Practices](https://docs.cypress.io/guides/references/best-practices)”. | ||
|
||
To get started make sure you have your `.env` set up. Copy the contents of `.env.example` to a file named `.env` and add the values relevant for the test(s) you are trying to run. | ||
|
||
To start the testing suite run: | ||
|
||
yarn e2e | ||
|
||
This will run Cypress in watch-mode, and it will pick up and rebuild any changes to JS files. If you need to change other files (like CSS for example), you need to run the respective `yarn build:*` scripts. | ||
|
||
Alternatively the following command is the same as the above, except it doesn’t run `build` first: | ||
|
||
yarn e2e:skip-build | ||
### Basic | ||
|
||
To generate the boilerplate for a new test run: | ||
To run a basic development version of Uppy, run: | ||
|
||
yarn e2e:generate | ||
```bash | ||
yarn dev | ||
``` | ||
|
||
## Development | ||
and go to http://localhost:5174 (or whatever link the yarn command outputted). | ||
As you edit Uppy code, the browser will live reload the changes. | ||
|
||
### Companion | ||
|
||
To start the Companion server along with Uppy, run: | ||
If you’d like to work on features that the basic development version of Uppy doesn’t support, such as Uppy integrations with Instagram/Google Drive/Facebook etc., you need to set up your `.env` file (copy the contents of `.env.example` and adjust them based on what you need to work on), and run: | ||
|
||
```bash | ||
yarn run dev:with-companion | ||
``` | ||
|
||
or if you only want to run Companion | ||
Or, if you only want to run the Companion server: | ||
|
||
```bash | ||
yarn run start:companion | ||
|
@@ -138,28 +118,50 @@ Tester invites -> Accept | |
|
||
Now you should be able to test the Instagram integration. | ||
|
||
## Zoom | ||
|
||
See above Instagram instructions for setting up a tunnel, but replace `instagram` with `zoom` in the URL. Note that **you also have to add the OAuth redirect URL to `OAuth allow list`** in the Zoom Oauth app settings or it will not work. | ||
### Requiring files | ||
|
||
Add the following scopes: `recording:read`, `user:read`, `user_info:read` | ||
* If we are `require()`ing a file from the same subpackage, we can freely use relative imports as long as the required file is under the `src` directory (for example to import `@uppy/dashboard/src/utils/hi.js` from `@uppy/dashboard/src/index.js`, use `require('./utils/hi.js')`). | ||
* But if we want to `require()` some file from another subpackage - we should use global @uppy requires, and they should always be in the form of `@uppy/:packageName/(lib instead of src)/(same path).js` | ||
|
||
To test recording a meeting, you need to sign up for a Zoom Pro trial (can be cancelled later), for example using their iOS app. | ||
## Tests | ||
|
||
## Releases | ||
### Unit tests | ||
|
||
Before doing a release, check that the examples on the website work: | ||
Unit tests are using Jest and can be run with: | ||
|
||
```bash | ||
yarn start | ||
open http://localhost:4000/examples/dashboard | ||
yarn test:unit | ||
``` | ||
|
||
Also check the other examples: | ||
### End-to-End tests | ||
|
||
```bash | ||
yarn workspace <example-name> start | ||
``` | ||
We use [Cypress](https://www.cypress.io/) for our e2e test suite. Be sure to checkout “[Writing your first test](https://docs.cypress.io/guides/getting-started/writing-your-first-test#Add-a-test-file)” and the “[Introduction to Cypress](https://docs.cypress.io/guides/core-concepts/introduction-to-cypress#Cypress-Can-Be-Simple-Sometimes)”. You should also be aware of the “[Best Practices](https://docs.cypress.io/guides/references/best-practices)”. | ||
|
||
To get started make sure you have your `.env` set up. Copy the contents of `.env.example` to a file named `.env` and add the values relevant for the test(s) you are trying to run. | ||
|
||
To start the testing suite run: | ||
|
||
yarn e2e | ||
|
||
This will run Cypress in watch-mode, and it will pick up and rebuild any changes to JS files. If you need to change other files (like CSS for example), you need to run the respective `yarn build:*` scripts. | ||
|
||
Alternatively the following command is the same as the above, except it doesn’t run `build` first: | ||
|
||
yarn e2e:skip-build | ||
|
||
To generate the boilerplate for a new test run: | ||
|
||
yarn e2e:generate | ||
|
||
## Zoom | ||
|
||
See above Instagram instructions for setting up a tunnel, but replace `instagram` with `zoom` in the URL. Note that **you also have to add the OAuth redirect URL to `OAuth allow list`** in the Zoom Oauth app settings or it will not work. | ||
|
||
Add the following scopes: `recording:read`, `user:read`, `user_info:read` | ||
|
||
To test recording a meeting, you need to sign up for a Zoom Pro trial (can be cancelled later), for example using their iOS app. | ||
|
||
## Releases | ||
|
||
Releases are managed by GitHub Actions, here’s an overview of the process to release a new Uppy version: | ||
|
||
|
@@ -176,30 +178,72 @@ 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: | ||
|
||
## Website development | ||
### Releasing hotfix patch | ||
|
||
We keep the [uppy.io](http://uppy.io) website in `./website` to keep docs and code in sync as we are still iterating at high velocity. | ||
#### Companion hotfix | ||
|
||
The site is built with [Hexo](http://hexo.io/), and Travis automatically deploys this onto GitHub Pages (it overwrites the `gh-pages` branch with Hexo’s build at every change to `main`). The content is written in Markdown and located in `./website/src`. Feel free to fork & hack! | ||
First checkout the tag of the version you want to patch: | ||
|
||
Even though bundled in this repo, the website is regarded as a separate project. As such, it has its own `package.json` and we aim to keep the surface where the two projects interface as small as possible. `./website/update.js` is called during website builds to inject the Uppy knowledge into the site. | ||
```bash | ||
git checkout @uppy/[email protected] | ||
``` | ||
|
||
### Local previews | ||
Now create a branch for your hotfix: | ||
|
||
1. `yarn install` | ||
2. `yarn start` | ||
3. Go to http://localhost:4000. Your changes in `/website` and `/packages/@uppy` will be watched, your browser will refresh as files change. | ||
```bash | ||
git checkout -b x.y.z-hotfix | ||
``` | ||
|
||
Then, to work on, for instance, the XHRUpload example, you would edit the following files: | ||
Run yarn to make sure all packages are consistent: | ||
|
||
```bash | ||
${EDITOR} packages/@uppy/core/src/index.js \ | ||
packages/@uppy/core/src/Plugin.js \ | ||
packages/@uppy/xhr-upload/src/index.js \ | ||
website/src/examples/xhrupload/app.es6 | ||
corepack yarn | ||
``` | ||
|
||
And open <http://localhost:4000/examples/xhrupload/> in your web browser. | ||
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 earlier 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 like 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 | ||
|
||
|
@@ -378,7 +422,7 @@ order: 0 | |
category: "Other Integrations" | ||
``` | ||
|
||
This data is used to generate Uppy’s website. Refer to [the section about running the website locally](#website-previews) if you’d like to see how the docs look on the website. | ||
This data is used to generate Uppy’s website. | ||
|
||
Any change of the documentation that involves a security best practice must substantiated with an external reference. See [#3565](https://github.com/transloadit/uppy/issues/3565). | ||
|
||
|
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
Oops, something went wrong.