From 87fe3a0d912d9b866390e0cc2f63afdd1d57dc0b Mon Sep 17 00:00:00 2001 From: Evgenia Karunus Date: Tue, 30 Apr 2019 10:47:36 +0300 Subject: [PATCH] CONTRIBUTING.MD - added info on how to require() files (#1508) --- .github/CONTRIBUTING.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index c751025b02..671a277c1d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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: