@ordergroove/smi-serve

1.8.3 • Public • Published

@ordergroove/smi-serve

smi-serve is a CLI tool to scaffold and run a local dev environment for Ordergroove's Subscription Manager templates.

Installation

Before using smi-serve, ensure you have Node.js installed on your system. If not, you can download and install it from nodejs.org. The smi-serve tool requires Node 18 or later.

Getting started

To initialize the current directory for local Subscription Manager development, run npx @ordergroove/smi-serve init. This will authenticate you with Ordergroove, retrieve your current Subscription Manager assets, and start a dev server.

After initialization, you can restart the dev server with npx @ordergroove/smi-serve.

When you are ready to push your changes to production, run npx @ordergroove/smi-serve deploy to deploy your changes to Ordergroove.

Configuration file

This tool generates a .ogrc.json file to store authentication information. This file should not be committed to source control.

Command reference

You can run each command with npx @ordergroove/smi-serve [command], e.g. npx @ordergroove/smi-serve init.

To see all available commands and flags, run npx @ordergroove/smi-serve --help. For documentation specific to individual commands, run npx @ordergroove/smi-serve [command] --help.

init

Initializes the current directory with the assets from your live Subscription Manager theme and starts a dev server. This only needs to be run when you need to retrieve the latest assets from Ordergroove; otherwise you can start the dev server directly with npx @ordergroove/smi-serve serve.

serve

Starts a development server. This is the default command, so it can also be run by entering npx @ordergroove/smi-serve.

By default it will choose a random available port, but you can customize this with the --port flag.

deploy

Publishes your template changes to your live Subscription Manager theme. Before publishing, it will summarize which files have changed and ask for confirmation.

select-merchant

If you have access to multiple merchants, this lets you select a new merchant to be used by the other commands. This can be useful if you manage multiple merchant accounts.

FAQs

How do I run commands against Ordergroove's staging environment?

You can use the flag --env staging to make requests against Ordergroove's staging environment. For example, run npx @ordergroove/smi-serve init --env staging to initialize with assets from staging.

Keep in mind that if you use this flag, every command you run must also include it.

How do I integrate with source control?

Once you run the init command, you can initialize the folder as a Git repository with git init and push to the source control provider of your choice. When you are ready to deploy the changes, run npx @ordergroove/smi-serve deploy.

Make sure to commit the autogenerated .gitignore, which prevents you from committing the .ogrc.json file to source control. The ogrc file contains authentication tokens and should not be committed.

How do I merge in updates that have been made via the Subscription Manager editor in RC3?

Ordergroove regularly makes updates to its Subscription Manager templates to fix bugs and add new features. To compare the latest changes with your current template files, first initialize the repo with a source control provider like Git and commit your current template files. You can then re-run the init command with the -f flag to overwrite your files with the latest Subscription Manager template. Use Git's diff tools to compare what has changed and add back any customizations as necessary.

Limitations

  • Windows is not fully supported, though most functionality should work.
  • smi-serve only reads and writes from your currently published Subscription Manager theme. Draft themes are not currently supported.
  • SSO users and My Organization admins are not currently supported.

Readme

Keywords

none

Package Sidebar

Install

npm i @ordergroove/smi-serve

Weekly Downloads

353

Version

1.8.3

License

ISC

Unpacked Size

57.8 kB

Total Files

20

Last publish

Collaborators

  • sopiejohnson
  • spossonog
  • kimw_ordergroove
  • nalhassaog
  • gabriel.tursi
  • oandrevictor
  • geoffrich
  • og-hugo-fusinato
  • oj
  • ericbreno
  • claranelson
  • gugaog
  • brandonrichog
  • swieckowski
  • ogdevs
  • og-jenkins
  • lisandroec
  • bestnewkevin
  • ap604
  • brian-lewis-5
  • eugenio63
  • evasilchenko
  • ezequiel.gomez
  • farooqhaider
  • federc88
  • juannyg
  • nicolasmoise
  • pola68
  • rusoftware
  • remitaffin
  • agustinog
  • eloycolella
  • manuelog
  • lindyordergroove
  • stephenwidom
  • jchiocchio
  • npnkenacc
  • willycamargo