0.10.1-main.d8219c672edde1d24bff81f9f241ecc6cfe84552 • Published 1 month ago

@prom-cms/schema v0.10.1-main.d8219c672edde1d24bff81f9f241ecc6cfe84552

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

This is a schema package for prom-cms packages.

Introduction

This package includes all schema, mainly generator config schemas, that PromCMS uses internally. This documentation won't describe every one of them - for this you should look at code, because it's very descriptive by itself since schemas are written with zod

Nonetheless this documentation will describe how you should approach schema and describe field types and their meaning.

Schema

PromCMS schema is split into two basic parts Project and Database.

  • Project - This part describes project basic settings (such as name, slug, url, etc)

  • Database - This part describes database layer of your project

    • Models - Record of all of your models (posts, products, etc) - extended from "Database Item Base"
    • Singletons - Record of all of your singletons (specific pages, contacts, or other non repetitive content) - extended from "Database Item Base"
  • Database Item Base - Base schema for Models and Singletons. Has defined columns and other config that is specific for both Models and Singletons

    • Columns - Union record of multiple column types. Every column type extends "Column Type Base"

      • Normal - Basic column types that does not require specific options
        • type: Enum
          • date
          • password
          • dateTime
          • longText
      • JSON - JSON column type. This field has also multiple types of fields in admin.
        • admin
          • fieldType: Enum
            • repeater
              • With this you have to define your columns in repeater
            • blockEditor - rich editor
            • jsonEditor default - basic textarea with support of json
            • openingHours - opening hours field
      • String - Basic string field. Can also take multiple rendering types in admin.
        • admin
          • fieldType: Enum
            • heading
            • normal
      • Enum - Classic enum field type

      • File - Field for selecting fields from PromCMS file system. This field can also take multiple forms of rendering in admin.

        • admin
          • fieldType: Enum
            • normal default
            • big-image
            • small-image
      • Number - Classic number field

      • Relationship - Relationship field type. With this you can "link" models between each other. This field renders as a select in admin.

      • Slug - Field type that automatically updates itself based on value of specified string field that is slugified

      • Boolean - Classic boolean field. True or False

  • Column Type Base - Options for every column type. Includes options for admin view, translations and more

0.10.1-next.0

2 months ago

0.10.0

2 months ago

0.9.0

3 months ago

0.8.0

3 months ago

0.7.0

3 months ago

0.6.2

3 months ago

0.6.1

3 months ago

0.6.0

3 months ago

0.5.0

6 months ago

0.4.0

6 months ago

0.3.0

6 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.0

9 months ago