@relyio/cli 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1155 -1508
- package/package.json +5 -5
- package/templates/bare/schema.ts +14 -0
- package/templates/blog/asset-types/photo.ts +17 -0
- package/templates/blog/content-types/author.ts +11 -0
- package/templates/blog/content-types/blog-post.ts +17 -0
- package/templates/blog/content-types/category.ts +9 -0
- package/templates/blog/fieldsets/seo-metadata.ts +11 -0
- package/templates/blog/queries.ts +18 -0
- package/templates/blog/schema.ts +26 -0
- package/templates/blog/singletons/blog-index.ts +13 -0
- package/templates/bare/schemas/locales.yaml +0 -4
- package/templates/blog/queries/featuredPosts.yaml +0 -11
- package/templates/blog/queries/latestPosts.yaml +0 -9
- package/templates/blog/schemas/asset-types/photo.yaml +0 -20
- package/templates/blog/schemas/author.yaml +0 -21
- package/templates/blog/schemas/blogPost.yaml +0 -44
- package/templates/blog/schemas/category.yaml +0 -11
- package/templates/blog/schemas/fieldsets/seoMetadata.yaml +0 -18
- package/templates/blog/schemas/locales.yaml +0 -4
- package/templates/blog/schemas/singleton-types/blogIndex.yaml +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relyio/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "RelyIO is coming soon — this package is not ready for general use yet.",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"email": "team@relyio.com"
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
63
63
|
"typescript-eslint": "8.69.0",
|
|
64
64
|
"vitest": "4.1.11",
|
|
65
|
-
"@relyio/codegen-python": "0.1.0",
|
|
66
|
-
"@relyio/codegen-typescript": "1.0.0",
|
|
67
65
|
"@relyio/api-contract": "0.1.0",
|
|
68
66
|
"@relyio/codegen-core": "1.0.0",
|
|
67
|
+
"@relyio/codegen-python": "0.1.0",
|
|
68
|
+
"@relyio/codegen-typescript": "1.0.0",
|
|
69
69
|
"@relyio/device-auth": "0.0.0",
|
|
70
70
|
"@relyio/eslint-config": "0.0.0",
|
|
71
|
+
"@relyio/manifest": "0.0.0",
|
|
71
72
|
"@relyio/schema": "0.0.1",
|
|
72
|
-
"@relyio/sdk": "0.
|
|
73
|
-
"@relyio/schema-yaml": "0.0.0",
|
|
73
|
+
"@relyio/sdk": "0.17.0",
|
|
74
74
|
"@relyio/tenancy": "0.1.0"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Your RelyIO schema. `relyio deploy` reads this file — `relyio/schema.ts` — and every module it
|
|
3
|
+
* imports. Add a content type under `contentTypes`; see https://docs.relyio.com/schemas.
|
|
4
|
+
*
|
|
5
|
+
* `@relyio/sdk` provides the `define*` functions: install it with your package manager
|
|
6
|
+
* (`npm install @relyio/sdk`).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { defineLocale, defineSchema } from '@relyio/sdk/schema'
|
|
10
|
+
|
|
11
|
+
export const schema = defineSchema({
|
|
12
|
+
locales: [defineLocale('en', { displayName: 'English', default: true })],
|
|
13
|
+
contentTypes: {},
|
|
14
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineAssetType, fields } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
export const photo = defineAssetType({
|
|
4
|
+
displayName: 'Photo',
|
|
5
|
+
displayNamePlural: 'Photos',
|
|
6
|
+
displayField: 'altText',
|
|
7
|
+
fields: {
|
|
8
|
+
altText: fields.shortText({ displayName: 'Alt Text' }),
|
|
9
|
+
},
|
|
10
|
+
image: {
|
|
11
|
+
upload: {
|
|
12
|
+
allowedMimeTypes: ['image/jpeg', 'image/png', 'image/webp'],
|
|
13
|
+
maxFileSize: 10_485_760,
|
|
14
|
+
},
|
|
15
|
+
variants: [{ id: 'thumb', width: 400, height: 400, fit: 'cover', format: 'webp' }],
|
|
16
|
+
},
|
|
17
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineContentType, fields } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
export const author = defineContentType({
|
|
4
|
+
displayName: 'Author',
|
|
5
|
+
description: 'Represents a blog author',
|
|
6
|
+
fields: {
|
|
7
|
+
name: fields.shortText({ required: true, displayName: 'Author Name' }),
|
|
8
|
+
bio: fields.longText({ displayName: 'Biography' }),
|
|
9
|
+
avatar: fields.reference({ to: 'photo', displayName: 'Profile Picture' }),
|
|
10
|
+
},
|
|
11
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineContentType, fields } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
import { seoMetadata } from '../fieldsets/seo-metadata'
|
|
4
|
+
|
|
5
|
+
export const blogPost = defineContentType({
|
|
6
|
+
displayName: 'Blog Post',
|
|
7
|
+
description: 'Defines the structure for blog articles',
|
|
8
|
+
fields: {
|
|
9
|
+
title: fields.shortText({ required: true, displayName: 'Post Title' }),
|
|
10
|
+
slug: fields.slug({ sourceField: 'title', unique: true, displayName: 'Slug' }),
|
|
11
|
+
body: fields.richText({ displayName: 'Body' }),
|
|
12
|
+
publishedAt: fields.date({ displayName: 'Published Date' }),
|
|
13
|
+
isFeatured: fields.boolean({ defaultValue: false, displayName: 'Featured' }),
|
|
14
|
+
author: fields.reference({ to: 'author', displayName: 'Author' }),
|
|
15
|
+
seo: fields.object({ of: seoMetadata, displayName: 'SEO' }),
|
|
16
|
+
},
|
|
17
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineContentType, fields } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
export const category = defineContentType({
|
|
4
|
+
displayName: 'Category',
|
|
5
|
+
description: 'Blog categories',
|
|
6
|
+
fields: {
|
|
7
|
+
title: fields.shortText({ required: true, displayName: 'Category Title' }),
|
|
8
|
+
},
|
|
9
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { fields, fieldset } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
/** One fieldset, placed wherever a page needs its SEO: on a post and on the blog's index page. */
|
|
4
|
+
export const seoMetadata = fieldset('seoMetadata', {
|
|
5
|
+
displayName: 'SEO Metadata',
|
|
6
|
+
fields: {
|
|
7
|
+
metaTitle: fields.shortText({ displayName: 'Meta Title' }),
|
|
8
|
+
metaDescription: fields.longText({ displayName: 'Meta Description' }),
|
|
9
|
+
openGraphImage: fields.reference({ to: 'photo', displayName: 'Open Graph Image' }),
|
|
10
|
+
},
|
|
11
|
+
})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineQuery } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
export const featuredPosts = defineQuery({
|
|
4
|
+
endpoint: '/api/featured-posts',
|
|
5
|
+
description: 'Fetches featured blog posts',
|
|
6
|
+
fetch: {
|
|
7
|
+
contentType: 'blogPost',
|
|
8
|
+
where: { isFeatured: true },
|
|
9
|
+
sort: [{ publishedAt: 'desc' }],
|
|
10
|
+
limit: 5,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const latestPosts = defineQuery({
|
|
15
|
+
endpoint: '/api/latest-posts',
|
|
16
|
+
description: 'Fetches the latest blog posts',
|
|
17
|
+
fetch: { contentType: 'blogPost', sort: [{ publishedAt: 'desc' }], limit: 5 },
|
|
18
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A blog: posts, authors and categories, an index page, a photo asset type and two queries.
|
|
3
|
+
*
|
|
4
|
+
* `relyio deploy` reads this file — `relyio/schema.ts` — and every module it imports, so the schema
|
|
5
|
+
* can live in as many files as you like. See https://docs.relyio.com/schemas.
|
|
6
|
+
*
|
|
7
|
+
* `@relyio/sdk` provides the `define*` functions: install it with your package manager
|
|
8
|
+
* (`npm install @relyio/sdk`).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { defineLocale, defineSchema } from '@relyio/sdk/schema'
|
|
12
|
+
|
|
13
|
+
import { photo } from './asset-types/photo'
|
|
14
|
+
import { author } from './content-types/author'
|
|
15
|
+
import { blogPost } from './content-types/blog-post'
|
|
16
|
+
import { category } from './content-types/category'
|
|
17
|
+
import { featuredPosts, latestPosts } from './queries'
|
|
18
|
+
import { blogIndex } from './singletons/blog-index'
|
|
19
|
+
|
|
20
|
+
export const schema = defineSchema({
|
|
21
|
+
locales: [defineLocale('en', { displayName: 'English', default: true })],
|
|
22
|
+
contentTypes: { author, blogPost, category },
|
|
23
|
+
singletonContentTypes: { blogIndex },
|
|
24
|
+
assetTypes: { photo },
|
|
25
|
+
queries: { featuredPosts, latestPosts },
|
|
26
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineSingleton, fields } from '@relyio/sdk/schema'
|
|
2
|
+
|
|
3
|
+
import { seoMetadata } from '../fieldsets/seo-metadata'
|
|
4
|
+
|
|
5
|
+
export const blogIndex = defineSingleton({
|
|
6
|
+
displayName: 'Blog Index Page',
|
|
7
|
+
description: 'Landing page for the blog section',
|
|
8
|
+
fields: {
|
|
9
|
+
headline: fields.shortText({ displayName: 'Headline' }),
|
|
10
|
+
description: fields.longText({ displayName: 'Description' }),
|
|
11
|
+
seo: fields.object({ of: seoMetadata, displayName: 'SEO' }),
|
|
12
|
+
},
|
|
13
|
+
})
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
assetTypes:
|
|
2
|
-
- id: "photo"
|
|
3
|
-
displayName: "Photo"
|
|
4
|
-
displayNamePlural: "Photos"
|
|
5
|
-
displayField: "altText"
|
|
6
|
-
fields:
|
|
7
|
-
- id: "altText"
|
|
8
|
-
type: "shortText"
|
|
9
|
-
ui:
|
|
10
|
-
displayName: "Alt Text"
|
|
11
|
-
image:
|
|
12
|
-
upload:
|
|
13
|
-
allowedMimeTypes: ["image/jpeg", "image/png", "image/webp"]
|
|
14
|
-
maxFileSize: 10485760
|
|
15
|
-
variants:
|
|
16
|
-
- id: "thumb"
|
|
17
|
-
width: 400
|
|
18
|
-
height: 400
|
|
19
|
-
fit: "cover"
|
|
20
|
-
format: "webp"
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
contentTypes:
|
|
2
|
-
- id: "author"
|
|
3
|
-
displayName: "Author"
|
|
4
|
-
description: "Represents a blog author"
|
|
5
|
-
fields:
|
|
6
|
-
- id: "name"
|
|
7
|
-
type: "shortText"
|
|
8
|
-
config:
|
|
9
|
-
required: true
|
|
10
|
-
ui:
|
|
11
|
-
displayName: "Author Name"
|
|
12
|
-
- id: "bio"
|
|
13
|
-
type: "longText"
|
|
14
|
-
ui:
|
|
15
|
-
displayName: "Biography"
|
|
16
|
-
- id: "avatar"
|
|
17
|
-
type: "reference"
|
|
18
|
-
config:
|
|
19
|
-
to: "photo"
|
|
20
|
-
ui:
|
|
21
|
-
displayName: "Profile Picture"
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
contentTypes:
|
|
2
|
-
- id: "blogPost"
|
|
3
|
-
displayName: "Blog Post"
|
|
4
|
-
description: "Defines the structure for blog articles"
|
|
5
|
-
fields:
|
|
6
|
-
- id: "title"
|
|
7
|
-
type: "shortText"
|
|
8
|
-
config:
|
|
9
|
-
required: true
|
|
10
|
-
ui:
|
|
11
|
-
displayName: "Post Title"
|
|
12
|
-
- id: "slug"
|
|
13
|
-
type: "slug"
|
|
14
|
-
config:
|
|
15
|
-
sourceField: "title"
|
|
16
|
-
unique: true
|
|
17
|
-
ui:
|
|
18
|
-
displayName: "Slug"
|
|
19
|
-
- id: "body"
|
|
20
|
-
type: "richText"
|
|
21
|
-
ui:
|
|
22
|
-
displayName: "Body"
|
|
23
|
-
- id: "publishedAt"
|
|
24
|
-
type: "date"
|
|
25
|
-
ui:
|
|
26
|
-
displayName: "Published Date"
|
|
27
|
-
- id: "isFeatured"
|
|
28
|
-
type: "boolean"
|
|
29
|
-
config:
|
|
30
|
-
defaultValue: false
|
|
31
|
-
ui:
|
|
32
|
-
displayName: "Featured"
|
|
33
|
-
- id: "author"
|
|
34
|
-
type: "reference"
|
|
35
|
-
config:
|
|
36
|
-
to: "author"
|
|
37
|
-
ui:
|
|
38
|
-
displayName: "Author"
|
|
39
|
-
- id: "seo"
|
|
40
|
-
type: "object"
|
|
41
|
-
config:
|
|
42
|
-
of: "seoMetadata"
|
|
43
|
-
ui:
|
|
44
|
-
displayName: "SEO"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
fieldsets:
|
|
2
|
-
- id: "seoMetadata"
|
|
3
|
-
displayName: "SEO Metadata"
|
|
4
|
-
fields:
|
|
5
|
-
- id: "metaTitle"
|
|
6
|
-
type: "shortText"
|
|
7
|
-
ui:
|
|
8
|
-
displayName: "Meta Title"
|
|
9
|
-
- id: "metaDescription"
|
|
10
|
-
type: "longText"
|
|
11
|
-
ui:
|
|
12
|
-
displayName: "Meta Description"
|
|
13
|
-
- id: "openGraphImage"
|
|
14
|
-
type: "reference"
|
|
15
|
-
config:
|
|
16
|
-
to: "photo"
|
|
17
|
-
ui:
|
|
18
|
-
displayName: "Open Graph Image"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
singletonContentTypes:
|
|
2
|
-
- id: "blogIndex"
|
|
3
|
-
displayName: "Blog Index Page"
|
|
4
|
-
description: "Landing page for the blog section"
|
|
5
|
-
fields:
|
|
6
|
-
- id: "headline"
|
|
7
|
-
type: "shortText"
|
|
8
|
-
ui:
|
|
9
|
-
displayName: "Headline"
|
|
10
|
-
- id: "description"
|
|
11
|
-
type: "longText"
|
|
12
|
-
ui:
|
|
13
|
-
displayName: "Description"
|
|
14
|
-
- id: "seo"
|
|
15
|
-
type: "object"
|
|
16
|
-
config:
|
|
17
|
-
of: "seoMetadata"
|
|
18
|
-
ui:
|
|
19
|
-
displayName: "SEO"
|