@clidey/dory 0.30.0 → 0.31.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 (74) hide show
  1. package/bin/dist/dory.js +1 -8
  2. package/bin/dist/dory.js.map +1 -1
  3. package/index.html +54 -0
  4. package/package.json +12 -4
  5. package/src/app.css +5 -0
  6. package/src/app.tsx +13 -0
  7. package/src/components/dropdown.tsx +53 -0
  8. package/src/components/hooks.tsx +36 -0
  9. package/src/components/loading.tsx +21 -0
  10. package/src/components/mdx-provider.tsx +13 -0
  11. package/src/components/navigation.tsx +58 -0
  12. package/src/components/notification.tsx +13 -0
  13. package/src/components/routes.tsx +92 -0
  14. package/src/components/search-index.ts +43 -0
  15. package/src/components/search.tsx +448 -0
  16. package/src/components/store.ts +216 -0
  17. package/src/config/mdx.js +12 -0
  18. package/src/config/mdx.ts +12 -0
  19. package/src/embed/loader.ts +200 -0
  20. package/src/embed/types.ts +54 -0
  21. package/src/embed/widget-iframe.ts +302 -0
  22. package/src/main.tsx +22 -0
  23. package/src/mdx/accordion.tsx +41 -0
  24. package/src/mdx/api-playground.tsx +659 -0
  25. package/src/mdx/api.tsx +354 -0
  26. package/src/mdx/async-api.tsx +353 -0
  27. package/src/mdx/callout.tsx +64 -0
  28. package/src/mdx/card.tsx +54 -0
  29. package/src/mdx/code.tsx +289 -0
  30. package/src/mdx/expandable.tsx +36 -0
  31. package/src/mdx/fence.tsx +74 -0
  32. package/src/mdx/icon.tsx +73 -0
  33. package/src/mdx/latex.tsx +26 -0
  34. package/src/mdx/list.tsx +7 -0
  35. package/src/mdx/mdx.tsx +47 -0
  36. package/src/mdx/mermaid.tsx +147 -0
  37. package/src/mdx/open-api.tsx +311 -0
  38. package/src/mdx/processor.ts +174 -0
  39. package/src/mdx/source.tsx +58 -0
  40. package/src/mdx/step.tsx +51 -0
  41. package/src/mdx/table.tsx +20 -0
  42. package/src/mdx/tag.tsx +53 -0
  43. package/src/mdx/text.tsx +99 -0
  44. package/src/mdx/websocket-playground.tsx +824 -0
  45. package/src/plugins/docs-assets.ts +79 -0
  46. package/src/plugins/frontmatter-dev-server.ts +158 -0
  47. package/src/plugins/frontmatter-generator.ts +157 -0
  48. package/src/plugins/html-files-middleware.ts +108 -0
  49. package/src/plugins/html-metadata-injector.ts +76 -0
  50. package/src/plugins/llm-txt-dev-server.ts +183 -0
  51. package/src/plugins/llm-txt-generator.ts +186 -0
  52. package/src/plugins/sanitize.ts +163 -0
  53. package/src/plugins/unified-mdx-plugin.ts +35 -0
  54. package/src/sdk/index.ts +89 -0
  55. package/src/sdk/react.tsx +139 -0
  56. package/src/sdk/vue.ts +107 -0
  57. package/src/theme.scss +72 -0
  58. package/src/types/config.ts +89 -0
  59. package/src/ui/header.tsx +96 -0
  60. package/src/ui/layout.tsx +237 -0
  61. package/src/ui/mobile-navigation.tsx +72 -0
  62. package/src/ui/prev-next-link.tsx +74 -0
  63. package/src/ui/table-of-content.tsx +167 -0
  64. package/src/utils/colors.ts +54 -0
  65. package/src/utils/fonts.ts +23 -0
  66. package/src/utils/functions.ts +12 -0
  67. package/src/vite-env.d.ts +1 -0
  68. package/tsconfig.app.json +33 -0
  69. package/tsconfig.bin.json +25 -0
  70. package/tsconfig.json +7 -0
  71. package/tsconfig.node.json +26 -0
  72. package/vite.config.embed-loader.ts +28 -0
  73. package/vite.config.embed-widget.ts +31 -0
  74. package/vite.config.ts +45 -0
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["ES2023"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "node",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "noEmit": false,
13
+ "outDir": "./bin/dist",
14
+ "rootDir": "./bin",
15
+ "declaration": true,
16
+ "declarationMap": true,
17
+ "sourceMap": true
18
+ },
19
+ "include": [
20
+ "bin/**/*.ts"
21
+ ],
22
+ "exclude": [
23
+ "bin/dist"
24
+ ]
25
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+ "types": ["node"],
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts", "src/plugins/**/*.ts", "bin/**/*.ts"]
26
+ }
@@ -0,0 +1,28 @@
1
+ import { defineConfig } from 'vite';
2
+ import { resolve } from 'path';
3
+
4
+ export default defineConfig({
5
+ build: {
6
+ rollupOptions: {
7
+ input: resolve(__dirname, 'src/embed/loader.ts'),
8
+ output: {
9
+ entryFileNames: 'embed.js',
10
+ format: 'iife',
11
+ inlineDynamicImports: true,
12
+ },
13
+ },
14
+ outDir: 'dist',
15
+ emptyOutDir: false,
16
+ minify: 'terser',
17
+ terserOptions: {
18
+ compress: {
19
+ drop_console: false, // Keep console for user feedback
20
+ drop_debugger: true,
21
+ pure_funcs: ['console.debug'],
22
+ },
23
+ mangle: {
24
+ safari10: true,
25
+ },
26
+ },
27
+ },
28
+ });
@@ -0,0 +1,31 @@
1
+ import { defineConfig } from 'vite';
2
+ import { resolve } from 'path';
3
+
4
+ export default defineConfig({
5
+ build: {
6
+ lib: {
7
+ entry: resolve(__dirname, 'src/embed/widget-iframe.ts'),
8
+ name: '__DoryWidget__',
9
+ fileName: () => 'embed-widget.js',
10
+ formats: ['es'],
11
+ },
12
+ outDir: 'dist',
13
+ emptyOutDir: false,
14
+ minify: 'terser',
15
+ terserOptions: {
16
+ compress: {
17
+ drop_console: false,
18
+ drop_debugger: true,
19
+ },
20
+ mangle: {
21
+ safari10: true,
22
+ },
23
+ },
24
+ rollupOptions: {
25
+ output: {
26
+ format: 'es',
27
+ inlineDynamicImports: false,
28
+ },
29
+ },
30
+ },
31
+ });
package/vite.config.ts ADDED
@@ -0,0 +1,45 @@
1
+ import { defineConfig } from 'vite';
2
+ import preact from '@preact/preset-vite';
3
+ import mdx from '@mdx-js/rollup';
4
+ import tailwindcss from '@tailwindcss/vite'
5
+ import { unifiedMdxPreprocessor } from './src/plugins/unified-mdx-plugin';
6
+ import { llmTxtGenerator } from './src/plugins/llm-txt-generator';
7
+ import { llmTxtDevServer } from './src/plugins/llm-txt-dev-server';
8
+ import { frontmatterGenerator } from './src/plugins/frontmatter-generator';
9
+ import { frontmatterDevServer } from './src/plugins/frontmatter-dev-server';
10
+ import { docsAssetsPlugin } from './src/plugins/docs-assets';
11
+ import { htmlMetadataInjector } from './src/plugins/html-metadata-injector';
12
+ import { htmlFilesMiddleware } from './src/plugins/html-files-middleware';
13
+ import { getMdxConfig } from './src/config/mdx';
14
+
15
+ export default defineConfig(({ command }) => ({
16
+ plugins: [
17
+ // SINGLE SOURCE OF TRUTH: All MDX preprocessing happens in src/mdx/processor.ts
18
+ htmlFilesMiddleware(), // Must be first to intercept HTML file requests
19
+ unifiedMdxPreprocessor(),
20
+ preact(),
21
+ mdx(getMdxConfig(command === 'serve')),
22
+ tailwindcss(),
23
+ llmTxtGenerator(),
24
+ llmTxtDevServer(),
25
+ frontmatterGenerator(),
26
+ frontmatterDevServer(),
27
+ docsAssetsPlugin(),
28
+ htmlMetadataInjector(),
29
+ ],
30
+ resolve: {
31
+ alias: {
32
+ react: 'preact/compat',
33
+ 'react-dom': 'preact/compat'
34
+ }
35
+ },
36
+ publicDir: false, // Don't use a public directory since we need to import from docs
37
+ server: {
38
+ allowedHosts: true,
39
+ port: 3000,
40
+ strictPort: false,
41
+ },
42
+ json: {
43
+ stringify: false
44
+ },
45
+ }));