We're glad you want to contribute!
You can use the command yarn watch to test the VTEX Toolbelt locally. It creates a symlink named vtex-test, with which you can test your code as you develop.
To be able to use it you'll have to add $HOME/.vtex/dev/bin to your PATH environment variable. This may differ across different OSs, but follow this steps:
- Open the
~/.bashrcfile (or the correponding shell configuration file). - On the end of the file, add the line:
export PATH=$PATH:$HOME/.vtex/dev/bin. - Save it.
- Run the command
source ~/.bashrc(or corresponding file).
That's it! Now you're able to run yarn watch and, on another terminal session, use the command vtex-test as an alias to what you're developing.
You can build the binaries and test it locally. You can run the commands:
yarn build && yarn oclif-dev pack
A folder named dist will be created with all the binaries for different OS. The command below enable to use the binaries for MacOS:
tar -xzf /Users/fila/Code/vtex/toolbelt/dist/vtex-v4.3.0/vtex-v4.3.0-darwin-x64.tar.gz -C ~/.local/vtex # or copy it to any other folder you want
Now, you can use the binaries in a VTEX IO App as:
~/.local/vtex/vtex/bin/vtex --version # or any other command
You can simulate a global installation for npm or yarn with your local changes. To do so, follow the following steps:
- Make sure you don't have
vtexin your environment. Runningwhich vtexshould returnvtex not found. You can also uninstall it with:
yarn global remove vtex
# or (depending on your installation)
npm -g un vtex
- Build the project locally and create a .tgz file:
yarn install
yarn build
npm pack
- Install it globally using your the consumer you want to test:
yarn global add file:$(pwd)/vtex-4.3.2-beta.15.tgz
# or
npm -g install ./vtex-4.3.2-beta.15.tgz
Don't forget to clean it up after testing it
The VTEX CLI uses Ocliff under the hood, making it very easy to add or improve commands. Follow this guide to learn how to develop on this project.
We adhere to a strict pull request review workflow. Please refrain from committing any "serious" changes directly to master. Small fixes are ok. ;)
- Create a branch from master. (e.g.
git checkout -b feature/super-awesome-thing) - Submit a Pull Request.
- Wait for comments from reviewers, discuss and fix any issues.
- Wait for a 馃専 LGTM 馃専.
- Merge to master, delete your branch and release to npm.
Please do not leave any unpublished code in master!