From e37c5e1c90c018087f4f1cf9a1d9c80ef5532ba2 Mon Sep 17 00:00:00 2001 From: Piotr Zaniewski Date: Sun, 10 Nov 2024 21:07:48 +0100 Subject: [PATCH] process fix Signed-off-by: Piotr Zaniewski --- blog/cloud-native-platform-kubernetes.mdx | 3 -- docusaurus.config.js | 38 ++++--------------- netlify.toml | 11 ------ package.json | 8 ++-- plugins/webpack-plugin.cjs | 46 ++++++++--------------- 5 files changed, 28 insertions(+), 78 deletions(-) delete mode 100644 netlify.toml diff --git a/blog/cloud-native-platform-kubernetes.mdx b/blog/cloud-native-platform-kubernetes.mdx index f333143..265a0b2 100644 --- a/blog/cloud-native-platform-kubernetes.mdx +++ b/blog/cloud-native-platform-kubernetes.mdx @@ -3,7 +3,6 @@ title: "How to Build Cloud Native Platforms with Kubernetes" date: 2024-06-12 tags: ['cloud-native', 'kubernetes', 'platrform-engineering'] --- -import Gist from 'react-gist'; import ReactPlayer from 'react-player'; # How to Build Cloud Native Platforms with Kubernetes @@ -144,8 +143,6 @@ Watch the video to see these principles in action and understand how they come t In the demo, you can see a range of tools that form the backbone of cloud-native platforms, each serving a critical role. From Kubernetes as the control plane orchestrator to GitHub for managing API calls via pull requests, these tools collectively ensure efficient, scalable, and secure infrastructure management. - - ### Recap: Platform Components in Action Let’s recap what we’ve learned about using Kubernetes as a control plane for infrastructure provisioning: diff --git a/docusaurus.config.js b/docusaurus.config.js index f2c9fe3..50ddea7 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,29 +1,23 @@ // @ts-check -// Note: type annotations allow type checking and IDEs autocompletion - const lightCodeTheme = require("prism-react-renderer/themes/github"); const darkCodeTheme = require("prism-react-renderer/themes/dracula"); -const { webpackPlugin } = require("./plugins/webpack-plugin.cjs"); -const tailwindPlugin = require("./plugins/tailwind-plugin.cjs"); - -const plugins = [tailwindPlugin, webpackPlugin]; - /** @type {import('@docusaurus/types').Config} */ const config = { title: "Cloud Rumble", - tagline: - "IT Certifications learning notes and blogs. Kubernetes and cloud native ramblings", + tagline: "IT Certifications learning notes and blogs. Kubernetes and cloud native ramblings", url: "https://frosty-babbage-3125a3.netlify.app", - // @ts-ignore - plugins: plugins, - // url: 'https://cloudrumble.net/', baseUrl: "/", onBrokenLinks: "warn", onBrokenMarkdownLinks: "warn", favicon: "img/favicon.svg", - organizationName: "Piotr1215", // Usually your GitHub org/user name. - projectName: "dca-prep-kit", // Usually your repo name. + organizationName: "Piotr1215", + projectName: "dca-prep-kit", + + // Single tailwind plugin + plugins: [ + ['./plugins/tailwind-plugin.cjs', {}] + ], presets: [ [ @@ -32,7 +26,6 @@ const config = { ({ docs: { sidebarPath: require.resolve("./sidebars.js"), - // Please change this to your repo. editUrl: ({ docPath }) => `https://github.com/Piotr1215/dca-prep-kit/edit/master/docs/${docPath}`, }, @@ -41,7 +34,6 @@ const config = { blogSidebarTitle: "All posts", blogSidebarCount: "ALL", postsPerPage: 10, - // Please change this to your repo. editUrl: "https://github.com/Piotr1215/dca-prep-kit/tree/master/docs", }, theme: { @@ -55,27 +47,13 @@ const config = { /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ algolia: { - // The application ID provided by Algolia appId: "YVUCIOP9V7", - - // Public API key: it is safe to commit it - apiKey: "ca28f15cd304fda34283080362ddefc6", indexName: "itcertificationsguide", - - // Optional: see doc section below contextualSearch: true, - - // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. externalUrlRegex: "external\\.com|domain\\.com", - - // Optional: Algolia search parameters searchParameters: {}, - - // Optional: path for search page that enabled by default (`false` to disable it) searchPagePath: "search", - - //... other Algolia params }, colorMode: { defaultMode: "dark", diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 02a69e4..0000000 --- a/netlify.toml +++ /dev/null @@ -1,11 +0,0 @@ -[build] - command = """ - npm install --legacy-peer-deps && \ - npm run build - """ - publish = "build" - -[build.environment] - NODE_VERSION = "18.20.4" - NPM_VERSION = "10.8.1" - NODE_ENV = "production" diff --git a/package.json b/package.json index eef0b3c..649ff5d 100644 --- a/package.json +++ b/package.json @@ -19,27 +19,27 @@ "@docusaurus/preset-classic": "^3.2.1", "@docusaurus/theme-search-algolia": "^3.2.1", "@mdx-js/react": "^3.0.1", + "buffer": "^6.0.3", "clsx": "1.2.1", "i": "0.3.7", "lucide-react": "^0.456.0", "npm": "^10.5.2", + "path-browserify": "^1.0.1", "prism-react-renderer": "1.3.5", + "process": "^0.11.10", "react": "^18.0.0", "react-dom": "^18.0.0", "react-lottie": "^1.2.4", "react-player": "2.16.0", "react-type-animation": "^3.2.0", "react-youtube": "10.1.0", + "stream-browserify": "^3.0.0", "swiper": "^11.1.1" }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.2.1", "@tsconfig/docusaurus": "1.0.6", - "buffer": "^6.0.3", - "path-browserify": "^1.0.1", "prettier-plugin-tailwindcss": "^0.5.14", - "process": "^0.11.10", - "stream-browserify": "^3.0.0", "tailwindcss": "^3.4.3", "trim": "1.0.1", "typescript": "5.6.3", diff --git a/plugins/webpack-plugin.cjs b/plugins/webpack-plugin.cjs index 1541a4b..5d85f17 100644 --- a/plugins/webpack-plugin.cjs +++ b/plugins/webpack-plugin.cjs @@ -1,43 +1,29 @@ /* eslint-disable */ -const { ProvidePlugin } = require("webpack"); +const webpack = require('webpack'); -function webpackPlugin(context, options) { +module.exports = function (context, options) { return { - name: "webpack-plugin", + name: 'webpack-plugin', configureWebpack(config) { return { - module: { - rules: [ - { - test: /\.m?js/, - resolve: { - fullySpecified: false, - }, - }, - ], - }, plugins: [ - new ProvidePlugin({ - process: require.resolve("process/browser"), - }), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production') + }) ], resolve: { fallback: { - stream: require.resolve("stream-browserify"), - path: require.resolve("path-browserify"), - buffer: require.resolve("buffer/"), - url: require.resolve("url"), + process: require.resolve('process/browser'), + buffer: false, crypto: false, - }, - alias: { - process: "process/browser.js", - }, - }, + path: false, + fs: false, + os: false, + stream: false, + util: false + } + } }; - }, + } }; -} - -module.exports = { - webpackPlugin, };