Open NobleMathews opened 3 days ago
To update the Docusaurus framework used in the OpenFeature Website project to its latest version, follow these steps:
Update Docusaurus Version in package.json
:
{
"dependencies": {
"@docusaurus/core": "^latest",
"@docusaurus/preset-classic": "^latest",
// other dependencies
}
}
Adjust docusaurus.config.ts
for Compatibility:
import type { Options as PresetClassicOptions } from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
import autoprefixer from 'autoprefixer';
import tailwindcss from 'tailwindcss';
import { rehypeGithubAlerts } from 'rehype-github-alerts';
import remarkBreaks from 'remark-breaks';
import remarkGfm from 'remark-gfm';
const config: Config = {
title: 'OpenFeature',
tagline: 'Standardizing Feature Flagging for Everyone',
url: 'https://openfeature.dev',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/open-feature/openfeature.dev/edit/main/docs/',
},
blog: {
showReadingTime: true,
editUrl: 'https://github.com/open-feature/openfeature.dev/edit/main/blog/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
plugins: [
async function tailwind() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
postcssOptions.plugins.push(tailwindcss);
postcssOptions.plugins.push(autoprefixer);
return postcssOptions;
},
};
},
'@docusaurus/plugin-content-docs',
'@docusaurus/plugin-content-blog',
'@docusaurus/plugin-content-pages',
'@docusaurus/plugin-sitemap',
],
themeConfig: {
navbar: {
title: 'OpenFeature',
logo: {
alt: 'OpenFeature Logo',
src: 'img/logo.svg',
},
items: [
{ to: 'docs/', label: 'Docs', position: 'left' },
{ to: 'blog', label: 'Blog', position: 'left' },
{
href: 'https://github.com/open-feature/openfeature.dev',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: 'docs/',
},
],
},
{
title: 'Community',
items: [
{
label: 'GitHub',
href: 'https://github.com/open-feature/openfeature.dev',
},
],
},
],
},
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/dracula'),
},
},
};
export default config;
Test Locally:
yarn install
to install the updated dependencies.yarn start
to start the development server and ensure it works correctly.yarn build
to ensure the static site generation works without errors.Update CONTRIBUTING.md
if Necessary:
CONTRIBUTING.md
.Commit and Push:
git add package.json yarn.lock docusaurus.config.ts CONTRIBUTING.md
git commit -m "[FEATURE] update docusaurus"
git push origin <branch-name>
Create a Pull Request:
babel.config.js:1-3 | Ensure Babel configuration is compatible with the latest Docusaurus version.
src/pages/index.tsx:1-50 | Verify that the main page components and hooks are compatible with the updated Docusaurus version.
src/css/custom.css:61-245 | Check if custom CSS styles are still valid and compatible with the latest Docusaurus version.
src/partials/hero-home.tsx:1-25 | The 'HeroHome' component utilizes Docusaurus context and components, which may be impacted by the Docusaurus update.
src/partials/question-blocks.tsx:1-63 | The 'QuestionBlocks' component uses Docusaurus context and may be impacted by the Docusaurus update.
💡 To rerun Mayil, comment mayil-ai rerun
. Mayil will incorporate any new context added to the ticket. Include details in your rerun comment to guide Mayil!
hashtaghashtaghashtag Requirements
)