From 9f346daba0cad37997d5d405a5be2356d68c4784 Mon Sep 17 00:00:00 2001 From: zmzlois Date: Sun, 22 Jun 2025 01:10:42 -0700 Subject: [PATCH 1/5] feat: add zephyr deployment --- .../document/docs/en/guide/basic/deploy.mdx | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/packages/document/docs/en/guide/basic/deploy.mdx b/packages/document/docs/en/guide/basic/deploy.mdx index 5a8e7ae38..08444b487 100644 --- a/packages/document/docs/en/guide/basic/deploy.mdx +++ b/packages/document/docs/en/guide/basic/deploy.mdx @@ -1,3 +1,5 @@ +import { PackageManagerTabs } from '@theme'; + # Deployment In this section, we will discuss the deployment of the project. We assume that you have completed the development of the project and now need to deploy the project online. You need to consider the following aspects: @@ -182,6 +184,59 @@ You can deploy your Rspress site on [Kinsta](https://kinsta.com/static-site-host 6. Click the **Create site**. +### Deploy to Zephyr Cloud + +[Zephyr Cloud](https://zephyr-cloud.io) is a deployment orchestration platform allowing users to deploy applications bundled by major build tools such as Rspack, Rspress, Vite, webpack, Rollup, Rolldown, Parcel, Re.Pack and Metro with exceptional support for Micro-frontends. It enables users to bring their own cloud includes but not limited to: Cloudflare, Netlify, Fastly, etc. + +You can find more information about Zephyr Cloud [in their documentation](https://docs.zephyr-cloud.io). + +#### How to deploy + +1. You will need to register an account on [Zephyr Cloud](https://app.zephyr-cloud.io) first. + +2. Install `zephyr-rspack-plugin` in your project. + + + +3. Add the following configuration to your `rspress.config.ts` file: + +```ts title="rspress.config.ts" +/** Rest of your imports */ +import { withZephyr } from 'zephyr-rspack-plugin'; + +/** Create a small plugin to add to the rspress config */ + +const zephyrRsbuildPlugin = () => ({ + name: 'zephyr-rsbuild-plugin', + setup(api: { + // biome-ignore lint/suspicious/noExplicitAny: `modifyRspackConfig` is a valid method + modifyRspackConfig: (arg0: (config: any) => Promise) => void; + }) { + api.modifyRspackConfig(async (config) => { + let searchIndexExists = false; + searchIndexExists = fs.existsSync(TEMP_SEARCH_INDEX_PATH); + + config.name === 'web' && (await withZephyr()(config)); + }); + }, +}); + +export default defineConfig({ + /** Rest of your config */ + builderConfig: { + plugins: [zephyrRsbuildPlugin()], + }, +}); +``` + +Their documentation is also built with Rspress and deployed to Zephyr Cloud, you can find the build configuration's source code [here](https://github.com/ZephyrCloudIO/zephyr-documentation/blob/main/rspress.config.ts). + +4. Run `npm run build` + +After the build is complete, you will find the `doc_build` directory in the project root directory. Your documentation site will be deployed automatically after the build is completed with a preview URL in your terminal output. + +You can also find the preview URL in your Zephyr Cloud dashboard and modify a custom domain for your site. Read more about how to do it in their [environment guide](https://docs.zephyr-cloud.io/features/environments). + ### Deploy to Zeabur [Zeabur](https://zeabur.com) is a platform for deploying services instantly, which allows you to directly deploy your Rspress site without any other configurations. From d4a3251b879e351262b2add277aeeb0fb1901203 Mon Sep 17 00:00:00 2001 From: zmzlois Date: Sun, 22 Jun 2025 01:12:52 -0700 Subject: [PATCH 2/5] chore: remove redundant comment --- packages/document/docs/en/guide/basic/deploy.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/document/docs/en/guide/basic/deploy.mdx b/packages/document/docs/en/guide/basic/deploy.mdx index 08444b487..de0298efa 100644 --- a/packages/document/docs/en/guide/basic/deploy.mdx +++ b/packages/document/docs/en/guide/basic/deploy.mdx @@ -204,7 +204,7 @@ You can find more information about Zephyr Cloud [in their documentation](https: /** Rest of your imports */ import { withZephyr } from 'zephyr-rspack-plugin'; -/** Create a small plugin to add to the rspress config */ +/** Create a small plugin */ const zephyrRsbuildPlugin = () => ({ name: 'zephyr-rsbuild-plugin', From 49df456f7e8282a995009aedb0fd7a9c8b9978d0 Mon Sep 17 00:00:00 2001 From: zmzlois Date: Sun, 22 Jun 2025 01:16:14 -0700 Subject: [PATCH 3/5] chore: modify wording --- packages/document/docs/en/guide/basic/deploy.mdx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/document/docs/en/guide/basic/deploy.mdx b/packages/document/docs/en/guide/basic/deploy.mdx index de0298efa..b83ea58f3 100644 --- a/packages/document/docs/en/guide/basic/deploy.mdx +++ b/packages/document/docs/en/guide/basic/deploy.mdx @@ -188,13 +188,13 @@ You can deploy your Rspress site on [Kinsta](https://kinsta.com/static-site-host [Zephyr Cloud](https://zephyr-cloud.io) is a deployment orchestration platform allowing users to deploy applications bundled by major build tools such as Rspack, Rspress, Vite, webpack, Rollup, Rolldown, Parcel, Re.Pack and Metro with exceptional support for Micro-frontends. It enables users to bring their own cloud includes but not limited to: Cloudflare, Netlify, Fastly, etc. -You can find more information about Zephyr Cloud [in their documentation](https://docs.zephyr-cloud.io). +You can find more information about Zephyr Cloud and how to deploy with differrent build tools [in their documentation](https://docs.zephyr-cloud.io). #### How to deploy 1. You will need to register an account on [Zephyr Cloud](https://app.zephyr-cloud.io) first. -2. Install `zephyr-rspack-plugin` in your project. +2. Install `zephyr-rspack-plugin` in your Rspress project. @@ -229,11 +229,13 @@ export default defineConfig({ }); ``` -Their documentation is also built with Rspress and deployed to Zephyr Cloud, you can find the build configuration's source code [here](https://github.com/ZephyrCloudIO/zephyr-documentation/blob/main/rspress.config.ts). +:::info +Zephyr Cloud's documentation is also written with Rspress and deployed to Zephyr Cloud, you can find the build configuration's source code [here](https://github.com/ZephyrCloudIO/zephyr-documentation/blob/main/rspress.config.ts). +::: 4. Run `npm run build` -After the build is complete, you will find the `doc_build` directory in the project root directory. Your documentation site will be deployed automatically after the build is completed with a preview URL in your terminal output. +After the build is complete, you will find the `doc_build` directory in the project root directory. Your documentation site will be deployed automatically (requires authentication from terminal) after the build is completed with a preview URL in your terminal output. You can also find the preview URL in your Zephyr Cloud dashboard and modify a custom domain for your site. Read more about how to do it in their [environment guide](https://docs.zephyr-cloud.io/features/environments). From 6301b33ffbebf30a31af6247c2971d52038edf3f Mon Sep 17 00:00:00 2001 From: zmzlois Date: Sun, 22 Jun 2025 01:20:42 -0700 Subject: [PATCH 4/5] chore: remove search index --- packages/document/docs/en/guide/basic/deploy.mdx | 3 --- 1 file changed, 3 deletions(-) diff --git a/packages/document/docs/en/guide/basic/deploy.mdx b/packages/document/docs/en/guide/basic/deploy.mdx index b83ea58f3..f650d6bcd 100644 --- a/packages/document/docs/en/guide/basic/deploy.mdx +++ b/packages/document/docs/en/guide/basic/deploy.mdx @@ -213,9 +213,6 @@ const zephyrRsbuildPlugin = () => ({ modifyRspackConfig: (arg0: (config: any) => Promise) => void; }) { api.modifyRspackConfig(async (config) => { - let searchIndexExists = false; - searchIndexExists = fs.existsSync(TEMP_SEARCH_INDEX_PATH); - config.name === 'web' && (await withZephyr()(config)); }); }, From 95fd8b1ce49def5df5f4be12560ffec1c02d28e7 Mon Sep 17 00:00:00 2001 From: zmzlois Date: Sun, 22 Jun 2025 01:28:26 -0700 Subject: [PATCH 5/5] chore: lint --- cspell.config.cjs | 1 + packages/document/docs/en/guide/basic/deploy.mdx | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cspell.config.cjs b/cspell.config.cjs index 7e4e52a09..b3c518559 100644 --- a/cspell.config.cjs +++ b/cspell.config.cjs @@ -19,6 +19,7 @@ module.exports = { 'node_modules', 'pnpm-lock.yaml', ], + words: ['Rolldown', 'frontends', 'Zephyr Cloud', 'Micro-frontends', 'Fastly'], flagWords: banWords, dictionaries: ['dictionary'], dictionaryDefinitions: [ diff --git a/packages/document/docs/en/guide/basic/deploy.mdx b/packages/document/docs/en/guide/basic/deploy.mdx index f650d6bcd..f6e7b1312 100644 --- a/packages/document/docs/en/guide/basic/deploy.mdx +++ b/packages/document/docs/en/guide/basic/deploy.mdx @@ -184,11 +184,11 @@ You can deploy your Rspress site on [Kinsta](https://kinsta.com/static-site-host 6. Click the **Create site**. -### Deploy to Zephyr Cloud +### Deploy to zephyr cloud [Zephyr Cloud](https://zephyr-cloud.io) is a deployment orchestration platform allowing users to deploy applications bundled by major build tools such as Rspack, Rspress, Vite, webpack, Rollup, Rolldown, Parcel, Re.Pack and Metro with exceptional support for Micro-frontends. It enables users to bring their own cloud includes but not limited to: Cloudflare, Netlify, Fastly, etc. -You can find more information about Zephyr Cloud and how to deploy with differrent build tools [in their documentation](https://docs.zephyr-cloud.io). +You can find more information about Zephyr Cloud and how to deploy with different build tools [in their documentation](https://docs.zephyr-cloud.io). #### How to deploy