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

@bloomreach/brx-spartacus-library

v3.0.1

Published

Bloomreach Spartacus Integration Library

Downloads

541

Readme

Bloomreach Spartacus Library

The Bloomreach Spartacus Library enables Bloomreach Content and Discovery capabilities with Spartacus. The Bloomreach Spartacus Library interacts with the following:

Installation

Before installing, make sure you have met the following requirements:

  • Angular 14
  • Spartacus 5
  • @bloomreach/spa-sdk 22 or later
  • @bloomreach/ng-sdk 22 or later

It's assumed that you already have working app with @bloomreach/spa-sdk, @bloomreach/ng-sdk and Spartacus installed. If you haven't set up Bloomreach SPA SDK in your app yet, please follow the instructions provided here. To set up Spartacus 5, you can refer to this guide.

For installing the brx-spartacus-library run following command

npm install @bloomreach/brx-spartacus-library 

Be aware! For Spartacus to track router events, it's important to use <router-outlet></router-outlet> in the App.tsx file. Routes that include parameters in Spartacus configuration should be copied to Routing module in Angular. Here is an example:

Spartacus configuration in spartacus-configuration.module.ts.

ConfigModule.withConfig({
  routing: {
    routes: {
        product: { paths: ['product/:productCode'] },
        category: { paths: ['category/:categoryCode', 'category'] },
        search: { paths: ['search/:query', 'search'] },
        login: { paths: ['sign-in'] },
        forgotPassword: { paths: ['forgot-password'] },
        resetPassword: { paths: ['sign-in/pw/change'] },
        register: { paths: ['register'] },
    },
  },
}),

Routes product/:productCode, search/:query, and category/:categoryCode contain parameters should be copied to Routing module. Product details route should have canActivate: [CmsPageGuard] as it shown below:

const routes: Routes = [
  { path: 'search/:query', component: BrxComponent },
  { path: 'product/:productCode', canActivate: [CmsPageGuard], component: BrxComponent },
  { path: 'category/:categoryCode', component: BrxComponent },
  { path: '**', component: BrxComponent },
];

In BrPage.tsx, add Spartacus components from the brx-spartacus-library to mapping as following:

  import {
    BannerComponent,
    SpartacusBannerComponent,
    SpartacusLoginFormComponent,
    ...
  } from '@bloomreach/brx-spartacus-library';
  
  mapping = {
    Banner: BannerComponent,
    SpartacusBanner: SpartacusBannerComponent,
    SpartacusLogin: SpartacusLoginFormComponent,
    ...
  }

See brx-spartacus-storefront as reference here.

Components present in integration

  • Category highlight
  • Pathways & Recommendations
  • Spartacus banner
  • Spartacus paragraph
  • Spartacus product carousel
  • Spartacus product details
  • Spartacus product list
  • Banner
  • Spartacus breadcrumb
  • Spartacus cart coupon
  • Spartacus cart details
  • Spartacus cart quick order form
  • Spartacus cart totals
  • Spartacus checkout order summary
  • Spartacus checkout progress
  • Spartacus checkout progress mobile bottom
  • Spartacus checkout progress mobile top
  • Spartacus checkout review order
  • Spartacus delivery mode
  • Spartacus forget password
  • Spartacus login
  • Spartacus login register
  • Spartacus mini cart
  • Spartacus order confirmation items
  • Spartacus order confirmation totals
  • Spartacus order confirmation thank you message
  • Spartacus order detail shipping
  • Spartacus payment method
  • Spartacus place order
  • Spartacus product facet navigation
  • Spartacus register
  • Spartacus search box
  • Spartacus shipping address
  • Spartacus user greet
  • Spartacus wish list
  • User my account

Prerequisites

Your development environment should include the following:

  • Node.js: 16.x.x or later
  • NPM: version 8 or later

Install dependencies and build

In the root directory of your project run the following commands using NPM:

npm ci
npm run build

Releasing a new version

Releasing a new version follows the standard angular appraoch for releasing libraries.

  • Make sure the pipelines are green and the library is tested to work.
  • Use npm version to set a new version in the package.json
  • Run npm run build to create the package build in dist/
  • Inside dist/ run npm publish

Development

If developing this in tandem with the storefront we suggest to use yalc to publish from the dist/ folder to your local system and yalc link it in the storefront app.

License

Published under Apache 2.0 license.