SDK for building Saleor Apps.
Supports Saleor version 3.20+
- The
mainbranch is a current, latest branch. - Branches matching
v[0-9]+.x(likev1.x, v0.x`) are release branches - PRs should be opened to
mainbranch and contain changesets (runnpx changeset). Once changeset is merged to main, the release PR is opened. After the release PR is merged, the version is being pushed to NPM and changesets are pruned - To patch older version, commit from
main(including changeset) should be also ported to release branch (e.g. v0.x). Release branch will also detect changes and open release PR - To release new major version (e.g. start working on
v2.xfromv1.x):- Create a legacy release branch (e.g.
v1.xbranch) - Mark changeset to
mainwithmajorchange, which will start counting nextmainreleases as2.x.x - Do not merge release PR until it's ready to be merged
- Create a legacy release branch (e.g.
PRs can be pushed to NPM by adding label to PR release dev tag. Workflow will run and print version that has been released.
npm i @saleor/app-sdkYou can find the documentation here.
If you would like to develop the SDK and test it with existing project:
- In the Saleor App SDK directory run command
pnpm watchNow any code change will trigger build operation automatically.
- In your project directory:
pnpm add ../saleor-app-sdk/distAs path to your local copy of the App SDK may be different, adjust it accordingly.
Before committing the code, Git pre-hooks will check staged changes for following the code styles. If you would like to format the code by yourself, run the command:
pnpm lintTo run the integration tests (e.g., Redis APL tests), follow these steps:
- Start a Redis container:
docker run --name saleor-app-sdk-redis -p 6379:6379 -d redis:7-alpine- Run the integration tests:
pnpm test:integration- (Optional) Clean up the Redis container:
docker stop saleor-app-sdk-redis
docker rm saleor-app-sdk-redisNote: If your Redis instance is running on a different host or port, you can set the REDIS_URL environment variable:
REDIS_URL=redis://custom-host:6379 pnpm test:integration