briandoll / schema

library for developing schemas for Tipe projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tipe Schema

Tipe logo

Overview

Tipe schema is used to model your content and API from a single file
Your schema is designed to be used with Tipe cli
yarn add @tipe/schema
npm install @tipe/schema

Getting Started

Create your first shape by invoking new Shape

Types are used for value types for the API and rendering associated editors on the dashboard

Example Schema

import { Shape, types } from '@type/schema'

const Post = new Shape('Post', {
  title: {
    type: types.simpletext
  },
  body: {
    type: types.markdown
  },
  author: {
    type: types.shape,
    ref: 'Author'
  }
})

const Author = new Shape('Author', {
  name: {
    type: types.simpletext
  },
  leadingAuthor: {
    type: types.toggle
  }
})

const PostPage = new Shape('PostsPage', {
  header: {
    type: {
      title: {
        type: types.simpletext
      },
      body: {
        type: types.markdown
      }
    }
  },
  posts: {
    type: types.shape,
    ref: 'Post',
    array: true
  }
})

Issues

For problems directly related to the schema, add an issue on GitHub.

For other issues, submit a support ticket.

Developing

yarn install

To cut a release, commit you messages using our commit guide

About

library for developing schemas for Tipe projects

License:MIT License


Languages

Language:TypeScript 99.7%Language:JavaScript 0.3%