npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@valantic/spartacus-mock

v4.0.2

Published

This project offers you the possibility to mock the OCC Endpoints of your Composable Storefront (Spartacus). It uses the Mock Service Worker to mock the API calls.

Downloads

416

Readme

spartacus-mock

This project offers you the possibility, to mock the API (OCC) Endpoints of your Composable-Storefront (Spartacus). It uses the Mock Service Worker (MSW) library to mock the API calls.

Getting started

You want to get started quickly? Follow the steps of the Getting Started section.

Versions

This project is tested to work with the listed angular versions and the listed Spartacus Versions in this table.

| Angular | Spartacus | msw | spartacus-mock | | ---------------- | :-------: | :-: | :------------: | | >=15.0.0 <16.0.0 | 6.x.x | 2.x | 3.x | | >=15.0.0 <16.0.0 | 6.x.x | 1.x | 2.x | | >=14.0.0 <15.0.0 | 5.x.x | 1.x | 1.x |

It is possible that it works with other versions, but not tested.

Motivation

When building Frontend application for SAP Commerce (former hybris), it was always a little bit annoying, as the frontend engineers needed to run hybris on their local machines. Additionally, one needed to wait until new features where built by the backend to be able to build the frontend for it.

In the new world of composable storefront (former spartacus), it already got easier as it is now possible to use a remote environment as backend. The problem of features not being ready yet or not being deployed to the remote environment still exists.

Spartacus-mock tries to solve both problems since you don't need to wait anymore, until

  • "...that dev system is ready"
  • "...that feature has been merged & deployed by the backend"
  • "...that page / component has been added in Smartedit by the backend"

It comes with the mock-data for the standard electronics store.

You can then define your own custom mock-data tailored to your custom spartacus project. Adding new pages and components in no time helps you, developing your actual feature, without waiting until the Backend has finished or the hassle of running a local hybris ;-).

Feature Scope

Spartacus-Mock currently offers mock-data for the following spartacus features / pages for the default electronics store:

  • Home Page
  • Content Page
  • Product Categories
  • Product Search
  • Product Detail
  • Cart
  • Checkout
  • My Account (except Order Returns)

See Roadmap for more information about the planned features.

For more information about the underlying Mock Service Worker tool, see the MSW documentation.

Developer Documentation

The developer documentation including api reference & examples can be found here.

GitHub issues

If you encounter a problem with this library or if you have a new feature you'd like to see in this project, please create a new issue.

Contribution Guidelines

The contribution guidelines can be found here.