polen 0.8.0-next.8 → 0.8.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.
- package/README.md +25 -0
- package/build/api/api.d.ts +3 -3
- package/build/api/api.js +3 -3
- package/build/api/builder/builder.d.ts +1 -1
- package/build/api/builder/builder.d.ts.map +1 -1
- package/build/api/builder/builder.js +12 -4
- package/build/api/builder/builder.js.map +1 -1
- package/build/api/builder/index.d.ts +1 -1
- package/build/api/builder/index.js +1 -1
- package/build/api/config/config.d.ts +4 -4
- package/build/api/config/config.js +4 -4
- package/build/api/config/configurator.d.ts +21 -4
- package/build/api/config/configurator.d.ts.map +1 -1
- package/build/api/config/configurator.js +6 -2
- package/build/api/config/configurator.js.map +1 -1
- package/build/api/config/define.d.ts +1 -1
- package/build/api/config/index.d.ts +1 -1
- package/build/api/config/index.js +1 -1
- package/build/api/config/load.d.ts +1 -1
- package/build/api/config/load.d.ts.map +1 -1
- package/build/api/config/load.js +71 -19
- package/build/api/config/load.js.map +1 -1
- package/build/api/config/merge.d.ts +1 -1
- package/build/api/config/merge.js +1 -1
- package/build/api/config/merge.js.map +1 -1
- package/build/api/config-resolver/config-resolver.d.ts +2 -2
- package/build/api/config-resolver/config-resolver.js +2 -2
- package/build/api/config-resolver/index.d.ts +1 -1
- package/build/api/config-resolver/index.js +1 -1
- package/build/api/config-resolver/resolve.d.ts +3 -3
- package/build/api/config-resolver/resolve.d.ts.map +1 -1
- package/build/api/config-resolver/resolve.js +8 -5
- package/build/api/config-resolver/resolve.js.map +1 -1
- package/build/api/config-resolver/vite.d.ts +2 -2
- package/build/api/config-resolver/vite.d.ts.map +1 -1
- package/build/api/config-resolver/vite.js +2 -2
- package/build/api/config-resolver/vite.js.map +1 -1
- package/build/api/index.d.ts +1 -1
- package/build/api/index.js +1 -1
- package/build/api/schema/data-sources/data-sources.d.ts +3 -3
- package/build/api/schema/data-sources/data-sources.js +3 -3
- package/build/api/schema/data-sources/index.d.ts +1 -1
- package/build/api/schema/data-sources/index.js +1 -1
- package/build/api/schema/data-sources/memory/memory.d.ts +1 -1
- package/build/api/schema/data-sources/memory/memory.js +2 -2
- package/build/api/schema/data-sources/memory/memory.js.map +1 -1
- package/build/api/schema/data-sources/schema-directory/file-name-expression/index.d.ts +1 -1
- package/build/api/schema/data-sources/schema-directory/file-name-expression/index.js +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts +1 -1
- package/build/api/schema/data-sources/schema-directory/schema-directory.js +5 -5
- package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
- package/build/api/schema/data-sources/schema-file/schema-file.d.ts +1 -1
- package/build/api/schema/data-sources/schema-file/schema-file.js +2 -2
- package/build/api/schema/data-sources/schema-file/schema-file.js.map +1 -1
- package/build/api/schema/index.d.ts +1 -1
- package/build/api/schema/index.js +1 -1
- package/build/api/schema/read.d.ts +2 -2
- package/build/api/schema/read.js +1 -1
- package/build/api/schema/schema.d.ts +3 -3
- package/build/api/schema/schema.d.ts.map +1 -1
- package/build/api/schema/schema.js +2 -2
- package/build/api/schema-augmentation/augmentations/description.d.ts +2 -2
- package/build/api/schema-augmentation/augmentations/description.d.ts.map +1 -1
- package/build/api/schema-augmentation/augmentations/description.js +1 -1
- package/build/api/schema-augmentation/index.d.ts +1 -1
- package/build/api/schema-augmentation/index.js +1 -1
- package/build/api/schema-augmentation/schema-augmentation.d.ts +2 -2
- package/build/api/schema-augmentation/schema-augmentation.d.ts.map +1 -1
- package/build/api/schema-augmentation/schema-augmentation.js +1 -1
- package/build/api/schema-augmentation/target.d.ts +1 -1
- package/build/api/schema-augmentation/target.d.ts.map +1 -1
- package/build/api/schema-augmentation/target.js +1 -1
- package/build/api/schema-augmentation/target.js.map +1 -1
- package/build/api/singletons/markdown/index.d.ts +1 -1
- package/build/api/singletons/markdown/index.js +1 -1
- package/build/api/vite/log-filters.d.ts +1 -1
- package/build/api/vite/log-filters.d.ts.map +1 -1
- package/build/api/vite/log-filters.js +1 -1
- package/build/api/vite/log-filters.js.map +1 -1
- package/build/api/vite/logger.d.ts +1 -1
- package/build/api/vite/logger.d.ts.map +1 -1
- package/build/api/vite/logger.js +21 -7
- package/build/api/vite/logger.js.map +1 -1
- package/build/api/vite/plugins/build.d.ts +2 -2
- package/build/api/vite/plugins/build.d.ts.map +1 -1
- package/build/api/vite/plugins/build.js +14 -6
- package/build/api/vite/plugins/build.js.map +1 -1
- package/build/api/vite/plugins/core.d.ts +3 -3
- package/build/api/vite/plugins/core.d.ts.map +1 -1
- package/build/api/vite/plugins/core.js +155 -203
- package/build/api/vite/plugins/core.js.map +1 -1
- package/build/api/vite/plugins/main.d.ts +2 -2
- package/build/api/vite/plugins/main.d.ts.map +1 -1
- package/build/api/vite/plugins/main.js +22 -21
- package/build/api/vite/plugins/main.js.map +1 -1
- package/build/api/vite/plugins/pages-tree.d.ts +16 -0
- package/build/api/vite/plugins/pages-tree.d.ts.map +1 -0
- package/build/api/vite/plugins/pages-tree.js +152 -0
- package/build/api/vite/plugins/pages-tree.js.map +1 -0
- package/build/api/vite/plugins/serve.d.ts +2 -2
- package/build/api/vite/plugins/serve.d.ts.map +1 -1
- package/build/api/vite/plugins/serve.js +41 -26
- package/build/api/vite/plugins/serve.js.map +1 -1
- package/build/api/vite/vi.d.ts +2 -2
- package/build/api/vite/vi.d.ts.map +1 -1
- package/build/api/vite/vi.js +2 -2
- package/build/api/vite/vi.js.map +1 -1
- package/build/cli/_/self-contained-mode.d.ts +16 -0
- package/build/cli/_/self-contained-mode.d.ts.map +1 -0
- package/build/cli/_/self-contained-mode.js +58 -0
- package/build/cli/_/self-contained-mode.js.map +1 -0
- package/build/cli/commands/build.js +2 -2
- package/build/cli/commands/build.js.map +1 -1
- package/build/cli/commands/dev.js +3 -4
- package/build/cli/commands/dev.js.map +1 -1
- package/build/cli/commands/open.js +4 -4
- package/build/cli/commands/open.js.map +1 -1
- package/build/cli/index.js +1 -1
- package/build/dep/graphql-inspector/index.d.ts +1 -1
- package/build/dep/graphql-inspector/index.js +1 -1
- package/build/dep/hono/hono.d.ts +1 -1
- package/build/dep/hono/hono.js +1 -1
- package/build/dep/hono/index.d.ts +1 -1
- package/build/dep/hono/index.js +1 -1
- package/build/dep/superjson/index.d.ts +1 -1
- package/build/dep/superjson/index.js +1 -1
- package/build/dep/tiny-globby/index.d.ts +1 -1
- package/build/dep/tiny-globby/index.js +1 -1
- package/build/dep/vite/index.d.ts +1 -1
- package/build/dep/vite/index.js +1 -1
- package/build/exports/index.d.ts +1 -1
- package/build/exports/index.js +1 -1
- package/build/exports/polen.d.ts +3 -3
- package/build/exports/polen.d.ts.map +1 -1
- package/build/exports/polen.js +3 -3
- package/build/exports/polen.js.map +1 -1
- package/build/lib/apple-touch-icon/index.d.ts +1 -1
- package/build/lib/apple-touch-icon/index.js +1 -1
- package/build/lib/debug/debug.d.ts +3 -3
- package/build/lib/debug/debug.d.ts.map +1 -1
- package/build/lib/debug/debug.js +39 -10
- package/build/lib/debug/debug.js.map +1 -1
- package/build/lib/debug/environment-variable.d.ts +2 -1
- package/build/lib/debug/environment-variable.d.ts.map +1 -1
- package/build/lib/debug/environment-variable.js +27 -7
- package/build/lib/debug/environment-variable.js.map +1 -1
- package/build/lib/debug/index.d.ts +1 -1
- package/build/lib/debug/index.js +1 -1
- package/build/lib/errors/ContextualAggregateError.d.ts +1 -1
- package/build/lib/errors/ContextualAggregateError.js +1 -1
- package/build/lib/errors/ContextualError.d.ts +1 -1
- package/build/lib/errors/ErrorInternal.d.ts +2 -2
- package/build/lib/errors/ErrorInternal.js +1 -1
- package/build/lib/errors/errors.d.ts +4 -4
- package/build/lib/errors/errors.js +4 -4
- package/build/lib/errors/index.d.ts +1 -1
- package/build/lib/errors/index.js +1 -1
- package/build/lib/errors/types.d.ts +1 -1
- package/build/lib/favicon/index.d.ts +1 -1
- package/build/lib/favicon/index.js +1 -1
- package/build/lib/file-router/diagnostic-reporter.d.ts +3 -0
- package/build/lib/file-router/diagnostic-reporter.d.ts.map +1 -0
- package/build/lib/file-router/diagnostic-reporter.js +18 -0
- package/build/lib/file-router/diagnostic-reporter.js.map +1 -0
- package/build/lib/file-router/file-router.d.ts +5 -3
- package/build/lib/file-router/file-router.d.ts.map +1 -1
- package/build/lib/file-router/file-router.js +5 -3
- package/build/lib/file-router/file-router.js.map +1 -1
- package/build/lib/file-router/index.d.ts +1 -1
- package/build/lib/file-router/index.js +1 -1
- package/build/lib/file-router/linter.d.ts +25 -2
- package/build/lib/file-router/linter.d.ts.map +1 -1
- package/build/lib/file-router/linter.js +46 -5
- package/build/lib/file-router/linter.js.map +1 -1
- package/build/lib/file-router/route.d.ts +1 -0
- package/build/lib/file-router/route.d.ts.map +1 -1
- package/build/lib/file-router/route.js +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 +2 -2
- package/build/lib/file-router/scan.d.ts.map +1 -1
- package/build/lib/file-router/scan.js +26 -10
- 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 +2 -0
- package/build/lib/file-router/sidebar/types.js.map +1 -0
- package/build/lib/grafaid/_Nodes.d.ts +1 -1
- package/build/lib/grafaid/_Nodes.js +1 -1
- package/build/lib/grafaid/document/OperationTypeNode.d.ts +1 -1
- package/build/lib/grafaid/document/OperationTypeNode.js +1 -1
- package/build/lib/grafaid/document/kind.d.ts +1 -1
- package/build/lib/grafaid/document/kind.js +1 -1
- package/build/lib/grafaid/document.d.ts +4 -4
- package/build/lib/grafaid/document.js +6 -6
- package/build/lib/grafaid/grafaid.d.ts +4 -4
- package/build/lib/grafaid/grafaid.js +4 -4
- package/build/lib/grafaid/graphql.d.ts +2 -2
- package/build/lib/grafaid/graphql.js +2 -2
- package/build/lib/grafaid/http/__.d.ts +1 -1
- package/build/lib/grafaid/http/__.js +1 -1
- package/build/lib/grafaid/http/http.js +1 -1
- package/build/lib/grafaid/index.d.ts +1 -1
- package/build/lib/grafaid/index.js +1 -1
- package/build/lib/grafaid/schema/KindMap/_.d.ts +3 -3
- package/build/lib/grafaid/schema/KindMap/_.js +4 -4
- package/build/lib/grafaid/schema/KindMap/__.d.ts +2 -2
- package/build/lib/grafaid/schema/KindMap/__.js +1 -1
- package/build/lib/grafaid/schema/OperationType/__.d.ts +2 -2
- package/build/lib/grafaid/schema/OperationType/__.js +1 -1
- package/build/lib/grafaid/schema/RootDetails.d.ts +3 -3
- package/build/lib/grafaid/schema/RootDetails.js +2 -2
- package/build/lib/grafaid/schema/RootTypeMap.d.ts +2 -2
- package/build/lib/grafaid/schema/RootTypeMap.js +2 -2
- package/build/lib/grafaid/schema/nodes-like.d.ts +1 -1
- package/build/lib/grafaid/schema/nodes-like.js +1 -1
- package/build/lib/grafaid/schema/schema.d.ts +14 -14
- package/build/lib/grafaid/schema/schema.js +15 -15
- package/build/lib/grafaid/schema/type-kind-name.d.ts +1 -1
- package/build/lib/grafaid/schema/type-kind-name.js +1 -1
- package/build/lib/grafaid/schema/type.d.ts +1 -1
- package/build/lib/grafaid/schema/typeGuards.js +1 -1
- package/build/lib/grafaid-old/grafaid.d.ts +1 -1
- package/build/lib/grafaid-old/grafaid.js +1 -1
- package/build/lib/grafaid-old/index.d.ts +1 -1
- package/build/lib/grafaid-old/index.js +1 -1
- package/build/lib/graphql-change/graphql-change.d.ts +2 -2
- package/build/lib/graphql-change/graphql-change.d.ts.map +1 -1
- package/build/lib/graphql-change/graphql-change.js +1 -1
- package/build/lib/graphql-change/graphql-change.js.map +1 -1
- package/build/lib/graphql-change/index.d.ts +1 -1
- package/build/lib/graphql-change/index.js +1 -1
- package/build/lib/graphql-changeset/graphql-changeset.d.ts +2 -2
- package/build/lib/graphql-changeset/graphql-changeset.d.ts.map +1 -1
- package/build/lib/graphql-changeset/index.d.ts +1 -1
- package/build/lib/graphql-changeset/index.js +1 -1
- package/build/lib/graphql-schema-loader/graphql-schema-loader.d.ts +1 -1
- package/build/lib/graphql-schema-loader/graphql-schema-loader.d.ts.map +1 -1
- package/build/lib/graphql-schema-loader/graphql-schema-loader.js +1 -1
- package/build/lib/graphql-schema-loader/graphql-schema-loader.js.map +1 -1
- package/build/lib/graphql-schema-loader/index.d.ts +1 -1
- package/build/lib/graphql-schema-loader/index.js +1 -1
- package/build/lib/hono-aid/hono-aid.d.ts +1 -1
- package/build/lib/hono-aid/hono-aid.d.ts.map +1 -1
- package/build/lib/hono-aid/index.d.ts +1 -1
- package/build/lib/hono-aid/index.js +1 -1
- package/build/lib/kit-temp.d.ts +6 -0
- package/build/lib/kit-temp.d.ts.map +1 -1
- package/build/lib/kit-temp.js +3 -0
- package/build/lib/kit-temp.js.map +1 -1
- package/build/lib/react-router-aid/get-paths-patterns.d.ts +1 -1
- package/build/lib/react-router-aid/get-paths-patterns.d.ts.map +1 -1
- package/build/lib/react-router-aid/index.d.ts +1 -1
- package/build/lib/react-router-aid/index.js +1 -1
- package/build/lib/react-router-aid/react-router-aid.d.ts +2 -2
- package/build/lib/react-router-aid/react-router-aid.d.ts.map +1 -1
- package/build/lib/react-router-aid/react-router-aid.js +1 -1
- package/build/lib/react-router-loader/react-router-loader.js +1 -1
- package/build/lib/stack-processor/index.d.ts +1 -1
- package/build/lib/stack-processor/index.js +1 -1
- package/build/lib/superjson-codec/codec.d.ts +1 -1
- package/build/lib/superjson-codec/codec.d.ts.map +1 -1
- package/build/lib/superjson-codec/codecs/graphql-schema.d.ts +2 -2
- package/build/lib/superjson-codec/codecs/graphql-schema.d.ts.map +1 -1
- package/build/lib/superjson-codec/codecs/graphql-schema.js +2 -2
- package/build/lib/superjson-codec/codecs/graphql-schema.js.map +1 -1
- package/build/lib/superjson-codec/exports.d.ts +2 -2
- package/build/lib/superjson-codec/exports.js +2 -2
- package/build/lib/superjson-codec/index.d.ts +1 -1
- package/build/lib/superjson-codec/index.js +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-config/vite-plugin-config.d.ts +1 -1
- package/build/lib/vite-plugin-config/vite-plugin-config.d.ts.map +1 -1
- package/build/lib/vite-plugin-mdx/index.d.ts +2 -0
- package/build/lib/vite-plugin-mdx/index.d.ts.map +1 -0
- package/build/lib/vite-plugin-mdx/index.js +2 -0
- package/build/lib/vite-plugin-mdx/index.js.map +1 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts +24 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts.map +1 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js +58 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js.map +1 -0
- package/build/lib/vite-plugins/index.d.ts +1 -1
- package/build/lib/vite-plugins/index.js +1 -1
- package/build/lib/vite-plugins/vite-plugins.d.ts +1 -2
- package/build/lib/vite-plugins/vite-plugins.d.ts.map +1 -1
- package/build/lib/vite-plugins/vite-plugins.js +1 -2
- package/build/lib/vite-plugins/vite-plugins.js.map +1 -1
- package/build/lib/vite-virtual/debug.d.ts +3 -0
- package/build/lib/vite-virtual/debug.d.ts.map +1 -0
- package/build/lib/vite-virtual/debug.js +3 -0
- package/build/lib/vite-virtual/debug.js.map +1 -0
- package/build/lib/vite-virtual/hooks.d.ts +1 -1
- package/build/lib/vite-virtual/hooks.d.ts.map +1 -1
- package/build/lib/vite-virtual/identified-loader.d.ts +3 -3
- package/build/lib/vite-virtual/identified-loader.d.ts.map +1 -1
- package/build/lib/vite-virtual/identified-loader.js +6 -2
- package/build/lib/vite-virtual/identified-loader.js.map +1 -1
- package/build/lib/vite-virtual/identifier.js +1 -1
- package/build/lib/vite-virtual/index.d.ts +1 -1
- package/build/lib/vite-virtual/index.js +1 -1
- package/build/lib/vite-virtual/vite-virtual.d.ts +3 -3
- package/build/lib/vite-virtual/vite-virtual.js +3 -3
- package/build/package-paths.d.ts +7 -0
- package/build/package-paths.d.ts.map +1 -1
- package/build/package-paths.js +12 -1
- package/build/package-paths.js.map +1 -1
- package/build/project-data.d.ts +4 -20
- package/build/project-data.d.ts.map +1 -1
- package/build/singletons/debug.d.ts +3 -0
- package/build/singletons/debug.d.ts.map +1 -0
- package/build/singletons/debug.js +3 -0
- package/build/singletons/debug.js.map +1 -0
- package/build/singletons/superjson.d.ts +1 -1
- package/build/singletons/superjson.d.ts.map +1 -1
- package/build/singletons/superjson.js +2 -2
- package/build/singletons/superjson.js.map +1 -1
- package/build/template/components/ArgumentListAnnotation.jsx +1 -1
- package/build/template/components/ArgumentListAnnotation.jsx.map +1 -1
- package/build/template/components/Changelog.d.ts +1 -1
- package/build/template/components/Changelog.jsx +2 -2
- package/build/template/components/Changelog.jsx.map +1 -1
- package/build/template/components/DeprecationReason.d.ts +1 -1
- package/build/template/components/DeprecationReason.d.ts.map +1 -1
- package/build/template/components/Description.d.ts +1 -1
- package/build/template/components/Description.d.ts.map +1 -1
- package/build/template/components/Field.d.ts +1 -1
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.jsx +1 -1
- package/build/template/components/Field.jsx.map +1 -1
- package/build/template/components/FieldList.d.ts +1 -1
- package/build/template/components/FieldList.d.ts.map +1 -1
- package/build/template/components/FieldList.jsx +1 -1
- package/build/template/components/FieldList.jsx.map +1 -1
- package/build/template/components/FieldListSection.jsx +1 -1
- package/build/template/components/FieldListSection.jsx.map +1 -1
- package/build/template/components/Markdown.jsx +1 -1
- package/build/template/components/Markdown.jsx.map +1 -1
- package/build/template/components/Sidebar.d.ts +2 -2
- package/build/template/components/Sidebar.d.ts.map +1 -1
- package/build/template/components/Sidebar.jsx +2 -2
- package/build/template/components/Sidebar.jsx.map +1 -1
- package/build/template/components/TypeIndex.jsx +1 -1
- package/build/template/components/TypeIndex.jsx.map +1 -1
- package/build/template/components/graphql/type-kind-icon.d.ts +2 -2
- package/build/template/components/graphql/type-kind-icon.d.ts.map +1 -1
- package/build/template/components/graphql/type-kind-icon.jsx +1 -1
- package/build/template/components/graphql/type-link.d.ts +1 -1
- package/build/template/components/graphql/type-link.d.ts.map +1 -1
- package/build/template/components/graphql/type-link.jsx +2 -2
- package/build/template/components/graphql/type-link.jsx.map +1 -1
- package/build/template/entry.client.jsx +1 -1
- package/build/template/entry.client.jsx.map +1 -1
- package/build/template/routes/changelog.d.ts +1 -1
- package/build/template/routes/changelog.jsx +2 -2
- package/build/template/routes/changelog.jsx.map +1 -1
- package/build/template/routes/index.d.ts +1 -1
- package/build/template/routes/index.d.ts.map +1 -1
- package/build/template/routes/index.jsx +1 -1
- package/build/template/routes/index.jsx.map +1 -1
- package/build/template/routes/reference.$type.$field.jsx +3 -3
- package/build/template/routes/reference.$type.$field.jsx.map +1 -1
- package/build/template/routes/reference.$type.jsx +2 -2
- package/build/template/routes/reference.$type.jsx.map +1 -1
- package/build/template/routes/reference.jsx +2 -2
- package/build/template/routes/reference.jsx.map +1 -1
- package/build/template/routes/root.d.ts +1 -1
- package/build/template/routes/root.d.ts.map +1 -1
- package/build/template/routes/root.jsx +3 -3
- package/build/template/routes/root.jsx.map +1 -1
- package/build/template/server/app.d.ts +1 -1
- package/build/template/server/app.d.ts.map +1 -1
- package/build/template/server/app.js +5 -4
- package/build/template/server/app.js.map +1 -1
- package/build/template/server/main.js +3 -3
- package/build/template/server/manifest.d.ts +1 -1
- package/build/template/server/manifest.d.ts.map +1 -1
- package/build/template/server/render-page.d.ts +1 -1
- package/build/template/server/render-page.d.ts.map +1 -1
- package/build/template/server/render-page.jsx +3 -3
- package/build/template/server/render-page.jsx.map +1 -1
- package/build/template/server/ssg/generate.d.ts +1 -1
- package/build/template/server/ssg/generate.d.ts.map +1 -1
- package/build/template/server/ssg/generate.js +3 -3
- package/build/template/server/ssg/generate.js.map +1 -1
- package/build/template/server/ssg/get-route-paths.js +2 -2
- package/build/template/server/ssg/get-route-paths.js.map +1 -1
- package/package.json +77 -56
- package/src/api/api.ts +3 -3
- package/src/api/builder/builder.ts +3 -3
- package/src/api/builder/index.ts +1 -1
- package/src/api/config/config.ts +4 -4
- package/src/api/config/configurator.ts +27 -5
- package/src/api/config/define.ts +1 -1
- package/src/api/config/index.ts +1 -1
- package/src/api/config/load.ts +74 -23
- package/src/api/config/merge.ts +2 -2
- package/src/api/config-resolver/config-resolver.ts +2 -2
- package/src/api/config-resolver/index.ts +1 -1
- package/src/api/config-resolver/resolve.ts +8 -5
- package/src/api/config-resolver/vite.ts +3 -3
- package/src/api/index.ts +1 -1
- package/src/api/schema/data-sources/data-sources.ts +3 -3
- package/src/api/schema/data-sources/index.ts +1 -1
- package/src/api/schema/data-sources/memory/memory.ts +4 -4
- package/src/api/schema/data-sources/schema-directory/file-name-expression/index.ts +1 -1
- package/src/api/schema/data-sources/schema-directory/schema-directory.ts +7 -7
- package/src/api/schema/data-sources/schema-file/schema-file.ts +4 -4
- package/src/api/schema/index.ts +1 -1
- package/src/api/schema/read.ts +2 -2
- package/src/api/schema/schema.ts +3 -3
- package/src/api/schema-augmentation/augmentations/description.ts +3 -3
- package/src/api/schema-augmentation/index.ts +1 -1
- package/src/api/schema-augmentation/schema-augmentation.ts +2 -2
- package/src/api/schema-augmentation/target.ts +1 -1
- package/src/api/singletons/markdown/index.ts +1 -1
- package/src/api/vite/log-filters.ts +1 -1
- package/src/api/vite/logger.ts +23 -7
- package/src/api/vite/plugins/build.ts +6 -6
- package/src/api/vite/plugins/core.ts +172 -240
- package/src/api/vite/plugins/main.ts +24 -23
- package/src/api/vite/plugins/pages-tree.ts +186 -0
- package/src/api/vite/plugins/serve.ts +52 -29
- package/src/api/vite/vi.ts +2 -2
- package/src/cli/_/self-contained-mode.ts +85 -0
- package/src/cli/commands/build.ts +2 -2
- package/src/cli/commands/dev.ts +3 -4
- package/src/cli/commands/open.ts +4 -4
- package/src/cli/index.ts +1 -1
- package/src/dep/graphql-inspector/index.ts +1 -1
- package/src/dep/hono/hono.ts +1 -1
- package/src/dep/hono/index.ts +1 -1
- package/src/dep/superjson/index.ts +1 -1
- package/src/dep/tiny-globby/index.ts +1 -1
- package/src/dep/vite/index.ts +1 -1
- package/src/exports/index.ts +1 -1
- package/src/exports/polen.ts +3 -3
- package/src/lib/apple-touch-icon/index.ts +1 -1
- package/src/lib/debug/debug.ts +45 -18
- package/src/lib/debug/environment-variable.ts +28 -7
- package/src/lib/debug/index.ts +1 -1
- package/src/lib/errors/ContextualAggregateError.ts +1 -1
- package/src/lib/errors/ContextualError.ts +1 -1
- package/src/lib/errors/ErrorInternal.ts +2 -2
- package/src/lib/errors/errors.ts +4 -4
- package/src/lib/errors/index.ts +1 -1
- package/src/lib/errors/types.ts +1 -1
- package/src/lib/favicon/index.ts +1 -1
- package/src/lib/file-router/diagnostic-reporter.ts +22 -0
- package/src/lib/file-router/file-router.ts +5 -3
- package/src/lib/file-router/index.test.ts +2 -2
- package/src/lib/file-router/index.ts +1 -1
- package/src/lib/file-router/linter.test.ts +115 -0
- package/src/lib/file-router/linter.ts +80 -6
- package/src/lib/file-router/route.ts +2 -1
- 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 +27 -12
- 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/grafaid/_Nodes.ts +1 -1
- package/src/lib/grafaid/document/OperationTypeNode.ts +1 -1
- package/src/lib/grafaid/document/kind.ts +1 -1
- package/src/lib/grafaid/document.ts +6 -6
- package/src/lib/grafaid/grafaid.ts +4 -4
- package/src/lib/grafaid/graphql.ts +3 -3
- package/src/lib/grafaid/http/__.ts +1 -1
- package/src/lib/grafaid/http/http.ts +1 -1
- package/src/lib/grafaid/index.ts +1 -1
- package/src/lib/grafaid/schema/KindMap/_.ts +6 -6
- package/src/lib/grafaid/schema/KindMap/__.ts +2 -2
- package/src/lib/grafaid/schema/OperationType/__.ts +2 -2
- package/src/lib/grafaid/schema/RootDetails.ts +3 -3
- package/src/lib/grafaid/schema/RootTypeMap.ts +2 -2
- package/src/lib/grafaid/schema/nodes-like.ts +2 -2
- package/src/lib/grafaid/schema/schema.ts +15 -15
- package/src/lib/grafaid/schema/type-kind-name.ts +1 -1
- package/src/lib/grafaid/schema/type.ts +1 -1
- package/src/lib/grafaid/schema/typeGuards.ts +1 -1
- package/src/lib/grafaid-old/grafaid.ts +1 -1
- package/src/lib/grafaid-old/index.ts +1 -1
- package/src/lib/graphql-change/graphql-change.ts +2 -2
- package/src/lib/graphql-change/index.ts +1 -1
- package/src/lib/graphql-changeset/graphql-changeset.ts +2 -2
- package/src/lib/graphql-changeset/index.ts +1 -1
- package/src/lib/graphql-schema-loader/graphql-schema-loader.ts +1 -1
- package/src/lib/graphql-schema-loader/index.ts +1 -1
- package/src/lib/hono-aid/hono-aid.ts +1 -1
- package/src/lib/hono-aid/index.ts +1 -1
- package/src/lib/kit-temp.ts +10 -0
- package/src/lib/react-router-aid/get-paths-patterns.ts +1 -1
- package/src/lib/react-router-aid/index.ts +1 -1
- package/src/lib/react-router-aid/react-router-aid.ts +2 -2
- package/src/lib/react-router-loader/react-router-loader.ts +1 -1
- package/src/lib/stack-processor/index.ts +1 -1
- package/src/lib/superjson-codec/codec.ts +1 -1
- package/src/lib/superjson-codec/codecs/graphql-schema.ts +2 -2
- package/src/lib/superjson-codec/exports.ts +2 -2
- package/src/lib/superjson-codec/index.ts +1 -1
- 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/vite-plugin-config/vite-plugin-config.ts +1 -1
- package/src/lib/vite-plugin-mdx/index.ts +1 -0
- package/src/lib/vite-plugin-mdx/vite-plugin-mdx.ts +91 -0
- package/src/lib/vite-plugins/index.ts +1 -1
- package/src/lib/vite-plugins/vite-plugins.ts +1 -2
- package/src/lib/vite-virtual/debug.ts +3 -0
- package/src/lib/vite-virtual/hooks.ts +1 -1
- package/src/lib/vite-virtual/identified-loader.ts +9 -5
- package/src/lib/vite-virtual/identifier.ts +1 -1
- package/src/lib/vite-virtual/index.ts +1 -1
- package/src/lib/vite-virtual/vite-virtual.ts +3 -3
- package/src/package-paths.ts +22 -1
- package/src/project-data.ts +4 -24
- package/src/singletons/debug.ts +3 -0
- package/src/singletons/superjson.ts +2 -2
- package/src/template/components/ArgumentListAnnotation.tsx +1 -1
- package/src/template/components/Changelog.tsx +6 -6
- package/src/template/components/DeprecationReason.tsx +1 -1
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/Field.tsx +1 -1
- package/src/template/components/FieldList.tsx +1 -1
- package/src/template/components/FieldListSection.tsx +1 -1
- package/src/template/components/Markdown.tsx +1 -1
- package/src/template/components/Sidebar.tsx +7 -6
- package/src/template/components/TypeIndex.tsx +1 -1
- package/src/template/components/graphql/type-kind-icon.tsx +3 -3
- package/src/template/components/graphql/type-kind-tokens.ts +1 -1
- package/src/template/components/graphql/type-link.tsx +2 -2
- package/src/template/entry.client.tsx +1 -1
- package/src/template/routes/changelog.tsx +2 -2
- package/src/template/routes/index.tsx +1 -1
- package/src/template/routes/reference.$type.$field.tsx +3 -3
- package/src/template/routes/reference.$type.tsx +2 -2
- package/src/template/routes/reference.tsx +2 -2
- package/src/template/routes/root.tsx +4 -5
- package/src/template/server/app.ts +6 -4
- package/src/template/server/main.ts +3 -3
- package/src/template/server/manifest.ts +1 -1
- package/src/template/server/render-page.tsx +5 -5
- package/src/template/server/ssg/generate.ts +4 -4
- package/src/template/server/ssg/get-route-paths.ts +2 -2
- package/build/lib/file-router/sidebar.d.ts +0 -2
- package/build/lib/file-router/sidebar.d.ts.map +0 -1
- package/build/lib/file-router/sidebar.js +0 -2
- package/build/lib/file-router/sidebar.js.map +0 -1
- package/build/lib/vite-plugins/output-logger.d.ts +0 -3
- package/build/lib/vite-plugins/output-logger.d.ts.map +0 -1
- package/build/lib/vite-plugins/output-logger.js +0 -13
- package/build/lib/vite-plugins/output-logger.js.map +0 -1
- package/src/lib/file-router/sidebar.ts +0 -0
- package/src/lib/vite-plugins/output-logger.ts +0 -14
@@ -0,0 +1,205 @@
|
|
1
|
+
import { TinyGlobby } from '#dep/tiny-globby/index'
|
2
|
+
import { Tree, type TreeNode } from '#lib/tree/index'
|
3
|
+
import { Path, Str } from '@wollybeard/kit'
|
4
|
+
import type { Diagnostic } from './linter.js'
|
5
|
+
import type { Route, RouteFile } from './route.js'
|
6
|
+
|
7
|
+
//
|
8
|
+
// Types
|
9
|
+
//
|
10
|
+
|
11
|
+
export type RouteTreeNodeType = 'directory' | 'file'
|
12
|
+
|
13
|
+
export interface RouteTreeNodeValue {
|
14
|
+
name: string
|
15
|
+
order?: number
|
16
|
+
type: RouteTreeNodeType
|
17
|
+
route?: Route // Only present for file nodes
|
18
|
+
}
|
19
|
+
|
20
|
+
export type RouteTreeNode = TreeNode<RouteTreeNodeValue>
|
21
|
+
|
22
|
+
export interface ScanTreeResult {
|
23
|
+
routeTree: RouteTreeNode
|
24
|
+
diagnostics: Diagnostic[]
|
25
|
+
}
|
26
|
+
|
27
|
+
//
|
28
|
+
// Constants
|
29
|
+
//
|
30
|
+
|
31
|
+
const conventions = {
|
32
|
+
index: {
|
33
|
+
name: `index`,
|
34
|
+
},
|
35
|
+
numberedPrefix: {
|
36
|
+
pattern: Str.pattern<{ groups: ['order', 'name'] }>(/^(?<order>\d+)[_-](?<name>.+)$/),
|
37
|
+
},
|
38
|
+
}
|
39
|
+
|
40
|
+
//
|
41
|
+
// Helpers
|
42
|
+
//
|
43
|
+
|
44
|
+
const parseSegment = (segment: string): { name: string; order?: number } => {
|
45
|
+
const match = Str.match(segment, conventions.numberedPrefix.pattern)
|
46
|
+
if (match) {
|
47
|
+
return {
|
48
|
+
name: match.groups.name,
|
49
|
+
order: parseInt(match.groups.order, 10),
|
50
|
+
}
|
51
|
+
}
|
52
|
+
return { name: segment }
|
53
|
+
}
|
54
|
+
|
55
|
+
const buildRouteTreeFromPaths = async (paths: string[], rootDir: string): Promise<RouteTreeNode> => {
|
56
|
+
// Root node (represents the pages directory itself)
|
57
|
+
const root = Tree.node<RouteTreeNodeValue>({
|
58
|
+
name: 'root',
|
59
|
+
type: 'directory',
|
60
|
+
})
|
61
|
+
|
62
|
+
// Process each file path
|
63
|
+
for (const filePath of paths) {
|
64
|
+
const relativePath = Path.relative(rootDir, filePath)
|
65
|
+
|
66
|
+
// Split the path into segments
|
67
|
+
const segments = relativePath.split(Path.sep).filter(s => s.length > 0)
|
68
|
+
if (segments.length === 0) continue // Skip root directory
|
69
|
+
|
70
|
+
// Navigate/create path in tree
|
71
|
+
let currentNode = root
|
72
|
+
|
73
|
+
for (let i = 0; i < segments.length; i++) {
|
74
|
+
const segment = segments[i]!
|
75
|
+
const isLast = i === segments.length - 1
|
76
|
+
|
77
|
+
// Parse segment for ordering
|
78
|
+
let segmentName = segment
|
79
|
+
// Strip extension for files
|
80
|
+
if (isLast && (segment.endsWith('.md') || segment.endsWith('.mdx'))) {
|
81
|
+
segmentName = segment.replace(/\.(md|mdx)$/, '')
|
82
|
+
}
|
83
|
+
const parsed = parseSegment(segmentName)
|
84
|
+
|
85
|
+
// Find existing child
|
86
|
+
const existingChildIndex = currentNode.children.findIndex(child => child.value.name === parsed.name)
|
87
|
+
let childNode = existingChildIndex >= 0 ? currentNode.children[existingChildIndex] : undefined
|
88
|
+
|
89
|
+
if (!childNode) {
|
90
|
+
// Create new node
|
91
|
+
if (isLast) {
|
92
|
+
// This is a file
|
93
|
+
const route = filePathToRoute(filePath, rootDir)
|
94
|
+
childNode = Tree.node<RouteTreeNodeValue>({
|
95
|
+
name: parsed.name,
|
96
|
+
order: parsed.order,
|
97
|
+
type: 'file',
|
98
|
+
route,
|
99
|
+
})
|
100
|
+
} else {
|
101
|
+
// This is a directory (implicit from file path)
|
102
|
+
childNode = Tree.node<RouteTreeNodeValue>({
|
103
|
+
name: parsed.name,
|
104
|
+
order: parsed.order,
|
105
|
+
type: 'directory',
|
106
|
+
})
|
107
|
+
}
|
108
|
+
currentNode.children.push(childNode)
|
109
|
+
} else if (isLast && childNode.value.type === 'file') {
|
110
|
+
// Handle collision for files with same name
|
111
|
+
// If new file has higher or equal order, replace the existing one (last wins for ties)
|
112
|
+
if (
|
113
|
+
parsed.order !== undefined
|
114
|
+
&& (childNode.value.order === undefined || parsed.order >= childNode.value.order)
|
115
|
+
) {
|
116
|
+
const route = filePathToRoute(filePath, rootDir)
|
117
|
+
const newNode = Tree.node<RouteTreeNodeValue>({
|
118
|
+
name: parsed.name,
|
119
|
+
order: parsed.order,
|
120
|
+
type: 'file',
|
121
|
+
route,
|
122
|
+
})
|
123
|
+
currentNode.children[existingChildIndex] = newNode
|
124
|
+
childNode = newNode
|
125
|
+
}
|
126
|
+
// Otherwise keep the existing node (when existing has higher order)
|
127
|
+
}
|
128
|
+
|
129
|
+
currentNode = childNode
|
130
|
+
}
|
131
|
+
}
|
132
|
+
|
133
|
+
// Sort the tree
|
134
|
+
return sortRouteTree(root)
|
135
|
+
}
|
136
|
+
|
137
|
+
const sortRouteTree = (tree: RouteTreeNode): RouteTreeNode => {
|
138
|
+
return Tree.sort(tree, (a, b) => {
|
139
|
+
// If both have orders, sort by order
|
140
|
+
if (a.order !== undefined && b.order !== undefined) {
|
141
|
+
return a.order - b.order
|
142
|
+
}
|
143
|
+
// If only one has order, it comes first
|
144
|
+
if (a.order !== undefined) return -1
|
145
|
+
if (b.order !== undefined) return 1
|
146
|
+
// Otherwise sort alphabetically
|
147
|
+
return a.name.localeCompare(b.name)
|
148
|
+
})
|
149
|
+
}
|
150
|
+
|
151
|
+
//
|
152
|
+
// Main scan function
|
153
|
+
//
|
154
|
+
|
155
|
+
export const scanTree = async (parameters: {
|
156
|
+
dir: string
|
157
|
+
glob?: string
|
158
|
+
}): Promise<ScanTreeResult> => {
|
159
|
+
const { dir, glob = `**/*` } = parameters
|
160
|
+
|
161
|
+
// Get all files
|
162
|
+
const filePaths = await TinyGlobby.glob(glob, {
|
163
|
+
absolute: true,
|
164
|
+
cwd: dir,
|
165
|
+
onlyFiles: true,
|
166
|
+
})
|
167
|
+
|
168
|
+
// Build tree structure (directories will be created implicitly)
|
169
|
+
const routeTree = await buildRouteTreeFromPaths(filePaths, dir)
|
170
|
+
|
171
|
+
// TODO: Implement tree-based linting
|
172
|
+
const diagnostics: Diagnostic[] = []
|
173
|
+
|
174
|
+
return {
|
175
|
+
routeTree,
|
176
|
+
diagnostics,
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
// Reuse existing route creation logic
|
181
|
+
const filePathToRoute = (filePathExpression: string, rootDir: string): Route => {
|
182
|
+
const file: RouteFile = {
|
183
|
+
path: {
|
184
|
+
absolute: Path.parse(filePathExpression),
|
185
|
+
relative: Path.parse(Path.relative(rootDir, filePathExpression)),
|
186
|
+
},
|
187
|
+
}
|
188
|
+
|
189
|
+
const dirPath = Str.split(Str.removeSurrounding(file.path.relative.dir, Path.sep), Path.sep)
|
190
|
+
|
191
|
+
// Parse numbered prefix from filename
|
192
|
+
const prefixMatch = file.path.relative.name.match(conventions.numberedPrefix.pattern)
|
193
|
+
const order = prefixMatch?.groups?.[`order`] ? parseInt(prefixMatch.groups[`order`], 10) : undefined
|
194
|
+
const nameWithoutPrefix = prefixMatch?.groups?.[`name`] ?? file.path.relative.name
|
195
|
+
|
196
|
+
const logical = {
|
197
|
+
path: nameWithoutPrefix === conventions.index.name ? dirPath : dirPath.concat(nameWithoutPrefix),
|
198
|
+
order,
|
199
|
+
}
|
200
|
+
|
201
|
+
return {
|
202
|
+
logical,
|
203
|
+
file,
|
204
|
+
}
|
205
|
+
}
|
@@ -1,7 +1,9 @@
|
|
1
|
-
import { TinyGlobby } from '#dep/tiny-globby/index
|
1
|
+
import { TinyGlobby } from '#dep/tiny-globby/index'
|
2
|
+
import { Tree } from '#lib/tree/index'
|
2
3
|
import { Path, Str } from '@wollybeard/kit'
|
3
|
-
import { type Diagnostic, lint } from './linter.
|
4
|
-
import type
|
4
|
+
import { type Diagnostic, lint } from './linter.ts'
|
5
|
+
import { type Route, type RouteFile, type RouteLogical, routeToPathExpression } from './route.ts'
|
6
|
+
import { scanTree } from './scan-tree.ts'
|
5
7
|
|
6
8
|
//
|
7
9
|
//
|
@@ -15,6 +17,9 @@ const conventions = {
|
|
15
17
|
index: {
|
16
18
|
name: `index`,
|
17
19
|
},
|
20
|
+
numberedPrefix: {
|
21
|
+
pattern: Str.pattern<{ groups: ['order', 'name'] }>(/^(?<order>\d+)[_-](?<name>.+)$/),
|
22
|
+
},
|
18
23
|
}
|
19
24
|
|
20
25
|
//
|
@@ -42,18 +47,21 @@ export const scan = async (parameters: {
|
|
42
47
|
dir: string
|
43
48
|
glob?: string
|
44
49
|
}): Promise<ScanResult> => {
|
45
|
-
|
50
|
+
// Use tree-based scanner
|
51
|
+
const treeResult = await scanTree(parameters)
|
46
52
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
53
|
+
// Flatten tree to get routes
|
54
|
+
const routes: Route[] = []
|
55
|
+
Tree.visit(treeResult.routeTree, (node) => {
|
56
|
+
if (node.value.type === 'file' && node.value.route) {
|
57
|
+
routes.push(node.value.route)
|
58
|
+
}
|
51
59
|
})
|
52
60
|
|
53
|
-
|
54
|
-
|
61
|
+
// Apply linting
|
55
62
|
const lintResult = lint(routes)
|
56
63
|
|
64
|
+
// Routes are already sorted by the tree structure
|
57
65
|
return lintResult
|
58
66
|
}
|
59
67
|
|
@@ -75,15 +83,22 @@ export const filePathToRoute = (filePathExpression: string, rootDir: string): Ro
|
|
75
83
|
export const filePathToRouteLogical = (filePath: Path.Parsed): RouteLogical => {
|
76
84
|
const dirPath = Str.split(Str.removeSurrounding(filePath.dir, Path.sep), Path.sep)
|
77
85
|
|
78
|
-
|
86
|
+
// Parse numbered prefix from filename
|
87
|
+
const prefixMatch = Str.match(filePath.name, conventions.numberedPrefix.pattern)
|
88
|
+
const order = prefixMatch ? parseInt(prefixMatch.groups.order, 10) : undefined
|
89
|
+
const nameWithoutPrefix = prefixMatch?.groups.name ?? filePath.name
|
90
|
+
|
91
|
+
if (nameWithoutPrefix === conventions.index.name) {
|
79
92
|
const path = dirPath
|
80
93
|
return {
|
81
94
|
path,
|
95
|
+
order,
|
82
96
|
}
|
83
97
|
}
|
84
98
|
|
85
|
-
const path = dirPath.concat(
|
99
|
+
const path = dirPath.concat(nameWithoutPrefix)
|
86
100
|
return {
|
87
101
|
path,
|
102
|
+
order,
|
88
103
|
}
|
89
104
|
}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
import { Tree } from '#lib/tree/index'
|
2
|
+
import { describe, expect, test } from 'vitest'
|
3
|
+
import type { RouteTreeNode, RouteTreeNodeValue } from '../scan-tree.ts'
|
4
|
+
import { buildFromTree } from './sidebar-tree.ts'
|
5
|
+
|
6
|
+
// Helper to create mock routes
|
7
|
+
const mockRoute = (path: string[]) => ({
|
8
|
+
logical: { path },
|
9
|
+
file: {
|
10
|
+
path: {
|
11
|
+
absolute: { root: '/', dir: '/', base: 'file.md', ext: '.md', name: 'file' },
|
12
|
+
relative: { root: '', dir: '', base: 'file.md', ext: '.md', name: 'file' },
|
13
|
+
},
|
14
|
+
},
|
15
|
+
})
|
16
|
+
|
17
|
+
// Helper to create file node
|
18
|
+
const fileNode = (name: string, route: any): RouteTreeNode =>
|
19
|
+
Tree.node<RouteTreeNodeValue>({ name, type: 'file', route })
|
20
|
+
|
21
|
+
// Helper to create directory node
|
22
|
+
const dirNode = (name: string, children: RouteTreeNode[] = []): RouteTreeNode =>
|
23
|
+
Tree.node<RouteTreeNodeValue>({ name, type: 'directory' }, children)
|
24
|
+
|
25
|
+
describe('sidebar-tree', () => {
|
26
|
+
test('builds sidebar from simple tree', () => {
|
27
|
+
const tree = dirNode('root', [
|
28
|
+
fileNode('getting-started', mockRoute(['getting-started'])),
|
29
|
+
dirNode('guide', [
|
30
|
+
fileNode('introduction', mockRoute(['guide', 'introduction'])),
|
31
|
+
fileNode('basics', mockRoute(['guide', 'basics'])),
|
32
|
+
]),
|
33
|
+
])
|
34
|
+
|
35
|
+
const sidebar = buildFromTree(tree, [])
|
36
|
+
|
37
|
+
expect(sidebar.items).toHaveLength(2)
|
38
|
+
expect(sidebar.items[0]).toMatchObject({
|
39
|
+
type: 'ItemLink',
|
40
|
+
pathExp: 'getting-started',
|
41
|
+
title: 'Getting Started',
|
42
|
+
})
|
43
|
+
const section = sidebar.items[1]
|
44
|
+
expect(section).toBeDefined()
|
45
|
+
expect(section!.type).toBe('ItemSection')
|
46
|
+
if (section!.type === 'ItemSection') {
|
47
|
+
expect(section).toMatchObject({
|
48
|
+
type: 'ItemSection',
|
49
|
+
title: 'Guide',
|
50
|
+
pathExp: 'guide',
|
51
|
+
isNavToo: false,
|
52
|
+
})
|
53
|
+
expect(section!.navs).toHaveLength(2)
|
54
|
+
}
|
55
|
+
})
|
56
|
+
|
57
|
+
test('handles index files correctly', () => {
|
58
|
+
const tree = dirNode('root', [
|
59
|
+
dirNode('guide', [
|
60
|
+
fileNode('index', mockRoute(['guide'])),
|
61
|
+
fileNode('introduction', mockRoute(['guide', 'introduction'])),
|
62
|
+
]),
|
63
|
+
])
|
64
|
+
|
65
|
+
const sidebar = buildFromTree(tree, [])
|
66
|
+
|
67
|
+
expect(sidebar.items).toHaveLength(1)
|
68
|
+
const section = sidebar.items[0]
|
69
|
+
expect(section).toBeDefined()
|
70
|
+
expect(section!.type).toBe('ItemSection')
|
71
|
+
if (section!.type === 'ItemSection') {
|
72
|
+
expect(section).toMatchObject({
|
73
|
+
type: 'ItemSection',
|
74
|
+
title: 'Guide',
|
75
|
+
pathExp: 'guide',
|
76
|
+
isNavToo: true, // Should be true because of index file
|
77
|
+
})
|
78
|
+
expect(section!.navs).toHaveLength(1) // Only introduction, not index
|
79
|
+
}
|
80
|
+
})
|
81
|
+
|
82
|
+
test('respects node ordering from tree', () => {
|
83
|
+
const tree = dirNode('root', [
|
84
|
+
Tree.node<RouteTreeNodeValue>({ name: 'quickstart', order: 5, type: 'file', route: mockRoute(['quickstart']) }),
|
85
|
+
Tree.node<RouteTreeNodeValue>({ name: 'guide', order: 10, type: 'file', route: mockRoute(['guide']) }),
|
86
|
+
fileNode('api', mockRoute(['api'])),
|
87
|
+
fileNode('troubleshooting', mockRoute(['troubleshooting'])),
|
88
|
+
])
|
89
|
+
|
90
|
+
const sidebar = buildFromTree(tree, [])
|
91
|
+
|
92
|
+
// Tree should already be sorted, so sidebar should maintain that order
|
93
|
+
const titles = sidebar.items.map(item => item.title)
|
94
|
+
expect(titles).toEqual(['Quickstart', 'Guide', 'Api', 'Troubleshooting'])
|
95
|
+
})
|
96
|
+
|
97
|
+
test('handles nested directories', () => {
|
98
|
+
const tree = dirNode('root', [
|
99
|
+
dirNode('guide', [
|
100
|
+
fileNode('intro', mockRoute(['guide', 'intro'])),
|
101
|
+
dirNode('advanced', [
|
102
|
+
fileNode('performance', mockRoute(['guide', 'advanced', 'performance'])),
|
103
|
+
fileNode('optimization', mockRoute(['guide', 'advanced', 'optimization'])),
|
104
|
+
]),
|
105
|
+
]),
|
106
|
+
])
|
107
|
+
|
108
|
+
const sidebar = buildFromTree(tree, [])
|
109
|
+
|
110
|
+
expect(sidebar.items).toHaveLength(1)
|
111
|
+
const guideSection = sidebar.items[0]
|
112
|
+
expect(guideSection).toBeDefined()
|
113
|
+
expect(guideSection!.type).toBe('ItemSection')
|
114
|
+
if (guideSection!.type === 'ItemSection') {
|
115
|
+
expect(guideSection!.navs).toHaveLength(3) // intro + 2 from advanced subdirectory
|
116
|
+
|
117
|
+
const navTitles = guideSection!.navs.map(nav => nav.title)
|
118
|
+
expect(navTitles).toContain('Intro')
|
119
|
+
expect(navTitles).toContain('Performance')
|
120
|
+
expect(navTitles).toContain('Optimization')
|
121
|
+
}
|
122
|
+
})
|
123
|
+
})
|
@@ -0,0 +1,110 @@
|
|
1
|
+
import { Tree } from '#lib/tree/index'
|
2
|
+
import { Str } from '@wollybeard/kit'
|
3
|
+
import * as FileRouter from '../file-router.ts'
|
4
|
+
import type { RouteTreeNode, RouteTreeNodeValue } from '../scan-tree.ts'
|
5
|
+
import type { ItemLink, ItemSection, Sidebar } from './types.ts'
|
6
|
+
|
7
|
+
export * from './types.ts'
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Build sidebar from tree structure
|
11
|
+
*/
|
12
|
+
export const buildFromTree = (routeTree: RouteTreeNode, basePath: FileRouter.Path): Sidebar => {
|
13
|
+
const navs: ItemLink[] = []
|
14
|
+
const sections: ItemSection[] = []
|
15
|
+
|
16
|
+
// Process only the children of the root node
|
17
|
+
for (const child of routeTree.children) {
|
18
|
+
processNode(child, basePath, [], navs, sections)
|
19
|
+
}
|
20
|
+
|
21
|
+
const items = [...navs, ...sections]
|
22
|
+
|
23
|
+
return {
|
24
|
+
items,
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
const processNode = (
|
29
|
+
node: RouteTreeNode,
|
30
|
+
basePath: FileRouter.Path,
|
31
|
+
parentPath: string[],
|
32
|
+
navs: ItemLink[],
|
33
|
+
sections: ItemSection[],
|
34
|
+
): void => {
|
35
|
+
const currentPath = [...parentPath, node.value.name]
|
36
|
+
|
37
|
+
if (node.value.type === 'directory') {
|
38
|
+
// This is a directory - create a section
|
39
|
+
const sectionPath = [...basePath, ...currentPath]
|
40
|
+
const sectionPathExp = FileRouter.pathToExpression(sectionPath)
|
41
|
+
const sectionTitle = Str.titlizeSlug(node.value.name)
|
42
|
+
|
43
|
+
const section: ItemSection = {
|
44
|
+
type: `ItemSection`,
|
45
|
+
title: sectionTitle,
|
46
|
+
pathExp: sectionPathExp.startsWith('/') ? sectionPathExp.slice(1) : sectionPathExp,
|
47
|
+
isNavToo: false,
|
48
|
+
navs: [],
|
49
|
+
}
|
50
|
+
|
51
|
+
// Check if this directory has an index file
|
52
|
+
const indexChild = node.children.find(child => child.value.type === 'file' && child.value.name === 'index')
|
53
|
+
if (indexChild) {
|
54
|
+
section.isNavToo = true
|
55
|
+
}
|
56
|
+
|
57
|
+
// Process all non-index children as navs for this section
|
58
|
+
for (const child of node.children) {
|
59
|
+
if (child.value.type === 'file' && child.value.name !== 'index' && child.value.route) {
|
60
|
+
// Pass the parent path of the route, not the section path
|
61
|
+
const routeParentPath = child.value.route.logical.path.slice(0, -1)
|
62
|
+
section.navs.push(routeToItemLink(child.value.route, routeParentPath))
|
63
|
+
} else if (child.value.type === 'directory') {
|
64
|
+
// Recursively process subdirectories
|
65
|
+
// Note: This creates nested sections which the original implementation doesn't support
|
66
|
+
// For now, we'll just add the files from subdirectories to the parent section
|
67
|
+
collectFilesFromDirectory(child, child.value.route?.logical.path || [], section.navs)
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
sections.push(section)
|
72
|
+
} else if (node.value.type === 'file' && node.value.route) {
|
73
|
+
// This is a top-level file - add as nav
|
74
|
+
if (node.value.name !== 'index') {
|
75
|
+
navs.push(routeToItemLink(node.value.route, basePath))
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
const collectFilesFromDirectory = (
|
81
|
+
node: RouteTreeNode,
|
82
|
+
basePath: FileRouter.Path,
|
83
|
+
navs: ItemLink[],
|
84
|
+
): void => {
|
85
|
+
Tree.visit(node, (n) => {
|
86
|
+
if (n.value.type === 'file' && n.value.route && n.value.name !== 'index') {
|
87
|
+
// Use the route's parent path for relative title generation
|
88
|
+
const routeParentPath = n.value.route.logical.path.slice(0, -1)
|
89
|
+
navs.push(routeToItemLink(n.value.route, routeParentPath))
|
90
|
+
}
|
91
|
+
})
|
92
|
+
}
|
93
|
+
|
94
|
+
const routeToItemLink = (route: FileRouter.Route, basePath: FileRouter.Path): ItemLink => {
|
95
|
+
const pagePathExp = FileRouter.routeToPathExpression(route)
|
96
|
+
const pageRelative = FileRouter.makeRelativeUnsafe(route, basePath)
|
97
|
+
const pageRelativePathExp = FileRouter.routeToPathExpression(pageRelative)
|
98
|
+
|
99
|
+
// Remove leading slash for title generation
|
100
|
+
const titlePath = pageRelativePathExp.startsWith('/') ? pageRelativePathExp.slice(1) : pageRelativePathExp
|
101
|
+
|
102
|
+
// Use only the last segment for the title
|
103
|
+
const titleSegment = pageRelative.logical.path[pageRelative.logical.path.length - 1] || titlePath
|
104
|
+
|
105
|
+
return {
|
106
|
+
type: `ItemLink`,
|
107
|
+
pathExp: pagePathExp.startsWith('/') ? pagePathExp.slice(1) : pagePathExp,
|
108
|
+
title: Str.titlizeSlug(titleSegment),
|
109
|
+
}
|
110
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export interface Sidebar {
|
2
|
+
items: Item[]
|
3
|
+
}
|
4
|
+
|
5
|
+
export type Item = ItemLink | ItemSection
|
6
|
+
|
7
|
+
export interface ItemLink {
|
8
|
+
type: `ItemLink`
|
9
|
+
title: string
|
10
|
+
pathExp: string
|
11
|
+
}
|
12
|
+
|
13
|
+
export interface ItemSection {
|
14
|
+
type: `ItemSection`
|
15
|
+
title: string
|
16
|
+
pathExp: string
|
17
|
+
isNavToo: boolean
|
18
|
+
navs: ItemLink[]
|
19
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export * as Nodes from './document.
|
1
|
+
export * as Nodes from './document.ts'
|
@@ -24,10 +24,10 @@ import {
|
|
24
24
|
type VariableNode,
|
25
25
|
} from 'graphql'
|
26
26
|
import type { HasRequiredKeys } from 'type-fest'
|
27
|
-
import { Kind } from './document/kind.
|
28
|
-
import { OperationTypeNode } from './document/OperationTypeNode.
|
29
|
-
// import type { RequestDocumentNodeInput } from './request.
|
30
|
-
export { OperationType } from './schema/OperationType/__.
|
27
|
+
import { Kind } from './document/kind.ts'
|
28
|
+
import { OperationTypeNode } from './document/OperationTypeNode.ts'
|
29
|
+
// import type { RequestDocumentNodeInput } from './request.ts'
|
30
|
+
export { OperationType } from './schema/OperationType/__.ts'
|
31
31
|
|
32
32
|
export type {
|
33
33
|
ArgumentNode,
|
@@ -55,9 +55,9 @@ export type {
|
|
55
55
|
VariableNode,
|
56
56
|
} from 'graphql'
|
57
57
|
|
58
|
-
export { OperationTypeNode } from './document/OperationTypeNode.
|
58
|
+
export { OperationTypeNode } from './document/OperationTypeNode.ts'
|
59
59
|
|
60
|
-
export { Kind } from './document/kind.
|
60
|
+
export { Kind } from './document/kind.ts'
|
61
61
|
|
62
62
|
export type $Any =
|
63
63
|
| DirectiveNode
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export * as Document from './document.
|
2
|
-
export * from './graphql.
|
3
|
-
export * as HTTP from './http/http.
|
4
|
-
export * as Schema from './schema/schema.
|
1
|
+
export * as Document from './document.ts'
|
2
|
+
export * from './graphql.ts'
|
3
|
+
export * as HTTP from './http/http.ts'
|
4
|
+
export * as Schema from './schema/schema.ts'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { neverCase } from '@wollybeard/kit/language'
|
2
2
|
import type { GraphQLNamedType, GraphQLScalarType } from 'graphql'
|
3
3
|
import { isEnumType, isInputObjectType, isInterfaceType, isObjectType, isScalarType, isUnionType } from 'graphql'
|
4
|
-
import type { KindMap } from './schema/schema.
|
5
|
-
import { isScalarTypeCustom } from './schema/schema.
|
4
|
+
import type { KindMap } from './schema/schema.ts'
|
5
|
+
import { isScalarTypeCustom } from './schema/schema.ts'
|
6
6
|
|
7
7
|
export {
|
8
8
|
type ExecutionResult,
|
@@ -11,7 +11,7 @@ export {
|
|
11
11
|
type GraphQLFormattedError as FormattedExecutionResultError,
|
12
12
|
} from 'graphql'
|
13
13
|
|
14
|
-
export * from './_Nodes.
|
14
|
+
export * from './_Nodes.ts'
|
15
15
|
|
16
16
|
export const StandardScalarTypeNames = {
|
17
17
|
String: `String`,
|
@@ -1 +1 @@
|
|
1
|
-
export * as GraphQLHTTP from './http.
|
1
|
+
export * as GraphQLHTTP from './http.ts'
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { FormattedExecutionResult, GraphQLFormattedError } from 'graphql'
|
2
|
-
// import { CONTENT_TYPE_GQL, CONTENT_TYPE_JSON } from '../../http.
|
2
|
+
// import { CONTENT_TYPE_GQL, CONTENT_TYPE_JSON } from '../../http.ts'
|
3
3
|
import { Rec } from '@wollybeard/kit'
|
4
4
|
|
5
5
|
export interface RequestConfig {
|
package/src/lib/grafaid/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Grafaid from './grafaid.
|
1
|
+
export * as Grafaid from './grafaid.ts'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import type { GraphQLInterfaceType } from 'graphql'
|
2
|
-
import { getRootTypeMap } from '../RootTypeMap.
|
3
|
-
import type { Schema } from '../schema.
|
4
|
-
import * as Type from '../type.
|
5
|
-
import { isRoot } from '../type.
|
6
|
-
import { isScalarTypeCustom } from '../typeGuards.
|
7
|
-
import type { KindMap } from './__.
|
2
|
+
import { getRootTypeMap } from '../RootTypeMap.ts'
|
3
|
+
import type { Schema } from '../schema.ts'
|
4
|
+
import * as Type from '../type.ts'
|
5
|
+
import { isRoot } from '../type.ts'
|
6
|
+
import { isScalarTypeCustom } from '../typeGuards.ts'
|
7
|
+
import type { KindMap } from './__.ts'
|
8
8
|
|
9
9
|
export const Name = {
|
10
10
|
Root: `Root`,
|
@@ -6,9 +6,9 @@ import type {
|
|
6
6
|
GraphQLScalarType,
|
7
7
|
GraphQLUnionType,
|
8
8
|
} from 'graphql'
|
9
|
-
import type { RootTypeMap } from '../RootTypeMap.
|
9
|
+
import type { RootTypeMap } from '../RootTypeMap.ts'
|
10
10
|
|
11
|
-
export * as KindMap from './_.
|
11
|
+
export * as KindMap from './_.ts'
|
12
12
|
|
13
13
|
export interface KindMap {
|
14
14
|
root: RootTypeMap
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { OperationTypeMutation, OperationTypeQuery, OperationTypeSubscription } from './_.
|
1
|
+
import type { OperationTypeMutation, OperationTypeQuery, OperationTypeSubscription } from './_.ts'
|
2
2
|
|
3
|
-
export * as OperationType from './_.
|
3
|
+
export * as OperationType from './_.ts'
|
4
4
|
export type OperationType = OperationTypeQuery | OperationTypeMutation | OperationTypeSubscription
|