diff --git a/.gitignore b/.gitignore index 4b8ac00ec4..1d750531b4 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ packages/plugin/webpack/spec/fixtures/apps/native-modules/package-lock.json packages/plugin/fuses/spec/fixture/out .links reports -packages/**/typedoc.json .vscode/settings.json .pnp.* .yarn/* diff --git a/packages/api/core/src/api/make.ts b/packages/api/core/src/api/make.ts index 9a8ab8f902..11bac4b7fa 100644 --- a/packages/api/core/src/api/make.ts +++ b/packages/api/core/src/api/make.ts @@ -33,6 +33,7 @@ type MakerImpl = { new (...args: any[]): MakerBase; }; +/** @inline */ type MakeTargets = ForgeConfigMaker[] | string[]; function generateTargets( diff --git a/packages/api/core/src/util/forge-config.ts b/packages/api/core/src/util/forge-config.ts index c4e5a8f016..92572c455c 100644 --- a/packages/api/core/src/util/forge-config.ts +++ b/packages/api/core/src/util/forge-config.ts @@ -106,11 +106,14 @@ export function unregisterForgeConfigForDirectory(dir: string): void { registeredForgeConfigs.delete(path.resolve(dir)); } -export type BuildIdentifierMap = Record; -export type BuildIdentifierConfig = { +/** @inline */ +export interface BuildIdentifierMap extends Record {} +/** @inline */ +export interface BuildIdentifierConfig { map: BuildIdentifierMap; + /** @internal */ __isMagicBuildIdentifierMap: true; -}; +} export function fromBuildIdentifier( map: BuildIdentifierMap, diff --git a/packages/maker/deb/README.md b/packages/maker/deb/README.md index e973f24025..0b4d005889 100644 --- a/packages/maker/deb/README.md +++ b/packages/maker/deb/README.md @@ -2,7 +2,7 @@ `@electron-forge/maker-deb` builds .deb packages, which are the standard package format for Debian-based Linux distributions such as Ubuntu. You can only build the deb target on Linux or macOS machines with the fakeroot and dpkg packages installed. -Configuration options are documented in [`MakerDebConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_deb.InternalOptions.MakerDebConfigOptions.html). +Configuration options are documented in [`MakerDebConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_deb.MakerDebConfigOptions.html). ```javascript { diff --git a/packages/maker/deb/src/MakerDeb.ts b/packages/maker/deb/src/MakerDeb.ts index b024cae802..7d07c48292 100644 --- a/packages/maker/deb/src/MakerDeb.ts +++ b/packages/maker/deb/src/MakerDeb.ts @@ -61,3 +61,4 @@ export default class MakerDeb extends MakerBase { } export { MakerDeb, MakerDebConfig }; +export type { MakerDebConfigOptions } from './Config.ts'; diff --git a/packages/maker/dmg/src/Config.ts b/packages/maker/dmg/src/Config.ts index 003053532f..513243ed87 100644 --- a/packages/maker/dmg/src/Config.ts +++ b/packages/maker/dmg/src/Config.ts @@ -1,6 +1,8 @@ import type { ElectronInstallerDMGOptions } from 'electron-installer-dmg'; -export type MakerDMGConfig = Omit< +export interface MakerDMGConfig extends Omit< ElectronInstallerDMGOptions, 'name' | 'appPath' | 'out' -> & { name?: string }; +> { + name?: string; +} diff --git a/typedoc.base.json b/packages/maker/dmg/typedoc.jsonc similarity index 64% rename from typedoc.base.json rename to packages/maker/dmg/typedoc.jsonc index 0eaa4ce92c..295a210546 100644 --- a/typedoc.base.json +++ b/packages/maker/dmg/typedoc.jsonc @@ -1,4 +1,4 @@ { "$schema": "https://typedoc.org/schema.json", - "excludeInternal": true + "excludeExternals": false, } diff --git a/packages/maker/flatpak/README.md b/packages/maker/flatpak/README.md index 9f1d629a26..880ae02860 100644 --- a/packages/maker/flatpak/README.md +++ b/packages/maker/flatpak/README.md @@ -4,7 +4,7 @@ You can only build the Flatpak target if you have `flatpak`, `flatpak-builder`, and `eu-strip` _\(usually part of the `elfutils` package\)_ installed on your system. -Configuration options are documented in [`MakerFlatpakOptionsConfig`](https://js.electronforge.io/interfaces/_electron_forge_maker_flatpak.InternalOptions.MakerFlatpakOptionsConfig.html). +Configuration options are documented in [`MakerFlatpakOptionsConfig`](https://js.electronforge.io/interfaces/_electron_forge_maker_flatpak.MakerFlatpakConfigOptions.html). ```javascript { diff --git a/packages/maker/flatpak/src/Config.ts b/packages/maker/flatpak/src/Config.ts index a71e56c677..9c5d9d4043 100644 --- a/packages/maker/flatpak/src/Config.ts +++ b/packages/maker/flatpak/src/Config.ts @@ -1,4 +1,4 @@ -export interface MakerFlatpakOptionsConfig { +export interface MakerFlatpakConfigOptions { /** * App id of the flatpak, used in the id field of a flatpak-builder manifest. * @@ -122,5 +122,5 @@ export interface MakerFlatpakOptionsConfig { } export interface MakerFlatpakConfig { - options?: MakerFlatpakOptionsConfig; + options?: MakerFlatpakConfigOptions; } diff --git a/packages/maker/flatpak/src/MakerFlatpak.ts b/packages/maker/flatpak/src/MakerFlatpak.ts index e109a05ffb..b2a15b5a61 100644 --- a/packages/maker/flatpak/src/MakerFlatpak.ts +++ b/packages/maker/flatpak/src/MakerFlatpak.ts @@ -59,3 +59,4 @@ export default class MakerFlatpak extends MakerBase { } export { MakerFlatpak, MakerFlatpakConfig }; +export type { MakerFlatpakConfigOptions } from './Config.ts'; diff --git a/packages/maker/msix/src/Config.ts b/packages/maker/msix/src/Config.ts index ed4fe809bf..b1daee6f1c 100644 --- a/packages/maker/msix/src/Config.ts +++ b/packages/maker/msix/src/Config.ts @@ -5,6 +5,16 @@ import { type SemiPartial = Omit & Partial>; +export interface MakerMSIXConfigManifestVariables extends SemiPartial< + ManifestGenerationVariables, + | 'packageDescription' + | 'appExecutable' + | 'packageVersion' + | 'publisher' + | 'packageIdentity' + | 'targetArch' +> {} + /** * The configuration object for the MSIX maker. * The `outputDir` and `appDir` parameters are preconfigured by Forge so that the @@ -15,19 +25,11 @@ type SemiPartial = Omit & Partial>; * * @see https://github.com/bitdisaster/electron-windows-msix/blob/master/src/types.ts */ -export type MakerMSIXConfig = Omit< +export interface MakerMSIXConfig extends Omit< MSIXPackagingOptions, 'outputDir' | 'appDir' | 'manifestVariables' -> & { - manifestVariables?: SemiPartial< - ManifestGenerationVariables, - | 'packageDescription' - | 'appExecutable' - | 'packageVersion' - | 'publisher' - | 'packageIdentity' - | 'targetArch' - >; +> { + manifestVariables?: MakerMSIXConfigManifestVariables; /** * The base name of the generated `.msix` file, without the `.msix` * extension (the maker always appends `.msix`). This only overrides the @@ -42,4 +44,4 @@ export type MakerMSIXConfig = Omit< * `my-app-win32-x64-1.2.3` */ outputFileName?: string | (() => string | Promise); -}; +} diff --git a/packages/maker/msix/src/MakerMSIX.ts b/packages/maker/msix/src/MakerMSIX.ts index ba79b61d0b..1e694c7f6d 100644 --- a/packages/maker/msix/src/MakerMSIX.ts +++ b/packages/maker/msix/src/MakerMSIX.ts @@ -73,3 +73,4 @@ export default class MakerMSIX extends MakerBase { } export { MakerMSIX, MakerMSIXConfig }; +export type { MakerMSIXConfigManifestVariables } from './Config.ts'; diff --git a/packages/maker/msix/typedoc.jsonc b/packages/maker/msix/typedoc.jsonc new file mode 100644 index 0000000000..295a210546 --- /dev/null +++ b/packages/maker/msix/typedoc.jsonc @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": false, +} diff --git a/packages/maker/rpm/README.md b/packages/maker/rpm/README.md index 9171676957..b2507fb143 100644 --- a/packages/maker/rpm/README.md +++ b/packages/maker/rpm/README.md @@ -4,7 +4,7 @@ You can only build the RPM target on Linux machines with the `rpm` or `rpm-build` packages installed. -Configuration options are documented in [`MakerRpmConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_rpm.InternalOptions.MakerRpmConfigOptions.html). +Configuration options are documented in [`MakerRpmConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_rpm.MakerRpmConfigOptions.html). ```javascript { diff --git a/packages/maker/rpm/src/MakerRpm.ts b/packages/maker/rpm/src/MakerRpm.ts index 52349b577e..55c2c1b98a 100644 --- a/packages/maker/rpm/src/MakerRpm.ts +++ b/packages/maker/rpm/src/MakerRpm.ts @@ -64,3 +64,4 @@ export default class MakerRpm extends MakerBase { } export { MakerRpm, MakerRpmConfig }; +export type { MakerRpmConfigOptions } from './Config.ts'; diff --git a/packages/maker/snap/README.md b/packages/maker/snap/README.md index 4b6c189e25..116cf724ad 100644 --- a/packages/maker/snap/README.md +++ b/packages/maker/snap/README.md @@ -4,6 +4,8 @@ You can only build the Snapcraft target on Linux systems with the `snapcraft` package installed. +Configuration options are documented in [`MakerSnapConfig`](https://js.electronforge.io/interfaces/_electron_forge_maker_snap.MakerSnapConfig.html). + ```javascript { name: '@electron-forge/maker-snap', diff --git a/packages/maker/snap/src/Config.ts b/packages/maker/snap/src/Config.ts index ff6250f282..6bc7bcd8e6 100644 --- a/packages/maker/snap/src/Config.ts +++ b/packages/maker/snap/src/Config.ts @@ -1,4 +1,4 @@ import { Options, SnapcraftConfig } from 'electron-installer-snap'; -export type MakerSnapConfig = Omit & - SnapcraftConfig; +export interface MakerSnapConfig + extends Omit, SnapcraftConfig {} diff --git a/packages/maker/snap/typedoc.jsonc b/packages/maker/snap/typedoc.jsonc new file mode 100644 index 0000000000..295a210546 --- /dev/null +++ b/packages/maker/snap/typedoc.jsonc @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": false, +} diff --git a/packages/maker/squirrel/README.md b/packages/maker/squirrel/README.md index dad1fd827f..60d5d69c80 100644 --- a/packages/maker/squirrel/README.md +++ b/packages/maker/squirrel/README.md @@ -7,7 +7,7 @@ Pre-requisites: * Windows machine * Linux machine with `mono` and `wine` installed. -Configuration options are documented in [`MakerSquirrelConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_squirrel.InternalOptions.Options.html). +Configuration options are documented in [`MakerSquirrelConfigOptions`](https://js.electronforge.io/interfaces/_electron_forge_maker_squirrel.MakerSquirrelConfig.html). ```javascript { diff --git a/packages/maker/squirrel/src/MakerSquirrel.ts b/packages/maker/squirrel/src/MakerSquirrel.ts index 4f45123e05..e05526e22f 100644 --- a/packages/maker/squirrel/src/MakerSquirrel.ts +++ b/packages/maker/squirrel/src/MakerSquirrel.ts @@ -11,10 +11,10 @@ import { Options as ElectronWinstallerOptions, } from 'electron-winstaller'; -export type MakerSquirrelConfig = Omit< +export interface MakerSquirrelConfig extends Omit< ElectronWinstallerOptions, 'appDirectory' | 'outputDirectory' ->; +> {} export default class MakerSquirrel extends MakerBase { name = 'squirrel'; diff --git a/packages/maker/squirrel/typedoc.jsonc b/packages/maker/squirrel/typedoc.jsonc new file mode 100644 index 0000000000..295a210546 --- /dev/null +++ b/packages/maker/squirrel/typedoc.jsonc @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": false, +} diff --git a/packages/maker/wix/src/Config.ts b/packages/maker/wix/src/Config.ts index 6e99c8e03d..50de63eb2e 100644 --- a/packages/maker/wix/src/Config.ts +++ b/packages/maker/wix/src/Config.ts @@ -1,6 +1,6 @@ import { MSICreator, type MSICreatorOptions } from 'electron-wix-msi'; -export type MakerWixConfig = Omit< +export interface MakerWixConfig extends Omit< MSICreatorOptions, | 'appDirectory' | 'outputDirectory' @@ -9,7 +9,7 @@ export type MakerWixConfig = Omit< | 'version' | 'manufacturer' | 'exe' -> & { +> { /** * The app's description * @@ -44,4 +44,4 @@ export type MakerWixConfig = Omit< * Allows for the modification of the MSICreator before create is called. */ beforeCreate?: (creator: MSICreator) => Promise | void; -}; +} diff --git a/packages/maker/wix/src/MakerWix.ts b/packages/maker/wix/src/MakerWix.ts index 53c7109dff..cc2db6e8a6 100644 --- a/packages/maker/wix/src/MakerWix.ts +++ b/packages/maker/wix/src/MakerWix.ts @@ -4,7 +4,7 @@ import { styleText } from 'node:util'; import { getNameFromAuthor } from '@electron-forge/core-utils'; import { MakerBase, type MakerOptions } from '@electron-forge/maker-base'; import { ForgePlatform } from '@electron-forge/shared-types'; -import { MSICreator, type MSICreatorOptions } from 'electron-wix-msi'; +import { MSICreator } from 'electron-wix-msi'; import semver from 'semver'; import { MakerWixConfig } from './Config.js'; @@ -74,4 +74,4 @@ export default class MakerWix extends MakerBase { } } -export { MakerWix, MakerWixConfig, MSICreatorOptions }; +export { MakerWix, MakerWixConfig }; diff --git a/packages/maker/wix/typedoc.jsonc b/packages/maker/wix/typedoc.jsonc new file mode 100644 index 0000000000..295a210546 --- /dev/null +++ b/packages/maker/wix/typedoc.jsonc @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": false, +} diff --git a/packages/plugin/vite/src/VitePlugin.ts b/packages/plugin/vite/src/VitePlugin.ts index 7219b25051..de0fee69b1 100644 --- a/packages/plugin/vite/src/VitePlugin.ts +++ b/packages/plugin/vite/src/VitePlugin.ts @@ -537,4 +537,8 @@ function getServerURLs(urls: vite.ResolvedServerUrls) { return output; } -export { VitePlugin }; +export { VitePlugin, VitePluginConfig }; +export type { + VitePluginBuildConfig, + VitePluginRendererConfig, +} from './Config.ts'; diff --git a/packages/plugin/webpack/src/Config.ts b/packages/plugin/webpack/src/Config.ts index 504151ca2b..33a3c2e380 100644 --- a/packages/plugin/webpack/src/Config.ts +++ b/packages/plugin/webpack/src/Config.ts @@ -65,6 +65,7 @@ export interface WebpackPluginEntryPointNoWindow extends WebpackPluginEntryPoint js: string; } +/** @inline */ export type WebpackPluginEntryPoint = | WebpackPluginEntryPointLocalWindow | WebpackPluginEntryPointNoWindow @@ -188,6 +189,7 @@ export interface WebpackPluginConfig { >; } +/** @inline */ export type WebpackConfiguration = | RawWebpackConfiguration | WebpackConfigurationFactory; diff --git a/packages/plugin/webpack/src/WebpackConfig.ts b/packages/plugin/webpack/src/WebpackConfig.ts index 0b7193d852..5c84edfc0d 100644 --- a/packages/plugin/webpack/src/WebpackConfig.ts +++ b/packages/plugin/webpack/src/WebpackConfig.ts @@ -31,6 +31,7 @@ type WebpackMode = 'production' | 'development'; const d = debug('electron-forge:plugin:webpack:webpackconfig'); +/** @inline */ export type ConfigurationFactory = ( env: string | Record | unknown, args: Record, diff --git a/packages/plugin/webpack/src/WebpackPlugin.ts b/packages/plugin/webpack/src/WebpackPlugin.ts index bfd3d139d0..87873bb8d0 100644 --- a/packages/plugin/webpack/src/WebpackPlugin.ts +++ b/packages/plugin/webpack/src/WebpackPlugin.ts @@ -817,3 +817,10 @@ the generated files). Instead, it is ${JSON.stringify(pj.main)}`); } export { WebpackPlugin, WebpackPluginConfig }; +export type { + WebpackPluginRendererConfig, + WebpackPluginEntryPointLocalWindow, + WebpackPluginEntryPointNoWindow, + WebpackPluginEntryPointPreloadOnly, + WebpackPreloadEntryPoint, +} from './Config.ts'; diff --git a/packages/publisher/base-static/src/PublisherStatic.ts b/packages/publisher/base-static/src/PublisherStatic.ts index 2f60d8fb00..3e53530ea2 100644 --- a/packages/publisher/base-static/src/PublisherStatic.ts +++ b/packages/publisher/base-static/src/PublisherStatic.ts @@ -46,3 +46,4 @@ export default abstract class PublisherStatic< } export { PublisherStatic, StaticPublisherConfig, PublisherOptions }; +export type { StaticArtifact }; diff --git a/packages/publisher/bitbucket/src/PublisherBitbucket.ts b/packages/publisher/bitbucket/src/PublisherBitbucket.ts index 1377f4331a..ce3a4f543f 100644 --- a/packages/publisher/bitbucket/src/PublisherBitbucket.ts +++ b/packages/publisher/bitbucket/src/PublisherBitbucket.ts @@ -98,3 +98,4 @@ export default class PublisherBitbucket extends PublisherBase = ListrTask< Ctx, ListrDefaultRenderer >['task']; -export type ElectronProcess = ChildProcess & { restarted: boolean }; +export interface ElectronProcess extends ChildProcess { + restarted: boolean; +} export type ForgePlatform = OfficialPlatform; export type ForgeArch = OfficialArch | 'all'; @@ -124,14 +126,14 @@ export interface IForgePluginInterface { } /* eslint-enable @typescript-eslint/no-explicit-any */ -export type ForgeRebuildOptions = Omit< +export interface ForgeRebuildOptions extends Omit< RebuildOptions, 'buildPath' | 'electronVersion' | 'arch' ->; -export type ForgePackagerOptions = Omit< +> {} +export interface ForgePackagerOptions extends Omit< ElectronPackagerOptions, 'dir' | 'arch' | 'platform' | 'out' | 'electronVersion' ->; +> {} export interface ResolvedForgeConfig { /** * A string to uniquely identify artifacts of this build, will be appended diff --git a/packages/utils/types/typedoc.jsonc b/packages/utils/types/typedoc.jsonc new file mode 100644 index 0000000000..295a210546 --- /dev/null +++ b/packages/utils/types/typedoc.jsonc @@ -0,0 +1,4 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "excludeExternals": false, +} diff --git a/typedoc.json b/typedoc.json deleted file mode 100644 index fb0b0085ad..0000000000 --- a/typedoc.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "https://typedoc.org/schema.json", - "entryPointStrategy": "packages", - "entryPoints": [ - "packages/api/core", - "packages/maker/*", - "packages/plugin/*", - "packages/plugin/*", - "packages/publisher/*", - "packages/utils/types" - ] -} diff --git a/typedoc.jsonc b/typedoc.jsonc new file mode 100644 index 0000000000..dc4896a13a --- /dev/null +++ b/typedoc.jsonc @@ -0,0 +1,78 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "entryPointStrategy": "packages", + "entryPoints": [ + "packages/api/core", + "packages/maker/*", + "packages/plugin/*", + "packages/publisher/*", + "packages/utils/types", + ], + "sourceLinkExternal": false, + "externalSymbolLinkMappings": { + // @electron-forge/shared-types + "@electron/packager": { + "OfficialArch": "https://packages.electronjs.org/packager/v20.0.3/types/OfficialArch.html", + "OfficialPlatform": "https://packages.electronjs.org/packager/v20.0.3/types/OfficialPlatform.html", + "Options": "https://packages.electronjs.org/packager/v20.0.3/interfaces/Options.html", + }, + "@electron/rebuild": { + "RebuildOptions": "https://packages.electronjs.org/rebuild/v4.2.0/interfaces/RebuildOptions.html", + }, + "listr2": { + "ListrBaseClassOptions": "https://listr2.kilic.dev/api/listr2/interfaces/ListrBaseClassOptions.html", + "ListrTask": "https://listr2.kilic.dev/api/listr2/interfaces/ListrTask.html", + "TaskWrapper": "https://listr2.kilic.dev/api/listr2/interfaces/ListrTaskWrapper.html", + "ListrDefaultRenderer": "https://listr2.kilic.dev/api/listr2/type-aliases/ListrDefaultRenderer.html", + "ListrDefaultRendererValue": "https://listr2.kilic.dev/api/listr2/type-aliases/ListrDefaultRendererValue.html", + "ListrSimpleRenderer": "https://listr2.kilic.dev/api/listr2/type-aliases/ListrSimpleRenderer.html", + "ListrSimpleRendererValue": "https://listr2.kilic.dev/api/listr2/type-aliases/ListrSimpleRendererValue.html", + }, + "@types/node": { + "\"child_process\".ChildProcess": "https://nodejs.org/docs/latest/api/child_process.html#class-childprocess", + }, + // @electron-forge/maker-snap + "electron-installer-snap": { + "createSnap.Options": "https://electron-userland.github.io/electron-installer-snap/master/interfaces/createsnap.snapcraftoptions.html", + "createSnap.SnapcraftConfig": "https://electron-userland.github.io/electron-installer-snap/master/modules/createsnap.html#customsnapcraftconfig", + }, + // @electron-forge/plugin-fuses + "@electron/fuses": { + "FuseConfig": "https://packages.electronjs.org/fuses/v2.1.3/types/FuseConfig.html", + }, + // @electron-forge/plugin-webpack + "webpack": { + "exports.Configuration": "https://webpack.js.org/configuration/", + }, + "webpack-dev-server": { + "Configuration": "https://webpack.js.org/configuration/dev-server/", + }, + // @electron-forge/publisher-gcs + "@google-cloud/storage": { + "ConfigMetadata": "https://docs.cloud.google.com/storage/docs/metadata", + "StorageOptions": "https://docs.cloud.google.com/nodejs/docs/reference/storage/latest/storage/storageoptions", + "UploadOptions": "https://docs.cloud.google.com/nodejs/docs/reference/storage/latest/storage/uploadoptions", + }, + // @electron-forge/publisher-github + "@octokit/core": { + "OctokitOptions": "https://github.com/octokit/core.js#options", + }, + // @electron-forge/publisher-s3 + "@aws-sdk/types": { + "Credentials": "https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-types/Interface/Credentials/", + }, + }, + // Replaces previous *.base.json concept: it is + // a per-package default documentation. It can still + // be overwritten if needed with a per-package config. + "packageOptions": { + "excludeInternal": true, + // Usually, we want to use "externalSymbolLinkMappings" + // to point out symbols that are in external packages, + // while allow for exceptions if Typedoc docs offer + // better quality of documentation or upstream docs + // are manually maintained and in risk of being + // out-of-date. + "excludeExternals": true, + }, +}