2.1.17 • Published 4 months ago

@aaiiccaa/mona-chat-widget v2.1.17

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

Mona Chat Widget

Chat widget package developed by Netmonk data & solution team to be imported in Netmonk products

🚅 Quick start

Prerequisites


  1. Install dependencies
    npm install
  2. Copy .env.example
    cp .env.example .env
  3. Populate .env

Storybook


  1. How to run Storybook locally (access at http://localhost:6006)

    npm run storybook
  2. How to build Storybook

    npm run build-storybook
  3. How to serve Storybook

    npm run serve-storybook

Library (how to update and publish)


  1. Commit changes
    git add .
    git commit -m "Your commit message"
  2. Update version

    npm version patch  # for bug fixes (1.0.0 -> 1.0.1)
    npm version minor  # for new features (1.0.0 -> 1.1.0)
    npm version major  # for breaking changes (1.0.0 -> 2.0.0)
  3. Build as a library (build file at /dist directory)

    npm run build
  4. Copy declaration file to /dist

    cp ./src/declarations/index.d.ts ./dist/index.d.ts
  5. Publish

    npm publish

Library (how to import on your project)


  1. Install package
    npm install @aaiiccaa/mona-chat-widget
  2. Import styles on your App.jsx or index.jsx

    import "@aaiiccaa/mona-chat-widget/dist/style.css";
  3. Import & use component

    import { ChatWidget } from "@aaiiccaa/mona-chat-widget";
    
    <ChatWidget userId={"1234"} sourceId={"1"}/>;

Standalone app (for demonstration)

  1. How to run locally (access at http://localhost:${PORT}/${APP_PREFIX})

    npm run dev
  2. How to build as a standalone app (build file at /dist-app directory)

    npm run build-app
  3. How to serve standalone app (access at http://localhost:${PORT}/${APP_PREFIX})

    npm run serve
  4. How to run on docker (access at http://localhost:${PORT}/${APP_PREFIX})

    docker-compose up --build