polen 0.8.0-next.9 → 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 +148 -208
- 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 +3 -3
- 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/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 +44 -3
- 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 +1 -1
- package/build/lib/vite-plugin-mdx/index.d.ts.map +1 -1
- package/build/lib/vite-plugin-mdx/index.js +1 -3
- package/build/lib/vite-plugin-mdx/index.js.map +1 -1
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts +22 -0
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.d.ts.map +1 -1
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js +55 -71
- package/build/lib/vite-plugin-mdx/vite-plugin-mdx.js.map +1 -1
- 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 -1
- package/build/lib/vite-plugins/vite-plugins.js +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 +2 -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 +2 -2
- 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 +70 -54
- 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 +165 -245
- package/src/api/vite/plugins/main.ts +5 -5
- 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/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 +78 -4
- 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 -2
- package/src/lib/vite-plugin-mdx/vite-plugin-mdx.ts +80 -70
- package/src/lib/vite-plugins/index.ts +1 -1
- package/src/lib/vite-plugins/vite-plugins.ts +1 -1
- 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 +5 -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 +4 -4
- 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/src/lib/file-router/sidebar.ts +0 -0
@@ -0,0 +1,186 @@
|
|
1
|
+
import type { Config } from '#api/config/index'
|
2
|
+
import { polenVirtual } from '#api/vite/vi'
|
3
|
+
import type { Vite } from '#dep/vite/index'
|
4
|
+
import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter'
|
5
|
+
import { FileRouter } from '#lib/file-router/index'
|
6
|
+
import { ViteVirtual } from '#lib/vite-virtual/index'
|
7
|
+
import { debug } from '#singletons/debug'
|
8
|
+
import mdx from '@mdx-js/rollup'
|
9
|
+
import { Path, Str } from '@wollybeard/kit'
|
10
|
+
import remarkGfm from 'remark-gfm'
|
11
|
+
|
12
|
+
const _debug = debug.sub(`vite-plugin-pages-tree`)
|
13
|
+
|
14
|
+
export const viProjectPages = polenVirtual([`project`, `pages.jsx`], { allowPluginProcessing: true })
|
15
|
+
|
16
|
+
export interface PagesTreePluginOptions {
|
17
|
+
config: Config.Config
|
18
|
+
onPagesChange?: (pages: FileRouter.ScanResult) => void
|
19
|
+
onTreeChange?: (tree: FileRouter.RouteTreeNode) => void
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Pages plugin with tree support
|
24
|
+
*/
|
25
|
+
export const createPagesTreePlugin = (
|
26
|
+
{ config, onPagesChange, onTreeChange }: PagesTreePluginOptions,
|
27
|
+
): Vite.Plugin[] => {
|
28
|
+
// State management
|
29
|
+
let pagesCache: FileRouter.ScanResult | null = null
|
30
|
+
let treeCache: FileRouter.RouteTreeNode | null = null
|
31
|
+
|
32
|
+
// Helper functions
|
33
|
+
const scanPages = async () => {
|
34
|
+
if (!pagesCache) {
|
35
|
+
_debug(`Scanning pages - cache is null, loading fresh data`)
|
36
|
+
pagesCache = await FileRouter.scan({
|
37
|
+
dir: config.paths.project.absolute.pages,
|
38
|
+
glob: `**/*.{md,mdx}`,
|
39
|
+
})
|
40
|
+
_debug(`Found ${String(pagesCache.routes.length)} pages`)
|
41
|
+
} else {
|
42
|
+
_debug(`Using cached pages`)
|
43
|
+
}
|
44
|
+
return pagesCache
|
45
|
+
}
|
46
|
+
|
47
|
+
const scanTree = async () => {
|
48
|
+
if (!treeCache) {
|
49
|
+
_debug(`Scanning tree - cache is null, loading fresh data`)
|
50
|
+
const result = await FileRouter.scanTree({
|
51
|
+
dir: config.paths.project.absolute.pages,
|
52
|
+
glob: `**/*.{md,mdx}`,
|
53
|
+
})
|
54
|
+
treeCache = result.routeTree
|
55
|
+
_debug(`Built route tree`)
|
56
|
+
} else {
|
57
|
+
_debug(`Using cached tree`)
|
58
|
+
}
|
59
|
+
return treeCache
|
60
|
+
}
|
61
|
+
|
62
|
+
const clearCache = () => {
|
63
|
+
_debug(`Clearing pages and tree cache`)
|
64
|
+
pagesCache = null
|
65
|
+
treeCache = null
|
66
|
+
}
|
67
|
+
|
68
|
+
const isPageFile = (file: string) => {
|
69
|
+
return (file.endsWith(`.md`) || file.endsWith(`.mdx`))
|
70
|
+
&& file.includes(config.paths.project.absolute.pages)
|
71
|
+
}
|
72
|
+
|
73
|
+
const generatePagesModule = (pagesScanResult: FileRouter.ScanResult): string => {
|
74
|
+
const $ = {
|
75
|
+
pages: `pages`,
|
76
|
+
}
|
77
|
+
|
78
|
+
const s = Str.Builder()
|
79
|
+
s`export const ${$.pages} = []`
|
80
|
+
|
81
|
+
// Generate imports and route objects
|
82
|
+
for (const route of pagesScanResult.routes) {
|
83
|
+
const filePathExp = Path.format(route.file.path.absolute)
|
84
|
+
const pathExp = FileRouter.routeToPathExpression(route)
|
85
|
+
const ident = Str.Case.camel(`page ` + Str.titlizeSlug(pathExp))
|
86
|
+
|
87
|
+
s`
|
88
|
+
import ${ident} from '${filePathExp}'
|
89
|
+
|
90
|
+
${$.pages}.push({
|
91
|
+
path: '${pathExp}',
|
92
|
+
Component: ${ident}
|
93
|
+
})
|
94
|
+
`
|
95
|
+
}
|
96
|
+
|
97
|
+
return s.render()
|
98
|
+
}
|
99
|
+
|
100
|
+
return [
|
101
|
+
// Plugin 1: MDX Processing
|
102
|
+
{
|
103
|
+
enforce: `pre` as const,
|
104
|
+
...mdx({
|
105
|
+
jsxImportSource: `polen/react`,
|
106
|
+
remarkPlugins: [remarkGfm],
|
107
|
+
}),
|
108
|
+
},
|
109
|
+
|
110
|
+
// Plugin 2: Pages Management
|
111
|
+
{
|
112
|
+
name: `polen:pages-tree`,
|
113
|
+
|
114
|
+
// Dev server configuration
|
115
|
+
configureServer(server) {
|
116
|
+
// Add pages directory to watcher
|
117
|
+
_debug(`Adding pages directory to watcher:`, config.paths.project.absolute.pages)
|
118
|
+
server.watcher.add(config.paths.project.absolute.pages)
|
119
|
+
},
|
120
|
+
|
121
|
+
// Hot update handling
|
122
|
+
async handleHotUpdate({ file, server }) {
|
123
|
+
if (!isPageFile(file)) return
|
124
|
+
|
125
|
+
_debug(`Page file changed:`, file)
|
126
|
+
|
127
|
+
// Clear cache
|
128
|
+
clearCache()
|
129
|
+
|
130
|
+
// Invalidate virtual module
|
131
|
+
const mod = server.moduleGraph.getModuleById(viProjectPages.resolved)
|
132
|
+
if (mod) {
|
133
|
+
server.moduleGraph.invalidateModule(mod)
|
134
|
+
_debug(`Invalidated pages virtual module`)
|
135
|
+
}
|
136
|
+
|
137
|
+
// Notify about pages change (for other plugins that depend on pages)
|
138
|
+
if (onPagesChange) {
|
139
|
+
const pages = await scanPages()
|
140
|
+
// Report any diagnostics
|
141
|
+
reportDiagnostics(pages.diagnostics)
|
142
|
+
onPagesChange(pages)
|
143
|
+
}
|
144
|
+
|
145
|
+
// Notify about tree change
|
146
|
+
if (onTreeChange) {
|
147
|
+
const tree = await scanTree()
|
148
|
+
onTreeChange(tree)
|
149
|
+
}
|
150
|
+
|
151
|
+
// Trigger full reload
|
152
|
+
server.ws.send({ type: `full-reload` })
|
153
|
+
|
154
|
+
return []
|
155
|
+
},
|
156
|
+
|
157
|
+
// Virtual module handling
|
158
|
+
...ViteVirtual.IdentifiedLoader.toHooks({
|
159
|
+
identifier: viProjectPages,
|
160
|
+
async loader() {
|
161
|
+
_debug(`Loading viProjectPages virtual module`)
|
162
|
+
const pagesScanResult = await scanPages()
|
163
|
+
const tree = await scanTree()
|
164
|
+
|
165
|
+
// Report any diagnostics
|
166
|
+
reportDiagnostics(pagesScanResult.diagnostics)
|
167
|
+
|
168
|
+
// Notify about pages (useful for initial load)
|
169
|
+
onPagesChange?.(pagesScanResult)
|
170
|
+
onTreeChange?.(tree)
|
171
|
+
|
172
|
+
return generatePagesModule(pagesScanResult)
|
173
|
+
},
|
174
|
+
}),
|
175
|
+
},
|
176
|
+
]
|
177
|
+
}
|
178
|
+
|
179
|
+
// Helper to get tree
|
180
|
+
export const getRouteTree = async (config: Config.Config): Promise<FileRouter.RouteTreeNode> => {
|
181
|
+
const result = await FileRouter.scanTree({
|
182
|
+
dir: config.paths.project.absolute.pages,
|
183
|
+
glob: `**/*.{md,mdx}`,
|
184
|
+
})
|
185
|
+
return result.routeTree
|
186
|
+
}
|
@@ -1,28 +1,60 @@
|
|
1
|
-
import type { Config } from '#api/config/index
|
2
|
-
import type { Hono } from '#dep/hono/index
|
3
|
-
import type { Vite } from '#dep/vite/index
|
1
|
+
import type { Config } from '#api/config/index'
|
2
|
+
import type { Hono } from '#dep/hono/index'
|
3
|
+
import type { Vite } from '#dep/vite/index'
|
4
|
+
import { debug } from '#singletons/debug'
|
4
5
|
import * as HonoNodeServer from '@hono/node-server'
|
6
|
+
import { Err } from '@wollybeard/kit'
|
7
|
+
|
8
|
+
type App = Hono.Hono
|
9
|
+
|
10
|
+
interface AppServerModule {
|
11
|
+
app: App
|
12
|
+
}
|
5
13
|
|
6
14
|
export const Serve = (
|
7
15
|
config: Config.Config,
|
8
16
|
): Vite.PluginOption => {
|
9
|
-
|
10
|
-
name: `polen:serve`,
|
11
|
-
apply: `serve`,
|
12
|
-
async configureServer(server) {
|
13
|
-
let honoApp: Hono.Hono
|
17
|
+
let appPromise: Promise<App>
|
14
18
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
const reloadApp = async ({ server }: { server: Vite.ViteDevServer }): Promise<App> => {
|
20
|
+
debug('reloadApp')
|
21
|
+
return await server.ssrLoadModule(config.paths.framework.template.server.app)
|
22
|
+
.then(module => module as AppServerModule)
|
23
|
+
.then(module => module.app)
|
24
|
+
.catch(cause => {
|
25
|
+
if (Err.is(cause)) {
|
20
26
|
server.ssrFixStacktrace(cause)
|
21
27
|
}
|
22
28
|
throw cause
|
23
|
-
}
|
29
|
+
})
|
30
|
+
}
|
24
31
|
|
25
|
-
|
32
|
+
return {
|
33
|
+
name: `polen:serve`,
|
34
|
+
apply: `serve`,
|
35
|
+
config() {
|
36
|
+
return {
|
37
|
+
server: {
|
38
|
+
port: 3000,
|
39
|
+
watch: {
|
40
|
+
disableGlobbing: false,
|
41
|
+
},
|
42
|
+
fs: {
|
43
|
+
strict: false, // bring back true, with the allow below might already work now
|
44
|
+
allow: [
|
45
|
+
config.paths.project.rootDir,
|
46
|
+
],
|
47
|
+
},
|
48
|
+
},
|
49
|
+
}
|
50
|
+
},
|
51
|
+
handleHotUpdate({ server }) {
|
52
|
+
// Reload app server immediately in the background
|
53
|
+
appPromise = reloadApp({ server })
|
54
|
+
},
|
55
|
+
async configureServer(server) {
|
56
|
+
// Initial load
|
57
|
+
appPromise = reloadApp({ server })
|
26
58
|
|
27
59
|
return () => {
|
28
60
|
// Remove index.html serving middleware.
|
@@ -31,26 +63,17 @@ export const Serve = (
|
|
31
63
|
server.middlewares.stack.findIndex(m => m.handle.name === `viteHtmlFallbackMiddleware`),
|
32
64
|
1,
|
33
65
|
)
|
66
|
+
|
67
|
+
// Add middleware that runs our entry server
|
34
68
|
server.middlewares.use((req, res, ___next) => {
|
35
69
|
void HonoNodeServer.getRequestListener(async request => {
|
36
|
-
//
|
37
|
-
const
|
70
|
+
// Always await the current app promise
|
71
|
+
const app = await appPromise
|
72
|
+
const response = await app.fetch(request, { viteDevServer: server })
|
38
73
|
return response
|
39
74
|
})(req, res)
|
40
75
|
})
|
41
76
|
}
|
42
77
|
},
|
43
|
-
config() {
|
44
|
-
return {
|
45
|
-
server: {
|
46
|
-
fs: {
|
47
|
-
strict: false,
|
48
|
-
allow: [
|
49
|
-
// todo allow from polen
|
50
|
-
],
|
51
|
-
},
|
52
|
-
},
|
53
|
-
}
|
54
|
-
},
|
55
78
|
}
|
56
79
|
}
|
package/src/api/vite/vi.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ViteVirtual } from '#lib/vite-virtual/index
|
1
|
+
import { ViteVirtual } from '#lib/vite-virtual/index'
|
2
2
|
|
3
|
-
export const
|
3
|
+
export const polenVirtual = ViteVirtual.Identifier.createFactory({
|
4
4
|
namespace: `polen`,
|
5
5
|
})
|
@@ -0,0 +1,85 @@
|
|
1
|
+
import type { Vite } from '#dep/vite/index'
|
2
|
+
import { type ImportEvent, isSpecifierFromPackage } from '#lib/kit-temp'
|
3
|
+
import { packagePaths } from '#package-paths'
|
4
|
+
import { debug } from '#singletons/debug'
|
5
|
+
import type * as Module from 'node:module'
|
6
|
+
import { fileURLToPath } from 'node:url'
|
7
|
+
|
8
|
+
export interface SelfContainedModeHooksData {
|
9
|
+
projectDirPathExp: string
|
10
|
+
}
|
11
|
+
|
12
|
+
let data_: SelfContainedModeHooksData | undefined = undefined
|
13
|
+
|
14
|
+
export function initialize(data: SelfContainedModeHooksData) {
|
15
|
+
data_ = data
|
16
|
+
}
|
17
|
+
|
18
|
+
export const resolve: Module.ResolveHook = async (specifier, context, nextResolve) => {
|
19
|
+
if (!data_) throw new Error(`Self-contained mode not initialized`)
|
20
|
+
|
21
|
+
const _debug = debug.sub(`node-module-hooks`)
|
22
|
+
|
23
|
+
const from: ImportEvent = {
|
24
|
+
specifier,
|
25
|
+
context,
|
26
|
+
}
|
27
|
+
|
28
|
+
if (
|
29
|
+
from.context.parentURL && checkIsSelfImportFromProject({
|
30
|
+
projectDirPathExp: data_.projectDirPathExp,
|
31
|
+
specifier,
|
32
|
+
importerPathExpOrFileUrlExp: from.context.parentURL,
|
33
|
+
})
|
34
|
+
) {
|
35
|
+
_debug(`resolve check`, { specifier, context })
|
36
|
+
|
37
|
+
const to: ImportEvent = {
|
38
|
+
specifier: from.specifier,
|
39
|
+
context: {
|
40
|
+
conditions: [...from.context.conditions, `source`],
|
41
|
+
parentURL: import.meta.url,
|
42
|
+
importAttributes: from.context.importAttributes,
|
43
|
+
},
|
44
|
+
}
|
45
|
+
|
46
|
+
_debug(`resolve`, { from, to })
|
47
|
+
|
48
|
+
await nextResolve(to.specifier, to.context)
|
49
|
+
}
|
50
|
+
|
51
|
+
return nextResolve(specifier, context)
|
52
|
+
}
|
53
|
+
|
54
|
+
export const checkIsSelfImportFromProject = (input: {
|
55
|
+
specifier: string
|
56
|
+
importerPathExpOrFileUrlExp: string
|
57
|
+
projectDirPathExp: string
|
58
|
+
}): boolean => {
|
59
|
+
// Not clear it would ever not be the case but we're being careful here.
|
60
|
+
// ...would be intersted to know if this is ever false.
|
61
|
+
const isImporterTheProject = input.importerPathExpOrFileUrlExp.includes(input.projectDirPathExp)
|
62
|
+
|
63
|
+
const isImportMe = isSpecifierFromPackage(input.specifier, packagePaths.name)
|
64
|
+
|
65
|
+
return isImporterTheProject && isImportMe
|
66
|
+
}
|
67
|
+
|
68
|
+
export const VitePluginSelfContainedMode = ({ projectDirPathExp }: { projectDirPathExp: string }): Vite.Plugin => {
|
69
|
+
const d = debug.sub(`vite-plugin:self-contained-import`)
|
70
|
+
|
71
|
+
return {
|
72
|
+
name: `polen:self-contained-import`,
|
73
|
+
resolveId(id, importer) {
|
74
|
+
const isSelfContainedImport = importer
|
75
|
+
&& checkIsSelfImportFromProject({ projectDirPathExp, specifier: id, importerPathExpOrFileUrlExp: importer })
|
76
|
+
if (!isSelfContainedImport) return
|
77
|
+
|
78
|
+
const to = fileURLToPath(import.meta.resolve(id))
|
79
|
+
|
80
|
+
d(`did resolve`, { from: id, to })
|
81
|
+
|
82
|
+
return to
|
83
|
+
},
|
84
|
+
}
|
85
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
// @ts-nocheck
|
3
|
-
import { Api } from '#api/index
|
4
|
-
import { Vite } from '#dep/vite/index
|
3
|
+
import { Api } from '#api/index'
|
4
|
+
import { Vite } from '#dep/vite/index'
|
5
5
|
import { Command } from '@molt/command'
|
6
6
|
import { z } from 'zod'
|
7
7
|
|
package/src/cli/commands/dev.ts
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
/* eslint-disable */
|
2
2
|
// @ts-nocheck
|
3
|
-
import { Api } from '#api/index
|
4
|
-
import { Vite } from '#dep/vite/index
|
5
|
-
import { ensureOptionalAbsolute, ensureOptionalAbsoluteWithCwd } from '#lib/kit-temp
|
3
|
+
import { Api } from '#api/index'
|
4
|
+
import { Vite } from '#dep/vite/index'
|
5
|
+
import { ensureOptionalAbsolute, ensureOptionalAbsoluteWithCwd } from '#lib/kit-temp'
|
6
6
|
import { Command } from '@molt/command'
|
7
7
|
import { Err, Path } from '@wollybeard/kit'
|
8
8
|
import { z } from 'zod'
|
9
|
-
// import { loadConfig } from '../../api/load-config.js'
|
10
9
|
|
11
10
|
const args = Command.create()
|
12
11
|
.parameter(
|
package/src/cli/commands/open.ts
CHANGED
@@ -8,10 +8,10 @@
|
|
8
8
|
* polen open --sdl https://docs.github.com/public/fpt/schema.docs.graphql
|
9
9
|
*/
|
10
10
|
|
11
|
-
import { Api } from '#api/index
|
12
|
-
import { Vite } from '#dep/vite/index
|
13
|
-
import { Grafaid } from '#lib/grafaid/index
|
14
|
-
import { GraphqlSchemaLoader } from '#lib/graphql-schema-loader/index
|
11
|
+
import { Api } from '#api/index'
|
12
|
+
import { Vite } from '#dep/vite/index'
|
13
|
+
import { Grafaid } from '#lib/grafaid/index'
|
14
|
+
import { GraphqlSchemaLoader } from '#lib/graphql-schema-loader/index'
|
15
15
|
import { Command } from '@molt/command'
|
16
16
|
import type { Fn } from '@wollybeard/kit'
|
17
17
|
import { Err, Fs, Json, Path, Rec } from '@wollybeard/kit'
|
@@ -1 +1 @@
|
|
1
|
-
export * as GraphqlInspector from './graphql-inspector.
|
1
|
+
export * as GraphqlInspector from './graphql-inspector.ts'
|
package/src/dep/hono/hono.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export * from 'hono'
|
2
|
-
export * from './ssg.
|
2
|
+
export * from './ssg.ts'
|
package/src/dep/hono/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Hono from './hono.
|
1
|
+
export * as Hono from './hono.ts'
|
@@ -1 +1 @@
|
|
1
|
-
export * as Superjson from './superjson.
|
1
|
+
export * as Superjson from './superjson.ts'
|
@@ -1 +1 @@
|
|
1
|
-
export * as TinyGlobby from './tiny-globby.
|
1
|
+
export * as TinyGlobby from './tiny-globby.ts'
|
package/src/dep/vite/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Vite from './vite.
|
1
|
+
export * as Vite from './vite.ts'
|
package/src/exports/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Polen from './polen.
|
1
|
+
export * as Polen from './polen.ts'
|
package/src/exports/polen.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export { defineConfig } from '#api/config/config
|
2
|
-
export { type ConfigInput } from '#api/config/configurator
|
3
|
-
export { Main as VitePlugin } from '#api/vite/plugins/main
|
1
|
+
export { defineConfig } from '#api/config/config'
|
2
|
+
export { type ConfigInput } from '#api/config/configurator'
|
3
|
+
export { Main as VitePlugin } from '#api/vite/plugins/main'
|
@@ -1 +1 @@
|
|
1
|
-
export * as AppleTouchIcon from './apple-touch-icon.
|
1
|
+
export * as AppleTouchIcon from './apple-touch-icon.ts'
|
package/src/lib/debug/debug.ts
CHANGED
@@ -1,21 +1,52 @@
|
|
1
|
+
import { Arr, Str } from '@wollybeard/kit'
|
1
2
|
import { colorize } from 'consola/utils'
|
2
|
-
import { snakeCase } from 'es-toolkit'
|
3
3
|
import { inspect } from 'node:util'
|
4
|
-
import { calcIsEnabledFromEnv } from './environment-variable.
|
4
|
+
import { calcIsEnabledFromEnv } from './environment-variable.ts'
|
5
5
|
|
6
6
|
type DebugParameters = [event: string, payload?: unknown]
|
7
7
|
|
8
8
|
export interface Debug {
|
9
9
|
(...args: DebugParameters): void
|
10
10
|
toggle: (isEnabled: boolean) => void
|
11
|
-
sub: (subNamespace: string) => Debug
|
11
|
+
sub: (subNamespace: string | string[]) => Debug
|
12
12
|
}
|
13
13
|
|
14
14
|
interface State {
|
15
15
|
isEnabled: boolean
|
16
16
|
}
|
17
17
|
|
18
|
-
|
18
|
+
// todo:
|
19
|
+
// const Option = {
|
20
|
+
// else:
|
21
|
+
// <alternative>(alternative: alternative) => <value>(value: value): value extends undefined ? alternative : value => {
|
22
|
+
// if (value === undefined || value === null) {
|
23
|
+
// return alternative as any
|
24
|
+
// }
|
25
|
+
// return value as any
|
26
|
+
// },
|
27
|
+
// }
|
28
|
+
|
29
|
+
// const namespaceToString = (namespace: string[] = []): string => {
|
30
|
+
// return formatNamespaceSegment(namespace.join(`_`))
|
31
|
+
// // todo:
|
32
|
+
// // const x = Option.else([] as string[])
|
33
|
+
// // const y = x(namespace)
|
34
|
+
// // const z = Fn.pipe(
|
35
|
+
// // namespace,
|
36
|
+
// // x,
|
37
|
+
// // // Option.else([]),
|
38
|
+
// // // (_) => Array.is(_) ? _ : [],
|
39
|
+
// // // Str.joinWith(`_`),
|
40
|
+
// // // Str.Case.upper,
|
41
|
+
// // )
|
42
|
+
// }
|
43
|
+
|
44
|
+
const formatNamespaceSegment = (segment: string): string => {
|
45
|
+
return Str.Case.snake(segment).toUpperCase()
|
46
|
+
}
|
47
|
+
|
48
|
+
export const create = (namespaceInput?: string | string[], initialState?: State): Debug => {
|
49
|
+
const namespace = Arr.sure(namespaceInput ?? [])
|
19
50
|
const isDebugEnabledFromEnv = calcIsEnabledFromEnv(process.env, namespace)
|
20
51
|
|
21
52
|
const state: State = initialState ?? {
|
@@ -43,20 +74,16 @@ export const create = (namespace?: string, initialState?: State): Debug => {
|
|
43
74
|
})
|
44
75
|
: ``
|
45
76
|
|
46
|
-
const
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
` ` + snakeCase(namespace).toUpperCase() + ` `,
|
52
|
-
),
|
53
|
-
)
|
54
|
-
: ``
|
77
|
+
const formatNamespaceSegmentAnsi = (segment: string): string => {
|
78
|
+
return colorize(`bold`, colorize(`bgYellowBright`, ` ` + formatNamespaceSegment(segment) + ` `))
|
79
|
+
}
|
80
|
+
|
81
|
+
const namespaceRendered = namespace.map(formatNamespaceSegmentAnsi).join(` `)
|
55
82
|
const eventRendered = colorize(
|
56
83
|
`bold`,
|
57
84
|
colorize(
|
58
85
|
`bgMagentaBright`,
|
59
|
-
` ` +
|
86
|
+
` ` + formatNamespaceSegment(event) + ` `,
|
60
87
|
),
|
61
88
|
)
|
62
89
|
const prefixRendered = `${namespaceRendered} ${eventRendered}`
|
@@ -69,10 +96,10 @@ export const create = (namespace?: string, initialState?: State): Debug => {
|
|
69
96
|
state.isEnabled = isEnabled
|
70
97
|
}
|
71
98
|
|
72
|
-
debug.sub = (subNamespace: string) => {
|
99
|
+
debug.sub = (subNamespace: string | string[]) => {
|
100
|
+
const s = Arr.sure(subNamespace)
|
73
101
|
const stateCopy = structuredClone(state)
|
74
|
-
|
75
|
-
return create(fullNamespace, stateCopy)
|
102
|
+
return create([...namespace, ...s], stateCopy)
|
76
103
|
}
|
77
104
|
|
78
105
|
return debug
|
@@ -90,4 +117,4 @@ const parseNumberOr = (str: string | undefined, defaultValue: number): number =>
|
|
90
117
|
|
91
118
|
// initialize root debug
|
92
119
|
|
93
|
-
export const
|
120
|
+
export const debugGlobal = create()
|
@@ -1,18 +1,39 @@
|
|
1
|
+
import { Arr, Language } from '@wollybeard/kit'
|
2
|
+
|
1
3
|
export const enVarName = `DEBUG`
|
2
4
|
|
3
|
-
export const
|
5
|
+
export const wildcard = `*`
|
6
|
+
export const enVarEnabledValuesStatic = [`true`, wildcard, `1`]
|
4
7
|
|
5
8
|
export const calcIsEnabledFromEnv = (
|
6
9
|
enVars: Record<string, unknown>,
|
7
|
-
namespace?: string,
|
10
|
+
namespace?: string[],
|
8
11
|
): boolean => {
|
9
|
-
const
|
12
|
+
const namespace_ = namespace?.map(_ => _.toLowerCase())
|
13
|
+
const pattern = typeof enVars[enVarName] === `string`
|
14
|
+
? enVars[enVarName]
|
15
|
+
.trim()
|
16
|
+
.toLowerCase()
|
17
|
+
.split(`:`)
|
18
|
+
.map(_ => _.trim())
|
19
|
+
: undefined
|
20
|
+
|
21
|
+
if (!pattern) return false
|
22
|
+
|
23
|
+
if (pattern.length === 1 && enVarEnabledValuesStatic.includes(pattern[0]!)) return true
|
10
24
|
|
11
|
-
if (!
|
25
|
+
if (!namespace_) return false
|
12
26
|
|
13
|
-
if (
|
27
|
+
if (Arr.getLast(pattern) !== wildcard) {
|
28
|
+
return pattern.join() === namespace_.join()
|
29
|
+
}
|
14
30
|
|
15
|
-
|
31
|
+
let i = 0
|
32
|
+
for (const segment of pattern) {
|
33
|
+
if (segment === wildcard) return true
|
34
|
+
if (segment !== namespace_[i]) return false
|
35
|
+
i++
|
36
|
+
}
|
16
37
|
|
17
|
-
|
38
|
+
Language.never()
|
18
39
|
}
|
package/src/lib/debug/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Debug from './debug.
|
1
|
+
export * as Debug from './debug.ts'
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ContextualError } from './ContextualError.
|
2
|
-
import type { Cause, Context } from './types.
|
1
|
+
import { ContextualError } from './ContextualError.ts'
|
2
|
+
import type { Cause, Context } from './types.ts'
|
3
3
|
|
4
4
|
export class ErrorInternal<
|
5
5
|
$Name extends string = `ErrorInternal`,
|
package/src/lib/errors/errors.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export * from './ContextualAggregateError.
|
2
|
-
export * from './ContextualError.
|
3
|
-
export * from './ErrorInternal.
|
4
|
-
export * from './types.
|
1
|
+
export * from './ContextualAggregateError.ts'
|
2
|
+
export * from './ContextualError.ts'
|
3
|
+
export * from './ErrorInternal.ts'
|
4
|
+
export * from './types.ts'
|
package/src/lib/errors/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * as Errors from './errors.
|
1
|
+
export * as Errors from './errors.ts'
|
package/src/lib/errors/types.ts
CHANGED