Update pipeline to Node 24. Update Lerna. Update Vitepress to Beta. Replace...
This commit is contained in:
@@ -17,13 +17,13 @@
|
||||
"@monaco-editor/loader": "^1.5.0",
|
||||
"@xocash/primitives": "*",
|
||||
"@xocash/stack": "*",
|
||||
"monaco-editor": "^0.52.2"
|
||||
"monaco-editor": "^0.52.2",
|
||||
"vitepress-mermaid-renderer": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typedoc": "^0.28.14",
|
||||
"typedoc-plugin-markdown": "^4.3.2",
|
||||
"typedoc-vitepress-theme": "^1.1.1",
|
||||
"vitepress": "^1.6.4",
|
||||
"vitepress-plugin-mermaid": "^2.0.17"
|
||||
"vitepress": "2.0.0-alpha.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { defineConfig } from 'vitepress';
|
||||
import { withMermaid } from 'vitepress-plugin-mermaid';
|
||||
import typedocSidebar from '../api/typedoc-sidebar.json';
|
||||
|
||||
// Node imports for auto blog sidebar (works at docs/src/.vitepress)
|
||||
@@ -39,8 +38,8 @@ function toPascalCase(str: string) {
|
||||
.map((word) => {
|
||||
if (word.length === 0) return '';
|
||||
|
||||
if (SPECIAL_CASES[word]) {
|
||||
return SPECIAL_CASES[word];
|
||||
if (word in SPECIAL_CASES) {
|
||||
return SPECIAL_CASES[word as keyof typeof SPECIAL_CASES];
|
||||
}
|
||||
|
||||
// Capitalize first letter, lowercase rest
|
||||
@@ -114,210 +113,208 @@ function blogSidebar() {
|
||||
}
|
||||
|
||||
// https://vitepress.dev/reference/site-config
|
||||
export default withMermaid(
|
||||
defineConfig({
|
||||
outDir: '../dist',
|
||||
title: 'XO Stack',
|
||||
description:
|
||||
'XO Stack: Building smart applications on the Bitcoin Cash Network',
|
||||
head: [
|
||||
// Favicon.
|
||||
['link', { rel: 'icon', href: '/favicon.png' }],
|
||||
// Basic OpenGraph tags
|
||||
['meta', { property: 'og:type', content: 'website' }],
|
||||
['meta', { property: 'og:title', content: 'XO Stack' }],
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
property: 'og:description',
|
||||
content:
|
||||
'XO Stack: Building smart applications on the Bitcoin Cash Network',
|
||||
},
|
||||
],
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
property: 'og:image',
|
||||
content: 'https://stack.xo.cash/stack-opengraph.jpg',
|
||||
},
|
||||
],
|
||||
['meta', { property: 'og:url', content: 'https://stack.xo.cash/' }],
|
||||
|
||||
// Optional additional tags
|
||||
['meta', { property: 'og:site_name', content: 'XO Stack' }],
|
||||
|
||||
// Twitter Card tags (optional but recommended)
|
||||
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
|
||||
['meta', { name: 'twitter:site', content: '@yourtwitterhandle' }],
|
||||
],
|
||||
themeConfig: {
|
||||
// Set the logo
|
||||
logo: {
|
||||
light: '/logo-light.svg',
|
||||
dark: '/logo-dark.svg',
|
||||
export default defineConfig({
|
||||
outDir: '../dist',
|
||||
title: 'XO Stack',
|
||||
description:
|
||||
'XO Stack: Building smart applications on the Bitcoin Cash Network',
|
||||
head: [
|
||||
// Favicon.
|
||||
['link', { rel: 'icon', href: '/favicon.png' }],
|
||||
// Basic OpenGraph tags
|
||||
['meta', { property: 'og:type', content: 'website' }],
|
||||
['meta', { property: 'og:title', content: 'XO Stack' }],
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
property: 'og:description',
|
||||
content:
|
||||
'XO Stack: Building smart applications on the Bitcoin Cash Network',
|
||||
},
|
||||
],
|
||||
[
|
||||
'meta',
|
||||
{
|
||||
property: 'og:image',
|
||||
content: 'https://stack.xo.cash/stack-opengraph.jpg',
|
||||
},
|
||||
],
|
||||
['meta', { property: 'og:url', content: 'https://stack.xo.cash/' }],
|
||||
|
||||
// Enable search functionality.
|
||||
// TODO: Re-enable once we release documentation.
|
||||
/*
|
||||
// Optional additional tags
|
||||
['meta', { property: 'og:site_name', content: 'XO Stack' }],
|
||||
|
||||
// Twitter Card tags (optional but recommended)
|
||||
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
|
||||
['meta', { name: 'twitter:site', content: '@yourtwitterhandle' }],
|
||||
],
|
||||
themeConfig: {
|
||||
// Set the logo
|
||||
logo: {
|
||||
light: '/logo-light.svg',
|
||||
dark: '/logo-dark.svg',
|
||||
},
|
||||
|
||||
// Enable search functionality.
|
||||
// TODO: Re-enable once we release documentation.
|
||||
/*
|
||||
search: {
|
||||
provider: 'local',
|
||||
},
|
||||
*/
|
||||
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
// TODO: Re-enable once we release documentation
|
||||
// { text: 'Documentation', link: '/quick-start' },
|
||||
{ text: 'Blog', link: '/blog' },
|
||||
{ text: 'Tools', link: '/tools/primitives' },
|
||||
{ text: 'Playground', link: '/playground' },
|
||||
// https://vitepress.dev/reference/default-theme-config
|
||||
nav: [
|
||||
{ text: 'Home', link: '/' },
|
||||
// TODO: Re-enable once we release documentation
|
||||
// { text: 'Documentation', link: '/quick-start' },
|
||||
{ text: 'Blog', link: '/blog' },
|
||||
{ text: 'Tools', link: '/tools/primitives' },
|
||||
{ text: 'Playground', link: '/playground' },
|
||||
],
|
||||
|
||||
sidebar: {
|
||||
// Default Side Menu.
|
||||
'/': [
|
||||
{
|
||||
text: 'Guide',
|
||||
items: [
|
||||
{ text: 'Quick Start', link: '/quick-start' },
|
||||
{ text: 'Architecture', link: '/architecture' },
|
||||
{ text: 'Best Practices', link: '/api-examples' },
|
||||
{ text: 'Contributing', link: '/contributing' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Frameworks',
|
||||
items: [
|
||||
{ text: 'Vue', link: '/frameworks/vue' },
|
||||
{ text: 'React', link: '/frameworks/react' },
|
||||
{ text: 'Svelte', link: '/frameworks/svelte' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'API',
|
||||
items: convertNavToPascalCase(typedocSidebar),
|
||||
},
|
||||
],
|
||||
|
||||
sidebar: {
|
||||
// Default Side Menu.
|
||||
'/': [
|
||||
{
|
||||
text: 'Guide',
|
||||
items: [
|
||||
{ text: 'Quick Start', link: '/quick-start' },
|
||||
{ text: 'Architecture', link: '/architecture' },
|
||||
{ text: 'Best Practices', link: '/api-examples' },
|
||||
{ text: 'Contributing', link: '/contributing' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Frameworks',
|
||||
items: [
|
||||
{ text: 'Vue', link: '/frameworks/vue' },
|
||||
{ text: 'React', link: '/frameworks/react' },
|
||||
{ text: 'Svelte', link: '/frameworks/svelte' },
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'API',
|
||||
items: convertNavToPascalCase(typedocSidebar),
|
||||
},
|
||||
],
|
||||
// Side-menu for all routes under /tools/
|
||||
'/tools/': [
|
||||
{
|
||||
text: 'XO Tools',
|
||||
items: [
|
||||
{
|
||||
text: 'Primitives',
|
||||
link: '/tools/primitives',
|
||||
collapsed: false,
|
||||
items: [
|
||||
{ text: 'Address', link: '/tools/primitives#address' },
|
||||
{
|
||||
text: 'Block Header',
|
||||
link: '/tools/primitives#block-header',
|
||||
},
|
||||
{ text: 'Bytes', link: '/tools/primitives#bytes' },
|
||||
{
|
||||
text: 'Encrypter',
|
||||
link: '/tools/primitives#encrypter',
|
||||
},
|
||||
{
|
||||
text: 'Hasher',
|
||||
link: '/tools/primitives#hasher',
|
||||
},
|
||||
{
|
||||
text: 'HD Private Node',
|
||||
link: '/tools/primitives#hd-private-node',
|
||||
},
|
||||
{
|
||||
text: 'HD Public Node',
|
||||
link: '/tools/primitives#hd-public-node',
|
||||
},
|
||||
{
|
||||
text: 'Mnemonic',
|
||||
link: '/tools/primitives#mnemonic',
|
||||
},
|
||||
{
|
||||
text: 'Private Key',
|
||||
link: '/tools/primitives#private-key',
|
||||
},
|
||||
{
|
||||
text: 'Public Key',
|
||||
link: '/tools/primitives#public-key',
|
||||
},
|
||||
{
|
||||
text: 'Satoshis',
|
||||
link: '/tools/primitives#satoshis',
|
||||
},
|
||||
{
|
||||
text: 'Script',
|
||||
link: '/tools/primitives#script',
|
||||
},
|
||||
{
|
||||
text: 'Transaction',
|
||||
link: '/tools/primitives#transaction',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Stack',
|
||||
collapsed: false,
|
||||
items: [
|
||||
{
|
||||
text: 'Blockchain',
|
||||
link: '/tools/stack/blockchain',
|
||||
items: [
|
||||
{
|
||||
text: 'Electrum',
|
||||
link: '/tools/stack/blockchain#electrum',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
// Blog sidebar (auto-generated)
|
||||
'/blog/': blogSidebar(),
|
||||
},
|
||||
|
||||
socialLinks: [
|
||||
// { icon: 'github', link: 'https://gitlab.com/GeneralProtocols/xo/stack' },
|
||||
{ icon: 'x', link: 'https://x.com/xo_bitcoincash' },
|
||||
// Side-menu for all routes under /tools/
|
||||
'/tools/': [
|
||||
{
|
||||
text: 'XO Tools',
|
||||
items: [
|
||||
{
|
||||
text: 'Primitives',
|
||||
link: '/tools/primitives',
|
||||
collapsed: false,
|
||||
items: [
|
||||
{ text: 'Address', link: '/tools/primitives#address' },
|
||||
{
|
||||
text: 'Block Header',
|
||||
link: '/tools/primitives#block-header',
|
||||
},
|
||||
{ text: 'Bytes', link: '/tools/primitives#bytes' },
|
||||
{
|
||||
text: 'Encrypter',
|
||||
link: '/tools/primitives#encrypter',
|
||||
},
|
||||
{
|
||||
text: 'Hasher',
|
||||
link: '/tools/primitives#hasher',
|
||||
},
|
||||
{
|
||||
text: 'HD Private Node',
|
||||
link: '/tools/primitives#hd-private-node',
|
||||
},
|
||||
{
|
||||
text: 'HD Public Node',
|
||||
link: '/tools/primitives#hd-public-node',
|
||||
},
|
||||
{
|
||||
text: 'Mnemonic',
|
||||
link: '/tools/primitives#mnemonic',
|
||||
},
|
||||
{
|
||||
text: 'Private Key',
|
||||
link: '/tools/primitives#private-key',
|
||||
},
|
||||
{
|
||||
text: 'Public Key',
|
||||
link: '/tools/primitives#public-key',
|
||||
},
|
||||
{
|
||||
text: 'Satoshis',
|
||||
link: '/tools/primitives#satoshis',
|
||||
},
|
||||
{
|
||||
text: 'Script',
|
||||
link: '/tools/primitives#script',
|
||||
},
|
||||
{
|
||||
text: 'Transaction',
|
||||
link: '/tools/primitives#transaction',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
text: 'Stack',
|
||||
collapsed: false,
|
||||
items: [
|
||||
{
|
||||
text: 'Blockchain',
|
||||
link: '/tools/stack/blockchain',
|
||||
items: [
|
||||
{
|
||||
text: 'Electrum',
|
||||
link: '/tools/stack/blockchain#electrum',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
// This is the outline on the right-hand side of the page.
|
||||
outline: {
|
||||
level: [2, 4],
|
||||
label: 'On this page',
|
||||
},
|
||||
// Blog sidebar (auto-generated)
|
||||
'/blog/': blogSidebar(),
|
||||
},
|
||||
|
||||
// Set the dev and build targets to "esnext"
|
||||
// NOTE: We do this so that we can support top-level-await.
|
||||
vite: {
|
||||
esbuild: {
|
||||
socialLinks: [
|
||||
// { icon: 'github', link: 'https://gitlab.com/GeneralProtocols/xo/stack' },
|
||||
{ icon: 'x', link: 'https://x.com/xo_bitcoincash' },
|
||||
],
|
||||
|
||||
// This is the outline on the right-hand side of the page.
|
||||
outline: {
|
||||
level: [2, 4],
|
||||
label: 'On this page',
|
||||
},
|
||||
},
|
||||
|
||||
// Set the dev and build targets to "esnext"
|
||||
// NOTE: We do this so that we can support top-level-await.
|
||||
vite: {
|
||||
esbuild: {
|
||||
target: 'esnext',
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
target: 'esnext',
|
||||
},
|
||||
build: {
|
||||
target: 'esnext',
|
||||
},
|
||||
optimizeDeps: {
|
||||
esbuildOptions: {
|
||||
target: 'esnext',
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
// Configure to use browser version of @xocash/stack
|
||||
conditions: ['browser', 'import', 'module', 'default'],
|
||||
},
|
||||
// SSR has its own separate ssr.resolve.conditions that must be explicitly set since not follow global resolve conditions.
|
||||
ssr: {
|
||||
resolve: {
|
||||
// Configure to use browser version of @xocash/stack
|
||||
conditions: ['browser', 'import', 'module', 'default'],
|
||||
},
|
||||
// SSR has its own separate ssr.resolve.conditions that must be explicitly set since not follow global resolve conditions.
|
||||
ssr: {
|
||||
resolve: {
|
||||
// Configure to use browser version of @xocash/stack
|
||||
conditions: ['browser', 'import', 'module', 'default'],
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,15 +1,61 @@
|
||||
// https://vitepress.dev/guide/custom-theme
|
||||
import { h, nextTick, watch } from 'vue';
|
||||
import type { Theme } from 'vitepress';
|
||||
import { useData } from 'vitepress';
|
||||
import DefaultTheme from 'vitepress/theme';
|
||||
import Layout from './Layout.vue';
|
||||
|
||||
import './style.css';
|
||||
import './custom.css';
|
||||
import './tools.css';
|
||||
import './mermaid-overrides.css';
|
||||
import './mermaid-lightbox.client';
|
||||
|
||||
import { createMermaidRenderer } from 'vitepress-mermaid-renderer';
|
||||
|
||||
export default {
|
||||
extends: DefaultTheme,
|
||||
Layout,
|
||||
enhanceApp({ _app, _router, _siteData }) {},
|
||||
|
||||
Layout: () => {
|
||||
const { isDark, localeIndex } = useData();
|
||||
|
||||
const initMermaid = () => {
|
||||
const mermaidRenderer = createMermaidRenderer({
|
||||
theme: isDark.value ? 'dark' : 'forest',
|
||||
});
|
||||
|
||||
mermaidRenderer.setToolbar({
|
||||
showLanguageLabel: false,
|
||||
downloadFormat: 'svg',
|
||||
fullscreenMode: 'browser',
|
||||
desktop: {
|
||||
copyCode: 'enabled',
|
||||
toggleFullscreen: 'enabled',
|
||||
resetView: 'enabled',
|
||||
zoomOut: 'enabled',
|
||||
zoomIn: 'enabled',
|
||||
zoomLevel: 'enabled',
|
||||
download: 'enabled',
|
||||
},
|
||||
fullscreen: {
|
||||
copyCode: 'disabled',
|
||||
toggleFullscreen: 'enabled',
|
||||
resetView: 'disabled',
|
||||
zoomLevel: 'disabled',
|
||||
download: 'enabled',
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
nextTick(initMermaid);
|
||||
|
||||
watch(
|
||||
() => [isDark.value, localeIndex.value] as const,
|
||||
() => {
|
||||
initMermaid();
|
||||
},
|
||||
);
|
||||
|
||||
return h(Layout);
|
||||
},
|
||||
|
||||
enhanceApp() {},
|
||||
} satisfies Theme;
|
||||
|
||||
Reference in New Issue
Block a user