@c00kiemonsta/report-engine-utils v0.0.11
@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-utilsor with yarn:
yarn add @c00kiemonsta/report-engine-utilsUsage
Import and use the package in your JavaScript/TypeScript project:
import myPackage from "@c00kiemonsta/report-engine-utils";
myPackage(); // Example usageConfiguration (If Applicable)
If the package requires configuration, provide details on how to configure it:
const options = {
key: "value"
};
myPackage(options);Test the package locally
- 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"
}- Run
npm i
Publishing a New Version
To publish a new version, follow these steps:
Update the version tag in
package.json, e.g., change from1.0.0to1.0.1.Log into npm from the console:
npm login- Build the TypeScript files:
npm run build- 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]- Use the npm package in
devandprod:
In dev:
npm install @c00kiemonsta/report-engine-utils@devIn prod:
npm install @c00kiemonsta/report-engine-utils@latestType 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 TypeScriptinterfaces.- Example:
export interface GenerateReportRequest { reportData: { title: string; description: string; blocks: string; }; }
- Example:
- Naming Convention:
- All types, interfaces, and fields must use
camelCase. - Avoid using snake_case or PascalCase for field names.
- All types, interfaces, and fields must use
License
This project is licensed under the MIT License.