@d-fischer/documen.ts 0.16.9 → 0.17.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 (300) hide show
  1. package/index.html +36 -35
  2. package/lib/common/CustomError.js +1 -4
  3. package/lib/common/CustomError.js.map +1 -1
  4. package/lib/common/Paths.js +1 -2
  5. package/lib/common/components/Badge.js +7 -10
  6. package/lib/common/components/Badge.js.map +1 -1
  7. package/lib/common/components/BetaNotice.js +5 -10
  8. package/lib/common/components/BetaNotice.js.map +1 -1
  9. package/lib/common/components/Button.js +8 -12
  10. package/lib/common/components/Button.js.map +1 -1
  11. package/lib/common/components/CodeBlock.js +45 -61
  12. package/lib/common/components/CodeBlock.js.map +1 -1
  13. package/lib/common/components/CodeLink.js +12 -15
  14. package/lib/common/components/CodeLink.js.map +1 -1
  15. package/lib/common/components/DeprecationNotice.js +5 -10
  16. package/lib/common/components/DeprecationNotice.js.map +1 -1
  17. package/lib/common/components/FunctionParamDesc.js +7 -19
  18. package/lib/common/components/FunctionParamDesc.js.map +1 -1
  19. package/lib/common/components/FunctionParamDescEntry.js +26 -38
  20. package/lib/common/components/FunctionParamDescEntry.js.map +1 -1
  21. package/lib/common/components/FunctionReturnType.js +8 -17
  22. package/lib/common/components/FunctionReturnType.js.map +1 -1
  23. package/lib/common/components/FunctionSignature.js +7 -22
  24. package/lib/common/components/FunctionSignature.js.map +1 -1
  25. package/lib/common/components/InterfaceDetail.js +11 -18
  26. package/lib/common/components/InterfaceDetail.js.map +1 -1
  27. package/lib/common/components/InterfaceRepresentation.js +21 -40
  28. package/lib/common/components/InterfaceRepresentation.js.map +1 -1
  29. package/lib/common/components/MainMenu.js +20 -36
  30. package/lib/common/components/MainMenu.js.map +1 -1
  31. package/lib/common/components/NavMenu.js +6 -9
  32. package/lib/common/components/NavMenu.js.map +1 -1
  33. package/lib/common/components/NavMenuGroup.js +5 -10
  34. package/lib/common/components/NavMenuGroup.js.map +1 -1
  35. package/lib/common/components/NavMenuItem.js +8 -11
  36. package/lib/common/components/NavMenuItem.js.map +1 -1
  37. package/lib/common/components/PageArticle.js +7 -10
  38. package/lib/common/components/PageArticle.js.map +1 -1
  39. package/lib/common/components/SymbolHeader.js +6 -20
  40. package/lib/common/components/SymbolHeader.js.map +1 -1
  41. package/lib/common/components/TypeAliasHint.js +7 -22
  42. package/lib/common/components/TypeAliasHint.js.map +1 -1
  43. package/lib/common/components/TypeLink.js +12 -16
  44. package/lib/common/components/TypeLink.js.map +1 -1
  45. package/lib/common/components/VersionMenu.js +21 -28
  46. package/lib/common/components/VersionMenu.js.map +1 -1
  47. package/lib/common/components/cards/CardToolbar.js +11 -17
  48. package/lib/common/components/cards/CardToolbar.js.map +1 -1
  49. package/lib/common/components/cards/EventCard.js +21 -46
  50. package/lib/common/components/cards/EventCard.js.map +1 -1
  51. package/lib/common/components/cards/FunctionCardHeader.js +13 -25
  52. package/lib/common/components/cards/FunctionCardHeader.js.map +1 -1
  53. package/lib/common/components/cards/MethodCard.js +13 -23
  54. package/lib/common/components/cards/MethodCard.js.map +1 -1
  55. package/lib/common/components/cards/PropertyCard.js +15 -31
  56. package/lib/common/components/cards/PropertyCard.js.map +1 -1
  57. package/lib/common/components/codeBuilders/ReferenceTypeView.js +12 -25
  58. package/lib/common/components/codeBuilders/ReferenceTypeView.js.map +1 -1
  59. package/lib/common/components/codeBuilders/Type.js +30 -75
  60. package/lib/common/components/codeBuilders/Type.js.map +1 -1
  61. package/lib/common/components/overviewTable/OverviewTable.js +6 -21
  62. package/lib/common/components/overviewTable/OverviewTable.js.map +1 -1
  63. package/lib/common/components/overviewTable/OverviewTableEntry.js +13 -22
  64. package/lib/common/components/overviewTable/OverviewTableEntry.js.map +1 -1
  65. package/lib/common/config/Config.js +1 -2
  66. package/lib/common/config/Util.js +4 -8
  67. package/lib/common/config/Util.js.map +1 -1
  68. package/lib/common/config/index.js +5 -9
  69. package/lib/common/config/index.js.map +1 -1
  70. package/lib/common/containers/App.js +10 -18
  71. package/lib/common/containers/App.js.map +1 -1
  72. package/lib/common/containers/AppLayout.js +5 -10
  73. package/lib/common/containers/AppLayout.js.map +1 -1
  74. package/lib/common/containers/Card.js +6 -9
  75. package/lib/common/containers/Card.js.map +1 -1
  76. package/lib/common/containers/PageContent.js +5 -8
  77. package/lib/common/containers/PageContent.js.map +1 -1
  78. package/lib/common/containers/PageHeader.js +5 -8
  79. package/lib/common/containers/PageHeader.js.map +1 -1
  80. package/lib/common/containers/PageSwitch.js +10 -19
  81. package/lib/common/containers/PageSwitch.js.map +1 -1
  82. package/lib/common/containers/ReferencePackageContainer.js +37 -54
  83. package/lib/common/containers/ReferencePackageContainer.js.map +1 -1
  84. package/lib/common/htmlRenderer/HtmlRenderer.js +23 -37
  85. package/lib/common/htmlRenderer/HtmlRenderer.js.map +1 -1
  86. package/lib/common/htmlRenderer/RouterMode.js +1 -2
  87. package/lib/common/htmlRenderer/StaticRouterWithSuffix.js +20 -24
  88. package/lib/common/htmlRenderer/StaticRouterWithSuffix.js.map +1 -1
  89. package/lib/common/pages/ClassPage.js +39 -67
  90. package/lib/common/pages/ClassPage.js.map +1 -1
  91. package/lib/common/pages/DocPage.js +27 -39
  92. package/lib/common/pages/DocPage.js.map +1 -1
  93. package/lib/common/pages/EnumPage.js +20 -40
  94. package/lib/common/pages/EnumPage.js.map +1 -1
  95. package/lib/common/pages/FunctionPage.js +20 -39
  96. package/lib/common/pages/FunctionPage.js.map +1 -1
  97. package/lib/common/pages/InterfacePage.js +20 -32
  98. package/lib/common/pages/InterfacePage.js.map +1 -1
  99. package/lib/common/pages/TypeAliasPage.js +19 -34
  100. package/lib/common/pages/TypeAliasPage.js.map +1 -1
  101. package/lib/common/reference/index.js +1 -3
  102. package/lib/common/reference/index.js.map +1 -1
  103. package/lib/common/theme.js +1 -3
  104. package/lib/common/theme.js.map +1 -1
  105. package/lib/common/tools/ArrayTools.js +7 -18
  106. package/lib/common/tools/ArrayTools.js.map +1 -1
  107. package/lib/common/tools/CodeTools.js +12 -23
  108. package/lib/common/tools/CodeTools.js.map +1 -1
  109. package/lib/common/tools/ConfigTools.js +15 -20
  110. package/lib/common/tools/ConfigTools.js.map +1 -1
  111. package/lib/common/tools/FileTools.js +9 -16
  112. package/lib/common/tools/FileTools.js.map +1 -1
  113. package/lib/common/tools/FunctionTools.js +3 -7
  114. package/lib/common/tools/FunctionTools.js.map +1 -1
  115. package/lib/common/tools/NodeTools.js +22 -33
  116. package/lib/common/tools/NodeTools.js.map +1 -1
  117. package/lib/common/tools/Point.js +1 -2
  118. package/lib/common/tools/ReferenceTools.js +30 -43
  119. package/lib/common/tools/ReferenceTools.js.map +1 -1
  120. package/lib/common/tools/StringTools.js +3 -9
  121. package/lib/common/tools/StringTools.js.map +1 -1
  122. package/lib/common/tools/TypeTools.js +1 -2
  123. package/lib/common/tools/markdown/MarkdownParser.js +21 -28
  124. package/lib/common/tools/markdown/MarkdownParser.js.map +1 -1
  125. package/lib/common/tools/markdown/plugins/customDirectives.js +15 -17
  126. package/lib/common/tools/markdown/plugins/customDirectives.js.map +1 -1
  127. package/lib/common/tools/markdown/plugins/gfmTables.js +7 -12
  128. package/lib/common/tools/markdown/plugins/gfmTables.js.map +1 -1
  129. package/lib/common/tools/markdown/plugins/symbolLinks.js +9 -13
  130. package/lib/common/tools/markdown/plugins/symbolLinks.js.map +1 -1
  131. package/lib/generator/analyzer/AnalyzeContext.js +5 -6
  132. package/lib/generator/analyzer/AnalyzeContext.js.map +1 -1
  133. package/lib/generator/analyzer/DocComment.js +17 -23
  134. package/lib/generator/analyzer/DocComment.js.map +1 -1
  135. package/lib/generator/analyzer/DocCommentTag.js +4 -5
  136. package/lib/generator/analyzer/DocCommentTag.js.map +1 -1
  137. package/lib/generator/analyzer/Project.js +71 -84
  138. package/lib/generator/analyzer/Project.js.map +1 -1
  139. package/lib/generator/analyzer/createReflection.js +87 -101
  140. package/lib/generator/analyzer/createReflection.js.map +1 -1
  141. package/lib/generator/analyzer/createType.js +51 -62
  142. package/lib/generator/analyzer/createType.js.map +1 -1
  143. package/lib/generator/analyzer/reflections/AccessorReflection.js +36 -39
  144. package/lib/generator/analyzer/reflections/AccessorReflection.js.map +1 -1
  145. package/lib/generator/analyzer/reflections/ClassReflection.js +58 -51
  146. package/lib/generator/analyzer/reflections/ClassReflection.js.map +1 -1
  147. package/lib/generator/analyzer/reflections/ConstructorReflection.js +28 -36
  148. package/lib/generator/analyzer/reflections/ConstructorReflection.js.map +1 -1
  149. package/lib/generator/analyzer/reflections/EnumMemberReflection.js +15 -18
  150. package/lib/generator/analyzer/reflections/EnumMemberReflection.js.map +1 -1
  151. package/lib/generator/analyzer/reflections/EnumReflection.js +21 -23
  152. package/lib/generator/analyzer/reflections/EnumReflection.js.map +1 -1
  153. package/lib/generator/analyzer/reflections/FunctionReflection.js +14 -16
  154. package/lib/generator/analyzer/reflections/FunctionReflection.js.map +1 -1
  155. package/lib/generator/analyzer/reflections/Heritage.js +6 -11
  156. package/lib/generator/analyzer/reflections/Heritage.js.map +1 -1
  157. package/lib/generator/analyzer/reflections/InterfaceReflection.js +41 -41
  158. package/lib/generator/analyzer/reflections/InterfaceReflection.js.map +1 -1
  159. package/lib/generator/analyzer/reflections/MethodReflection.js +40 -45
  160. package/lib/generator/analyzer/reflections/MethodReflection.js.map +1 -1
  161. package/lib/generator/analyzer/reflections/ParameterReflection.js +68 -69
  162. package/lib/generator/analyzer/reflections/ParameterReflection.js.map +1 -1
  163. package/lib/generator/analyzer/reflections/PropertyReflection.js +43 -40
  164. package/lib/generator/analyzer/reflections/PropertyReflection.js.map +1 -1
  165. package/lib/generator/analyzer/reflections/ReferenceReflection.js +8 -7
  166. package/lib/generator/analyzer/reflections/ReferenceReflection.js.map +1 -1
  167. package/lib/generator/analyzer/reflections/Reflection.js +35 -38
  168. package/lib/generator/analyzer/reflections/Reflection.js.map +1 -1
  169. package/lib/generator/analyzer/reflections/SignatureReflection.js +42 -46
  170. package/lib/generator/analyzer/reflections/SignatureReflection.js.map +1 -1
  171. package/lib/generator/analyzer/reflections/SymbolBasedReflection.js +6 -13
  172. package/lib/generator/analyzer/reflections/SymbolBasedReflection.js.map +1 -1
  173. package/lib/generator/analyzer/reflections/TypeAliasReflection.js +24 -26
  174. package/lib/generator/analyzer/reflections/TypeAliasReflection.js.map +1 -1
  175. package/lib/generator/analyzer/reflections/TypeLiteralReflection.js +22 -21
  176. package/lib/generator/analyzer/reflections/TypeLiteralReflection.js.map +1 -1
  177. package/lib/generator/analyzer/reflections/TypeParameterReflection.js +38 -39
  178. package/lib/generator/analyzer/reflections/TypeParameterReflection.js.map +1 -1
  179. package/lib/generator/analyzer/types/ArrayType.js +15 -23
  180. package/lib/generator/analyzer/types/ArrayType.js.map +1 -1
  181. package/lib/generator/analyzer/types/FunctionType.js +31 -38
  182. package/lib/generator/analyzer/types/FunctionType.js.map +1 -1
  183. package/lib/generator/analyzer/types/IntersectionType.js +12 -20
  184. package/lib/generator/analyzer/types/IntersectionType.js.map +1 -1
  185. package/lib/generator/analyzer/types/IntrinsicType.js +33 -41
  186. package/lib/generator/analyzer/types/IntrinsicType.js.map +1 -1
  187. package/lib/generator/analyzer/types/LiteralType.js +60 -68
  188. package/lib/generator/analyzer/types/LiteralType.js.map +1 -1
  189. package/lib/generator/analyzer/types/NamedTupleElementType.js +11 -15
  190. package/lib/generator/analyzer/types/NamedTupleElementType.js.map +1 -1
  191. package/lib/generator/analyzer/types/ObjectLiteralType.js +21 -30
  192. package/lib/generator/analyzer/types/ObjectLiteralType.js.map +1 -1
  193. package/lib/generator/analyzer/types/OptionalType.js +11 -17
  194. package/lib/generator/analyzer/types/OptionalType.js.map +1 -1
  195. package/lib/generator/analyzer/types/ReferenceType.js +118 -133
  196. package/lib/generator/analyzer/types/ReferenceType.js.map +1 -1
  197. package/lib/generator/analyzer/types/ReflectionType.js +4 -7
  198. package/lib/generator/analyzer/types/ReflectionType.js.map +1 -1
  199. package/lib/generator/analyzer/types/TupleType.js +27 -31
  200. package/lib/generator/analyzer/types/TupleType.js.map +1 -1
  201. package/lib/generator/analyzer/types/Type.js +1 -5
  202. package/lib/generator/analyzer/types/Type.js.map +1 -1
  203. package/lib/generator/analyzer/types/TypeOperatorType.js +38 -40
  204. package/lib/generator/analyzer/types/TypeOperatorType.js.map +1 -1
  205. package/lib/generator/analyzer/types/UnionType.js +22 -30
  206. package/lib/generator/analyzer/types/UnionType.js.map +1 -1
  207. package/lib/generator/analyzer/types/UnknownType.js +5 -6
  208. package/lib/generator/analyzer/types/UnknownType.js.map +1 -1
  209. package/lib/generator/analyzer/util/expressions.js +8 -13
  210. package/lib/generator/analyzer/util/expressions.js.map +1 -1
  211. package/lib/generator/analyzer/util/functions.js +15 -19
  212. package/lib/generator/analyzer/util/functions.js.map +1 -1
  213. package/lib/generator/analyzer/util/inheritance.js +26 -32
  214. package/lib/generator/analyzer/util/inheritance.js.map +1 -1
  215. package/lib/generator/analyzer/util/promises.js +2 -9
  216. package/lib/generator/analyzer/util/promises.js.map +1 -1
  217. package/lib/generator/analyzer/util/sourceMaps.js +12 -20
  218. package/lib/generator/analyzer/util/sourceMaps.js.map +1 -1
  219. package/lib/generator/analyzer/util/symbols.js +3 -9
  220. package/lib/generator/analyzer/util/symbols.js.map +1 -1
  221. package/lib/generator/analyzer/util/types.js +6 -10
  222. package/lib/generator/analyzer/util/types.js.map +1 -1
  223. package/lib/generator/cli.js +5 -8
  224. package/lib/generator/cli.js.map +1 -1
  225. package/lib/generator/commands/default.js +260 -259
  226. package/lib/generator/commands/default.js.map +1 -1
  227. package/lib/generator/index.js +1 -1
  228. package/lib/generator/modes/Generator.js +20 -31
  229. package/lib/generator/modes/Generator.js.map +1 -1
  230. package/lib/generator/modes/HtmlGenerator.js +214 -228
  231. package/lib/generator/modes/HtmlGenerator.js.map +1 -1
  232. package/lib/generator/modes/MonorepoGenerator.js +143 -159
  233. package/lib/generator/modes/MonorepoGenerator.js.map +1 -1
  234. package/lib/generator/modes/OutputGenerator.js +2 -7
  235. package/lib/generator/modes/OutputGenerator.js.map +1 -1
  236. package/lib/progressiveEnhancement/fsMap.js +2 -5
  237. package/lib/progressiveEnhancement/fsMap.js.map +1 -1
  238. package/package.json +16 -16
  239. package/src/common/components/CodeBlock.tsx +2 -2
  240. package/src/common/components/CodeLink.tsx +2 -2
  241. package/src/common/components/DeprecationNotice.tsx +2 -2
  242. package/src/common/components/FunctionParamDesc.tsx +3 -3
  243. package/src/common/components/FunctionParamDescEntry.tsx +6 -6
  244. package/src/common/components/FunctionReturnType.tsx +3 -3
  245. package/src/common/components/FunctionSignature.tsx +2 -2
  246. package/src/common/components/InterfaceDetail.tsx +15 -7
  247. package/src/common/components/InterfaceRepresentation.tsx +9 -9
  248. package/src/common/components/MainMenu.tsx +4 -4
  249. package/src/common/components/NavMenuItem.tsx +1 -1
  250. package/src/common/components/PageArticle.tsx +2 -2
  251. package/src/common/components/SymbolHeader.tsx +7 -9
  252. package/src/common/components/TypeAliasHint.tsx +3 -5
  253. package/src/common/components/TypeLink.tsx +6 -7
  254. package/src/common/components/VersionMenu.tsx +3 -3
  255. package/src/common/components/cards/CardToolbar.tsx +10 -6
  256. package/src/common/components/cards/EventCard.tsx +19 -23
  257. package/src/common/components/cards/FunctionCardHeader.tsx +8 -8
  258. package/src/common/components/cards/MethodCard.tsx +8 -8
  259. package/src/common/components/cards/PropertyCard.tsx +11 -11
  260. package/src/common/components/codeBuilders/ReferenceTypeView.tsx +4 -4
  261. package/src/common/components/codeBuilders/Type.tsx +4 -4
  262. package/src/common/components/overviewTable/OverviewTable.tsx +2 -2
  263. package/src/common/components/overviewTable/OverviewTableEntry.tsx +7 -7
  264. package/src/common/config/Config.ts +1 -1
  265. package/src/common/config/Util.ts +11 -3
  266. package/src/common/config/index.tsx +2 -2
  267. package/src/common/containers/App.tsx +12 -9
  268. package/src/common/containers/AppLayout.tsx +2 -2
  269. package/src/common/containers/PageHeader.tsx +2 -2
  270. package/src/common/containers/PageSwitch.tsx +7 -7
  271. package/src/common/containers/ReferencePackageContainer.tsx +13 -13
  272. package/src/common/htmlRenderer/HtmlRenderer.tsx +8 -9
  273. package/src/common/htmlRenderer/StaticRouterWithSuffix.tsx +18 -21
  274. package/src/common/pages/ClassPage.tsx +17 -17
  275. package/src/common/pages/DocPage.tsx +10 -10
  276. package/src/common/pages/EnumPage.tsx +14 -14
  277. package/src/common/pages/FunctionPage.tsx +15 -15
  278. package/src/common/pages/InterfacePage.tsx +13 -13
  279. package/src/common/pages/TypeAliasPage.tsx +12 -12
  280. package/src/common/reference/index.ts +0 -1
  281. package/src/common/tools/ArrayTools.ts +27 -11
  282. package/src/common/tools/CodeTools.tsx +1 -1
  283. package/src/common/tools/ConfigTools.ts +1 -1
  284. package/src/common/tools/FunctionTools.ts +2 -3
  285. package/src/common/tools/NodeTools.ts +3 -2
  286. package/src/common/tools/ReferenceTools.ts +10 -11
  287. package/src/common/tools/StringTools.ts +1 -1
  288. package/src/common/tools/markdown/MarkdownParser.tsx +13 -15
  289. package/src/common/tools/markdown/plugins/customDirectives.ts +1 -1
  290. package/src/common/tools/markdown/plugins/symbolLinks.ts +3 -3
  291. package/src/dev/index.tsx +9 -9
  292. package/src/dev/registerServiceWorker.ts +8 -16
  293. package/src/progressiveEnhancement/fsMap.ts +0 -1
  294. package/src/progressiveEnhancement/index.tsx +9 -11
  295. package/tsconfig-dev.json +1 -6
  296. package/tsconfig-enhance.json +1 -5
  297. package/tsconfig-html.json +1 -5
  298. package/tsconfig.json +7 -21
  299. package/types/globals.d.ts +0 -1
  300. package/types/react-router-hash-link.d.ts +0 -8
@@ -1,5 +1,5 @@
1
+ import { type Nodes as MdastNodes } from 'mdast';
1
2
  import { toHast } from 'mdast-util-to-hast';
2
- import { type MdastNodes } from 'mdast-util-to-hast/lib';
3
3
  import remarkDirective from 'remark-directive';
4
4
  import type { Processor, Transformer } from 'unified';
5
5
  import type { Node } from 'unist';
@@ -2,9 +2,9 @@ import type { Content, Link, Text } from 'mdast';
2
2
  import type { Transformer } from 'unified';
3
3
  import type { Parent } from 'unist';
4
4
  import { visit } from 'unist-util-visit';
5
- import { getPageType } from '../../CodeTools';
6
- import { findSymbolByMember } from '../../ReferenceTools';
7
- import { getPackagePath } from '../../StringTools';
5
+ import { getPageType } from '../../CodeTools.js';
6
+ import { findSymbolByMember } from '../../ReferenceTools.js';
7
+ import { getPackagePath } from '../../StringTools.js';
8
8
 
9
9
  function insertAt(array: Parent['children'], index: number, ...items: Content[]): Parent['children'] {
10
10
  return [...array.slice(0, index), ...items, ...array.slice(index)];
package/src/dev/index.tsx CHANGED
@@ -3,14 +3,13 @@ import js from '@d-fischer/react-syntax-highlighter/dist/esm/languages/hljs/java
3
3
  import json from '@d-fischer/react-syntax-highlighter/dist/esm/languages/hljs/json';
4
4
  import ts from '@d-fischer/react-syntax-highlighter/dist/esm/languages/hljs/typescript';
5
5
  import { ThemeProvider } from '@mui/styles';
6
- import React from 'react';
7
- import ReactDOM from 'react-dom';
8
- import { BrowserRouter, HashRouter } from 'react-router-dom';
6
+ import { createRoot } from 'react-dom/client';
7
+ import { BrowserRouter, HashRouter } from 'react-router';
9
8
 
10
- import App from '../common/containers/App';
11
- import theme from '../common/theme';
9
+ import App from '../common/containers/App.js';
10
+ import theme from '../common/theme.js';
12
11
 
13
- import registerServiceWorker from './registerServiceWorker';
12
+ import registerServiceWorker from './registerServiceWorker.js';
14
13
 
15
14
  const Router = process.env.SUPPORTS_DYNAMIC_ROUTING ? BrowserRouter : HashRouter;
16
15
 
@@ -20,13 +19,14 @@ SyntaxHighlighter.registerLanguage('json', json);
20
19
  SyntaxHighlighter.registerLanguage('typescript', ts);
21
20
  SyntaxHighlighter.registerLanguage('ts', ts);
22
21
 
23
- ReactDOM.render(
22
+ const root = createRoot(document.getElementById('app-root'));
23
+
24
+ root.render(
24
25
  <ThemeProvider theme={theme}>
25
26
  <Router>
26
27
  <App />
27
28
  </Router>
28
- </ThemeProvider>,
29
- document.getElementById('app-root')
29
+ </ThemeProvider>
30
30
  );
31
31
 
32
32
  // eslint-disable-next-line no-console
@@ -1,4 +1,4 @@
1
- /* eslint-disable no-console,consistent-return */
1
+ /* eslint-disable no-console */
2
2
  // In production, we register a service worker to serve assets from local cache.
3
3
 
4
4
  // This lets the app load faster on subsequent visits in production, and gives
@@ -11,10 +11,10 @@
11
11
 
12
12
  const isLocalhost = Boolean(
13
13
  window.location.hostname === 'localhost' ||
14
- // [::1] is the IPv6 localhost address.
15
- window.location.hostname === '[::1]' ||
16
- // 127.0.0.1/8 is considered localhost for IPv4.
17
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/.exec(window.location.hostname)
14
+ // [::1] is the IPv6 localhost address.
15
+ window.location.hostname === '[::1]' ||
16
+ // 127.0.0.1/8 is considered localhost for IPv4.
17
+ /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/.exec(window.location.hostname)
18
18
  );
19
19
 
20
20
  async function registerValidServiceWorker(swUrl: string) {
@@ -53,10 +53,7 @@ async function checkValidServiceWorker(swUrl: string) {
53
53
  // Check if the service worker can be found. If it can't, reload the page.
54
54
  const response = await fetch(swUrl);
55
55
  // Ensure service worker exists, and that we really are getting a JS file.
56
- if (
57
- response.status === 404 ||
58
- !response.headers.get('content-type')!.includes('javascript')
59
- ) {
56
+ if (response.status === 404 || !response.headers.get('content-type')!.includes('javascript')) {
60
57
  // No service worker found. Probably a different app. Reload the page.
61
58
  const registration = await navigator.serviceWorker.ready;
62
59
  await registration.unregister();
@@ -66,9 +63,7 @@ async function checkValidServiceWorker(swUrl: string) {
66
63
  await registerValidServiceWorker(swUrl);
67
64
  }
68
65
  } catch (e) {
69
- console.log(
70
- 'No internet connection found. App is running in offline mode.'
71
- );
66
+ console.log('No internet connection found. App is running in offline mode.');
72
67
  }
73
68
  }
74
69
 
@@ -76,10 +71,7 @@ export default async function registerServiceWorker() {
76
71
  await new Promise<void>((resolve, reject) => {
77
72
  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
78
73
  // The URL constructor is available in all browsers that support SW.
79
- const publicUrl = new URL(
80
- process.env.PUBLIC_URL!,
81
- window.location.toString()
82
- );
74
+ const publicUrl = new URL(process.env.PUBLIC_URL!, window.location.toString());
83
75
  if (publicUrl.origin !== window.location.origin) {
84
76
  // Our service worker won't work if PUBLIC_URL is on a different origin
85
77
  // from what our page is served on. This might happen if a CDN is used to
@@ -1,4 +1,3 @@
1
- // eslint-disable-next-line @typescript-eslint/naming-convention
2
1
  declare const __DOCTS_FSMAP: Array<[string, string]>;
3
2
  export const fsMap = new Map(__DOCTS_FSMAP);
4
3
 
@@ -1,15 +1,13 @@
1
1
  import { createGenerateClassName, StylesProvider, ThemeProvider } from '@mui/styles';
2
- import * as React from 'react';
3
- import * as ReactDOM from 'react-dom';
4
- import { CodeBlock } from '../common/components/CodeBlock';
5
- import VersionMenu from '../common/components/VersionMenu';
6
- import theme from '../common/theme';
2
+ import { CodeBlock } from '../common/components/CodeBlock.js';
3
+ import VersionMenu from '../common/components/VersionMenu.js';
4
+ import theme from '../common/theme.js';
5
+ import { type ComponentType } from 'react';
6
+ import { createRoot } from 'react-dom/client';
7
7
 
8
8
  const registeredComponents = {
9
- /* eslint-disable @typescript-eslint/naming-convention */
10
9
  CodeBlock,
11
10
  VersionMenu
12
- /* eslint-enable @typescript-eslint/naming-convention */
13
11
  };
14
12
 
15
13
  const generateClassName = createGenerateClassName({
@@ -17,16 +15,16 @@ const generateClassName = createGenerateClassName({
17
15
  });
18
16
 
19
17
  for (const elem of document.querySelectorAll<HTMLElement>('[data-dynamic-component]')) {
20
- const Component = registeredComponents[elem.dataset.dynamicComponent!] as React.ComponentType | undefined;
18
+ const Component = registeredComponents[elem.dataset.dynamicComponent!] as ComponentType | undefined;
21
19
  if (Component) {
22
20
  const props = JSON.parse(elem.dataset.componentProps ?? '{}') as JSX.IntrinsicAttributes;
23
- ReactDOM.render(
21
+ const root = createRoot(elem);
22
+ root.render(
24
23
  <StylesProvider generateClassName={generateClassName}>
25
24
  <ThemeProvider theme={theme}>
26
25
  <Component {...props} />
27
26
  </ThemeProvider>
28
- </StylesProvider>,
29
- elem
27
+ </StylesProvider>
30
28
  );
31
29
  }
32
30
  }
package/tsconfig-dev.json CHANGED
@@ -1,12 +1,7 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
3
  "outDir": "tmp",
4
- "include": [
5
- "types",
6
- "src/common",
7
- "src/dev",
8
- "vite.config.dev.ts"
9
- ],
4
+ "include": ["types", "src/common", "src/dev", "vite.config.dev.ts"],
10
5
  "compilerOptions": {
11
6
  "importHelpers": false
12
7
  }
@@ -1,10 +1,6 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "include": [
4
- "types",
5
- "src/common",
6
- "src/progressiveEnhancement"
7
- ],
3
+ "include": ["types", "src/common", "src/progressiveEnhancement"],
8
4
  "compilerOptions": {
9
5
  "module": "esnext"
10
6
  }
@@ -1,10 +1,6 @@
1
1
  {
2
2
  "extends": "./tsconfig.json",
3
- "include": [
4
- "types",
5
- "src/common",
6
- "src/html"
7
- ],
3
+ "include": ["types", "src/common", "src/html"],
8
4
  "compilerOptions": {
9
5
  "importHelpers": false
10
6
  }
package/tsconfig.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "outDir": "lib",
4
- "module": "commonjs",
5
- "target": "es6",
6
- "lib": [
7
- "dom",
8
- "dom.iterable",
9
- "es2019"
10
- ],
4
+ "module": "node16",
5
+ "moduleResolution": "node16",
6
+ "target": "es2022",
7
+ "lib": ["dom", "dom.iterable", "es2022"],
11
8
  "sourceMap": true,
12
9
  "allowJs": true,
13
- "jsx": "react",
14
- "moduleResolution": "node",
10
+ "jsx": "react-jsx",
15
11
  "rootDir": "src",
16
12
  "forceConsistentCasingInFileNames": true,
17
13
  "strict": true,
@@ -22,16 +18,6 @@
22
18
  "esModuleInterop": true,
23
19
  "skipLibCheck": true
24
20
  },
25
- "include": [
26
- "types",
27
- "src/common",
28
- "src/generator"
29
- ],
30
- "exclude": [
31
- "node_modules",
32
- "build",
33
- "scripts",
34
- "config",
35
- "vite.config.dev.ts"
36
- ]
21
+ "include": ["types", "src/common", "src/generator"],
22
+ "exclude": ["node_modules", "build", "scripts", "config", "vite.config.dev.ts"]
37
23
  }
@@ -1,2 +1 @@
1
- // eslint-disable-next-line @typescript-eslint/naming-convention
2
1
  declare const __DOCTS_COMPONENT_MODE: 'static' | 'dynamic';
@@ -1,8 +0,0 @@
1
- declare module 'react-router-hash-link' {
2
- import type { LinkProps, NavLinkProps } from 'react-router-dom';
3
-
4
- const HashLink: React.ComponentType<LinkProps>;
5
- const NavHashLink: React.ComponentType<NavLinkProps>;
6
-
7
- export { HashLink, NavHashLink };
8
- }