浏览代码

docs(common): Fix default types for apiHost & apiPort

Fixes #2962
Michael Bromley 1 年之前
父节点
当前提交
20078e98af

+ 2 - 2
docs/docs/reference/typescript-api/common/admin-ui/admin-ui-config.md

@@ -42,14 +42,14 @@ interface AdminUiConfig {
 
 ### apiHost
 
-<MemberInfo kind="property" type={`string | 'auto'`} default={`'http://localhost'`}   />
+<MemberInfo kind="property" type={`string | 'auto'`} default={`'auto'`}   />
 
 The hostname of the Vendure server which the admin UI will be making API calls
 to. If set to "auto", the Admin UI app will determine the hostname from the
 current location (i.e. `window.location.hostname`).
 ### apiPort
 
-<MemberInfo kind="property" type={`number | 'auto'`} default={`3000`}   />
+<MemberInfo kind="property" type={`number | 'auto'`} default={`'auto'`}   />
 
 The port of the Vendure server which the admin UI will be making API calls
 to. If set to "auto", the Admin UI app will determine the port from the

+ 6 - 6
packages/common/src/shared-types.ts

@@ -12,8 +12,8 @@ export type DeepPartial<T> = {
         | (T[P] extends Array<infer U>
               ? Array<DeepPartial<U>>
               : T[P] extends ReadonlyArray<infer U>
-              ? ReadonlyArray<DeepPartial<U>>
-              : DeepPartial<T[P]>);
+                ? ReadonlyArray<DeepPartial<U>>
+                : DeepPartial<T[P]>);
 };
 /* eslint-enable no-shadow, @typescript-eslint/no-shadow */
 
@@ -53,8 +53,8 @@ export type JsonCompatible<T> = {
     [P in keyof T]: T[P] extends Json
         ? T[P]
         : Pick<T, P> extends Required<Pick<T, P>>
-        ? never
-        : JsonCompatible<T[P]>;
+          ? never
+          : JsonCompatible<T[P]>;
 };
 
 /**
@@ -219,7 +219,7 @@ export interface AdminUiConfig {
      * to. If set to "auto", the Admin UI app will determine the hostname from the
      * current location (i.e. `window.location.hostname`).
      *
-     * @default 'http://localhost'
+     * @default 'auto'
      */
     apiHost: string | 'auto';
     /**
@@ -228,7 +228,7 @@ export interface AdminUiConfig {
      * to. If set to "auto", the Admin UI app will determine the port from the
      * current location (i.e. `window.location.port`).
      *
-     * @default 3000
+     * @default 'auto'
      */
     apiPort: number | 'auto';
     /**