@ankhorage/paradox 0.1.26 → 0.1.27

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.27
4
+
5
+ ### Patch Changes
6
+
7
+ - ef42af1: Reuse the canonical Utility ASCII slugifier for generated HTML anchor ids.
8
+
3
9
  ## 0.1.26
4
10
 
5
11
  ### Patch Changes
@@ -1,3 +1,4 @@
1
+ import { slugifyAscii } from '@ankhorage/utility/string';
1
2
  /***
2
3
  * Renders a deterministic static HTML documentation app.
3
4
  */
@@ -281,7 +282,7 @@ function renderSourceNavItem(area) {
281
282
  * Renders the right-hand source area view for a selected file.
282
283
  */
283
284
  function renderSourceAreaView(area) {
284
- return `<section id="view-${toAnchorId(area.path)}" class="view" data-view="${escapeAttribute(area.path)}" hidden>
285
+ return `<section id="view-${slugifyAscii(area.path)}" class="view" data-view="${escapeAttribute(area.path)}" hidden>
285
286
  <section class="panel">
286
287
  <h2>${escapeHtml(area.path)}</h2>
287
288
  ${area.functions.map(renderSourceFunctionCard).join('')}
@@ -337,7 +338,7 @@ function renderModuleCard(module) {
337
338
  * Renders one public API export card on the Home page.
338
339
  */
339
340
  function renderExportCard(item) {
340
- return `<article class="item" id="symbol-${toAnchorId(item.name)}" data-search="${escapeAttribute([
341
+ return `<article class="item" id="symbol-${slugifyAscii(item.name)}" data-search="${escapeAttribute([
341
342
  item.name,
342
343
  item.kind,
343
344
  item.modulePath,
@@ -404,7 +405,7 @@ function renderMemberTable(item) {
404
405
  * Renders one detected component card on the Home page.
405
406
  */
406
407
  function renderComponentCard(component) {
407
- return `<article class="item" id="component-${toAnchorId(component.name)}" data-search="${escapeAttribute([
408
+ return `<article class="item" id="component-${slugifyAscii(component.name)}" data-search="${escapeAttribute([
408
409
  component.name,
409
410
  component.modulePath,
410
411
  component.description ?? '',
@@ -477,15 +478,6 @@ function groupBy(items, key) {
477
478
  }
478
479
  return new Map([...groups.entries()].sort(([left], [right]) => left.localeCompare(right)));
479
480
  }
480
- /***
481
- * Converts a label to a stable HTML anchor id fragment.
482
- */
483
- function toAnchorId(value) {
484
- return value
485
- .toLowerCase()
486
- .replace(/[^a-z0-9]+/g, '-')
487
- .replace(/^-|-$/g, '');
488
- }
489
481
  /***
490
482
  * Converts a scenario name to the generated Mermaid file stem.
491
483
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/paradox",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "Deterministic documentation generator for TypeScript packages.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -15,12 +15,13 @@
15
15
  "url": "git+https://github.com/ankhorage/paradox.git"
16
16
  },
17
17
  "keywords": [
18
- "typescript",
18
+ "ankhorage",
19
+ "developer-tools",
19
20
  "documentation",
20
21
  "readme-generator",
21
22
  "static-analysis",
22
23
  "ts-morph",
23
- "developer-tools"
24
+ "typescript"
24
25
  ],
25
26
  "type": "module",
26
27
  "main": "./dist/index.js",
@@ -63,12 +64,14 @@
63
64
  "lint": "ankhorage-eslint . --max-warnings=0",
64
65
  "lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
65
66
  "prepack": "bun run build",
66
- "test": "bun test",
67
+ "test": "bun test --path-ignore-patterns '**/*.e2e.test.ts'",
67
68
  "typecheck": "bun x tsc --noEmit -p tsconfig.json",
68
69
  "version-packages": "ankhorage-changeset version",
69
- "knip:check": "ankhorage-knip"
70
+ "knip:check": "ankhorage-knip",
71
+ "test:standalone": "bun test tests/cli.e2e.test.ts"
70
72
  },
71
73
  "dependencies": {
74
+ "@ankhorage/utility": "^1.8.0",
72
75
  "ts-morph": "^28.0.0"
73
76
  },
74
77
  "devDependencies": {