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

2021ai-grace-app

v1.0.0

Published

Use this package to build your React app to work in Grace environment.

Downloads

162

Readme

Grace-app

Use this package to build your React app to work in Grace environment.

Usage

Install 2021ai-grace-app in your project:
yarn add 2021ai-grace-app

Make sure you have peer dependencies installed in your project:

"axios": "^1.4.0",  
"react": "^18.2.0"

Make sure to have src/App.jsx file, which exports a React component called App.

2021ai-grace-app serve to run app your app in development mode

2021ai-grace-app build to build your app to production

Grace app loads a config file in run-time. The config.json file is expected to be located in the parent directory relative to grace-app. Currently following properties are defined:

  • apiPath - the url pointing to client's application backend API

In your React app you can use:
useGraceContext - a hook that would return following object:

{
    config: {
        apiPath: string
    }
}

example:

  const { config } = useGraceContext();
  console.log(config.apiPath);

Webpack configuration

The library comes with some default webpack configs, which are used when serving or building the app with 2021ai-grace-app CLI commands. These configs provide basic support for react apps. If your project requires additional webpack configuration, all you need to do is to create files in the main project folder:

  • webpack.config.js for any shared config
  • webpack.dev.config.js for any config used by 2021ai-grace-app serve command
  • webpack.prod.config.js for any config used by 2021ai-grace-app build command

The serve command will take libraries webpack.dev.config.js, extend it with your webpack.config.js and then extend it with your webpack.dev.config.js

The build command will take libraries webpack.prod.config.js, extend it with your webpack.config.js and then extend it with your webpack.prod.config.js

For developers of Grace-app

This node package provides cli commands to enable Grace users to build their React apps. We wrap the provided app in our code as defined in src/index.js. The wrapping script can be found under scripts/wrap.js.

To start working with this project:

  • install node
  • install yarn
  • in workspace run yarn install
  • make you changes
  • make sure you have 2021AI auth token to npmjs
  • run yarn build and yarn npm publish. Remember to bump version in package.json.

In development, you can use local node registry like Verdaccio to publish this package. If you do, point to your local registry in .yarnrc.yml in workspace main path.

You can use my-app in this workspace (in the parent folder) to test grace-app as a dependency.