s-hive-models
TypeScript icon, indicating that this package has built-in type declarations

1.0.52 • Public • Published

S-Hive Models

Overview

The S-Hive Models project is a centralized repository of reusable models designed to streamline the integration and development of multiple applications. By standardizing these models, you can ensure consistency, reduce redundancy, and improve the overall maintainability of your projects.

This package supports TypeScript, is built with TypeORM for database interactions, and uses PostgreSQL as its primary database dependency.

Features

  • Centralized reusable models for database management.
  • TypeScript support for type safety and code reliability.
  • Built using TypeORM, with support for migrations and advanced ORM capabilities.
  • Easily extensible to suit the needs of different applications.

Installation

Install the package via npm:

npm install s-hive-models

Usage

Import the models into your project:

import { User } from 's-hive-models';

You can use the models in conjunction with your TypeORM setup for seamless database interactions.

Development Scripts

Build

Compile the TypeScript files into JavaScript:

npm run build

Clean

Remove the dist folder to ensure a fresh build:

npm run clean

Prepare

Automatically build the project before publishing:

npm run prepare

Bump Version

Increment the package version using semantic versioning:

npm run bump-version

This defaults to a patch update. Modify it manually for major or minor updates.

Release Protocol

The release process for this project is streamlined using the npm run release script. This ensures that every release is consistent, validated, and ready for distribution. Here's how the release process works and what each step entails:

Command

npm run release

What the Release Script Does

  1. Clean the Build Directory: Removes the dist folder to ensure no outdated or residual files are included in the build.
npm run clean
  1. Git Commit:: Stages and commits any uncommitted changes with a standard message.
npm run git-commit
  1. Bump the Version: Automatically increments the package version according to semantic versioning (e.g., 1.0.141.0.15).
npm version patch
  1. Build the Project: Compiles all TypeScript files into JavaScript and outputs them into the dist directory.
npm run build
  1. Push Changes and Tags: Pushes the changes (including the version bump and tag) to the remote repository.
git push origin release-alpha
  1. Pre-Publish Validation: Runs the check-version script to ensure the version and metadata are valid. This step prevents publishing if something is off.
npm run prepublishOnly
  1. Publish to npm: Publishes the updated package to the npm registry.
npm run publish-package

Example Output

When you run npm run release, you'll see logs indicating each step of the process:

> npm run clean
> Cleaning the dist directory...

> npm version patch
> Version bumped from 1.0.14 to 1.0.15...

> npm run build
> Compiling TypeScript files...

> npm run prepublishOnly
> Running pre-publish checks...

> npm run publish-package
> Publishing package to npm registry...
> Package published successfully!

Important Notes

  • Ensure you are logged into npm and have the proper permissions to publish the package.
  • The release script is a single command that automates the entire process, but you can also run each step manually if needed.

Files Included in the Package

The following files are included in the npm package distribution:

  • src/**/*: The source TypeScript files for reference.
  • dist/**/*: The compiled JavaScript files for production use.
  • package.json: The package metadata.
  • README.md: The documentation for the package.
  • LICENSE: The license agreement.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

We welcome contributions to improve this package! Feel free to fork the repository, create a branch, and open a pull request with your changes.

Readme

Keywords

none

Package Sidebar

Install

npm i s-hive-models

Weekly Downloads

0

Version

1.0.52

License

MIT

Unpacked Size

50.9 kB

Total Files

83

Last publish

Collaborators

  • mevrik