jamdesk 1.1.74 → 1.1.75

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamdesk",
3
- "version": "1.1.74",
3
+ "version": "1.1.75",
4
4
  "description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
5
5
  "keywords": [
6
6
  "jamdesk",
@@ -17,6 +17,16 @@ import type { Root, ElementContent } from 'hast';
17
17
  * intent), drop the inner (autolink artifact), promote the inner's
18
18
  * children into the outer's children. Handles arbitrary nesting depth.
19
19
  *
20
+ * **Two anchor flavors are recognised:**
21
+ * 1. Plain hast `element` with `tagName === 'a'` — produced by remark
22
+ * from markdown `[text](href)` syntax and by remark-gfm autolinks.
23
+ * 2. MDX-jsx nodes (`mdxJsxTextElement` / `mdxJsxFlowElement`) with
24
+ * `name === 'a'` — produced when the user writes literal `<a …>` JSX
25
+ * inside MDX. These are non-standard hast extensions added by
26
+ * `@mdx-js/mdx`; their children are still hast `ElementContent`.
27
+ * Without this case the dodo customer pattern (outer = user JSX
28
+ * anchor, inner = autolink hast element) slips past unchanged.
29
+ *
20
30
  * **Inner attributes are intentionally discarded.** The inner `<a>`'s
21
31
  * `href`, `id`, `className`, etc. are dropped — only its children survive.
22
32
  * This is correct under the policy below (the inner is an autolink
@@ -39,6 +49,38 @@ import type { Root, ElementContent } from 'hast';
39
49
  * children array, which is what unwrapping requires. The manual walk
40
50
  * below is the simplest correct shape for that specific operation.
41
51
  */
52
+
53
+ // Structural shape covering both hast `element` and MDX-jsx anchor nodes.
54
+ // We avoid pulling type defs from `mdast-util-mdx-jsx` to keep this file
55
+ // dependency-free; runtime checks on `type` are sufficient.
56
+ type AnchorLike = {
57
+ type: 'element' | 'mdxJsxTextElement' | 'mdxJsxFlowElement';
58
+ tagName?: string;
59
+ name?: string | null;
60
+ children: ElementContent[];
61
+ };
62
+
63
+ function isAnchor(node: { type: string }): node is AnchorLike {
64
+ if (node.type === 'element') {
65
+ return (node as { tagName?: string }).tagName === 'a';
66
+ }
67
+ if (node.type === 'mdxJsxTextElement' || node.type === 'mdxJsxFlowElement') {
68
+ return (node as { name?: string | null }).name === 'a';
69
+ }
70
+ return false;
71
+ }
72
+
73
+ // A child that has a `children` array we should descend into. Covers
74
+ // hast elements and both MDX-jsx flavors. Other node types (text,
75
+ // comment, doctype, mdxFlowExpression, etc.) have no children to walk.
76
+ function hasChildren(node: { type: string }): node is { type: string; children: ElementContent[] } {
77
+ return (
78
+ node.type === 'element' ||
79
+ node.type === 'mdxJsxTextElement' ||
80
+ node.type === 'mdxJsxFlowElement'
81
+ );
82
+ }
83
+
42
84
  export function rehypeUnwrapNestedAnchors() {
43
85
  return (tree: Root) => {
44
86
  // Returns the same array reference unchanged when no nested-anchor
@@ -52,9 +94,9 @@ export function rehypeUnwrapNestedAnchors() {
52
94
  let next: ElementContent[] | null = null;
53
95
  for (let i = 0; i < children.length; i++) {
54
96
  const child = children[i];
55
- if (child.type === 'element') {
56
- const isAnchor = child.tagName === 'a';
57
- if (isAnchor && insideAnchor) {
97
+ if (hasChildren(child)) {
98
+ const childIsAnchor = isAnchor(child);
99
+ if (childIsAnchor && insideAnchor) {
58
100
  // Nested <a> inside an outer <a>. Recurse with insideAnchor=true
59
101
  // so deeper nesting is also flattened, then splice the (now
60
102
  // anchor-free) children into the outer instead of the <a> itself.
@@ -63,7 +105,7 @@ export function rehypeUnwrapNestedAnchors() {
63
105
  if (inner !== child.children) child.children = inner;
64
106
  next.push(...child.children);
65
107
  } else {
66
- const grandchildren = rewriteChildren(child.children, insideAnchor || isAnchor);
108
+ const grandchildren = rewriteChildren(child.children, insideAnchor || childIsAnchor);
67
109
  if (grandchildren !== child.children) child.children = grandchildren;
68
110
  if (next !== null) next.push(child);
69
111
  }
@@ -938,15 +938,15 @@
938
938
  }
939
939
  },
940
940
  "node_modules/@next/env": {
941
- "version": "16.2.5",
942
- "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.5.tgz",
943
- "integrity": "sha512-Lb9ElHD2klcyeVD25vW+siPFqz9QMzDUSgvFZNO+dZEKoMHex4viJhVuzBhrXKqb+UKnih7mVYbt50/7KLsSCA==",
941
+ "version": "16.2.6",
942
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.2.6.tgz",
943
+ "integrity": "sha512-gd8HoHN4ufj73WmR3JmVolrpJR47ILK6LouP5xElPglaVxir6e1a7VzvTvDWkOoPXT9rkkTzyCxBu4yeZfZwcw==",
944
944
  "license": "MIT"
945
945
  },
946
946
  "node_modules/@next/mdx": {
947
- "version": "16.2.5",
948
- "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-16.2.5.tgz",
949
- "integrity": "sha512-U1r0I3Ga5/PYKH+loar1OfWCjkZXwG6qFovDzyAFPI2Nxi9gLOWZQ3dLNC5znSGLPToJauRbqgi3kfkKEFqNig==",
947
+ "version": "16.2.6",
948
+ "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-16.2.6.tgz",
949
+ "integrity": "sha512-0hdoSkzRbyud1dNRRDiyqD9FrxR2wwdiW+ffhYx+n+fXrFOJ7Nwpi8o7nUz2LiiM44BB9M0eIO1Evy3BBrS50A==",
950
950
  "license": "MIT",
951
951
  "dependencies": {
952
952
  "source-map": "^0.7.0"
@@ -965,9 +965,9 @@
965
965
  }
966
966
  },
967
967
  "node_modules/@next/swc-darwin-arm64": {
968
- "version": "16.2.5",
969
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.5.tgz",
970
- "integrity": "sha512-BW+8PGVmsruomXHsitD8JG6gny9lEdobctjBwvtPF8AKtxGDR7nR35FOl/oK9UAPXBOBm+vx0k8qtpeHOXQMGQ==",
968
+ "version": "16.2.6",
969
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.2.6.tgz",
970
+ "integrity": "sha512-ZJGkkcNfYgrrMkqOdZ7zoLa1TOy0qpcMfk/z4Mh/FKUz40gVO+HNQWqmLxf67Z5WB64DRp0dhEbyHfel+6sJUg==",
971
971
  "cpu": [
972
972
  "arm64"
973
973
  ],
@@ -981,9 +981,9 @@
981
981
  }
982
982
  },
983
983
  "node_modules/@next/swc-darwin-x64": {
984
- "version": "16.2.5",
985
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.5.tgz",
986
- "integrity": "sha512-ZoCGnCl9LlQJWmqXrZAUlNxvuNmclvE+7zUif+nDydkkehl9FKxHJ+wxSQMj+C37BYFerKiEdX9s9o02ir975Q==",
984
+ "version": "16.2.6",
985
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.2.6.tgz",
986
+ "integrity": "sha512-v/YLBHIY132Ced3puBJ7YJKw1lqsCrgcNo2aRJlCEyQrrCeRJlvGlnmxhPxNQI3KE3N1DN5r9TPNPvka3nq5RQ==",
987
987
  "cpu": [
988
988
  "x64"
989
989
  ],
@@ -997,9 +997,9 @@
997
997
  }
998
998
  },
999
999
  "node_modules/@next/swc-linux-arm64-gnu": {
1000
- "version": "16.2.5",
1001
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.5.tgz",
1002
- "integrity": "sha512-AwcZzMChaWkOTZt3vu+2ZMIj8g4dYQY+B8VUVhlFSQ2JtvyZpefyYHTe00D6b6L7BysYw7vl3zsvs9jix8tl5Q==",
1000
+ "version": "16.2.6",
1001
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.2.6.tgz",
1002
+ "integrity": "sha512-RPOvqlYBbcQjkz9VQQDZ2T2bARIjXZV1KFlt+V2Mr6SW/e4I9fcKsaA0hdyf2FHoTlsV2xnBd5Y912rP/1Ce6w==",
1003
1003
  "cpu": [
1004
1004
  "arm64"
1005
1005
  ],
@@ -1016,9 +1016,9 @@
1016
1016
  }
1017
1017
  },
1018
1018
  "node_modules/@next/swc-linux-arm64-musl": {
1019
- "version": "16.2.5",
1020
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.5.tgz",
1021
- "integrity": "sha512-QqMgqWbCBFsfiQ7BF3dUlW8HJy1LWhpcqbTpoHMWA9IV+TnWwDKozQJA5NdIAHjQ00yX2Q7AUkLr/XK4n77q8A==",
1019
+ "version": "16.2.6",
1020
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.2.6.tgz",
1021
+ "integrity": "sha512-URUTu1+dMkxJsPFgm+OeEvq9wf5sujw0EvgYy80TDGHTSLTnIHeqb0Eu8A3sC95IRgjejQL+kC4mw+4yPxiAXA==",
1022
1022
  "cpu": [
1023
1023
  "arm64"
1024
1024
  ],
@@ -1035,9 +1035,9 @@
1035
1035
  }
1036
1036
  },
1037
1037
  "node_modules/@next/swc-linux-x64-gnu": {
1038
- "version": "16.2.5",
1039
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.5.tgz",
1040
- "integrity": "sha512-3hzeiFGZtyATVx9pCeuzTshXmh50vHZitqaeZiyJZaUmjQyrfjsVUgS8apOj1vEJCIpKJM/55F45yPAV2kpjsA==",
1038
+ "version": "16.2.6",
1039
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.2.6.tgz",
1040
+ "integrity": "sha512-DOj182mPV8G3UkrayLoREM5YEYI+Dk5wv7Ox9xl1fFibAELEsFD0lDPfHIeILlutMMfdyhlzYPELG3peuKaurw==",
1041
1041
  "cpu": [
1042
1042
  "x64"
1043
1043
  ],
@@ -1054,9 +1054,9 @@
1054
1054
  }
1055
1055
  },
1056
1056
  "node_modules/@next/swc-linux-x64-musl": {
1057
- "version": "16.2.5",
1058
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.5.tgz",
1059
- "integrity": "sha512-0mzZV/mAt7Qj2tYNdTB6AqrS8dwng/AQLSYC5Z1YLpZdi2wxqKDPK7RY2RvjB1fXyJfOfdA3l/yTF5yLi+WfuQ==",
1057
+ "version": "16.2.6",
1058
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.2.6.tgz",
1059
+ "integrity": "sha512-HKQ5SP/V/ub73UvF7n/zeJlxk2kLmtL7Wzrg4WfmkjmNos5onJ2tKu7yZOPdL18A6Svfn3max29ym+ry7NkK4g==",
1060
1060
  "cpu": [
1061
1061
  "x64"
1062
1062
  ],
@@ -1073,9 +1073,9 @@
1073
1073
  }
1074
1074
  },
1075
1075
  "node_modules/@next/swc-win32-arm64-msvc": {
1076
- "version": "16.2.5",
1077
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.5.tgz",
1078
- "integrity": "sha512-f/H4nZ2zJBvA8/+HpsB9mNonF9zfQoAU6D0WxJrfzhJDvJLfngVN85oqxUyrDVK99DIFfFYhLpGa5K+c5uotSw==",
1076
+ "version": "16.2.6",
1077
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.2.6.tgz",
1078
+ "integrity": "sha512-LZXpTlPyS5v7HhSmnvsLGP3iIYgYOBnc8r8ArlT55sGHV89bR2HlDdBjWQ+PY6SJMmk8TuVGFuxalnP3k/0Dwg==",
1079
1079
  "cpu": [
1080
1080
  "arm64"
1081
1081
  ],
@@ -1089,9 +1089,9 @@
1089
1089
  }
1090
1090
  },
1091
1091
  "node_modules/@next/swc-win32-x64-msvc": {
1092
- "version": "16.2.5",
1093
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.5.tgz",
1094
- "integrity": "sha512-nuP7DHs4koAojsIxVPkihNgKiRUKtCU65j5X6DAbSy8VBrfT/o90bCLLHPf51JEdOZwZMFzM6e0NiGWfIWjVAg==",
1092
+ "version": "16.2.6",
1093
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.2.6.tgz",
1094
+ "integrity": "sha512-F0+4i0h9J6C4eE3EAPWsoCk7UW/dbzOjyzxY0qnDUOYFu6FFmdZ6l97/XdV3/Nz3VYyO7UWjyEJUXkGqcoXfMA==",
1095
1095
  "cpu": [
1096
1096
  "x64"
1097
1097
  ],
@@ -1105,9 +1105,9 @@
1105
1105
  }
1106
1106
  },
1107
1107
  "node_modules/@next/third-parties": {
1108
- "version": "16.2.5",
1109
- "resolved": "https://registry.npmjs.org/@next/third-parties/-/third-parties-16.2.5.tgz",
1110
- "integrity": "sha512-GgjE9fJiYDr5eMEowSWoThJVV4fOHVA4vJ5oxAzoaa3Agfj56g+0PkPXtj0CjdaH6IlUFBtUPp5r2kfdGABK1w==",
1108
+ "version": "16.2.6",
1109
+ "resolved": "https://registry.npmjs.org/@next/third-parties/-/third-parties-16.2.6.tgz",
1110
+ "integrity": "sha512-PDPIPVj1NX6Taxsl8OJteAUJ7iwR+QrokwWig68eh0cOmuNjC6MBL+ZzBjO8Bv0n/HOSqjGArZpM5KMSUxm+MQ==",
1111
1111
  "license": "MIT",
1112
1112
  "dependencies": {
1113
1113
  "third-party-capital": "1.0.20"
@@ -5312,12 +5312,12 @@
5312
5312
  }
5313
5313
  },
5314
5314
  "node_modules/next": {
5315
- "version": "16.2.5",
5316
- "resolved": "https://registry.npmjs.org/next/-/next-16.2.5.tgz",
5317
- "integrity": "sha512-TkVTm9F2WEulkgGljm4wPwNgvCCWCVw6StUHsZb8WZpHFRjepoUWg3d7L4IMg7IyjcJ4Co9eVhpro8e8O+KarQ==",
5315
+ "version": "16.2.6",
5316
+ "resolved": "https://registry.npmjs.org/next/-/next-16.2.6.tgz",
5317
+ "integrity": "sha512-qOVgKJg1+At15NpeUP+eJgCHvTCgXsogweq87Ri/Ix7PkqQHg4sdaXmSFqKlgaIXE4kW0g25LE68W87UANlHtw==",
5318
5318
  "license": "MIT",
5319
5319
  "dependencies": {
5320
- "@next/env": "16.2.5",
5320
+ "@next/env": "16.2.6",
5321
5321
  "@swc/helpers": "0.5.15",
5322
5322
  "baseline-browser-mapping": "^2.9.19",
5323
5323
  "caniuse-lite": "^1.0.30001579",
@@ -5331,14 +5331,14 @@
5331
5331
  "node": ">=20.9.0"
5332
5332
  },
5333
5333
  "optionalDependencies": {
5334
- "@next/swc-darwin-arm64": "16.2.5",
5335
- "@next/swc-darwin-x64": "16.2.5",
5336
- "@next/swc-linux-arm64-gnu": "16.2.5",
5337
- "@next/swc-linux-arm64-musl": "16.2.5",
5338
- "@next/swc-linux-x64-gnu": "16.2.5",
5339
- "@next/swc-linux-x64-musl": "16.2.5",
5340
- "@next/swc-win32-arm64-msvc": "16.2.5",
5341
- "@next/swc-win32-x64-msvc": "16.2.5",
5334
+ "@next/swc-darwin-arm64": "16.2.6",
5335
+ "@next/swc-darwin-x64": "16.2.6",
5336
+ "@next/swc-linux-arm64-gnu": "16.2.6",
5337
+ "@next/swc-linux-arm64-musl": "16.2.6",
5338
+ "@next/swc-linux-x64-gnu": "16.2.6",
5339
+ "@next/swc-linux-x64-musl": "16.2.6",
5340
+ "@next/swc-win32-arm64-msvc": "16.2.6",
5341
+ "@next/swc-win32-x64-msvc": "16.2.6",
5342
5342
  "sharp": "^0.34.5"
5343
5343
  },
5344
5344
  "peerDependencies": {