Skip to content

Commit

Permalink
CONTRIBUTING.MD - added info on how to require() files (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
lakesare authored and kvz committed Apr 30, 2019
1 parent 212ba41 commit 87fe3a0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ We use lerna to manage the many plugin packages Uppy has. You should always do `

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 (e.g. require `@uppy/dashboard/utils/hi.js` from `@uppy/dashboard/src/index.js`) - we can freely use relative imports, as long as the required file is under the `src` directory (`/:packageName/src/**/*.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 are using Jest and can be run with:
Expand Down

0 comments on commit 87fe3a0

Please sign in to comment.