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

sn-react

v1.0.2

Published

CLI tool for creating and deploying React applications for ServiceNow.

Downloads

5

Readme

ServiceNow React CLI

WARNING This package is in Early Development. There is NO working functionality yet. The README below represents the desired outcome of working on this package.

The ServiceNow React CLI is meant to bring seamless create-react-app-like experience to creating and deploying React applications for ServiceNow.

The CLI will provide the functionality to:

  • Create a new React application with CRA boilerplate and connect it to ServiceNow
  • Build a custom React application bundle
  • Automatically deploy the custom bundle on ServiceNow

Nо pre-configuration on ServiceNow side required.

User workflow

Create App

  1. Install the CLI npm package
npm install sn-react
  1. Create a boilerplate application
sn-react create my-app

The user will be prompted to enter their ServiceNow instance url, username and password.

  1. Start developing ;)

NOTE: The app is preconfigured to proxy all requests to the provided instance.

Deploy App

When you are ready to deploy the application to ServiceNow, just run sn-react deploy in your terminal, and see the latest version of your app running in ServiceNow.

Under the hood

  • The CLI will run on Node.js.
  • All communication with ServiceNow instance will happen via Table API and Attachments API.
  • Necessary instance information and all app configuration will be stored locally in the project root .json file.
  • Credentials will be stored in OS-specific password vault

Create App

On sn-react create MyApp:

  1. Ask for ServiceNow instance name and credentials (e.g. using npm inquire)
  2. Create a scoped application in ServiceNow named MyApp via Table API
  3. Run create-react-app MyApp
  4. Create a .json configuration file with instance url
  5. Save credentials to the OS-specific password vault via node-keytar
  6. Set up proxy for the provided instance url

Deploy App

On sn-react deploy:

For the first deploy:

  1. Set up Scripted REST API via multiple Table API requests and save sys_id's of resource records
  2. Run create-react-app native build
  3. Run sn-build.js to create a custom build folder
  4. Upload static files to the matching Scripted REST API records

For ordinary deploy:

  1. Run create-react-app native build
  2. Run sn-build.js to create a custom build folder
  3. Remove all old attachments from SN resources (maybe use ServiceNow script include for handy SN attachment class methods?)
  4. Upload static files to the matching Scripted REST API records