@textmode/docs 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,28 +80,32 @@ names begin with `textmode`.
80
80
 
81
81
  ### Defaults
82
82
 
83
- | Setting | Default |
84
- | ------------------------------ | ---------------------------------------------- |
85
- | Package name and description | `package.json` |
86
- | Entrypoint and link entrypoint | `src/index.ts` |
87
- | Source roots | Derived from link entrypoints |
88
- | TypeScript config | `tsconfig.json` |
89
- | Output | `api/<package-name>` |
90
- | Hosted API URL | `https://code.textmode.art/api/<package-name>` |
91
- | Member pages | Methods, properties, and accessors |
92
- | Self-link stripping | `full` |
93
- | Sorting | Source order |
94
- | API-link kinds | All supported reflection kinds |
95
- | Required docstrings | All supported reflection kinds |
96
- | Required examples | Functions, methods, and accessors |
97
- | Example checks | Gallery, manifest, and sketch checks enabled |
98
- | Gallery source bases | Hardcoded source bases rejected |
83
+ | Setting | Default |
84
+ | ------------------------------ | ----------------------------------------------------- |
85
+ | Package name and description | `package.json` |
86
+ | Entrypoint and link entrypoint | `src/index.ts` |
87
+ | Source roots | Derived from link entrypoints |
88
+ | TypeScript config | `tsconfig.json` |
89
+ | Output | `api/<package-name>` |
90
+ | Hosted API URL | `https://code.textmode.art/api/<package-name>` |
91
+ | Member pages | Methods, properties, and accessors |
92
+ | Self-link stripping | `full` |
93
+ | Sorting | Kind, instance-first, alphabetical (except documents) |
94
+ | API-link kinds | All supported reflection kinds |
95
+ | Required docstrings | All supported reflection kinds |
96
+ | Required examples | Functions, methods, and accessors |
97
+ | Example checks | Gallery, manifest, and sketch checks enabled |
98
+ | Gallery source bases | Hardcoded source bases rejected |
99
99
 
100
100
  Configuration precedence is shared defaults, derived package metadata,
101
101
  `textmode.docs.config.mjs`, then command-owned overrides such as `--out`,
102
102
  strict checking, and watch mode. Use `--show-config` to inspect the effective
103
103
  values and the origin of every setting.
104
104
 
105
+ The shared sorting policy groups API reflections by kind, lists instance members
106
+ before static members, and alphabetizes non-document reflections. A project can
107
+ override it with `typedoc.sort` when its API needs a different presentation.
108
+
105
109
  ## Commands
106
110
 
107
111
  ```text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textmode/docs",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Shared documentation generation and validation for the textmode.js ecosystem",
5
5
  "keywords": [
6
6
  "textmode",
@@ -57,6 +57,9 @@ export const DEFAULT_API_LINK_KINDS = [
57
57
  export const DEFAULT_DOCSTRING_KINDS = [...DEFAULT_API_LINK_KINDS];
58
58
  export const DEFAULT_EXAMPLE_KINDS = ['function', 'method', 'accessor'];
59
59
  export const DEFAULT_MEMBER_PAGE_KINDS = ['method', 'property', 'accessor'];
60
+ export const DEFAULT_TYPEDOC_OPTIONS = {
61
+ sort: ['kind', 'instance-first', 'alphabetical-ignoring-documents'],
62
+ };
60
63
 
61
64
  function isRecord(value) {
62
65
  return value !== null && typeof value === 'object' && !Array.isArray(value);
@@ -310,7 +313,7 @@ export async function resolveDocsConfig({ cwd = process.cwd(), configPath: reque
310
313
  stripApiSelfLinks: config.stripApiSelfLinks ?? 'full',
311
314
  checks,
312
315
  examples,
313
- typedoc: config.typedoc ?? {},
316
+ typedoc: { ...DEFAULT_TYPEDOC_OPTIONS, ...(config.typedoc ?? {}) },
314
317
  origins: {
315
318
  packageName: 'package.json#name',
316
319
  packageDescription:
@@ -8,6 +8,7 @@ import { load as loadMemberPages } from './typedoc-plugins/all-member-pages-rout
8
8
  import { load as loadApiFrontmatter } from './typedoc-plugins/api-frontmatter/index.js';
9
9
  import { load as loadCodeExamples } from './typedoc-plugins/include-code-examples/index.js';
10
10
  import { load as loadSelfLinkStripper } from './typedoc-plugins/strip-api-self-links/index.js';
11
+ import { DEFAULT_TYPEDOC_OPTIONS } from './config.js';
11
12
 
12
13
  const BASE_TYPEDOC_OPTIONS = {
13
14
  readme: 'none',
@@ -22,7 +23,7 @@ const BASE_TYPEDOC_OPTIONS = {
22
23
  exampleTag: false,
23
24
  },
24
25
  exclude: ['**/node_modules/**'],
25
- sort: ['source-order'],
26
+ ...DEFAULT_TYPEDOC_OPTIONS,
26
27
  logLevel: 'Verbose',
27
28
  frontmatterGlobals: {
28
29
  layout: 'doc',