2021-07-27 21:52:49 +02:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
const isDeployPreview = process.env.CONTEXT === "deploy-preview";
|
|
|
|
const isProductionDeployment = process.env.CONTEXT === "production";
|
|
|
|
|
|
|
|
const localesWithLowRatioOfTranslation = ["ar-SA", "fil-PH", "gl-ES", "hi-IN", "ja-JP", "ko-KR", "pt-PT", "sr-SP", "tg-TJ", "ro-RO", "zh-CN"];
|
|
|
|
/** @type {import('@docusaurus/types').DocusaurusConfig['i18n']} */
|
|
|
|
const i18nConfig = {
|
|
|
|
defaultLocale: 'en',
|
|
|
|
locales: isDeployPreview ? ['en'] : [
|
|
|
|
"en", "cs-CZ", "de-DE",
|
|
|
|
"es-ES", "fr-FR",
|
|
|
|
"it-IT", "pl-PL",
|
|
|
|
"pt-BR", "ru-RU",
|
|
|
|
"sr-CS", "vi-VN",
|
|
|
|
"yo-NG", "zh-TW",
|
2021-07-30 08:44:34 +02:00
|
|
|
"zh-CN"
|
2021-07-27 21:52:49 +02:00
|
|
|
],
|
|
|
|
localeConfigs: {
|
|
|
|
ar: {
|
|
|
|
direction: 'rtl'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const pkgJson = require('./package.json')
|
|
|
|
|
|
|
|
/** @type {import('@docusaurus/types').DocusaurusConfig} */
|
|
|
|
module.exports = {
|
|
|
|
title: 'Verdaccio',
|
2021-12-12 10:40:05 +01:00
|
|
|
tagline: 'A lightweight private proxy registry built in Node.js',
|
2021-07-27 21:52:49 +02:00
|
|
|
organizationName: 'verdaccio',
|
|
|
|
projectName: 'verdaccio',
|
|
|
|
url: 'https://verdaccio.org',
|
|
|
|
baseUrl: '/',
|
|
|
|
onBrokenLinks: 'throw',
|
|
|
|
onBrokenMarkdownLinks: 'warn',
|
|
|
|
favicon: 'img/logo/symbol/svg/verdaccio-tiny.svg',
|
|
|
|
i18n: i18nConfig,
|
|
|
|
plugins: [
|
|
|
|
'docusaurus-plugin-sass',
|
2021-12-01 08:20:39 +01:00
|
|
|
"docusaurus-plugin-contributors",
|
2021-07-27 22:34:07 +02:00
|
|
|
isProductionDeployment && ['docusaurus-plugin-sentry', { DSN: 'a7bc89ee3f284570b1d9a47e600e7597' }]
|
2021-07-27 21:52:49 +02:00
|
|
|
].filter(Boolean),
|
|
|
|
webpack: {
|
|
|
|
jsLoader: (isServer) => ({
|
|
|
|
loader: require.resolve('esbuild-loader'),
|
|
|
|
options: {
|
|
|
|
loader: 'tsx',
|
|
|
|
format: isServer ? 'cjs' : undefined,
|
|
|
|
target: isServer ? 'node12' : 'es2017',
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
customFields: {
|
2021-12-12 10:40:05 +01:00
|
|
|
description: 'A lightweight private proxy registry built in Node.js'
|
2021-07-27 21:52:49 +02:00
|
|
|
},
|
|
|
|
themeConfig: {
|
|
|
|
announcementBar: {
|
|
|
|
id: 'announcementBar',
|
|
|
|
content:
|
|
|
|
'If you like Verdaccio, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/verdaccio/verdaccio">GitHub</a>! ⭐',
|
|
|
|
},
|
|
|
|
algolia: {
|
|
|
|
apiKey: 'a8b4d117e513cd8d71d6a95e3d9d4a91',
|
2021-07-28 14:02:39 +02:00
|
|
|
indexName: 'verdaccio',
|
|
|
|
contextualSearch: true
|
2021-07-27 21:52:49 +02:00
|
|
|
},
|
|
|
|
googleAnalytics: isProductionDeployment ? {
|
|
|
|
trackingID: 'UA-2527438-21'
|
|
|
|
} : undefined,
|
|
|
|
navbar: {
|
|
|
|
title: `Verdaccio - v${pkgJson.version}`,
|
|
|
|
logo: {
|
|
|
|
alt: 'Verdaccio Logo',
|
|
|
|
src: 'img/verdaccio-tiny.svg',
|
|
|
|
},
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: 'doc',
|
|
|
|
docId: 'what-is-verdaccio',
|
|
|
|
position: 'left',
|
|
|
|
label: 'Docs',
|
|
|
|
},
|
|
|
|
{ to: '/blog', label: 'Blog', position: 'left' },
|
2021-08-29 08:11:55 +02:00
|
|
|
{ to: '/help', label: 'Help', position: 'left' },
|
2021-07-27 21:52:49 +02:00
|
|
|
{
|
|
|
|
href: 'https://opencollective.com/verdaccio',
|
|
|
|
label: 'Sponsor us',
|
|
|
|
position: 'right',
|
|
|
|
},
|
2021-08-29 08:11:55 +02:00
|
|
|
{
|
|
|
|
href: 'https://www.youtube.com/channel/UC5i20v6o7lSjXzAHOvatt0w',
|
2021-08-29 08:37:11 +02:00
|
|
|
label: 'YouTube',
|
2021-08-29 08:11:55 +02:00
|
|
|
position: 'right',
|
|
|
|
},
|
2021-07-27 21:52:49 +02:00
|
|
|
{
|
|
|
|
href: '/contributors',
|
|
|
|
label: 'Contributors',
|
|
|
|
position: 'right',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'localeDropdown',
|
|
|
|
position: 'right',
|
|
|
|
dropdownItemsAfter: [
|
|
|
|
{
|
|
|
|
href: 'https://crowdin.com/project/verdaccio',
|
|
|
|
label: 'Help Us Translate',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
href: 'https://github.com/verdaccio/verdaccio',
|
|
|
|
position: 'right',
|
|
|
|
className: 'header-github-link',
|
|
|
|
'aria-label': 'GitHub repository',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
footer: {
|
|
|
|
style: 'dark',
|
|
|
|
links: [
|
|
|
|
{
|
|
|
|
title: 'Docs',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Getting Started',
|
|
|
|
to: '/docs/what-is-verdaccio',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Docker',
|
|
|
|
to: '/docs/docker',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Configuration',
|
|
|
|
to: '/docs/configuration',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Logos',
|
|
|
|
to: '/docs/logo',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Community',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Stack Overflow',
|
|
|
|
href: 'https://stackoverflow.com/questions/tagged/verdaccio',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Discord',
|
|
|
|
href: 'https://discordapp.com/invite/verdaccio',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Twitter',
|
|
|
|
href: 'https://twitter.com/verdaccio_npm',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'More',
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: 'Blog',
|
|
|
|
to: '/blog',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'GitHub',
|
|
|
|
href: 'https://github.com/verdaccio/verdaccio',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: 'Twitter',
|
|
|
|
href: 'https://twitter.com/verdaccio_npm',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
html: `
|
|
|
|
<a href="https://www.netlify.com" target="_blank" rel="noreferrer noopener" aria-label="Deploys by Netlify">
|
|
|
|
<img src="https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt="Deploys by Netlify" />
|
|
|
|
</a>
|
|
|
|
`,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
copyright: `Copyright © ${new Date().getFullYear()} Verdaccio community. Built with Docusaurus.`,
|
|
|
|
},
|
|
|
|
hideableSidebar: true,
|
|
|
|
colorMode: {
|
|
|
|
defaultMode: 'light',
|
|
|
|
disableSwitch: false,
|
|
|
|
respectPrefersColorScheme: true,
|
|
|
|
},
|
|
|
|
prism: {
|
|
|
|
theme: require('prism-react-renderer/themes/github'),
|
|
|
|
darkTheme: require('prism-react-renderer/themes/nightOwl'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
presets: [
|
|
|
|
[
|
|
|
|
'@docusaurus/preset-classic',
|
|
|
|
{
|
|
|
|
docs: {
|
|
|
|
sidebarPath: require.resolve('./sidebars.js'),
|
|
|
|
showLastUpdateAuthor: true,
|
|
|
|
showLastUpdateTime: true,
|
2021-07-29 12:19:37 +02:00
|
|
|
sidebarCollapsible: true,
|
2021-07-27 21:52:49 +02:00
|
|
|
remarkPlugins: [
|
|
|
|
[require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
|
|
|
|
],
|
|
|
|
editUrl: ({ locale, docPath }) => {
|
|
|
|
if (locale !== 'en') {
|
|
|
|
return `https://crowdin.com/project/verdaccio/${locale}`;
|
|
|
|
}
|
|
|
|
return `https://github.com/verdaccio/verdaccio/edit/master/website/docs/${docPath}`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
blog: {
|
|
|
|
blogTitle: 'Verdaccio Official Blog',
|
|
|
|
blogDescription: 'The official Verdaccio NPM proxy registry blog',
|
|
|
|
showReadingTime: true,
|
|
|
|
postsPerPage: 3,
|
|
|
|
feedOptions: {
|
|
|
|
type: 'all',
|
|
|
|
},
|
|
|
|
blogSidebarCount: 'ALL',
|
|
|
|
blogSidebarTitle: 'All our posts',
|
|
|
|
editUrl: ({ locale, blogDirPath, blogPath }) => {
|
|
|
|
if (locale !== 'en') {
|
|
|
|
return `https://crowdin.com/project/verdaccio/${locale}`;
|
|
|
|
}
|
|
|
|
return `https://github.com/verdaccio/verdaccio/edit/master/website/${blogDirPath}/${blogPath}`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
theme: {
|
|
|
|
customCss: require.resolve('./src/css/custom.scss'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
],
|
|
|
|
};
|