Start creating a Shoptet Visual Addon in a minute
Introduction
This repository contains a CLI wizard that scaffolds a Shoptet Visual Addon project, so you can start building visual addons and deploy them with a minimum of additional setup.
Prerequisites
Before you can use create-visual-addon-boilerplate, you must have the following software installed on your system:
- Node.js 24.15+ or 26+ (Node 25 is not supported) — you can download it from the official Node.js website: https://nodejs.org/
- A package manager of your choice — npm (bundled with Node.js), Yarn, or pnpm are all supported by the Addon Repository build pipeline.
Usage
To create a new Visual Addon project, run the following command:
npx shoptet/create-visual-addon-boilerplate
This launches a wizard that guides you through creating a new project. The wizard asks for:
- Addon name — used as the project folder and package name (lowercase letters, numbers, underscores, and hyphens, starting with a letter or a number).
- Addon description
- Folders to initialize —
header,footer, andorderFinale; they correspond to the three code fields in the Shoptet administration. - Example files — pre-fills the selected folders with an example script and stylesheet (asked only when you selected some folders).
- Shoptet Bender — adds Shoptet Bender for local development against a live e-shop (you will be asked for the e-shop URL).
- Build process — adds a webpack build pipeline (see Build below).
- Stylesheet format — CSS, LESS, or SCSS; example files follow the chosen format, and when you also choose the build process, only the matching preprocessor is installed (asked when you chose example files or the build process).
Once the wizard is complete, install the dependencies with your preferred package manager:
cd <addon-name>
npm install
Commit the generated lockfile (package-lock.json, yarn.lock, or pnpm-lock.yaml) — the Addon Repository deploy
workflow detects your package manager from it and requires it for reproducible builds. You can also pin the manager
explicitly via the packageManager field in package.json.
Project structure
my-addon/
├─ src/
│ ├─ header/ # deployed to the "header" field in the administration
│ ├─ footer/ # deployed to the "footer" field
│ └─ orderFinale/ # deployed to the "order finale" field
├─ assets/ # optional static files (fonts, images), deployed as-is
├─ config.json # Shoptet Bender configuration
├─ webpack.config.js # created when you choose the build process
└─ package.json
To fully integrate with the Addon Repository deployment, you cannot change the boilerplate folder structure.
Development
If you chose Shoptet Bender, start the development server with:
npm run dev
Bender proxies the remote e-shop to http://localhost:3010 and injects your local scripts and styles into it, so you
can develop against a live e-shop without touching production.
Build
If you chose the build process, two scripts are available:
npm run build— production build: bundles, minifies, and obfuscates your code intodist/, producing the exact artifacts the Addon Repository deploys (scripts.<folder>.min.js,styles.<folder>.min.css).npm run build:dev— development build of the same bundles without minification and obfuscation.
HTML files placed in the src folders are concatenated in alphabetical order into dist/markups.<folder>.html and
deployed to the corresponding markup field. The assets/ folder is copied to dist/assets/ as-is.
Note that your code is bundled exactly as written — there is no transpilation or polyfilling, so mind the browser support of the JavaScript and CSS features you use.
The Addon Repository deploy workflow runs the build script with --env production using your detected package
manager and uploads the contents of dist/, so a local production build gives you exactly what will be deployed.
From project to approved addon
With the Addon Repository, Shoptet reviews and deploys the code of visual addons from GitHub: your code lives in your own repository, you work in a branch, and Shoptet reviews it in a pull request before it reaches the main branch.
The Addon Repository is in beta. To try it, contact husa@shoptet.cz.
Once the project is generated, the path to an approved addon looks like this:
- Create a GitHub repository for the addon — one repository per addon. Commit the generated project, including the lockfile, and push it to the main branch.
- Connect the repository to the addon — the Addon Repository has to be enabled on your Partner e-shop (see the beta note above). Then enter the repository URL in the Url of the GitHub repository field in the Codes tab of the addon detail in the administration.
- Install the Shoptet Addon Repository GitHub app on the
repository. It adds the deploy workflow (
.github/workflows/shoptetAddon.workflow.yml) and invites the Shoptet reviewer to the repository as a collaborator. Do not edit the workflow file — changes to it are flagged in review. - Create your own branch (for example
dev) and do all the work there. Leave the main branch alone: Shoptet merges into it once the addon is approved. - Deploy your branch and test it — in the Actions tab, run Deploy current version and select your branch. When the run turns green, the code is on the CDN and in the addon, so you can test the addon on a real e-shop before anyone approves it.
- Open a pull request from your branch to the main branch and do not merge it. Open it yourself: the Shoptet reviewer can only review a pull request someone else opened.
- Hand it over to Shoptet — the addon first goes through user testing with the Shoptet addon team, then through code review. The reviewer merges the pull request and deploys the main branch.
Later changes follow the same loop: a new branch, a pull request, a review. A small fix that does not change how the
addon behaves can go straight to the main branch as a hotfix, with the commit message prefixed Hotfix: . See
Recommended flows for all three cases.
Contributing
If you find any issues or have any suggestions for improving this project, feel free to open an issue or submit a pull request.