Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme.md #21

Open
wants to merge 1 commit into
base: jedi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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