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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@tattvafoundation/digit-ui-module-emarket

v1.0.5

Published

Market & Stall Module - BMC

Readme

@tattvafoundation/digit-ui-module-emarket

Market & Stall (EMARKET) Module for BMC — a micro-UI module used in UPYOG by Tattva Foundation (https://tattvafoundation.org).

This package is a self-contained micro-UI module that provides screens and utilities for Market & Stall Management, Revenue & Billing, License Management, Reports and Dashboard features used by the UPYOG frontend.

Key points

  • Part of the UPYOG micro-ui frontend.
  • Built to be bundled together with other UPYOG modules (uses Node.js 14 for compatibility across modules).
  • Uses the project's own CSS based on Tailwind CSS v2.
  • Compatible with React 17 (peer) and has allowances for React 18 where possible.

Contents

  • Source entry: src/Module.tsx (exports EMARKETModule and initEMARKETComponents).
  • Main component(s) registered: EMARKETCard (see componentsToRegister in Module.tsx).
  • Routes and feature list: see "Routes" section below (sourced from the_one_using.md).

Contract (quick)

  • Inputs: EMARKETModule accepts props: stateCode: string, userType: string (e.g., citizen or employee), tenants?: string[].
  • Outputs: React routes/pages mounted under the host app's routing. The module registers components via Digit.ComponentRegistryService when initEMARKETComponents is run.
  • Error modes: module expects Digit runtime services (Store, ComponentRegistryService). If those are missing or the language/store calls fail, the UI may show loading or fallback behavior.

Routes / Features

The module exposes routes used by the host application (non-exhaustive, from the_one_using.md):

  • License Management

    • /license/register
    • /license/search
    • /license/view/:id
    • /license/renewal
    • /license/transfer/* (legal-heir, distant-heir, sublet, multiple-stall)
    • /license/modification/* (name-correction, ownership-update, document-update)
    • /license/revocation/create
    • /license/restoration/create
  • Market & Stall Management

    • /market/structural/facility-request
    • /market/structural/permission
    • /market/amalgamation/create
    • /market/subdivision/create
    • /market/notices/scn
    • /market/notices/view/:id
  • Revenue & Billing

    • /billing/demand-generation
    • /billing/payment/:id
    • /billing/receipt/:id
    • /billing/ledger/:licenseId
    • /billing/arrears
    • /billing/waivers
  • Reports & Dashboard

    • /reports/*
    • /dashboard

Include these routes in the host application's router (the module itself mounts pages using the path provided by react-router's useRouteMatch).

Usage

Install (when publishing to npm the package will be consumed by the host application):

# from the host micro-ui workspace (example)
yarn add @tattvafoundation/digit-ui-module-emarket

API notes (from src/Module.tsx):

  • EMARKETModule uses Digit.Services.useStore to load store config for the module (moduleCode = 'EMARKET') and the current language. If userType === 'citizen' the module returns null (server/employee-only UI).
  • initEMARKETComponents registers named components (e.g., EMARKETCard) into Digit.ComponentRegistryService.

Development

Prerequisites

  • Node.js 14.x (the module is bundled to be compatible with other modules that require Node 14)
  • Yarn (recommended, used by the UPYOG workspace)

Common commands (from package.json):

# build
yarn build

# prepublish step runs build automatically

Build notes

  • The package uses microbundle-crl to produce dist/index.js and dist/index.modern.js bundles and outputs type definitions to dist/index.d.ts.
  • CSS: this module imports its own Tailwind-based stylesheet (@/styles/tailwind.css). Tailwind v2 build tooling must be compatible with the host build pipeline. The module disables CSS-modules in the microbundle config used here.

Compatibility

  • Node: 14.x required for consistent bundling with other UPYOG modules.
  • React: peer dependency allows React 17 (and a tolerant range for React 18). Tested against React 17.
  • react-router-dom: v5.3.0 is a peer dependency; the host app should use v5 to match routing expectations.

Peer dependencies (from package.json)

  • react: 17.0.2 || ^18
  • react-router-dom: 5.3.0

Other runtime dependencies are declared in package.json; ensure the host app provides compatible versions.

Testing & Quality

  • There are no unit tests in this package by default. Recommended additions:
    • A smoke test that mounts EMARKETModule inside a memory router and asserts it renders for employee userType.
    • A small test for initEMARKETComponents to ensure components are registered.

Edge cases to consider

  • Missing Digit runtime (store, services, ComponentRegistryService) — host must provide Digit runtime.
  • Language/store fetch failures — UI should show loading/errors as appropriate.
  • Host using react-router v6 — module expects v5 useRouteMatch and will need adaptation.

Troubleshooting

  • If styles do not appear, verify Tailwind v2 build is included in host pipeline and @/styles/tailwind.css resolves correctly when the package is bundled.
  • If components fail to register, make sure initEMARKETComponents() is called after the host initializes Digit.ComponentRegistryService.

Contributing

If you plan to contribute, follow the host project's contribution conventions. Keep changes minimal and add tests for new behaviours. Run yarn build before submitting PRs to ensure bundles are generated.

License

This module is published under the MIT license (see package.json).


For more implementation details see src/Module.tsx and package.json in this package.