Files
pezkuwi-api/typedoc.config.mjs
T
SatoshiQaziMuhammed 1914388d2b docs: API reference and getting-started guide for developers.pezkuwichain.io (#21)
* docs: generate the API reference for developers.pezkuwichain.io

Add TypeDoc (0.28.20) and `yarn docs`, which builds the reference for the
nine public API packages from src/ into build-docs/, with a landing page
and a getting-started guide whose examples were run against the live
network. The PR workflow builds it so a broken doc comment or config is
caught before merge.

docs/ held only a redirect to polkadot.js.org; it now holds the guide
sources. The README, packages/api/README.md and three CHANGELOG entries
linked to js.pezkuwichain.app, a domain that is not ours and is listed
for sale; they now point to developers.pezkuwichain.io, the Pezkuwi
Portal, or the upstream polkadot.js.org pages the entries came from.

* ci(docs): deploy the reference to developers.pezkuwichain.io

On every master push that changes the generated reference, build it with
`yarn docs` and publish it to the web host the same way pezkuwi-apps
publishes the portal: an approved production environment holds the deploy
key, the bundle is unpacked into releases/<sha>, and going live is one
rename of the current symlink. The switch is checked through nginx for the
public name (deploy sha, index, main.js, search index) and rolled back if
the new release is not served. workflow_dispatch with rollback_to makes an
earlier release live again.

Release-bot version bumps ([CI Skip]) and changes that cannot affect the
output do not ask for an approval.
2026-11-12 22:32:28 +04:00

55 lines
1.8 KiB
JavaScript

// Copyright 2017-2026 @pezkuwi/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
// The API reference published at developers.pezkuwichain.io. `yarn docs` writes it
// to build-docs/ (ignored by git); CI builds it on every pull request.
import { OptionDefaults } from 'typedoc';
/** @type {Partial<import('typedoc').TypeDocOptions>} */
const config = {
entryPointStrategy: 'packages',
entryPoints: [
'packages/api',
'packages/api-base',
'packages/api-contract',
'packages/api-derive',
'packages/rpc-core',
'packages/rpc-provider',
'packages/types',
'packages/types-codec',
'packages/types-create'
],
excludePrivate: true,
hostedBaseUrl: 'https://developers.pezkuwichain.io/',
name: 'Pezkuwi API',
navigationLinks: {
GitHub: 'https://github.com/pezkuwichain/pezkuwi-api',
npm: 'https://www.npmjs.com/package/@pezkuwi/api'
},
out: 'build-docs',
// Each package.json points at its build output; the reference is built from src/.
packageOptions: {
entryPoints: ['src/index.ts'],
readme: 'none',
skipErrorChecking: true
},
projectDocuments: [
'docs/getting-started.md'
],
readme: 'docs/index.md',
skipErrorChecking: true,
tsconfig: 'tsconfig.build.json'
};
// The sources use tags TypeDoc does not define: @description on most members,
// @name on derives, @noInheritDoc and @constructor on some classes. Declaring
// them keeps their text in the reference instead of a warning per use.
// Each package is converted with packageOptions, so the tags go there as well.
for (const target of [config, config.packageOptions]) {
target.blockTags = [...OptionDefaults.blockTags, '@description', '@describe', '@name'];
target.modifierTags = [...OptionDefaults.modifierTags, '@noInheritDoc', '@constructor'];
}
export default config;