0.0.11 • Published 6 months ago

@c00kiemonsta/report-engine-utils v0.0.11

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

@c00kiemonsta/report-engine-utils

Description

@c00kiemonsta/report-engine-utils is a lightweight and efficient npm package designed to briefly describe what the package does. It provides mention key features that help developers streamline their workflow.

Installation

To install the package, run:

npm install @c00kiemonsta/report-engine-utils

or with yarn:

yarn add @c00kiemonsta/report-engine-utils

Usage

Import and use the package in your JavaScript/TypeScript project:

import myPackage from "@c00kiemonsta/report-engine-utils";

myPackage(); // Example usage

Configuration (If Applicable)

If the package requires configuration, provide details on how to configure it:

const options = {
  key: "value"
};

myPackage(options);

Test the package locally

  1. You can install a local package directly by referencing its path in your project’s package.json:
"dependencies": {
  "my-package": "file:../path/to/my-package"
}
  1. Run npm i

Publishing a New Version

To publish a new version, follow these steps:

  1. Update the version tag in package.json, e.g., change from 1.0.0 to 1.0.1.

  2. Log into npm from the console:

npm login
  1. Build the TypeScript files:
npm run build
  1. Publish the package (first in dev if you want to run some tests):

optional dev release, with version increase like this: 1.0.1-dev.0

npm publish --access public [--tag dev]
  1. Use the npm package in dev and prod:

In dev:

npm install @c00kiemonsta/report-engine-utils@dev

In prod:

npm install @c00kiemonsta/report-engine-utils@latest

Type Creation Convention

To ensure consistency and maintainability, please follow these conventions when creating types and interfaces in this package:

  • Database Constructs:
    All types that represent database entities or constructs must be defined as Zod schemas.

    • Export the Zod schema itself.
    • Export the corresponding TypeScript type using z.infer<typeof MySchema>.
    • Example:

      import { z } from "zod";
      
      export const userSchema = z.object({
        id: z.string(),
        name: z.string(),
        createdAt: z.date()
      });
      
      export type User = z.infer<typeof userSchema>;
  • Non-Database Constructs (e.g., API request/response):
    All types that are not directly related to database storage (such as API request and response shapes) should be defined as TypeScript interfaces.

    • Example:
      export interface GenerateReportRequest {
        reportData: {
          title: string;
          description: string;
          blocks: string;
        };
      }
  • Naming Convention:
    • All types, interfaces, and fields must use camelCase.
    • Avoid using snake_case or PascalCase for field names.

License

This project is licensed under the MIT License.

0.0.11

6 months ago

0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago