v0.1.0 commit
This commit is contained in:
Generated
+3181
-3391
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -15,10 +15,10 @@
|
||||
"sanity"
|
||||
],
|
||||
"dependencies": {
|
||||
"@sanity/vision": "^5.14.1",
|
||||
"@sanity/vision": "^5.18.0",
|
||||
"react": "^19.1",
|
||||
"react-dom": "^19.1",
|
||||
"sanity": "^5.14.1",
|
||||
"sanity": "^5.18.0",
|
||||
"styled-components": "^6.1.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
import {defineField, defineType} from 'sanity'
|
||||
|
||||
export default defineType({
|
||||
name: 'changelogEntry',
|
||||
title: 'Changelog Entry',
|
||||
type: 'document',
|
||||
fields: [
|
||||
defineField({
|
||||
name: 'version',
|
||||
title: 'Version',
|
||||
type: 'string',
|
||||
description: 'e.g. v1.2.0',
|
||||
validation: (Rule) => Rule.required(),
|
||||
}),
|
||||
defineField({
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string',
|
||||
validation: (Rule) => Rule.required().max(120),
|
||||
}),
|
||||
defineField({
|
||||
name: 'publishedAt',
|
||||
title: 'Published At',
|
||||
type: 'datetime',
|
||||
initialValue: () => new Date().toISOString(),
|
||||
validation: (Rule) => Rule.required(),
|
||||
}),
|
||||
defineField({
|
||||
name: 'tags',
|
||||
title: 'Tags',
|
||||
type: 'array',
|
||||
of: [
|
||||
{
|
||||
type: 'string',
|
||||
options: {
|
||||
list: [
|
||||
{title: 'Feature', value: 'feature'},
|
||||
{title: 'Fix', value: 'fix'},
|
||||
{title: 'Improvement', value: 'improvement'},
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
}),
|
||||
defineField({
|
||||
name: 'body',
|
||||
title: 'Body',
|
||||
type: 'array',
|
||||
of: [
|
||||
{type: 'block'},
|
||||
{
|
||||
type: 'image',
|
||||
options: {hotspot: true},
|
||||
fields: [
|
||||
defineField({name: 'alt', title: 'Alt Text', type: 'string'}),
|
||||
defineField({name: 'caption', title: 'Caption', type: 'string'}),
|
||||
],
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
orderings: [
|
||||
{
|
||||
title: 'Published Date, Newest',
|
||||
name: 'publishedAtDesc',
|
||||
by: [{field: 'publishedAt', direction: 'desc'}],
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: 'title',
|
||||
version: 'version',
|
||||
publishedAt: 'publishedAt',
|
||||
},
|
||||
prepare({title, version, publishedAt}) {
|
||||
const date = publishedAt ? new Date(publishedAt).toLocaleDateString() : 'Draft'
|
||||
return {
|
||||
title: `${version} — ${title}`,
|
||||
subtitle: date,
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,4 +1,6 @@
|
||||
import author from './author'
|
||||
import post from './post'
|
||||
import changelogEntry from './changelogEntry'
|
||||
import roadmapItem from './roadmapItem'
|
||||
|
||||
export const schemaTypes = [author, post]
|
||||
export const schemaTypes = [author, post, changelogEntry, roadmapItem]
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
import {defineField, defineType} from 'sanity'
|
||||
|
||||
export default defineType({
|
||||
name: 'roadmapItem',
|
||||
title: 'Roadmap Item',
|
||||
type: 'document',
|
||||
fields: [
|
||||
defineField({
|
||||
name: 'title',
|
||||
title: 'Title',
|
||||
type: 'string',
|
||||
validation: (Rule) => Rule.required().max(100),
|
||||
}),
|
||||
defineField({
|
||||
name: 'description',
|
||||
title: 'Description',
|
||||
type: 'text',
|
||||
rows: 2,
|
||||
description: 'Short description shown on the roadmap card.',
|
||||
validation: (Rule) => Rule.max(300),
|
||||
}),
|
||||
defineField({
|
||||
name: 'status',
|
||||
title: 'Status',
|
||||
type: 'string',
|
||||
options: {
|
||||
list: [
|
||||
{title: 'Planned', value: 'planned'},
|
||||
{title: 'In Progress', value: 'in-progress'},
|
||||
{title: 'Shipped', value: 'shipped'},
|
||||
],
|
||||
layout: 'radio',
|
||||
},
|
||||
initialValue: 'planned',
|
||||
validation: (Rule) => Rule.required(),
|
||||
}),
|
||||
defineField({
|
||||
name: 'order',
|
||||
title: 'Sort Order',
|
||||
type: 'number',
|
||||
description: 'Lower numbers appear first within each status group.',
|
||||
initialValue: 100,
|
||||
}),
|
||||
],
|
||||
orderings: [
|
||||
{
|
||||
title: 'Sort Order',
|
||||
name: 'orderAsc',
|
||||
by: [{field: 'order', direction: 'asc'}],
|
||||
},
|
||||
],
|
||||
preview: {
|
||||
select: {
|
||||
title: 'title',
|
||||
status: 'status',
|
||||
},
|
||||
prepare({title, status}) {
|
||||
const badge =
|
||||
status === 'in-progress' ? '🔄' : status === 'shipped' ? '✅' : '📋'
|
||||
return {
|
||||
title,
|
||||
subtitle: `${badge} ${status ?? 'planned'}`,
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user