erudit 3.0.0-dev.23 → 3.0.0-dev.25
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 +25 -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 +2 -2
- 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 +2 -4
- 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 +2 -2
- 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 -1
- 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 +17 -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 -33
- package/app/components/ads/AdsBannerAside.vue +46 -61
- package/app/components/ads/AdsBannerBottom.vue +17 -22
- package/app/components/ads/AdsReplacer.vue +28 -73
- package/app/components/ads/provider/Custom.vue +19 -0
- package/app/components/ads/{AdsProviderYandex.vue → provider/Yandex.vue} +84 -91
- package/app/components/aside/AsideListItem.vue +66 -91
- package/app/components/aside/AsideMajor.vue +8 -56
- package/app/components/aside/AsideMinor.vue +76 -97
- package/app/components/aside/AsideSwitch.vue +67 -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 +24 -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 +21 -0
- package/app/components/aside/minor/content/AsideMinorContentContributions.vue +53 -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 +116 -0
- package/app/components/aside/minor/content/ButtonPaneImprove.vue +121 -0
- package/app/components/aside/minor/content/Contribution.vue +34 -0
- package/app/components/aside/minor/content/Toc.vue +165 -0
- package/app/components/aside/minor/content/TocItem.vue +77 -0
- package/app/components/aside/minor/content/TopicPartButton.vue +35 -0
- package/app/components/aside/minor/contributor/AsideMinorContributor.vue +31 -68
- 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 +135 -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 +48 -0
- package/app/components/main/MainContentChildren.vue +14 -0
- package/app/components/main/MainDecoration.vue +15 -0
- package/app/components/main/MainDescription.vue +6 -23
- 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 +76 -0
- package/app/components/main/MainQuickLinks.vue +42 -0
- package/app/components/main/MainQuote.vue +160 -0
- package/app/components/main/MainQuoteLoader.vue +86 -0
- package/app/components/main/MainSection.vue +39 -42
- package/app/components/main/MainSectionPreamble.vue +5 -0
- package/app/components/main/MainSubTitle.vue +12 -0
- package/app/components/main/MainTitle.vue +26 -69
- 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 +46 -0
- package/app/components/main/connections/MainConnections.vue +41 -0
- package/app/components/main/connections/MainConnectionsButton.vue +80 -0
- package/app/components/main/connections/ScrollPane.vue +11 -0
- package/app/components/main/contentStats/Item.vue +35 -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 +50 -0
- package/app/components/preview/Preview.vue +173 -186
- package/app/components/preview/PreviewError.vue +10 -0
- package/app/components/preview/PreviewLoading.vue +5 -14
- package/app/components/preview/PreviewScreen.vue +65 -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 +70 -0
- package/app/components/site/SiteAsideOverlay.vue +21 -0
- package/app/components/site/SiteMain.vue +16 -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 -93
- package/app/composables/ads.ts +17 -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 +78 -81
- package/app/composables/loading.ts +2 -0
- package/app/composables/mainContent.ts +31 -0
- package/app/composables/og.ts +169 -0
- package/app/composables/phrases.ts +126 -77
- package/app/composables/preview.ts +53 -0
- package/app/composables/route.ts +4 -0
- package/app/composables/theme.ts +71 -50
- package/app/composables/url.ts +22 -43
- package/app/formatters/ru.ts +14 -0
- package/app/pages/article/[...articleId].vue +10 -1
- package/app/pages/book/[...bookId].vue +50 -11
- package/app/pages/contributor/[contributorId].vue +127 -203
- package/app/pages/contributors.vue +80 -164
- package/app/pages/group/[...groupId].vue +52 -11
- package/app/pages/index.vue +101 -186
- package/app/pages/page/[...pageId].vue +60 -0
- package/app/pages/practice/[...practiceId].vue +12 -0
- package/app/pages/sponsors.vue +66 -76
- 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 +16 -11
- package/app/router.options.ts +5 -0
- package/app/scripts/theme.js +33 -0
- package/app/styles/main.css +173 -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 +48 -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 -102
- package/package.json +36 -18
- 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 +36 -35
- package/server/api/contributor/page/[contributorId].ts +58 -4
- 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 +56 -0
- package/server/api/prerender/content.ts +82 -0
- package/server/api/prerender/files.ts +10 -0
- package/server/api/prerender/frontNav.ts +13 -0
- package/server/api/prerender/language.ts +3 -5
- 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 +135 -0
- package/server/erudit/cameos/build.ts +111 -0
- package/server/erudit/config.ts +11 -0
- package/server/erudit/content/global/build.ts +271 -0
- package/server/erudit/content/global/singleton.ts +5 -0
- package/server/erudit/content/nav/build.ts +431 -0
- package/server/erudit/content/nav/front.ts +130 -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 +64 -0
- package/server/erudit/content/repository/externals.ts +25 -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 +139 -0
- package/server/erudit/content/resolve/page.ts +87 -0
- package/server/erudit/content/resolve/topic.ts +113 -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 +93 -0
- package/server/erudit/content/search.ts +135 -0
- package/server/erudit/contributors/build.ts +111 -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 +23 -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 +32 -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 +209 -0
- package/server/erudit/language/list/ru.ts +214 -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 +77 -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 +114 -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 +1 -1
- package/server/routes/search.json.gz.ts +72 -0
- package/server/routes/sitemap.xml.ts +61 -90
- 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 +8 -0
- package/shared/types/frontContentNav.ts +38 -0
- package/shared/types/indexPage.ts +20 -0
- package/shared/types/language.ts +189 -89
- 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/cameo-add.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/list-squared.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/Avatar.vue +0 -118
- package/app/components/EruditLink.vue +0 -17
- package/app/components/GroupLikePage.vue +0 -70
- package/app/components/Loading.vue +0 -23
- package/app/components/QuickLinks.vue +0 -99
- package/app/components/SiteAside.vue +0 -393
- package/app/components/SiteMain.vue +0 -32
- package/app/components/ads/AdsProviderCustom.vue +0 -35
- 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 -50
- package/app/components/aside/major/panes/Search.vue +0 -11
- package/app/components/aside/major/panes/nav/Nav.vue +0 -92
- package/app/components/aside/major/panes/nav/NavBook.vue +0 -95
- 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 -13
- package/app/components/aside/major/panes/other/ItemTheme.vue +0 -49
- package/app/components/aside/major/panes/other/Other.vue +0 -16
- package/app/components/aside/minor/AsideMinorContribute.vue +0 -175
- package/app/components/aside/minor/AsideMinorNews.vue +0 -11
- package/app/components/aside/minor/AsideMinorTopLink.vue +0 -66
- package/app/components/aside/minor/content/AsideMinorContent.vue +0 -89
- package/app/components/aside/minor/contributor/BookContribution.vue +0 -64
- package/app/components/aside/minor/topic/AsideMinorTopic.vue +0 -31
- package/app/components/aside/minor/topic/TopicContributors.vue +0 -183
- package/app/components/aside/minor/topic/TopicNav.vue +0 -49
- package/app/components/aside/minor/topic/TopicToc.vue +0 -212
- package/app/components/aside/minor/topic/TopicTocItem.vue +0 -19
- package/app/components/aside/utils/AsideOverlayPane.vue +0 -40
- package/app/components/bitran/BitranContent.vue +0 -90
- package/app/components/bitran/RenderWrapper.vue +0 -10
- package/app/components/contributor/ContributorListItem.vue +0 -43
- package/app/components/index/IndexAvatars.vue +0 -143
- package/app/components/main/MainActionButton.vue +0 -53
- package/app/components/main/MainBitranContent.vue +0 -68
- package/app/components/main/MainBreadcrumb.vue +0 -63
- package/app/components/main/MainSectionTitle.vue +0 -50
- package/app/components/main/MainSourceUsages.vue +0 -119
- package/app/components/main/MainSourcesUsage.vue +0 -60
- package/app/components/main/MainToc.vue +0 -135
- package/app/components/main/cameo/MainCameo.vue +0 -135
- package/app/components/main/cameo/MainCameoData.vue +0 -232
- package/app/components/main/content/ContentBreadcrumb.vue +0 -28
- package/app/components/main/content/ContentDecoration.vue +0 -29
- package/app/components/main/content/ContentPopover.vue +0 -188
- package/app/components/main/content/ContentPopovers.vue +0 -118
- package/app/components/main/content/ContentReferences.vue +0 -44
- package/app/components/main/content/reference/ReferenceGroup.vue +0 -39
- package/app/components/main/content/reference/ReferenceItem.vue +0 -70
- package/app/components/main/content/reference/ReferenceSource.vue +0 -121
- package/app/components/main/topic/MainTopic.vue +0 -73
- package/app/components/main/topic/MainTopicQuickLinks.vue +0 -24
- package/app/components/main/topic/TopicPartSwitch.vue +0 -119
- 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 -22
- package/app/components/preview/display/Unique.vue +0 -46
- package/app/components/sponsor/SponsorTier1.vue +0 -89
- package/app/components/sponsor/SponsorTier2.vue +0 -109
- package/app/components/stats/Stats.vue +0 -21
- package/app/components/stats/StatsGroupLike.vue +0 -24
- package/app/components/stats/StatsItem.vue +0 -33
- package/app/components/stats/StatsItemElement.vue +0 -13
- package/app/composables/adsAllowed.ts +0 -11
- package/app/composables/asset.ts +0 -12
- package/app/composables/bitran.ts +0 -108
- package/app/composables/bitranLocation.ts +0 -6
- package/app/composables/contentData.ts +0 -38
- package/app/composables/contentPage.ts +0 -169
- package/app/composables/contentRoute.ts +0 -45
- package/app/composables/darkMagic.ts +0 -24
- package/app/composables/externalApi.ts +0 -69
- package/app/composables/head.ts +0 -24
- package/app/composables/majorPane.ts +0 -62
- package/app/pages/_test/preview.vue +0 -110
- package/app/pages/practice/[...practice].vue +0 -3
- package/app/plugins/analytics.ts +0 -95
- 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/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/flag.ts +0 -28
- package/app/scripts/og.ts +0 -28
- package/app/scripts/preview/build.ts +0 -76
- 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 -24
- package/app/scripts/preview/data/unique.ts +0 -69
- 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 -49
- 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/const.ts +0 -3
- package/globalPath.ts +0 -21
- package/globals/bitran.ts +0 -1
- package/globals/cameo.ts +0 -5
- package/globals/content.ts +0 -27
- package/globals/contributor.ts +0 -5
- package/globals/erudit.ts +0 -5
- package/globals/register.ts +0 -23
- package/globals/sponsor.ts +0 -17
- package/languages/en.ts +0 -114
- package/languages/ru.ts +0 -119
- package/module/bitran.ts +0 -66
- package/module/config.ts +0 -35
- package/module/imports.ts +0 -74
- 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 -17
- package/server/api/aside/major/nav/global.ts +0 -7
- package/server/api/aside/minor/book/[...bookId].ts +0 -18
- package/server/api/aside/minor/contributor/[contributorId].ts +0 -18
- package/server/api/aside/minor/group/[...groupId].ts +0 -18
- package/server/api/aside/minor/news.ts +0 -7
- package/server/api/aside/minor/topic.ts +0 -36
- package/server/api/bitran/content/[...location].ts +0 -13
- package/server/api/bitran/toc/[...location].ts +0 -9
- package/server/api/cameo/data/[cameoId].ts +0 -42
- package/server/api/cameo/ids.ts +0 -5
- package/server/api/content/data.ts +0 -97
- 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/index/data.ts +0 -46
- package/server/api/language/phrase/[phraseId].ts +0 -19
- package/server/api/language/phraseIds.ts +0 -8
- package/server/api/prerender/assets/cameo.ts +0 -14
- package/server/api/prerender/assets/contributor.ts +0 -12
- package/server/api/prerender/assets/sponsor.ts +0 -13
- package/server/api/prerender/cameos.ts +0 -12
- package/server/api/preview/page/[...parts].ts +0 -78
- package/server/api/preview/unique/[...location].ts +0 -48
- package/server/api/problem/generator/[...path].ts +0 -26
- package/server/api/sponsor/cameo/data/[sponsorId].ts +0 -51
- package/server/api/sponsor/cameo/ids.ts +0 -5
- package/server/api/sponsor/count.ts +0 -5
- package/server/api/sponsor/list.ts +0 -36
- package/server/plugin/bitran/content.ts +0 -238
- package/server/plugin/bitran/elements/include.ts +0 -229
- package/server/plugin/bitran/location.ts +0 -40
- package/server/plugin/bitran/toc.ts +0 -94
- package/server/plugin/bitran/transpiler.ts +0 -18
- package/server/plugin/build/close.ts +0 -12
- package/server/plugin/build/jobs/content/builderArgs.ts +0 -8
- package/server/plugin/build/jobs/content/generic.ts +0 -191
- package/server/plugin/build/jobs/content/parse.ts +0 -207
- 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 -16
- package/server/plugin/build/jobs/content/type/topic.ts +0 -36
- package/server/plugin/build/jobs/contributors.ts +0 -69
- package/server/plugin/build/jobs/language.ts +0 -36
- package/server/plugin/build/jobs/nav.ts +0 -345
- package/server/plugin/build/process.ts +0 -34
- package/server/plugin/build/rebuild.ts +0 -68
- package/server/plugin/build/setup.ts +0 -19
- 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 -45
- package/server/plugin/db/entities/Contribution.ts +0 -10
- package/server/plugin/db/entities/Contributor.ts +0 -25
- package/server/plugin/db/entities/File.ts +0 -10
- package/server/plugin/db/entities/Group.ts +0 -11
- package/server/plugin/db/entities/Hash.ts +0 -15
- package/server/plugin/db/entities/QuickLink.ts +0 -19
- package/server/plugin/db/entities/Stat.ts +0 -13
- package/server/plugin/db/entities/Topic.ts +0 -20
- package/server/plugin/db/entities/Unique.ts +0 -21
- package/server/plugin/db/reset.ts +0 -12
- package/server/plugin/db/setup.ts +0 -53
- package/server/plugin/global.ts +0 -18
- package/server/plugin/importer.ts +0 -16
- package/server/plugin/index.ts +0 -9
- package/server/plugin/logger.ts +0 -23
- package/server/plugin/nav/node.ts +0 -27
- package/server/plugin/nav/utils.ts +0 -179
- package/server/plugin/repository/asideMinor.ts +0 -51
- package/server/plugin/repository/book.ts +0 -39
- package/server/plugin/repository/cameo.ts +0 -16
- package/server/plugin/repository/content.ts +0 -240
- package/server/plugin/repository/contentId.ts +0 -40
- package/server/plugin/repository/contentToc.ts +0 -90
- package/server/plugin/repository/contributor.ts +0 -129
- package/server/plugin/repository/elementStats.ts +0 -80
- package/server/plugin/repository/file.ts +0 -10
- package/server/plugin/repository/frontNav.ts +0 -145
- package/server/plugin/repository/link.ts +0 -20
- package/server/plugin/repository/quickLink.ts +0 -36
- package/server/plugin/repository/readLink.ts +0 -17
- package/server/plugin/repository/reference.ts +0 -78
- package/server/plugin/repository/topic.ts +0 -35
- package/server/plugin/repository/topicCount.ts +0 -19
- package/server/plugin/sponsor/build.ts +0 -82
- package/server/plugin/sponsor/index.ts +0 -5
- package/server/plugin/sponsor/repository.ts +0 -56
- package/server/routes/asset/[...assetPath].ts +0 -34
- package/server/tsconfig.json +0 -9
- package/shared/aside/minor.ts +0 -55
- package/shared/asset.ts +0 -17
- package/shared/bitran/content.ts +0 -9
- package/shared/bitran/contentId.ts +0 -56
- package/shared/bitran/toc.ts +0 -8
- package/shared/breadcrumb.ts +0 -7
- package/shared/content/bookId.ts +0 -12
- package/shared/content/context.ts +0 -9
- package/shared/content/data/base.ts +0 -32
- package/shared/content/data/groupLike.ts +0 -11
- package/shared/content/data/index.ts +0 -5
- package/shared/content/data/type/book.ts +0 -7
- package/shared/content/data/type/group.ts +0 -8
- package/shared/content/data/type/topic.ts +0 -13
- package/shared/content/previousNext.ts +0 -9
- package/shared/content/reference.ts +0 -18
- package/shared/content/toc.ts +0 -35
- package/shared/contributor.ts +0 -34
- package/shared/frontNav.ts +0 -41
- package/shared/icons.ts +0 -38
- package/shared/image.ts +0 -5
- package/shared/indexData.ts +0 -10
- package/shared/link.ts +0 -29
- package/shared/popover.ts +0 -8
- package/shared/quickLink.ts +0 -7
- package/shared/stat.ts +0 -23
- package/shared/utils/objectsEqual.ts +0 -4
- package/test/contentId.test.ts +0 -91
- package/test/utils/url.test.ts +0 -99
- package/utils/contentPath.ts +0 -67
- package/utils/ext.ts +0 -41
- package/utils/normalize.ts +0 -7
- package/utils/stress.ts +0 -9
- package/utils/url.ts +0 -23
package/languages/ru.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
const russian: EruditPhrases = {
|
|
2
|
-
_language_title: 'Русский',
|
|
3
|
-
_language_code: 'ru',
|
|
4
|
-
|
|
5
|
-
site_info_title: 'Erudit',
|
|
6
|
-
site_info_slogan: 'Современный учебник',
|
|
7
|
-
seo_index_title: 'Erudit - CMS для образовательных сайтов',
|
|
8
|
-
seo_index_description:
|
|
9
|
-
'Erudit — CMS для создания и управления идеальными образовательными сайтами, которые поддерживаются сообществом.',
|
|
10
|
-
seo_article_description: (contentTitle) =>
|
|
11
|
-
`Понятное и интересное объяснение темы «${contentTitle}». Показательные примеры, важные свойства, интересные факты, применение в жизни, понятные доказательства. Здесь вы точно разберетесь!`,
|
|
12
|
-
seo_summary_description: (contentTitle) =>
|
|
13
|
-
`Конспект темы «${contentTitle}»: ключевые определения, теоремы, свойства и примеры их использвания. Все самое важное и в кратком виде!`,
|
|
14
|
-
seo_practice_description: (contentTitle) =>
|
|
15
|
-
`Разнообразные задачи с подсказками и ответами по теме «${contentTitle}». Интересные условия, подсказки и подробные решения. Превратите знания в навык!`,
|
|
16
|
-
index: 'Оглавление',
|
|
17
|
-
pages: 'Страницы',
|
|
18
|
-
search: 'Поиск',
|
|
19
|
-
language: 'Язык',
|
|
20
|
-
other: 'Другое',
|
|
21
|
-
ads_replacer:
|
|
22
|
-
'Помогите улучшать проект.<br><strong>Включите показ рекламы!</strong>',
|
|
23
|
-
theme: 'Тема',
|
|
24
|
-
theme_system: 'Системная',
|
|
25
|
-
theme_light: 'Светлая',
|
|
26
|
-
theme_dark: 'Темная',
|
|
27
|
-
content: 'Контент',
|
|
28
|
-
main_page: 'Главная страница',
|
|
29
|
-
contributors: 'Авторы',
|
|
30
|
-
contributors_page_description:
|
|
31
|
-
'Список людей, которые внесли вклад в материалы проекта: предложили ценные идеи, вносили корректировки в существующий материал или же написали собственный!',
|
|
32
|
-
contributors_page_invite:
|
|
33
|
-
'Вы тоже можете помочь проекту, внести свой вклад и попасть на эту страницу!',
|
|
34
|
-
become_contributor: 'Стать автором',
|
|
35
|
-
contributor: 'Автор',
|
|
36
|
-
contribution: 'Вклад',
|
|
37
|
-
contributions_explain: (count) =>
|
|
38
|
-
`Вклад в ${m(count, 'материал', 'материала', 'материалов')}`,
|
|
39
|
-
contributor_description: (name) =>
|
|
40
|
-
`Страница с информацией о авторе "${name}" и его вкладе в проект.`,
|
|
41
|
-
editor: 'Редактор',
|
|
42
|
-
add_translation: 'Добавить перевод',
|
|
43
|
-
empty_nav: 'Пустая навигация',
|
|
44
|
-
flag_dev: 'Разработка',
|
|
45
|
-
flag_dev_description:
|
|
46
|
-
'Этот материал в разработке! Он может измениться в будущем и даже содержать ошибки!',
|
|
47
|
-
flag_advanced: 'Профиль',
|
|
48
|
-
flag_advanced_description:
|
|
49
|
-
'Этот материал предназначен для учеников с высоким уровнем понимания предмета. Информация здесь не предназначена для новичков!',
|
|
50
|
-
flag_secondary: 'Дополнение',
|
|
51
|
-
flag_secondary_description:
|
|
52
|
-
'Это дополнительный материал для тех, кто хочет глубже погрузиться предмет и получить дополнительные знания и контекст.',
|
|
53
|
-
popover_dependencies: 'Зависимости',
|
|
54
|
-
popover_dependencies_description:
|
|
55
|
-
'Царского пути в эту тему нет! Вы сможете разобраться только если знаете следующие темы:',
|
|
56
|
-
to_index: 'К оглавлению',
|
|
57
|
-
about_book: 'Об учебнике',
|
|
58
|
-
close: 'Закрыть',
|
|
59
|
-
back: 'Назад',
|
|
60
|
-
goto: 'Перейти',
|
|
61
|
-
error: 'Ошибка!',
|
|
62
|
-
external_link: 'Внешняя ссылка',
|
|
63
|
-
external_link_warn: 'Вы собираетесь перейти на внешний ресурс!',
|
|
64
|
-
internal_link: 'Внутренняя ссылка',
|
|
65
|
-
internal_link_warn: 'Вы собираетесь перейти на внутреннюю страницу сайта!',
|
|
66
|
-
book: 'Учебник',
|
|
67
|
-
group: 'Группа',
|
|
68
|
-
topic: 'Тема',
|
|
69
|
-
topics: 'Темы',
|
|
70
|
-
article: 'Статья',
|
|
71
|
-
summary: 'Конспект',
|
|
72
|
-
practice: 'Задачи',
|
|
73
|
-
element_id: 'ID элемента',
|
|
74
|
-
preview_missing_title: 'Элемент не найден!',
|
|
75
|
-
preview_missing_explain:
|
|
76
|
-
'Не удалось найти на этой странице элемент с указанным ID!<br>Возможно, ID элемента указан неправильно или элемент был изменен/удален.',
|
|
77
|
-
preview_missing_explain_mismatch: `Не удалось найти на этой странице элемент с указанным ID!<br>Версия страницы, на которую вела ссылка, отличается от текущей версии страницы!<br>Скорее всего, именно это и является причиной ошибки.`,
|
|
78
|
-
preview_hash_mismatch_title: 'Несовпадение версий страницы!',
|
|
79
|
-
preview_hash_mismatch_explain:
|
|
80
|
-
'Версия страницы, которую вы видите сейчас отличается от версии страницы, на которую вела исходная ссылка!<br>Содержимое может отличаться от того, что вы ожидали увидеть.',
|
|
81
|
-
current_page_hash: 'Текущий хеш',
|
|
82
|
-
expected_page_hash: 'Ожидаемый хеш',
|
|
83
|
-
empty_toc: 'Пустая таблица содержимого...',
|
|
84
|
-
no_contributors: 'Авторов нет...',
|
|
85
|
-
make_contribution: 'Внести свой вклад',
|
|
86
|
-
material_improvement: 'Улучшение материала',
|
|
87
|
-
how_to_improve: 'Как улучшить?',
|
|
88
|
-
edit_page: 'Редактировать страницу',
|
|
89
|
-
report_problem: 'Сообщить о проблеме',
|
|
90
|
-
references: 'Источники',
|
|
91
|
-
reference_source_featured: 'Избранный источник',
|
|
92
|
-
references_description:
|
|
93
|
-
'Список внешних источников, которые использовались при написании этого материала. Если рядом с названием стоит звездочка, то это избранный источник и с ним стоит ознакомиться, если вы хотите глубже погрузиться в материал.',
|
|
94
|
-
sponsors: 'Спонсоры',
|
|
95
|
-
sponsors_description:
|
|
96
|
-
'Список людей и организаций, которые поддерживают проект финансово. Благодаря им проект может существовать и развиваться. Если вы хотите помочь проекту, то тоже можете стать спонсором и попасть на эту страницу!',
|
|
97
|
-
become_sponsor: 'Стать спонсором',
|
|
98
|
-
toc: 'Содержание',
|
|
99
|
-
mentions: (count: number) =>
|
|
100
|
-
m(count, 'упоминание', 'упоминания', 'упоминаний'),
|
|
101
|
-
start_learning: 'Начать изучение!',
|
|
102
|
-
x_contributors: (count: number) => m(count, 'Автор', 'Автора', 'Авторов'),
|
|
103
|
-
x_sponsors: (count: number) => m(count, 'Спонсор', 'Спонсора', 'Спонсоров'),
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export default russian;
|
|
107
|
-
|
|
108
|
-
export function m(
|
|
109
|
-
number: number,
|
|
110
|
-
one: string,
|
|
111
|
-
two: string,
|
|
112
|
-
five: string,
|
|
113
|
-
includeNumber = true,
|
|
114
|
-
) {
|
|
115
|
-
const text = [five, one, two, two, two, five][
|
|
116
|
-
number % 100 > 10 && number % 100 < 20 ? 0 : Math.min(number % 10, 5)
|
|
117
|
-
]!;
|
|
118
|
-
return includeNumber ? `${number} ${text}` : text;
|
|
119
|
-
}
|
package/module/bitran.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { globSync } from 'glob';
|
|
2
|
-
import { addTemplate } from 'nuxt/kit';
|
|
3
|
-
import type { Nuxt } from 'nuxt/schema';
|
|
4
|
-
|
|
5
|
-
import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
|
|
6
|
-
import { logger } from '@erudit/module/logger';
|
|
7
|
-
|
|
8
|
-
export async function setupBitranTemplates(_nuxt: Nuxt) {
|
|
9
|
-
const serverConfigPath = projectPath('bitran.server');
|
|
10
|
-
const appConfigPath = projectPath('bitran.app');
|
|
11
|
-
|
|
12
|
-
const hasServerConfig = globSync(serverConfigPath + '.*').length > 0;
|
|
13
|
-
const hasAppConfig = globSync(appConfigPath + '.*').length > 0;
|
|
14
|
-
const hasIncompleteBitranConfig = hasServerConfig !== hasAppConfig;
|
|
15
|
-
|
|
16
|
-
if (hasIncompleteBitranConfig) {
|
|
17
|
-
logger.warn(
|
|
18
|
-
`Failed to load Bitran. Make sure you have "bitran.server" and "bitran.app" files in your project root!`,
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const serverTemplateName = '#erudit/bitran/server.ts';
|
|
23
|
-
const appTemplateName = '#erudit/bitran/app.ts';
|
|
24
|
-
|
|
25
|
-
addTemplate({
|
|
26
|
-
filename: serverTemplateName,
|
|
27
|
-
write: true,
|
|
28
|
-
getContents: () => `
|
|
29
|
-
import type { ElementTranspilers } from '@bitran-js/transpiler';
|
|
30
|
-
import { eruditTranspilers } from '@erudit-js/bitran-elements/defaultServer';
|
|
31
|
-
${hasServerConfig ? `import getProjectTranspilers from '${serverConfigPath}';` : ''}
|
|
32
|
-
|
|
33
|
-
export default async function() {
|
|
34
|
-
const projectTranspilers = ${hasServerConfig ? 'await getProjectTranspilers()' : '{}'};
|
|
35
|
-
return {
|
|
36
|
-
...eruditTranspilers,
|
|
37
|
-
...projectTranspilers,
|
|
38
|
-
} as ElementTranspilers;
|
|
39
|
-
}
|
|
40
|
-
`,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
addTemplate({
|
|
44
|
-
filename: appTemplateName,
|
|
45
|
-
write: true,
|
|
46
|
-
getContents: () => `
|
|
47
|
-
import type { EruditBitranElements } from '@erudit-js/cog/schema';
|
|
48
|
-
import { eruditElements } from '@erudit-js/bitran-elements/defaultApp';
|
|
49
|
-
${hasAppConfig ? `import getProjectElements from '${appConfigPath}';` : ''}
|
|
50
|
-
|
|
51
|
-
export default async function() {
|
|
52
|
-
const projectElements = ${hasAppConfig ? 'await getProjectElements()' : '{}'};
|
|
53
|
-
return {
|
|
54
|
-
...eruditElements,
|
|
55
|
-
...projectElements,
|
|
56
|
-
} as EruditBitranElements;
|
|
57
|
-
}
|
|
58
|
-
`,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const alias = (_nuxt.options.alias ||= {});
|
|
62
|
-
alias['#erudit/bitran/server'] = eruditEndNuxtPath(
|
|
63
|
-
`.nuxt/${serverTemplateName}`,
|
|
64
|
-
);
|
|
65
|
-
alias['#erudit/bitran/app'] = eruditEndNuxtPath(`.nuxt/${appTemplateName}`);
|
|
66
|
-
}
|
package/module/config.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { addTemplate } from 'nuxt/kit';
|
|
2
|
-
import type { Nuxt } from 'nuxt/schema';
|
|
3
|
-
import type { EruditConfig } from '@erudit-js/cog/schema';
|
|
4
|
-
|
|
5
|
-
import { eruditEndNuxtPath, projectPath } from '@erudit/globalPath';
|
|
6
|
-
import { logger } from '@erudit/module/logger';
|
|
7
|
-
|
|
8
|
-
export async function setupEruditConfig(_nuxt: Nuxt) {
|
|
9
|
-
let config: Partial<EruditConfig> = {};
|
|
10
|
-
const configPath = projectPath('erudit.config');
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
const projectConfig = (await import(configPath)).default;
|
|
14
|
-
if (!projectConfig) throw new Error('Falsy Erudit config!');
|
|
15
|
-
config = projectConfig;
|
|
16
|
-
} catch (error) {
|
|
17
|
-
logger.warn(`Failed to load Erudit config!\n\n${error}`);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const templateFilename = '#erudit/config.ts';
|
|
21
|
-
|
|
22
|
-
addTemplate({
|
|
23
|
-
filename: templateFilename,
|
|
24
|
-
write: true,
|
|
25
|
-
getContents: () => `
|
|
26
|
-
import type { EruditConfig } from '@erudit-js/cog/schema';
|
|
27
|
-
export default ${JSON.stringify(config, null, ' ')} as Partial<EruditConfig>;
|
|
28
|
-
`,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const alias = (_nuxt.options.alias ||= {});
|
|
32
|
-
alias['#erudit/config'] = eruditEndNuxtPath(`.nuxt/${templateFilename}`);
|
|
33
|
-
|
|
34
|
-
return config;
|
|
35
|
-
}
|
package/module/imports.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { addImports, addServerImports } from 'nuxt/kit';
|
|
2
|
-
|
|
3
|
-
import { eruditPath } from '@erudit/globalPath';
|
|
4
|
-
|
|
5
|
-
export function setupGlobalImports() {
|
|
6
|
-
addImports([
|
|
7
|
-
{
|
|
8
|
-
name: 'defineEruditConfig',
|
|
9
|
-
from: eruditPath('globals/erudit'),
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: 'defineContributor',
|
|
13
|
-
from: eruditPath('globals/contributor'),
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'defineCameo',
|
|
17
|
-
from: eruditPath('globals/cameo'),
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'defineTier1Sponsor',
|
|
21
|
-
from: eruditPath('globals/sponsor'),
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: 'defineTier2Sponsor',
|
|
25
|
-
from: eruditPath('globals/sponsor'),
|
|
26
|
-
},
|
|
27
|
-
// Bitran
|
|
28
|
-
...(() => {
|
|
29
|
-
const imports = ['defineAppBitran'];
|
|
30
|
-
return imports.map((name) => ({
|
|
31
|
-
name,
|
|
32
|
-
from: eruditPath(`globals/bitran`),
|
|
33
|
-
}));
|
|
34
|
-
})(),
|
|
35
|
-
// Content
|
|
36
|
-
...(() => {
|
|
37
|
-
const imports = [
|
|
38
|
-
'defineBook',
|
|
39
|
-
'defineGroup',
|
|
40
|
-
'defineTopic',
|
|
41
|
-
'defineContentReferences',
|
|
42
|
-
'defineContentSource',
|
|
43
|
-
];
|
|
44
|
-
return imports.map((name) => ({
|
|
45
|
-
name,
|
|
46
|
-
from: eruditPath(`globals/content`),
|
|
47
|
-
}));
|
|
48
|
-
})(),
|
|
49
|
-
// Problems Generation
|
|
50
|
-
{
|
|
51
|
-
name: 'defineProblemGenerator',
|
|
52
|
-
from: '@erudit-js/bitran-elements/problem/generator',
|
|
53
|
-
},
|
|
54
|
-
// Helper Asset Path Functions
|
|
55
|
-
...(() => {
|
|
56
|
-
const imports = ['eruditAsset', 'contentAsset', 'publicAsset'];
|
|
57
|
-
return imports.map((name) => ({
|
|
58
|
-
name,
|
|
59
|
-
from: eruditPath(`shared/asset`),
|
|
60
|
-
}));
|
|
61
|
-
})(),
|
|
62
|
-
]);
|
|
63
|
-
|
|
64
|
-
addServerImports([
|
|
65
|
-
// Bitran
|
|
66
|
-
...(() => {
|
|
67
|
-
const imports = ['defineServerBitran'];
|
|
68
|
-
return imports.map((name) => ({
|
|
69
|
-
name,
|
|
70
|
-
from: eruditPath(`globals/bitran`),
|
|
71
|
-
}));
|
|
72
|
-
})(),
|
|
73
|
-
]);
|
|
74
|
-
}
|
package/module/index.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { defineNuxtModule, updateTemplates } from 'nuxt/kit';
|
|
2
|
-
|
|
3
|
-
import { registerGlobals } from '@erudit/globals/register';
|
|
4
|
-
import { setupRestartWatcher } from '@erudit/module/restart';
|
|
5
|
-
import { setupEruditConfig } from '@erudit/module/config';
|
|
6
|
-
import { logger } from '@erudit/module/logger';
|
|
7
|
-
import { setupGlobalImports } from '@erudit/module/imports';
|
|
8
|
-
import { setupBitranTemplates } from './bitran';
|
|
9
|
-
import { setupGlobalPaths } from './paths';
|
|
10
|
-
|
|
11
|
-
export default defineNuxtModule({
|
|
12
|
-
meta: { name: 'Erudit', configKey: 'erudit' },
|
|
13
|
-
async setup(_options, _nuxt) {
|
|
14
|
-
if (_nuxt.options.dev) setupRestartWatcher(_nuxt);
|
|
15
|
-
|
|
16
|
-
setupGlobalImports();
|
|
17
|
-
registerGlobals();
|
|
18
|
-
|
|
19
|
-
const eruditConfig = await setupEruditConfig(_nuxt);
|
|
20
|
-
await setupBitranTemplates(_nuxt);
|
|
21
|
-
setupGlobalPaths(_nuxt);
|
|
22
|
-
|
|
23
|
-
if (eruditConfig.site?.baseUrl) {
|
|
24
|
-
const newBaseUrl = eruditConfig.site.baseUrl;
|
|
25
|
-
_nuxt.options.app.baseURL = newBaseUrl;
|
|
26
|
-
_nuxt.options.nitro.runtimeConfig!.app!.baseURL = newBaseUrl;
|
|
27
|
-
await updateTemplates();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
const transpile = (_nuxt.options.build.transpile ||= []);
|
|
32
|
-
const optimizeDeps = _nuxt.options.vite.optimizeDeps || {};
|
|
33
|
-
const optimizeDepsInclude = (optimizeDeps.include ||= []);
|
|
34
|
-
|
|
35
|
-
const deps = eruditConfig.dependencies || {};
|
|
36
|
-
for (const [dep, options] of Object.entries(deps)) {
|
|
37
|
-
if (options?.transpile) transpile.push(dep);
|
|
38
|
-
if (options?.optimize) optimizeDepsInclude.push(dep);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// TODO: Watch for contributors folder and create/update template with their IDs
|
|
43
|
-
// TODO: Create such helpers for other features!
|
|
44
|
-
|
|
45
|
-
logger.success('Erudit module setup complete!');
|
|
46
|
-
},
|
|
47
|
-
});
|
package/module/paths.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { addTemplate } from 'nuxt/kit';
|
|
2
|
-
import type { Nuxt } from 'nuxt/schema';
|
|
3
|
-
|
|
4
|
-
import { ERUDIT_DIR, eruditEndNuxtPath, PROJECT_DIR } from '@erudit/globalPath';
|
|
5
|
-
|
|
6
|
-
export function setupGlobalPaths(_nuxt: Nuxt) {
|
|
7
|
-
const templateFilename = '#erudit/globalPaths.ts';
|
|
8
|
-
|
|
9
|
-
addTemplate({
|
|
10
|
-
filename: templateFilename,
|
|
11
|
-
write: true,
|
|
12
|
-
getContents: () => `
|
|
13
|
-
export const ERUDIT_DIR = '${ERUDIT_DIR}';
|
|
14
|
-
export const PROJECT_DIR = '${PROJECT_DIR}';
|
|
15
|
-
`,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const alias = (_nuxt.options.alias ||= {});
|
|
19
|
-
alias['#erudit/globalPaths'] = eruditEndNuxtPath(
|
|
20
|
-
`.nuxt/${templateFilename}`,
|
|
21
|
-
);
|
|
22
|
-
}
|
package/module/restart.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { exit } from 'node:process';
|
|
2
|
-
import { globSync } from 'glob';
|
|
3
|
-
import chokidar, { type FSWatcher } from 'chokidar';
|
|
4
|
-
import type { Nuxt } from 'nuxt/schema';
|
|
5
|
-
|
|
6
|
-
import { eruditPath, projectPath } from '@erudit/globalPath';
|
|
7
|
-
import { logger } from '@erudit/module/logger';
|
|
8
|
-
import { stress } from '@erudit/utils/stress';
|
|
9
|
-
|
|
10
|
-
const watchTargets: string[] = [
|
|
11
|
-
// Erudit Nuxt config file
|
|
12
|
-
eruditPath('nuxt.config.ts'),
|
|
13
|
-
// Erudit Globals
|
|
14
|
-
eruditPath('globals'),
|
|
15
|
-
// Erudit Nuxt module non-runtime files
|
|
16
|
-
...globSync(eruditPath('module/**/*')),
|
|
17
|
-
// Erudit config in project root
|
|
18
|
-
...globSync(projectPath('erudit.config.{js,ts}')),
|
|
19
|
-
// Erudit Bitran config in project root
|
|
20
|
-
...globSync(projectPath('bitran.{app,server}.{js,ts}')),
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
const ignoreTargets: string[] = [
|
|
24
|
-
// Erudit Nuxt module runtime files
|
|
25
|
-
...globSync(eruditPath('module/runtime/**/*')),
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
const restartDelay = 300;
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
let watcher: FSWatcher;
|
|
35
|
-
let restartTimeout: any;
|
|
36
|
-
let nuxt: Nuxt;
|
|
37
|
-
|
|
38
|
-
export function setupRestartWatcher(_nuxt: Nuxt) {
|
|
39
|
-
nuxt = _nuxt;
|
|
40
|
-
|
|
41
|
-
if (watcher) return;
|
|
42
|
-
|
|
43
|
-
watcher = chokidar.watch(watchTargets, {
|
|
44
|
-
ignored: ignoreTargets,
|
|
45
|
-
ignoreInitial: true,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
watcher.on('all', (event, path) => {
|
|
49
|
-
clearTimeout(restartTimeout);
|
|
50
|
-
restartTimeout = setTimeout(() => {
|
|
51
|
-
console.log('\n');
|
|
52
|
-
logger.info(
|
|
53
|
-
`Restarting due to critical file change: ${stress(path)}\n\n`,
|
|
54
|
-
);
|
|
55
|
-
// Nuxt Restart Hook won't work when unhandled Node exception is thrown!
|
|
56
|
-
// nuxt.callHook('restart', { hard: true, });
|
|
57
|
-
// So we kill the process and restart it in Erudit CLI instead.
|
|
58
|
-
exit(1337);
|
|
59
|
-
}, restartDelay);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { getNavNode } from '@server/nav/utils';
|
|
2
|
-
import { createBookFrontNav } from '@server/repository/frontNav';
|
|
3
|
-
|
|
4
|
-
export default defineEventHandler(async (event) => {
|
|
5
|
-
const bookId = getRouterParam(event, 'bookId');
|
|
6
|
-
|
|
7
|
-
if (!bookId) {
|
|
8
|
-
throw createError({
|
|
9
|
-
statusCode: 400,
|
|
10
|
-
statusText: 'Missing book ID!',
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const bookNode = getNavNode(bookId);
|
|
15
|
-
|
|
16
|
-
return await createBookFrontNav(bookNode);
|
|
17
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { FrontNav } from '@erudit/shared/frontNav';
|
|
2
|
-
import { ERUDIT_SERVER } from '@server/global';
|
|
3
|
-
import { createGlobalFrontNav } from '@server/repository/frontNav';
|
|
4
|
-
|
|
5
|
-
export default defineEventHandler(async () => {
|
|
6
|
-
return (await createGlobalFrontNav(ERUDIT_SERVER.NAV)) as FrontNav;
|
|
7
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAsideMinorContentBase,
|
|
3
|
-
getAsideMinorContentNode,
|
|
4
|
-
} from '@server/repository/asideMinor';
|
|
5
|
-
|
|
6
|
-
import type { AsideMinorBook } from '@erudit/shared/aside/minor';
|
|
7
|
-
|
|
8
|
-
export default defineEventHandler(async (event) => {
|
|
9
|
-
const bookNavNode = getAsideMinorContentNode(
|
|
10
|
-
'book',
|
|
11
|
-
event.context.params?.bookId,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
type: 'book',
|
|
16
|
-
...(await getAsideMinorContentBase(bookNavNode)),
|
|
17
|
-
} satisfies AsideMinorBook;
|
|
18
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getContributions } from '@server/repository/contributor';
|
|
2
|
-
import type { AsideMinorContributor } from '@erudit/shared/aside/minor';
|
|
3
|
-
|
|
4
|
-
export default defineEventHandler(async (event) => {
|
|
5
|
-
const contributorId = event.context.params?.contributorId;
|
|
6
|
-
|
|
7
|
-
if (!contributorId) {
|
|
8
|
-
throw createError({
|
|
9
|
-
statusCode: 400,
|
|
10
|
-
message: 'Missing contributor ID!',
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
type: 'contributor',
|
|
16
|
-
contributions: await getContributions(contributorId),
|
|
17
|
-
} satisfies AsideMinorContributor;
|
|
18
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getAsideMinorContentNode,
|
|
3
|
-
getAsideMinorContentBase,
|
|
4
|
-
} from '@server/repository/asideMinor';
|
|
5
|
-
|
|
6
|
-
import type { AsideMinorGroup } from '@erudit/shared/aside/minor';
|
|
7
|
-
|
|
8
|
-
export default defineEventHandler(async (event) => {
|
|
9
|
-
const groupNavNode = getAsideMinorContentNode(
|
|
10
|
-
'group',
|
|
11
|
-
event.context.params?.groupId,
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
type: 'group',
|
|
16
|
-
...(await getAsideMinorContentBase(groupNavNode)),
|
|
17
|
-
} satisfies AsideMinorGroup;
|
|
18
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { TopicPart } from '@erudit-js/cog/schema';
|
|
2
|
-
|
|
3
|
-
import { getBitranToc } from '@server/bitran/toc';
|
|
4
|
-
import {
|
|
5
|
-
getAsideMinorContentBase,
|
|
6
|
-
getAsideMinorContentNode,
|
|
7
|
-
} from '@server/repository/asideMinor';
|
|
8
|
-
import { getTopicPartsLinks } from '@server/repository/topic';
|
|
9
|
-
|
|
10
|
-
import type { AsideMinorTopic } from '@erudit/shared/aside/minor';
|
|
11
|
-
|
|
12
|
-
export default defineEventHandler(async (event) => {
|
|
13
|
-
const query = getQuery<{ topicId: string; topicPart: TopicPart }>(event);
|
|
14
|
-
const topicNavNode = getAsideMinorContentNode('topic', query.topicId);
|
|
15
|
-
const topicPart = query.topicPart;
|
|
16
|
-
|
|
17
|
-
if (!topicPart) {
|
|
18
|
-
throw createError({
|
|
19
|
-
statusCode: 400,
|
|
20
|
-
statusText: 'Missing "topicPart" query parameter!',
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const toc = await getBitranToc({
|
|
25
|
-
type: topicPart,
|
|
26
|
-
path: topicNavNode.fullId,
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
type: 'topic',
|
|
31
|
-
toc,
|
|
32
|
-
part: topicPart,
|
|
33
|
-
partLinks: await getTopicPartsLinks(topicNavNode.fullId),
|
|
34
|
-
...(await getAsideMinorContentBase(topicNavNode)),
|
|
35
|
-
} satisfies AsideMinorTopic;
|
|
36
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { parseClientBitranLocation } from '@server/bitran/location';
|
|
2
|
-
import { getBitranContent } from '@server/bitran/content';
|
|
3
|
-
|
|
4
|
-
import { type RawBitranContent } from '@shared/bitran/content';
|
|
5
|
-
|
|
6
|
-
export default defineEventHandler<Promise<RawBitranContent>>(async (event) => {
|
|
7
|
-
setResponseHeader(event, 'Content-Type', 'application/json; charset=utf-8');
|
|
8
|
-
const location = await parseClientBitranLocation(
|
|
9
|
-
event.context.params!.location,
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
return await getBitranContent(location);
|
|
13
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { parseClientBitranLocation } from '@server/bitran/location';
|
|
2
|
-
import { getBitranToc } from '@server/bitran/toc';
|
|
3
|
-
|
|
4
|
-
export default defineEventHandler(async (event) => {
|
|
5
|
-
const location = await parseClientBitranLocation(
|
|
6
|
-
event.context.params!.location,
|
|
7
|
-
);
|
|
8
|
-
return await getBitranToc(location);
|
|
9
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { glob } from 'glob';
|
|
2
|
-
import { type Cameo } from '@erudit-js/cog/schema';
|
|
3
|
-
|
|
4
|
-
import { PROJECT_DIR } from '@erudit/globalPath';
|
|
5
|
-
import { IMPORT } from '@server/importer';
|
|
6
|
-
|
|
7
|
-
export default defineEventHandler<Promise<Cameo>>(async (event) => {
|
|
8
|
-
const cameoId = event.context.params?.cameoId;
|
|
9
|
-
|
|
10
|
-
if (typeof cameoId !== 'string' || !cameoId) {
|
|
11
|
-
throw createError({
|
|
12
|
-
statusCode: 400,
|
|
13
|
-
message: 'Cameo ID is required and must be a string!',
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const avatarPaths = await glob(`cameos/${cameoId}/avatars/*`, {
|
|
18
|
-
cwd: PROJECT_DIR,
|
|
19
|
-
absolute: false,
|
|
20
|
-
posix: true,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const avatarRoutes = avatarPaths.map((path) => `/asset/${path}`);
|
|
24
|
-
|
|
25
|
-
let cameoConfig;
|
|
26
|
-
try {
|
|
27
|
-
cameoConfig = await IMPORT(`${PROJECT_DIR}/cameos/${cameoId}/cameo`, {
|
|
28
|
-
default: true,
|
|
29
|
-
});
|
|
30
|
-
} catch (error) {
|
|
31
|
-
throw createError({
|
|
32
|
-
statusCode: 500,
|
|
33
|
-
message: `Failed to import config for ID "${cameoId}"! Error: ${error}`,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return {
|
|
38
|
-
...cameoConfig,
|
|
39
|
-
cameoId,
|
|
40
|
-
avatars: avatarRoutes,
|
|
41
|
-
} satisfies Cameo;
|
|
42
|
-
});
|