@ankhorage/paradox 0.1.15 → 0.1.17
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/CHANGELOG.md +12 -0
- package/README.md +7 -7
- package/dist/analyze/analyze.js +2 -0
- package/dist/analyze/types.d.ts +1 -0
- package/dist/{cli.js → cli/standalone.js} +5 -5
- package/dist/config/types.d.ts +1 -0
- package/dist/model/buildModel.d.ts +1 -0
- package/dist/model/buildModel.js +1 -0
- package/dist/model/types.d.ts +1 -0
- package/dist/render/renderers/markdown.js +8 -6
- package/package.json +3 -3
- /package/dist/{cli.d.ts → cli/standalone.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8eac93d: Support section-level README Usage prose through `docs.usage.description` without requiring a source-backed usage example.
|
|
8
|
+
|
|
9
|
+
## 0.1.16
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 5bbc16a: Move the standalone executable into the canonical `src/cli/` folder while keeping the provider export at `src/cli/index.ts`.
|
|
14
|
+
|
|
3
15
|
## 0.1.15
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/paradox
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Deterministic documentation generator for TypeScript packages.
|
|
9
9
|
|
|
@@ -79,12 +79,12 @@ export default defineParadoxConfig({
|
|
|
79
79
|
<details>
|
|
80
80
|
<summary>Configuration options</summary>
|
|
81
81
|
|
|
82
|
-
| Field | Type
|
|
83
|
-
| ------- |
|
|
84
|
-
| mode | `'safe' \| 'write' \| undefined`
|
|
85
|
-
| docs | `{ title?: string; description?: string; usage?: { entrypoints?: string[]; }; } \| undefined` | no | — | |
|
|
86
|
-
| package | `{ root?: string; entrypoints?: string[]; } \| undefined`
|
|
87
|
-
| output | `{ dir?: string; } \| undefined`
|
|
82
|
+
| Field | Type | Required | Default | Description |
|
|
83
|
+
| ------- | ------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ----------- |
|
|
84
|
+
| mode | `'safe' \| 'write' \| undefined` | no | — | |
|
|
85
|
+
| docs | `{ title?: string; description?: string; usage?: { description?: string; entrypoints?: string[]; }; } \| undefined` | no | — | |
|
|
86
|
+
| package | `{ root?: string; entrypoints?: string[]; } \| undefined` | no | — | |
|
|
87
|
+
| output | `{ dir?: string; } \| undefined` | no | — | |
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
package/dist/analyze/analyze.js
CHANGED
|
@@ -22,6 +22,7 @@ export async function analyze(config, runtime) {
|
|
|
22
22
|
const badges = await analyzeBadges(root, pkg);
|
|
23
23
|
const project = createProject(root);
|
|
24
24
|
const entrypoints = config.package?.entrypoints ?? ['src/index.ts'];
|
|
25
|
+
const readmeUsageDescription = config.docs?.usage?.description ?? null;
|
|
25
26
|
const usageEntryPoints = config.docs?.usage?.entrypoints ?? [];
|
|
26
27
|
const readmeUsage = await analyzeReadmeUsage({ root, entrypoints: usageEntryPoints });
|
|
27
28
|
const program = createTypeScriptProgram({ root, entrypoints, project });
|
|
@@ -67,6 +68,7 @@ export async function analyze(config, runtime) {
|
|
|
67
68
|
badges,
|
|
68
69
|
sequenceScenarios,
|
|
69
70
|
usage,
|
|
71
|
+
readmeUsageDescription,
|
|
70
72
|
readmeUsage,
|
|
71
73
|
config: configMetadata
|
|
72
74
|
? {
|
package/dist/analyze/types.d.ts
CHANGED
|
@@ -163,6 +163,7 @@ export interface AnalysisResult {
|
|
|
163
163
|
badges: AnalysisBadge[];
|
|
164
164
|
sequenceScenarios: AnalysisSequenceScenario[];
|
|
165
165
|
usage: AnalysisUsage | null;
|
|
166
|
+
readmeUsageDescription: string | null;
|
|
166
167
|
readmeUsage: AnalysisReadmeUsage[];
|
|
167
168
|
config: {
|
|
168
169
|
exportName: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
|
-
import { analyze } from '
|
|
4
|
-
import { buildModel } from '
|
|
5
|
-
import { findParadoxConfigFile, loadParadoxConfig, resolveOutputRoot, resolvePackageRoot, } from '
|
|
6
|
-
import { render } from '
|
|
7
|
-
import { write } from '
|
|
3
|
+
import { analyze } from '../analyze/analyze.js';
|
|
4
|
+
import { buildModel } from '../model/buildModel.js';
|
|
5
|
+
import { findParadoxConfigFile, loadParadoxConfig, resolveOutputRoot, resolvePackageRoot, } from '../paths/policy.js';
|
|
6
|
+
import { render } from '../render/render.js';
|
|
7
|
+
import { write } from '../write/write.js';
|
|
8
8
|
/***
|
|
9
9
|
* Runs the Paradox CLI.
|
|
10
10
|
*
|
package/dist/config/types.d.ts
CHANGED
package/dist/model/buildModel.js
CHANGED
package/dist/model/types.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ function renderReadme(model, outputDir, badges, diagrams) {
|
|
|
23
23
|
}
|
|
24
24
|
if (model.description)
|
|
25
25
|
lines.push(model.description, '');
|
|
26
|
-
renderReadmeUsage(lines, model.readmeUsage);
|
|
26
|
+
renderReadmeUsage(lines, model.readmeUsageDescription, model.readmeUsage);
|
|
27
27
|
if (model.usage !== null) {
|
|
28
28
|
lines.push('## Installation', '', '```bash');
|
|
29
29
|
for (const command of model.usage.commands)
|
|
@@ -37,18 +37,20 @@ function renderReadme(model, outputDir, badges, diagrams) {
|
|
|
37
37
|
renderReadmeApi(lines, model);
|
|
38
38
|
return `${lines.join('\n').trimEnd()}\n`;
|
|
39
39
|
}
|
|
40
|
-
function renderReadmeUsage(lines, entries) {
|
|
41
|
-
if (entries.length === 0)
|
|
40
|
+
function renderReadmeUsage(lines, description, entries) {
|
|
41
|
+
if (description === null && entries.length === 0)
|
|
42
42
|
return;
|
|
43
43
|
lines.push('## Usage', '');
|
|
44
|
+
if (description !== null)
|
|
45
|
+
lines.push(description, '');
|
|
44
46
|
for (const entry of entries) {
|
|
45
47
|
if (entry.title !== null)
|
|
46
48
|
lines.push(`### ${entry.title}`, '');
|
|
47
49
|
if (entry.description !== null) {
|
|
48
50
|
const [, ...rest] = entry.description.split('\n');
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
lines.push(
|
|
51
|
+
const entryDescription = rest.join('\n').trim();
|
|
52
|
+
if (entryDescription.length > 0)
|
|
53
|
+
lines.push(entryDescription, '');
|
|
52
54
|
}
|
|
53
55
|
lines.push(`Source: \`${entry.sourcePath}\``, '');
|
|
54
56
|
lines.push(`\`\`\`${entry.language}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/paradox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "Deterministic documentation generator for TypeScript packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"LICENSE"
|
|
44
44
|
],
|
|
45
45
|
"bin": {
|
|
46
|
-
"paradox": "./dist/cli.js"
|
|
46
|
+
"paradox": "./dist/cli/standalone.js"
|
|
47
47
|
},
|
|
48
48
|
"ankh": {
|
|
49
49
|
"category": "docs",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"build": "tsc -p tsconfig.build.json",
|
|
57
57
|
"changeset": "changeset",
|
|
58
58
|
"changeset:status": "changeset status --since=origin/main",
|
|
59
|
-
"docs": "bun src/cli.ts",
|
|
59
|
+
"docs": "bun src/cli/standalone.ts",
|
|
60
60
|
"docs:bunx": "bunx @ankhorage/paradox",
|
|
61
61
|
"format": "ankhorage-prettier --write .",
|
|
62
62
|
"format:check": "ankhorage-prettier --check .",
|
|
File without changes
|