@ankhorage/paradox 0.1.20 → 0.1.21

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.21
4
+
5
+ ### Patch Changes
6
+
7
+ - b7cd8b9: Normalize package-local absolute import types emitted through React component prop analysis by carrying the analyzed package root into the existing type-text normalizer.
8
+
3
9
  ## 0.1.20
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/paradox
5
5
 
6
- ![license: MIT](./paradox/badges/license.svg) ![npm: v0.1.20](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![docs: paradox](./paradox/badges/docs.svg)
6
+ ![license: MIT](./paradox/badges/license.svg) ![npm: v0.1.21](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![docs: paradox](./paradox/badges/docs.svg)
7
7
 
8
8
  Deterministic documentation generator for TypeScript packages.
9
9
 
@@ -21,7 +21,7 @@ export function analyzeComponents(exports, options = {}) {
21
21
  description: member.description ?? null,
22
22
  })) ?? [];
23
23
  const propsType = getComponentPropsType(e.node);
24
- const legacyProps = propsType != null ? getPropsFromType(propsType) : [];
24
+ const legacyProps = propsType != null ? getPropsFromType(propsType, options.program?.root) : [];
25
25
  const props = analyzerProps.length > 0 ? analyzerProps : legacyProps;
26
26
  components.push({
27
27
  name: e.name,
@@ -3,4 +3,4 @@ import type { AnalysisComponent } from '../types.js';
3
3
  /***
4
4
  * Extracts prop names, types, required flags, and descriptions from a type.
5
5
  */
6
- export declare function getPropsFromType(type: Type): AnalysisComponent['props'];
6
+ export declare function getPropsFromType(type: Type, packageRoot?: string): AnalysisComponent['props'];
@@ -4,7 +4,7 @@ import { parseParadoxComment } from './parseParadoxComment.js';
4
4
  /***
5
5
  * Extracts prop names, types, required flags, and descriptions from a type.
6
6
  */
7
- export function getPropsFromType(type) {
7
+ export function getPropsFromType(type, packageRoot) {
8
8
  return type.getProperties().map((property) => {
9
9
  const [declaration] = property.getDeclarations();
10
10
  const propertyType = property.getTypeAtLocation(declaration);
@@ -14,7 +14,7 @@ export function getPropsFromType(type) {
14
14
  : { description: null, isConfig: false, params: {}, returns: null };
15
15
  return {
16
16
  name: property.getName(),
17
- type: normalizeTypeText(propertyType.getText(declaration)),
17
+ type: normalizeTypeText(propertyType.getText(declaration), packageRoot),
18
18
  required: !property.isOptional(),
19
19
  description: parsed.description,
20
20
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/paradox",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Deterministic documentation generator for TypeScript packages.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {