Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs]: add configuration reference #397

Open
wants to merge 83 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
15d9ea4
[misc]: update deps
0x009922 Aug 30, 2023
6b17267
[style]: remove brand colors and `SButton`; revert prettier
0x009922 Aug 30, 2023
d13775b
[refactor]: use headless dialog; revert plugin-pwa
0x009922 Sep 1, 2023
793959a
[chore]: disable `vue/no-v-html` in Mermaid
0x009922 Sep 1, 2023
122f05f
[refactor]: remove sora components from MermaidRender
0x009922 Sep 1, 2023
c472637
[chore]: format
0x009922 Sep 1, 2023
6bd761d
[chore]: remove `@soramitsu-ui/*` packages
0x009922 Sep 1, 2023
15f8e10
[refactor]: remove `vite-plugin-pwa`
0x009922 Sep 1, 2023
6d39164
[docs]: introduce "Reference" section
0x009922 Sep 8, 2023
6a9e6dd
[chore]: remove logo temporarily
0x009922 Sep 8, 2023
1d091a7
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 8, 2023
29736bd
[chore]: fix ffi link
0x009922 Sep 8, 2023
c88c48e
[chore]: update deps
0x009922 Sep 11, 2023
17fc897
[refactor]: simplify logging, remove `log-update`
0x009922 Sep 11, 2023
e123ac0
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 11, 2023
f6bb470
[docs]: change headings
0x009922 Sep 11, 2023
e2ecaa7
[docs]: format chores
0x009922 Sep 11, 2023
6786935
Merge remote-tracking branch 'hyperledger/main' into service-update
0x009922 Sep 15, 2023
ce9bf11
[chore]: update pnpm
0x009922 Sep 15, 2023
5828496
[fix]: remove `SSpinner` import
0x009922 Sep 15, 2023
134a275
[chore]: bump vitepress
0x009922 Sep 15, 2023
de585ca
[fix]: fix version of unocss
0x009922 Sep 15, 2023
4bafdab
[chore]: fix format
0x009922 Sep 15, 2023
cd0cede
[chore]: bump vitepress to `rc.14`
0x009922 Sep 18, 2023
1fe2a67
Merge branch 'service-update' into 392-draft-config-reference
0x009922 Sep 18, 2023
cbe8885
[docs]: use tex math syntax across
0x009922 Sep 18, 2023
13fe5ce
[docs]: move `/reference/` to `/api/`; split config reference
0x009922 Sep 18, 2023
5e2265a
[docs]: describe duration type
0x009922 Sep 18, 2023
eff21b2
[docs]: describe byte size type
0x009922 Sep 18, 2023
18b614b
[docs]: remove `*.actor-channel-capacity`
0x009922 Sep 18, 2023
32008ad
[fix]: dead links
0x009922 Sep 18, 2023
2adbbf9
[docs]: restore `snake_case`
0x009922 Sep 20, 2023
cfabb36
[docs]: update config reference
0x009922 Sep 21, 2023
6d88337
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 21, 2023
c9e4fcf
[chore]: remove dead code
0x009922 Sep 21, 2023
07fd463
Apply suggestions from code review
0x009922 Sep 22, 2023
60edf4e
Apply suggestions from code review
yamkovoy Sep 26, 2023
a0bc81f
[docs]: use TODO marks
0x009922 Sep 27, 2023
b1c7ef8
[docs]: add Snapshot section
0x009922 Sep 27, 2023
12a026d
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Sep 27, 2023
2db62aa
[chore]: fix format
0x009922 Sep 27, 2023
08532e0
[docs]: change TODO notation
0x009922 Sep 27, 2023
bb938ef
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 27, 2023
35a0974
Apply suggestions from code review
0x009922 Sep 29, 2023
5b3dd60
Merge branch 'main' into 392-draft-config-reference
0x009922 Sep 29, 2023
0efcf1c
[docs]: put TODOs
0x009922 Sep 29, 2023
ea286e6
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Sep 29, 2023
9dd1a49
[chore]: remove dead sidebar link
0x009922 Sep 29, 2023
76b850c
[docs]: expand logger params
0x009922 Sep 29, 2023
38dd466
[docs]: expand sections, update naming, rethink structure
0x009922 Sep 29, 2023
6688e80
Apply suggestions from code review
0x009922 Oct 2, 2023
d5d1156
[docs]: refactor the reference
0x009922 Oct 4, 2023
e9aa302
[chore]: fix typo and format
0x009922 Oct 4, 2023
fc9bd81
[docs]: combine sumeragi and block_sync
0x009922 Oct 4, 2023
2750023
Merge branch 'main' into 392-draft-config-reference
0x009922 Oct 10, 2023
df7415b
[docs]: torii bindings
0x009922 Oct 10, 2023
bde027d
Apply suggestions from code review
0x009922 Oct 20, 2023
b86a04c
Update src/api/config/sumeragi-params.md
0x009922 Oct 23, 2023
5e5582a
bunch of updates
0x009922 Nov 3, 2023
b9177e7
Merge remote-tracking branch 'hyperledger/main' into 392-draft-config…
0x009922 Nov 3, 2023
0d949c6
Merge remote-tracking branch '0x009922/392-draft-config-reference' in…
0x009922 Nov 3, 2023
f74845e
[docs]: fix broken link
0x009922 Nov 3, 2023
99698dd
[docs]: a bunch of edits of config
0x009922 Nov 22, 2023
7d9c926
[docs]: update configuration guides (wip)
0x009922 Nov 22, 2023
128e675
Merge branch 'main' into 392-draft-config-reference
0x009922 Nov 22, 2023
2be984d
Merge branch 'main' into 392-draft-config-reference
0x009922 Feb 12, 2024
4c78fe2
[chore]: update deps
0x009922 Feb 12, 2024
8841a0b
[chore]: `type: module`, fixing warning from Vitest
0x009922 Feb 12, 2024
3d26c72
[revert]: project is not ready for ESM
0x009922 Feb 12, 2024
c704b6f
Merge branch 'housekeeping' into 392-draft-config-reference
0x009922 Feb 12, 2024
a96fa91
[docs]: update reference section
0x009922 Feb 21, 2024
b21c68e
[docs]: migration guide; edits
0x009922 Mar 25, 2024
cfe5ae4
[revert]: remove `Specs` component
0x009922 Mar 25, 2024
dfd5498
[feat]: add sidebar link
0x009922 Mar 25, 2024
ca2f813
[chore]: fix format
0x009922 Mar 25, 2024
eb231f3
misc: update dependencies
Nov 7, 2024
aae25ba
Merge branch 'housekeeping' into 392-draft-config-reference
Nov 7, 2024
9fe82b7
docs: revamp config reference
Nov 8, 2024
1e3b453
Merge branch 'main' into 392-draft-config-reference
0x009922 Nov 8, 2024
39cfe97
docs: fix links
0x009922 Nov 8, 2024
790686a
docs: complete structure of config reference & related docs
0x009922 Nov 13, 2024
1f1c868
docs: chores
0x009922 Nov 13, 2024
a44d9b4
chore: fix format
0x009922 Nov 13, 2024
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
98 changes: 90 additions & 8 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="vite/client" />

import { defineConfig, DefaultTheme } from 'vitepress'
import { DefaultTheme, defineConfig } from 'vitepress'
import footnote from 'markdown-it-footnote'
import { resolve } from 'path'
import ViteSvgLoader from 'vite-svg-loader'
Expand All @@ -12,6 +12,7 @@ function nav(): DefaultTheme.NavItem[] {
return [
{
text: 'Guide',
activeMatch: '^/$|^/guide/',
items: [
// { text: 'Get Started', link: '/guide/get-started/index' },
// { text: 'Build and Install', link: '/guide/get-started/install' },
Expand All @@ -33,12 +34,12 @@ function nav(): DefaultTheme.NavItem[] {
{
text: 'Reference',
link: '/reference/torii-endpoints',
activeMatch: '/reference/',
activeMatch: '^/reference/',
},
]
}

function sidebarAPI(): DefaultTheme.SidebarItem[] {
function sidebarReference(): DefaultTheme.SidebarItem[] {
return [
{
text: 'About',
Expand All @@ -64,9 +65,13 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
{
text: 'Reference',
items: [
{
text: 'CLI',
link: '/reference/cli',
},
{
text: 'Torii Endpoints',
link: '/reference/torii-endpoints.md',
link: '/reference/torii-endpoints',
},
{
text: 'Data Model Schema',
Expand All @@ -78,11 +83,89 @@ function sidebarAPI(): DefaultTheme.SidebarItem[] {
},
{
text: 'Queries',
link: '/reference/queries.md',
link: '/reference/queries',
},
{
text: 'Permissions',
link: '/reference/permissions.md',
link: '/reference/permissions',
},
{
text: 'Genesis Block',
link: '/reference/genesis'
}
],
},
{
text: 'Configuration',
items: [
{
text: 'Overview',
link: '/reference/config/',
},
{
text: 'Parameters',
items: [
// TODO: consider re-ordering sections to a more intuitive format?
{
text: 'Base',
link: '/reference/config/base-params',
},
{
text: 'Genesis',
link: '/reference/config/genesis-params',
},
{
text: 'Network',
link: '/reference/config/network-params',
},
{
text: 'Torii',
link: '/reference/config/torii-params',
},
{
text: 'Sumeragi',
link: '/reference/config/sumeragi-params',
},
{
text: 'Kura',
link: '/reference/config/kura-params',
},
{
text: 'Logger',
link: '/reference/config/logger-params',
},
{
text: 'Queue',
link: '/reference/config/queue-params',
},
{
text: 'Snapshot',
link: '/reference/config/snapshot-params',
},
{
text: 'Telemetry',
link: '/reference/config/telemetry-params',
},
{
text: 'Chain Wide',
link: '/reference/config/chain-wide-params',
},
],
},
{
text: 'Glossary',
link: '/reference/config/glossary',
},
],
},
{
text: 'Client CLI',
items: [
{
text: 'CLI',
},
{
text: 'Configuration',
},
],
},
Expand Down Expand Up @@ -476,11 +559,10 @@ export default defineConfig({
},

nav: nav(),
outline: [2, 3],

sidebar: {
'/guide/': sidebarGuide(),
'/reference/': sidebarAPI(),
'/reference/': sidebarReference(),
},

search: {
Expand Down
65 changes: 65 additions & 0 deletions .vitepress/theme/components/ConfigParameterSpecs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<script setup lang="ts">
import { computed } from 'vue'
import { computedEager } from '@vueuse/core'

Check failure on line 3 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

'computedEager' is defined but never used
import { withBase } from 'vitepress'
import { match, P } from 'ts-pattern'

Check failure on line 5 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

'P' is defined but never used

const props = defineProps<{
type: 'string' | 'number' | 'socket-addr' | 'duration' | 'bytes' | 'private-key' | 'multihash' | 'file-path'
defaultValue?: string
env?: boolean | string
}>()

function glossaryLink(text: string, id: string) {
return { text, url: withBase(`/reference/config/glossary#${id}`) }
}

const typeModel = computed(() => {
type Result = (string | { url: string; text: string })[]

return match(props.type)
.returnType<Result>()
.with('string', () => ['String'])
.with('number', () => ['Number'])
.with('socket-addr', () => ['String, ', glossaryLink('Socket Address', 'type-socket-address')])
.with('duration', () => ['String, ', glossaryLink('Duration', 'type-duration')])
.with('bytes', () => ['String, ', glossaryLink('Bytes', 'type-bytes')])
.with('private-key', () => ['Table, ', glossaryLink('Private Key', 'type-private-key')])
.with('multihash', () => ['String, ', glossaryLink('Multihash', 'type-multihash')])
.with('file-path', () => ['String, file path'])
.exhaustive()
})
</script>

<template>
<table>
<thead>
<tr>
<th>Type</th>
<th v-if="env">Environment Alias</th>

Check warning on line 39 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break after opening tag (`<th>`), but no line breaks found

Check warning on line 39 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break before closing tag (`</th>`), but no line breaks found
<th v-if="defaultValue">Default</th>

Check warning on line 40 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break after opening tag (`<th>`), but no line breaks found

Check warning on line 40 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break before closing tag (`</th>`), but no line breaks found
<th v-else></th>

Check warning on line 41 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Require self-closing on HTML elements (<th>)
</tr>
</thead>
<tbody>
<tr>
<td>
<template v-for="item in typeModel">
<template v-if="typeof item === 'string'">{{ item }}</template>

Check warning on line 48 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break after opening tag (`<template>`), but no line breaks found

Check warning on line 48 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Expected 1 line break before closing tag (`</template>`), but no line breaks found
<a v-else :href="item.url">{{ item.text }}</a>

Check failure on line 49 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Elements in iteration expect to have 'v-bind:key' directives

Check warning on line 49 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

':href' should be on a new line
</template>
</td>
<td v-if="env">
<code v-if="typeof env === 'string'">{{ env }}</code>
<slot name="env" v-else />

Check warning on line 54 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

Attribute "v-else" should go before "name"

Check warning on line 54 in .vitepress/theme/components/ConfigParameterSpecs.vue

View workflow job for this annotation

GitHub Actions / check

'v-else' should be on a new line
</td>
<td v-if="defaultValue">
{{ defaultValue }}
</td>
<td v-else>
<b>Required</b>
</td>
</tr>
</tbody>
</table>
</template>
4 changes: 4 additions & 0 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ export default {
'CompatibilityMatrixTableIcon',
defineAsyncComponent(async () => import('./components/CompatibilityMatrixTableIcon.vue')),
)
app.component(
'ConfigParameterSpecs',
defineAsyncComponent(() => import('./components/ConfigParameterSpecs.vue')),
)
},
}
44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lint": "eslint --ext .js,.ts,.mts,.vue . .vitepress",
"typecheck": "tsc --noEmit",
"get-snippets": "pnpm cli get-snippets",
"test": "vitest",
"test": "VITE_CJS_IGNORE_WARNING=true vitest",
"cli": "tsx etc/cli"
},
"devDependencies": {
Expand All @@ -23,15 +23,15 @@
"@types/markdown-it": "^13.0.1",
"@types/node": "^20.6.0",
"@types/yargs": "^17.0.24",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@unocss/transformer-directives": "=0.55.7",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@unocss/transformer-directives": "^0.58.5",
"case": "^1.6.3",
"chalk": "^4",
"css-select": "^5.1.0",
"del": "^7.0.0",
"eslint": "^8.49.0",
"eslint-plugin-vue": "^9.17.0",
"eslint": "^8.56.0",
"eslint-plugin-vue": "^9.21.1",
"fast-diff": "^1.3.0",
"globby": "^13.2.2",
"hasha": "^5.2.2",
Expand All @@ -42,27 +42,27 @@
"markdown-it-footnote": "^3.0.3",
"mermaid": "^10.4.0",
"node-fetch": "^3.3.0",
"prettier": "^2.8.8",
"prettier-eslint": "^15.0.1",
"prettier-eslint-cli": "^7.1.0",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"prettier-eslint-cli": "^8.0.1",
"sass": "^1.66.1",
"ts-pattern": "^5.0.5",
"tsx": "^3.12.7",
"typescript": "5.2.2",
"unocss": "=0.55.7",
"vite": "^4.4.9",
"vite-svg-loader": "^4.0.0",
"vitepress": "1.0.0-rc.14",
"vitest": "^0.34.3",
"ts-pattern": "^5.0.6",
"tsx": "^4.7.1",
"typescript": "5.3.3",
"unocss": "^0.58.5",
"vite": "^5.1.1",
"vite-svg-loader": "^5.1.0",
"vitepress": "1.0.0-rc.42",
"vitest": "^1.2.2",
"yargs": "^17.6.2"
},
"dependencies": {
"@headlessui/vue": "^1.7.16",
"@headlessui/vue": "^1.7.19",
"@vue-kakuyaku/core": "^0.4.3",
"@vueuse/core": "^10.4.1",
"@vueuse/math": "^10.4.1",
"mande": "^2.0.7",
"@vueuse/core": "^10.7.2",
"@vueuse/math": "^10.7.2",
"mande": "^2.0.8",
"tiny-invariant": "^1.3.1",
"vue": "^3.3.4"
"vue": "^3.4.18"
}
}
Loading
Loading