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

sgmf-scripts

v3.0.0

Published

Scripts for sgmf overlay cartridges

Downloads

67,706

Readme

SGMF Scripts

This repository contains a collection of scrips that are useful for creating Storefront Reference Architecture overlay cartridges. All of the scripts are executable through CLI.

New in v3.0.0

  • Support for Node 18
  • Webpack updated to v5+
  • Renamed master branch to main

Available commands

--help - Generate help message

--upload [path::String] - Upload a file to a sandbox. Requires dw.json file at the root directory.

--uploadCartridge [String] - Upload a cartridge. Requires dw.json file at the root directory.

--test [path::String] - Run unittests on specified files/directories.

--integration [path::String] - Run overlay integration tests on specified files/directories.

--cover [--include **/cartridges/**/*.js] [--exclude **/bin/**,**/cartridges/**] - Run all unittests with coverage report. The include and exclude parameter is meant to limit coverage reporting to the requested paths.

--compile String - Compile css/js files. - either: css or js

--lint String - Lint scss/js files. - either: js or css

--createCartridge String - Create new cartridge structure

--watch - Watch and upload files

Installation and usage

You can install this module from NPM command:

npm install sgmf-scripts --save-dev
npm run test:integration https://hostname/on/demandware.store/Sites-RefArch-Site/en_US
 {
            "type": "node",
            "request": "launch",
            "name": "Mocha overlay Integration Tests",
            "program": "${workspaceFolder}/../sgmf-scripts/index.js",
            "args": [
                "--integration",
                "test/integration/**/*.js",
                "--baseUrl",
                "https://hostname/on/demandware.store/Sites-RefArch-Site/en_US",  
            ],
            "cwd": "${workspaceFolder}",
            "internalConsoleOptions": "openOnSessionStart"
        }
}
1. From sgmf-scripts repo root directory
npm link
2. From plugin cartridge root directory
npm link sgmf-scripts
you will see something like this to indicate the link has created : 
/Users/xxx/Salesforce/plugin_giftregistry/node_modules/sgmf-scripts -> /usr/local/lib/node_modules/sgmf-scripts -> /Users/xxx/Salesforce/sgmf-scripts
3. To remove the link, just delete the node_modules directory and run npm install again

In order for all commands to work, this script makes a few assumptions:

  • There's a dw.json file at the root of your repository, that contains information with the path to your sandbox, as well as username and password
  • There's a cartridges top level folder that contains your cartridge
  • name property in package.json matches the name of your cartridge, or if it doesn't, there's a packageName property with the name of the cartridge
  • If this an overlay cartridge, package.json contains paths property, that's of type Array and contains key/value pairs with name/path to all cartridges that will come below yours. For example, if you are creating a cartridge that will be overlayed on top of app_storefront_base paths property will look something like this: [{ "base": "../sfra/cartridges/app_storefront_base"}]
  • ESLint and Stylelint are dev-dependencies of your cartridge. You have all required plugins and configs installed as well.
  • There's a webpack.config.js at the top of your project that specifies how to compile client-side JavaScript files.
  • Your package.json file contains browserslist key that specifies which browsers you are targeting, to compile SCSS files with correct prefixes. See https://github.com/ai/browserslist for more details