Theme Kit is open source and we welcome your contributions to the project. The following steps illustrate the workflow for making a contribution:
- Open an issue to report a bug or request a feature.
- If the feature or bug is deemed valid, then fork the repo.
- Implement a patch to resolve the issue.
- Include tests to prevent regressions and validate the patch.
- Update the documentation for any API changes.
- Submit a pull request and mention maintainers. The current maintainers are @tanema and @chrisbutcher.
Although Theme Kit is a command line interface, it's also a library that can be used in Go application development. For more information, refer to the development documentation for Theme Kit.
- Go 1.12 or higher
- Golint
You can set up your development environment by running the following commands:
git clone [email protected]:Shopify/themekit.git # get the code
cd themekit # change into the themekit directory
make # build themekit, will install theme kit into $GOPATH/bin
theme version # should output the current themekit version
make
: Compiles themekit into yourGOPATH/bin
.make test
: Runs linting/vetting/testing to make sure your code meets high quality standards.make help
: Shows all of the commands available to you.
You can run the following command to get started and retrieve the themekit
library:
go get -u github.com/Shopify/themekit
Shopify uses Theme Kit in many of our Gulp processes. To interact with Theme Kit using Javascript, check out our node-themekit library.
If interfaces change, then you need to regenerate the mocks with Mockery.
To install Mockery, run the following command:
go get github.com/vektra/mockery/...
After Mockery is installed, cd
into the directory of the interface and run:
mockery --name=InterfaceName --output=_mocks
A mitmproxy (man in the middle proxy) is the easiest way to introspect the requests that themekit makes.
To use the proxy, complete the following steps:
- Run
brew install mitmproxy
. - Run
mitmproxy -p 5000 -w themekit_dump
. This will start it listening on port 5000 and write to the filethemekit_dump
. - In another console, in your project directory, run
theme deploy --proxy http://localhost:5000
. - After the
theme deploy
command executes, you can quitmitmproxy
by enteringq
and theny
.
Note: If you are troubleshooting an issue for a partner, then they must provide the
themekit_dump
log. The log can then be loaded intomitmproxy
for analysis.