# Contributing to Theme Tools ## This repository is a mirror Shopify develops Theme Tools in its monorepo. This repository is a public, read-only mirror of it: after each change merges there, a bot publishes it here as a pull request from the `world-mirror/main` branch and merges it once the checks pass. - **We don't accept pull requests here.** Only people with write access can open a pull request in this repository. We can't merge outside changes here, because the next update from the monorepo would replace them. - **Issues are open.** Report a bug or ask for a feature in [issues](https://github.com/Shopify/theme-tools/issues/new/choose). A clear issue with a small example is the best way to get a change made. - **When a fix for your issue ships,** the mirror's pull request says `Fixes #`, and GitHub closes your issue when that pull request merges. - **Releases** still publish from this repository's `main`, to the same places as before. ## Reporting issues 1. **Check for existing issues.** Search the open and closed issues first. 2. **Choose the right template.** Use the bug report or the feature request template. 3. **Write a clear title** that sums up the problem or the idea. 4. **Describe it in detail.** For a bug, give the Liquid or JSON that causes it, the steps to reproduce it, the error message, what you expected and what happened. Screenshots help. 5. **Include your environment:** the package or extension version, your operating system, your Node.js version, and your editor or browser if it matters. ## Building and testing locally You can still build and run everything here, for example to reproduce a bug or to try a fix before you describe it in an issue. 1. **Clone the repository**: Clone the theme-tools repository to your local machine by running the following command in your terminal: ```bash git clone https://github.com/Shopify/theme-tools.git ``` 2. **Install dependencies**: Navigate to the project directory and install the required dependencies by running: ```bash cd theme-tools pnpm install ``` 3. **Build monorepo packages**: Ensure that all packages build: ```bash pnpm build ``` 4. **Run tests**: Ensure that all tests pass by running `pnpm test` for TypeScript and `cargo test --workspace` for Rust: ```bash pnpm test cargo test --workspace ``` 5. **Start developing**: If you're developing changes to test against the VS Code extension, all you need to do is add a breakpoint anywhere in a package used within the VS Code extension, hit `F5` in VS Code and your development instance of the extension will automatically open. ### Developing for codemirror-language-client Run the following command to start a browser instance that runs `@shopify/theme-language-server-browser`. ```bash pnpm playground ``` ### Developing for VS Code for Web #### In Chrome Run the following command to start a `@vscode/test-web` instance in Chrome with the Shopify Liquid extension loaded. ```bash pnpm dev:web ``` #### In the desktop app Because the Chrome version doesn't have great debugging, you can also use the `Debug Web Extension` launch configuration to debug the extension. This starts an Extension Host window like the normal `F5` flow, but instead of running the node extension, it's running the browser extension. ### Testing JSON Schema changes on Shopify/theme-liquid-docs If ever you want to see how the VS Code extension or playground would behave before merging a PR to Shopify/theme-liquid-docs, you can do the following: 1. In a terminal, with VS Code closed, go to the Shopify/theme-liquid-docs directory. ```sh cd /path/to/theme-liquid-docs ``` 2. Export the root of that repository in the `SHOPIFY_TLD_ROOT` environment variable. ```sh export SHOPIFY_TLD_ROOT=$(pwd) ``` 3. Go to the Shopify/theme-tools directory. ```sh cd /path/to/theme-tools ``` 4. Update the docs and start VS Code from that directory. ```sh # update the docs theme-docs download # start vscode code . ``` 5. (Repeat) You can repeat the `theme-docs download` command to have updated changes. ```sh theme-docs download ``` 6. Proceed to debug the VS Code extension or playground as usual. ## Code of conduct Everyone who takes part in issues follows our [Code of Conduct](./CODE_OF_CONDUCT.md).