feat: add changelog/roadmap types, Sanity queries, and public route whitelist
This commit is contained in:
@@ -55,3 +55,19 @@ export const postBySlugQuery = `
|
|||||||
export const postSlugsQuery = `
|
export const postSlugsQuery = `
|
||||||
*[_type == "post" && defined(slug.current)] { "slug": slug.current }
|
*[_type == "post" && defined(slug.current)] { "slug": slug.current }
|
||||||
`
|
`
|
||||||
|
|
||||||
|
/** All changelog entries — published, newest first */
|
||||||
|
export const changelogEntriesQuery = `
|
||||||
|
*[_type == "changelogEntry" && publishedAt <= now()]
|
||||||
|
| order(publishedAt desc) {
|
||||||
|
_id, title, version, publishedAt, tags, body
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
|
/** Roadmap items — excludes shipped, sorted by manual order */
|
||||||
|
export const roadmapItemsQuery = `
|
||||||
|
*[_type == "roadmapItem" && status != "shipped"]
|
||||||
|
| order(order asc) {
|
||||||
|
_id, title, description, status, order
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ function isPublicPath(pathname: string) {
|
|||||||
if (pathname === "/guides") return true;
|
if (pathname === "/guides") return true;
|
||||||
if (pathname.startsWith("/guides/")) return true;
|
if (pathname.startsWith("/guides/")) return true;
|
||||||
|
|
||||||
|
// Changelog and feedback — always public
|
||||||
|
if (pathname === "/changelog") return true;
|
||||||
|
if (pathname === "/feedback") return true;
|
||||||
|
|
||||||
// Static / framework assets
|
// Static / framework assets
|
||||||
if (pathname.startsWith("/_next")) return true;
|
if (pathname.startsWith("/_next")) return true;
|
||||||
if (pathname === "/favicon.ico") return true;
|
if (pathname === "/favicon.ico") return true;
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
export type ChangelogEntry = {
|
||||||
|
_id: string
|
||||||
|
title: string
|
||||||
|
version: string
|
||||||
|
publishedAt: string
|
||||||
|
tags: string[]
|
||||||
|
body: unknown[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RoadmapItemData = {
|
||||||
|
_id: string
|
||||||
|
title: string
|
||||||
|
description: string
|
||||||
|
status: 'planned' | 'in-progress'
|
||||||
|
order: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Tab = 'whats-new' | 'whats-next' | 'give-feedback'
|
||||||
|
|
||||||
|
export type VoteState = {
|
||||||
|
count: number
|
||||||
|
voted: boolean
|
||||||
|
loading: boolean
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user