Catalog npm
Back to packageRELEASE DETAILS

0.0.8

npm

2021ai-grace-app

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

Published11 Sept 2023
Direct dependencies22
Transitive dependenciesNot calculated

README

Current package documentation

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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 24

Native requirements
22 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
yargs
Environment
{
  "local_name": "yargs",
  "alias": false,
  "peer_metadata": null
}
^17.7.2runtime
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
7.13.15development
@babel/plugin-transform-runtime
Environment
{
  "local_name": "@babel/plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^7.13.15development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.13.15development
@babel/preset-react
Environment
{
  "local_name": "@babel/preset-react",
  "alias": false,
  "peer_metadata": null
}
7.13.13development
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
^7.13.10development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^18.2.14development
@webpack-cli/serve
Environment
{
  "local_name": "@webpack-cli/serve",
  "alias": false,
  "peer_metadata": null
}
^1.3.1development
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.4.0development
babel-loader
Environment
{
  "local_name": "babel-loader",
  "alias": false,
  "peer_metadata": null
}
8.2.2development
css-loader
Environment
{
  "local_name": "css-loader",
  "alias": false,
  "peer_metadata": null
}
^5.2.1development
html-webpack-plugin
Environment
{
  "local_name": "html-webpack-plugin",
  "alias": false,
  "peer_metadata": null
}
^5.5.3development
json-loader
Environment
{
  "local_name": "json-loader",
  "alias": false,
  "peer_metadata": null
}
^0.5.7development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
^3.0.0development
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^18.2.0development
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^18.2.0development
style-loader
Environment
{
  "local_name": "style-loader",
  "alias": false,
  "peer_metadata": null
}
2.0.0development
ts-loader
Environment
{
  "local_name": "ts-loader",
  "alias": false,
  "peer_metadata": null
}
^9.4.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.1.6development
webpack
Environment
{
  "local_name": "webpack",
  "alias": false,
  "peer_metadata": null
}
^5.88.2development
webpack-cli
Environment
{
  "local_name": "webpack-cli",
  "alias": false,
  "peer_metadata": null
}
4.10.0development
webpack-dev-server
Environment
{
  "local_name": "webpack-dev-server",
  "alias": false,
  "peer_metadata": null
}
4.15.1development
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.4.0peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": {
    "optional": true
  }
}
^18.2.0peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-aHZ6Amf0blCb879SWd7lX4nzNOEAYY1KQpUKKmgOq1N7Rc3dqwgjd8+TQq3SgMJpwbW2yteorhV+NqkdoOzYZA==",
  "shasum": "05c0570b175a685660f9fb1554fb445d961851d9",
  "tarball": "https://registry.npmjs.org/2021ai-grace-app/-/2021ai-grace-app-0.0.8.tgz",
  "fileCount": 12,
  "unpackedSize": 34361,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIH3cCn/vQ2B+cWDdOICbMKvcmSFftPWzjPk+TuxKMDQ9AiALfYsdPEMq/muiQmRxsx8x+HG3q9LEhAXDde/DQUamtQ=="
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 18:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:3a50b87a75f5392c64a8b5ca5f6d10bdf142bd709b0f5633ee366f280a084637

Other collected versions

1.0.03 Nov0.0.925 Oct0.0.77 Sept0.0.68 Aug0.0.51 Aug0.0.41 AugView all collected versions →