polen 0.10.0-next.14 → 0.10.0-next.4
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/README.md +1 -2
- package/build/api/builder/builder.js +1 -1
- package/build/api/builder/builder.js.map +1 -1
- package/build/api/config/load.js +6 -6
- package/build/api/config/load.js.map +1 -1
- package/build/api/config-resolver/resolve.js +2 -2
- package/build/api/config-resolver/resolve.js.map +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
- package/build/api/vite/plugins/branding/index.js +4 -4
- package/build/api/vite/plugins/branding/index.js.map +1 -1
- package/build/api/vite/plugins/build.d.ts.map +1 -1
- package/build/api/vite/plugins/build.js +4 -12
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts +2 -2
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +13 -13
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/pages.d.ts +14 -8
- package/build/api/vite/plugins/pages.d.ts.map +1 -1
- package/build/api/vite/plugins/pages.js +185 -111
- package/build/api/vite/plugins/pages.js.map +1 -1
- package/build/api/vite/plugins/serve.d.ts.map +1 -1
- package/build/api/vite/plugins/serve.js +12 -52
- package/build/api/vite/plugins/serve.js.map +1 -1
- package/build/cli/_/self-contained-mode.js +5 -5
- package/build/cli/_/self-contained-mode.js.map +1 -1
- package/build/lib/demos/config-schema.d.ts +20 -20
- package/build/lib/file-router/diagnostic-reporter.js +2 -2
- package/build/lib/file-router/diagnostic-reporter.js.map +1 -1
- package/build/lib/file-router/file-router.d.ts +2 -0
- package/build/lib/file-router/file-router.d.ts.map +1 -1
- package/build/lib/file-router/file-router.js +2 -0
- package/build/lib/file-router/file-router.js.map +1 -1
- package/build/lib/file-router/route.d.ts +0 -2
- package/build/lib/file-router/route.d.ts.map +1 -1
- package/build/lib/file-router/route.js.map +1 -1
- package/build/lib/file-router/scan-tree.d.ts +20 -0
- package/build/lib/file-router/scan-tree.d.ts.map +1 -0
- package/build/lib/file-router/scan-tree.js +158 -0
- package/build/lib/file-router/scan-tree.js.map +1 -0
- package/build/lib/file-router/scan.d.ts.map +1 -1
- package/build/lib/file-router/scan.js +13 -22
- package/build/lib/file-router/scan.js.map +1 -1
- package/build/lib/file-router/sidebar/index.d.ts +3 -0
- package/build/lib/file-router/sidebar/index.d.ts.map +1 -0
- package/build/lib/file-router/sidebar/index.js +4 -0
- package/build/lib/file-router/sidebar/index.js.map +1 -0
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts +9 -0
- package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +1 -0
- package/build/lib/file-router/sidebar/sidebar-tree.js +85 -0
- package/build/lib/file-router/sidebar/sidebar-tree.js.map +1 -0
- package/build/lib/file-router/sidebar/types.d.ts +17 -0
- package/build/lib/file-router/sidebar/types.d.ts.map +1 -0
- package/build/lib/file-router/sidebar/types.js.map +1 -0
- package/build/lib/github-actions/runner.js +2 -2
- package/build/lib/github-actions/runner.js.map +1 -1
- package/build/lib/github-actions/schemas/context.d.ts +2 -2
- package/build/lib/kit-temp.d.ts +0 -103
- package/build/lib/kit-temp.d.ts.map +1 -1
- package/build/lib/kit-temp.js +3 -239
- package/build/lib/kit-temp.js.map +1 -1
- package/build/lib/tree/index.d.ts +3 -0
- package/build/lib/tree/index.d.ts.map +1 -0
- package/build/lib/tree/index.js +2 -0
- package/build/lib/tree/index.js.map +1 -0
- package/build/lib/tree/tree.d.ts +62 -0
- package/build/lib/tree/tree.d.ts.map +1 -0
- package/build/lib/tree/tree.js +134 -0
- package/build/lib/tree/tree.js.map +1 -0
- package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.d.ts +8 -1
- package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.d.ts.map +1 -1
- package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.js +53 -48
- package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.js.map +1 -1
- package/build/package-paths.js +3 -3
- package/build/package-paths.js.map +1 -1
- package/build/sandbox.js +2 -17
- package/build/sandbox.js.map +1 -1
- package/build/singletons/debug.d.ts +1 -1
- package/build/singletons/debug.d.ts.map +1 -1
- package/build/singletons/debug.js +1 -1
- package/build/singletons/debug.js.map +1 -1
- package/build/template/components/ArgumentAnnotation.jsx +16 -0
- package/build/template/components/ArgumentAnnotation.jsx.map +1 -0
- package/build/template/components/ArgumentList.jsx +16 -0
- package/build/template/components/ArgumentList.jsx.map +1 -0
- package/build/template/components/ArgumentListAnnotation.jsx +23 -0
- package/build/template/components/ArgumentListAnnotation.jsx.map +1 -0
- package/build/template/components/Changelog.jsx +68 -0
- package/build/template/components/Changelog.jsx.map +1 -0
- package/build/template/components/{CodeBlock.js → CodeBlock.jsx} +5 -4
- package/build/template/components/{CodeBlock.js.map → CodeBlock.jsx.map} +1 -1
- package/build/template/components/DeprecationReason.jsx +10 -0
- package/build/template/components/DeprecationReason.jsx.map +1 -0
- package/build/template/components/Description.jsx +10 -0
- package/build/template/components/Description.jsx.map +1 -0
- package/build/template/components/Field.jsx +22 -0
- package/build/template/components/Field.jsx.map +1 -0
- package/build/template/components/{FieldList.js → FieldList.jsx} +5 -4
- package/build/template/components/FieldList.jsx.map +1 -0
- package/build/template/components/{FieldListSection.js → FieldListSection.jsx} +6 -4
- package/build/template/components/FieldListSection.jsx.map +1 -0
- package/build/template/components/Link.d.ts +2 -2
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/{Link.js → Link.jsx} +9 -17
- package/build/template/components/Link.jsx.map +1 -0
- package/build/template/components/Logo.jsx +29 -0
- package/build/template/components/Logo.jsx.map +1 -0
- package/build/template/components/{Markdown.js → Markdown.jsx} +2 -3
- package/build/template/components/Markdown.jsx.map +1 -0
- package/build/template/components/MissingSchema.d.ts +1 -1
- package/build/template/components/MissingSchema.d.ts.map +1 -1
- package/build/template/components/MissingSchema.jsx +4 -0
- package/build/template/components/MissingSchema.jsx.map +1 -0
- package/build/template/components/NamedType.jsx +17 -0
- package/build/template/components/NamedType.jsx.map +1 -0
- package/build/template/components/{RadixLink.js → RadixLink.jsx} +1 -1
- package/build/template/components/RadixLink.jsx.map +1 -0
- package/build/template/components/Texts/{MinorHeading.js → MinorHeading.jsx} +3 -4
- package/build/template/components/Texts/MinorHeading.jsx.map +1 -0
- package/build/template/components/Texts/texts.js +1 -1
- package/build/template/components/Texts/texts.js.map +1 -1
- package/build/template/components/{TypeAnnotation.js → TypeAnnotation.jsx} +18 -8
- package/build/template/components/TypeAnnotation.jsx.map +1 -0
- package/build/template/components/TypeFieldsLinkList.jsx +17 -0
- package/build/template/components/TypeFieldsLinkList.jsx.map +1 -0
- package/build/template/components/TypeIndex.jsx +27 -0
- package/build/template/components/TypeIndex.jsx.map +1 -0
- package/build/template/components/graphql/graphql.d.ts +2 -2
- package/build/template/components/graphql/graphql.jsx +3 -0
- package/build/template/components/graphql/graphql.jsx.map +1 -0
- package/build/template/components/graphql/index.d.ts +1 -1
- package/build/template/components/graphql/index.js +1 -1
- package/build/template/components/graphql/index.js.map +1 -1
- package/build/template/components/graphql/{type-kind-icon.js → type-kind-icon.jsx} +2 -3
- package/build/template/components/graphql/type-kind-icon.jsx.map +1 -0
- package/build/template/components/graphql/type-link.jsx +16 -0
- package/build/template/components/graphql/type-link.jsx.map +1 -0
- package/build/template/components/sidebar/Sidebar.d.ts +3 -3
- package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
- package/build/template/components/sidebar/Sidebar.jsx +15 -0
- package/build/template/components/sidebar/Sidebar.jsx.map +1 -0
- package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/{SidebarItem.js → SidebarItem.jsx} +35 -18
- package/build/template/components/sidebar/SidebarItem.jsx.map +1 -0
- package/build/template/components/sidebar/ToggleButton.d.ts +1 -1
- package/build/template/components/sidebar/ToggleButton.d.ts.map +1 -1
- package/build/template/components/sidebar/ToggleButton.jsx +6 -0
- package/build/template/components/sidebar/ToggleButton.jsx.map +1 -0
- package/build/template/entry.client.d.ts +0 -1
- package/build/template/entry.client.d.ts.map +1 -1
- package/build/template/{entry.client.js → entry.client.jsx} +9 -5
- package/build/template/entry.client.jsx.map +1 -0
- package/build/template/routes/changelog.d.ts +1 -1
- package/build/template/routes/{changelog.js → changelog.jsx} +4 -5
- package/build/template/routes/changelog.jsx.map +1 -0
- package/build/template/routes/{index.js → index.jsx} +2 -3
- package/build/template/routes/index.jsx.map +1 -0
- package/build/template/routes/reference.$type.$field.d.ts +1 -1
- package/build/template/routes/{reference.$type.$field.js → reference.$type.$field.jsx} +5 -6
- package/build/template/routes/reference.$type.$field.jsx.map +1 -0
- package/build/template/routes/reference.$type.d.ts +1 -1
- package/build/template/routes/{reference.$type.js → reference.$type.jsx} +5 -6
- package/build/template/routes/reference.$type.jsx.map +1 -0
- package/build/template/routes/reference.d.ts +2 -2
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/{reference.js → reference.jsx} +12 -7
- package/build/template/routes/reference.jsx.map +1 -0
- package/build/template/routes/root.d.ts +2 -2
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +188 -0
- package/build/template/routes/root.jsx.map +1 -0
- package/build/template/routes.jsx +5 -0
- package/build/template/routes.jsx.map +1 -0
- package/build/template/server/app.d.ts +1 -8
- package/build/template/server/app.d.ts.map +1 -1
- package/build/template/server/app.js +21 -21
- package/build/template/server/app.js.map +1 -1
- package/build/template/server/main.js +1 -2
- package/build/template/server/main.js.map +1 -1
- package/build/template/server/render-page.d.ts +3 -0
- package/build/template/server/render-page.d.ts.map +1 -0
- package/build/template/server/{create-page-html-response.js → render-page.jsx} +17 -11
- package/build/template/server/render-page.jsx.map +1 -0
- package/build/template/server/ssg/generate.d.ts.map +1 -1
- package/build/template/server/ssg/generate.js +34 -33
- package/build/template/server/ssg/generate.js.map +1 -1
- package/build/template/server/ssg/get-route-paths.js +1 -1
- package/build/template/server/ssg/get-route-paths.js.map +1 -1
- package/build/template/server/view.js +1 -1
- package/build/template/server/view.js.map +1 -1
- package/package.json +9 -66
- package/src/api/config/load.ts +5 -5
- package/src/api/config-resolver/resolve.ts +2 -2
- package/src/api/schema/data-sources/schema-directory/schema-directory.ts +1 -1
- package/src/api/singletons/markdown/markdown.test.ts +1 -1
- package/src/api/vite/plugins/branding/index.ts +4 -4
- package/src/api/vite/plugins/build.ts +89 -97
- package/src/api/vite/plugins/core.ts +16 -18
- package/src/api/vite/plugins/pages.ts +209 -135
- package/src/api/vite/plugins/serve.ts +14 -67
- package/src/cli/_/self-contained-mode.ts +5 -5
- package/src/lib/deployment/$$.ts +1 -1
- package/src/lib/deployment/$.test.ts +3 -3
- package/src/lib/deployment/$.ts +1 -1
- package/src/lib/file-router/diagnostic-reporter.ts +2 -2
- package/src/lib/file-router/file-router.ts +2 -0
- package/src/lib/file-router/linter.test.ts +0 -2
- package/src/lib/file-router/route.ts +0 -2
- package/src/lib/file-router/scan-tree.test.ts +189 -0
- package/src/lib/file-router/scan-tree.ts +205 -0
- package/src/lib/file-router/scan.ts +14 -26
- package/src/lib/file-router/sidebar/index.ts +3 -0
- package/src/lib/file-router/sidebar/sidebar-tree.test.ts +123 -0
- package/src/lib/file-router/sidebar/sidebar-tree.ts +110 -0
- package/src/lib/file-router/sidebar/types.ts +19 -0
- package/src/lib/kit-temp.test.ts +7 -19
- package/src/lib/kit-temp.ts +5 -307
- package/src/lib/task/$.test.ts +3 -3
- package/src/lib/tree/index.ts +2 -0
- package/src/lib/tree/tree.test.ts +117 -0
- package/src/lib/tree/tree.ts +183 -0
- package/src/lib/version-history/index.test.ts +4 -12
- package/src/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.ts +58 -52
- package/src/package-paths.ts +3 -3
- package/src/sandbox.ts +1 -20
- package/src/singletons/debug.ts +1 -1
- package/src/template/components/ArgumentAnnotation.tsx +1 -1
- package/src/template/components/ArgumentList.tsx +1 -1
- package/src/template/components/ArgumentListAnnotation.tsx +2 -2
- package/src/template/components/DeprecationReason.tsx +1 -1
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/Field.tsx +4 -4
- package/src/template/components/FieldList.tsx +1 -1
- package/src/template/components/FieldListSection.tsx +1 -1
- package/src/template/components/Link.tsx +14 -22
- package/src/template/components/NamedType.tsx +2 -2
- package/src/template/components/TypeAnnotation.tsx +1 -1
- package/src/template/components/TypeFieldsLinkList.tsx +1 -1
- package/src/template/components/TypeIndex.tsx +1 -1
- package/src/template/components/graphql/graphql.tsx +2 -2
- package/src/template/components/graphql/index.ts +1 -1
- package/src/template/components/graphql/type-link.tsx +2 -2
- package/src/template/components/sidebar/Sidebar.tsx +2 -2
- package/src/template/components/sidebar/SidebarItem.tsx +14 -14
- package/src/template/entry.client.tsx +5 -2
- package/src/template/routes/changelog.tsx +1 -1
- package/src/template/routes/reference.$type.$field.tsx +3 -3
- package/src/template/routes/reference.$type.tsx +3 -3
- package/src/template/routes/reference.tsx +10 -6
- package/src/template/routes/root.tsx +108 -112
- package/src/template/routes.tsx +1 -1
- package/src/template/server/app.ts +23 -33
- package/src/template/server/main.ts +1 -2
- package/src/template/server/{create-page-html-response.ts → render-page.tsx} +16 -19
- package/src/template/server/ssg/generate.ts +72 -68
- package/src/template/server/ssg/get-route-paths.ts +1 -1
- package/src/template/server/view.ts +1 -1
- package/src/template/styles/code-block.css +0 -32
- package/build/api/content/$$.d.ts +0 -7
- package/build/api/content/$$.d.ts.map +0 -1
- package/build/api/content/$$.js +0 -7
- package/build/api/content/$$.js.map +0 -1
- package/build/api/content/$.d.ts +0 -2
- package/build/api/content/$.d.ts.map +0 -1
- package/build/api/content/$.js +0 -2
- package/build/api/content/$.js.map +0 -1
- package/build/api/content/metadata.d.ts +0 -10
- package/build/api/content/metadata.d.ts.map +0 -1
- package/build/api/content/metadata.js +0 -9
- package/build/api/content/metadata.js.map +0 -1
- package/build/api/content/navbar.d.ts +0 -10
- package/build/api/content/navbar.d.ts.map +0 -1
- package/build/api/content/navbar.js +0 -45
- package/build/api/content/navbar.js.map +0 -1
- package/build/api/content/page.d.ts +0 -11
- package/build/api/content/page.d.ts.map +0 -1
- package/build/api/content/page.js +0 -2
- package/build/api/content/page.js.map +0 -1
- package/build/api/content/scan.d.ts +0 -19
- package/build/api/content/scan.d.ts.map +0 -1
- package/build/api/content/scan.js +0 -90
- package/build/api/content/scan.js.map +0 -1
- package/build/api/content/sidebar.d.ts +0 -104
- package/build/api/content/sidebar.d.ts.map +0 -1
- package/build/api/content/sidebar.js +0 -166
- package/build/api/content/sidebar.js.map +0 -1
- package/build/api/content/utils.d.ts +0 -5
- package/build/api/content/utils.d.ts.map +0 -1
- package/build/api/content/utils.js +0 -8
- package/build/api/content/utils.js.map +0 -1
- package/build/exports/components.d.ts +0 -5
- package/build/exports/components.d.ts.map +0 -1
- package/build/exports/components.js +0 -5
- package/build/exports/components.js.map +0 -1
- package/build/lib/graphql-document/$$.d.ts +0 -5
- package/build/lib/graphql-document/$$.d.ts.map +0 -1
- package/build/lib/graphql-document/$$.js +0 -5
- package/build/lib/graphql-document/$$.js.map +0 -1
- package/build/lib/graphql-document/$.d.ts +0 -2
- package/build/lib/graphql-document/$.d.ts.map +0 -1
- package/build/lib/graphql-document/$.js +0 -2
- package/build/lib/graphql-document/$.js.map +0 -1
- package/build/lib/graphql-document/analysis.d.ts +0 -44
- package/build/lib/graphql-document/analysis.d.ts.map +0 -1
- package/build/lib/graphql-document/analysis.js +0 -361
- package/build/lib/graphql-document/analysis.js.map +0 -1
- package/build/lib/graphql-document/components/CopyButton.d.ts +0 -19
- package/build/lib/graphql-document/components/CopyButton.d.ts.map +0 -1
- package/build/lib/graphql-document/components/CopyButton.js +0 -43
- package/build/lib/graphql-document/components/CopyButton.js.map +0 -1
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts +0 -38
- package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +0 -1
- package/build/lib/graphql-document/components/GraphQLDocument.js +0 -142
- package/build/lib/graphql-document/components/GraphQLDocument.js.map +0 -1
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +0 -7
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +0 -1
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +0 -45
- package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +0 -1
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +0 -33
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +0 -1
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +0 -48
- package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +0 -1
- package/build/lib/graphql-document/components/IdentifierLink.d.ts +0 -39
- package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +0 -1
- package/build/lib/graphql-document/components/IdentifierLink.js +0 -75
- package/build/lib/graphql-document/components/IdentifierLink.js.map +0 -1
- package/build/lib/graphql-document/components/graphql-document-styles.d.ts +0 -5
- package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +0 -1
- package/build/lib/graphql-document/components/graphql-document-styles.js +0 -167
- package/build/lib/graphql-document/components/graphql-document-styles.js.map +0 -1
- package/build/lib/graphql-document/components/index.d.ts +0 -6
- package/build/lib/graphql-document/components/index.d.ts.map +0 -1
- package/build/lib/graphql-document/components/index.js +0 -6
- package/build/lib/graphql-document/components/index.js.map +0 -1
- package/build/lib/graphql-document/example.d.ts +0 -25
- package/build/lib/graphql-document/example.d.ts.map +0 -1
- package/build/lib/graphql-document/example.js +0 -140
- package/build/lib/graphql-document/example.js.map +0 -1
- package/build/lib/graphql-document/graphql-document.d.ts +0 -35
- package/build/lib/graphql-document/graphql-document.d.ts.map +0 -1
- package/build/lib/graphql-document/graphql-document.js +0 -36
- package/build/lib/graphql-document/graphql-document.js.map +0 -1
- package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +0 -43
- package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +0 -1
- package/build/lib/graphql-document/hooks/use-tooltip-state.js +0 -132
- package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +0 -1
- package/build/lib/graphql-document/positioning-simple.d.ts +0 -63
- package/build/lib/graphql-document/positioning-simple.d.ts.map +0 -1
- package/build/lib/graphql-document/positioning-simple.js +0 -185
- package/build/lib/graphql-document/positioning-simple.js.map +0 -1
- package/build/lib/graphql-document/schema-context.d.ts +0 -8
- package/build/lib/graphql-document/schema-context.d.ts.map +0 -1
- package/build/lib/graphql-document/schema-context.js +0 -11
- package/build/lib/graphql-document/schema-context.js.map +0 -1
- package/build/lib/graphql-document/schema-integration-example.d.ts +0 -27
- package/build/lib/graphql-document/schema-integration-example.d.ts.map +0 -1
- package/build/lib/graphql-document/schema-integration-example.js +0 -297
- package/build/lib/graphql-document/schema-integration-example.js.map +0 -1
- package/build/lib/graphql-document/schema-integration.d.ts +0 -135
- package/build/lib/graphql-document/schema-integration.d.ts.map +0 -1
- package/build/lib/graphql-document/schema-integration.js +0 -328
- package/build/lib/graphql-document/schema-integration.js.map +0 -1
- package/build/lib/graphql-document/types.d.ts +0 -117
- package/build/lib/graphql-document/types.d.ts.map +0 -1
- package/build/lib/graphql-document/types.js.map +0 -1
- package/build/template/components/ArgumentAnnotation.js +0 -10
- package/build/template/components/ArgumentAnnotation.js.map +0 -1
- package/build/template/components/ArgumentList.js +0 -9
- package/build/template/components/ArgumentList.js.map +0 -1
- package/build/template/components/ArgumentListAnnotation.js +0 -15
- package/build/template/components/ArgumentListAnnotation.js.map +0 -1
- package/build/template/components/Changelog.js +0 -44
- package/build/template/components/Changelog.js.map +0 -1
- package/build/template/components/CodeBlockEnhancer.d.ts +0 -2
- package/build/template/components/CodeBlockEnhancer.d.ts.map +0 -1
- package/build/template/components/CodeBlockEnhancer.js +0 -175
- package/build/template/components/CodeBlockEnhancer.js.map +0 -1
- package/build/template/components/DeprecationReason.js +0 -9
- package/build/template/components/DeprecationReason.js.map +0 -1
- package/build/template/components/Description.js +0 -9
- package/build/template/components/Description.js.map +0 -1
- package/build/template/components/Field.js +0 -14
- package/build/template/components/Field.js.map +0 -1
- package/build/template/components/FieldList.js.map +0 -1
- package/build/template/components/FieldListSection.js.map +0 -1
- package/build/template/components/HamburgerMenu.d.ts +0 -9
- package/build/template/components/HamburgerMenu.d.ts.map +0 -1
- package/build/template/components/HamburgerMenu.js +0 -30
- package/build/template/components/HamburgerMenu.js.map +0 -1
- package/build/template/components/Link.js.map +0 -1
- package/build/template/components/Logo.js +0 -20
- package/build/template/components/Logo.js.map +0 -1
- package/build/template/components/MDXComponents.d.ts +0 -11
- package/build/template/components/MDXComponents.d.ts.map +0 -1
- package/build/template/components/MDXComponents.js +0 -70
- package/build/template/components/MDXComponents.js.map +0 -1
- package/build/template/components/Markdown.js.map +0 -1
- package/build/template/components/MissingSchema.js +0 -5
- package/build/template/components/MissingSchema.js.map +0 -1
- package/build/template/components/NamedType.js +0 -12
- package/build/template/components/NamedType.js.map +0 -1
- package/build/template/components/NotFound.d.ts +0 -2
- package/build/template/components/NotFound.d.ts.map +0 -1
- package/build/template/components/NotFound.js +0 -7
- package/build/template/components/NotFound.js.map +0 -1
- package/build/template/components/RadixLink.js.map +0 -1
- package/build/template/components/TestComponent.d.ts +0 -5
- package/build/template/components/TestComponent.d.ts.map +0 -1
- package/build/template/components/TestComponent.js +0 -7
- package/build/template/components/TestComponent.js.map +0 -1
- package/build/template/components/Texts/MinorHeading.js.map +0 -1
- package/build/template/components/ThemeToggle.d.ts +0 -3
- package/build/template/components/ThemeToggle.d.ts.map +0 -1
- package/build/template/components/ThemeToggle.js +0 -9
- package/build/template/components/ThemeToggle.js.map +0 -1
- package/build/template/components/TypeAnnotation.js.map +0 -1
- package/build/template/components/TypeFieldsLinkList.js +0 -9
- package/build/template/components/TypeFieldsLinkList.js.map +0 -1
- package/build/template/components/TypeIndex.js +0 -17
- package/build/template/components/TypeIndex.js.map +0 -1
- package/build/template/components/content/$$.d.ts +0 -3
- package/build/template/components/content/$$.d.ts.map +0 -1
- package/build/template/components/content/$$.js +0 -3
- package/build/template/components/content/$$.js.map +0 -1
- package/build/template/components/content/GraphQLDocumentWithSchema.d.ts +0 -8
- package/build/template/components/content/GraphQLDocumentWithSchema.d.ts.map +0 -1
- package/build/template/components/content/GraphQLDocumentWithSchema.js +0 -13
- package/build/template/components/content/GraphQLDocumentWithSchema.js.map +0 -1
- package/build/template/components/content/GraphQLDocumentWrapper.d.ts +0 -7
- package/build/template/components/content/GraphQLDocumentWrapper.d.ts.map +0 -1
- package/build/template/components/content/GraphQLDocumentWrapper.js +0 -63
- package/build/template/components/content/GraphQLDocumentWrapper.js.map +0 -1
- package/build/template/components/graphql/graphql.js +0 -3
- package/build/template/components/graphql/graphql.js.map +0 -1
- package/build/template/components/graphql/type-kind-icon.js.map +0 -1
- package/build/template/components/graphql/type-link.js +0 -11
- package/build/template/components/graphql/type-link.js.map +0 -1
- package/build/template/components/sidebar/Sidebar.js +0 -11
- package/build/template/components/sidebar/Sidebar.js.map +0 -1
- package/build/template/components/sidebar/SidebarItem.js.map +0 -1
- package/build/template/components/sidebar/ToggleButton.js +0 -5
- package/build/template/components/sidebar/ToggleButton.js.map +0 -1
- package/build/template/contexts/ThemeContext.d.ts +0 -12
- package/build/template/contexts/ThemeContext.d.ts.map +0 -1
- package/build/template/contexts/ThemeContext.js +0 -40
- package/build/template/contexts/ThemeContext.js.map +0 -1
- package/build/template/entry.client.js.map +0 -1
- package/build/template/hooks/useClientOnly.d.ts +0 -9
- package/build/template/hooks/useClientOnly.d.ts.map +0 -1
- package/build/template/hooks/useClientOnly.js +0 -16
- package/build/template/hooks/useClientOnly.js.map +0 -1
- package/build/template/routes/changelog.js.map +0 -1
- package/build/template/routes/index.js.map +0 -1
- package/build/template/routes/reference.$type.$field.js.map +0 -1
- package/build/template/routes/reference.$type.js.map +0 -1
- package/build/template/routes/reference.js.map +0 -1
- package/build/template/routes/root.js +0 -138
- package/build/template/routes/root.js.map +0 -1
- package/build/template/routes.js +0 -5
- package/build/template/routes.js.map +0 -1
- package/build/template/server/create-page-html-response.d.ts +0 -7
- package/build/template/server/create-page-html-response.d.ts.map +0 -1
- package/build/template/server/create-page-html-response.js.map +0 -1
- package/build/template/server/middleware/page.d.ts +0 -4
- package/build/template/server/middleware/page.d.ts.map +0 -1
- package/build/template/server/middleware/page.js +0 -15
- package/build/template/server/middleware/page.js.map +0 -1
- package/build/template/server/middleware/unsupported-assets.d.ts +0 -10
- package/build/template/server/middleware/unsupported-assets.d.ts.map +0 -1
- package/build/template/server/middleware/unsupported-assets.js +0 -21
- package/build/template/server/middleware/unsupported-assets.js.map +0 -1
- package/build/template/styles/code-block.css +0 -218
- package/src/api/content/$$.ts +0 -6
- package/src/api/content/$.test.ts +0 -72
- package/src/api/content/$.ts +0 -1
- package/src/api/content/metadata.ts +0 -11
- package/src/api/content/navbar.test.ts +0 -55
- package/src/api/content/navbar.ts +0 -61
- package/src/api/content/page.ts +0 -12
- package/src/api/content/scan.ts +0 -117
- package/src/api/content/sidebar.test.ts +0 -297
- package/src/api/content/sidebar.ts +0 -283
- package/src/api/content/utils.ts +0 -7
- package/src/exports/components.ts +0 -4
- package/src/lib/graphql-document/$$.ts +0 -4
- package/src/lib/graphql-document/$.test.ts +0 -132
- package/src/lib/graphql-document/$.ts +0 -1
- package/src/lib/graphql-document/README.md +0 -102
- package/src/lib/graphql-document/analysis.ts +0 -415
- package/src/lib/graphql-document/components/CopyButton.tsx +0 -76
- package/src/lib/graphql-document/components/GraphQLDocument.tsx +0 -262
- package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +0 -188
- package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +0 -70
- package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +0 -197
- package/src/lib/graphql-document/components/IdentifierLink.tsx +0 -160
- package/src/lib/graphql-document/components/graphql-document-styles.ts +0 -167
- package/src/lib/graphql-document/components/index.ts +0 -5
- package/src/lib/graphql-document/demo.md +0 -155
- package/src/lib/graphql-document/example.ts +0 -163
- package/src/lib/graphql-document/graphql-document.ts +0 -37
- package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +0 -76
- package/src/lib/graphql-document/hooks/use-tooltip-state.ts +0 -191
- package/src/lib/graphql-document/positioning-simple.test.ts +0 -248
- package/src/lib/graphql-document/positioning-simple.ts +0 -260
- package/src/lib/graphql-document/schema-context.tsx +0 -20
- package/src/lib/graphql-document/schema-integration-example.ts +0 -341
- package/src/lib/graphql-document/schema-integration.test.ts +0 -365
- package/src/lib/graphql-document/schema-integration.ts +0 -497
- package/src/lib/graphql-document/types.ts +0 -129
- package/src/template/components/CodeBlockEnhancer.tsx +0 -192
- package/src/template/components/HamburgerMenu.tsx +0 -96
- package/src/template/components/MDXComponents.tsx +0 -101
- package/src/template/components/NotFound.tsx +0 -28
- package/src/template/components/TestComponent.tsx +0 -6
- package/src/template/components/ThemeToggle.tsx +0 -21
- package/src/template/components/content/$$.ts +0 -2
- package/src/template/components/content/GraphQLDocumentWithSchema.tsx +0 -13
- package/src/template/components/content/GraphQLDocumentWrapper.tsx +0 -89
- package/src/template/contexts/ThemeContext.tsx +0 -60
- package/src/template/hooks/useClientOnly.ts +0 -21
- package/src/template/server/middleware/page.ts +0 -19
- package/src/template/server/middleware/unsupported-assets.ts +0 -25
- /package/build/lib/{graphql-document → file-router/sidebar}/types.js +0 -0
@@ -1,64 +1,81 @@
|
|
1
|
-
import { Content } from '#api/content/$';
|
2
|
-
import { createNavbar } from '#api/content/navbar';
|
3
1
|
import { polenVirtual } from '#api/vite/vi';
|
4
2
|
import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter';
|
5
3
|
import { FileRouter } from '#lib/file-router/index';
|
6
|
-
import {
|
4
|
+
import { Tree } from '#lib/tree/index';
|
5
|
+
import { debug } from '#singletons/debug';
|
7
6
|
import { superjson } from '#singletons/superjson';
|
8
7
|
import mdx from '@mdx-js/rollup';
|
9
8
|
import rehypeShiki from '@shikijs/rehype';
|
10
|
-
import {
|
11
|
-
import remarkFrontmatter from 'remark-frontmatter';
|
9
|
+
import { Path, Str } from '@wollybeard/kit';
|
12
10
|
import remarkGfm from 'remark-gfm';
|
13
|
-
const
|
14
|
-
export const
|
15
|
-
export const
|
16
|
-
allowPluginProcessing: true,
|
17
|
-
});
|
11
|
+
const _debug = debug.sub(`vite-plugin-pages`);
|
12
|
+
export const viProjectPages = polenVirtual([`project`, `pages.jsx`], { allowPluginProcessing: true });
|
13
|
+
export const viProjectPagesData = polenVirtual([`project`, `data`, 'pages.jsonsuper'], { allowPluginProcessing: true });
|
18
14
|
/**
|
19
15
|
* Pages plugin with tree support
|
20
16
|
*/
|
21
|
-
export const Pages = ({ config, navbarData, }) => {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
17
|
+
export const Pages = ({ config, navbarData, onPagesChange, onTreeChange, }) => {
|
18
|
+
let currentPagesData = null;
|
19
|
+
let currentTreeData = null;
|
20
|
+
// State management
|
21
|
+
let pagesCache = null;
|
22
|
+
let treeCache = null;
|
23
|
+
// Helper functions
|
24
|
+
const scanPages = async () => {
|
25
|
+
if (!pagesCache) {
|
26
|
+
_debug(`Scanning pages - cache is null, loading fresh data`);
|
27
|
+
pagesCache = await FileRouter.scan({
|
28
|
+
dir: config.paths.project.absolute.pages,
|
29
|
+
glob: `**/*.{md,mdx}`,
|
30
|
+
});
|
31
|
+
_debug(`Found ${String(pagesCache.routes.length)} pages`);
|
34
32
|
}
|
35
|
-
|
36
|
-
|
37
|
-
server.moduleGraph.invalidateModule(catalogModule);
|
38
|
-
debug(`Invalidated pages catalog virtual module`);
|
33
|
+
else {
|
34
|
+
_debug(`Using cached pages`);
|
39
35
|
}
|
36
|
+
return pagesCache;
|
40
37
|
};
|
41
|
-
const
|
38
|
+
const scanTree = async () => {
|
39
|
+
if (!treeCache) {
|
40
|
+
_debug(`Scanning tree - cache is null, loading fresh data`);
|
41
|
+
const result = await FileRouter.scanTree({
|
42
|
+
dir: config.paths.project.absolute.pages,
|
43
|
+
glob: `**/*.{md,mdx}`,
|
44
|
+
});
|
45
|
+
treeCache = result.routeTree;
|
46
|
+
_debug(`Built route tree`);
|
47
|
+
}
|
48
|
+
else {
|
49
|
+
_debug(`Using cached tree`);
|
50
|
+
}
|
51
|
+
return treeCache;
|
52
|
+
};
|
53
|
+
const clearCache = () => {
|
54
|
+
_debug(`Clearing pages and tree cache`);
|
55
|
+
pagesCache = null;
|
56
|
+
treeCache = null;
|
57
|
+
};
|
58
|
+
const isPageFile = (file) => {
|
59
|
+
return (file.endsWith(`.md`) || file.endsWith(`.mdx`))
|
60
|
+
&& file.includes(config.paths.project.absolute.pages);
|
61
|
+
};
|
62
|
+
const generatePagesModule = (pagesScanResult) => {
|
42
63
|
const $ = {
|
43
|
-
|
64
|
+
pages: `pages`,
|
44
65
|
};
|
45
66
|
const s = Str.Builder();
|
46
|
-
s `export const ${$.
|
67
|
+
s `export const ${$.pages} = []`;
|
47
68
|
// Generate imports and route objects
|
48
|
-
for (const
|
69
|
+
for (const route of pagesScanResult.routes) {
|
49
70
|
const filePathExp = Path.format(route.file.path.absolute);
|
50
71
|
const pathExp = FileRouter.routeToPathExpression(route);
|
51
|
-
const
|
52
|
-
...$,
|
53
|
-
Component: Str.Case.camel(`page ` + Str.titlizeSlug(pathExp)),
|
54
|
-
};
|
72
|
+
const ident = Str.Case.camel(`page ` + Str.titlizeSlug(pathExp));
|
55
73
|
s `
|
56
|
-
import ${
|
74
|
+
import ${ident} from '${filePathExp}'
|
57
75
|
|
58
|
-
${
|
76
|
+
${$.pages}.push({
|
59
77
|
path: '${pathExp}',
|
60
|
-
Component: ${
|
61
|
-
metadata: ${JSON.stringify(metadata)}
|
78
|
+
Component: ${ident}
|
62
79
|
})
|
63
80
|
`;
|
64
81
|
}
|
@@ -70,11 +87,7 @@ export const Pages = ({ config, navbarData, }) => {
|
|
70
87
|
enforce: `pre`,
|
71
88
|
...mdx({
|
72
89
|
jsxImportSource: `polen/react`,
|
73
|
-
remarkPlugins: [
|
74
|
-
// Parse frontmatter blocks so they're removed from content
|
75
|
-
remarkFrontmatter,
|
76
|
-
remarkGfm,
|
77
|
-
],
|
90
|
+
remarkPlugins: [remarkGfm],
|
78
91
|
rehypePlugins: [
|
79
92
|
[
|
80
93
|
rehypeShiki,
|
@@ -83,7 +96,7 @@ export const Pages = ({ config, navbarData, }) => {
|
|
83
96
|
light: `github-light`,
|
84
97
|
dark: `tokyo-night`,
|
85
98
|
},
|
86
|
-
defaultColor:
|
99
|
+
defaultColor: false,
|
87
100
|
cssVariablePrefix: `--shiki-`,
|
88
101
|
transformers: [
|
89
102
|
// Line numbers will be handled via CSS
|
@@ -99,60 +112,56 @@ export const Pages = ({ config, navbarData, }) => {
|
|
99
112
|
// Dev server configuration
|
100
113
|
configureServer(server) {
|
101
114
|
// Add pages directory to watcher
|
102
|
-
|
115
|
+
_debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages);
|
103
116
|
server.watcher.add(config.paths.project.absolute.pages);
|
104
|
-
// Handle file additions and deletions
|
105
|
-
const handleFileStructureChange = async (file, event) => {
|
106
|
-
if (!Content.isPageFile(file, config.paths.project.absolute.pages))
|
107
|
-
return;
|
108
|
-
debug(`Page file ${event === 'add' ? 'added' : 'deleted'}:`, file);
|
109
|
-
// Clear cache and rescan
|
110
|
-
scanPages.clear();
|
111
|
-
const newScanResult = await scanPages();
|
112
|
-
// Invalidate virtual modules
|
113
|
-
invalidateVirtualModules(server);
|
114
|
-
// Report any diagnostics
|
115
|
-
reportDiagnostics(newScanResult.diagnostics);
|
116
|
-
// Trigger full reload to ensure routes are updated
|
117
|
-
server.ws.send({ type: 'full-reload' });
|
118
|
-
};
|
119
|
-
server.watcher.on('add', (file) => handleFileStructureChange(file, 'add'));
|
120
|
-
server.watcher.on('unlink', (file) => handleFileStructureChange(file, 'unlink'));
|
121
117
|
},
|
122
|
-
// Hot update handling
|
118
|
+
// Hot update handling
|
123
119
|
async handleHotUpdate({ file, server, modules }) {
|
124
|
-
|
125
|
-
if (!
|
120
|
+
_debug(`handleHotUpdate`, file);
|
121
|
+
if (!isPageFile(file))
|
126
122
|
return;
|
127
|
-
|
128
|
-
//
|
129
|
-
const oldPages =
|
123
|
+
_debug(`Page file changed:`, file);
|
124
|
+
// Check if this is a content-only change to an existing page
|
125
|
+
const oldPages = pagesCache;
|
130
126
|
// Clear cache and rescan
|
131
|
-
|
132
|
-
const
|
133
|
-
|
134
|
-
//
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
if (
|
139
|
-
|
127
|
+
clearCache();
|
128
|
+
const newPages = await scanPages();
|
129
|
+
currentPagesData = newPages;
|
130
|
+
// Check if page structure changed (added/removed pages)
|
131
|
+
const structureChanged = !oldPages
|
132
|
+
|| oldPages.routes.length !== newPages.routes.length
|
133
|
+
|| !oldPages.routes.every((oldRoute, i) => oldRoute.file.path.absolute === newPages.routes[i]?.file.path.absolute);
|
134
|
+
if (structureChanged) {
|
135
|
+
_debug(`Page structure changed, triggering full reload`);
|
136
|
+
// Invalidate virtual module
|
137
|
+
const mod = server.moduleGraph.getModuleById(viProjectPages.id);
|
138
|
+
if (mod) {
|
139
|
+
server.moduleGraph.invalidateModule(mod);
|
140
|
+
_debug(`Invalidated pages virtual module`);
|
141
|
+
}
|
142
|
+
// Notify about changes
|
143
|
+
if (onPagesChange) {
|
144
|
+
reportDiagnostics(newPages.diagnostics);
|
145
|
+
onPagesChange(newPages);
|
146
|
+
}
|
147
|
+
if (onTreeChange) {
|
148
|
+
const tree = await scanTree();
|
149
|
+
onTreeChange(tree);
|
150
|
+
currentTreeData = tree;
|
151
|
+
}
|
152
|
+
// Trigger full reload for structure changes
|
153
|
+
server.ws.send({ type: `full-reload` });
|
154
|
+
return [];
|
155
|
+
}
|
156
|
+
else {
|
157
|
+
_debug(`Page content changed, allowing HMR`);
|
140
158
|
// Let default HMR handle the MDX file change
|
141
159
|
return modules;
|
142
160
|
}
|
143
|
-
//
|
144
|
-
// ━━ Manual Invalidation
|
145
|
-
//
|
146
|
-
debug(`Page structure changed, triggering full reload`);
|
147
|
-
// Invalidate virtual modules and trigger reload
|
148
|
-
invalidateVirtualModules(server);
|
149
|
-
reportDiagnostics(newScanResult.diagnostics);
|
150
|
-
server.ws.send({ type: `full-reload` });
|
151
|
-
return [];
|
152
161
|
},
|
153
162
|
resolveId(id) {
|
154
|
-
if (id ===
|
155
|
-
return
|
163
|
+
if (id === viProjectPagesData.id) {
|
164
|
+
return viProjectPagesData.resolved;
|
156
165
|
}
|
157
166
|
},
|
158
167
|
load: {
|
@@ -160,44 +169,99 @@ export const Pages = ({ config, navbarData, }) => {
|
|
160
169
|
// id: viProjectPagesData.resolved,
|
161
170
|
// },
|
162
171
|
async handler(id) {
|
163
|
-
if (id !==
|
172
|
+
if (id !== viProjectPagesData.resolved)
|
164
173
|
return;
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
174
|
+
_debug(`viProjectDataPages`);
|
175
|
+
// Get pages data from the pages plugin or load initially
|
176
|
+
if (!currentPagesData) {
|
177
|
+
_debug(`loadingPagesDataInitially`);
|
178
|
+
currentPagesData = await FileRouter.scan({
|
179
|
+
dir: config.paths.project.absolute.pages,
|
180
|
+
glob: `**/*.{md,mdx}`,
|
181
|
+
});
|
182
|
+
// Report any diagnostics from initial scan
|
183
|
+
reportDiagnostics(currentPagesData.diagnostics);
|
184
|
+
}
|
185
|
+
if (!currentTreeData) {
|
186
|
+
_debug(`loadingTreeDataInitially`);
|
187
|
+
currentTreeData = await getRouteTree(config);
|
188
|
+
}
|
189
|
+
const pagesScanResult = currentPagesData;
|
190
|
+
const routeTree = currentTreeData;
|
191
|
+
_debug(`usingPageRoutesFromPagesPlugin`, pagesScanResult.routes.length);
|
169
192
|
//
|
170
193
|
// ━━ Build Navbar
|
171
194
|
//
|
195
|
+
// Update navbar if provided
|
172
196
|
if (navbarData) {
|
173
197
|
const navbarPages = navbarData.get('pages');
|
174
198
|
navbarPages.length = 0; // Clear existing
|
175
|
-
|
176
|
-
|
177
|
-
|
199
|
+
// Process first-level children as navigation items
|
200
|
+
for (const child of routeTree.children) {
|
201
|
+
if (child.value.type === 'directory') {
|
202
|
+
// Check if this directory has an index file
|
203
|
+
const hasIndex = child.children.some(c => c.value.type === 'file' && c.value.name === 'index');
|
204
|
+
if (hasIndex) {
|
205
|
+
const pathExp = FileRouter.pathToExpression([child.value.name]);
|
206
|
+
const title = Str.titlizeSlug(child.value.name);
|
207
|
+
navbarPages.push({
|
208
|
+
// IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
|
209
|
+
// Without the leading slash, React Router treats paths as relative, which causes
|
210
|
+
// hydration mismatches between SSR (where base path is prepended) and client
|
211
|
+
// (where basename is configured). This ensures consistent behavior.
|
212
|
+
pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
|
213
|
+
title,
|
214
|
+
});
|
215
|
+
}
|
216
|
+
}
|
217
|
+
else if (child.value.type === 'file' && child.value.name !== 'index') {
|
218
|
+
const pathExp = FileRouter.pathToExpression([child.value.name]);
|
219
|
+
const title = Str.titlizeSlug(child.value.name);
|
220
|
+
navbarPages.push({
|
221
|
+
// IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
|
222
|
+
// Without the leading slash, React Router treats paths as relative, which causes
|
223
|
+
// hydration mismatches between SSR (where base path is prepended) and client
|
224
|
+
// (where basename is configured). This ensures consistent behavior.
|
225
|
+
pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
|
226
|
+
title,
|
227
|
+
});
|
228
|
+
}
|
229
|
+
}
|
178
230
|
}
|
179
231
|
//
|
180
232
|
// ━━ Build Sidebar
|
181
233
|
//
|
182
|
-
const sidebarIndex =
|
234
|
+
const sidebarIndex = {};
|
235
|
+
// Build sidebar for each top-level directory
|
236
|
+
for (const child of routeTree.children) {
|
237
|
+
if (child.value.type === 'directory') {
|
238
|
+
const pathExp = `/${child.value.name}`;
|
239
|
+
// Create a subtree starting from this directory
|
240
|
+
const subtree = Tree.node(child.value, child.children);
|
241
|
+
// Pass the directory name as base path so paths are built correctly
|
242
|
+
const sidebar = FileRouter.Sidebar.buildFromTree(subtree, [child.value.name]);
|
243
|
+
_debug(`Built sidebar for ${pathExp}:`, sidebar);
|
244
|
+
sidebarIndex[pathExp] = sidebar;
|
245
|
+
}
|
246
|
+
}
|
183
247
|
//
|
184
248
|
// ━━ Put It All together
|
185
249
|
//
|
186
|
-
const
|
250
|
+
const projectDataPages = {
|
187
251
|
sidebarIndex,
|
188
|
-
|
252
|
+
pagesScanResult: pagesScanResult,
|
189
253
|
};
|
190
254
|
// Return just the JSON string - let the JSON plugin handle the transformation
|
191
|
-
return superjson.stringify(
|
255
|
+
return superjson.stringify(projectDataPages);
|
192
256
|
},
|
193
257
|
},
|
194
258
|
},
|
195
|
-
// Plugin
|
259
|
+
// Plugin 4: Virtual Module for Pages Routes
|
196
260
|
{
|
197
|
-
name: 'polen:routes',
|
261
|
+
name: 'polen:pages:routes',
|
198
262
|
resolveId(id) {
|
199
|
-
if (id ===
|
200
|
-
return
|
263
|
+
if (id === viProjectPages.id) {
|
264
|
+
return viProjectPages.resolved;
|
201
265
|
}
|
202
266
|
},
|
203
267
|
load: {
|
@@ -205,15 +269,17 @@ export const Pages = ({ config, navbarData, }) => {
|
|
205
269
|
// id: viProjectPages.resolved,
|
206
270
|
// },
|
207
271
|
handler: async (id) => {
|
208
|
-
if (id !==
|
272
|
+
if (id !== viProjectPages.resolved)
|
209
273
|
return;
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
274
|
+
_debug(`Loading viProjectPages virtual module`);
|
275
|
+
// Ensure we have pages data
|
276
|
+
if (!currentPagesData) {
|
277
|
+
currentPagesData = await scanPages();
|
278
|
+
reportDiagnostics(currentPagesData.diagnostics);
|
279
|
+
}
|
214
280
|
// Generate the module code
|
215
281
|
return {
|
216
|
-
code,
|
282
|
+
code: generatePagesModule(currentPagesData),
|
217
283
|
moduleType: 'js',
|
218
284
|
};
|
219
285
|
},
|
@@ -221,4 +287,12 @@ export const Pages = ({ config, navbarData, }) => {
|
|
221
287
|
},
|
222
288
|
];
|
223
289
|
};
|
290
|
+
// Helper to get tree
|
291
|
+
export const getRouteTree = async (config) => {
|
292
|
+
const result = await FileRouter.scanTree({
|
293
|
+
dir: config.paths.project.absolute.pages,
|
294
|
+
glob: `**/*.{md,mdx}`,
|
295
|
+
});
|
296
|
+
return result.routeTree;
|
297
|
+
};
|
224
298
|
//# sourceMappingURL=pages.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/pages.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/pages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,GAAG,MAAM,gBAAgB,CAAA;AAChC,OAAO,WAAW,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,EAAE,qBAAqB,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EAAE,MAAM,iBAAiB,CAAA;
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAY3C,eAAO,MAAM,KAAK,GAChB,QAAQ,MAAM,CAAC,MAAM,KACpB,IAAI,CAAC,YAyEP,CAAA"}
|
@@ -1,55 +1,16 @@
|
|
1
1
|
import { reportError } from '#api/server/report-error';
|
2
|
-
import { Hono } from '#dep/hono/index';
|
3
2
|
import { ResponseInternalServerError } from '#lib/kit-temp';
|
4
|
-
import {
|
3
|
+
import { debug } from '#singletons/debug';
|
5
4
|
import * as HonoNodeServer from '@hono/node-server';
|
6
|
-
import { Err
|
5
|
+
import { Err } from '@wollybeard/kit';
|
7
6
|
export const Serve = (config) => {
|
8
|
-
const
|
9
|
-
debug('construct');
|
10
|
-
const appModulePath = config.paths.framework.template.server.app;
|
7
|
+
const _debug = debug.sub(`serve`);
|
11
8
|
let appPromise;
|
12
|
-
const
|
13
|
-
|
14
|
-
if (!appModule)
|
15
|
-
return true; // Not loaded yet
|
16
|
-
// Check if the module or any of its dependencies are invalidated
|
17
|
-
const checkInvalidated = (mod, visited = new Set()) => {
|
18
|
-
console.log(Obj.pick(mod, ['ssrInvalidationState', 'invalidationState', 'lastInvalidationTimestamp']));
|
19
|
-
// if (!mod.id || visited.has(mod.id)) return false
|
20
|
-
// visited.add(mod.id)
|
21
|
-
// // Check if this module is invalidated
|
22
|
-
// if (mod.transformResult === null) return true
|
23
|
-
// // Check all imported modules recursively
|
24
|
-
// for (const imported of mod.importedModules) {
|
25
|
-
// if (checkInvalidated(imported, visited)) return true
|
26
|
-
// }
|
27
|
-
return false;
|
28
|
-
};
|
29
|
-
return checkInvalidated(appModule);
|
30
|
-
};
|
31
|
-
const reloadApp = async (server) => {
|
32
|
-
debug('reloadApp');
|
9
|
+
const reloadApp = async ({ server }) => {
|
10
|
+
_debug('reloadApp');
|
33
11
|
return server.ssrLoadModule(config.paths.framework.template.server.app)
|
34
12
|
.then(module => module)
|
35
|
-
.then(module =>
|
36
|
-
return module.createApp({
|
37
|
-
hooks: {
|
38
|
-
transformHtml: [
|
39
|
-
// Inject entry client script for development
|
40
|
-
(html, _ctx) => {
|
41
|
-
const entryClientPath = config.paths.framework.template.client.entrypoint;
|
42
|
-
const entryClientScript = `<script type="module" src="${entryClientPath}"></script>`;
|
43
|
-
return html.replace('</body>', `${entryClientScript}</body>`);
|
44
|
-
},
|
45
|
-
// Apply Vite's transformations
|
46
|
-
async (html, ctx) => {
|
47
|
-
return await server.transformIndexHtml(ctx.req.url, html);
|
48
|
-
},
|
49
|
-
],
|
50
|
-
},
|
51
|
-
});
|
52
|
-
})
|
13
|
+
.then(module => module.app)
|
53
14
|
.catch(async (error) => {
|
54
15
|
if (Err.is(error)) {
|
55
16
|
// ━ Clean Stack Trace
|
@@ -80,14 +41,14 @@ export const Serve = (config) => {
|
|
80
41
|
};
|
81
42
|
},
|
82
43
|
handleHotUpdate({ server }) {
|
83
|
-
|
44
|
+
_debug('handleHotUpdate');
|
84
45
|
// Reload app server immediately in the background
|
85
|
-
appPromise = reloadApp(server);
|
46
|
+
appPromise = reloadApp({ server });
|
86
47
|
},
|
87
48
|
async configureServer(server) {
|
88
|
-
|
49
|
+
_debug('configureServer');
|
89
50
|
// Initial load
|
90
|
-
appPromise = reloadApp(server);
|
51
|
+
appPromise = reloadApp({ server });
|
91
52
|
return () => {
|
92
53
|
// Remove index.html serving middleware.
|
93
54
|
server.middlewares.stack.splice(
|
@@ -95,8 +56,6 @@ export const Serve = (config) => {
|
|
95
56
|
server.middlewares.stack.findIndex(m => m.handle.name === `viteHtmlFallbackMiddleware`), 1);
|
96
57
|
// Add middleware that runs our entry server
|
97
58
|
server.middlewares.use((req, res, ___next) => {
|
98
|
-
debug('request');
|
99
|
-
// isNeedAppLoadOrReload(server)
|
100
59
|
void HonoNodeServer.getRequestListener(async (request) => {
|
101
60
|
// Always await the current app promise
|
102
61
|
const app = await appPromise;
|
@@ -104,7 +63,8 @@ export const Serve = (config) => {
|
|
104
63
|
// Err.log(app)
|
105
64
|
return ResponseInternalServerError();
|
106
65
|
}
|
107
|
-
|
66
|
+
const response = await app.fetch(request, { viteDevServer: server });
|
67
|
+
return response;
|
108
68
|
})(req, res);
|
109
69
|
});
|
110
70
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/serve.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,cAAc,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAQrC,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,MAAqB,EACF,EAAE;IACrB,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IACjC,IAAI,UAAgC,CAAA;IAEpC,MAAM,SAAS,GAAG,KAAK,EAAE,EAAE,MAAM,EAAkC,EAAwB,EAAE;QAC3F,MAAM,CAAC,WAAW,CAAC,CAAA;QACnB,OAAO,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;aACpE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAyB,CAAC;aACzC,IAAI,CAAC,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4B,CAAC,EACvF,CAAC,CACF,CAAA;gBAED,4CAA4C;gBAC5C,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE;oBAC3C,KAAK,cAAc,CAAC,kBAAkB,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;wBACrD,uCAAuC;wBACvC,MAAM,GAAG,GAAG,MAAM,UAAU,CAAA;wBAC5B,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;4BAChB,eAAe;4BACf,OAAO,2BAA2B,EAAE,CAAA;wBACtC,CAAC;wBACD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAA;wBACpE,OAAO,QAAQ,CAAA;oBACjB,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;gBACd,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { isSpecifierFromPackage } from '#lib/kit-temp';
|
2
2
|
import { packagePaths } from '#package-paths';
|
3
|
-
import {
|
3
|
+
import { debug } from '#singletons/debug';
|
4
4
|
import { fileURLToPath } from 'node:url';
|
5
5
|
let data_ = undefined;
|
6
6
|
export function initialize(data) {
|
@@ -9,7 +9,7 @@ export function initialize(data) {
|
|
9
9
|
export const resolve = async (specifier, context, nextResolve) => {
|
10
10
|
if (!data_)
|
11
11
|
throw new Error(`Self-contained mode not initialized`);
|
12
|
-
const
|
12
|
+
const _debug = debug.sub(`node-module-hooks`);
|
13
13
|
const from = {
|
14
14
|
specifier,
|
15
15
|
context,
|
@@ -19,7 +19,7 @@ export const resolve = async (specifier, context, nextResolve) => {
|
|
19
19
|
specifier,
|
20
20
|
importerPathExpOrFileUrlExp: from.context.parentURL,
|
21
21
|
})) {
|
22
|
-
|
22
|
+
_debug(`resolve check`, { specifier, context });
|
23
23
|
const to = {
|
24
24
|
specifier: from.specifier,
|
25
25
|
context: {
|
@@ -28,7 +28,7 @@ export const resolve = async (specifier, context, nextResolve) => {
|
|
28
28
|
importAttributes: from.context.importAttributes,
|
29
29
|
},
|
30
30
|
};
|
31
|
-
|
31
|
+
_debug(`resolve`, { from, to });
|
32
32
|
await nextResolve(to.specifier, to.context);
|
33
33
|
}
|
34
34
|
return nextResolve(specifier, context);
|
@@ -41,7 +41,7 @@ export const checkIsSelfImportFromProject = (input) => {
|
|
41
41
|
return isImporterTheProject && isImportMe;
|
42
42
|
};
|
43
43
|
export const VitePluginSelfContainedMode = ({ projectDirPathExp }) => {
|
44
|
-
const d =
|
44
|
+
const d = debug.sub(`vite-plugin:self-contained-import`);
|
45
45
|
return {
|
46
46
|
name: `polen:self-contained-import`,
|
47
47
|
resolveId(id, importer) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"self-contained-mode.js","sourceRoot":"","sources":["../../../src/cli/_/self-contained-mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"self-contained-mode.js","sourceRoot":"","sources":["../../../src/cli/_/self-contained-mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMxC,IAAI,KAAK,GAA2C,SAAS,CAAA;AAE7D,MAAM,UAAU,UAAU,CAAC,IAAgC;IACzD,KAAK,GAAG,IAAI,CAAA;AACd,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAuB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