This repo is part of Git Integration & Wix CLI, a set of tools that allows you to write, test, and publish code for your Wix site locally on your computer.
Connect your site to GitHub, develop in your favorite IDE, test your code in real time, and publish your site from the command line.
This repo is connected to a Wix site. That site tracks this repo's default branch. Any code committed and pushed to that branch from your local IDE appears on the site.
Before getting started, make sure you have the following things installed:
- Git
- Node, version 22 (run
nvm use
to load the version in.nvmrc
). - npm or yarn
- An SSH key added to your GitHub account.
To set up your local environment and start coding locally, do the following:
- Open your terminal and navigate to where you want to store the repo.
- Clone the repo by running
git clone <your-repository-url>
. - Navigate to the repo's directory by running
cd <directory-name>
. - Install the repo's dependencies by running
npm install
oryarn install
. - Install the Wix CLI by running
npm install -g @wix/cli
oryarn global add @wix/cli
.
Once you've installed the CLI globally, you can use it with any Wix site's repo.
For more information, see Setting up Git Integration & Wix CLI.
Once your repo is set up, you can write code in it as you would in any other non-Wix project. The repo's file structure matches the public, backend, and page code sections in Editor X.
Learn more about this repo's file structure.
The Local Editor allows you test changes made to your site in real time. The code in your local IDE is synced with the Local Editor, so you can test your changes before committing them to your repo. You can also change the site design in the Local Editor and sync it with your IDE.
Start the Local Editor by navigating to this repo's directory in your terminal and running wix dev
.
For more information, see Working with the Local Editor.
The Wix CLI lets you preview and publish the site from the command line. Run wix preview
to generate a preview link locally. Use wix publish
to publish once your changes pass the CI gate. You can also use the CLI to install approved npm packages to your site.
npm run lint
runs ESLint with zero warnings allowed.npm run format
formats files with Prettier.npm run prettier:check
verifies formatting without writing changes.
Learn more about working with the Wix CLI.
This repo includes a GitHub Actions workflow that installs the Wix CLI and builds a preview of your site whenever code is pushed to the main
branch. To enable it, add a WIX_CLI_TOKEN
secret in your repository settings so the workflow can authenticate with your Wix site.
The preview URL is posted on each pull request. A follow-up workflow checks Lighthouse performance and accessibility scores and optimizes images. Publishing to production requires approving the Publish
workflow once these checks pass.
Run npx squoosh-cli <file>
on any images inside src/public
to manually compress them. The CI workflow will attempt the same optimisation and commit changes when the total size is reduced by more than 5%.
Git Integration & Wix CLI extends Editor X's concurrent editing capabilities. Invite other developers as collaborators on your site and your GitHub repo. Multiple developers can work on a site's code at once.
Run wix preview
to generate a shareable link for the current branch. The Preview workflow posts this link on each pull request after running npm audit
.
Pull requests must pass linting and formatting checks. The Quality Gate workflow runs Lighthouse and axe-core to enforce performance and accessibility scores above 90 and compresses images automatically. Production deploys require approving the Publish workflow once these checks succeed. An asset-size workflow guards JS and CSS bundle growth while CodeQL checks for high severity vulnerabilities on each pull request.
See SECURITY.md for how to report vulnerabilities.