Skip to content
Merged

I23 #528

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 122 additions & 2 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function nav(): DefaultTheme.NavItem[] {
activeMatch: '/get-started/',
},
{
text: 'SDKs',
link: '/guide/tutorials/',
text: 'Guide',
link: '/guide/',
activeMatch: '/guide/',
},
{
Expand Down Expand Up @@ -75,6 +75,17 @@ function sidebarStart(): DefaultTheme.SidebarItem[] {

function sidebarGuide(): DefaultTheme.SidebarItem[] {
return [
{
text: 'Guide',
link: '/guide/',
collapsed: false,
items: [
{
text: 'Overview',
link: '/guide/',
},
],
},
{
text: 'SDK Tutorials',
link: '/guide/tutorials/',
Expand Down Expand Up @@ -108,12 +119,51 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
text: 'Embed Kaigi',
link: '/guide/tutorials/kaigi',
},
{
text: 'Musubi Packages',
link: '/guide/tutorials/musubi',
},
{
text: 'Compatibility Matrix',
link: '/reference/compatibility-matrix',
},
],
},
{
text: 'Best Practices',
link: '/guide/best-practices/',
collapsed: false,
items: [
{
text: 'Overview',
link: '/guide/best-practices/',
},
{
text: 'Application Development',
link: '/guide/best-practices/application-development.md',
},
{
text: 'Data Modeling',
link: '/guide/best-practices/data-modeling.md',
},
{
text: 'Network Deployment',
link: '/guide/best-practices/network-deployment.md',
},
{
text: 'Operations',
link: '/guide/best-practices/operations.md',
},
{
text: 'Security and Access',
link: '/guide/best-practices/security-and-access.md',
},
{
text: 'Release Readiness',
link: '/guide/best-practices/release-readiness.md',
},
],
},
{
text: 'Operator Quick Links',
collapsed: false,
Expand Down Expand Up @@ -146,16 +196,67 @@ function sidebarGuide(): DefaultTheme.SidebarItem[] {
text: 'Torii Endpoints',
link: '/reference/torii-endpoints.md',
},
{
text: 'Torii API Console',
link: '/reference/torii-api-console.md',
},
{
text: 'Performance and Metrics',
link: '/guide/advanced/metrics.md',
},
{
text: 'Chaos Testing',
link: '/guide/advanced/chaos-testing.md',
},
{
text: 'Binaries',
link: '/reference/binaries.md',
},
],
},
{
text: 'Security',
link: '/guide/security/',
collapsed: false,
items: [
{
text: 'Overview',
link: '/guide/security/',
},
{
text: 'Security Principles',
link: '/guide/security/security-principles.md',
},
{
text: 'Virtual Private Networks',
link: '/guide/security/vpn.md',
},
{
text: 'Operational Security',
link: '/guide/security/operational-security.md',
},
{
text: 'Fraud Monitoring',
link: '/guide/security/fraud-monitoring.md',
},
{
text: 'Password Security',
link: '/guide/security/password-security.md',
},
{
text: 'Public Key Cryptography',
link: '/guide/security/public-key-cryptography.md',
},
{
text: 'Generating Cryptographic Keys',
link: '/guide/security/generating-cryptographic-keys.md',
},
{
text: 'Storing Cryptographic Keys',
link: '/guide/security/storing-cryptographic-keys.md',
},
],
},
]
}

Expand Down Expand Up @@ -198,6 +299,14 @@ function sidebarChain(): DefaultTheme.SidebarItem[] {
text: 'Assets',
link: '/blockchain/assets',
},
{
text: 'NFTs',
link: '/blockchain/nfts',
},
{
text: 'Real-World Assets',
link: '/blockchain/rwas',
},
{
text: 'Metadata',
link: '/blockchain/metadata',
Expand Down Expand Up @@ -286,6 +395,10 @@ function sidebarReference(): DefaultTheme.SidebarItem[] {
text: 'Torii API',
link: '/reference/torii-endpoints.md',
},
{
text: 'Torii API Console',
link: '/reference/torii-api-console.md',
},
{
text: 'Norito',
link: '/reference/norito.md',
Expand Down Expand Up @@ -351,6 +464,13 @@ export default defineConfig({
plugins: [ViteUnoCSS('../uno.config.ts'), ViteSvgLoader()],
envDir: resolve(__dirname, '../'),
},
vue: {
template: {
compilerOptions: {
isCustomElement: (tag: string) => tag === 'rapi-doc',
},
},
},
lastUpdated: true,

head: [
Expand Down
66 changes: 55 additions & 11 deletions .vitepress/theme/components/CompatibilityMatrixTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ interface Matrix {

interface MatrixSource {
repo?: string
repo_url?: string
branch?: string
branch_url?: string
commit?: string
dirty?: boolean
generated_at?: string
Expand Down Expand Up @@ -126,20 +128,32 @@ const table = computed(() => {
return { headers, rows }
})

const sourceSummary = computed(() => {
function toHttpUrl(value: unknown): string | undefined {
if (typeof value !== 'string') return undefined

try {
const url = new URL(value)
return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : undefined
} catch {
return undefined
}
}

const matrixSource = computed(() => {
if (!task.state.fulfilled) return null

const { source } = task.state.fulfilled.value
if (!source) return null

const parts: string[] = []
if (source.repo) parts.push(`Source: ${source.repo}`)
if (source.branch) parts.push(source.branch)
if (source.commit) parts.push(source.commit)
if (source.dirty) parts.push('dirty worktree')
if (source.generated_at) parts.push(`generated ${source.generated_at}`)

return parts.join(' | ')
return {
repo: source.repo,
repoUrl: toHttpUrl(source.repo_url),
branch: source.branch,
branchUrl: toHttpUrl(source.branch_url),
commit: source.commit,
dirty: source.dirty,
generatedAt: source.generated_at,
}
})

const rejectionReason = computed(() => {
Expand Down Expand Up @@ -180,10 +194,40 @@ const rejectionReason = computed(() => {
</table>

<p
v-if="sourceSummary"
v-if="matrixSource"
class="compat-source"
>
{{ sourceSummary }}
Source:
<a
v-if="matrixSource.repo && matrixSource.repoUrl"
:href="matrixSource.repoUrl"
target="_blank"
rel="noreferrer"
>
{{ matrixSource.repo }}
</a>
<span v-else-if="matrixSource.repo">{{ matrixSource.repo }}</span>
<template v-if="matrixSource.branch">
| branch
<a
v-if="matrixSource.branchUrl"
:href="matrixSource.branchUrl"
target="_blank"
rel="noreferrer"
>
{{ matrixSource.branch }}
</a>
<span v-else>{{ matrixSource.branch }}</span>
</template>
<template v-if="matrixSource.commit">
| {{ matrixSource.commit }}
</template>
<template v-if="matrixSource.dirty">
| dirty worktree
</template>
<template v-if="matrixSource.generatedAt">
| generated {{ matrixSource.generatedAt }}
</template>
</p>
</div>

Expand Down
Loading
Loading