From 3fcf6756778155148460b809909299c469995804 Mon Sep 17 00:00:00 2001 From: retroboydev Date: Thu, 18 Aug 2022 12:42:52 +0200 Subject: [PATCH] update readme.md --- .gitignore | 12 ++++++++++++ README.md | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.gitignore b/.gitignore index a284d1362..235578b87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,15 @@ dist node_modules + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + .idea +.vscode diff --git a/README.md b/README.md index 5c0e0faad..1cfa90cdc 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,23 @@ Install dependencies ```sh yarn install ``` + +## Local testing + +There are two possible ways of local testing: by using the [yarn link](https://classic.yarnpkg.com/en/docs/cli/link) command or by manual transferring of built files + +### Testing by using the [yarn link](https://classic.yarnpkg.com/en/docs/cli/link) command +- run `yarn link` in the root directory of our module. You should see in the console command for using the linked module, e.g. `yarn link "@jediswap/sdk"` +- run `yarn start` in the root directory of our module, you should see the `dist` folder after that +- go to the project where we want to test our module, e.g. `jediswap-interface` +- run `yarn link "@jediswap/sdk"`, it will install our linked package +- if everything was done right, you would see a success message in the console, and a symlink to our local package will appear in `node_modules` +- after that we can start working with our local module, all changes should be updated automatically +- once we're done, we can run the `yarn unlink` command in our module and `yarn unlink "@jediswap/sdk" && yarn install --check-files` in the project where we tested our module + +### Testing with manual transferring of built files +This method is less convenient and requires a lot of manual operations +- run `yarn start` in the root directory of our module +- copy the contents of the `dist` folder to `node_modules/@jediswap/sdk/dist` of the project in which we want to test our module +- if you are using `vite` in a project, you should add the `--force` flag to the project launch command, for example, `vite --open --force` +- when you change your module, you should copy and past the contents of the `dist` folder again