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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { config } from "livemark:virtual";
|
|
3
|
+
import { TanStackDevtools } from "@tanstack/react-devtools";
|
|
4
|
+
import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools";
|
|
5
|
+
import { createRootRoute, HeadContent, Outlet, Scripts, useMatch, } from "@tanstack/react-router";
|
|
6
|
+
import { TanStackRouterDevtoolsPanel } from "@tanstack/react-router-devtools";
|
|
7
|
+
import { Layout } from "../components/Layout.js";
|
|
8
|
+
import { DefaultCatchBoundary } from "../components/DefaultCatchBoundary.js";
|
|
9
|
+
import { NotFound } from "../components/NotFound.js";
|
|
10
|
+
import { Toaster } from "../elements/sonner.js";
|
|
11
|
+
import { faviconType } from "../helpers/favicon.js";
|
|
12
|
+
import defaultFavicon from "../assets/logo.svg";
|
|
13
|
+
import generalCss from "../styles/general.css?url";
|
|
14
|
+
export const Route = createRootRoute({
|
|
15
|
+
head: () => {
|
|
16
|
+
const favicon = config.favicon ?? config.logo ?? defaultFavicon;
|
|
17
|
+
return {
|
|
18
|
+
meta: [
|
|
19
|
+
{ charSet: "utf-8" },
|
|
20
|
+
{ title: config.title },
|
|
21
|
+
{ name: "description", content: config.description },
|
|
22
|
+
{ property: "og:title", content: config.title },
|
|
23
|
+
{
|
|
24
|
+
property: "og:description",
|
|
25
|
+
content: config.description,
|
|
26
|
+
},
|
|
27
|
+
{ property: "og:site_name", content: config.title },
|
|
28
|
+
{ property: "og:type", content: "website" },
|
|
29
|
+
{
|
|
30
|
+
name: "viewport",
|
|
31
|
+
content: "width=device-width, initial-scale=1",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
links: [
|
|
35
|
+
{ rel: "icon", href: favicon, type: faviconType(favicon) },
|
|
36
|
+
{ rel: "stylesheet", href: generalCss },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
notFoundComponent: () => _jsx(NotFound, {}),
|
|
41
|
+
errorComponent: props => {
|
|
42
|
+
return (_jsx(Document, { children: _jsx(DefaultCatchBoundary, { ...props }) }));
|
|
43
|
+
},
|
|
44
|
+
component: () => {
|
|
45
|
+
return (_jsx(Document, { children: _jsx(Outlet, {}) }));
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
function Document(props) {
|
|
49
|
+
const articleRoute = useMatch({ from: "/$", shouldThrow: false });
|
|
50
|
+
const withSidebar = articleRoute?.loaderData?.sidebar;
|
|
51
|
+
return (_jsxs("html", { lang: "en", children: [
|
|
52
|
+
_jsx("head", { children: _jsx(HeadContent, {}) }), _jsxs("body", { children: [
|
|
53
|
+
_jsx(Layout, { withSidebar: withSidebar, children: props.children }), _jsx(Toaster, { position: "top-center" }), _jsx(TanStackDevtools, { config: { hideUntilHover: true, position: "bottom-left" }, plugins: [
|
|
54
|
+
{
|
|
55
|
+
name: "TanStack Query",
|
|
56
|
+
render: _jsx(ReactQueryDevtoolsPanel, {}),
|
|
57
|
+
defaultOpen: true,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "TanStack Router",
|
|
61
|
+
render: _jsx(TanStackRouterDevtoolsPanel, {}),
|
|
62
|
+
defaultOpen: false,
|
|
63
|
+
},
|
|
64
|
+
] }), _jsx(Scripts, {})
|
|
65
|
+
] })
|
|
66
|
+
] }));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiX19yb290LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc291cmNlL3JvdXRlcy9fX3Jvb3QudHN4Il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iBcImJvdHRvbS1sZWZ0XCIgfX1cbiAgICAgICAgICBwbHVnaW5zPXtbXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIG5hbWU6IFwiVGFuU3RhY2sgUXVlcnlcIixcbiAgICAgICAgICAgICAgcmVuZGVyOiA8UmVhY3RRdWVyeURldnRvb2xzUGFuZWwgLz4sXG4gICAgICAgICAgICAgIGRlZmF1bHRPcGVuOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgbmFtZTogXCJUYW5TdGFjayBSb3V0ZXJcIixcbiAgICAgICAgICAgICAgcmVuZGVyOiA8VGFuU3RhY2tSb3V0ZXJEZXZ0b29sc1BhbmVsIC8+LFxuICAgICAgICAgICAgICBkZWZhdWx0T3BlbjogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgIF19XG4gICAgICAgIC8+XG4gICAgICAgIDxTY3JpcHRzIC8+XG4gICAgICA8L2JvZHk+XG4gICAgPC9odG1sPlxuICApXG59XG4iXX0=
|
|
@@ -0,0 +1,9 @@
|
|
|
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 declare const ESCAPABLE_FOLDERS: readonly string[];
|
|
5
|
+
/** Top-level source files that `.livemark/<file>` can replace atomically. */
|
|
6
|
+
export declare const ESCAPABLE_FILES: readonly string[];
|
|
7
|
+
/** Glob patterns auto-excluded from content scanning when the consumer's
|
|
8
|
+
* project doesn't ship a `.gitignore` to declare its own exclusions. */
|
|
9
|
+
export declare const DEFAULT_EXCLUDES: readonly string[];
|
|
@@ -0,0 +1,25 @@
|
|
|
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 = [
|
|
5
|
+
"components",
|
|
6
|
+
"elements",
|
|
7
|
+
"styles",
|
|
8
|
+
"routes",
|
|
9
|
+
"public",
|
|
10
|
+
];
|
|
11
|
+
/** Top-level source files that `.livemark/<file>` can replace atomically. */
|
|
12
|
+
export const ESCAPABLE_FILES = [
|
|
13
|
+
"client.tsx",
|
|
14
|
+
"server.ts",
|
|
15
|
+
"router.tsx",
|
|
16
|
+
];
|
|
17
|
+
/** Glob patterns auto-excluded from content scanning when the consumer's
|
|
18
|
+
* project doesn't ship a `.gitignore` to declare its own exclusions. */
|
|
19
|
+
export const DEFAULT_EXCLUDES = [
|
|
20
|
+
"**/node_modules/**",
|
|
21
|
+
"**/.git/**",
|
|
22
|
+
"**/build/**",
|
|
23
|
+
"**/dist/**",
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dGluZ3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zb3VyY2Uvc2V0dGluZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O2dCQUVnQjtBQUNoQixNQUFNLENBQUMsTUFBTSxpQkFBaUIsR0FBc0I7SUFDbEQsWUFBWTtJQUNaLFVBQVU7SUFDVixRQUFRO0lBQ1IsUUFBUTtJQUNSLFFBQVE7Q0FDVCxDQUFBO0FBRUQsNkVBQTZFO0FBQzdFLE1BQU0sQ0FBQyxNQUFNLGVBQWUsR0FBc0I7SUFDaEQsWUFBWTtJQUNaLFdBQVc7SUFDWCxZQUFZO0NBQ2IsQ0FBQTtBQUVEO3lFQUN5RTtBQUN6RSxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBc0I7SUFDakQsb0JBQW9CO0lBQ3BCLFlBQVk7SUFDWixhQUFhO0lBQ2IsWUFBWTtDQUNiLENBQUEiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogU3ViZGlycyBvZiBzb3VyY2UvIHdoZXJlIGNvbnN1bWVyIGZpbGVzIGluIGAubGl2ZW1hcmsvPGZvbGRlcj4vYCBhcmVcbiAqICBtZXJnZWQgcGVyLWZpbGUgaW50byB0aGUgcnVudGltZSBtb3VudCwgd2l0aCBgLmxpdmVtYXJrYCB3aW5uaW5nIG9uXG4gKiAgY29uZmxpY3QuICovXG5leHBvcnQgY29uc3QgRVNDQVBBQkxFX0ZPTERFUlM6IHJlYWRvbmx5IHN0cmluZ1tdID0gW1xuICBcImNvbXBvbmVudHNcIixcbiAgXCJlbGVtZW50c1wiLFxuICBcInN0eWxlc1wiLFxuICBcInJvdXRlc1wiLFxuICBcInB1YmxpY1wiLFxuXVxuXG4vKiogVG9wLWxldmVsIHNvdXJjZSBmaWxlcyB0aGF0IGAubGl2ZW1hcmsvPGZpbGU+YCBjYW4gcmVwbGFjZSBhdG9taWNhbGx5LiAqL1xuZXhwb3J0IGNvbnN0IEVTQ0FQQUJMRV9GSUxFUzogcmVhZG9ubHkgc3RyaW5nW10gPSBbXG4gIFwiY2xpZW50LnRzeFwiLFxuICBcInNlcnZlci50c1wiLFxuICBcInJvdXRlci50c3hcIixcbl1cblxuLyoqIEdsb2IgcGF0dGVybnMgYXV0by1leGNsdWRlZCBmcm9tIGNvbnRlbnQgc2Nhbm5pbmcgd2hlbiB0aGUgY29uc3VtZXInc1xuICogIHByb2plY3QgZG9lc24ndCBzaGlwIGEgYC5naXRpZ25vcmVgIHRvIGRlY2xhcmUgaXRzIG93biBleGNsdXNpb25zLiAqL1xuZXhwb3J0IGNvbnN0IERFRkFVTFRfRVhDTFVERVM6IHJlYWRvbmx5IHN0cmluZ1tdID0gW1xuICBcIioqL25vZGVfbW9kdWxlcy8qKlwiLFxuICBcIioqLy5naXQvKipcIixcbiAgXCIqKi9idWlsZC8qKlwiLFxuICBcIioqL2Rpc3QvKipcIixcbl1cbiJdfQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import contentCollections from "@content-collections/vite";
|
|
2
|
+
import tailwind from "@tailwindcss/vite";
|
|
3
|
+
import { devtools } from "@tanstack/devtools-vite";
|
|
4
|
+
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
5
|
+
import react from "@vitejs/plugin-react";
|
|
6
|
+
import { defineConfig } from "vite";
|
|
7
|
+
import svgr from "vite-plugin-svgr";
|
|
8
|
+
import { loadConfig } from "./actions/config/load.js";
|
|
9
|
+
import { livemark } from "./plugins/vite-livemark.js";
|
|
10
|
+
const config = await loadConfig();
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
plugins: [
|
|
13
|
+
livemark({ config }),
|
|
14
|
+
devtools(),
|
|
15
|
+
tailwind(),
|
|
16
|
+
contentCollections({ configPath: "content-collections.ts" }),
|
|
17
|
+
tanstackStart({
|
|
18
|
+
srcDirectory: ".",
|
|
19
|
+
pages: [{ path: "/" }],
|
|
20
|
+
prerender: { enabled: true, crawlLinks: true },
|
|
21
|
+
sitemap: config.site
|
|
22
|
+
? { enabled: true, host: config.site }
|
|
23
|
+
: { enabled: false },
|
|
24
|
+
router: { generatedRouteTree: "routeTree.gen.ts" },
|
|
25
|
+
}),
|
|
26
|
+
react(),
|
|
27
|
+
svgr(),
|
|
28
|
+
],
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidml0ZS5jb25maWcuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zb3VyY2Uvdml0ZS5jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxrQkFBa0IsTUFBTSwyQkFBMkIsQ0FBQTtBQUMxRCxPQUFPLFFBQVEsTUFBTSxtQkFBbUIsQ0FBQTtBQUN4QyxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0seUJBQXlCLENBQUE7QUFDbEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1DQUFtQyxDQUFBO0FBQ2pFLE9BQU8sS0FBSyxN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BjcmF3bExpbmtzOiB0cnVlIH0sXG4gICAgICBzaXRlbWFwOiBjb25maWcuc2l0ZVxuICAgICAgICA/IHsgZW5hYmxlZDogdHJ1ZSwgaG9zdDogY29uZmlnLnNpdGUgfVxuICAgICAgICA6IHsgZW5hYmxlZDogZmFsc2UgfSxcbiAgICAgIHJvdXRlcjogeyBnZW5lcmF0ZWRSb3V0ZVRyZWU6IFwicm91dGVUcmVlLmdlbi50c1wiIH0sXG4gICAgfSksXG4gICAgcmVhY3QoKSxcbiAgICBzdmdyKCksXG4gIF0sXG59KVxuIl19
|
package/package.json
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livemark",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Livemark description",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Evgeny Karev",
|
|
7
7
|
"repository": "https://github.com/datisthq/livemark",
|
|
8
8
|
"bin": {
|
|
9
|
-
"livemark": "./
|
|
9
|
+
"livemark": "./build/entrypoints/main.js"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
|
-
"
|
|
12
|
+
"build",
|
|
13
13
|
"source",
|
|
14
|
-
"!source/routeTree.gen.ts",
|
|
15
14
|
"skills"
|
|
16
15
|
],
|
|
17
16
|
"type": "module",
|
|
18
17
|
"sideEffects": false,
|
|
19
18
|
"exports": {
|
|
20
|
-
".": "./
|
|
19
|
+
".": "./build/index.js",
|
|
21
20
|
"./components/*": "./source/components/*.tsx",
|
|
22
21
|
"./elements/*": "./source/elements/*.tsx",
|
|
23
22
|
"./hooks/*": "./source/hooks/*.ts",
|
|
@@ -92,6 +91,7 @@
|
|
|
92
91
|
"zod": "4.3.6"
|
|
93
92
|
},
|
|
94
93
|
"devDependencies": {
|
|
94
|
+
"@plausible-analytics/tracker": "^0.4.4",
|
|
95
95
|
"@semantic-release/exec": "7.1.0",
|
|
96
96
|
"@types/node": "24.2.0",
|
|
97
97
|
"@typescript/native-preview": "7.0.0-dev.20260316.1",
|
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
"husky": "9.1.7",
|
|
101
101
|
"is-ci": "4.1.0",
|
|
102
102
|
"lefthook": "2.1.1",
|
|
103
|
+
"livemark": "link:.",
|
|
103
104
|
"npm-check-updates": "18.0.1",
|
|
104
105
|
"react": "19.2.4",
|
|
105
106
|
"react-dom": "19.2.4",
|
|
@@ -118,15 +119,16 @@
|
|
|
118
119
|
"pnpm": "^10.0.0"
|
|
119
120
|
},
|
|
120
121
|
"scripts": {
|
|
121
|
-
"build": "tsgo",
|
|
122
|
+
"build": "tsgo --project tsconfig.build.json",
|
|
122
123
|
"bump": "ncu -u",
|
|
123
|
-
"clean": "rm -rf pnpm-lock.yaml node_modules
|
|
124
|
+
"clean": "rm -rf pnpm-lock.yaml node_modules build",
|
|
124
125
|
"docs:build": "node source/entrypoints/main.ts build",
|
|
125
126
|
"docs:start": "node source/entrypoints/main.ts start",
|
|
126
127
|
"format": "vp fmt",
|
|
127
128
|
"lint": "vp fmt --check && vp lint",
|
|
128
129
|
"release": "pnpm publish --access public --ignore-scripts --no-git-checks",
|
|
129
130
|
"setversion": "pnpm version --no-git-tag-version",
|
|
131
|
+
"start": "pnpm build && livemark start",
|
|
130
132
|
"unit": "vp test",
|
|
131
133
|
"test": "pnpm lint && pnpm type && pnpm unit",
|
|
132
134
|
"type": "tsgo --noEmit"
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
access,
|
|
3
|
+
mkdir,
|
|
4
|
+
readFile,
|
|
5
|
+
readdir,
|
|
6
|
+
rm,
|
|
7
|
+
writeFile,
|
|
8
|
+
} from "node:fs/promises"
|
|
2
9
|
import { dirname, join, resolve } from "node:path"
|
|
3
10
|
import slugify from "@sindresorhus/slugify"
|
|
4
11
|
import type { Root, RootContent } from "mdast"
|
|
@@ -10,6 +17,7 @@ import { visit } from "unist-util-visit"
|
|
|
10
17
|
import type { Config } from "../../models/config.ts"
|
|
11
18
|
import type { ChangelogSection } from "../../models/section.ts"
|
|
12
19
|
import { isGitHubUrl, parseGitHubRepo } from "../../helpers/changelog-source.ts"
|
|
20
|
+
import { targetDirFor } from "../target/build.ts"
|
|
13
21
|
|
|
14
22
|
interface Release {
|
|
15
23
|
tag_name: string
|
|
@@ -32,8 +40,7 @@ interface ChangelogEntry {
|
|
|
32
40
|
sourceUrl?: string
|
|
33
41
|
}
|
|
34
42
|
|
|
35
|
-
const
|
|
36
|
-
const META_FILE = ".livemark/cache/changelog.meta.json"
|
|
43
|
+
const CACHE_SUBDIR = "cache/changelog"
|
|
37
44
|
|
|
38
45
|
const parser = unified().use(remarkParse)
|
|
39
46
|
const stringifier = unified().use(remarkStringify, {
|
|
@@ -42,17 +49,25 @@ const stringifier = unified().use(remarkStringify, {
|
|
|
42
49
|
emphasis: "_",
|
|
43
50
|
})
|
|
44
51
|
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
/** Glob (absolute path) covering all cached changelog markdown files for
|
|
53
|
+
* a given consumer. Used by content-collections to include them in the
|
|
54
|
+
* article scan. */
|
|
55
|
+
export function cacheIncludeGlob(config: Config) {
|
|
56
|
+
return join(targetDirFor(config.configPath), CACHE_SUBDIR, "**", "*.md")
|
|
47
57
|
}
|
|
48
58
|
|
|
49
|
-
/** Build the per-version changelog cache files
|
|
59
|
+
/** Build the per-version changelog cache files. Livemark allows one
|
|
60
|
+
* changelog per project, so all cache state lives in a single
|
|
61
|
+
* `cache/changelog/`: the rendered `.md` entries plus a `meta.json`
|
|
62
|
+
* holding the etag for conditional GETs. On refresh we wipe only the
|
|
63
|
+
* `.md` files, leaving meta intact. */
|
|
50
64
|
export async function buildChangelog(
|
|
51
65
|
section: ChangelogSection,
|
|
52
66
|
config: Config,
|
|
53
67
|
) {
|
|
54
|
-
const
|
|
55
|
-
const
|
|
68
|
+
const targetDir = targetDirFor(config.configPath)
|
|
69
|
+
const cacheDir = join(targetDir, CACHE_SUBDIR)
|
|
70
|
+
const metaPath = join(cacheDir, "meta.json")
|
|
56
71
|
|
|
57
72
|
const entries = isGitHubUrl(section.source)
|
|
58
73
|
? await buildFromGitHub(section.source, metaPath, cacheDir)
|
|
@@ -60,8 +75,10 @@ export async function buildChangelog(
|
|
|
60
75
|
|
|
61
76
|
if (entries === undefined) return
|
|
62
77
|
|
|
63
|
-
await rm(cacheDir, { recursive: true, force: true })
|
|
64
78
|
await mkdir(cacheDir, { recursive: true })
|
|
79
|
+
for (const f of await readdir(cacheDir).catch(() => [])) {
|
|
80
|
+
if (f.endsWith(".md")) await rm(join(cacheDir, f), { force: true })
|
|
81
|
+
}
|
|
65
82
|
|
|
66
83
|
for (const entry of entries) {
|
|
67
84
|
const markdown = wrapFrontmatter(entry, section)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { existsSync } from "node:fs"
|
|
1
2
|
import { dirname, resolve } from "node:path"
|
|
2
3
|
import { pathToFileURL } from "node:url"
|
|
3
4
|
import type { z } from "zod"
|
|
@@ -7,16 +8,30 @@ import { defineConfig } from "./define.ts"
|
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Load and validate a config file, checking --config/-c CLI arg, then cwd.
|
|
11
|
+
*
|
|
12
|
+
* If a path is provided explicitly (arg or `--config`/`-c`) and the
|
|
13
|
+
* file is missing, throws — the user asked for a specific config and
|
|
14
|
+
* it isn't there. If no path is provided and no `livemark.config.ts`
|
|
15
|
+
* exists in cwd, falls back to the default config with a synthesized
|
|
16
|
+
* `configPath = <cwd>/livemark.config.ts` so downstream code (target
|
|
17
|
+
* hash, watcher) still has a stable per-project key.
|
|
10
18
|
*/
|
|
11
19
|
export async function loadConfig(path?: string): Promise<Config> {
|
|
12
20
|
const configIndex = process.argv.findIndex(
|
|
13
21
|
a => a === "-c" || a === "--config",
|
|
14
22
|
)
|
|
15
23
|
const cliPath = configIndex !== -1 ? process.argv[configIndex + 1] : undefined
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
const explicit = path ?? cliPath
|
|
25
|
+
const resolved = resolve(explicit ?? "livemark.config.ts")
|
|
26
|
+
let input: z.input<typeof UserConfig> = {}
|
|
27
|
+
if (existsSync(resolved)) {
|
|
28
|
+
// Cache-bust the ESM import so dev-server restart reloads edits on disk.
|
|
29
|
+
const url = `${pathToFileURL(resolved).href}?t=${Date.now()}`
|
|
30
|
+
const module: Record<string, unknown> = await import(url)
|
|
31
|
+
input = (module.default as z.input<typeof UserConfig>) ?? {}
|
|
32
|
+
} else if (explicit) {
|
|
33
|
+
throw new Error(`Config file not found: ${resolved}`)
|
|
34
|
+
}
|
|
35
|
+
const validated = defineConfig(input)
|
|
36
|
+
return { ...validated, root: dirname(resolved), configPath: resolved }
|
|
22
37
|
}
|
|
@@ -5,10 +5,27 @@ import { describe, expect, it } from "vite-plus/test"
|
|
|
5
5
|
import { loadConfig } from "./load.ts"
|
|
6
6
|
|
|
7
7
|
describe("loadConfig", () => {
|
|
8
|
-
it("should throw when
|
|
9
|
-
await expect(loadConfig("/nonexistent/config.ts")).rejects.toThrow(
|
|
8
|
+
it("should throw when an explicit path points at a missing file", async () => {
|
|
9
|
+
await expect(loadConfig("/nonexistent/config.ts")).rejects.toThrow(
|
|
10
|
+
/not found/,
|
|
11
|
+
)
|
|
10
12
|
})
|
|
11
13
|
|
|
14
|
+
it("should return defaults when no path is given and cwd has no config", () =>
|
|
15
|
+
temporaryDirectoryTask(async tmpDir => {
|
|
16
|
+
const cwd = process.cwd()
|
|
17
|
+
try {
|
|
18
|
+
process.chdir(tmpDir)
|
|
19
|
+
const config = await loadConfig()
|
|
20
|
+
expect(config.title).toBe("Livemark")
|
|
21
|
+
expect(config.include).toBe("**/*.md")
|
|
22
|
+
expect(config.root).toBe(tmpDir)
|
|
23
|
+
expect(config.configPath).toBe(join(tmpDir, "livemark.config.ts"))
|
|
24
|
+
} finally {
|
|
25
|
+
process.chdir(cwd)
|
|
26
|
+
}
|
|
27
|
+
}))
|
|
28
|
+
|
|
12
29
|
it("should load config from explicit path", () =>
|
|
13
30
|
temporaryDirectoryTask(async tmpDir => {
|
|
14
31
|
const configPath = join(tmpDir, "livemark.config.ts")
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createHash } from "node:crypto"
|
|
2
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, rmSync } from "node:fs"
|
|
3
|
+
import { dirname, join } from "node:path"
|
|
4
|
+
import { ESCAPABLE_FILES, ESCAPABLE_FOLDERS } from "../../settings.ts"
|
|
5
|
+
|
|
6
|
+
// This file ships at <livemark-pkg>/source/actions/target/build.ts AND
|
|
7
|
+
// gets copied into <livemark-pkg>/targets/<hash>/actions/target/build.ts
|
|
8
|
+
// as part of every per-consumer mount. content-collections loads the
|
|
9
|
+
// COPIED version, so `import.meta.dirname` can land inside `targets/`.
|
|
10
|
+
// Walk up to the first directory holding livemark's `package.json` so
|
|
11
|
+
// SOURCE_DIR / TARGETS_ROOT always anchor at the package, never at a
|
|
12
|
+
// per-consumer dir.
|
|
13
|
+
const LIVEMARK_PKG = findLivemarkPkg(import.meta.dirname)
|
|
14
|
+
const SOURCE_DIR = join(LIVEMARK_PKG, "source")
|
|
15
|
+
const TARGETS_ROOT = join(LIVEMARK_PKG, "targets")
|
|
16
|
+
|
|
17
|
+
function findLivemarkPkg(start: string) {
|
|
18
|
+
let cur = start
|
|
19
|
+
while (cur !== dirname(cur)) {
|
|
20
|
+
if (existsSync(join(cur, "package.json"))) return cur
|
|
21
|
+
cur = dirname(cur)
|
|
22
|
+
}
|
|
23
|
+
throw new Error(`Could not locate livemark package root from ${start}`)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Synthesize a fully self-contained per-consumer Vite mount at
|
|
28
|
+
* `<livemark-pkg>/targets/<hash>/`.
|
|
29
|
+
*
|
|
30
|
+
* The mount is built by copying livemark's `source/` wholesale, then
|
|
31
|
+
* overlaying any matching files from the consumer's `.livemark/`. Every
|
|
32
|
+
* file lives at its target path as a real file — no symlinks — so
|
|
33
|
+
* Vite's relative-import and bare-specifier resolution all anchor
|
|
34
|
+
* inside the target dir, where node_modules walks reach livemark's pnpm
|
|
35
|
+
* subtree natively.
|
|
36
|
+
*
|
|
37
|
+
* Behavior:
|
|
38
|
+
* - First run (target dir missing): full source copy + overlay.
|
|
39
|
+
* - Subsequent runs: skip the source copy. Source is immutable in
|
|
40
|
+
* installed mode; in livemark's own dev the watcher keeps the target
|
|
41
|
+
* in sync. Only the `.livemark/` overlay is re-applied each time —
|
|
42
|
+
* cheap, and may have changed between runs.
|
|
43
|
+
* - With `--clear` in argv: wipe the entire target dir (including
|
|
44
|
+
* downstream caches like `.vite/`, `.content-collections/`,
|
|
45
|
+
* `cache/`, `routeTree.gen.ts`) and rebuild from scratch. Use this
|
|
46
|
+
* to recover from a stale or corrupted cache.
|
|
47
|
+
*
|
|
48
|
+
* Returns the absolute path to the target dir.
|
|
49
|
+
*/
|
|
50
|
+
export function buildTarget(configPath: string) {
|
|
51
|
+
const targetDir = targetDirFor(configPath)
|
|
52
|
+
const overridesRoot = join(dirname(configPath), ".livemark")
|
|
53
|
+
const clear = process.argv.includes("--clear")
|
|
54
|
+
|
|
55
|
+
if (clear) rmSync(targetDir, { recursive: true, force: true })
|
|
56
|
+
|
|
57
|
+
if (!existsSync(targetDir)) {
|
|
58
|
+
mkdirSync(targetDir, { recursive: true })
|
|
59
|
+
cpSync(SOURCE_DIR, targetDir, { recursive: true })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
for (const folder of ESCAPABLE_FOLDERS) {
|
|
63
|
+
const overlay = join(overridesRoot, folder)
|
|
64
|
+
if (!existsSync(overlay)) continue
|
|
65
|
+
const dest = join(targetDir, folder)
|
|
66
|
+
if (!existsSync(dest)) mkdirSync(dest, { recursive: true })
|
|
67
|
+
for (const f of readdirSync(overlay)) {
|
|
68
|
+
cpSync(join(overlay, f), join(dest, f), { recursive: true, force: true })
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (const file of ESCAPABLE_FILES) {
|
|
72
|
+
const overlay = join(overridesRoot, file)
|
|
73
|
+
if (!existsSync(overlay)) continue
|
|
74
|
+
cpSync(overlay, join(targetDir, file), { force: true })
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return targetDir
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Compute the target dir for a given consumer config path without
|
|
81
|
+
* rebuilding it. Used by code that needs to write into the target
|
|
82
|
+
* (e.g. cache writers) outside of `buildTarget`'s setup phase. */
|
|
83
|
+
export function targetDirFor(configPath: string) {
|
|
84
|
+
const hash = createHash("sha256")
|
|
85
|
+
.update(configPath)
|
|
86
|
+
.digest("hex")
|
|
87
|
+
.slice(0, 16)
|
|
88
|
+
return join(TARGETS_ROOT, hash)
|
|
89
|
+
}
|
package/source/commands/build.ts
CHANGED
|
@@ -15,6 +15,7 @@ const configFile = join(
|
|
|
15
15
|
*/
|
|
16
16
|
export const build = new Command("build")
|
|
17
17
|
.description("Build the site for production")
|
|
18
|
+
.option("--clear", "Wipe and fully rebuild the runtime target dir")
|
|
18
19
|
.action(async () => {
|
|
19
20
|
const builder = await createBuilder({ configFile })
|
|
20
21
|
await builder.buildApp()
|
|
@@ -9,37 +9,41 @@ import {
|
|
|
9
9
|
import { dirname, join } from "node:path"
|
|
10
10
|
import { Command } from "commander"
|
|
11
11
|
import pc from "picocolors"
|
|
12
|
-
import {
|
|
12
|
+
import { ESCAPABLE_FILES, ESCAPABLE_FOLDERS } from "../settings.ts"
|
|
13
13
|
|
|
14
14
|
const defaultsRoot = join(import.meta.dirname, "..", "..", "source")
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
* List or copy
|
|
17
|
+
* List or copy escapable livemark files into `.livemark/`.
|
|
18
18
|
*
|
|
19
19
|
* Without an argument, prints every file you can shadow. With a path, copies
|
|
20
20
|
* the default from the livemark package into `.livemark/<path>`; fails if the
|
|
21
21
|
* destination already exists.
|
|
22
22
|
*/
|
|
23
23
|
export const escape = new Command("escape")
|
|
24
|
-
.description("List or copy
|
|
24
|
+
.description("List or copy escapable livemark files into .livemark/")
|
|
25
25
|
.argument(
|
|
26
26
|
"[path]",
|
|
27
|
-
"path relative to .livemark/ (e.g. components/Footer.tsx)",
|
|
27
|
+
"path relative to .livemark/ (e.g. components/Footer.tsx, client.tsx)",
|
|
28
28
|
)
|
|
29
29
|
.action((relPath?: string) => {
|
|
30
30
|
if (!relPath) {
|
|
31
|
-
for (const file of
|
|
31
|
+
for (const file of listEscapable()) console.log(file)
|
|
32
32
|
console.log(
|
|
33
33
|
pc.dim("\nRun 'livemark escape <path>' to copy a file into .livemark/"),
|
|
34
34
|
)
|
|
35
35
|
return
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
const isTopLevelFile =
|
|
39
|
+
!relPath.includes("/") && ESCAPABLE_FILES.includes(relPath)
|
|
38
40
|
const [first] = relPath.split("/")
|
|
39
|
-
|
|
41
|
+
const isFolderPath =
|
|
42
|
+
!!first && ESCAPABLE_FOLDERS.includes(first) && !relPath.includes("..")
|
|
43
|
+
if (!isTopLevelFile && !isFolderPath) {
|
|
40
44
|
console.error(
|
|
41
45
|
pc.red(
|
|
42
|
-
`Error: '${relPath}' is not
|
|
46
|
+
`Error: '${relPath}' is not escapable (folders: ${ESCAPABLE_FOLDERS.join(", ")}; files: ${ESCAPABLE_FILES.join(", ")})`,
|
|
43
47
|
),
|
|
44
48
|
)
|
|
45
49
|
process.exit(1)
|
|
@@ -64,14 +68,17 @@ export const escape = new Command("escape")
|
|
|
64
68
|
)
|
|
65
69
|
})
|
|
66
70
|
|
|
67
|
-
function
|
|
71
|
+
function listEscapable() {
|
|
68
72
|
const files: string[] = []
|
|
69
|
-
for (const
|
|
70
|
-
const dir = join(defaultsRoot,
|
|
73
|
+
for (const folder of ESCAPABLE_FOLDERS) {
|
|
74
|
+
const dir = join(defaultsRoot, folder)
|
|
71
75
|
if (!existsSync(dir)) continue
|
|
72
76
|
for (const entry of readdirSync(dir)) {
|
|
73
|
-
if (statSync(join(dir, entry)).isFile()) files.push(`${
|
|
77
|
+
if (statSync(join(dir, entry)).isFile()) files.push(`${folder}/${entry}`)
|
|
74
78
|
}
|
|
75
79
|
}
|
|
80
|
+
for (const file of ESCAPABLE_FILES) {
|
|
81
|
+
if (existsSync(join(defaultsRoot, file))) files.push(file)
|
|
82
|
+
}
|
|
76
83
|
return files.sort()
|
|
77
84
|
}
|
|
@@ -15,6 +15,7 @@ const configFile = join(
|
|
|
15
15
|
*/
|
|
16
16
|
export const preview = new Command("preview")
|
|
17
17
|
.description("Preview the production build locally")
|
|
18
|
+
.option("--clear", "Wipe and fully rebuild the runtime target dir")
|
|
18
19
|
.action(async () => {
|
|
19
20
|
const server = await vitePreview({
|
|
20
21
|
configFile,
|
package/source/commands/start.ts
CHANGED
|
@@ -15,6 +15,7 @@ const configFile = join(
|
|
|
15
15
|
*/
|
|
16
16
|
export const start = new Command("start")
|
|
17
17
|
.description("Start a live server")
|
|
18
|
+
.option("--clear", "Wipe and fully rebuild the runtime target dir")
|
|
18
19
|
.action(async () => {
|
|
19
20
|
const server = await createServer({
|
|
20
21
|
configFile,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { Link, useLocation, useMatches } from "@tanstack/react-router"
|
|
2
3
|
import { currentSection } from "../content/article.ts"
|
|
3
4
|
|
|
@@ -11,7 +12,7 @@ export function Breadcrumbs() {
|
|
|
11
12
|
return (
|
|
12
13
|
<nav className="flex items-center gap-1.5 text-sm text-muted-foreground">
|
|
13
14
|
<Link to="/" className="hover:text-foreground transition-colors">
|
|
14
|
-
{section?.title ??
|
|
15
|
+
{section?.title ?? config.title}
|
|
15
16
|
</Link>
|
|
16
17
|
<span>/</span>
|
|
17
18
|
{loaderData?.title && (
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { Link, useLocation, useMatch } from "@tanstack/react-router"
|
|
2
3
|
import { useHotkey } from "@tanstack/react-hotkeys"
|
|
3
4
|
import { ExternalLink } from "lucide-react"
|
|
@@ -41,7 +42,7 @@ export function Layout(props: {
|
|
|
41
42
|
window.scrollBy({ top: -window.innerHeight * 0.8, behavior: "smooth" }),
|
|
42
43
|
)
|
|
43
44
|
|
|
44
|
-
const sections =
|
|
45
|
+
const sections = config.sections
|
|
45
46
|
|
|
46
47
|
const header = (
|
|
47
48
|
<header className="sticky top-0 z-20 flex h-16 shrink-0 items-center border-b bg-background">
|
|
@@ -112,7 +113,7 @@ export function Layout(props: {
|
|
|
112
113
|
Docs
|
|
113
114
|
</Link>
|
|
114
115
|
)}
|
|
115
|
-
{
|
|
116
|
+
{config.links
|
|
116
117
|
?.filter(
|
|
117
118
|
link =>
|
|
118
119
|
link.position === "header" &&
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { Link, useLocation } from "@tanstack/react-router"
|
|
2
3
|
import { ChevronRight } from "lucide-react"
|
|
3
4
|
import {
|
|
@@ -28,7 +29,7 @@ import type { ArticleNode } from "../models/article.ts"
|
|
|
28
29
|
export function SidebarArticles() {
|
|
29
30
|
const pathname = useLocation({ select: l => l.pathname })
|
|
30
31
|
|
|
31
|
-
const configSections =
|
|
32
|
+
const configSections = config.sections
|
|
32
33
|
const section = currentSection(`/${pathname.replace(/^\/|\/$/g, "")}/`)
|
|
33
34
|
const groups = configSections?.length
|
|
34
35
|
? (sectionArticleGroups.get(section?.prefix ?? "__default__") ??
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { useLocation } from "@tanstack/react-router"
|
|
2
3
|
import { ExternalLink } from "lucide-react"
|
|
3
4
|
import { currentSection } from "../content/article.ts"
|
|
@@ -18,7 +19,7 @@ export function SidebarLinks() {
|
|
|
18
19
|
const pathname = useLocation({ select: l => l.pathname })
|
|
19
20
|
const section = currentSection(`/${pathname.replace(/^\/|\/$/g, "")}/`)
|
|
20
21
|
const links =
|
|
21
|
-
|
|
22
|
+
config.links?.filter(
|
|
22
23
|
link => !link.prefix || link.prefix === section?.prefix,
|
|
23
24
|
) ?? []
|
|
24
25
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { config } from "livemark:virtual"
|
|
1
2
|
import { Link, useLocation, useMatch } from "@tanstack/react-router"
|
|
2
3
|
import { currentSection, sectionFirstArticle } from "../content/article.ts"
|
|
3
4
|
import { DynamicIcon } from "../helpers/dynamic-icon.tsx"
|
|
@@ -24,7 +25,7 @@ export function SidebarSections() {
|
|
|
24
25
|
const section = articleRoute
|
|
25
26
|
? currentSection(`/${pathname.replace(/^\/|\/$/g, "")}/`)
|
|
26
27
|
: undefined
|
|
27
|
-
const sections =
|
|
28
|
+
const sections = config.sections ?? []
|
|
28
29
|
|
|
29
30
|
if (!sections.length) return null
|
|
30
31
|
const hasDesktopItems = sections.some(s => s.position === "sidebar")
|