livemark 0.10.5 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/actions/changelog/build.d.ts +22 -0
- package/build/actions/changelog/build.js +198 -0
- package/build/actions/config/load.d.ts +12 -0
- package/build/actions/config/load.js +41 -0
- package/build/actions/config/load.unit.js +39 -0
- package/build/actions/target/build.d.ts +29 -0
- package/build/actions/target/build.js +87 -0
- package/build/commands/build.js +15 -0
- package/{target → build}/commands/escape.d.ts +1 -1
- package/build/commands/escape.js +62 -0
- package/build/commands/preview.js +19 -0
- package/build/commands/start.js +20 -0
- package/build/components/Breadcrumbs.js +14 -0
- package/build/components/Layout.js +66 -0
- package/build/components/SidebarArticles.js +46 -0
- package/build/components/SidebarLinks.js +27 -0
- package/build/components/SidebarSections.js +37 -0
- package/build/components/SiteTitle.js +13 -0
- package/build/content/article.js +55 -0
- package/build/content/tag.js +31 -0
- package/build/content-collections.js +218 -0
- package/{target → build}/models/config.d.ts +17 -1
- package/build/models/config.js +38 -0
- package/build/plugins/vite-livemark.d.ts +12 -0
- package/build/plugins/vite-livemark.js +165 -0
- package/build/routes/__root.js +68 -0
- package/build/settings.d.ts +9 -0
- package/build/settings.js +25 -0
- package/build/vite.config.js +30 -0
- package/package.json +9 -7
- package/source/actions/changelog/build.ts +26 -9
- package/source/actions/config/load.ts +21 -6
- package/source/actions/config/load.unit.ts +19 -2
- package/source/actions/target/build.ts +89 -0
- package/source/commands/build.ts +1 -0
- package/source/commands/escape.ts +18 -11
- package/source/commands/preview.ts +1 -0
- package/source/commands/start.ts +1 -0
- package/source/components/Breadcrumbs.tsx +2 -1
- package/source/components/Layout.tsx +3 -2
- package/source/components/SidebarArticles.tsx +2 -1
- package/source/components/SidebarLinks.tsx +2 -1
- package/source/components/SidebarSections.tsx +2 -1
- package/source/components/SiteTitle.tsx +5 -10
- package/source/content/article.ts +2 -1
- package/source/content/tag.ts +2 -1
- package/source/content-collections.ts +1 -1
- package/source/env.d.ts +2 -2
- package/source/models/config.ts +22 -1
- package/source/plugins/vite-livemark.ts +168 -94
- package/source/routeTree.gen.ts +86 -0
- package/source/routes/__root.tsx +7 -9
- package/source/settings.ts +13 -2
- package/source/vite.config.ts +4 -78
- package/target/actions/changelog/build.d.ts +0 -15
- package/target/actions/changelog/build.js +0 -187
- package/target/actions/config/load.d.ts +0 -5
- package/target/actions/config/load.js +0 -25
- package/target/actions/config/load.unit.js +0 -25
- package/target/commands/build.js +0 -14
- package/target/commands/escape.js +0 -56
- package/target/commands/preview.js +0 -18
- package/target/commands/start.js +0 -19
- package/target/components/Breadcrumbs.js +0 -13
- package/target/components/Layout.js +0 -65
- package/target/components/SidebarArticles.js +0 -45
- package/target/components/SidebarLinks.js +0 -26
- package/target/components/SidebarSections.js +0 -36
- package/target/components/SiteTitle.js +0 -12
- package/target/content/article.js +0 -54
- package/target/content/tag.js +0 -30
- package/target/content-collections.js +0 -218
- package/target/models/config.js +0 -34
- package/target/plugins/vite-livemark.d.ts +0 -18
- package/target/plugins/vite-livemark.js +0 -111
- package/target/routes/__root.js +0 -69
- package/target/settings.d.ts +0 -5
- package/target/settings.js +0 -15
- package/target/vite.config.js +0 -89
- package/{target → build}/actions/changelog/build.unit.d.ts +0 -0
- package/{target → build}/actions/changelog/build.unit.js +0 -0
- package/{target → build}/actions/config/define.d.ts +0 -0
- package/{target → build}/actions/config/define.js +0 -0
- package/{target → build}/actions/config/define.unit.d.ts +0 -0
- package/{target → build}/actions/config/define.unit.js +0 -0
- package/{target → build}/actions/config/load.unit.d.ts +0 -0
- package/{target → build}/client.d.ts +0 -0
- package/{target → build}/client.js +0 -0
- package/{target → build}/commands/build.d.ts +0 -0
- package/{target → build}/commands/preview.d.ts +0 -0
- package/{target → build}/commands/start.d.ts +0 -0
- package/{target → build}/components/Abbr.d.ts +0 -0
- package/{target → build}/components/Abbr.js +0 -0
- package/{target → build}/components/AnsiCode.d.ts +0 -0
- package/{target → build}/components/AnsiCode.js +0 -0
- package/{target → build}/components/Article.d.ts +0 -0
- package/{target → build}/components/Article.js +0 -0
- package/{target → build}/components/BackToTop.d.ts +0 -0
- package/{target → build}/components/BackToTop.js +0 -0
- package/{target → build}/components/Banner.d.ts +0 -0
- package/{target → build}/components/Banner.js +0 -0
- package/{target → build}/components/BlogIndex.d.ts +0 -0
- package/{target → build}/components/BlogIndex.js +0 -0
- package/{target → build}/components/Breadcrumbs.d.ts +0 -0
- package/{target → build}/components/Callout.d.ts +0 -0
- package/{target → build}/components/Callout.js +0 -0
- package/{target → build}/components/Card.d.ts +0 -0
- package/{target → build}/components/Card.js +0 -0
- package/{target → build}/components/Cards.d.ts +0 -0
- package/{target → build}/components/Cards.js +0 -0
- package/{target → build}/components/ChangelogIndex.d.ts +0 -0
- package/{target → build}/components/ChangelogIndex.js +0 -0
- package/{target → build}/components/CodeBlock.d.ts +0 -0
- package/{target → build}/components/CodeBlock.js +0 -0
- package/{target → build}/components/CodeTabs.d.ts +0 -0
- package/{target → build}/components/CodeTabs.js +0 -0
- package/{target → build}/components/Column.d.ts +0 -0
- package/{target → build}/components/Column.js +0 -0
- package/{target → build}/components/Columns.d.ts +0 -0
- package/{target → build}/components/Columns.js +0 -0
- package/{target → build}/components/Content.d.ts +0 -0
- package/{target → build}/components/Content.js +0 -0
- package/{target → build}/components/ContentTab.d.ts +0 -0
- package/{target → build}/components/ContentTab.js +0 -0
- package/{target → build}/components/ContentTabs.d.ts +0 -0
- package/{target → build}/components/ContentTabs.js +0 -0
- package/{target → build}/components/DefaultCatchBoundary.d.ts +0 -0
- package/{target → build}/components/DefaultCatchBoundary.js +0 -0
- package/{target → build}/components/DefinitionList.d.ts +0 -0
- package/{target → build}/components/DefinitionList.js +0 -0
- package/{target → build}/components/Details.d.ts +0 -0
- package/{target → build}/components/Details.js +0 -0
- package/{target → build}/components/FileTree.d.ts +0 -0
- package/{target → build}/components/FileTree.js +0 -0
- package/{target → build}/components/Footer.d.ts +0 -0
- package/{target → build}/components/Footer.js +0 -0
- package/{target → build}/components/FootnoteRef.d.ts +0 -0
- package/{target → build}/components/FootnoteRef.js +0 -0
- package/{target → build}/components/Heading.d.ts +0 -0
- package/{target → build}/components/Heading.js +0 -0
- package/{target → build}/components/InlineBadge.d.ts +0 -0
- package/{target → build}/components/InlineBadge.js +0 -0
- package/{target → build}/components/InlineIcon.d.ts +0 -0
- package/{target → build}/components/InlineIcon.js +0 -0
- package/{target → build}/components/InlineToc.d.ts +0 -0
- package/{target → build}/components/InlineToc.js +0 -0
- package/{target → build}/components/Layout.d.ts +0 -0
- package/{target → build}/components/LinkButton.d.ts +0 -0
- package/{target → build}/components/LinkButton.js +0 -0
- package/{target → build}/components/Mermaid.d.ts +0 -0
- package/{target → build}/components/Mermaid.js +0 -0
- package/{target → build}/components/MermaidRenderer.d.ts +0 -0
- package/{target → build}/components/MermaidRenderer.js +0 -0
- package/{target → build}/components/NotFound.d.ts +0 -0
- package/{target → build}/components/NotFound.js +0 -0
- package/{target → build}/components/PackageTabs.d.ts +0 -0
- package/{target → build}/components/PackageTabs.js +0 -0
- package/{target → build}/components/PageToolbar.d.ts +0 -0
- package/{target → build}/components/PageToolbar.js +0 -0
- package/{target → build}/components/PrevNext.d.ts +0 -0
- package/{target → build}/components/PrevNext.js +0 -0
- package/{target → build}/components/Search.d.ts +0 -0
- package/{target → build}/components/Search.js +0 -0
- package/{target → build}/components/SearchDialog.d.ts +0 -0
- package/{target → build}/components/SearchDialog.js +0 -0
- package/{target → build}/components/Section.d.ts +0 -0
- package/{target → build}/components/Section.js +0 -0
- package/{target → build}/components/SectionHeader.d.ts +0 -0
- package/{target → build}/components/SectionHeader.js +0 -0
- package/{target → build}/components/Sidebar.d.ts +0 -0
- package/{target → build}/components/Sidebar.js +0 -0
- package/{target → build}/components/SidebarArticles.d.ts +0 -0
- package/{target → build}/components/SidebarLinks.d.ts +0 -0
- package/{target → build}/components/SidebarPosts.d.ts +0 -0
- package/{target → build}/components/SidebarPosts.js +0 -0
- package/{target → build}/components/SidebarReleases.d.ts +0 -0
- package/{target → build}/components/SidebarReleases.js +0 -0
- package/{target → build}/components/SidebarSections.d.ts +0 -0
- package/{target → build}/components/SiteTitle.d.ts +0 -0
- package/{target → build}/components/SortableTable.d.ts +0 -0
- package/{target → build}/components/SortableTable.js +0 -0
- package/{target → build}/components/SoundCloud.d.ts +0 -0
- package/{target → build}/components/SoundCloud.js +0 -0
- package/{target → build}/components/TagIndex.d.ts +0 -0
- package/{target → build}/components/TagIndex.js +0 -0
- package/{target → build}/components/Theme.d.ts +0 -0
- package/{target → build}/components/Theme.js +0 -0
- package/{target → build}/components/Toc.d.ts +0 -0
- package/{target → build}/components/Toc.js +0 -0
- package/{target → build}/components/YouTube.d.ts +0 -0
- package/{target → build}/components/YouTube.js +0 -0
- package/{target → build}/components/ZoomImage.d.ts +0 -0
- package/{target → build}/components/ZoomImage.js +0 -0
- package/{target → build}/content/article.d.ts +5 -5
- /package/{target → build}/content/tag.d.ts +0 -0
- /package/{target → build}/content-collections.d.ts +0 -0
- /package/{target → build}/elements/accordion.d.ts +0 -0
- /package/{target → build}/elements/accordion.js +0 -0
- /package/{target → build}/elements/alert-dialog.d.ts +0 -0
- /package/{target → build}/elements/alert-dialog.js +0 -0
- /package/{target → build}/elements/alert.d.ts +0 -0
- /package/{target → build}/elements/alert.js +0 -0
- /package/{target → build}/elements/aspect-ratio.d.ts +0 -0
- /package/{target → build}/elements/aspect-ratio.js +0 -0
- /package/{target → build}/elements/avatar.d.ts +0 -0
- /package/{target → build}/elements/avatar.js +0 -0
- /package/{target → build}/elements/badge.d.ts +0 -0
- /package/{target → build}/elements/badge.js +0 -0
- /package/{target → build}/elements/breadcrumb.d.ts +0 -0
- /package/{target → build}/elements/breadcrumb.js +0 -0
- /package/{target → build}/elements/button-group.d.ts +0 -0
- /package/{target → build}/elements/button-group.js +0 -0
- /package/{target → build}/elements/button.d.ts +0 -0
- /package/{target → build}/elements/button.js +0 -0
- /package/{target → build}/elements/calendar.d.ts +0 -0
- /package/{target → build}/elements/calendar.js +0 -0
- /package/{target → build}/elements/card.d.ts +0 -0
- /package/{target → build}/elements/card.js +0 -0
- /package/{target → build}/elements/carousel.d.ts +0 -0
- /package/{target → build}/elements/carousel.js +0 -0
- /package/{target → build}/elements/chart.d.ts +0 -0
- /package/{target → build}/elements/chart.js +0 -0
- /package/{target → build}/elements/checkbox.d.ts +0 -0
- /package/{target → build}/elements/checkbox.js +0 -0
- /package/{target → build}/elements/collapsible.d.ts +0 -0
- /package/{target → build}/elements/collapsible.js +0 -0
- /package/{target → build}/elements/command.d.ts +0 -0
- /package/{target → build}/elements/command.js +0 -0
- /package/{target → build}/elements/context-menu.d.ts +0 -0
- /package/{target → build}/elements/context-menu.js +0 -0
- /package/{target → build}/elements/dialog.d.ts +0 -0
- /package/{target → build}/elements/dialog.js +0 -0
- /package/{target → build}/elements/direction.d.ts +0 -0
- /package/{target → build}/elements/direction.js +0 -0
- /package/{target → build}/elements/drawer.d.ts +0 -0
- /package/{target → build}/elements/drawer.js +0 -0
- /package/{target → build}/elements/dropdown-menu.d.ts +0 -0
- /package/{target → build}/elements/dropdown-menu.js +0 -0
- /package/{target → build}/elements/empty.d.ts +0 -0
- /package/{target → build}/elements/empty.js +0 -0
- /package/{target → build}/elements/field.d.ts +0 -0
- /package/{target → build}/elements/field.js +0 -0
- /package/{target → build}/elements/hover-card.d.ts +0 -0
- /package/{target → build}/elements/hover-card.js +0 -0
- /package/{target → build}/elements/input-group.d.ts +0 -0
- /package/{target → build}/elements/input-group.js +0 -0
- /package/{target → build}/elements/input-otp.d.ts +0 -0
- /package/{target → build}/elements/input-otp.js +0 -0
- /package/{target → build}/elements/input.d.ts +0 -0
- /package/{target → build}/elements/input.js +0 -0
- /package/{target → build}/elements/item.d.ts +0 -0
- /package/{target → build}/elements/item.js +0 -0
- /package/{target → build}/elements/kbd.d.ts +0 -0
- /package/{target → build}/elements/kbd.js +0 -0
- /package/{target → build}/elements/label.d.ts +0 -0
- /package/{target → build}/elements/label.js +0 -0
- /package/{target → build}/elements/menubar.d.ts +0 -0
- /package/{target → build}/elements/menubar.js +0 -0
- /package/{target → build}/elements/native-select.d.ts +0 -0
- /package/{target → build}/elements/native-select.js +0 -0
- /package/{target → build}/elements/navigation-menu.d.ts +0 -0
- /package/{target → build}/elements/navigation-menu.js +0 -0
- /package/{target → build}/elements/pagination.d.ts +0 -0
- /package/{target → build}/elements/pagination.js +0 -0
- /package/{target → build}/elements/popover.d.ts +0 -0
- /package/{target → build}/elements/popover.js +0 -0
- /package/{target → build}/elements/progress.d.ts +0 -0
- /package/{target → build}/elements/progress.js +0 -0
- /package/{target → build}/elements/radio-group.d.ts +0 -0
- /package/{target → build}/elements/radio-group.js +0 -0
- /package/{target → build}/elements/resizable.d.ts +0 -0
- /package/{target → build}/elements/resizable.js +0 -0
- /package/{target → build}/elements/scroll-area.d.ts +0 -0
- /package/{target → build}/elements/scroll-area.js +0 -0
- /package/{target → build}/elements/select.d.ts +0 -0
- /package/{target → build}/elements/select.js +0 -0
- /package/{target → build}/elements/separator.d.ts +0 -0
- /package/{target → build}/elements/separator.js +0 -0
- /package/{target → build}/elements/sheet.d.ts +0 -0
- /package/{target → build}/elements/sheet.js +0 -0
- /package/{target → build}/elements/sidebar.d.ts +0 -0
- /package/{target → build}/elements/sidebar.js +0 -0
- /package/{target → build}/elements/skeleton.d.ts +0 -0
- /package/{target → build}/elements/skeleton.js +0 -0
- /package/{target → build}/elements/slider.d.ts +0 -0
- /package/{target → build}/elements/slider.js +0 -0
- /package/{target → build}/elements/sonner.d.ts +0 -0
- /package/{target → build}/elements/sonner.js +0 -0
- /package/{target → build}/elements/spinner.d.ts +0 -0
- /package/{target → build}/elements/spinner.js +0 -0
- /package/{target → build}/elements/switch.d.ts +0 -0
- /package/{target → build}/elements/switch.js +0 -0
- /package/{target → build}/elements/table.d.ts +0 -0
- /package/{target → build}/elements/table.js +0 -0
- /package/{target → build}/elements/tabs.d.ts +0 -0
- /package/{target → build}/elements/tabs.js +0 -0
- /package/{target → build}/elements/textarea.d.ts +0 -0
- /package/{target → build}/elements/textarea.js +0 -0
- /package/{target → build}/elements/toggle-group.d.ts +0 -0
- /package/{target → build}/elements/toggle-group.js +0 -0
- /package/{target → build}/elements/toggle.d.ts +0 -0
- /package/{target → build}/elements/toggle.js +0 -0
- /package/{target → build}/elements/tooltip.d.ts +0 -0
- /package/{target → build}/elements/tooltip.js +0 -0
- /package/{target → build}/entrypoints/main.d.ts +0 -0
- /package/{target → build}/entrypoints/main.js +0 -0
- /package/{target → build}/helpers/article-icon.d.ts +0 -0
- /package/{target → build}/helpers/article-icon.js +0 -0
- /package/{target → build}/helpers/article.d.ts +0 -0
- /package/{target → build}/helpers/article.js +0 -0
- /package/{target → build}/helpers/changelog-source.d.ts +0 -0
- /package/{target → build}/helpers/changelog-source.js +0 -0
- /package/{target → build}/helpers/changelog-source.unit.d.ts +0 -0
- /package/{target → build}/helpers/changelog-source.unit.js +0 -0
- /package/{target → build}/helpers/dynamic-icon-resolver.d.ts +0 -0
- /package/{target → build}/helpers/dynamic-icon-resolver.js +0 -0
- /package/{target → build}/helpers/dynamic-icon.d.ts +0 -0
- /package/{target → build}/helpers/dynamic-icon.js +0 -0
- /package/{target → build}/helpers/favicon.d.ts +0 -0
- /package/{target → build}/helpers/favicon.js +0 -0
- /package/{target → build}/helpers/model.d.ts +0 -0
- /package/{target → build}/helpers/model.js +0 -0
- /package/{target → build}/helpers/program.d.ts +0 -0
- /package/{target → build}/helpers/program.js +0 -0
- /package/{target → build}/helpers/resolve-asset-path.d.ts +0 -0
- /package/{target → build}/helpers/resolve-asset-path.js +0 -0
- /package/{target → build}/helpers/resolve-includes.d.ts +0 -0
- /package/{target → build}/helpers/resolve-includes.js +0 -0
- /package/{target → build}/helpers/resolve-includes.unit.d.ts +0 -0
- /package/{target → build}/helpers/resolve-includes.unit.js +0 -0
- /package/{target → build}/helpers/search-text.d.ts +0 -0
- /package/{target → build}/helpers/search-text.js +0 -0
- /package/{target → build}/helpers/section.d.ts +0 -0
- /package/{target → build}/helpers/section.js +0 -0
- /package/{target → build}/helpers/section.unit.d.ts +0 -0
- /package/{target → build}/helpers/section.unit.js +0 -0
- /package/{target → build}/helpers/theme.d.ts +0 -0
- /package/{target → build}/helpers/theme.js +0 -0
- /package/{target → build}/helpers/toc-context.d.ts +0 -0
- /package/{target → build}/helpers/toc-context.js +0 -0
- /package/{target → build}/helpers/toc.d.ts +0 -0
- /package/{target → build}/helpers/toc.js +0 -0
- /package/{target → build}/helpers/toc.unit.d.ts +0 -0
- /package/{target → build}/helpers/toc.unit.js +0 -0
- /package/{target → build}/hooks/in-view.d.ts +0 -0
- /package/{target → build}/hooks/in-view.js +0 -0
- /package/{target → build}/hooks/media.d.ts +0 -0
- /package/{target → build}/hooks/media.js +0 -0
- /package/{target → build}/index.d.ts +0 -0
- /package/{target → build}/index.js +0 -0
- /package/{target → build}/models/article.d.ts +0 -0
- /package/{target → build}/models/article.js +0 -0
- /package/{target → build}/models/link.d.ts +0 -0
- /package/{target → build}/models/link.js +0 -0
- /package/{target → build}/models/patch.d.ts +0 -0
- /package/{target → build}/models/patch.js +0 -0
- /package/{target → build}/models/section.d.ts +0 -0
- /package/{target → build}/models/section.js +0 -0
- /package/{target → build}/models/theme.d.ts +0 -0
- /package/{target → build}/models/theme.js +0 -0
- /package/{target → build}/models/toc.d.ts +0 -0
- /package/{target → build}/models/toc.js +0 -0
- /package/{target → build}/plugins/rehype-inline-code.d.ts +0 -0
- /package/{target → build}/plugins/rehype-inline-code.js +0 -0
- /package/{target → build}/plugins/rehype-task-list-a11y.d.ts +0 -0
- /package/{target → build}/plugins/rehype-task-list-a11y.js +0 -0
- /package/{target → build}/plugins/remark-abbr.d.ts +0 -0
- /package/{target → build}/plugins/remark-abbr.js +0 -0
- /package/{target → build}/plugins/remark-abbr.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-abbr.unit.js +0 -0
- /package/{target → build}/plugins/remark-ansi.d.ts +0 -0
- /package/{target → build}/plugins/remark-ansi.js +0 -0
- /package/{target → build}/plugins/remark-ansi.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-ansi.unit.js +0 -0
- /package/{target → build}/plugins/remark-badge.d.ts +0 -0
- /package/{target → build}/plugins/remark-badge.js +0 -0
- /package/{target → build}/plugins/remark-badge.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-badge.unit.js +0 -0
- /package/{target → build}/plugins/remark-button.d.ts +0 -0
- /package/{target → build}/plugins/remark-button.js +0 -0
- /package/{target → build}/plugins/remark-button.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-button.unit.js +0 -0
- /package/{target → build}/plugins/remark-callout.d.ts +0 -0
- /package/{target → build}/plugins/remark-callout.js +0 -0
- /package/{target → build}/plugins/remark-card.d.ts +0 -0
- /package/{target → build}/plugins/remark-card.js +0 -0
- /package/{target → build}/plugins/remark-code-tabs.d.ts +0 -0
- /package/{target → build}/plugins/remark-code-tabs.js +0 -0
- /package/{target → build}/plugins/remark-columns.d.ts +0 -0
- /package/{target → build}/plugins/remark-columns.js +0 -0
- /package/{target → build}/plugins/remark-custom-heading-id.d.ts +0 -0
- /package/{target → build}/plugins/remark-custom-heading-id.js +0 -0
- /package/{target → build}/plugins/remark-custom-heading-id.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-custom-heading-id.unit.js +0 -0
- /package/{target → build}/plugins/remark-deflist.d.ts +0 -0
- /package/{target → build}/plugins/remark-deflist.js +0 -0
- /package/{target → build}/plugins/remark-details.d.ts +0 -0
- /package/{target → build}/plugins/remark-details.js +0 -0
- /package/{target → build}/plugins/remark-filetree.d.ts +0 -0
- /package/{target → build}/plugins/remark-filetree.js +0 -0
- /package/{target → build}/plugins/remark-filetree.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-filetree.unit.js +0 -0
- /package/{target → build}/plugins/remark-github-callout.d.ts +0 -0
- /package/{target → build}/plugins/remark-github-callout.js +0 -0
- /package/{target → build}/plugins/remark-icon.d.ts +0 -0
- /package/{target → build}/plugins/remark-icon.js +0 -0
- /package/{target → build}/plugins/remark-image.d.ts +0 -0
- /package/{target → build}/plugins/remark-image.js +0 -0
- /package/{target → build}/plugins/remark-media.d.ts +0 -0
- /package/{target → build}/plugins/remark-media.js +0 -0
- /package/{target → build}/plugins/remark-media.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-media.unit.js +0 -0
- /package/{target → build}/plugins/remark-mermaid.d.ts +0 -0
- /package/{target → build}/plugins/remark-mermaid.js +0 -0
- /package/{target → build}/plugins/remark-npm.d.ts +0 -0
- /package/{target → build}/plugins/remark-npm.js +0 -0
- /package/{target → build}/plugins/remark-passthrough-directive.d.ts +0 -0
- /package/{target → build}/plugins/remark-passthrough-directive.js +0 -0
- /package/{target → build}/plugins/remark-steps.d.ts +0 -0
- /package/{target → build}/plugins/remark-steps.js +0 -0
- /package/{target → build}/plugins/remark-steps.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-steps.unit.js +0 -0
- /package/{target → build}/plugins/remark-tab.d.ts +0 -0
- /package/{target → build}/plugins/remark-tab.js +0 -0
- /package/{target → build}/plugins/remark-tab.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-tab.unit.js +0 -0
- /package/{target → build}/plugins/remark-toc.d.ts +0 -0
- /package/{target → build}/plugins/remark-toc.js +0 -0
- /package/{target → build}/plugins/remark-toc.unit.d.ts +0 -0
- /package/{target → build}/plugins/remark-toc.unit.js +0 -0
- /package/{target → build}/plugins/shiki-icon.d.ts +0 -0
- /package/{target → build}/plugins/shiki-icon.js +0 -0
- /package/{target → build}/plugins/shiki-line-highlight.d.ts +0 -0
- /package/{target → build}/plugins/shiki-line-highlight.js +0 -0
- /package/{target → build}/program.d.ts +0 -0
- /package/{target → build}/program.js +0 -0
- /package/{target → build}/routeTree.gen.d.ts +0 -0
- /package/{target → build}/routeTree.gen.js +0 -0
- /package/{target → build}/router.d.ts +0 -0
- /package/{target → build}/router.js +0 -0
- /package/{target → build}/routes/$.d.ts +0 -0
- /package/{target → build}/routes/$.js +0 -0
- /package/{target → build}/routes/__root.d.ts +0 -0
- /package/{target → build}/server.d.ts +0 -0
- /package/{target → build}/server.js +0 -0
- /package/{target → build}/utils/style.d.ts +0 -0
- /package/{target → build}/utils/style.js +0 -0
- /package/{target → build}/vite.config.d.ts +0 -0
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import defaultLogo from "../assets/logo.svg"
|
|
2
3
|
|
|
3
4
|
/** Renders the site logo, title, and description in the sidebar header */
|
|
4
5
|
export function SiteTitle() {
|
|
5
|
-
const logo =
|
|
6
|
+
const logo = config.logo ?? defaultLogo
|
|
6
7
|
return (
|
|
7
8
|
<div className="flex items-end gap-2.5 text-sm">
|
|
8
|
-
<img
|
|
9
|
-
src={logo}
|
|
10
|
-
alt={import.meta.env.CONFIG.title}
|
|
11
|
-
className="size-6.5 mb-1.25"
|
|
12
|
-
/>
|
|
9
|
+
<img src={logo} alt={config.title} className="size-6.5 mb-1.25" />
|
|
13
10
|
<div className="flex flex-col gap-0.5 leading-none">
|
|
14
|
-
<span className="font-semibold">{
|
|
15
|
-
<span className="text-xs opacity-80">
|
|
16
|
-
{import.meta.env.CONFIG.description}
|
|
17
|
-
</span>
|
|
11
|
+
<span className="font-semibold">{config.title}</span>
|
|
12
|
+
<span className="text-xs opacity-80">{config.description}</span>
|
|
18
13
|
</div>
|
|
19
14
|
</div>
|
|
20
15
|
)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { allArticles } from "content-collections"
|
|
2
3
|
import type { ArticleGroup } from "../models/article.ts"
|
|
3
4
|
import {
|
|
@@ -39,7 +40,7 @@ function orderKey(order?: number) {
|
|
|
39
40
|
return order
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const configSections =
|
|
43
|
+
const configSections = config.sections
|
|
43
44
|
|
|
44
45
|
/** Per-section article groups, keyed by section prefix */
|
|
45
46
|
export const sectionArticleGroups = new Map<string, ArticleGroup[]>()
|
package/source/content/tag.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { sectionFlatArticles, sortedArticles } from "./article.ts"
|
|
2
3
|
|
|
3
|
-
const configSections =
|
|
4
|
+
const configSections = config.sections
|
|
4
5
|
|
|
5
6
|
/** Per-section tag → article paths mapping. Articles sorted by date descending. */
|
|
6
7
|
export const sectionTags = new Map<string, Map<string, string[]>>()
|
|
@@ -64,7 +64,7 @@ const configInclude = Array.isArray(config.include)
|
|
|
64
64
|
? config.include
|
|
65
65
|
: [config.include]
|
|
66
66
|
const include = changelogSections.length
|
|
67
|
-
? [...configInclude, cacheIncludeGlob()]
|
|
67
|
+
? [...configInclude, cacheIncludeGlob(config)]
|
|
68
68
|
: configInclude
|
|
69
69
|
|
|
70
70
|
const userExclude = config.exclude
|
package/source/env.d.ts
CHANGED
package/source/models/config.ts
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { z } from "zod"
|
|
2
|
+
import type { ConfigEnv, UserConfig as ViteUserConfig } from "vite"
|
|
2
3
|
import { Link } from "./link.ts"
|
|
3
4
|
import { Patch } from "./patch.ts"
|
|
4
5
|
import { Section } from "./section.ts"
|
|
5
6
|
import { CodeThemeDark, CodeThemeLight } from "./theme.ts"
|
|
6
7
|
|
|
8
|
+
/** Escape hatch for arbitrary Vite config — accepts either a config
|
|
9
|
+
* object (simple overrides) or a function form (`(env) => config`,
|
|
10
|
+
* matching Vite's own `defineConfig`). Merged on top of livemark's
|
|
11
|
+
* defaults via `mergeConfig`, so plugin arrays concatenate, defines
|
|
12
|
+
* merge, etc. Use this for deployment-target tweaks (e.g. CF Workers
|
|
13
|
+
* via `environments.ssr.resolve.conditions: ["workerd", ...]`). */
|
|
14
|
+
export type ViteOverride =
|
|
15
|
+
| ViteUserConfig
|
|
16
|
+
| ((env: ConfigEnv) => ViteUserConfig | Promise<ViteUserConfig>)
|
|
17
|
+
|
|
7
18
|
/**
|
|
8
19
|
* User-provided configuration for Livemark.
|
|
9
20
|
*/
|
|
10
|
-
export type UserConfig = z.infer<typeof UserConfig>
|
|
21
|
+
export type UserConfig = Omit<z.infer<typeof UserConfig>, "vite"> & {
|
|
22
|
+
vite?: ViteOverride
|
|
23
|
+
}
|
|
11
24
|
export const UserConfig = z.object({
|
|
12
25
|
site: z.string().optional(),
|
|
13
26
|
favicon: z.string().optional(),
|
|
@@ -21,6 +34,10 @@ export const UserConfig = z.object({
|
|
|
21
34
|
links: z.array(Link).optional(),
|
|
22
35
|
sections: z.array(Section).optional(),
|
|
23
36
|
patches: z.array(Patch).optional(),
|
|
37
|
+
// Stored as `unknown` in the schema (zod can't type a Vite UserConfig
|
|
38
|
+
// or a function returning one meaningfully); the public TypeScript
|
|
39
|
+
// surface above lifts it back to ViteOverride for editor support.
|
|
40
|
+
vite: z.unknown().optional(),
|
|
24
41
|
})
|
|
25
42
|
|
|
26
43
|
/** Website configuration injected at build time via Vite define */
|
|
@@ -46,6 +63,10 @@ export const SystemConfig = z.object({
|
|
|
46
63
|
|
|
47
64
|
/**
|
|
48
65
|
* Fully resolved Livemark configuration.
|
|
66
|
+
*
|
|
67
|
+
* `vite` stays `unknown` here because that's what the runtime schema
|
|
68
|
+
* produces — consumer-facing typing happens via {@link UserConfig} so
|
|
69
|
+
* `defineConfig` shows the right shape in editors.
|
|
49
70
|
*/
|
|
50
71
|
export type Config = z.infer<typeof Config>
|
|
51
72
|
export const Config = UserConfig.merge(SystemConfig)
|
|
@@ -1,119 +1,193 @@
|
|
|
1
|
-
import { existsSync } from "node:fs"
|
|
2
|
-
import { join } from "node:path"
|
|
3
|
-
import type {
|
|
1
|
+
import { cpSync, existsSync, rmSync } from "node:fs"
|
|
2
|
+
import { join, sep } from "node:path"
|
|
3
|
+
import type {
|
|
4
|
+
ConfigEnv,
|
|
5
|
+
Plugin,
|
|
6
|
+
UserConfig as ViteUserConfig,
|
|
7
|
+
ViteDevServer,
|
|
8
|
+
} from "vite"
|
|
9
|
+
import { mergeConfig } from "vite"
|
|
10
|
+
import { buildTarget } from "../actions/target/build.ts"
|
|
11
|
+
import type { Config } from "../models/config.ts"
|
|
12
|
+
import { WebsiteConfig } from "../models/config.ts"
|
|
13
|
+
import { ESCAPABLE_FILES, ESCAPABLE_FOLDERS } from "../settings.ts"
|
|
4
14
|
|
|
5
15
|
export interface LivemarkOptions {
|
|
6
|
-
|
|
7
|
-
overridesRoot: string
|
|
8
|
-
subdirs: string[]
|
|
9
|
-
configPath: string
|
|
16
|
+
config: Config
|
|
10
17
|
}
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
* not relative (`./foo`), absolute (`/foo`), URL, or virtual (`\0...`)
|
|
14
|
-
* paths. */
|
|
15
|
-
const BARE_SPECIFIER_RE = /^(@[^/]+\/)?[a-z0-9_][^?#]*$/i
|
|
19
|
+
const SOURCE_DIR = join(import.meta.dirname, "..")
|
|
16
20
|
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
21
|
+
/** Single virtual module exposing livemark's runtime values to consumer
|
|
22
|
+
* override files via named exports:
|
|
23
|
+
*
|
|
24
|
+
* import { config } from "livemark:virtual"
|
|
25
|
+
*
|
|
26
|
+
* Currently exports `config` (validated `WebsiteConfig`); future
|
|
27
|
+
* additions (e.g. `articles`, `sections`) land here as new named
|
|
28
|
+
* exports without consumers changing their import statements.
|
|
29
|
+
*
|
|
30
|
+
* The `\0` prefix on the resolved id is Vite's convention to signal
|
|
31
|
+
* "this is a virtual module — no other plugin should try to resolve
|
|
32
|
+
* or load it from disk". */
|
|
33
|
+
const VIRTUAL_ID = "livemark:virtual"
|
|
34
|
+
const VIRTUAL_RESOLVED_ID = `\0${VIRTUAL_ID}`
|
|
35
|
+
|
|
36
|
+
/** Owns the per-consumer `targets/<hash>/` mount: synthesizes it via
|
|
37
|
+
* `buildTarget()`, returns the Vite config that anchors there, and
|
|
38
|
+
* watches the consumer's `.livemark/` (plus livemark's `source/` in
|
|
39
|
+
* dev) for changes that need to be re-copied into the target. The
|
|
40
|
+
* override mechanism is pure file-system (full copies) — no resolveId
|
|
41
|
+
* redirection, no realpath surprises. */
|
|
27
42
|
export function livemark(opts: LivemarkOptions): Plugin {
|
|
28
|
-
const
|
|
29
|
-
|
|
43
|
+
const overridesRoot = join(opts.config.root, ".livemark")
|
|
44
|
+
let targetDir = ""
|
|
30
45
|
return {
|
|
31
46
|
name: "livemark",
|
|
32
47
|
enforce: "pre",
|
|
33
|
-
async
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const fromImporter = importer
|
|
45
|
-
? await this.resolve(id, importer, {
|
|
46
|
-
...options,
|
|
47
|
-
skipSelf: true,
|
|
48
|
-
})
|
|
49
|
-
: null
|
|
50
|
-
if (fromImporter) return fromImporter
|
|
51
|
-
const fromLivemark = await this.resolve(id, livemarkAnchor, {
|
|
52
|
-
...options,
|
|
53
|
-
skipSelf: true,
|
|
54
|
-
})
|
|
55
|
-
if (fromLivemark) return fromLivemark
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (!importer || !EXT_RE.test(id)) return null
|
|
59
|
-
const resolved = await this.resolve(id, importer, {
|
|
60
|
-
...options,
|
|
61
|
-
skipSelf: true,
|
|
62
|
-
})
|
|
63
|
-
if (!resolved) return null
|
|
64
|
-
const queryIdx = resolved.id.indexOf("?")
|
|
65
|
-
const path =
|
|
66
|
-
queryIdx === -1 ? resolved.id : resolved.id.slice(0, queryIdx)
|
|
67
|
-
const query = queryIdx === -1 ? "" : resolved.id.slice(queryIdx)
|
|
68
|
-
for (const subdir of opts.subdirs) {
|
|
69
|
-
const defaultsSubdir = `${join(opts.defaultsRoot, subdir)}/`
|
|
70
|
-
if (!path.startsWith(defaultsSubdir)) continue
|
|
71
|
-
const rel = path.slice(defaultsSubdir.length)
|
|
72
|
-
const userPath = join(opts.overridesRoot, subdir, rel)
|
|
73
|
-
if (existsSync(userPath)) return userPath + query
|
|
74
|
-
return null
|
|
48
|
+
async config(_, env) {
|
|
49
|
+
targetDir = buildTarget(opts.config.configPath)
|
|
50
|
+
const base: ViteUserConfig = {
|
|
51
|
+
root: targetDir,
|
|
52
|
+
// outDir lives outside the target root (in the consumer's
|
|
53
|
+
// .livemark/) so the consumer can find their deployable output
|
|
54
|
+
// without digging into node_modules. Vite's default refusal to
|
|
55
|
+
// empty out-of-root directories doesn't apply here because the
|
|
56
|
+
// target/ root is livemark's, not the consumer's.
|
|
57
|
+
build: { outDir: join(overridesRoot, "build"), emptyOutDir: true },
|
|
58
|
+
resolve: { dedupe: ["react", "react-dom"] },
|
|
75
59
|
}
|
|
60
|
+
const override = await resolveViteOverride(opts.config.vite, env)
|
|
61
|
+
return override ? mergeConfig(base, override) : base
|
|
62
|
+
},
|
|
63
|
+
resolveId(id) {
|
|
64
|
+
if (id === VIRTUAL_ID) return VIRTUAL_RESOLVED_ID
|
|
76
65
|
return null
|
|
77
66
|
},
|
|
67
|
+
load(id) {
|
|
68
|
+
if (id !== VIRTUAL_RESOLVED_ID) return null
|
|
69
|
+
const config = WebsiteConfig.parse(opts.config)
|
|
70
|
+
return `export const config = ${JSON.stringify(config)}`
|
|
71
|
+
},
|
|
78
72
|
configureServer(server) {
|
|
79
|
-
server.watcher.add(opts.configPath)
|
|
80
|
-
server.watcher.add(join(
|
|
73
|
+
server.watcher.add(opts.config.configPath)
|
|
74
|
+
server.watcher.add(join(overridesRoot, "**", "*"))
|
|
75
|
+
server.watcher.add(join(SOURCE_DIR, "**", "*"))
|
|
81
76
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
const routesRoot = `${join(opts.overridesRoot, "routes")}/`
|
|
77
|
+
server.watcher.on("change", file => onChange(file, "change"))
|
|
78
|
+
server.watcher.on("add", file => onChange(file, "add"))
|
|
79
|
+
server.watcher.on("unlink", file => onChange(file, "unlink"))
|
|
86
80
|
|
|
87
|
-
|
|
88
|
-
if (file === opts.configPath) {
|
|
81
|
+
function onChange(file: string, kind: "change" | "add" | "unlink") {
|
|
82
|
+
if (file === opts.config.configPath) {
|
|
89
83
|
server.restart()
|
|
90
84
|
return
|
|
91
85
|
}
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
|
|
86
|
+
const overlayHit = matchOverlay(file, overridesRoot)
|
|
87
|
+
if (overlayHit) {
|
|
88
|
+
syncOverlay(overlayHit, kind, targetDir, overridesRoot)
|
|
89
|
+
if (kind !== "change") fullReload(server)
|
|
95
90
|
return
|
|
96
91
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
const rel = file.slice(root.length)
|
|
102
|
-
const subdir = opts.subdirs[i]
|
|
103
|
-
if (!subdir) continue
|
|
104
|
-
const defaultPath = join(opts.defaultsRoot, subdir, rel)
|
|
105
|
-
const mod = server.moduleGraph.getModuleById(defaultPath)
|
|
106
|
-
if (mod) server.moduleGraph.invalidateModule(mod)
|
|
107
|
-
server.ws.send({ type: "full-reload" })
|
|
108
|
-
return
|
|
92
|
+
const sourceHit = matchSource(file)
|
|
93
|
+
if (sourceHit) {
|
|
94
|
+
syncSource(sourceHit, kind, targetDir, overridesRoot)
|
|
95
|
+
if (kind !== "change") fullReload(server)
|
|
109
96
|
}
|
|
110
97
|
}
|
|
111
|
-
|
|
112
|
-
server.watcher.on("add", onChange)
|
|
113
|
-
server.watcher.on("unlink", onChange)
|
|
114
|
-
server.watcher.on("change", file => {
|
|
115
|
-
if (file === opts.configPath) server.restart()
|
|
116
|
-
})
|
|
117
98
|
},
|
|
118
99
|
}
|
|
119
100
|
}
|
|
101
|
+
|
|
102
|
+
interface Hit {
|
|
103
|
+
rel: string
|
|
104
|
+
category: "folder" | "file" | null
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function matchOverlay(file: string, overridesRoot: string): Hit | null {
|
|
108
|
+
const prefix = `${overridesRoot}${sep}`
|
|
109
|
+
if (!file.startsWith(prefix)) return null
|
|
110
|
+
const rel = file.slice(prefix.length)
|
|
111
|
+
return { rel, category: classify(rel) }
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function matchSource(file: string): Hit | null {
|
|
115
|
+
const prefix = `${SOURCE_DIR}${sep}`
|
|
116
|
+
if (!file.startsWith(prefix)) return null
|
|
117
|
+
// Skip the targets/ output dir itself (sibling of source/) and any
|
|
118
|
+
// `.gen.ts` files that downstream tools regenerate inside the target.
|
|
119
|
+
const rel = file.slice(prefix.length)
|
|
120
|
+
if (rel === "" || rel.includes("routeTree.gen.ts")) return null
|
|
121
|
+
return { rel, category: classify(rel) }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function classify(rel: string): "folder" | "file" | null {
|
|
125
|
+
const [head] = rel.split(sep)
|
|
126
|
+
if (head && ESCAPABLE_FOLDERS.includes(head)) return "folder"
|
|
127
|
+
if (ESCAPABLE_FILES.includes(rel)) return "file"
|
|
128
|
+
// Non-escapable source files still need to flow into target during
|
|
129
|
+
// livemark's own dev — the user is editing the canonical source.
|
|
130
|
+
return null
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function syncOverlay(
|
|
134
|
+
hit: Hit,
|
|
135
|
+
kind: "change" | "add" | "unlink",
|
|
136
|
+
targetDir: string,
|
|
137
|
+
overridesRoot: string,
|
|
138
|
+
) {
|
|
139
|
+
if (!hit.category) return
|
|
140
|
+
const dest = join(targetDir, hit.rel)
|
|
141
|
+
const source = join(SOURCE_DIR, hit.rel)
|
|
142
|
+
if (kind === "unlink") {
|
|
143
|
+
rmSync(dest, { force: true, recursive: true })
|
|
144
|
+
if (existsSync(source))
|
|
145
|
+
cpSync(source, dest, { recursive: true, force: true })
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
const overlay = join(overridesRoot, hit.rel)
|
|
149
|
+
if (existsSync(overlay))
|
|
150
|
+
cpSync(overlay, dest, { recursive: true, force: true })
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function syncSource(
|
|
154
|
+
hit: Hit,
|
|
155
|
+
kind: "change" | "add" | "unlink",
|
|
156
|
+
targetDir: string,
|
|
157
|
+
overridesRoot: string,
|
|
158
|
+
) {
|
|
159
|
+
// If the consumer has an overlay for this file (and it's escapable),
|
|
160
|
+
// the overlay wins — ignore source changes.
|
|
161
|
+
if (hit.category && existsSync(join(overridesRoot, hit.rel))) return
|
|
162
|
+
const dest = join(targetDir, hit.rel)
|
|
163
|
+
const source = join(SOURCE_DIR, hit.rel)
|
|
164
|
+
if (kind === "unlink") {
|
|
165
|
+
rmSync(dest, { force: true, recursive: true })
|
|
166
|
+
return
|
|
167
|
+
}
|
|
168
|
+
if (existsSync(source)) cpSync(source, dest, { recursive: true, force: true })
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function fullReload(server: ViteDevServer) {
|
|
172
|
+
server.ws.send({ type: "full-reload" })
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Resolve livemark.config.ts's `vite` field — either a config object
|
|
176
|
+
* or a function `(env) => config` (matching Vite's own `defineConfig`).
|
|
177
|
+
* Schema stores it as `unknown`; typing for the consumer's editor
|
|
178
|
+
* lives on {@link ViteOverride}. */
|
|
179
|
+
async function resolveViteOverride(
|
|
180
|
+
vite: unknown,
|
|
181
|
+
env: ConfigEnv,
|
|
182
|
+
): Promise<Record<string, unknown> | null> {
|
|
183
|
+
if (!vite) return null
|
|
184
|
+
if (typeof vite === "function") {
|
|
185
|
+
const result = await Reflect.apply(vite, undefined, [env])
|
|
186
|
+
return isObject(result) ? result : null
|
|
187
|
+
}
|
|
188
|
+
return isObject(vite) ? vite : null
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function isObject(v: unknown): v is Record<string, unknown> {
|
|
192
|
+
return v !== null && typeof v === "object"
|
|
193
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
|
+
|
|
7
|
+
// This file was automatically generated by TanStack Router.
|
|
8
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
+
|
|
11
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
12
|
+
import { Route as splatRouteImport } from './routes/$'
|
|
13
|
+
import { Route as IndexRouteImport } from './../.livemark/routes/index'
|
|
14
|
+
|
|
15
|
+
const splatRoute = splatRouteImport.update({
|
|
16
|
+
id: '/$',
|
|
17
|
+
path: '/$',
|
|
18
|
+
getParentRoute: () => rootRouteImport,
|
|
19
|
+
} as any)
|
|
20
|
+
const IndexRoute = IndexRouteImport.update({
|
|
21
|
+
id: '/',
|
|
22
|
+
path: '/',
|
|
23
|
+
getParentRoute: () => rootRouteImport,
|
|
24
|
+
} as any)
|
|
25
|
+
|
|
26
|
+
export interface FileRoutesByFullPath {
|
|
27
|
+
'/': typeof IndexRoute
|
|
28
|
+
'/$': typeof splatRoute
|
|
29
|
+
}
|
|
30
|
+
export interface FileRoutesByTo {
|
|
31
|
+
'/': typeof IndexRoute
|
|
32
|
+
'/$': typeof splatRoute
|
|
33
|
+
}
|
|
34
|
+
export interface FileRoutesById {
|
|
35
|
+
__root__: typeof rootRouteImport
|
|
36
|
+
'/': typeof IndexRoute
|
|
37
|
+
'/$': typeof splatRoute
|
|
38
|
+
}
|
|
39
|
+
export interface FileRouteTypes {
|
|
40
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
41
|
+
fullPaths: '/' | '/$'
|
|
42
|
+
fileRoutesByTo: FileRoutesByTo
|
|
43
|
+
to: '/' | '/$'
|
|
44
|
+
id: '__root__' | '/' | '/$'
|
|
45
|
+
fileRoutesById: FileRoutesById
|
|
46
|
+
}
|
|
47
|
+
export interface RootRouteChildren {
|
|
48
|
+
IndexRoute: typeof IndexRoute
|
|
49
|
+
splatRoute: typeof splatRoute
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare module '@tanstack/react-router' {
|
|
53
|
+
interface FileRoutesByPath {
|
|
54
|
+
'/$': {
|
|
55
|
+
id: '/$'
|
|
56
|
+
path: '/$'
|
|
57
|
+
fullPath: '/$'
|
|
58
|
+
preLoaderRoute: typeof splatRouteImport
|
|
59
|
+
parentRoute: typeof rootRouteImport
|
|
60
|
+
}
|
|
61
|
+
'/': {
|
|
62
|
+
id: '/'
|
|
63
|
+
path: '/'
|
|
64
|
+
fullPath: '/'
|
|
65
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
66
|
+
parentRoute: typeof rootRouteImport
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
72
|
+
IndexRoute: IndexRoute,
|
|
73
|
+
splatRoute: splatRoute,
|
|
74
|
+
}
|
|
75
|
+
export const routeTree = rootRouteImport
|
|
76
|
+
._addFileChildren(rootRouteChildren)
|
|
77
|
+
._addFileTypes<FileRouteTypes>()
|
|
78
|
+
|
|
79
|
+
import type { getRouter } from './router.tsx'
|
|
80
|
+
import type { createStart } from '@tanstack/react-start'
|
|
81
|
+
declare module '@tanstack/react-start' {
|
|
82
|
+
interface Register {
|
|
83
|
+
ssr: true
|
|
84
|
+
router: Awaited<ReturnType<typeof getRouter>>
|
|
85
|
+
}
|
|
86
|
+
}
|
package/source/routes/__root.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { TanStackDevtools } from "@tanstack/react-devtools"
|
|
2
3
|
import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools"
|
|
3
4
|
import {
|
|
@@ -19,21 +20,18 @@ import generalCss from "../styles/general.css?url"
|
|
|
19
20
|
|
|
20
21
|
export const Route = createRootRoute({
|
|
21
22
|
head: () => {
|
|
22
|
-
const favicon =
|
|
23
|
-
import.meta.env.CONFIG.favicon ??
|
|
24
|
-
import.meta.env.CONFIG.logo ??
|
|
25
|
-
defaultFavicon
|
|
23
|
+
const favicon = config.favicon ?? config.logo ?? defaultFavicon
|
|
26
24
|
return {
|
|
27
25
|
meta: [
|
|
28
26
|
{ charSet: "utf-8" },
|
|
29
|
-
{ title:
|
|
30
|
-
{ name: "description", content:
|
|
31
|
-
{ property: "og:title", content:
|
|
27
|
+
{ title: config.title },
|
|
28
|
+
{ name: "description", content: config.description },
|
|
29
|
+
{ property: "og:title", content: config.title },
|
|
32
30
|
{
|
|
33
31
|
property: "og:description",
|
|
34
|
-
content:
|
|
32
|
+
content: config.description,
|
|
35
33
|
},
|
|
36
|
-
{ property: "og:site_name", content:
|
|
34
|
+
{ property: "og:site_name", content: config.title },
|
|
37
35
|
{ property: "og:type", content: "website" },
|
|
38
36
|
{
|
|
39
37
|
name: "viewport",
|
package/source/settings.ts
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/** Subdirs of source/ where consumer files in `.livemark/<folder>/` are
|
|
2
|
+
* merged per-file into the runtime mount, with `.livemark` winning on
|
|
3
|
+
* conflict. */
|
|
4
|
+
export const ESCAPABLE_FOLDERS: readonly string[] = [
|
|
3
5
|
"components",
|
|
4
6
|
"elements",
|
|
5
7
|
"styles",
|
|
8
|
+
"routes",
|
|
9
|
+
"public",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
/** Top-level source files that `.livemark/<file>` can replace atomically. */
|
|
13
|
+
export const ESCAPABLE_FILES: readonly string[] = [
|
|
14
|
+
"client.tsx",
|
|
15
|
+
"server.ts",
|
|
16
|
+
"router.tsx",
|
|
6
17
|
]
|
|
7
18
|
|
|
8
19
|
/** Glob patterns auto-excluded from content scanning when the consumer's
|
package/source/vite.config.ts
CHANGED
|
@@ -1,103 +1,29 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs"
|
|
2
|
-
import { join, relative } from "node:path"
|
|
3
1
|
import contentCollections from "@content-collections/vite"
|
|
4
2
|
import tailwind from "@tailwindcss/vite"
|
|
5
3
|
import { devtools } from "@tanstack/devtools-vite"
|
|
6
4
|
import { tanstackStart } from "@tanstack/react-start/plugin/vite"
|
|
7
|
-
import {
|
|
8
|
-
physical,
|
|
9
|
-
rootRoute,
|
|
10
|
-
route,
|
|
11
|
-
type VirtualRouteNode,
|
|
12
|
-
} from "@tanstack/virtual-file-routes"
|
|
13
5
|
import react from "@vitejs/plugin-react"
|
|
14
6
|
import { defineConfig } from "vite"
|
|
15
7
|
import svgr from "vite-plugin-svgr"
|
|
16
8
|
import { loadConfig } from "./actions/config/load.ts"
|
|
17
|
-
import { WebsiteConfig } from "./models/config.ts"
|
|
18
|
-
import { OVERRIDE_SUBDIRS } from "./settings.ts"
|
|
19
9
|
import { livemark } from "./plugins/vite-livemark.ts"
|
|
20
10
|
|
|
21
11
|
const config = await loadConfig()
|
|
22
|
-
const sourceDir = import.meta.dirname
|
|
23
|
-
const sourceRelative = relative(config.root, sourceDir)
|
|
24
|
-
const overridesRoot = join(config.root, ".livemark")
|
|
25
|
-
|
|
26
|
-
// Seed `.livemark/.gitignore` on first run so Vite's build/cache
|
|
27
|
-
// artifacts never get committed by accident. On the same first-run
|
|
28
|
-
// trigger, also seed an `.npmrc` when pnpm is in use: pnpm's strict
|
|
29
|
-
// isolation hides livemark's transitive deps (react, @tanstack/*) from
|
|
30
|
-
// Vite's optimizer, which walks from config.root rather than livemark's
|
|
31
|
-
// subtree. The public-hoist-pattern entries make those deps reachable
|
|
32
|
-
// from the consumer's top-level node_modules. Skip when the consumer
|
|
33
|
-
// already authored their own `.npmrc` — never overwrite user config.
|
|
34
|
-
const gitignorePath = join(overridesRoot, ".gitignore")
|
|
35
|
-
if (!existsSync(gitignorePath)) {
|
|
36
|
-
mkdirSync(overridesRoot, { recursive: true })
|
|
37
|
-
writeFileSync(gitignorePath, "/build\n/cache\n")
|
|
38
|
-
|
|
39
|
-
const npmrcPath = join(config.root, ".npmrc")
|
|
40
|
-
const usingPnpm = existsSync(join(config.root, "pnpm-lock.yaml"))
|
|
41
|
-
if (usingPnpm && !existsSync(npmrcPath)) {
|
|
42
|
-
writeFileSync(
|
|
43
|
-
npmrcPath,
|
|
44
|
-
"public-hoist-pattern[]=react\n" +
|
|
45
|
-
"public-hoist-pattern[]=react-*\n" +
|
|
46
|
-
"public-hoist-pattern[]=@tanstack/*\n",
|
|
47
|
-
)
|
|
48
|
-
console.log(
|
|
49
|
-
"Created .npmrc with hoist patterns for pnpm. Run `pnpm install` to apply.",
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const routeChildren: VirtualRouteNode[] = [route("/$", "$.tsx")]
|
|
55
|
-
if (existsSync(join(overridesRoot, "routes"))) {
|
|
56
|
-
// physical(dir) resolves `dir` relative to the routes directory
|
|
57
|
-
// (`srcDirectory/routes`). A hardcoded "../../.livemark/routes" only
|
|
58
|
-
// works when source/ sits one level under config.root — it lands at
|
|
59
|
-
// node_modules/.livemark/routes once livemark is installed. Compute
|
|
60
|
-
// the path dynamically from the consumer's actual layout.
|
|
61
|
-
const routesDir = join(sourceDir, "routes")
|
|
62
|
-
routeChildren.push(
|
|
63
|
-
physical(relative(routesDir, join(overridesRoot, "routes"))),
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
12
|
|
|
67
13
|
export default defineConfig({
|
|
68
|
-
root: config.root,
|
|
69
|
-
publicDir: join(config.root, ".livemark", "public"),
|
|
70
|
-
build: { outDir: ".livemark/build" },
|
|
71
|
-
define: {
|
|
72
|
-
"import.meta.env.CONFIG": JSON.stringify(WebsiteConfig.parse(config)),
|
|
73
|
-
},
|
|
74
|
-
// peerDependencies guarantee one canonical react/react-dom in the pnpm
|
|
75
|
-
// store. dedupe collapses any transitive resolutions to that copy.
|
|
76
|
-
resolve: {
|
|
77
|
-
dedupe: ["react", "react-dom"],
|
|
78
|
-
},
|
|
79
14
|
plugins: [
|
|
80
|
-
livemark({
|
|
81
|
-
defaultsRoot: sourceDir,
|
|
82
|
-
overridesRoot,
|
|
83
|
-
subdirs: [...OVERRIDE_SUBDIRS],
|
|
84
|
-
configPath: config.configPath,
|
|
85
|
-
}),
|
|
15
|
+
livemark({ config }),
|
|
86
16
|
devtools(),
|
|
87
17
|
tailwind(),
|
|
88
|
-
contentCollections({
|
|
89
|
-
configPath: join(sourceRelative, "content-collections.ts"),
|
|
90
|
-
}),
|
|
18
|
+
contentCollections({ configPath: "content-collections.ts" }),
|
|
91
19
|
tanstackStart({
|
|
92
|
-
srcDirectory:
|
|
20
|
+
srcDirectory: ".",
|
|
93
21
|
pages: [{ path: "/" }],
|
|
94
22
|
prerender: { enabled: true, crawlLinks: true },
|
|
95
23
|
sitemap: config.site
|
|
96
24
|
? { enabled: true, host: config.site }
|
|
97
25
|
: { enabled: false },
|
|
98
|
-
router: {
|
|
99
|
-
virtualRouteConfig: rootRoute("__root.tsx", routeChildren),
|
|
100
|
-
},
|
|
26
|
+
router: { generatedRouteTree: "routeTree.gen.ts" },
|
|
101
27
|
}),
|
|
102
28
|
react(),
|
|
103
29
|
svgr(),
|