GitHub - searchspring/snap: Snap is Searchspring's latest front end integration SDK

Welcome to Snap - Searchspring's SDK for integrating into front end web apps. We invite your participation through issues, discussions and pull requests! Please reference Searchspring's Community Contribution Guidelines.

Note

This documentation is only applicable when using packages from @searchspring/snap-preact
If you are using Athos Commerce packages, see athoscommerce snap

Please reference the Snap Documentation to get started using Snap to build applications.

Packages

The Snap mono-repo publishes multiple packages to NPM's registry; packages are versioned together, and it is recommended to utilize packages of the same exact versioning.

Documentation for each package can be found in its respective README file (/packages/).

Prerequisite

Node.js

We recommend usage of Node.js v16 or higher.

NPM v7.x

NPM v7.x is required for its workspaces feature

NPM v7.7.0 is optional for executing scripts in workspaces

Commands

While at the repo root, the following commands are available:

Install dependencies

Build

Executes npm run build across all packages sequentially

Dev

Executes npm run dev across all packages sequentially. All packages will be linked with hot reloading

Demo store: https://localhost:2222

Docs

Serves the contents of the root directory to allow you to view the docs

Docs: http://localhost:1111/

Commit

Instead of using git commit, use npm run commit to utilize Commitizen

Storybook Components

Preact Components: http://localhost:6006

Tests (unit + headless E2E)

Cypress E2E Tests

Only applies to packages/snap-preact-demo

Clean

Removes all package and root node_modules directories and package-lock.json; additionally removes generated documentation and test coverage data.