Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
feat: dogfood schema repository
Browse files Browse the repository at this point in the history
  • Loading branch information
bketelsen committed Apr 9, 2021
1 parent fad1973 commit d1d8f8a
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/test/tests.*
/test/coverage.*
repository/
!/dogfood/repository/
/repository.yaml
/blox
/_build/
67 changes: 67 additions & 0 deletions dogfood/repository/_build/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"Root": "repository",
"Namespace": "schemas.cueblox.com",
"Output": "_build",
"Schemas": [
{
"Namespace": "schemas.cueblox.com",
"Name": "article",
"Versions": [
{
"Namespace": "schemas.cueblox.com",
"Name": "v1",
"Schema": "article",
"Definition": "{\n\t_schema: {\n\t\tname: \"Article\"\n\t\tnamespace: \"schemas.cueblox.com\"\n\t}\n\n\t#Article: {\n\t\t_model: {\n\t\t\tplural: \"articles\"\n\t\t\tsupportedExtensions: [\"yaml\", \"yml\", \"md\", \"mdx\"]\n\t\t}\n\n\ttitle: string\n\texcerpt: string\n featured: bool | *false\n draft: bool | *false\n publish_date: string\n image?: string\n last_edit_date?: string\n edit_description?: string\n\tbody?: string\n\ttags?: [...string]\n category_id?: string\n profile_id?: string\n\t}\n\n}\n"
}
]
},
{
"Namespace": "schemas.cueblox.com",
"Name": "category",
"Versions": [
{
"Namespace": "schemas.cueblox.com",
"Name": "v1",
"Schema": "category",
"Definition": "{\n\t_schema: {\n\t\tname: \"Category\"\n\t\tnamespace: \"schemas.cueblox.com\"\n\t}\n\n\t#Category: {\n\t\t_model: {\n\t\t\tplural: \"categories\"\n\t\t\tsupportedExtensions: [\"yaml\", \"yml\", \"md\", \"mdx\"]\n\t\t}\n\n\tname: string\n\tdescription: string\n body?: string\n\t}\n\n\n}\n"
}
]
},
{
"Namespace": "schemas.cueblox.com",
"Name": "page",
"Versions": [
{
"Namespace": "schemas.cueblox.com",
"Name": "v1",
"Schema": "page",
"Definition": "{\n\t_schema: {\n\t\tname: \"Page\"\n\t\tnamespace: \"schemas.cueblox.com\"\n\t}\n\n\t#Page: {\n\t\t_model: {\n\t\t\tplural: \"pages\"\n\t\t\tsupportedExtensions: [\"yaml\", \"yml\", \"md\", \"mdx\"]\n\t\t}\n\n\ttitle: string\n\texcerpt: string\n draft: bool | *false\n publish_date: string\n image?: string\n\tbody?: string\n\ttags?: [...string]\n\t}\n\n}\n"
}
]
},
{
"Namespace": "schemas.cueblox.com",
"Name": "profile",
"Versions": [
{
"Namespace": "schemas.cueblox.com",
"Name": "v1",
"Schema": "profile",
"Definition": "{\n\t_schema: {\n\t\tname: \"Profile\"\n\t\tnamespace: \"schemas.cueblox.com\"\n\t}\n\n\t#Profile: {\n\t\t_model: {\n\t\t\tplural: \"profiles\"\n\t\t\tsupportedExtensions: [\"yaml\", \"yml\", \"md\", \"mdx\"]\n\t\t}\n\n\t\tfirst_name: string\n\t\tlast_name: string\n\t\tage?: int\n\t\tcompany?: string\n\t\ttitle?: string\n\t\tbody?: string\n\t\tsocial_accounts?: [...#TwitterAccount | #GitHubAccount | #MiscellaneousAccount]\n\t}\n\n\t#TwitterAccount: {\n\t\tnetwork: \"twitter\"\n\t\tusername: string\n\t\turl: *\"https://twitter.com/\\(username)\" | string\n\t}\n\n\t#GitHubAccount: {\n\t\tnetwork: \"github\"\n\t\tusername: string\n\t\turl: *\"https://github.com/\\(username)\" | string\n\t}\n\n\t#MiscellaneousAccount: {\n\t\tnetwork: string\n\t\turl: string\n\t}\n}\n"
}
]
},
{
"Namespace": "schemas.cueblox.com",
"Name": "website",
"Versions": [
{
"Namespace": "schemas.cueblox.com",
"Name": "v1",
"Schema": "website",
"Definition": "{\n\t_schema: {\n\t\tname: \"Profile\"\n\t\tnamespace: \"schemas.cueblox.com\"\n\t}\n\n\t#Website: {\n\t\t_model: {\n\t\t\tplural: \"websites\"\n\t\t\tsupportedExtensions: [\"yaml\", \"yml\"]\n\t\t}\n\n\t\turl: string\n\t\tprofile_id?: string\n\t\tbody?: string\n\t}\n}\n"
}
]
}
]
}
27 changes: 27 additions & 0 deletions dogfood/repository/article/v1/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
_schema: {
name: "Article"
namespace: "schemas.cueblox.com"
}

#Article: {
_model: {
plural: "articles"
supportedExtensions: ["yaml", "yml", "md", "mdx"]
}

title: string
excerpt: string
featured: bool | *false
draft: bool | *false
publish_date: string
image?: string
last_edit_date?: string
edit_description?: string
body?: string
tags?: [...string]
category_id?: string
profile_id?: string
}

}
19 changes: 19 additions & 0 deletions dogfood/repository/category/v1/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
_schema: {
name: "Category"
namespace: "schemas.cueblox.com"
}

#Category: {
_model: {
plural: "categories"
supportedExtensions: ["yaml", "yml", "md", "mdx"]
}

name: string
description: string
body?: string
}


}
22 changes: 22 additions & 0 deletions dogfood/repository/page/v1/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
_schema: {
name: "Page"
namespace: "schemas.cueblox.com"
}

#Page: {
_model: {
plural: "pages"
supportedExtensions: ["yaml", "yml", "md", "mdx"]
}

title: string
excerpt: string
draft: bool | *false
publish_date: string
image?: string
body?: string
tags?: [...string]
}

}
38 changes: 38 additions & 0 deletions dogfood/repository/profile/v1/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
_schema: {
name: "Profile"
namespace: "schemas.cueblox.com"
}

#Profile: {
_model: {
plural: "profiles"
supportedExtensions: ["yaml", "yml", "md", "mdx"]
}

first_name: string
last_name: string
age?: int
company?: string
title?: string
body?: string
social_accounts?: [...#TwitterAccount | #GitHubAccount | #MiscellaneousAccount]
}

#TwitterAccount: {
network: "twitter"
username: string
url: *"https://twitter.com/\(username)" | string
}

#GitHubAccount: {
network: "github"
username: string
url: *"https://github.com/\(username)" | string
}

#MiscellaneousAccount: {
network: string
url: string
}
}
17 changes: 17 additions & 0 deletions dogfood/repository/website/v1/schema.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
_schema: {
name: "Profile"
namespace: "schemas.cueblox.com"
}

#Website: {
_model: {
plural: "websites"
supportedExtensions: ["yaml", "yml"]
}

url: string
profile_id?: string
body?: string
}
}

0 comments on commit d1d8f8a

Please sign in to comment.