polen 0.11.0-next.24 → 0.11.0-next.26
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/build/api/config/input.d.ts +259 -77
- package/build/api/config/input.d.ts.map +1 -1
- package/build/api/config/input.js +2 -0
- package/build/api/config/input.js.map +1 -1
- package/build/api/config/normalized.d.ts +433 -143
- package/build/api/config/normalized.d.ts.map +1 -1
- package/build/api/config/normalized.js +47 -0
- package/build/api/config/normalized.js.map +1 -1
- package/build/api/config-template/template.d.ts +191 -121
- package/build/api/config-template/template.d.ts.map +1 -1
- package/build/api/config-template/template.js +18 -1
- package/build/api/config-template/template.js.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
- package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.js +1 -3
- package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
- package/build/api/examples/scanner.d.ts +27 -1
- package/build/api/examples/scanner.d.ts.map +1 -1
- package/build/api/examples/scanner.js +30 -17
- package/build/api/examples/scanner.js.map +1 -1
- package/build/api/examples/schemas/catalog.d.ts +56 -12
- package/build/api/examples/schemas/catalog.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.d.ts +54 -11
- package/build/api/examples/schemas/example/example.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.js +5 -0
- package/build/api/examples/schemas/example/example.js.map +1 -1
- package/build/api/reference/$.d.ts +4 -0
- package/build/api/reference/$.d.ts.map +1 -0
- package/build/api/reference/$.js +4 -0
- package/build/api/reference/$.js.map +1 -0
- package/build/api/reference/catalog.d.ts +69 -0
- package/build/api/reference/catalog.d.ts.map +1 -0
- package/build/api/reference/catalog.js +44 -0
- package/build/api/reference/catalog.js.map +1 -0
- package/build/api/reference/config.d.ts +616 -0
- package/build/api/reference/config.d.ts.map +1 -0
- package/build/api/reference/config.js +162 -0
- package/build/api/reference/config.js.map +1 -0
- package/build/api/reference/scanner.d.ts +26 -0
- package/build/api/reference/scanner.d.ts.map +1 -0
- package/build/api/reference/scanner.js +27 -0
- package/build/api/reference/scanner.js.map +1 -0
- package/build/api/schema/augmentations/$$.d.ts +7 -0
- package/build/api/schema/augmentations/$$.d.ts.map +1 -0
- package/build/api/schema/augmentations/$$.js +7 -0
- package/build/api/schema/augmentations/$$.js.map +1 -0
- package/build/api/schema/augmentations/$.d.ts +1 -1
- package/build/api/schema/augmentations/$.d.ts.map +1 -1
- package/build/api/schema/augmentations/$.js +1 -1
- package/build/api/schema/augmentations/$.js.map +1 -1
- package/build/api/schema/augmentations/apply.d.ts +29 -0
- package/build/api/schema/augmentations/apply.d.ts.map +1 -0
- package/build/api/schema/augmentations/apply.js +181 -0
- package/build/api/schema/augmentations/apply.js.map +1 -0
- package/build/api/schema/augmentations/augmentation.d.ts +31 -0
- package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
- package/build/api/schema/augmentations/augmentation.js +22 -0
- package/build/api/schema/augmentations/augmentation.js.map +1 -0
- package/build/api/schema/augmentations/config.d.ts +24 -0
- package/build/api/schema/augmentations/config.d.ts.map +1 -0
- package/build/api/schema/augmentations/config.js +9 -0
- package/build/api/schema/augmentations/config.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
- package/build/api/schema/augmentations/input.d.ts +145 -0
- package/build/api/schema/augmentations/input.d.ts.map +1 -0
- package/build/api/schema/augmentations/input.js +191 -0
- package/build/api/schema/augmentations/input.js.map +1 -0
- package/build/api/schema/augmentations/placement.d.ts +8 -0
- package/build/api/schema/augmentations/placement.d.ts.map +1 -0
- package/build/api/schema/augmentations/placement.js +7 -0
- package/build/api/schema/augmentations/placement.js.map +1 -0
- package/build/api/schema/config-schema.d.ts +66 -66
- package/build/api/schema/config-schema.d.ts.map +1 -1
- package/build/api/schema/config-schema.js +2 -2
- package/build/api/schema/config-schema.js.map +1 -1
- package/build/api/schema/input-source/load.d.ts +2 -0
- package/build/api/schema/input-source/load.d.ts.map +1 -1
- package/build/api/schema/input-source/load.js.map +1 -1
- package/build/api/schema/input-sources/directory.d.ts +39 -39
- package/build/api/schema/input-sources/file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection.d.ts +39 -39
- package/build/api/schema/input-sources/memory.d.ts +39 -39
- package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
- package/build/api/schema/load.d.ts.map +1 -1
- package/build/api/schema/load.js +9 -2
- package/build/api/schema/load.js.map +1 -1
- package/build/lib/catalog/catalog.d.ts +1181 -1181
- package/build/lib/catalog/unversioned.d.ts +312 -312
- package/build/lib/catalog/versioned.d.ts +634 -634
- package/build/lib/change/change.d.ts +238 -238
- package/build/lib/document/document.d.ts +14 -8
- package/build/lib/document/document.d.ts.map +1 -1
- package/build/lib/document/versioned.d.ts +17 -10
- package/build/lib/document/versioned.d.ts.map +1 -1
- package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
- package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
- package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
- package/build/lib/grafaid/schema/format-default-value.js +20 -0
- package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
- package/build/lib/grafaid/schema/schema.d.ts +1 -0
- package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
- package/build/lib/grafaid/schema/schema.js +1 -0
- package/build/lib/grafaid/schema/schema.js.map +1 -1
- package/build/lib/graphql-path/$$.d.ts +7 -13
- package/build/lib/graphql-path/$$.d.ts.map +1 -1
- package/build/lib/graphql-path/$$.js +7 -13
- package/build/lib/graphql-path/$$.js.map +1 -1
- package/build/lib/graphql-path/definition.d.ts +104 -94
- package/build/lib/graphql-path/definition.d.ts.map +1 -1
- package/build/lib/graphql-path/definition.js +126 -125
- package/build/lib/graphql-path/definition.js.map +1 -1
- package/build/lib/graphql-path/query.d.ts +25 -57
- package/build/lib/graphql-path/query.d.ts.map +1 -1
- package/build/lib/graphql-path/query.js +15 -93
- package/build/lib/graphql-path/query.js.map +1 -1
- package/build/lib/graphql-path/schema.d.ts +49 -0
- package/build/lib/graphql-path/schema.d.ts.map +1 -0
- package/build/lib/graphql-path/schema.js +89 -0
- package/build/lib/graphql-path/schema.js.map +1 -0
- package/build/lib/graphql-path/types.d.ts +76 -28
- package/build/lib/graphql-path/types.d.ts.map +1 -1
- package/build/lib/graphql-path/types.js +101 -2
- package/build/lib/graphql-path/types.js.map +1 -1
- package/build/lib/revision/revision.d.ts +1170 -1170
- package/build/lib/schema/schema.d.ts +708 -708
- package/build/lib/schema/unversioned.d.ts +1092 -1092
- package/build/lib/schema/versioned.d.ts +634 -634
- package/build/lib/semver/official-release.d.ts +10 -10
- package/build/lib/semver/pre-release.d.ts +10 -10
- package/build/lib/semver/semver.d.ts +50 -50
- package/build/lib/version-coverage/version-coverage.d.ts +43 -11
- package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
- package/build/lib/version-coverage/version-coverage.js +40 -6
- package/build/lib/version-coverage/version-coverage.js.map +1 -1
- package/build/template/components/ArgumentAnnotation.d.ts +2 -1
- package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentAnnotation.js +14 -4
- package/build/template/components/ArgumentAnnotation.js.map +1 -1
- package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
- package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentListAnnotation.js +21 -8
- package/build/template/components/ArgumentListAnnotation.js.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
- package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
- package/build/template/components/CodeBlock.d.ts.map +1 -1
- package/build/template/components/CodeBlock.js +1 -1
- package/build/template/components/CodeBlock.js.map +1 -1
- package/build/template/components/Description.js +1 -1
- package/build/template/components/Description.js.map +1 -1
- package/build/template/components/ExampleLink.d.ts.map +1 -1
- package/build/template/components/ExampleLink.js +2 -1
- package/build/template/components/ExampleLink.js.map +1 -1
- package/build/template/components/Field.d.ts +2 -0
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.js +42 -4
- package/build/template/components/Field.js.map +1 -1
- package/build/template/components/FieldList.d.ts +2 -1
- package/build/template/components/FieldList.d.ts.map +1 -1
- package/build/template/components/FieldList.js +14 -3
- package/build/template/components/FieldList.js.map +1 -1
- package/build/template/components/FieldListSection.d.ts.map +1 -1
- package/build/template/components/FieldListSection.js +6 -1
- package/build/template/components/FieldListSection.js.map +1 -1
- package/build/template/components/GraphQLDocument.d.ts.map +1 -1
- package/build/template/components/GraphQLDocument.js +2 -1
- package/build/template/components/GraphQLDocument.js.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/IAPIndicator.d.ts +12 -0
- package/build/template/components/IAPIndicator.d.ts.map +1 -0
- package/build/template/components/IAPIndicator.js +21 -0
- package/build/template/components/IAPIndicator.js.map +1 -0
- package/build/template/components/Link.d.ts +1 -2
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/Link.js +5 -2
- package/build/template/components/Link.js.map +1 -1
- package/build/template/components/NamedType.d.ts.map +1 -1
- package/build/template/components/NamedType.js +9 -5
- package/build/template/components/NamedType.js.map +1 -1
- package/build/template/components/ReferenceLink.d.ts +2 -2
- package/build/template/components/ReferenceLink.d.ts.map +1 -1
- package/build/template/components/ReferenceLink.js +5 -3
- package/build/template/components/ReferenceLink.js.map +1 -1
- package/build/template/components/TypeAnnotation.d.ts +2 -0
- package/build/template/components/TypeAnnotation.d.ts.map +1 -1
- package/build/template/components/TypeAnnotation.js +4 -4
- package/build/template/components/TypeAnnotation.js.map +1 -1
- package/build/template/components/ViewModeToggle.d.ts +3 -0
- package/build/template/components/ViewModeToggle.d.ts.map +1 -0
- package/build/template/components/ViewModeToggle.js +9 -0
- package/build/template/components/ViewModeToggle.js.map +1 -0
- package/build/template/components/graphql/type-link.d.ts +2 -0
- package/build/template/components/graphql/type-link.d.ts.map +1 -1
- package/build/template/components/graphql/type-link.js +15 -3
- package/build/template/components/graphql/type-link.js.map +1 -1
- package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
- package/build/template/components/home/PlaygroundPreview.js +3 -2
- package/build/template/components/home/PlaygroundPreview.js.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.js +18 -5
- package/build/template/components/sidebar/SidebarItem.js.map +1 -1
- package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
- package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
- package/build/template/contexts/ReferenceConfigContext.js +14 -0
- package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
- package/build/template/contexts/ViewModeContext.d.ts +14 -0
- package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
- package/build/template/contexts/ViewModeContext.js +40 -0
- package/build/template/contexts/ViewModeContext.js.map +1 -0
- package/build/template/hooks/use-examples.d.ts +4 -1
- package/build/template/hooks/use-examples.d.ts.map +1 -1
- package/build/template/hooks/useAlignedColumns.d.ts +10 -0
- package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
- package/build/template/hooks/useAlignedColumns.js +17 -0
- package/build/template/hooks/useAlignedColumns.js.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
- package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
- package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
- package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
- package/build/template/routes/examples/_.d.ts +12 -3
- package/build/template/routes/examples/_.d.ts.map +1 -1
- package/build/template/routes/examples/_index.d.ts +8 -2
- package/build/template/routes/examples/_index.d.ts.map +1 -1
- package/build/template/routes/examples/name.d.ts +12 -3
- package/build/template/routes/examples/name.d.ts.map +1 -1
- package/build/template/routes/examples/name.js +6 -2
- package/build/template/routes/examples/name.js.map +1 -1
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.js +37 -10
- package/build/template/routes/reference.js.map +1 -1
- package/build/template/stores/changelog.d.ts +39 -39
- package/build/vite/plugins/core.d.ts.map +1 -1
- package/build/vite/plugins/core.js +6 -0
- package/build/vite/plugins/core.js.map +1 -1
- package/build/vite/plugins/examples.d.ts.map +1 -1
- package/build/vite/plugins/examples.js +10 -3
- package/build/vite/plugins/examples.js.map +1 -1
- package/build/vite/plugins/index.d.ts +1 -0
- package/build/vite/plugins/index.d.ts.map +1 -1
- package/build/vite/plugins/index.js +1 -0
- package/build/vite/plugins/index.js.map +1 -1
- package/build/vite/plugins/navbar.d.ts.map +1 -1
- package/build/vite/plugins/navbar.js +3 -1
- package/build/vite/plugins/navbar.js.map +1 -1
- package/build/vite/plugins/reference.d.ts +19 -0
- package/build/vite/plugins/reference.d.ts.map +1 -0
- package/build/vite/plugins/reference.js +96 -0
- package/build/vite/plugins/reference.js.map +1 -0
- package/build/vite/plugins/schemas.d.ts.map +1 -1
- package/build/vite/plugins/schemas.js +38 -2
- package/build/vite/plugins/schemas.js.map +1 -1
- package/package.json +1 -1
- package/src/api/config/input.ts +2 -0
- package/src/api/config/normalized.ts +54 -0
- package/src/api/config-template/template.ts +18 -1
- package/src/api/examples/diagnostic/diagnostic.ts +0 -3
- package/src/api/examples/scanner.test.ts +83 -0
- package/src/api/examples/scanner.ts +31 -21
- package/src/api/examples/schemas/example/example.ts +6 -0
- package/src/api/reference/$.ts +3 -0
- package/src/api/reference/catalog.ts +55 -0
- package/src/api/reference/config.ts +193 -0
- package/src/api/reference/scanner.ts +53 -0
- package/src/api/schema/augmentations/$$.ts +6 -0
- package/src/api/schema/augmentations/$.ts +1 -1
- package/src/api/schema/augmentations/apply.test.ts +89 -0
- package/src/api/schema/augmentations/apply.ts +277 -0
- package/src/api/schema/augmentations/augmentation.ts +24 -0
- package/src/api/schema/augmentations/config.ts +11 -0
- package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
- package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
- package/src/api/schema/augmentations/input.test.ts +144 -0
- package/src/api/schema/augmentations/input.ts +215 -0
- package/src/api/schema/augmentations/placement.ts +11 -0
- package/src/api/schema/config-schema.ts +2 -2
- package/src/api/schema/input-source/load.ts +2 -0
- package/src/api/schema/load.ts +19 -2
- package/src/lib/grafaid/schema/format-default-value.ts +22 -0
- package/src/lib/grafaid/schema/schema.ts +2 -0
- package/src/lib/graphql-path/$$.ts +7 -13
- package/src/lib/graphql-path/$.test.ts +175 -0
- package/src/lib/graphql-path/definition.ts +162 -162
- package/src/lib/graphql-path/query.ts +15 -98
- package/src/lib/graphql-path/schema.ts +136 -0
- package/src/lib/graphql-path/types.ts +108 -28
- package/src/lib/version-coverage/version-coverage.ts +48 -6
- package/src/template/components/ArgumentAnnotation.tsx +58 -9
- package/src/template/components/ArgumentListAnnotation.tsx +50 -17
- package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
- package/src/template/components/CodeBlock.tsx +1 -0
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/ExampleLink.tsx +2 -1
- package/src/template/components/Field.tsx +148 -20
- package/src/template/components/FieldList.tsx +28 -13
- package/src/template/components/FieldListSection.tsx +12 -2
- package/src/template/components/GraphQLDocument.tsx +2 -0
- package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
- package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
- package/src/template/components/IAPIndicator.tsx +73 -0
- package/src/template/components/Link.tsx +9 -3
- package/src/template/components/NamedType.tsx +54 -28
- package/src/template/components/ReferenceLink.tsx +16 -10
- package/src/template/components/TypeAnnotation.tsx +17 -5
- package/src/template/components/ViewModeToggle.tsx +27 -0
- package/src/template/components/graphql/type-link.tsx +34 -3
- package/src/template/components/home/PlaygroundPreview.tsx +3 -0
- package/src/template/components/sidebar/SidebarItem.tsx +21 -5
- package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
- package/src/template/contexts/ViewModeContext.tsx +64 -0
- package/src/template/hooks/useAlignedColumns.ts +19 -0
- package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
- package/src/template/routes/examples/name.tsx +13 -1
- package/src/template/routes/reference.tsx +67 -23
- package/src/types/virtual-modules.d.ts +5 -0
- package/src/vite/plugins/core.ts +6 -0
- package/src/vite/plugins/examples.ts +12 -2
- package/src/vite/plugins/index.ts +1 -0
- package/src/vite/plugins/navbar.ts +4 -1
- package/src/vite/plugins/reference.ts +130 -0
- package/src/vite/plugins/schemas.ts +51 -2
- package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
- package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
- package/build/api/examples/diagnostic/unused-default.js +0 -19
- package/build/api/examples/diagnostic/unused-default.js.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
- package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.js +0 -55
- package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
- package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.js +0 -22
- package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
- package/build/api/schema/augmentations/target.d.ts +0 -25
- package/build/api/schema/augmentations/target.d.ts.map +0 -1
- package/build/api/schema/augmentations/target.js +0 -39
- package/build/api/schema/augmentations/target.js.map +0 -1
- package/build/lib/graphql-path/constructors.d.ts +0 -57
- package/build/lib/graphql-path/constructors.d.ts.map +0 -1
- package/build/lib/graphql-path/constructors.js +0 -73
- package/build/lib/graphql-path/constructors.js.map +0 -1
- package/build/template/components/ArgumentList.d.ts +0 -6
- package/build/template/components/ArgumentList.d.ts.map +0 -1
- package/build/template/components/ArgumentList.js +0 -9
- package/build/template/components/ArgumentList.js.map +0 -1
- package/src/api/examples/diagnostic/unused-default.ts +0 -22
- package/src/api/schema/augmentations/augmentations/description.ts +0 -69
- package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
- package/src/api/schema/augmentations/target.ts +0 -61
- package/src/lib/graphql-path/constructors.ts +0 -81
- package/src/template/components/ArgumentList.tsx +0 -22
@@ -7,20 +7,28 @@ import { Lifecycles } from '#lib/lifecycles/$'
|
|
7
7
|
import { route, useLoaderData } from '#lib/react-router-effect/react-router-effect'
|
8
8
|
import { Schema } from '#lib/schema/$'
|
9
9
|
import { Version } from '#lib/version/$'
|
10
|
+
import { SegmentedControl, Text } from '@radix-ui/themes'
|
10
11
|
import { Flex } from '@radix-ui/themes'
|
12
|
+
import { Str } from '@wollybeard/kit'
|
11
13
|
import { neverCase } from '@wollybeard/kit/language'
|
12
14
|
import { HashMap, Option } from 'effect'
|
13
15
|
import { Effect, Match } from 'effect'
|
14
16
|
import React from 'react'
|
15
|
-
import { useParams } from 'react-router'
|
17
|
+
import { redirect, useParams } from 'react-router'
|
18
|
+
import { templateConfig } from 'virtual:polen/project/config'
|
19
|
+
import { IndexComponent } from 'virtual:polen/project/reference'
|
16
20
|
import { schemasCatalog } from 'virtual:polen/project/schemas'
|
17
21
|
import { Field } from '../components/Field.js'
|
18
22
|
import { TypeKindIcon } from '../components/graphql/graphql.js'
|
19
23
|
import { MissingSchema } from '../components/MissingSchema.js'
|
20
24
|
import { NamedType } from '../components/NamedType.js'
|
21
25
|
import { ReferenceVersionPicker } from '../components/ReferenceVersionPicker.js'
|
26
|
+
import { ViewModeToggle } from '../components/ViewModeToggle.js'
|
22
27
|
import { GraphqlLifecycleProvider } from '../contexts/GraphqlLifecycleContext.js'
|
28
|
+
import { ReferenceConfigProvider } from '../contexts/ReferenceConfigContext.js'
|
29
|
+
import { ViewModeProvider } from '../contexts/ViewModeContext.js'
|
23
30
|
import { SidebarLayout } from '../layouts/index.js'
|
31
|
+
import { MdxProvider } from '../providers/mdx.js'
|
24
32
|
|
25
33
|
const routeSchema = S.Struct({
|
26
34
|
catalog: Catalog.Catalog,
|
@@ -28,6 +36,17 @@ const routeSchema = S.Struct({
|
|
28
36
|
})
|
29
37
|
|
30
38
|
const referenceLoader = ({ params }: any) => {
|
39
|
+
// Check if reference is enabled
|
40
|
+
if (!templateConfig.reference.enabled) {
|
41
|
+
throw new Response('Reference documentation is disabled', { status: 404 })
|
42
|
+
}
|
43
|
+
|
44
|
+
// Check if no type is selected (index route) and no custom index exists
|
45
|
+
if (!params.type && !params.version && !IndexComponent) {
|
46
|
+
// Redirect to Query type which is guaranteed to exist
|
47
|
+
throw redirect('/reference/Query')
|
48
|
+
}
|
49
|
+
|
31
50
|
// This should never be called when schemasCatalog is null
|
32
51
|
// because the route won't be added to the router
|
33
52
|
// But we return an Effect.fail for safety
|
@@ -97,7 +116,7 @@ const ReferenceView = () => {
|
|
97
116
|
for (const [title, types] of kindEntries) {
|
98
117
|
sidebarItems.push({
|
99
118
|
type: `ItemSection` as const,
|
100
|
-
title,
|
119
|
+
title: Str.Case.title(Str.Case.snake(title)),
|
101
120
|
pathExp: `reference-${title.toLowerCase()}`,
|
102
121
|
isLinkToo: false,
|
103
122
|
links: types.map(type => {
|
@@ -130,7 +149,16 @@ const ReferenceView = () => {
|
|
130
149
|
|
131
150
|
const content: React.ReactNode = (() => {
|
132
151
|
if (viewType === 'index') {
|
133
|
-
|
152
|
+
// Render custom index component if available
|
153
|
+
if (IndexComponent) {
|
154
|
+
return (
|
155
|
+
<MdxProvider schema={schema.definition}>
|
156
|
+
<IndexComponent />
|
157
|
+
</MdxProvider>
|
158
|
+
)
|
159
|
+
}
|
160
|
+
// Fallback message (shouldn't reach here due to redirect)
|
161
|
+
return <Text>Select a type from the sidebar to view its documentation.</Text>
|
134
162
|
} else if (viewType === 'type-missing' || viewType === 'field-missing') {
|
135
163
|
return <MissingSchema />
|
136
164
|
} else if (viewType === 'type') {
|
@@ -151,26 +179,42 @@ const ReferenceView = () => {
|
|
151
179
|
}
|
152
180
|
})()
|
153
181
|
|
182
|
+
const referenceConfig = {
|
183
|
+
descriptionsView: templateConfig.reference.descriptionsView,
|
184
|
+
nullabilityRendering: templateConfig.reference.nullabilityRendering,
|
185
|
+
}
|
186
|
+
|
154
187
|
return (
|
155
|
-
<
|
156
|
-
<
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
188
|
+
<ReferenceConfigProvider config={referenceConfig}>
|
189
|
+
<ViewModeProvider defaultMode={referenceConfig.descriptionsView.defaultMode}>
|
190
|
+
<GraphqlLifecycleProvider lifecycle={lifecycle} schema={schema}>
|
191
|
+
<SidebarLayout
|
192
|
+
sidebar={sidebarItems}
|
193
|
+
basePath={basePath}
|
194
|
+
topContent={(() => {
|
195
|
+
const version = Schema.getVersion(schema)
|
196
|
+
const versionPicker = catalog._tag === 'CatalogVersioned' && version
|
197
|
+
? (
|
198
|
+
<ReferenceVersionPicker
|
199
|
+
data={Catalog.Versioned.getVersions(catalog)}
|
200
|
+
current={version}
|
201
|
+
/>
|
202
|
+
)
|
203
|
+
: null
|
204
|
+
|
205
|
+
return (
|
206
|
+
<Flex gap='3' align='center'>
|
207
|
+
{versionPicker}
|
208
|
+
{referenceConfig.descriptionsView.showControl && <ViewModeToggle />}
|
209
|
+
</Flex>
|
210
|
+
)
|
211
|
+
})()}
|
212
|
+
>
|
213
|
+
{content}
|
214
|
+
</SidebarLayout>
|
215
|
+
</GraphqlLifecycleProvider>
|
216
|
+
</ViewModeProvider>
|
217
|
+
</ReferenceConfigProvider>
|
174
218
|
)
|
175
219
|
}
|
176
220
|
|
@@ -207,7 +251,7 @@ const typeAndFieldRoutes = [
|
|
207
251
|
* - Single ReferenceView component handles all variations
|
208
252
|
*/
|
209
253
|
|
210
|
-
export const reference = !schemasCatalog
|
254
|
+
export const reference = !schemasCatalog || !templateConfig.reference.enabled
|
211
255
|
? null
|
212
256
|
: route({
|
213
257
|
path: `reference`,
|
@@ -35,6 +35,11 @@ declare module 'virtual:polen/project/examples' {
|
|
35
35
|
export const IndexComponent: React.ComponentType | null
|
36
36
|
}
|
37
37
|
|
38
|
+
declare module 'virtual:polen/project/reference' {
|
39
|
+
export const referenceCatalog: import('#api/reference/catalog').Catalog
|
40
|
+
export const IndexComponent: React.ComponentType | null
|
41
|
+
}
|
42
|
+
|
38
43
|
declare module 'virtual:polen/project/config' {
|
39
44
|
export const templateConfig: import('#api/config-template/template').TemplateConfig
|
40
45
|
}
|
package/src/vite/plugins/core.ts
CHANGED
@@ -10,6 +10,7 @@ import { Examples } from './examples.js'
|
|
10
10
|
import { Hooks, viProjectHooks } from './hooks.js'
|
11
11
|
import { Navbar, viProjectNavbar } from './navbar.js'
|
12
12
|
import { Pages, viProjectRoutes } from './pages.js'
|
13
|
+
import { Reference, viProjectReference } from './reference.js'
|
13
14
|
import { Schemas, viProjectSchema } from './schemas.js'
|
14
15
|
|
15
16
|
export interface ProjectRoutesModule {
|
@@ -44,6 +45,10 @@ export const Core = (config: Api.Config.Config): Vite.PluginOption[] => {
|
|
44
45
|
schemaReader: schemasArea.reader,
|
45
46
|
dependentVirtualModules: [viProjectConfig, viProjectNavbar],
|
46
47
|
})
|
48
|
+
const referenceArea = Reference({
|
49
|
+
config,
|
50
|
+
dependentVirtualModules: [viProjectConfig, viProjectNavbar],
|
51
|
+
})
|
47
52
|
const configPlugin = ConfigPlugin({
|
48
53
|
config,
|
49
54
|
schemaReader: schemasArea.reader,
|
@@ -62,6 +67,7 @@ export const Core = (config: Api.Config.Config): Vite.PluginOption[] => {
|
|
62
67
|
...conditionalPlugins,
|
63
68
|
...examplesArea.plugins,
|
64
69
|
...schemasArea.plugins,
|
70
|
+
...referenceArea.plugins,
|
65
71
|
...pagesArea.plugins,
|
66
72
|
configPlugin,
|
67
73
|
navbarPlugin,
|
@@ -83,8 +83,6 @@ export const Examples = ({
|
|
83
83
|
const getControlForDiagnostic = (diagnostic: ExamplesModule.Diagnostic) => {
|
84
84
|
if (diagnostic.source === 'examples-scanner') {
|
85
85
|
switch (diagnostic.name) {
|
86
|
-
case 'unused-default':
|
87
|
-
return config.examples.diagnostics?.unusedVersions
|
88
86
|
case 'duplicate-content':
|
89
87
|
return config.examples.diagnostics?.duplicateContent
|
90
88
|
case 'missing-versions':
|
@@ -123,6 +121,8 @@ export const Examples = ({
|
|
123
121
|
|| file.endsWith('.gql')
|
124
122
|
|| file.endsWith('index.md')
|
125
123
|
|| file.endsWith('index.mdx')
|
124
|
+
|| (file.endsWith('.md') && !file.endsWith('index.md'))
|
125
|
+
|| (file.endsWith('.mdx') && !file.endsWith('index.mdx'))
|
126
126
|
)
|
127
127
|
},
|
128
128
|
},
|
@@ -181,6 +181,16 @@ export const Examples = ({
|
|
181
181
|
s`export const IndexComponent = null`
|
182
182
|
}
|
183
183
|
|
184
|
+
// Export description components for each example
|
185
|
+
for (const example of scanExamplesResult.catalog.examples) {
|
186
|
+
if (example.description?.path) {
|
187
|
+
s``
|
188
|
+
s`export { default as DescriptionComponent_${
|
189
|
+
example.name.replace(/-/g, '_')
|
190
|
+
} } from '${example.description.path}'`
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
184
194
|
// Encode the catalog to ensure HashMap and other Effect types are properly serialized
|
185
195
|
const encodedCatalog = Catalog.encodeSync(catalogWithIndex)
|
186
196
|
|
@@ -46,7 +46,10 @@ export const Navbar = ({
|
|
46
46
|
>,
|
47
47
|
)
|
48
48
|
|
49
|
-
if (
|
49
|
+
// Check if reference is enabled (explicitly or auto-detected via schema presence)
|
50
|
+
const referenceEnabled = config.reference.enabled ?? Boolean(loadedSchemaCatalog?.data)
|
51
|
+
|
52
|
+
if (referenceEnabled && loadedSchemaCatalog?.data) {
|
50
53
|
// IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
|
51
54
|
// Without the leading slash, React Router treats paths as relative, which causes
|
52
55
|
// hydration mismatches between SSR (where base path is prepended) and client
|
@@ -0,0 +1,130 @@
|
|
1
|
+
import type { Api } from '#api/$'
|
2
|
+
import * as ReferenceModule from '#api/reference/$'
|
3
|
+
import * as Catalog from '#api/reference/catalog'
|
4
|
+
import { Diagnostic } from '#lib/diagnostic/$'
|
5
|
+
import { ViteReactive } from '#lib/vite-reactive/$'
|
6
|
+
import { type AssetReader, createAssetReader } from '#lib/vite-reactive/reactive-asset-plugin'
|
7
|
+
import { ViteVirtual } from '#lib/vite-virtual'
|
8
|
+
import { debugPolen } from '#singletons/debug'
|
9
|
+
import { FileSystem } from '@effect/platform'
|
10
|
+
import * as NodeFileSystem from '@effect/platform-node/NodeFileSystem'
|
11
|
+
import { Str } from '@wollybeard/kit'
|
12
|
+
import { Effect } from 'effect'
|
13
|
+
import type * as Vite from 'vite'
|
14
|
+
import { polenVirtual } from '../vi.js'
|
15
|
+
|
16
|
+
// Virtual modules provided by this plugin
|
17
|
+
export const viProjectReference = polenVirtual([`project`, `reference`])
|
18
|
+
|
19
|
+
export interface Options {
|
20
|
+
config: Api.Config.Config
|
21
|
+
dependentVirtualModules?: ViteVirtual.Identifier.Identifier[]
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Reference plugin for handling reference documentation
|
26
|
+
*/
|
27
|
+
export const Reference = ({
|
28
|
+
config,
|
29
|
+
dependentVirtualModules = [],
|
30
|
+
}: Options): {
|
31
|
+
plugins: Vite.Plugin[]
|
32
|
+
reader: AssetReader<ReferenceModule.ScanResult, Error, FileSystem.FileSystem>
|
33
|
+
} => {
|
34
|
+
const debug = debugPolen.sub(`vite-reference`)
|
35
|
+
|
36
|
+
const reader = createAssetReader<ReferenceModule.ScanResult, Error, FileSystem.FileSystem>(() => {
|
37
|
+
return ReferenceModule.scan({
|
38
|
+
dir: config.paths.project.rootDir,
|
39
|
+
})
|
40
|
+
})
|
41
|
+
|
42
|
+
const scanReference = async () => {
|
43
|
+
return await Effect.runPromise(
|
44
|
+
reader.read().pipe(Effect.provide(NodeFileSystem.layer)),
|
45
|
+
)
|
46
|
+
}
|
47
|
+
|
48
|
+
// Map diagnostic to its control configuration
|
49
|
+
const getControlForDiagnostic = (diagnostic: any) => {
|
50
|
+
return config.reference.diagnostics?.validation
|
51
|
+
}
|
52
|
+
|
53
|
+
// Report diagnostics
|
54
|
+
const reportDiagnostics = (
|
55
|
+
diagnostics: any[],
|
56
|
+
phase: 'dev' | 'build' = 'dev',
|
57
|
+
) => {
|
58
|
+
Diagnostic.filterAndReport(diagnostics, getControlForDiagnostic, phase)
|
59
|
+
}
|
60
|
+
|
61
|
+
// Check if a file is the reference index file
|
62
|
+
const isReferenceIndexFile = (file: string): boolean => {
|
63
|
+
return file.endsWith('/reference/index.md') || file.endsWith('/reference/index.mdx')
|
64
|
+
}
|
65
|
+
|
66
|
+
const plugins: Vite.Plugin[] = [
|
67
|
+
ViteReactive.ReactiveAssetPlugin<ReferenceModule.ScanResult, Error, FileSystem.FileSystem>({
|
68
|
+
name: 'polen:reference-reactive',
|
69
|
+
reader,
|
70
|
+
filePatterns: {
|
71
|
+
watch: ['reference'],
|
72
|
+
isRelevant: (file: string) => {
|
73
|
+
return isReferenceIndexFile(file)
|
74
|
+
},
|
75
|
+
},
|
76
|
+
dependentVirtualModules: [viProjectReference, ...dependentVirtualModules],
|
77
|
+
hooks: {
|
78
|
+
async shouldFullReload() {
|
79
|
+
// Trigger full reload for reference changes
|
80
|
+
return true
|
81
|
+
},
|
82
|
+
async onDiagnostics(data: any) {
|
83
|
+
// Report diagnostics with DiagnosticControl filtering
|
84
|
+
reportDiagnostics(data.diagnostics, 'dev')
|
85
|
+
},
|
86
|
+
},
|
87
|
+
}),
|
88
|
+
{
|
89
|
+
name: 'polen:reference-virtual',
|
90
|
+
...ViteVirtual.IdentifiedLoader.toHooks(
|
91
|
+
{
|
92
|
+
identifier: viProjectReference,
|
93
|
+
async loader() {
|
94
|
+
debug(`Loading viProjectReference virtual module`)
|
95
|
+
|
96
|
+
const scanReferenceResult = await scanReference()
|
97
|
+
|
98
|
+
reportDiagnostics(scanReferenceResult.diagnostics, 'dev')
|
99
|
+
|
100
|
+
// Generate the module code with both catalog and component exports
|
101
|
+
const s = Str.Builder()
|
102
|
+
s`import { Effect } from 'effect'`
|
103
|
+
s`import * as Catalog from '#api/reference/catalog'`
|
104
|
+
|
105
|
+
const indexFilePath = scanReferenceResult.catalog.index?.path
|
106
|
+
if (indexFilePath) {
|
107
|
+
s``
|
108
|
+
s`export { default as IndexComponent } from '${indexFilePath}'`
|
109
|
+
} else {
|
110
|
+
s``
|
111
|
+
s`export const IndexComponent = null`
|
112
|
+
}
|
113
|
+
|
114
|
+
// Encode the catalog to ensure proper serialization
|
115
|
+
const encodedCatalog = Catalog.encodeSync(scanReferenceResult.catalog)
|
116
|
+
|
117
|
+
s``
|
118
|
+
s`const catalogData = ${JSON.stringify(encodedCatalog)}`
|
119
|
+
s``
|
120
|
+
s`export const referenceCatalog = Catalog.decodeSync(catalogData)`
|
121
|
+
|
122
|
+
return s.render()
|
123
|
+
},
|
124
|
+
},
|
125
|
+
),
|
126
|
+
},
|
127
|
+
]
|
128
|
+
|
129
|
+
return { plugins, reader }
|
130
|
+
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { Api } from '#api/$'
|
2
2
|
import { Schema } from '#api/schema/$'
|
3
|
+
import type { Diagnostic as AugmentationDiagnostic } from '#api/schema/augmentations/diagnostics/diagnostic'
|
3
4
|
import { Catalog } from '#lib/catalog/$'
|
5
|
+
import { Diagnostic } from '#lib/diagnostic/$'
|
4
6
|
import { ViteReactive } from '#lib/vite-reactive/$'
|
5
7
|
import { createAssetReader } from '#lib/vite-reactive/reactive-asset-plugin'
|
6
8
|
import { ViteVirtual } from '#lib/vite-virtual/$'
|
@@ -39,7 +41,40 @@ export const Schemas = ({
|
|
39
41
|
// Self-contained Schema Reader
|
40
42
|
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
41
43
|
|
42
|
-
|
44
|
+
let lastDiagnostics: AugmentationDiagnostic[] = []
|
45
|
+
|
46
|
+
const reader = createAssetReader(() =>
|
47
|
+
Schema.loadOrNull(config).pipe(
|
48
|
+
Effect.map((result) => {
|
49
|
+
// Store diagnostics for reporting
|
50
|
+
if (result?.diagnostics) {
|
51
|
+
lastDiagnostics = result.diagnostics
|
52
|
+
}
|
53
|
+
return result
|
54
|
+
}),
|
55
|
+
)
|
56
|
+
)
|
57
|
+
|
58
|
+
// Map diagnostic to its control configuration
|
59
|
+
const getControlForDiagnostic = (diagnostic: AugmentationDiagnostic) => {
|
60
|
+
if (diagnostic.source === 'schema-augmentations') {
|
61
|
+
// All augmentation errors are always enabled with error severity
|
62
|
+
return {
|
63
|
+
enabled: true,
|
64
|
+
dev: { severity: 'error' as const },
|
65
|
+
build: { severity: 'error' as const },
|
66
|
+
}
|
67
|
+
}
|
68
|
+
return undefined
|
69
|
+
}
|
70
|
+
|
71
|
+
// Report diagnostics
|
72
|
+
const reportDiagnostics = (
|
73
|
+
diagnostics: AugmentationDiagnostic[],
|
74
|
+
phase: 'dev' | 'build' = 'dev',
|
75
|
+
) => {
|
76
|
+
Diagnostic.filterAndReport(diagnostics, getControlForDiagnostic, phase)
|
77
|
+
}
|
43
78
|
|
44
79
|
// Helper to check if a file is a schema file that should trigger regeneration
|
45
80
|
const isSchemaFile = (file: string): boolean => {
|
@@ -102,7 +137,7 @@ export const Schemas = ({
|
|
102
137
|
// @claude in what case can data be null?
|
103
138
|
serializer: (loadedCatalog) =>
|
104
139
|
Effect.gen(function*() {
|
105
|
-
if (!loadedCatalog
|
140
|
+
if (!loadedCatalog?.data) throw new Error('No schema data to serialize')
|
106
141
|
const encoded = yield* Catalog.encode(loadedCatalog.data)
|
107
142
|
return JSON.stringify(encoded, null, 2)
|
108
143
|
}),
|
@@ -113,6 +148,14 @@ export const Schemas = ({
|
|
113
148
|
isRelevant: isSchemaFile,
|
114
149
|
},
|
115
150
|
dependentVirtualModules,
|
151
|
+
hooks: {
|
152
|
+
async onDiagnostics(data) {
|
153
|
+
// Report augmentation diagnostics
|
154
|
+
if (data?.diagnostics) {
|
155
|
+
reportDiagnostics(data.diagnostics as AugmentationDiagnostic[], 'dev')
|
156
|
+
}
|
157
|
+
},
|
158
|
+
},
|
116
159
|
}),
|
117
160
|
{
|
118
161
|
name: 'polen:schemas-virtual',
|
@@ -126,6 +169,12 @@ export const Schemas = ({
|
|
126
169
|
const schemaResult = await Effect.runPromise(
|
127
170
|
reader.read().pipe(Effect.provide(NodeFileSystem.layer)),
|
128
171
|
)
|
172
|
+
|
173
|
+
// Report diagnostics if any
|
174
|
+
if (schemaResult?.diagnostics && schemaResult.diagnostics.length > 0) {
|
175
|
+
reportDiagnostics(schemaResult.diagnostics, 'dev')
|
176
|
+
}
|
177
|
+
|
129
178
|
if (!schemaResult?.data) {
|
130
179
|
return `export const schemasCatalog = null`
|
131
180
|
}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import { S } from '#lib/kit-temp/effect';
|
2
|
-
export declare const DiagnosticUnusedDefault: S.Struct<{
|
3
|
-
_tag: S.tag<"Diagnostic">;
|
4
|
-
} & Omit<{
|
5
|
-
_tag: S.Literal<["Diagnostic"]>;
|
6
|
-
source: typeof S.String;
|
7
|
-
name: typeof S.String;
|
8
|
-
severity: S.Enums<{
|
9
|
-
readonly error: "error";
|
10
|
-
readonly warning: "warning";
|
11
|
-
readonly info: "info";
|
12
|
-
}>;
|
13
|
-
message: typeof S.String;
|
14
|
-
}, "_tag" | "name" | "source" | "severity"> & {
|
15
|
-
name: S.Literal<["unused-default"]>;
|
16
|
-
source: S.Literal<["examples-scanner"]>;
|
17
|
-
severity: S.Literal<["warning"]>;
|
18
|
-
} & {
|
19
|
-
example: S.Struct<{
|
20
|
-
name: typeof S.String;
|
21
|
-
path: typeof S.String;
|
22
|
-
}>;
|
23
|
-
versions: S.Array$<typeof S.String>;
|
24
|
-
}>;
|
25
|
-
export declare const makeDiagnosticUnusedDefault: import("#lib/kit-temp/effect").EffectKit.Schema.ConstructorUsingOmitLiteral1Algo<S.Struct<{
|
26
|
-
_tag: S.tag<"Diagnostic">;
|
27
|
-
} & Omit<{
|
28
|
-
_tag: S.Literal<["Diagnostic"]>;
|
29
|
-
source: typeof S.String;
|
30
|
-
name: typeof S.String;
|
31
|
-
severity: S.Enums<{
|
32
|
-
readonly error: "error";
|
33
|
-
readonly warning: "warning";
|
34
|
-
readonly info: "info";
|
35
|
-
}>;
|
36
|
-
message: typeof S.String;
|
37
|
-
}, "_tag" | "name" | "source" | "severity"> & {
|
38
|
-
name: S.Literal<["unused-default"]>;
|
39
|
-
source: S.Literal<["examples-scanner"]>;
|
40
|
-
severity: S.Literal<["warning"]>;
|
41
|
-
} & {
|
42
|
-
example: S.Struct<{
|
43
|
-
name: typeof S.String;
|
44
|
-
path: typeof S.String;
|
45
|
-
}>;
|
46
|
-
versions: S.Array$<typeof S.String>;
|
47
|
-
}>>;
|
48
|
-
export type DiagnosticUnusedDefault = S.Schema.Type<typeof DiagnosticUnusedDefault>;
|
49
|
-
//# sourceMappingURL=unused-default.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"unused-default.d.ts","sourceRoot":"","sources":["../../../../src/api/examples/diagnostic/unused-default.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;EAclC,CAAA;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;GAAiD,CAAA;AAEzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
-
import { S } from '#lib/kit-temp/effect';
|
3
|
-
export const DiagnosticUnusedDefault = Diagnostic.create({
|
4
|
-
source: 'examples-scanner',
|
5
|
-
name: 'unused-default',
|
6
|
-
severity: 'warning',
|
7
|
-
context: {
|
8
|
-
example: S.Struct({
|
9
|
-
name: S.String,
|
10
|
-
path: S.String,
|
11
|
-
}),
|
12
|
-
versions: S.Array(S.String),
|
13
|
-
},
|
14
|
-
}).annotations({
|
15
|
-
identifier: 'DiagnosticUnusedDefault',
|
16
|
-
description: 'Default example file that is never used because explicit versions exist for all schema versions',
|
17
|
-
});
|
18
|
-
export const makeDiagnosticUnusedDefault = Diagnostic.createMake(DiagnosticUnusedDefault);
|
19
|
-
//# sourceMappingURL=unused-default.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"unused-default.js","sourceRoot":"","sources":["../../../../src/api/examples/diagnostic/unused-default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,MAAM,CAAC;IACvD,MAAM,EAAE,kBAAkB;IAC1B,IAAI,EAAE,gBAAgB;IACtB,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;YAChB,IAAI,EAAE,CAAC,CAAC,MAAM;YACd,IAAI,EAAE,CAAC,CAAC,MAAM;SACf,CAAC;QACF,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;KAC5B;CACF,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,yBAAyB;IACrC,WAAW,EAAE,iGAAiG;CAC/G,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAA"}
|
@@ -1,26 +0,0 @@
|
|
1
|
-
import type { GrafaidOld } from '#lib/grafaid-old';
|
2
|
-
import { S } from '#lib/kit-temp/effect';
|
3
|
-
export declare const PlacementSchema: S.Literal<["before", "after", "over"]>;
|
4
|
-
export type Placement = S.Schema.Type<typeof PlacementSchema>;
|
5
|
-
export declare const DescriptionAugmentationSchema: S.Struct<{
|
6
|
-
type: S.Literal<["description"]>;
|
7
|
-
on: S.Union<[S.Struct<{
|
8
|
-
type: S.Literal<["TargetType"]>;
|
9
|
-
name: typeof S.String;
|
10
|
-
}>, S.Struct<{
|
11
|
-
type: S.Literal<["TargetField"]>;
|
12
|
-
name: typeof S.String;
|
13
|
-
targetType: typeof S.String;
|
14
|
-
}>]>;
|
15
|
-
placement: S.Literal<["before", "after", "over"]>;
|
16
|
-
content: typeof S.String;
|
17
|
-
}>;
|
18
|
-
export type DescriptionAugmentation = S.Schema.Type<typeof DescriptionAugmentationSchema>;
|
19
|
-
export declare const Placement: {
|
20
|
-
Before: "before";
|
21
|
-
After: "after";
|
22
|
-
Over: "over";
|
23
|
-
};
|
24
|
-
export declare const applyDescriptionContent: (type: GrafaidOld.Groups.Describable, augmentation: DescriptionAugmentation) => void;
|
25
|
-
export declare const apply: (schema: GrafaidOld.Schema.Schema, augmentation: DescriptionAugmentation) => void;
|
26
|
-
//# sourceMappingURL=description.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"description.d.ts","sourceRoot":"","sources":["../../../../../src/api/schema/augmentations/augmentations/description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AASxC,eAAO,MAAM,eAAe,wCAAuC,CAAA;AACnE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAKxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAMzF,eAAO,MAAM,SAAS;;;;CAIrB,CAAA;AAED,eAAO,MAAM,uBAAuB,GAClC,MAAM,UAAU,CAAC,MAAM,CAAC,WAAW,EACnC,cAAc,uBAAuB,SAiBtC,CAAA;AAED,eAAO,MAAM,KAAK,GAAI,QAAQ,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,uBAAuB,SAe5F,CAAA"}
|
@@ -1,55 +0,0 @@
|
|
1
|
-
import { S } from '#lib/kit-temp/effect';
|
2
|
-
import { neverCase } from '@wollybeard/kit/language';
|
3
|
-
import { TargetSchema } from '../target.js';
|
4
|
-
import { locateTargetField, locateTargetType } from '../target.js';
|
5
|
-
// ============================================================================
|
6
|
-
// Schema
|
7
|
-
// ============================================================================
|
8
|
-
export const PlacementSchema = S.Literal('before', 'after', 'over');
|
9
|
-
export const DescriptionAugmentationSchema = S.Struct({
|
10
|
-
type: S.Literal('description'),
|
11
|
-
on: TargetSchema,
|
12
|
-
placement: PlacementSchema,
|
13
|
-
content: S.String,
|
14
|
-
});
|
15
|
-
// ============================================================================
|
16
|
-
// Constants
|
17
|
-
// ============================================================================
|
18
|
-
export const Placement = {
|
19
|
-
Before: `before`,
|
20
|
-
After: `after`,
|
21
|
-
Over: `over`,
|
22
|
-
};
|
23
|
-
export const applyDescriptionContent = (type, augmentation) => {
|
24
|
-
const existingDescription = type.description ?? ``;
|
25
|
-
switch (augmentation.placement) {
|
26
|
-
case `before`:
|
27
|
-
type.description = `${augmentation.content}\n\n${existingDescription}`;
|
28
|
-
break;
|
29
|
-
case `after`:
|
30
|
-
type.description = `${existingDescription}\n\n${augmentation.content}`;
|
31
|
-
break;
|
32
|
-
case `over`:
|
33
|
-
type.description = augmentation.content;
|
34
|
-
break;
|
35
|
-
default:
|
36
|
-
neverCase(augmentation.placement);
|
37
|
-
}
|
38
|
-
};
|
39
|
-
export const apply = (schema, augmentation) => {
|
40
|
-
switch (augmentation.on.type) {
|
41
|
-
case `TargetType`: {
|
42
|
-
const type = locateTargetType(schema, augmentation.on);
|
43
|
-
applyDescriptionContent(type, augmentation);
|
44
|
-
break;
|
45
|
-
}
|
46
|
-
case `TargetField`: {
|
47
|
-
const field = locateTargetField(schema, augmentation.on);
|
48
|
-
applyDescriptionContent(field, augmentation);
|
49
|
-
break;
|
50
|
-
}
|
51
|
-
default:
|
52
|
-
neverCase(augmentation.on);
|
53
|
-
}
|
54
|
-
};
|
55
|
-
//# sourceMappingURL=description.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"description.js","sourceRoot":"","sources":["../../../../../src/api/schema/augmentations/augmentations/description.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAElE,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;AAGnE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,EAAE,EAAE,YAAY;IAChB,SAAS,EAAE,eAAe;IAC1B,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAA;AAIF,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM,EAAE,QAAiB;IACzB,KAAK,EAAE,OAAgB;IACvB,IAAI,EAAE,MAAe;CACtB,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,IAAmC,EACnC,YAAqC,EACrC,EAAE;IACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,IAAI,EAAE,CAAA;IAElD,QAAQ,YAAY,CAAC,SAAS,EAAE,CAAC;QAC/B,KAAK,QAAQ;YACX,IAAI,CAAC,WAAW,GAAG,GAAG,YAAY,CAAC,OAAO,OAAO,mBAAmB,EAAE,CAAA;YACtE,MAAK;QACP,KAAK,OAAO;YACV,IAAI,CAAC,WAAW,GAAG,GAAG,mBAAmB,OAAO,YAAY,CAAC,OAAO,EAAE,CAAA;YACtE,MAAK;QACP,KAAK,MAAM;YACT,IAAI,CAAC,WAAW,GAAG,YAAY,CAAC,OAAO,CAAA;YACvC,MAAK;QACP;YACE,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,MAAgC,EAAE,YAAqC,EAAE,EAAE;IAC/F,QAAQ,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QAC7B,KAAK,YAAY,CAAC,CAAC,CAAC;YAClB,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAA;YACtD,uBAAuB,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;YAC3C,MAAK;QACP,CAAC;QACD,KAAK,aAAa,CAAC,CAAC,CAAC;YACnB,MAAM,KAAK,GAAG,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,CAAA;YACxD,uBAAuB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;YAC5C,MAAK;QACP,CAAC;QACD;YACE,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC,CAAA;IAC9B,CAAC;AACH,CAAC,CAAA"}
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import type { GrafaidOld } from '#lib/grafaid-old';
|
2
|
-
import { S } from '#lib/kit-temp/effect';
|
3
|
-
import * as AugmentationDescription from './augmentations/description.js';
|
4
|
-
export { AugmentationDescription };
|
5
|
-
export declare const AugmentationSchema: S.Struct<{
|
6
|
-
type: S.Literal<["description"]>;
|
7
|
-
on: S.Union<[S.Struct<{
|
8
|
-
type: S.Literal<["TargetType"]>;
|
9
|
-
name: typeof S.String;
|
10
|
-
}>, S.Struct<{
|
11
|
-
type: S.Literal<["TargetField"]>;
|
12
|
-
name: typeof S.String;
|
13
|
-
targetType: typeof S.String;
|
14
|
-
}>]>;
|
15
|
-
placement: S.Literal<["before", "after", "over"]>;
|
16
|
-
content: typeof S.String;
|
17
|
-
}>;
|
18
|
-
export type Augmentation = S.Schema.Type<typeof AugmentationSchema>;
|
19
|
-
export declare const apply: (schema: GrafaidOld.Schema.Schema, augmentations: readonly Augmentation[]) => GrafaidOld.Schema.Schema;
|
20
|
-
//# sourceMappingURL=schema-augmentation.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"schema-augmentation.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/schema-augmentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,OAAO,KAAK,uBAAuB,MAAM,gCAAgC,CAAA;AAEzE,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAMlC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAAwD,CAAA;AAEvF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE,eAAO,MAAM,KAAK,GAChB,QAAQ,UAAU,CAAC,MAAM,CAAC,MAAM,EAChC,eAAe,SAAS,YAAY,EAAE,KACrC,UAAU,CAAC,MAAM,CAAC,MAapB,CAAA"}
|