chore(typedoc-plugin-appium): fix intra-module links; eliminate a loop in builder
MODIFY
packages/typedoc-plugin-appium/lib/converter/builder.ts
packages/typedoc-plugin-appium/lib/converter/builder.ts
/**
- * A thing that creates {@linkcode typedoc!DeclarationReflection} instances from parsed
+ * A thing that creates {@linkcode typedoc#DeclarationReflection} instances from parsed
* command & execute method data.
* @module
*/
@@ -90,7 +90,7 @@ function createCommandsReflection(
}
/**
- * Creates custom {@linkcode typedoc!DeclarationReflection}s from parsed command & execute method data.
+ * Creates custom {@linkcode typedoc#DeclarationReflection}s from parsed command & execute method data.
*
* These instances are added to the {@linkcode Context} object itself; this mutates TypeDoc's internal state. Nothing is returned.
* @param ctx TypeDoc Context
@@ -109,12 +109,16 @@ export function createReflections(
const modules = project.getChildrenByKind(ReflectionKind.Module);
// the project itself may have commands, as well as any modules within the project
- const parents = [...modules, project].filter((parent) => commandInfo.get(parent)?.hasData);
- if (!parents.length) {
+ let hasCommands = false;
+ for (const parent of [...modules, project]) {
+ if (commandInfo.get(parent)?.hasData) {
+ hasCommands = true;
+ createCommandsReflection(log, ctx, parent, commandInfo.get(parent)!);
+ }
+ }
+
+ if (!hasCommands) {
log.warn('No Appium commands found in the entire project');
// TODO: maybe we should abort processing gracefully here? or throw?
}
- for (const parent of parents) {
- createCommandsReflection(log, ctx, parent, commandInfo.get(parent)!);
- }
}

MODIFY
packages/typedoc-plugin-appium/lib/converter/types.ts
packages/typedoc-plugin-appium/lib/converter/types.ts
@@ -12,7 +12,7 @@ import {AllowedHttpMethod} from '../model';
import {NAME_BUILTIN_COMMAND_MODULE, NAME_METHOD_MAP, NAME_NEW_METHOD_MAP} from './converter';
/**
- * Type corresponding to a reflection of a {@linkcode @appium/types!MethodMap}
+ * Type corresponding to a reflection of a {@linkcode @appium/types#MethodMap}
*/
export type MethodMapDeclarationReflection = Merge<
DeclarationReflectionWithReflectedType,
@@ -20,7 +20,7 @@ export type MethodMapDeclarationReflection = Merge<
>;
/**
- * Type corresponding to a reflection of {@linkcode @appium/base-driver!}
+ * Type corresponding to a reflection of {@linkcode @appium/base-driver}
*/
export type BaseDriverDeclarationReflection = Merge<
DeclarationReflection,

MODIFY
packages/typedoc-plugin-appium/lib/guards.ts
packages/typedoc-plugin-appium/lib/guards.ts
@@ -187,7 +187,7 @@ export function isAllowedHTTPMethod(value: any): value is AllowedHttpMethod {
}
/**
- * Type guard for a {@linkcode CommandPropDeclarationReflection} corresponding to the `command` property of a {@linkcode @appium/types!MethodDef} object contained within a {@linkcode @appium/types!MethodMap}.
+ * Type guard for a {@linkcode CommandPropDeclarationReflection} corresponding to the `command` property of a {@linkcode @appium/types#MethodDef} object contained within a {@linkcode @appium/types#MethodMap}.
* @param value any value
*/
export function isCommandPropDeclarationReflection(
@@ -197,7 +197,7 @@ export function isCommandPropDeclarationReflection(
}
/**
- * Type guard for a {@linkcode ExecMethodData} derived from a {@linkcode @appium/types!ExecuteMethodMap} object.
+ * Type guard for a {@linkcode ExecMethodData} derived from a {@linkcode @appium/types#ExecuteMethodMap} object.
* @param value any value
*/
export function isExecMethodData(value: any): value is ExecMethodData {

MODIFY
packages/typedoc-plugin-appium/lib/theme/helpers.ts
packages/typedoc-plugin-appium/lib/theme/helpers.ts
@@ -9,7 +9,7 @@ import {AppiumPluginReflectionKind} from '../model';
import plural from 'pluralize';
/**
- * Overwrites {@linkcode typedoc-plugin-markdown!MarkdownTheme}'s `reflectionPath` helper to handle {@linkcode AppiumPluginReflectionKind} reflection kinds
+ * Overwrites {@linkcode typedoc-plugin-markdown#MarkdownTheme}'s `reflectionPath` helper to handle {@linkcode AppiumPluginReflectionKind} reflection kinds
* @param this Page event
* @returns Reflection path, if any
*/

chore(typedoc-plugin-appium): fix intra-module links; eliminate a loop in builder