Mayil-AI-Sandbox / openfeature.dev_feb24

Creative Commons Attribution 4.0 International
0 stars 0 forks source link

[FEATURE] update docusaurus (hashtag548) #4

Open NobleMathews opened 3 days ago

NobleMathews commented 3 days ago

hashtaghashtaghashtag Requirements

)

mayil-ai[bot] commented 3 days ago

To update the Docusaurus framework used in the OpenFeature Website project to its latest version, follow these steps:

  1. Update Docusaurus Version in package.json:

    {
      "dependencies": {
        "@docusaurus/core": "^latest",
        "@docusaurus/preset-classic": "^latest",
        // other dependencies
      }
    }
  2. 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;
  3. Test Locally:

    • Run yarn install to install the updated dependencies.
    • Run yarn start to start the development server and ensure it works correctly.
    • Run yarn build to ensure the static site generation works without errors.
  4. Update CONTRIBUTING.md if Necessary:

    • If there are changes in the setup or build process, update the relevant sections in CONTRIBUTING.md.
  5. 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>
  6. Create a Pull Request:

    • Open a pull request for review with a descriptive message about the Docusaurus update.

Here are some code snippets that may help you get started:

💡 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!