@ankhorage/paradox 0.1.27 → 0.2.0

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.
Files changed (58) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +53 -61
  3. package/dist/analyze/analyze.d.ts +2 -2
  4. package/dist/analyze/analyze.js +51 -35
  5. package/dist/analyze/badges.d.ts +2 -1
  6. package/dist/analyze/badges.js +14 -4
  7. package/dist/analyze/components.js +12 -11
  8. package/dist/analyze/documentation/collectDocumentationCommentsAsync.d.ts +11 -0
  9. package/dist/analyze/documentation/collectDocumentationCommentsAsync.js +72 -0
  10. package/dist/analyze/documentation/findings.d.ts +5 -0
  11. package/dist/analyze/documentation/findings.js +17 -0
  12. package/dist/analyze/documentation/validateDocumentationPolicyAsync.d.ts +13 -0
  13. package/dist/analyze/documentation/validateDocumentationPolicyAsync.js +150 -0
  14. package/dist/analyze/documentation/validateReferencesAsync.d.ts +11 -0
  15. package/dist/analyze/documentation/validateReferencesAsync.js +148 -0
  16. package/dist/analyze/exports.d.ts +4 -0
  17. package/dist/analyze/exports.js +14 -7
  18. package/dist/analyze/readmeConfig.d.ts +1 -3
  19. package/dist/analyze/readmeConfig.js +8 -19
  20. package/dist/analyze/readmeUsage.d.ts +7 -10
  21. package/dist/analyze/readmeUsage.js +124 -48
  22. package/dist/analyze/semantic/docBlocks.js +18 -48
  23. package/dist/analyze/semantic/exports.js +1 -3
  24. package/dist/analyze/semantic/model.d.ts +0 -2
  25. package/dist/analyze/semantic/paradoxComment.d.ts +1 -11
  26. package/dist/analyze/semantic/paradoxComment.js +1 -43
  27. package/dist/analyze/semantic/tagRegistry.js +2 -1
  28. package/dist/analyze/sourceFunctions.js +4 -4
  29. package/dist/analyze/types.d.ts +31 -24
  30. package/dist/analyze/usage.d.ts +2 -2
  31. package/dist/analyze/usage.js +3 -33
  32. package/dist/analyze/utils/getExportMetadata.js +11 -40
  33. package/dist/analyze/utils/parseParadoxComment.d.ts +12 -9
  34. package/dist/analyze/utils/parseParadoxComment.js +66 -78
  35. package/dist/cli/index.d.ts +3 -2
  36. package/dist/cli/index.js +3 -2
  37. package/dist/cli/standalone.js +11 -0
  38. package/dist/config/defineParadoxConfig.d.ts +1 -1
  39. package/dist/doc-tags/registry.d.ts +28 -32
  40. package/dist/doc-tags/registry.js +35 -39
  41. package/dist/index.d.ts +1 -1
  42. package/dist/model/buildModel.d.ts +26 -19
  43. package/dist/model/buildModel.js +33 -99
  44. package/dist/model/types.d.ts +27 -20
  45. package/dist/paths/policy.d.ts +1 -1
  46. package/dist/render/renderers/diagrams.js +1 -7
  47. package/dist/render/renderers/html.js +89 -58
  48. package/dist/render/renderers/markdown.js +139 -86
  49. package/dist/render/toFileStem.d.ts +2 -0
  50. package/dist/render/toFileStem.js +8 -0
  51. package/dist/{config/types.d.ts → types/config.d.ts} +3 -5
  52. package/dist/write/write.d.ts +1 -1
  53. package/package.json +2 -1
  54. package/dist/analyze/readmeCli.d.ts +0 -9
  55. package/dist/analyze/readmeCli.js +0 -33
  56. package/dist/analyze/utils/getLeadingParadoxComment.d.ts +0 -10
  57. package/dist/analyze/utils/getLeadingParadoxComment.js +0 -16
  58. /package/dist/{config/types.js → types/config.js} +0 -0
@@ -1,5 +1,7 @@
1
1
  /***
2
- * Configuration for running Paradox.
2
+ * @title Configuration
3
+ *
4
+ * Configures Paradox documentation generation for a package.
3
5
  *
4
6
  * @config
5
7
  * @readme
@@ -16,10 +18,6 @@ export interface ParadoxConfig {
16
18
  docs?: {
17
19
  title?: string;
18
20
  description?: string;
19
- usage?: {
20
- description?: string;
21
- entrypoints?: string[];
22
- };
23
21
  };
24
22
  package?: {
25
23
  root?: string;
@@ -1,5 +1,5 @@
1
- import type { ParadoxConfig } from '../config/types.js';
2
1
  import type { RenderResult } from '../render/types.js';
2
+ import type { ParadoxConfig } from '../types/config.js';
3
3
  /***
4
4
  * Writes generated documentation artifacts to the configured output paths.
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/paradox",
3
- "version": "0.1.27",
3
+ "version": "0.2.0",
4
4
  "description": "Deterministic documentation generator for TypeScript packages.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -71,6 +71,7 @@
71
71
  "test:standalone": "bun test tests/cli.e2e.test.ts"
72
72
  },
73
73
  "dependencies": {
74
+ "@ankhorage/policy": "^0.1.0",
74
75
  "@ankhorage/utility": "^1.8.0",
75
76
  "ts-morph": "^28.0.0"
76
77
  },
@@ -1,9 +0,0 @@
1
- export interface AnalysisReadmeCli {
2
- description: string | null;
3
- sourcePath: string;
4
- }
5
- /***
6
- * Collects README CLI metadata from the canonical Ankhorage CLI entrypoint when its leading
7
- * Paradox comment opts into README output with @readme.
8
- */
9
- export declare function analyzeReadmeCli(root: string): Promise<AnalysisReadmeCli | null>;
@@ -1,33 +0,0 @@
1
- import { readFile } from 'node:fs/promises';
2
- import { join } from 'node:path';
3
- import { getLeadingParadoxComment } from './utils/getLeadingParadoxComment.js';
4
- const CLI_INDEX_PATH = 'src/cli/index.ts';
5
- /***
6
- * Collects README CLI metadata from the canonical Ankhorage CLI entrypoint when its leading
7
- * Paradox comment opts into README output with @readme.
8
- */
9
- export async function analyzeReadmeCli(root) {
10
- const filePath = join(root, CLI_INDEX_PATH);
11
- let source;
12
- try {
13
- source = await readFile(filePath, 'utf-8');
14
- }
15
- catch (error) {
16
- if (isMissingPathError(error))
17
- return null;
18
- throw error;
19
- }
20
- const comment = getLeadingParadoxComment(source);
21
- if (!comment?.parsed.isReadme)
22
- return null;
23
- return {
24
- description: comment.parsed.description,
25
- sourcePath: CLI_INDEX_PATH,
26
- };
27
- }
28
- function isMissingPathError(error) {
29
- return (error instanceof Error &&
30
- 'code' in error &&
31
- typeof error.code === 'string' &&
32
- error.code === 'ENOENT');
33
- }
@@ -1,10 +0,0 @@
1
- import { type ParsedParadoxComment } from './parseParadoxComment.js';
2
- export interface LeadingParadoxComment {
3
- parsed: ParsedParadoxComment;
4
- start: number;
5
- end: number;
6
- }
7
- /***
8
- * Parses a leading Paradox comment from a source file.
9
- */
10
- export declare function getLeadingParadoxComment(source: string): LeadingParadoxComment | null;
@@ -1,16 +0,0 @@
1
- import { parseParadoxComment } from './parseParadoxComment.js';
2
- /***
3
- * Parses a leading Paradox comment from a source file.
4
- */
5
- export function getLeadingParadoxComment(source) {
6
- const match = /^\s*(\/\*\*\*[\s\S]*?\*\/)/.exec(source);
7
- const comment = match?.[1];
8
- if (match === null || comment === undefined)
9
- return null;
10
- const start = match[0].indexOf(comment);
11
- return {
12
- parsed: parseParadoxComment(comment),
13
- start,
14
- end: start + comment.length,
15
- };
16
- }
File without changes