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

@enable-tech/enable-shared-types

v1.0.7

Published

This package represents the single source of truth of the Types being used in the codebase (front-end and back-end) of enable.tech, It is an organization-scoped package. So, all the development teams belonging to it can participate to enhance it.

Downloads

9

Readme

enable-shared-types

This package represents the single source of truth of the Types being used in the codebase (front-end and back-end) of enable.tech, It is an organization-scoped package. So, all the development teams belonging to it can participate to enhance it.

Installation

npm i @enable-tech/enable-shared-types

Usage

Right now the package contains the types of front-end apps (5 apps) exported as { CallCenterApp, CentralizedApp, EnableApp, OperationsManagementApp, PublicPagesApp } in "src/index.ts" so if we are working in the centralized app we are going to import CentralizedApp ony from it & access all the exported modules from it { FormModules, ApiModules } in "src/Types/CentralizedApp/index.ts"

Check the screenshot to see an example of how to use it

enable_package

as you can see if you don't remember what is being exported in the CentralizedApp you can easily see what it included by dot notation & the autocomplete for TypeScript will result in 2 results so you can choose which one to use & proceed with destructing what you want to use from it In this example, I logged 2 values of the enum one of them is correct & the other is not just for testing

You can the code snippet directly if you want:

import { CentralizedApp } from '@enable-tech/enable-shared-types';

const {
  FormModules: { Mode },
} = CentralizedApp;

console.log('Mode Enum', Mode.Add); // Correct Enum value

After a new version of the package is published you need to update it through the following command

npm update @enable-tech/enable-shared-types

Contributing

All the development team can contribute you would need to do the following steps

  1. Clone the repo

    git clone https://github.com/EButler-QA/enable-shared-types.git
  2. Install the dependencies

    npm install
  3. If there is a new project we want to add the types of it, it shall be added to This directory 'src/Types' example: All the types of the centralized app (front-end app) are added to this directory 'src/Types/CentralizedApp' and all I want to export from it are included at 'src/Types/CentralizedApp/index.ts' Don't forget to export your new module at this file 'src/index.ts' as it represents the index to the package

    Note: The back-end team & front-end teams are free to propose another architecture for exporting the modules if needed feel free to suggest any new ideas to enhance the package

  4. After adding the new updates to the package you can use the scripts in the package.json file to make sure that everything is working fine before publishing

    • Run the following command to build the project

      npm run prepare
    • Run the following command to make sure that there are no ESlint across the project (If there are any new errors fix them before publishing)

      npm run prepublish

      Note:

      • The rules of ESlint are provided in this file '.eslintrc.cjs' so if you want to add any extra config feel free to do so
      • In the '.eslintrc.cjs' file The following rule
        rules: {
         '@typescript-eslint/no-explicit-any': ['off'],
         },
        is only added because there are explicit 'any' for some of the types that supposed to be typed by the schema of DTOs so once the back-end adds them we are going to remove this rule & follow strict types without 'any'
    • Run the following command to format all files using Prettier & add them to be committed

      npm run version
  5. Provide a new version

    npm version <update_type>

    The version of the package mainly would be represented as major.minor.patch so replace <update_type> with the equivalent example updating the patch would be

    npm version patch
  6. Finally, Publish it 🥳

    npm publish

Author

Mayar Elabbasy