erudit 3.0.0-dev.9 → 4.0.0-dev.2
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/app/app.vue +24 -185
- package/app/assets/icons/array-check.svg +3 -0
- package/app/assets/icons/array-lines.svg +3 -0
- package/app/assets/icons/array-star.svg +3 -0
- package/app/assets/icons/arrow/from-circle.svg +3 -0
- package/app/assets/icons/arrow/left.svg +3 -0
- package/app/assets/icons/arrow/outward-box.svg +3 -0
- package/app/assets/icons/arrow/outward.svg +3 -0
- package/app/assets/icons/arrow/to-circle.svg +3 -0
- package/app/assets/icons/arrow/up-to-right.svg +3 -0
- package/app/assets/icons/aside-open.svg +2 -2
- package/app/assets/icons/asterisk.svg +2 -2
- package/app/assets/icons/bell.svg +3 -0
- package/app/assets/icons/book-outline.svg +3 -0
- package/app/assets/icons/book-question.svg +2 -2
- package/app/assets/icons/book.svg +2 -2
- package/app/assets/icons/box.svg +3 -0
- package/app/assets/icons/bug.svg +2 -2
- package/app/assets/icons/chevron-right.svg +3 -0
- package/app/assets/icons/cog.svg +3 -0
- package/app/assets/icons/construction.svg +2 -2
- package/app/assets/icons/diamond.svg +3 -0
- package/app/assets/icons/draw.svg +2 -2
- package/app/assets/icons/erudit.svg +3 -0
- package/app/assets/icons/file-lines.svg +2 -2
- package/app/assets/icons/files.svg +3 -0
- package/app/assets/icons/flame.svg +3 -0
- package/app/assets/icons/folder-open.svg +2 -2
- package/app/assets/icons/folder.svg +2 -2
- package/app/assets/icons/globe.svg +2 -2
- package/app/assets/icons/graduation.svg +3 -0
- package/app/assets/icons/handshake.svg +3 -0
- package/app/assets/icons/house.svg +2 -2
- package/app/assets/icons/lines.svg +3 -0
- package/app/assets/icons/moon.svg +2 -2
- package/app/assets/icons/plus-circle.svg +2 -2
- package/app/assets/icons/plus.svg +2 -2
- package/app/assets/icons/puzzle.svg +2 -2
- package/app/assets/icons/question-circle.svg +3 -0
- package/app/assets/icons/rocket.svg +3 -0
- package/app/assets/icons/search/check.svg +3 -0
- package/app/assets/icons/search/dead.svg +3 -0
- package/app/assets/icons/search/glass.svg +3 -0
- package/app/assets/icons/search/wtf.svg +3 -0
- package/app/assets/icons/sun-moon.svg +2 -2
- package/app/assets/icons/sun.svg +2 -2
- package/app/assets/icons/translate.svg +3 -0
- package/app/assets/icons/user.svg +2 -2
- package/app/assets/icons/users.svg +2 -2
- package/app/assets/icons/warning.svg +3 -0
- package/app/components/EruditLink.ts +9 -0
- package/app/components/FancyBold.vue +16 -0
- package/app/components/FancyCard.vue +58 -0
- package/app/components/FancyCardTag.vue +16 -0
- package/app/components/Prose.vue +51 -0
- package/app/components/ScrollHolder.vue +20 -0
- package/app/components/SmartMedia.vue +112 -0
- package/app/components/ads/Ads.vue +39 -0
- package/app/components/ads/AdsBannerAside.vue +45 -0
- package/app/components/ads/AdsBannerBottom.vue +17 -0
- package/app/components/ads/AdsReplacer.vue +28 -0
- package/app/components/ads/provider/Custom.vue +19 -0
- package/app/components/ads/provider/Yandex.vue +84 -0
- package/app/components/aside/AsideListItem.vue +66 -74
- package/app/components/aside/AsideMajor.vue +8 -56
- package/app/components/aside/AsideMinor.vue +76 -71
- package/app/components/aside/AsidePlainMessage.vue +9 -0
- package/app/components/aside/AsideSwitch.vue +77 -0
- package/app/components/aside/major/PaneHolder.vue +106 -0
- package/app/components/aside/major/PaneSwitcher.vue +73 -0
- package/app/components/aside/major/PaneSwitcherButton.vue +38 -0
- package/app/components/aside/major/PaneTemplate.vue +5 -0
- package/app/components/aside/major/SiteInfo.vue +68 -85
- package/app/components/aside/major/contentNav/PaneBookNav.vue +116 -0
- package/app/components/aside/major/contentNav/PaneGlobalNav.vue +19 -0
- package/app/components/aside/major/contentNav/items/ContentNavBook.vue +21 -0
- package/app/components/aside/major/contentNav/items/ContentNavFolder.vue +92 -0
- package/app/components/aside/major/contentNav/items/ContentNavItem.vue +33 -0
- package/app/components/aside/major/contentNav/items/ContentNavPage.vue +18 -0
- package/app/components/aside/major/contentNav/items/ContentNavSeparator.vue +62 -0
- package/app/components/aside/major/contentNav/items/ContentNavTopic.vue +18 -0
- package/app/components/aside/major/contentNav/items/Flags.vue +52 -0
- package/app/components/aside/major/contentNav/items/ItemTemplate.vue +27 -0
- package/app/components/aside/major/languages/PaneLanguages.vue +55 -0
- package/app/components/aside/major/pages/PanePages.vue +60 -0
- package/app/components/aside/major/search/PaneSearch.vue +145 -0
- package/app/components/aside/major/search/SearchInput.vue +104 -0
- package/app/components/aside/major/search/SearchResult.vue +103 -0
- package/app/components/aside/major/search/SearchStatus.vue +48 -0
- package/app/components/aside/major/search/search.worker.ts +164 -0
- package/app/components/aside/major/settings/BuildTime.vue +25 -0
- package/app/components/aside/major/settings/EngineVersion.vue +13 -0
- package/app/components/aside/major/settings/PaneSettings.vue +17 -0
- package/app/components/aside/major/settings/ThemeSwitcher.vue +53 -0
- package/app/components/aside/major/settings/repository/Repository.vue +33 -0
- package/app/components/aside/major/settings/repository/SecondaryGitHub.vue +71 -0
- package/app/components/aside/minor/AsideMinorPane.vue +1 -11
- package/app/components/aside/minor/AsideMinorPlainHeader.vue +20 -0
- package/app/components/aside/minor/content/AsideMinorContentContributions.vue +51 -0
- package/app/components/aside/minor/content/AsideMinorContentPage.vue +37 -0
- package/app/components/aside/minor/content/AsideMinorContentTopic.vue +66 -0
- package/app/components/aside/minor/content/ButtonPaneContributions.vue +114 -0
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +120 -0
- package/app/components/aside/minor/content/Contribution.vue +36 -0
- package/app/components/aside/minor/content/Toc.vue +163 -0
- package/app/components/aside/minor/content/TocItem.vue +91 -0
- package/app/components/aside/minor/content/TopicPartButton.vue +35 -0
- package/app/components/aside/minor/contributor/AsideMinorContributor.vue +39 -0
- package/app/components/aside/minor/contributor/ItemBook.vue +39 -0
- package/app/components/aside/minor/contributor/ItemContent.vue +17 -0
- package/app/components/aside/minor/news/AsideMinorNews.vue +132 -0
- package/app/components/aside/minor/news/NewsItem.vue +69 -0
- package/app/components/aside/minor/news/RenderNewsElement.vue +42 -0
- package/app/components/aside/minor/news/elements/Mix.vue +11 -0
- package/app/components/aside/minor/news/elements/P.vue +14 -0
- package/app/components/aside/minor/news/elements/Ref.vue +58 -0
- package/app/components/aside/minor/news/elements/Text.vue +18 -0
- package/app/components/indexPage/IndexPagePersons.vue +117 -0
- package/app/components/main/MainAction.vue +20 -0
- package/app/components/main/MainBreadcrumbs.vue +28 -0
- package/app/components/main/MainContentChild.vue +47 -0
- package/app/components/main/MainContentChildren.vue +14 -0
- package/app/components/main/MainDecoration.vue +15 -0
- package/app/components/main/MainDescription.vue +13 -0
- package/app/components/main/MainFlag.vue +133 -0
- package/app/components/main/MainFlags.vue +17 -0
- package/app/components/main/MainGlow.vue +12 -0
- package/app/components/main/MainQuickLink.vue +91 -0
- package/app/components/main/MainQuickLinks.vue +40 -0
- package/app/components/main/MainQuote.vue +159 -0
- package/app/components/main/MainQuoteLoader.vue +86 -0
- package/app/components/main/MainSection.vue +44 -0
- package/app/components/main/MainSectionPreamble.vue +5 -0
- package/app/components/main/MainSubTitle.vue +12 -0
- package/app/components/main/MainTitle.vue +32 -0
- package/app/components/main/MainTopicPartPage.vue +88 -0
- package/app/components/main/MainTopicPartSwitch.vue +71 -0
- package/app/components/main/connections/Deps.vue +34 -0
- package/app/components/main/connections/Externals.vue +104 -0
- package/app/components/main/connections/MainConnections.vue +94 -0
- package/app/components/main/connections/MainConnectionsButton.vue +81 -0
- package/app/components/main/connections/ScrollPane.vue +10 -0
- package/app/components/main/contentStats/Item.vue +34 -0
- package/app/components/main/contentStats/ItemElement.vue +19 -0
- package/app/components/main/contentStats/ItemMaterials.vue +11 -0
- package/app/components/main/contentStats/MainContentStats.vue +53 -0
- package/app/components/preview/Preview.vue +172 -186
- package/app/components/preview/PreviewError.vue +10 -0
- package/app/components/preview/PreviewLoading.vue +5 -14
- package/app/components/preview/PreviewScreen.vue +64 -141
- package/app/components/preview/PreviewScreenButton.vue +39 -0
- package/app/components/preview/screen/ContentPage.vue +50 -0
- package/app/components/preview/screen/DirectLink.vue +23 -0
- package/app/components/preview/screen/Unique.vue +54 -0
- package/app/components/site/SiteAside.vue +68 -0
- package/app/components/site/SiteAsideOverlay.vue +21 -0
- package/app/components/site/SiteMain.vue +13 -0
- package/app/components/transition/Fade.vue +30 -19
- package/app/components/transition/Slide.vue +47 -0
- package/app/components/tree/TreeContainer.vue +5 -11
- package/app/components/tree/TreeItem.vue +40 -89
- package/app/composables/ads.ts +23 -0
- package/app/composables/analytics.ts +102 -0
- package/app/composables/appElements.ts +40 -0
- package/app/composables/aside.ts +28 -0
- package/app/composables/asideMajorPane.ts +135 -0
- package/app/composables/asideMinor.ts +109 -0
- package/app/composables/contentNav.ts +7 -0
- package/app/composables/favicon.ts +104 -4
- package/app/composables/file.ts +3 -0
- package/app/composables/formatText.ts +85 -71
- package/app/composables/loading.ts +2 -0
- package/app/composables/mainContent.ts +31 -0
- package/app/composables/og.ts +182 -0
- package/app/composables/phrases.ts +126 -81
- package/app/composables/preview.ts +53 -0
- package/app/composables/route.ts +4 -0
- package/app/composables/theme.ts +71 -29
- package/app/composables/url.ts +22 -33
- package/app/formatters/ru.ts +14 -0
- package/app/pages/article/[...articleId].vue +10 -1
- package/app/pages/book/[...bookId].vue +52 -43
- package/app/pages/contributor/[contributorId].vue +150 -0
- package/app/pages/contributors.vue +99 -0
- package/app/pages/group/[...groupId].vue +53 -59
- package/app/pages/index.vue +111 -26
- package/app/pages/page/[...pageId].vue +60 -0
- package/app/pages/practice/[...practiceId].vue +12 -0
- package/app/pages/sponsors.vue +91 -0
- package/app/pages/summary/[...summaryId].vue +10 -1
- package/app/plugins/appSetup/client/htmlBranding.ts +6 -0
- package/app/plugins/appSetup/client/welcome.ts +35 -0
- package/app/plugins/appSetup/config.ts +6 -0
- package/app/plugins/appSetup/global.ts +3 -0
- package/app/plugins/appSetup/index.ts +28 -0
- package/app/plugins/prerender.server.ts +40 -0
- package/app/router.options.ts +5 -0
- package/app/scripts/theme.js +33 -0
- package/app/styles/main.css +172 -0
- package/bin/erudit.mjs +2 -2
- package/modules/erudit/globals/content.ts +4 -0
- package/modules/erudit/globals/contributor.ts +1 -0
- package/modules/erudit/globals/eruditConfig.ts +10 -0
- package/modules/erudit/globals/problem.ts +1 -0
- package/modules/erudit/globals/prose.ts +1 -0
- package/modules/erudit/globals/public.ts +18 -0
- package/modules/erudit/index.ts +60 -0
- package/{module → modules/erudit}/logger.ts +2 -2
- package/modules/erudit/setup/aliases.ts +17 -0
- package/modules/erudit/setup/baseUrl.ts +19 -0
- package/modules/erudit/setup/elements/appTemplate.ts +45 -0
- package/modules/erudit/setup/elements/globalTemplate.ts +82 -0
- package/modules/erudit/setup/elements/globalTypes.ts +273 -0
- package/modules/erudit/setup/elements/setup.ts +167 -0
- package/modules/erudit/setup/elements/shared.ts +10 -0
- package/modules/erudit/setup/elements/tagsTable.ts +28 -0
- package/modules/erudit/setup/fullRestart.ts +71 -0
- package/modules/erudit/setup/globals.ts +196 -0
- package/modules/erudit/setup/nuxtConfig.ts +62 -0
- package/modules/erudit/setup/projectConfig.ts +114 -0
- package/modules/erudit/setup/publicAssets.ts +52 -0
- package/modules/erudit/setup/runtimeConfig.ts +58 -0
- package/modules/erudit/watcher.ts +27 -0
- package/nuxt.config.ts +66 -87
- package/package.json +38 -19
- package/proxy/prose.app.ts +1 -0
- package/proxy/prose.ts +1 -0
- package/public/favicons/default.svg +1 -0
- package/{app/public → public}/logotype.svg +1 -1
- package/public/og.png +0 -0
- package/server/api/aside/major/frontNav/book/[...shortId].ts +10 -0
- package/server/api/aside/major/frontNav/global.ts +5 -0
- package/server/api/aside/major/pages.ts +6 -0
- package/server/api/contributor/list.ts +61 -0
- package/server/api/contributor/page/[contributorId].ts +68 -0
- package/server/api/indexPage.ts +81 -0
- package/server/api/language/functions.ts +6 -7
- package/server/api/language/phrase/[phraseKey].ts +32 -0
- package/server/api/main/content/[...contentTypePath].ts +153 -0
- package/server/api/news/batch/[batchIndex].ts +5 -0
- package/server/api/pageSponsors.ts +58 -0
- package/server/api/prerender/content.ts +82 -0
- package/server/api/prerender/default.ts +35 -0
- package/server/api/prerender/files.ts +10 -0
- package/server/api/prerender/frontNav.ts +13 -0
- package/server/api/prerender/language.ts +7 -0
- package/server/api/prerender/news.ts +8 -0
- package/server/api/prerender/quotes.ts +15 -0
- package/server/api/preview/contentPage/[...contentTypePath].ts +63 -0
- package/server/api/preview/contentUnique/[...contentTypePathUnique].ts +81 -0
- package/server/api/problemScript/[...problemScriptPath].ts +92 -0
- package/server/api/quote/data/[quoteId].ts +87 -0
- package/server/api/quote/ids.ts +3 -0
- package/server/erudit/build.ts +137 -0
- package/server/erudit/cameos/build.ts +161 -0
- package/server/erudit/config.ts +13 -0
- package/server/erudit/content/global/build.ts +297 -0
- package/server/erudit/content/global/singleton.ts +5 -0
- package/server/erudit/content/nav/build.ts +463 -0
- package/server/erudit/content/nav/front.ts +127 -0
- package/server/erudit/content/nav/repository/books.ts +40 -0
- package/server/erudit/content/nav/repository/get.ts +33 -0
- package/server/erudit/content/nav/repository/hasChildren.ts +5 -0
- package/server/erudit/content/nav/repository/hasNav.ts +3 -0
- package/server/erudit/content/nav/repository/hasParent.ts +5 -0
- package/server/erudit/content/nav/repository/id.ts +9 -0
- package/server/erudit/content/nav/repository/index.ts +9 -0
- package/server/erudit/content/nav/repository/order.ts +14 -0
- package/server/erudit/content/nav/repository/previousNext.ts +35 -0
- package/server/erudit/content/nav/repository/walk.ts +127 -0
- package/server/erudit/content/nav/setup.ts +13 -0
- package/server/erudit/content/nav/types.ts +24 -0
- package/server/erudit/content/repository/breadcrumbs.ts +24 -0
- package/server/erudit/content/repository/children.ts +47 -0
- package/server/erudit/content/repository/connections.ts +35 -0
- package/server/erudit/content/repository/contentLink.ts +16 -0
- package/server/erudit/content/repository/decoration.ts +23 -0
- package/server/erudit/content/repository/deps.ts +84 -0
- package/server/erudit/content/repository/description.ts +11 -0
- package/server/erudit/content/repository/elementSnippets.ts +105 -0
- package/server/erudit/content/repository/externals.ts +50 -0
- package/server/erudit/content/repository/flags.ts +33 -0
- package/server/erudit/content/repository/seo.ts +12 -0
- package/server/erudit/content/repository/stats.ts +97 -0
- package/server/erudit/content/repository/title.ts +27 -0
- package/server/erudit/content/repository/topicParts.ts +39 -0
- package/server/erudit/content/repository/unique.ts +76 -0
- package/server/erudit/content/resolve/book.ts +32 -0
- package/server/erudit/content/resolve/group.ts +39 -0
- package/server/erudit/content/resolve/index.ts +290 -0
- package/server/erudit/content/resolve/page.ts +87 -0
- package/server/erudit/content/resolve/topic.ts +246 -0
- package/server/erudit/content/resolve/utils/contentError.ts +10 -0
- package/server/erudit/content/resolve/utils/insertContentItem.ts +122 -0
- package/server/erudit/content/resolve/utils/insertContentResolved.ts +132 -0
- package/server/erudit/content/search.ts +163 -0
- package/server/erudit/contributors/build.ts +166 -0
- package/server/erudit/contributors/global.ts +3 -0
- package/server/erudit/contributors/repository/avatarUrl.ts +10 -0
- package/server/erudit/contributors/repository/contributions.ts +178 -0
- package/server/erudit/contributors/repository/count.ts +3 -0
- package/server/erudit/contributors/search.ts +34 -0
- package/server/erudit/db/repository/pushFile.ts +26 -0
- package/server/erudit/db/repository/pushProblemScript.ts +19 -0
- package/server/erudit/db/repository/pushProseLink.ts +40 -0
- package/server/erudit/db/schema/cameos.ts +7 -0
- package/server/erudit/db/schema/content.ts +18 -0
- package/server/erudit/db/schema/contentContributions.ts +15 -0
- package/server/erudit/db/schema/contentDeps.ts +21 -0
- package/server/erudit/db/schema/contentElementStats.ts +20 -0
- package/server/erudit/db/schema/contentProseLinks.ts +23 -0
- package/server/erudit/db/schema/contentSnippets.ts +15 -0
- package/server/erudit/db/schema/contentToc.ts +16 -0
- package/server/erudit/db/schema/contentUniques.ts +25 -0
- package/server/erudit/db/schema/contributors.ts +12 -0
- package/server/erudit/db/schema/files.ts +11 -0
- package/server/erudit/db/schema/groups.ts +6 -0
- package/server/erudit/db/schema/index.ts +17 -0
- package/server/erudit/db/schema/news.ts +7 -0
- package/server/erudit/db/schema/pages.ts +7 -0
- package/server/erudit/db/schema/problemScripts.ts +14 -0
- package/server/erudit/db/schema/sponsors.ts +9 -0
- package/server/erudit/db/schema/topics.ts +9 -0
- package/server/erudit/db/setup.ts +62 -0
- package/server/erudit/db/types.ts +10 -0
- package/server/erudit/global.ts +33 -0
- package/server/erudit/importer.ts +97 -0
- package/server/erudit/index.ts +90 -0
- package/server/erudit/language/list/en.ts +211 -0
- package/server/erudit/language/list/ru.ts +216 -0
- package/server/erudit/language/list.ts +6 -0
- package/server/erudit/language/setup.ts +36 -0
- package/server/erudit/language/types.ts +16 -0
- package/server/erudit/logger.ts +77 -0
- package/server/erudit/news/build.ts +114 -0
- package/server/erudit/news/repository/batch.ts +61 -0
- package/server/erudit/prose/repository/finalize.ts +68 -0
- package/server/erudit/prose/repository/get.ts +54 -0
- package/server/erudit/prose/repository/resolve.ts +17 -0
- package/server/erudit/prose/storage/callout.ts +14 -0
- package/server/erudit/prose/storage/image.ts +20 -0
- package/server/erudit/prose/storage/link.ts +226 -0
- package/server/erudit/prose/storage/problemScript.ts +21 -0
- package/server/erudit/prose/storage/video.ts +14 -0
- package/server/erudit/prose/transform/bundleProblemScript.ts +6 -0
- package/server/erudit/prose/transform/extensions.ts +15 -0
- package/server/erudit/quote/repository/ids.ts +31 -0
- package/server/erudit/repository.ts +96 -0
- package/server/erudit/sponsors/build.ts +165 -0
- package/server/erudit/sponsors/repository/avatarUrl.ts +10 -0
- package/server/erudit/sponsors/repository/count.ts +4 -0
- package/server/erudit/staticFile.ts +28 -0
- package/server/plugins/augmentCss.ts +17 -0
- package/server/plugins/lang.ts +7 -0
- package/server/plugins/metaViewport.ts +15 -0
- package/server/plugins/theme.ts +13 -0
- package/server/routes/file/[...path].ts +18 -0
- package/server/routes/robots.txt.ts +9 -0
- package/server/routes/search.json.gz.ts +73 -0
- package/server/routes/sitemap.xml.ts +81 -0
- package/shared/search/encoders.ts +20 -0
- package/shared/types/asideMajorPages.ts +4 -0
- package/shared/types/breadcrumbs.ts +9 -0
- package/shared/types/contentChildren.ts +10 -0
- package/shared/types/contentConnections.ts +27 -0
- package/shared/types/contentStats.ts +6 -0
- package/shared/types/elementSnippet.ts +14 -0
- package/shared/types/frontContentNav.ts +38 -0
- package/shared/types/indexPage.ts +20 -0
- package/shared/types/language.ts +191 -75
- package/shared/types/mainContent.ts +69 -0
- package/shared/types/news.ts +13 -0
- package/shared/types/preview.ts +28 -0
- package/shared/types/runtimeConfig.ts +64 -0
- package/shared/types/search.ts +79 -0
- package/shared/utils/contentTypePath.ts +63 -0
- package/shared/utils/icons.ts +11 -0
- package/shared/utils/pages.ts +24 -0
- package/shared/utils/slasher.ts +64 -0
- package/shared/utils/stringColor.ts +13 -9
- package/shared/utils/toStringEqual.ts +21 -0
- package/shared/utils/zip.ts +64 -0
- package/test/shared/utils/slasher.test.ts +75 -0
- package/test/shared/utils/zip.test.ts +8 -0
- package/tsconfig.json +17 -8
- package/app/assets/icons/alert.svg +0 -3
- package/app/assets/icons/angle-right.svg +0 -3
- package/app/assets/icons/arrow-in-text.svg +0 -3
- package/app/assets/icons/arrow-left.svg +0 -3
- package/app/assets/icons/arrow-up-to-right.svg +0 -3
- package/app/assets/icons/chip.svg +0 -3
- package/app/assets/icons/circle-help.svg +0 -3
- package/app/assets/icons/cross.svg +0 -3
- package/app/assets/icons/ellipsis-vertical.svg +0 -3
- package/app/assets/icons/file-check.svg +0 -3
- package/app/assets/icons/file-star.svg +0 -3
- package/app/assets/icons/link-external.svg +0 -3
- package/app/assets/icons/link.svg +0 -3
- package/app/assets/icons/outline/book.svg +0 -3
- package/app/assets/icons/outline/file-lines.svg +0 -3
- package/app/assets/icons/pirate.svg +0 -3
- package/app/assets/icons/search.svg +0 -3
- package/app/assets/icons/shuffle.svg +0 -3
- package/app/assets/icons/star.svg +0 -3
- package/app/components/Loading.vue +0 -23
- package/app/components/SiteAside.vue +0 -393
- package/app/components/SiteMain.vue +0 -34
- package/app/components/ads/BannerTemplate.vue +0 -51
- package/app/components/ads/BottomBanner.vue +0 -45
- package/app/components/ads/LeftBanner.vue +0 -50
- package/app/components/aside/major/PaneContentScroll.vue +0 -23
- package/app/components/aside/major/PaneSwitch.vue +0 -54
- package/app/components/aside/major/PaneSwitchButton.vue +0 -63
- package/app/components/aside/major/panes/Language.vue +0 -79
- package/app/components/aside/major/panes/Pages.vue +0 -34
- package/app/components/aside/major/panes/Search.vue +0 -11
- package/app/components/aside/major/panes/nav/Nav.vue +0 -87
- package/app/components/aside/major/panes/nav/NavBook.vue +0 -87
- package/app/components/aside/major/panes/nav/NavBookLoading.vue +0 -24
- package/app/components/aside/major/panes/nav/NavGlobal.vue +0 -16
- package/app/components/aside/major/panes/nav/fnav/FNav.vue +0 -105
- package/app/components/aside/major/panes/nav/fnav/FNavBook.vue +0 -32
- package/app/components/aside/major/panes/nav/fnav/FNavFlags.vue +0 -40
- package/app/components/aside/major/panes/nav/fnav/FNavFolder.vue +0 -60
- package/app/components/aside/major/panes/nav/fnav/FNavItem.vue +0 -34
- package/app/components/aside/major/panes/nav/fnav/FNavSeparator.vue +0 -80
- package/app/components/aside/major/panes/nav/fnav/FNavTopic.vue +0 -24
- package/app/components/aside/major/panes/other/ItemContent.vue +0 -29
- package/app/components/aside/major/panes/other/ItemGenerator.vue +0 -15
- package/app/components/aside/major/panes/other/ItemTheme.vue +0 -54
- package/app/components/aside/major/panes/other/Other.vue +0 -16
- package/app/components/aside/minor/AsideMinorContributor.vue +0 -5
- package/app/components/aside/minor/AsideMinorNews.vue +0 -11
- package/app/components/aside/minor/AsideMinorTopLink.vue +0 -67
- package/app/components/aside/minor/Contribute.vue +0 -145
- package/app/components/aside/minor/content/AsideMinorContent.vue +0 -92
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +0 -32
- package/app/components/aside/minor/topic/TopicContributors.vue +0 -177
- package/app/components/aside/minor/topic/TopicNav.vue +0 -49
- package/app/components/aside/minor/topic/TopicToc.vue +0 -219
- package/app/components/aside/minor/topic/TopicTocItem.vue +0 -30
- package/app/components/aside/utils/AsideOverlayPane.vue +0 -40
- package/app/components/bitran/BitranContent.vue +0 -77
- package/app/components/bitran/RenderWrapper.vue +0 -10
- package/app/components/contributor/ContributorAvatar.vue +0 -43
- package/app/components/contributor/ContributorListItem.vue +0 -35
- package/app/components/main/topic/MainTopic.vue +0 -78
- package/app/components/main/topic/TopicPartSwitch.vue +0 -118
- package/app/components/main/utils/Breadcrumb.vue +0 -70
- package/app/components/main/utils/ContentDecoration.vue +0 -29
- package/app/components/main/utils/ContentDescription.vue +0 -19
- package/app/components/main/utils/ContentPopover.vue +0 -188
- package/app/components/main/utils/ContentPopovers.vue +0 -111
- package/app/components/main/utils/ContentReferences.vue +0 -70
- package/app/components/main/utils/ContentSection.vue +0 -45
- package/app/components/main/utils/ContentTitle.vue +0 -63
- package/app/components/main/utils/reference/ReferenceGroup.vue +0 -38
- package/app/components/main/utils/reference/ReferenceItem.vue +0 -68
- package/app/components/main/utils/reference/ReferenceSource.vue +0 -116
- package/app/components/preview/PreviewDisplay.vue +0 -139
- package/app/components/preview/PreviewFooterAction.vue +0 -73
- package/app/components/preview/display/Alert.vue +0 -50
- package/app/components/preview/display/Custom.vue +0 -18
- package/app/components/preview/display/GenericLink.vue +0 -48
- package/app/components/preview/display/PageLink.vue +0 -20
- package/app/components/preview/display/Unique.vue +0 -55
- package/app/composables/bitran.ts +0 -105
- package/app/composables/bitranContent.ts +0 -51
- package/app/composables/bitranLocation.ts +0 -7
- package/app/composables/contentData.ts +0 -36
- package/app/composables/contentPage.ts +0 -157
- package/app/composables/contentRoute.ts +0 -45
- package/app/composables/darkMagic.ts +0 -24
- package/app/composables/externalApi.ts +0 -63
- package/app/composables/majorPane.ts +0 -60
- package/app/pages/_test/preview.vue +0 -110
- package/app/pages/members.vue +0 -6
- package/app/pages/practice/[...practice].vue +0 -3
- package/app/public/favicon/article.svg +0 -10
- package/app/public/favicon/default.svg +0 -10
- package/app/public/favicon/practice.svg +0 -10
- package/app/public/favicon/summary.svg +0 -10
- package/app/public/og-default.png +0 -0
- package/app/public/user.svg +0 -10
- package/app/scripts/_immediate.js +0 -9
- package/app/scripts/aside/index.ts +0 -59
- package/app/scripts/aside/major/nav.ts +0 -26
- package/app/scripts/aside/minor/state.ts +0 -37
- package/app/scripts/aside/minor/topic.ts +0 -3
- package/app/scripts/flag.ts +0 -28
- package/app/scripts/og.ts +0 -27
- package/app/scripts/preview/build.ts +0 -73
- package/app/scripts/preview/data/alert.ts +0 -19
- package/app/scripts/preview/data/custom.ts +0 -8
- package/app/scripts/preview/data/genericLink.ts +0 -24
- package/app/scripts/preview/data/pageLink.ts +0 -22
- package/app/scripts/preview/data/unique.ts +0 -72
- package/app/scripts/preview/data.ts +0 -24
- package/app/scripts/preview/display.ts +0 -37
- package/app/scripts/preview/footer.ts +0 -9
- package/app/scripts/preview/request.ts +0 -51
- package/app/scripts/preview/state.ts +0 -63
- package/app/styles/_immediate.css +0 -7
- package/app/styles/_util.scss +0 -43
- package/app/styles/_utils.scss +0 -44
- package/app/styles/app.scss +0 -91
- package/app/styles/def/_bp.scss +0 -27
- package/app/styles/def/_size.scss +0 -7
- package/app/styles/def/_z.scss +0 -5
- package/app/styles/normalize.scss +0 -63
- package/app/styles/partials/_darkMagic.scss +0 -5
- package/app/styles/partials/_fnav.scss +0 -15
- package/app/styles/partials/_preview.scss +0 -5
- package/globalPath.ts +0 -21
- package/globals/bitran.ts +0 -2
- package/globals/content.ts +0 -22
- package/globals/contributor.ts +0 -5
- package/globals/erudit.ts +0 -5
- package/globals/register.ts +0 -18
- package/languages/en.ts +0 -95
- package/languages/ru.ts +0 -99
- package/module/bitran.ts +0 -36
- package/module/config.ts +0 -35
- package/module/imports.ts +0 -50
- package/module/index.ts +0 -47
- package/module/paths.ts +0 -22
- package/module/restart.ts +0 -61
- package/server/api/aside/major/nav/bookIds.ts +0 -5
- package/server/api/aside/major/nav/bookNav/[...bookId].ts +0 -20
- package/server/api/aside/major/nav/global.ts +0 -7
- package/server/api/aside/minor/news.ts +0 -7
- package/server/api/aside/minor/path.ts +0 -77
- package/server/api/bitran/content/[location].ts +0 -8
- package/server/api/bitran/toc/[location].ts +0 -7
- package/server/api/content/data.ts +0 -72
- package/server/api/contributor/count.ts +0 -6
- package/server/api/fake/content.ts +0 -11
- package/server/api/fake/shared/languages.ts +0 -12
- package/server/api/language/phrase/[phraseId].ts +0 -19
- package/server/api/language/phraseIds.ts +0 -8
- package/server/api/preview/page/[...parts].ts +0 -52
- package/server/api/preview/unique/[location].ts +0 -60
- package/server/plugin/bitran/content.ts +0 -194
- package/server/plugin/bitran/location.ts +0 -25
- package/server/plugin/bitran/products/include.ts +0 -228
- package/server/plugin/bitran/products/link.ts +0 -116
- package/server/plugin/bitran/setup.ts +0 -11
- package/server/plugin/bitran/toc.ts +0 -75
- package/server/plugin/bitran/transpiler.ts +0 -30
- package/server/plugin/build/close.ts +0 -10
- package/server/plugin/build/jobs/content/builderArgs.ts +0 -8
- package/server/plugin/build/jobs/content/generic.ts +0 -176
- package/server/plugin/build/jobs/content/parse.ts +0 -109
- package/server/plugin/build/jobs/content/path.ts +0 -6
- package/server/plugin/build/jobs/content/type/book.ts +0 -9
- package/server/plugin/build/jobs/content/type/group.ts +0 -37
- package/server/plugin/build/jobs/content/type/topic.ts +0 -36
- package/server/plugin/build/jobs/contributors.ts +0 -66
- package/server/plugin/build/jobs/language.ts +0 -36
- package/server/plugin/build/jobs/nav.ts +0 -214
- package/server/plugin/build/process.ts +0 -25
- package/server/plugin/build/rebuild.ts +0 -55
- package/server/plugin/build/setup.ts +0 -22
- package/server/plugin/content/absoluteId.ts +0 -94
- package/server/plugin/content/context.ts +0 -116
- package/server/plugin/db/entities/Book.ts +0 -7
- package/server/plugin/db/entities/Content.ts +0 -49
- package/server/plugin/db/entities/Contribution.ts +0 -10
- package/server/plugin/db/entities/Contributor.ts +0 -16
- package/server/plugin/db/entities/Group.ts +0 -14
- package/server/plugin/db/entities/Hash.ts +0 -15
- package/server/plugin/db/entities/Topic.ts +0 -20
- package/server/plugin/db/entities/Unique.ts +0 -21
- package/server/plugin/db/setup.ts +0 -34
- package/server/plugin/global.ts +0 -17
- package/server/plugin/importer.ts +0 -12
- package/server/plugin/index.ts +0 -9
- package/server/plugin/logger.ts +0 -23
- package/server/plugin/nav/node.ts +0 -26
- package/server/plugin/nav/utils.ts +0 -129
- package/server/plugin/repository/book.ts +0 -21
- package/server/plugin/repository/content.ts +0 -238
- package/server/plugin/repository/contributor.ts +0 -8
- package/server/plugin/repository/frontNav.ts +0 -148
- package/server/plugin/repository/topic.ts +0 -32
- package/server/tsconfig.json +0 -9
- package/shared/aside/minor.ts +0 -51
- package/shared/asset.ts +0 -15
- package/shared/bitran/stringContent.ts +0 -6
- package/shared/bitran/toc.ts +0 -8
- package/shared/content/context.ts +0 -9
- package/shared/content/data/base.ts +0 -32
- package/shared/content/data/index.ts +0 -5
- package/shared/content/data/type/book.ts +0 -5
- package/shared/content/data/type/group.ts +0 -6
- package/shared/content/data/type/topic.ts +0 -11
- package/shared/content/previousNext.ts +0 -9
- package/shared/contributor.ts +0 -5
- package/shared/frontNav.ts +0 -41
- package/shared/icons.ts +0 -38
- package/shared/image.ts +0 -5
- package/shared/link.ts +0 -28
- package/shared/popover.ts +0 -8
- package/shared/utils/objectsEqual.ts +0 -4
- package/utils/stress.ts +0 -9
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { content } from './content';
|
|
2
|
+
export { contributors } from './contributors';
|
|
3
|
+
export { topics } from './topics';
|
|
4
|
+
export { contentUniques } from './contentUniques';
|
|
5
|
+
export { pages } from './pages';
|
|
6
|
+
export { groups } from './groups';
|
|
7
|
+
export { contentSnippets } from './contentSnippets';
|
|
8
|
+
export { files } from './files';
|
|
9
|
+
export { contentProseLinks } from './contentProseLinks';
|
|
10
|
+
export { problemScripts } from './problemScripts';
|
|
11
|
+
export { contentElementStats } from './contentElementStats';
|
|
12
|
+
export { contentDeps } from './contentDeps';
|
|
13
|
+
export { contentContributions } from './contentContributions';
|
|
14
|
+
export { contentToc } from './contentToc';
|
|
15
|
+
export { cameos } from './cameos';
|
|
16
|
+
export { sponsors } from './sponsors';
|
|
17
|
+
export { news } from './news';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import type { AnySchema, ProseElement } from '@jsprose/core';
|
|
3
|
+
|
|
4
|
+
export const news = sqliteTable('news', {
|
|
5
|
+
date: text().primaryKey(),
|
|
6
|
+
prose: text({ mode: 'json' }).$type<ProseElement<AnySchema>>().notNull(),
|
|
7
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import type { AnySchema, ProseElement } from '@jsprose/core';
|
|
3
|
+
|
|
4
|
+
export const pages = sqliteTable('pages', {
|
|
5
|
+
fullId: text().primaryKey(),
|
|
6
|
+
prose: text({ mode: 'json' }).$type<ProseElement<AnySchema>>().notNull(),
|
|
7
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { primaryKey, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
|
|
3
|
+
export const problemScripts = sqliteTable(
|
|
4
|
+
'problemScripts',
|
|
5
|
+
{
|
|
6
|
+
problemScriptSrc: text(),
|
|
7
|
+
contentFullId: text(),
|
|
8
|
+
},
|
|
9
|
+
(table) => [
|
|
10
|
+
primaryKey({
|
|
11
|
+
columns: [table.problemScriptSrc, table.contentFullId],
|
|
12
|
+
}),
|
|
13
|
+
],
|
|
14
|
+
);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import type { Sponsor } from '@erudit-js/core/sponsor';
|
|
3
|
+
|
|
4
|
+
export const sponsors = sqliteTable('sponsors', {
|
|
5
|
+
sponsorId: text().primaryKey(),
|
|
6
|
+
hasMessages: integer({ mode: 'boolean' }).notNull(),
|
|
7
|
+
avatarExtension: text(),
|
|
8
|
+
data: text({ mode: 'json' }).notNull().$type<Sponsor>(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
2
|
+
import type { AnySchema, ProseElement } from '@jsprose/core';
|
|
3
|
+
|
|
4
|
+
export const topics = sqliteTable('topics', {
|
|
5
|
+
fullId: text().primaryKey(),
|
|
6
|
+
article: text({ mode: 'json' }).$type<ProseElement<AnySchema>>(),
|
|
7
|
+
summary: text({ mode: 'json' }).$type<ProseElement<AnySchema>>(),
|
|
8
|
+
practice: text({ mode: 'json' }).$type<ProseElement<AnySchema>>(),
|
|
9
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { readdirSync, unlinkSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { drizzle } from 'drizzle-orm/better-sqlite3';
|
|
5
|
+
import Database from 'better-sqlite3';
|
|
6
|
+
|
|
7
|
+
import * as schema from './schema';
|
|
8
|
+
|
|
9
|
+
export async function setupServerDatabase() {
|
|
10
|
+
const buildDir = ERUDIT.config.paths.build;
|
|
11
|
+
const nowTs = Date.now();
|
|
12
|
+
const dbFilename = `erudit-${nowTs}.db`;
|
|
13
|
+
const dbPath = join(buildDir, dbFilename);
|
|
14
|
+
|
|
15
|
+
try {
|
|
16
|
+
for (const f of readdirSync(buildDir)) {
|
|
17
|
+
const m = f.match(/^erudit-(\d+)\.db$/);
|
|
18
|
+
if (m && Number(m[1]) < nowTs) {
|
|
19
|
+
try {
|
|
20
|
+
unlinkSync(join(buildDir, f));
|
|
21
|
+
} catch {}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} catch {}
|
|
25
|
+
|
|
26
|
+
const connection = new Database(dbPath);
|
|
27
|
+
|
|
28
|
+
const db = drizzle(connection, { schema });
|
|
29
|
+
|
|
30
|
+
ERUDIT.db = new Proxy(db, {
|
|
31
|
+
get(target, prop, receiver) {
|
|
32
|
+
if (prop === 'connection') {
|
|
33
|
+
return connection;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (prop === 'schema') {
|
|
37
|
+
return schema;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (prop === 'path') {
|
|
41
|
+
return dbPath;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return Reflect.get(target, prop, receiver);
|
|
45
|
+
},
|
|
46
|
+
}) as any;
|
|
47
|
+
|
|
48
|
+
const require = createRequire(import.meta.url);
|
|
49
|
+
const { generateSQLiteMigration, generateSQLiteDrizzleJson } =
|
|
50
|
+
require('drizzle-kit/api') as typeof import('drizzle-kit/api');
|
|
51
|
+
|
|
52
|
+
const migration = await generateSQLiteMigration(
|
|
53
|
+
await generateSQLiteDrizzleJson({}),
|
|
54
|
+
await generateSQLiteDrizzleJson(schema, undefined, 'camelCase'),
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
for (const query of migration) {
|
|
58
|
+
await ERUDIT.db.run(query);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
ERUDIT.log.success('Database connection setup complete!');
|
|
62
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
|
2
|
+
import type { Database } from 'better-sqlite3';
|
|
3
|
+
|
|
4
|
+
import type * as schema from './schema';
|
|
5
|
+
|
|
6
|
+
export type EruditServerDatabase = LibSQLDatabase<typeof schema> & {
|
|
7
|
+
path: string;
|
|
8
|
+
connection: Database;
|
|
9
|
+
schema: typeof schema;
|
|
10
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { EruditServerBuildError, EruditServerChangedFiles } from './build';
|
|
2
|
+
import type { EruditServerConfig } from './config';
|
|
3
|
+
import type { EruditServerContentNav } from './content/nav/types';
|
|
4
|
+
import type { EruditServerDatabase } from './db/types';
|
|
5
|
+
import type { EruditServerImporter } from './importer';
|
|
6
|
+
import type { EruditServerLanguage } from './language/types';
|
|
7
|
+
import type { EruditServerLogger } from './logger';
|
|
8
|
+
import type { EruditServerRepository } from './repository';
|
|
9
|
+
|
|
10
|
+
export const ERUDIT: {
|
|
11
|
+
buildError: EruditServerBuildError;
|
|
12
|
+
buildPromise: Promise<void>;
|
|
13
|
+
changedFiles: EruditServerChangedFiles;
|
|
14
|
+
config: EruditServerConfig;
|
|
15
|
+
log: EruditServerLogger;
|
|
16
|
+
language: EruditServerLanguage;
|
|
17
|
+
db: EruditServerDatabase;
|
|
18
|
+
repository: EruditServerRepository;
|
|
19
|
+
contentNav: EruditServerContentNav;
|
|
20
|
+
import: EruditServerImporter;
|
|
21
|
+
} = {} as any;
|
|
22
|
+
|
|
23
|
+
Object.assign(globalThis, {
|
|
24
|
+
defineContributor,
|
|
25
|
+
defineSponsor,
|
|
26
|
+
defineCameo,
|
|
27
|
+
defineBook,
|
|
28
|
+
defineTopic,
|
|
29
|
+
definePage,
|
|
30
|
+
defineGroup,
|
|
31
|
+
defineProse,
|
|
32
|
+
Include,
|
|
33
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createJiti, type Jiti, type JitiOptions } from 'jiti';
|
|
2
|
+
import slash from 'slash';
|
|
3
|
+
import { insertDocumentId } from '@jsprose/core';
|
|
4
|
+
import {
|
|
5
|
+
pathToDocumentId,
|
|
6
|
+
stringifyDocumentId,
|
|
7
|
+
} from '@erudit-js/core/prose/documentId';
|
|
8
|
+
import { insertProblemScriptId } from '@erudit-js/prose/elements/problem/problemScript';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
EXTENSIONS,
|
|
12
|
+
STATIC_ASSET_EXTENSIONS,
|
|
13
|
+
} from './prose/transform/extensions';
|
|
14
|
+
|
|
15
|
+
export type EruditServerImporter = Jiti['import'];
|
|
16
|
+
|
|
17
|
+
export let jiti: Jiti;
|
|
18
|
+
|
|
19
|
+
export async function setupServerImporter() {
|
|
20
|
+
const jitiId = ERUDIT.config.paths.project;
|
|
21
|
+
const defaultJiti = createJiti(jitiId, createBaseJitiOptions());
|
|
22
|
+
const getDefaultCode = defaultJiti.transform.bind(defaultJiti);
|
|
23
|
+
|
|
24
|
+
jiti = createJiti(ERUDIT.config.paths.project, {
|
|
25
|
+
...createBaseJitiOptions(),
|
|
26
|
+
extensions: EXTENSIONS.map((ext) => '.' + ext),
|
|
27
|
+
transform: (opts) => {
|
|
28
|
+
if (!opts.filename) {
|
|
29
|
+
return { code: getDefaultCode(opts) };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const filename = slash(opts.filename).replace('file://', '');
|
|
33
|
+
|
|
34
|
+
const staticAssetModule = tryStaticAssetModule(filename);
|
|
35
|
+
if (staticAssetModule) {
|
|
36
|
+
return staticAssetModule;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let code = getDefaultCode(opts);
|
|
40
|
+
|
|
41
|
+
//
|
|
42
|
+
// Insert IDs in `defineDocument(...)` calls
|
|
43
|
+
//
|
|
44
|
+
|
|
45
|
+
const documentId = pathToDocumentId(
|
|
46
|
+
filename,
|
|
47
|
+
ERUDIT.config.paths.project,
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
if (documentId) {
|
|
51
|
+
code = insertDocumentId({
|
|
52
|
+
code,
|
|
53
|
+
documentId: stringifyDocumentId(documentId),
|
|
54
|
+
aliasName: 'defineProse',
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
// Problem Scripts
|
|
60
|
+
//
|
|
61
|
+
|
|
62
|
+
code = insertProblemScriptId(filename, code);
|
|
63
|
+
|
|
64
|
+
return { code };
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
ERUDIT.import = jiti.import;
|
|
69
|
+
|
|
70
|
+
ERUDIT.log.success('Importer setup complete!');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function createBaseJitiOptions(): JitiOptions {
|
|
74
|
+
return {
|
|
75
|
+
fsCache: false,
|
|
76
|
+
moduleCache: false,
|
|
77
|
+
alias: {
|
|
78
|
+
'#project/': ERUDIT.config.paths.project + '/',
|
|
79
|
+
'#content/': ERUDIT.config.paths.project + '/content/',
|
|
80
|
+
},
|
|
81
|
+
jsx: {
|
|
82
|
+
runtime: 'automatic',
|
|
83
|
+
importSource: '@jsprose/core',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function tryStaticAssetModule(filename: unknown) {
|
|
89
|
+
if (
|
|
90
|
+
typeof filename === 'string' &&
|
|
91
|
+
STATIC_ASSET_EXTENSIONS.some((ext) => filename.endsWith('.' + ext))
|
|
92
|
+
) {
|
|
93
|
+
return {
|
|
94
|
+
code: `exports.default = "${filename}";`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
|
|
3
|
+
import { setupServerLogger } from './logger';
|
|
4
|
+
import { setupServerRuntimeConfig } from './config';
|
|
5
|
+
import { setupServerLanguage } from './language/setup';
|
|
6
|
+
import { setupServerDatabase } from './db/setup';
|
|
7
|
+
import { setupServerImporter } from './importer';
|
|
8
|
+
import { setupServerRepository } from './repository';
|
|
9
|
+
import { setupServerContentNav } from './content/nav/setup';
|
|
10
|
+
import { buildServerErudit, tryServerWatchProject } from './build';
|
|
11
|
+
|
|
12
|
+
let serverSetupPromise: Promise<void>;
|
|
13
|
+
|
|
14
|
+
export default defineNitroPlugin((nitro) => {
|
|
15
|
+
serverSetupPromise = setupServer();
|
|
16
|
+
|
|
17
|
+
nitro.hooks.hook('request', async (event) => {
|
|
18
|
+
await serverSetupPromise;
|
|
19
|
+
await ERUDIT.buildPromise;
|
|
20
|
+
|
|
21
|
+
if (ERUDIT.buildError) {
|
|
22
|
+
const accept = getHeader(event, 'accept') || '';
|
|
23
|
+
if (accept.includes('text/html')) {
|
|
24
|
+
function escapeHtml(str: string) {
|
|
25
|
+
return str
|
|
26
|
+
.replace(/&/g, '&')
|
|
27
|
+
.replace(/</g, '<')
|
|
28
|
+
.replace(/>/g, '>')
|
|
29
|
+
.replace(/"/g, '"')
|
|
30
|
+
.replace(/'/g, ''');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
event.node.res.end(`
|
|
34
|
+
<!DOCTYPE html>
|
|
35
|
+
<html>
|
|
36
|
+
<head>
|
|
37
|
+
<meta charset="UTF-8">
|
|
38
|
+
<title>Erudit Build Error</title>
|
|
39
|
+
<style>
|
|
40
|
+
:root {
|
|
41
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen;
|
|
42
|
+
}
|
|
43
|
+
</style>
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
<h1>Erudit Build Error</h1>
|
|
47
|
+
<pre style="padding: 1em; border-radius: 4px; overflow-x: auto;">
|
|
48
|
+
${escapeHtml(ERUDIT.buildError.stack || '')}
|
|
49
|
+
</pre>
|
|
50
|
+
</body>
|
|
51
|
+
</html>
|
|
52
|
+
`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
nitro.hooks.hook('close', async () => {});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
async function setupServer() {
|
|
61
|
+
try {
|
|
62
|
+
const { registerProseGlobals } = await import('#erudit/prose/global');
|
|
63
|
+
registerProseGlobals();
|
|
64
|
+
|
|
65
|
+
await setupServerRuntimeConfig();
|
|
66
|
+
await setupServerLogger();
|
|
67
|
+
await setupServerImporter();
|
|
68
|
+
await setupServerLanguage();
|
|
69
|
+
await setupServerDatabase();
|
|
70
|
+
await setupServerRepository();
|
|
71
|
+
await setupServerContentNav();
|
|
72
|
+
ERUDIT.log.success(chalk.green('Setup Complete!'));
|
|
73
|
+
|
|
74
|
+
await tryServerWatchProject();
|
|
75
|
+
await buildServerErudit();
|
|
76
|
+
} catch (buildError) {
|
|
77
|
+
if (buildError instanceof Error) {
|
|
78
|
+
ERUDIT.buildError = buildError;
|
|
79
|
+
} else {
|
|
80
|
+
ERUDIT.buildError = createError({
|
|
81
|
+
statusCode: 500,
|
|
82
|
+
statusMessage: 'Unknown Erudit Server Error',
|
|
83
|
+
message:
|
|
84
|
+
typeof buildError === 'string'
|
|
85
|
+
? buildError
|
|
86
|
+
: 'An unknown error occurred!',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
const en: LanguagePhrases = {
|
|
2
|
+
language_code: 'en',
|
|
3
|
+
language_name: 'English',
|
|
4
|
+
erudit: 'Erudit',
|
|
5
|
+
content_nav: 'Content navigation',
|
|
6
|
+
pages: 'Pages',
|
|
7
|
+
search: 'Search',
|
|
8
|
+
languages: 'Languages',
|
|
9
|
+
settings: 'Settings',
|
|
10
|
+
theme: 'Theme',
|
|
11
|
+
theme_light: 'Light',
|
|
12
|
+
theme_dark: 'Dark',
|
|
13
|
+
theme_system: 'System',
|
|
14
|
+
built: 'Built',
|
|
15
|
+
content: 'Content',
|
|
16
|
+
add_translation: 'Add translation',
|
|
17
|
+
main_page: 'Main page',
|
|
18
|
+
contributors: 'Contributors',
|
|
19
|
+
sponsors: 'Sponsors',
|
|
20
|
+
search_the_site: 'Search the site...',
|
|
21
|
+
searching_more: 'Searching more...',
|
|
22
|
+
no_results: 'No results found',
|
|
23
|
+
no_more_results: 'No more results',
|
|
24
|
+
no_content: 'No content.',
|
|
25
|
+
to_index: 'To index',
|
|
26
|
+
about_textbook: 'About textbook',
|
|
27
|
+
flag_title_dev: 'Development',
|
|
28
|
+
flag_hint_dev:
|
|
29
|
+
'This material is not complete, may contain error and will change in the future! Use with caution!',
|
|
30
|
+
flag_title_advanced: 'Advanced',
|
|
31
|
+
flag_hint_advanced:
|
|
32
|
+
'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
|
|
33
|
+
flag_title_secondary: 'Additional',
|
|
34
|
+
flag_hint_secondary:
|
|
35
|
+
'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
|
|
36
|
+
ads_replacer:
|
|
37
|
+
'We help you. Help us back.<br><strong style="color: inherit;">Disable your ads blocker!</strong>',
|
|
38
|
+
direct_link: 'Direct link',
|
|
39
|
+
direct_link_explain: 'You are about to open a direct link:',
|
|
40
|
+
book: 'Textbook',
|
|
41
|
+
group: 'Category',
|
|
42
|
+
topic: 'Topic',
|
|
43
|
+
article: 'Article',
|
|
44
|
+
summary: 'Summary',
|
|
45
|
+
practice: 'Practice',
|
|
46
|
+
page: 'Page',
|
|
47
|
+
preview_content_page_description: 'You are about to open a content page:',
|
|
48
|
+
begin_learning: 'Begin Learning!',
|
|
49
|
+
flag_dev: 'Development',
|
|
50
|
+
flag_dev_description:
|
|
51
|
+
'This material is in development! It may change in the future and even contain errors!',
|
|
52
|
+
flag_advanced: 'Advanced',
|
|
53
|
+
flag_advanced_description:
|
|
54
|
+
'This material is for learners with a high level of knowledge. It contains information that is not suitable for beginners!',
|
|
55
|
+
flag_secondary: 'Additional',
|
|
56
|
+
flag_secondary_description:
|
|
57
|
+
'This is an optional material is for learners who want to dive deeper and gain additional knowledge and context.',
|
|
58
|
+
key_elements: 'Key elements',
|
|
59
|
+
stats: 'Statistics',
|
|
60
|
+
connections: 'Connections',
|
|
61
|
+
need_to_know: 'Need to know',
|
|
62
|
+
depends_on: 'Depends on',
|
|
63
|
+
used_by: 'Used by',
|
|
64
|
+
externals: 'Externals',
|
|
65
|
+
add_quote: 'Add your own message!',
|
|
66
|
+
next_quote: 'Next quote',
|
|
67
|
+
sponsors_description:
|
|
68
|
+
'List of people and organizations that support the project financially. Thanks to them, the project can exist and develop. If you want to help the project, you can become a sponsor and get on this page too!',
|
|
69
|
+
become_sponsor: 'Become a sponsor',
|
|
70
|
+
no_sponsors: 'There are no sponsors yet. You can be the first one!',
|
|
71
|
+
contributors_description:
|
|
72
|
+
'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
|
|
73
|
+
contributors_invite:
|
|
74
|
+
'You can also help the project, make a contribution and get on this page!',
|
|
75
|
+
contributor_page_description: (name: string) =>
|
|
76
|
+
`Personal page of contributor "${name}" with information about their contributions to the project.`,
|
|
77
|
+
become_contributor: 'Become a contributor',
|
|
78
|
+
no_contributors: 'There are no contributors yet. You can be the first one!',
|
|
79
|
+
contribution: 'Contribution',
|
|
80
|
+
no_contribution: 'No contributions yet.',
|
|
81
|
+
editor: 'Editor',
|
|
82
|
+
materials: 'Materials',
|
|
83
|
+
x_sponsors: (count: number) => m(count, 'Sponsor', 'Sponsors'),
|
|
84
|
+
x_contributors: (count: number) => m(count, 'Contributor', 'Contributors'),
|
|
85
|
+
news: 'News',
|
|
86
|
+
no_news: 'No news.',
|
|
87
|
+
show_more: 'Show more',
|
|
88
|
+
make_contribution: 'Make a contribution',
|
|
89
|
+
improve_material: 'Improve material',
|
|
90
|
+
how_to_improve: 'How to improve?',
|
|
91
|
+
report_issue: 'Report an issue',
|
|
92
|
+
edit_page: 'Edit page',
|
|
93
|
+
no_toc: 'TOC is empty.',
|
|
94
|
+
article_seo_description: (contentTitle: string) =>
|
|
95
|
+
`Clear and interesting explanation of the topic "${contentTitle}". Clear examples, important terms and statements, interesting facts, life applications.`,
|
|
96
|
+
summary_seo_description: (contentTitle: string) =>
|
|
97
|
+
`Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
|
|
98
|
+
practice_seo_description: (contentTitle: string) =>
|
|
99
|
+
`Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
|
|
100
|
+
externals_own: 'Own',
|
|
101
|
+
externals_from: 'From',
|
|
102
|
+
|
|
103
|
+
default_index_title: 'Erudit',
|
|
104
|
+
default_index_short: 'Modern digital textbooks!',
|
|
105
|
+
default_site_info_short: 'Modern textbook',
|
|
106
|
+
|
|
107
|
+
// _language_title: 'English',
|
|
108
|
+
// _language_code: 'en',
|
|
109
|
+
// site_info_title: 'Erudit',
|
|
110
|
+
// site_info_slogan: 'Modern textbook',
|
|
111
|
+
// seo_index_title: 'Erudit - CMS for eductional sites',
|
|
112
|
+
// seo_index_description:
|
|
113
|
+
// 'Erudit is a CMS for creating and managing perfect educational sites, maintained by the community.',
|
|
114
|
+
// seo_article_description: (contentTitle) =>
|
|
115
|
+
// `Clear and interesting explanation of the topic "${contentTitle}". Illustrative examples, important properties, interesting facts, life applications, clear proofs. Here you will definitely understand the topic!`,
|
|
116
|
+
// seo_summary_description: (contentTitle) =>
|
|
117
|
+
// `Summary of the topic "${contentTitle}": key definitions, theorems, properties and examples of their use. All the most important things in a concise form!`,
|
|
118
|
+
// seo_practice_description: (contentTitle) =>
|
|
119
|
+
// `Various problems with hints and answers on the topic "${contentTitle}". Interesting conditions, hints and detailed solutions. Turn knowledge into a skill!`,
|
|
120
|
+
// index: 'Index',
|
|
121
|
+
// pages: 'Pages',
|
|
122
|
+
// search: 'Search',
|
|
123
|
+
// language: 'Language',
|
|
124
|
+
// other: 'Other',
|
|
125
|
+
// ads_replacer:
|
|
126
|
+
// 'Help us develop the project.<br><strong>Disable your ads blocker!</strong>',
|
|
127
|
+
// theme: 'Theme',
|
|
128
|
+
// theme_system: 'System',
|
|
129
|
+
// theme_light: 'Light',
|
|
130
|
+
// theme_dark: 'Dark',
|
|
131
|
+
// content: 'Content',
|
|
132
|
+
// main_page: 'Main page',
|
|
133
|
+
// contributors: 'Contributors',
|
|
134
|
+
// contributors_page_description:
|
|
135
|
+
// 'List of people who contributed to the project materials: suggested valuable ideas, made corrections to existing material or wrote their own!',
|
|
136
|
+
// contributors_page_invite:
|
|
137
|
+
// 'You can also help the project, make a contribution and get on this page!',
|
|
138
|
+
// become_contributor: 'Become a contributor',
|
|
139
|
+
// contributor: 'Contributor',
|
|
140
|
+
// contribution: 'Contribution',
|
|
141
|
+
// contributions_explain: (count) =>
|
|
142
|
+
// `Contributed to ${m(count, 'material', 'materials')}`,
|
|
143
|
+
// contributor_description: (name) =>
|
|
144
|
+
// `Page with information about the contributor "${name}" and his contribution to the project.`,
|
|
145
|
+
// editor: 'Editor',
|
|
146
|
+
// add_translation: 'Add translation',
|
|
147
|
+
// empty_nav: 'Empty navigation',
|
|
148
|
+
|
|
149
|
+
// popover_dependencies: 'Dependencies',
|
|
150
|
+
// popover_dependencies_description:
|
|
151
|
+
// 'There is no royal way into this topic! You can only figure it out if you know the following topics:',
|
|
152
|
+
// to_index: 'To index',
|
|
153
|
+
// about_book: 'About book',
|
|
154
|
+
// close: 'Close',
|
|
155
|
+
// back: 'Back',
|
|
156
|
+
// goto: 'Go to',
|
|
157
|
+
// error: 'Error!',
|
|
158
|
+
// external_link: 'External link',
|
|
159
|
+
// external_link_warn: 'You are going to visit external resource!',
|
|
160
|
+
// internal_link: 'Internal link',
|
|
161
|
+
// internal_link_warn: 'You are going to visit internal site page!',
|
|
162
|
+
// book: 'Textbook',
|
|
163
|
+
// group: 'Group',
|
|
164
|
+
// topic: 'Topic',
|
|
165
|
+
// topics: 'Topics',
|
|
166
|
+
// article: 'Article',
|
|
167
|
+
// summary: 'Summary',
|
|
168
|
+
// practice: 'Practice',
|
|
169
|
+
// element_id: 'Element ID',
|
|
170
|
+
// preview_missing_title: 'Element not found!',
|
|
171
|
+
// preview_missing_explain: `Can't find the element with specified ID in this page!<br>Perhaps the element ID is specified incorrectly or the element has been changed/deleted.`,
|
|
172
|
+
// preview_missing_explain_mismatch: `Can't find the element with specified ID in this page!<br>The version of the linked page is different from the current version of the page!<br>This is most likely the cause of the error.`,
|
|
173
|
+
// preview_hash_mismatch_title: 'Page version mismatch!',
|
|
174
|
+
// preview_hash_mismatch_explain:
|
|
175
|
+
// 'The version of the page you see now is different from the version of the page the original link led to!<br>The content may be different from what you expected to see.',
|
|
176
|
+
// current_page_hash: 'Current hash',
|
|
177
|
+
// expected_page_hash: 'Expected hash',
|
|
178
|
+
// empty_toc: 'Empty table of contents...',
|
|
179
|
+
// no_contributors: 'No contributors...',
|
|
180
|
+
// make_contribution: 'Make a contribution',
|
|
181
|
+
// material_improvement: 'Material improvement',
|
|
182
|
+
// how_to_improve: 'How to improve?',
|
|
183
|
+
// edit_page: 'Edit page',
|
|
184
|
+
// report_problem: 'Report a problem',
|
|
185
|
+
// references: 'References',
|
|
186
|
+
// reference_source_featured: 'Featured source',
|
|
187
|
+
// references_description:
|
|
188
|
+
// 'A list of external sources that were used to write this material. If there is an asterisk next to the title, it is a featured source and is worth reading if you want to delve deeper into the material.',
|
|
189
|
+
// sponsors: 'Sponsors',
|
|
190
|
+
// sponsors_description:
|
|
191
|
+
// 'People and organizations that support the project financially. Thanks to them, we can continue to develop the project and improve the quality of materials. If you want to support the project, you can become a sponsor too!',
|
|
192
|
+
// become_sponsor: 'Become a sponsor',
|
|
193
|
+
// toc: 'Table of contents',
|
|
194
|
+
// mentions: (count) => m(count, 'mention', 'mentions'),
|
|
195
|
+
// start_learning: 'Start learning!',
|
|
196
|
+
// x_contributors: (count) => m(count, 'Contributor', 'Contributors'),
|
|
197
|
+
// x_sponsors: (count) => m(count, 'Sponsor', 'Sponsors'),
|
|
198
|
+
// show_all: 'Show all',
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export default en;
|
|
202
|
+
|
|
203
|
+
export function m(
|
|
204
|
+
number: number,
|
|
205
|
+
one: string,
|
|
206
|
+
few: string,
|
|
207
|
+
includeNumber = true,
|
|
208
|
+
) {
|
|
209
|
+
const text = number === 1 ? one : few;
|
|
210
|
+
return includeNumber ? `${number} ${text}` : text;
|
|
211
|
+
}
|