chore: fixes to ConfigModule's docblocks (#7390)
This commit is contained in:
1 parent
6fa23a2695
commit
6ab7cbd529
4 files changed
+37
-17
No files matched your search
@@ -29,17 +29,19 @@ export type AdminOptions = {
|
|||||||
*/
|
*/
|
||||||
path?: `/${string}`
|
path?: `/${string}`
|
||||||
/**
|
/**
|
||||||
* The directory where the admin build is output. This is where the build process will place the generated files.
|
* The directory where the admin build is output. This is where the build process places the generated files.
|
||||||
* The default value is `./build`.
|
* The default value is `./build`.
|
||||||
*/
|
*/
|
||||||
outDir?: string
|
outDir?: string
|
||||||
/**
|
/**
|
||||||
* The URL of your Medusa server. Defaults to an empty string, which means requests will hit the same server that serves the dashboard.
|
* The URL of your Medusa backend. Defaults to an empty string, which means requests will hit the same server that serves the dashboard.
|
||||||
*/
|
*/
|
||||||
backendUrl?: string
|
backendUrl?: string
|
||||||
/**
|
/**
|
||||||
* Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration
|
* Configure the Vite configuration for the admin dashboard. This function receives the default Vite configuration
|
||||||
* and returns the modified configuration. The default value is `undefined`.
|
* and returns the modified configuration. The default value is `undefined`.
|
||||||
|
*
|
||||||
|
* @privateRemarks TODO Add example
|
||||||
*/
|
*/
|
||||||
vite?: (config: InlineConfig) => InlineConfig
|
vite?: (config: InlineConfig) => InlineConfig
|
||||||
}
|
}
|
||||||
@@ -216,7 +218,7 @@ export type ProjectConfigOptions = {
|
|||||||
* @ignore
|
* @ignore
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*
|
*
|
||||||
* @privateRemark
|
* @privateRemarks
|
||||||
* only postgres is supported, so this config has no effect
|
* only postgres is supported, so this config has no effect
|
||||||
*/
|
*/
|
||||||
database_type?: string
|
database_type?: string
|
||||||
@@ -379,12 +381,9 @@ export type ProjectConfigOptions = {
|
|||||||
session_options?: SessionOptions
|
session_options?: SessionOptions
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated - use `http.compression` instead
|
|
||||||
* Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.
|
* Configure HTTP compression from the application layer. If you have access to the HTTP server, the recommended approach would be to enable it there.
|
||||||
* However, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.
|
* However, some platforms don't offer access to the HTTP layer and in those cases, this is a good alternative.
|
||||||
*
|
*
|
||||||
* Its value is an object that has the following properties:
|
|
||||||
*
|
|
||||||
* If you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `"x-no-compression": true`.
|
* If you enable HTTP compression and you want to disable it for specific API Routes, you can pass in the request header `"x-no-compression": true`.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
@@ -402,6 +401,9 @@ export type ProjectConfigOptions = {
|
|||||||
* // ...
|
* // ...
|
||||||
* }
|
* }
|
||||||
* ```
|
* ```
|
||||||
|
*
|
||||||
|
* @deprecated use {@link http }'s `compression` property instead.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
http_compression?: HttpCompressionOptions
|
http_compression?: HttpCompressionOptions
|
||||||
|
|
||||||
@@ -713,7 +715,8 @@ export type ProjectConfigOptions = {
|
|||||||
*
|
*
|
||||||
* `medusa-config.js` exports an object having the following properties:
|
* `medusa-config.js` exports an object having the following properties:
|
||||||
*
|
*
|
||||||
* - {@link ConfigModule.projectConfig | projectConfig}: (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations.
|
* - {@link ConfigModule.projectConfig | projectConfig} (required): An object that holds general configurations related to the Medusa backend, such as database or CORS configurations.
|
||||||
|
* - {@link ConfigModule.admin | admin}: An object that holds admin-related configurations.
|
||||||
* - {@link ConfigModule.plugins | plugins}: An array of plugin configurations that defines what plugins are installed and optionally specifies each of their configurations.
|
* - {@link ConfigModule.plugins | plugins}: An array of plugin configurations that defines what plugins are installed and optionally specifies each of their configurations.
|
||||||
* - {@link ConfigModule.modules | modules}: An object that defines what modules are installed and optionally specifies each of their configurations.
|
* - {@link ConfigModule.modules | modules}: An object that defines what modules are installed and optionally specifies each of their configurations.
|
||||||
* - {@link ConfigModule.featureFlags | featureFlags}: An object that enables or disables features guarded by a feature flag.
|
* - {@link ConfigModule.featureFlags | featureFlags}: An object that enables or disables features guarded by a feature flag.
|
||||||
@@ -723,7 +726,7 @@ export type ProjectConfigOptions = {
|
|||||||
* ```js title="medusa-config.js"
|
* ```js title="medusa-config.js"
|
||||||
* module.exports = {
|
* module.exports = {
|
||||||
* projectConfig,
|
* projectConfig,
|
||||||
* plugins,
|
* admin,
|
||||||
* modules,
|
* modules,
|
||||||
* featureFlags,
|
* featureFlags,
|
||||||
* }
|
* }
|
||||||
@@ -748,6 +751,16 @@ export type ConfigModule = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Admin dashboard configurations.
|
* Admin dashboard configurations.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```js title="medusa-config.js"
|
||||||
|
* module.exports = {
|
||||||
|
* admin: {
|
||||||
|
* backendUrl: process.env.MEDUSA_BACKEND_URL || "http://localhost:9000"
|
||||||
|
* }
|
||||||
|
* // ...
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
admin?: AdminOptions
|
admin?: AdminOptions
|
||||||
|
|
||||||
@@ -863,6 +876,12 @@ export type ConfigModule = {
|
|||||||
*/
|
*/
|
||||||
featureFlags: Record<string, boolean | string>
|
featureFlags: Record<string, boolean | string>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ignore
|
||||||
|
*
|
||||||
|
* @privateRemarks
|
||||||
|
* Since this is a temporary config, maybe let's not include it in the generated reference for now.
|
||||||
|
*/
|
||||||
directories?: {
|
directories?: {
|
||||||
srcDir?: string
|
srcDir?: string
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-7
@@ -9,13 +9,7 @@ const medusaConfigOptions: FormattingOptionsType = {
|
|||||||
frontmatterData: {
|
frontmatterData: {
|
||||||
slug: "/references/medusa-config",
|
slug: "/references/medusa-config",
|
||||||
},
|
},
|
||||||
reflectionDescription: `In this document, you’ll learn how to create a file service in the Medusa backend and the methods you must implement in it.
|
reflectionDescription: `In this document, you’ll learn how to create a file service in the Medusa backend and the methods you must implement in it.`,
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
|
|
||||||
This document assumes you already followed along with the [Prepare Environment documentation](https://docs.medusajs.com/development/backend/prepare-environment) and have a Medusa backend installed.
|
|
||||||
|
|
||||||
---`,
|
|
||||||
reflectionTitle: {
|
reflectionTitle: {
|
||||||
fullReplacement: "Configure Medusa Backend",
|
fullReplacement: "Configure Medusa Backend",
|
||||||
},
|
},
|
||||||
@@ -25,6 +19,8 @@ This document assumes you already followed along with the [Prepare Environment d
|
|||||||
...baseSectionsOptions,
|
...baseSectionsOptions,
|
||||||
member_declaration_title: false,
|
member_declaration_title: false,
|
||||||
member_declaration_children: true,
|
member_declaration_children: true,
|
||||||
|
member_declaration_typeDeclaration: false,
|
||||||
|
member_declaration_signatures: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ export const modules = [
|
|||||||
const allReferences = [
|
const allReferences = [
|
||||||
...modules,
|
...modules,
|
||||||
"file",
|
"file",
|
||||||
"js-client",
|
// "js-client",
|
||||||
"medusa-config",
|
"medusa-config",
|
||||||
"medusa-react",
|
// "medusa-react",
|
||||||
"medusa",
|
"medusa",
|
||||||
"notification",
|
"notification",
|
||||||
"payment-provider",
|
"payment-provider",
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ export default function (theme: MarkdownTheme) {
|
|||||||
const tagTitle = camelToTitleCase(tag.tag.substring(1)),
|
const tagTitle = camelToTitleCase(tag.tag.substring(1)),
|
||||||
tagContent = Handlebars.helpers.comment(tag.content)
|
tagContent = Handlebars.helpers.comment(tag.content)
|
||||||
|
|
||||||
|
if (tag.tag === "@deprecated") {
|
||||||
|
// show as admonition
|
||||||
|
return `:::note[Deprecated]\n\n${tagContent}\n\n:::`
|
||||||
|
}
|
||||||
|
|
||||||
if (showCommentsAsHeader) {
|
if (showCommentsAsHeader) {
|
||||||
return `${Handlebars.helpers.titleLevel.call(
|
return `${Handlebars.helpers.titleLevel.call(
|
||||||
parent
|
parent
|
||||||
|
|||||||
Reference in new issue
Block a user