@winible/winible-typed
TypeScript icon, indicating that this package has built-in type declarations

2.69.0 • Public • Published

Winible Typescript Models

The Winible Typescript Models or @winible/winible-typed npm package is a project that holds all of Winible's sequelize database model declarations, sequelize client instantiation, as well as type declarations for unifying type sharing between all of our projects.

Overview

This package serves as the central source of truth for Winible's database models and TypeScript types. It's used across multiple projects including:

  • Main backend
  • Lambda functions
  • Other Winible services

Installation

npm install @winible/winible-typed

Project Structure

├── src/                    # Source code
│   ├── types.ts           # Index types (NOT IN USE)
│   ├── index.ts           # Main entry point
│   └── recurlyInstance.ts # Recurly integration
├── migrations/            # Database migrations (NOT IN USE)
├── typed-model/          # Typed model definitions
├── support/              # Support utilities (NOT IN USE)
└── webhooks/            # Webhook handlers (NOT IN USE)

Features

  • Sequelize model declarations
  • TypeScript type definitions
  • Database migrations (Not in use)
  • Shared database client instance

Development Setup

  1. Clone the repository:
git clone https://github.com/winible-betting/winible-typescript-models.git
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Database Migrations

While this package includes migration files in the migrations/ directory, these migrations are currently not in use and should not be used. The migration system has been deprecated in favor of other database management approaches.

Contributing

We use npm and semantic versioning for making changes to the models and sharing. We need to be extremely careful when making major changes because almost all of winible's project use the npm package and are reliant on its typescript or model declarations, some of them use the sequelize instance to make database calls, like the main backend or some of our lambda functions.

Releasing a new version

  1. Make the changes to the models needed
  2. PR your changes into main
    1. Get approvals
  3. Merge into main
  4. Release a new version:
    1. npm version minor|major|patch ← please refer to the semantic versioning section for explanation
      1. Most changes fall into a MINOR version category change (eg. updates to a existing data model, adding a new data model)
    2. Run npm run publish. Note: you will get an error but that's normal, you can ignore it.
  5. Push new version change to main
  6. Update the Database manually
  7. Update the package version on all needed repositories by:
    1. Manually changing the version on package.json
    2. Using npm run winible
      1. This will install the latest version of the package that being major, minor or patch

NPM Tags

For more complex feature development that will require testing or major overhauls, we can use npm tag releases. Please follow the guide below:

How to Use NPM Tags

After all testing is done and it's ready to release, make a regular release with all the changes.

Misc

Links

Semantic Versioning

Given a version number MAJOR.MINOR.PATCH, we increment the:

  1. MAJOR version when you make incompatible API changes (1.x.x)
  2. MINOR version when you add functionality in a backward compatible manner (x.1.x)
  3. PATCH version when you make backward compatible bug fixes (x.x.1)

Readme

Keywords

none

Package Sidebar

Install

npm i @winible/winible-typed

Weekly Downloads

1,164

Version

2.69.0

License

ISC

Unpacked Size

644 kB

Total Files

356

Last publish

Collaborators

  • teddymoney
  • brandongarciawinible
  • rodney.winible
  • arcmena-winible
  • gabriel.winible
  • luisrohten
  • winible-justinv