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
@@ -1,124 +1,166 @@
|
|
1
|
-
import type { Config } from '#api/config/index
|
2
|
-
import
|
3
|
-
import type {
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import
|
7
|
-
import {
|
1
|
+
import type { Config } from '#api/config/index'
|
2
|
+
import { VitePluginSelfContainedMode } from '#cli/_/self-contained-mode'
|
3
|
+
import type { ReactRouter } from '#dep/react-router/index'
|
4
|
+
import type { Vite } from '#dep/vite/index'
|
5
|
+
import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter'
|
6
|
+
import { FileRouter } from '#lib/file-router/index'
|
7
|
+
import { Tree } from '#lib/tree/index'
|
8
|
+
import { ViteVirtual } from '#lib/vite-virtual/index'
|
9
|
+
import { debug } from '#singletons/debug'
|
10
|
+
import { Json, Str } from '@wollybeard/kit'
|
8
11
|
import jsesc from 'jsesc'
|
9
|
-
import
|
10
|
-
import
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
SiteNavigationItem,
|
17
|
-
} from '../../../project-data.js'
|
18
|
-
import { superjson } from '../../../singletons/superjson.js'
|
19
|
-
import { SchemaAugmentation } from '../../schema-augmentation/index.js'
|
20
|
-
import { Schema } from '../../schema/index.js'
|
21
|
-
import { logger } from '../logger.js'
|
22
|
-
import { vi as pvi } from '../vi.js'
|
12
|
+
import type { ProjectData, SidebarIndex, SiteNavigationItem } from '../../../project-data.ts'
|
13
|
+
import { superjson } from '../../../singletons/superjson.ts'
|
14
|
+
import { SchemaAugmentation } from '../../schema-augmentation/index.ts'
|
15
|
+
import { Schema } from '../../schema/index.ts'
|
16
|
+
import { logger } from '../logger.ts'
|
17
|
+
import { polenVirtual } from '../vi.ts'
|
18
|
+
import { createPagesTreePlugin, getRouteTree } from './pages-tree.ts'
|
23
19
|
|
24
|
-
const
|
25
|
-
|
26
|
-
const
|
20
|
+
const _debug = debug.sub(`vite-plugin-core`)
|
21
|
+
|
22
|
+
const viTemplateVariables = polenVirtual([`template`, `variables`])
|
23
|
+
const viTemplateSchemaAugmentations = polenVirtual([`template`, `schema-augmentations`])
|
24
|
+
const viProjectData = polenVirtual([`project`, `data`])
|
27
25
|
|
28
|
-
const viProjectPages = pvi([`project`, `pages.jsx`], { allowPluginProcessing: true })
|
29
26
|
export interface ProjectPagesModule {
|
30
27
|
pages: ReactRouter.RouteObject[]
|
31
28
|
}
|
32
29
|
|
33
30
|
export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
31
|
+
// State for current pages data (updated by pages plugin)
|
32
|
+
let currentPagesData: FileRouter.ScanResult | null = null
|
33
|
+
let currentTreeData: FileRouter.RouteTreeNode | null = null
|
34
|
+
let viteDevServer: Vite.ViteDevServer | null = null
|
35
|
+
|
36
|
+
// Schema cache management
|
37
|
+
let schemaCache: Awaited<ReturnType<typeof Schema.readOrThrow>> | null = null
|
38
|
+
|
39
|
+
const readSchema = async () => {
|
40
|
+
if (schemaCache === null) {
|
41
|
+
const schema = await Schema.readOrThrow({
|
42
|
+
...config.schema,
|
43
|
+
projectRoot: config.paths.project.rootDir,
|
44
|
+
})
|
45
|
+
// todo: augmentations scoped to a version
|
46
|
+
schema?.versions.forEach(version => {
|
47
|
+
SchemaAugmentation.apply(version.after, config.schemaAugmentations)
|
48
|
+
})
|
49
|
+
schemaCache = schema
|
50
|
+
}
|
51
|
+
return schemaCache
|
52
|
+
}
|
53
|
+
|
54
|
+
const plugins: Vite.Plugin[] = []
|
55
|
+
|
56
|
+
// Note: The main use for this right now is to resolve the react imports
|
57
|
+
// from the mdx vite plugin which have to go through the Polen exports since Polen keeps those deps bundled.
|
58
|
+
//
|
59
|
+
// If we manage to get the mdx vite plugin that defers JSX transform to Rolldown then we can remove this!
|
60
|
+
//
|
61
|
+
if (config.advanced.isSelfContainedMode) {
|
62
|
+
plugins.push(VitePluginSelfContainedMode({
|
63
|
+
projectDirPathExp: config.paths.project.rootDir,
|
64
|
+
}))
|
65
|
+
}
|
51
66
|
|
52
67
|
return [
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
68
|
+
...plugins,
|
69
|
+
|
70
|
+
// Self-contained pages plugin
|
71
|
+
...createPagesTreePlugin({
|
72
|
+
config,
|
73
|
+
onPagesChange: (pages) => {
|
74
|
+
currentPagesData = pages
|
75
|
+
// Invalidate project data virtual module to regenerate navigation/sidebar
|
76
|
+
if (viteDevServer) {
|
77
|
+
const projectDataModule = viteDevServer.moduleGraph.getModuleById(viProjectData.resolved)
|
78
|
+
if (projectDataModule) {
|
79
|
+
viteDevServer.moduleGraph.invalidateModule(projectDataModule)
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
onTreeChange: (tree) => {
|
84
|
+
currentTreeData = tree
|
85
|
+
},
|
86
|
+
}),
|
87
|
+
/**
|
88
|
+
* If a `polen*` import is encountered from the user's project, resolve it to the currently
|
89
|
+
* running source code of Polen rather than the user's node_modules.
|
90
|
+
*
|
91
|
+
* Useful for the following cases:
|
92
|
+
*
|
93
|
+
* 1. Main: Using Polen CLI from the source code against some local example/development project.
|
94
|
+
*
|
95
|
+
* 2. Secondary: Using Polen CLI on a project that does not have Polen installed.
|
96
|
+
* (User would likely not want to do this because they would not be able to achieve type safety)
|
97
|
+
*/
|
80
98
|
|
81
|
-
// const code = `export default ${JSON.stringify(htmlString)}`
|
82
|
-
// return code
|
83
|
-
// }
|
84
|
-
// return null
|
85
|
-
// },
|
86
|
-
// },
|
87
99
|
{
|
88
|
-
name: `polen:
|
100
|
+
name: `polen:internal-import-alias`,
|
89
101
|
resolveId(id, importer) {
|
90
|
-
|
102
|
+
const d = debug.sub(`vite-plugin:internal-import-alias`)
|
103
|
+
|
104
|
+
const isPolenImporter = Boolean(
|
105
|
+
importer
|
106
|
+
&& (
|
107
|
+
importer.startsWith(config.paths.framework.sourceDir)
|
108
|
+
|| polenVirtual.includes(importer)
|
109
|
+
/*
|
110
|
+
TODO: can we make index.html be in the source dir?
|
111
|
+
Example case:
|
112
|
+
|
113
|
+
POLEN VITE_PLUGIN_INTERNAL_IMPORT_ALIAS CHECK {
|
114
|
+
id: '#singletons/superjson',
|
115
|
+
importer: '/Users/jasonkuhrt/projects/the-guild-org/polen/index.html',
|
116
|
+
isPolenImporter: false
|
117
|
+
}
|
118
|
+
*/
|
119
|
+
|| (importer.startsWith(config.paths.framework.rootDir) && importer.endsWith(`index.html`))
|
120
|
+
),
|
121
|
+
)
|
122
|
+
|
123
|
+
if (!isPolenImporter) return null
|
124
|
+
d(`check candidate`, { id, importer, isPolenImporter })
|
91
125
|
|
92
126
|
const find = Str.pattern<{ groups: [`path`] }>(/^#(?<path>.+)/)
|
93
127
|
const match = Str.match(id, find)
|
94
128
|
if (!match) return null
|
95
129
|
|
96
|
-
const
|
97
|
-
|
130
|
+
const to = `${config.paths.framework.sourceDir}/${match.groups.path}${config.paths.framework.sourceExtension}`
|
131
|
+
d(`did resolve`, { from: id, to })
|
132
|
+
|
133
|
+
return to
|
98
134
|
},
|
99
135
|
},
|
100
136
|
{
|
101
137
|
name: `polen:core`,
|
138
|
+
configureServer(server) {
|
139
|
+
viteDevServer = server
|
140
|
+
},
|
102
141
|
config(_, { command }) {
|
103
142
|
// isServing = command === `serve`
|
104
143
|
return {
|
105
144
|
root: config.paths.framework.rootDir,
|
106
145
|
define: {
|
107
|
-
__BUILDING__: Json.
|
108
|
-
__SERVING__: Json.
|
109
|
-
__COMMAND__: Json.
|
110
|
-
__BUILD_ARCHITECTURE__: Json.
|
111
|
-
__BUILD_ARCHITECTURE_SSG__: Json.
|
112
|
-
},
|
113
|
-
server: {
|
114
|
-
port: 3000,
|
146
|
+
__BUILDING__: Json.encode(command === `build`),
|
147
|
+
__SERVING__: Json.encode(command === `serve`),
|
148
|
+
__COMMAND__: Json.encode(command),
|
149
|
+
__BUILD_ARCHITECTURE__: Json.encode(config.build.architecture),
|
150
|
+
__BUILD_ARCHITECTURE_SSG__: Json.encode(config.build.architecture === `ssg`),
|
115
151
|
},
|
116
152
|
customLogger: logger,
|
153
|
+
esbuild: false,
|
117
154
|
build: {
|
118
155
|
target: `esnext`,
|
119
156
|
assetsDir: config.paths.project.relative.build.relative.assets,
|
120
157
|
rollupOptions: {
|
121
|
-
treeshake:
|
158
|
+
treeshake: {
|
159
|
+
// Aggressive tree-shaking for smallest bundles
|
160
|
+
moduleSideEffects: false, // Only include code if an export is actually used
|
161
|
+
annotations: true, // Respect @__PURE__ annotations for better dead code elimination
|
162
|
+
unknownGlobalSideEffects: false, // Assume global functions don't have side effects
|
163
|
+
},
|
122
164
|
},
|
123
165
|
minify: !config.advanced.debug,
|
124
166
|
outDir: config.paths.project.absolute.build.root,
|
@@ -144,9 +186,27 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
144
186
|
{
|
145
187
|
identifier: viProjectData,
|
146
188
|
async loader() {
|
189
|
+
_debug(`loadingViProjectDataVirtualModule`)
|
147
190
|
// todo: parallel
|
148
191
|
const schema = await readSchema()
|
149
|
-
|
192
|
+
|
193
|
+
// Get pages data from the pages plugin or load initially
|
194
|
+
if (!currentPagesData) {
|
195
|
+
_debug(`loadingPagesDataInitially`)
|
196
|
+
currentPagesData = await FileRouter.scan({
|
197
|
+
dir: config.paths.project.absolute.pages,
|
198
|
+
glob: `**/*.{md,mdx}`,
|
199
|
+
})
|
200
|
+
// Report any diagnostics from initial scan
|
201
|
+
reportDiagnostics(currentPagesData.diagnostics)
|
202
|
+
}
|
203
|
+
if (!currentTreeData) {
|
204
|
+
_debug(`loadingTreeDataInitially`)
|
205
|
+
currentTreeData = await getRouteTree(config)
|
206
|
+
}
|
207
|
+
const pagesScanResult = currentPagesData
|
208
|
+
const routeTree = currentTreeData
|
209
|
+
_debug(`usingPageRoutesFromPagesPlugin`, pagesScanResult.routes.length)
|
150
210
|
|
151
211
|
const siteNavigationItems: SiteNavigationItem[] = []
|
152
212
|
|
@@ -154,37 +214,24 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
154
214
|
// ━━ Build Navbar
|
155
215
|
//
|
156
216
|
|
157
|
-
//
|
158
|
-
const
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
const topDirsPaths = pagesScanResult.routes
|
168
|
-
.filter(FileRouter.routeIsSubLevel)
|
169
|
-
// todo: kit, slice that understands non-empty
|
170
|
-
// Arr.slice(route.path.segments, 1)
|
171
|
-
.map(route => [route.logical.path[0]])
|
172
|
-
|
173
|
-
for (const dir of topDirsPaths) {
|
174
|
-
const pathExp = FileRouter.pathToExpression(dir)
|
175
|
-
const title = Str.titlizeSlug(pathExp)
|
176
|
-
// todo: this should never happen, if it does, swarn user
|
177
|
-
// Only add if not already added as a top page
|
178
|
-
if (!siteNavigationItems.some(item => item.pathExp === pathExp)) {
|
179
|
-
siteNavigationItems.push({ pathExp: pathExp, title })
|
217
|
+
// Process first-level children as navigation items
|
218
|
+
for (const child of routeTree.children) {
|
219
|
+
if (child.value.type === 'directory') {
|
220
|
+
const pathExp = FileRouter.pathToExpression([child.value.name])
|
221
|
+
const title = Str.titlizeSlug(child.value.name)
|
222
|
+
siteNavigationItems.push({ pathExp: pathExp.startsWith('/') ? pathExp.slice(1) : pathExp, title })
|
223
|
+
} else if (child.value.type === 'file' && child.value.name !== 'index') {
|
224
|
+
const pathExp = FileRouter.pathToExpression([child.value.name])
|
225
|
+
const title = Str.titlizeSlug(child.value.name)
|
226
|
+
siteNavigationItems.push({ pathExp: pathExp.startsWith('/') ? pathExp.slice(1) : pathExp, title })
|
180
227
|
}
|
181
228
|
}
|
182
229
|
|
183
230
|
// ━ Schema presence causes adding some navbar items
|
184
231
|
if (schema) {
|
185
|
-
siteNavigationItems.push({ pathExp:
|
232
|
+
siteNavigationItems.push({ pathExp: `reference`, title: `Reference` })
|
186
233
|
if (schema.versions.length > 1) {
|
187
|
-
siteNavigationItems.push({ pathExp:
|
234
|
+
siteNavigationItems.push({ pathExp: `changelog`, title: `Changelog` })
|
188
235
|
}
|
189
236
|
}
|
190
237
|
|
@@ -194,9 +241,16 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
194
241
|
|
195
242
|
const sidebarIndex: SidebarIndex = {}
|
196
243
|
|
197
|
-
|
198
|
-
|
199
|
-
|
244
|
+
// Build sidebar for each top-level directory
|
245
|
+
for (const child of routeTree.children) {
|
246
|
+
if (child.value.type === 'directory') {
|
247
|
+
const pathExp = `/${child.value.name}`
|
248
|
+
// Create a subtree starting from this directory
|
249
|
+
const subtree = Tree.node(child.value, child.children)
|
250
|
+
const sidebar = FileRouter.Sidebar.buildFromTree(subtree, [])
|
251
|
+
_debug(`Built sidebar for ${pathExp}:`, sidebar)
|
252
|
+
sidebarIndex[pathExp] = sidebar
|
253
|
+
}
|
200
254
|
}
|
201
255
|
|
202
256
|
//
|
@@ -224,7 +278,7 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
224
278
|
|
225
279
|
const projectDataCode = jsesc(superjson.stringify(projectData))
|
226
280
|
const content = `
|
227
|
-
import { superjson } from '#singletons/superjson
|
281
|
+
import { superjson } from '#singletons/superjson'
|
228
282
|
|
229
283
|
export const PROJECT_DATA = superjson.parse('${projectDataCode}')
|
230
284
|
`
|
@@ -232,129 +286,7 @@ export const Core = (config: Config.Config): Vite.PluginOption[] => {
|
|
232
286
|
return content
|
233
287
|
},
|
234
288
|
},
|
235
|
-
{
|
236
|
-
identifier: viProjectPages,
|
237
|
-
async loader() {
|
238
|
-
const pagesScanResult = await scanPageRoutes()
|
239
|
-
|
240
|
-
const $ = {
|
241
|
-
pages: `pages`,
|
242
|
-
}
|
243
|
-
|
244
|
-
const s = Str.Builder()
|
245
|
-
s`export const ${$.pages} = []`
|
246
|
-
|
247
|
-
// todo: kit fs should accept parsed file paths
|
248
|
-
for (const route of pagesScanResult.routes) {
|
249
|
-
const filePathExp = Path.format(route.file.path.absolute)
|
250
|
-
const pathExp = FileRouter.routeToPathExpression(route)
|
251
|
-
const ident = Str.Case.camel(`page ` + Str.titlizeSlug(pathExp))
|
252
|
-
|
253
|
-
s`
|
254
|
-
import ${ident} from '${filePathExp}'
|
255
|
-
|
256
|
-
${$.pages}.push({
|
257
|
-
path: '${pathExp}',
|
258
|
-
Component: ${ident}
|
259
|
-
})
|
260
|
-
`
|
261
|
-
}
|
262
|
-
|
263
|
-
return s.render()
|
264
|
-
},
|
265
|
-
},
|
266
289
|
),
|
267
290
|
},
|
268
291
|
]
|
269
292
|
}
|
270
|
-
|
271
|
-
/**
|
272
|
-
* Helper function to build sidebar items recursively
|
273
|
-
*/
|
274
|
-
const buildSidebar = (pages: FileRouter.Route[], basePath: FileRouter.Path): Sidebar => {
|
275
|
-
const navs: SidebarNav[] = []
|
276
|
-
const sections = Idx.create<SidebarSection, string>({ toKey: (item) => item.pathExp })
|
277
|
-
|
278
|
-
// Items
|
279
|
-
for (const page of pages) {
|
280
|
-
const pageRelative = FileRouter.makeRelativeUnsafe(page, basePath)
|
281
|
-
|
282
|
-
if (FileRouter.routeIsRootLevel(pageRelative)) {
|
283
|
-
continue
|
284
|
-
}
|
285
|
-
|
286
|
-
if (FileRouter.routeIsTopLevel(pageRelative)) {
|
287
|
-
// Section (index)
|
288
|
-
if (FileRouter.routeIsFromIndexFile(pageRelative)) {
|
289
|
-
const sectionPath = page.logical.path
|
290
|
-
const sectionPathExp = FileRouter.pathToExpression(sectionPath)
|
291
|
-
|
292
|
-
let section: SidebarSection | undefined
|
293
|
-
section = sections.getKey(sectionPathExp)
|
294
|
-
|
295
|
-
if (!section) {
|
296
|
-
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(pageRelative.logical.path))
|
297
|
-
section = {
|
298
|
-
type: `SidebarSection`,
|
299
|
-
title: sectionTitle,
|
300
|
-
pathExp: sectionPathExp,
|
301
|
-
isNavToo: false,
|
302
|
-
navs: [],
|
303
|
-
}
|
304
|
-
|
305
|
-
sections.set(section)
|
306
|
-
}
|
307
|
-
section.isNavToo = true
|
308
|
-
continue
|
309
|
-
}
|
310
|
-
|
311
|
-
// Nav
|
312
|
-
navs.push(pageToSidebarNav(page, basePath))
|
313
|
-
continue
|
314
|
-
}
|
315
|
-
|
316
|
-
// Section (sub-page)
|
317
|
-
if (FileRouter.routeIsSubLevel(pageRelative)) {
|
318
|
-
const sectionRelativePath = [pageRelative.logical.path[0]]
|
319
|
-
const sectionPath = [...basePath, ...sectionRelativePath]
|
320
|
-
const sectionPathExp = FileRouter.pathToExpression(sectionPath)
|
321
|
-
|
322
|
-
let section: SidebarSection | undefined
|
323
|
-
section = sections.getKey(sectionPathExp)
|
324
|
-
|
325
|
-
if (!section) {
|
326
|
-
const sectionTitle = Str.titlizeSlug(FileRouter.pathToExpression(sectionRelativePath))
|
327
|
-
section = {
|
328
|
-
type: `SidebarSection`,
|
329
|
-
title: sectionTitle,
|
330
|
-
pathExp: sectionPathExp,
|
331
|
-
isNavToo: false,
|
332
|
-
navs: [],
|
333
|
-
}
|
334
|
-
sections.set(section)
|
335
|
-
}
|
336
|
-
section.navs.push(pageToSidebarNav(page, sectionPath))
|
337
|
-
}
|
338
|
-
}
|
339
|
-
|
340
|
-
const items = [...navs, ...sections.data.array]
|
341
|
-
|
342
|
-
return {
|
343
|
-
items,
|
344
|
-
}
|
345
|
-
}
|
346
|
-
|
347
|
-
/**
|
348
|
-
* Helper function to build sidebar items recursively
|
349
|
-
*/
|
350
|
-
const pageToSidebarNav = (page: FileRouter.Route, basePath: FileRouter.Path): SidebarNav => {
|
351
|
-
const pagePathExp = FileRouter.routeToPathExpression(page)
|
352
|
-
const pageRelative = FileRouter.makeRelativeUnsafe(page, basePath)
|
353
|
-
const pageRelativePathExp = FileRouter.routeToPathExpression(pageRelative)
|
354
|
-
|
355
|
-
return {
|
356
|
-
type: `SidebarItem`,
|
357
|
-
pathExp: pagePathExp,
|
358
|
-
title: Str.titlizeSlug(pageRelativePathExp),
|
359
|
-
}
|
360
|
-
}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { Config } from '#api/config/index
|
2
|
-
import type { Vite } from '#dep/vite/index
|
3
|
-
import ViteReact from '@vitejs/plugin-react'
|
4
|
-
import { Arr, Path } from '@wollybeard/kit'
|
5
|
-
import Inspect from 'vite-plugin-inspect'
|
6
|
-
import Restart from 'vite-plugin-restart'
|
7
|
-
import { Build } from './build.
|
8
|
-
import { Core } from './core.
|
9
|
-
import { Serve } from './serve.
|
1
|
+
import type { Config } from '#api/config/index'
|
2
|
+
import type { Vite } from '#dep/vite/index'
|
3
|
+
import ViteReact from '@vitejs/plugin-react-oxc'
|
4
|
+
// import { Arr, Path } from '@wollybeard/kit'
|
5
|
+
// import Inspect from 'vite-plugin-inspect'
|
6
|
+
// import Restart from 'vite-plugin-restart'
|
7
|
+
import { Build } from './build.ts'
|
8
|
+
import { Core } from './core.ts'
|
9
|
+
import { Serve } from './serve.ts'
|
10
10
|
|
11
11
|
export const Main = (
|
12
12
|
config: Config.Config,
|
@@ -14,22 +14,23 @@ export const Main = (
|
|
14
14
|
const plugins: Vite.PluginOption = []
|
15
15
|
|
16
16
|
// Optional Plugins based on config
|
17
|
+
// TODO: Re-enable when compatible with Rolldown
|
17
18
|
|
18
|
-
if (config.advanced.explorer) {
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
19
|
+
// if (config.advanced.explorer) {
|
20
|
+
// const outputDir = Path.join(config.paths.project.rootDir, `.bundle-explorer`)
|
21
|
+
// const plugin = Inspect({
|
22
|
+
// build: true,
|
23
|
+
// outputDir,
|
24
|
+
// })
|
25
|
+
// plugins.push(plugin)
|
26
|
+
// }
|
26
27
|
|
27
|
-
if (Arr.isntEmpty(config.watch.also)) {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}
|
28
|
+
// if (Arr.isntEmpty(config.watch.also)) {
|
29
|
+
// const plugin = Restart({
|
30
|
+
// restart: config.watch.also,
|
31
|
+
// })
|
32
|
+
// plugins.push(plugin)
|
33
|
+
// }
|
33
34
|
|
34
35
|
plugins.push(
|
35
36
|
ViteReact(),
|