polen 0.11.0-next.17 → 0.11.0-next.19
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/builder/ssg/generate.d.ts.map +1 -1
- package/build/api/builder/ssg/generate.js +5 -5
- package/build/api/builder/ssg/generate.js.map +1 -1
- package/build/api/builder/ssg/page-generator.worker.js +13 -3
- package/build/api/builder/ssg/page-generator.worker.js.map +1 -1
- package/build/api/config/input.d.ts +88 -3
- package/build/api/config/input.d.ts.map +1 -1
- package/build/api/config/normalized.d.ts +92 -7
- package/build/api/config/normalized.d.ts.map +1 -1
- package/build/api/config/normalized.js +11 -3
- package/build/api/config/normalized.js.map +1 -1
- package/build/api/config-template/template.js +2 -2
- package/build/api/config-template/template.js.map +1 -1
- package/build/api/content/sidebar.d.ts.map +1 -1
- package/build/api/content/sidebar.js +2 -1
- package/build/api/content/sidebar.js.map +1 -1
- package/build/api/errors.d.ts +278 -0
- package/build/api/errors.d.ts.map +1 -0
- package/build/api/errors.js +153 -0
- package/build/api/errors.js.map +1 -0
- package/build/api/examples/config.d.ts +366 -3
- package/build/api/examples/config.d.ts.map +1 -1
- package/build/api/examples/config.js +25 -3
- package/build/api/examples/config.js.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.d.ts +1 -1
- package/build/api/examples/diagnostic/validation-error.d.ts +3 -2
- package/build/api/examples/diagnostic/validation-error.d.ts.map +1 -1
- package/build/api/examples/diagnostic/validation-error.js +9 -3
- package/build/api/examples/diagnostic/validation-error.js.map +1 -1
- package/build/api/examples/diagnostic/validator.d.ts.map +1 -1
- package/build/api/examples/diagnostic/validator.js +115 -68
- package/build/api/examples/diagnostic/validator.js.map +1 -1
- package/build/api/examples/filter.d.ts.map +1 -1
- package/build/api/examples/filter.js +9 -6
- package/build/api/examples/filter.js.map +1 -1
- package/build/api/examples/scanner.d.ts.map +1 -1
- package/build/api/examples/scanner.js +89 -103
- package/build/api/examples/scanner.js.map +1 -1
- package/build/api/examples/type-usage-indexer.d.ts.map +1 -1
- package/build/api/examples/type-usage-indexer.js +17 -30
- package/build/api/examples/type-usage-indexer.js.map +1 -1
- package/build/api/iso/schema/routing.d.ts.map +1 -1
- package/build/api/iso/schema/routing.js +8 -8
- package/build/api/iso/schema/routing.js.map +1 -1
- package/build/api/iso/schema/validation.d.ts.map +1 -1
- package/build/api/iso/schema/validation.js +3 -2
- package/build/api/iso/schema/validation.js.map +1 -1
- package/build/api/schema/input-source/$$.d.ts +1 -0
- package/build/api/schema/input-source/$$.d.ts.map +1 -1
- package/build/api/schema/input-source/$$.js +1 -0
- package/build/api/schema/input-source/$$.js.map +1 -1
- package/build/api/schema/input-source/errors.d.ts +36 -0
- package/build/api/schema/input-source/errors.d.ts.map +1 -0
- package/build/api/schema/input-source/errors.js +17 -0
- package/build/api/schema/input-source/errors.js.map +1 -0
- package/build/api/schema/input-source/input-source.d.ts +1 -7
- package/build/api/schema/input-source/input-source.d.ts.map +1 -1
- package/build/api/schema/input-source/input-source.js +0 -6
- package/build/api/schema/input-source/input-source.js.map +1 -1
- package/build/api/schema/input-sources/directory.d.ts.map +1 -1
- package/build/api/schema/input-sources/directory.js +19 -6
- package/build/api/schema/input-sources/directory.js.map +1 -1
- package/build/api/schema/input-sources/file.d.ts.map +1 -1
- package/build/api/schema/input-sources/file.js +15 -4
- package/build/api/schema/input-sources/file.js.map +1 -1
- package/build/api/schema/input-sources/introspection-file.d.ts.map +1 -1
- package/build/api/schema/input-sources/introspection-file.js +28 -6
- package/build/api/schema/input-sources/introspection-file.js.map +1 -1
- package/build/api/schema/input-sources/introspection.d.ts.map +1 -1
- package/build/api/schema/input-sources/introspection.js +35 -7
- package/build/api/schema/input-sources/introspection.js.map +1 -1
- package/build/api/schema/input-sources/memory.d.ts.map +1 -1
- package/build/api/schema/input-sources/memory.js +15 -3
- package/build/api/schema/input-sources/memory.js.map +1 -1
- package/build/api/schema/input-sources/versioned-directory.d.ts.map +1 -1
- package/build/api/schema/input-sources/versioned-directory.js +23 -7
- package/build/api/schema/input-sources/versioned-directory.js.map +1 -1
- package/build/api/schema/load.d.ts +1 -1
- package/build/api/schema/load.d.ts.map +1 -1
- package/build/api/schema/load.js.map +1 -1
- package/build/cli/commands/hero-image.d.ts +1 -2
- package/build/cli/commands/hero-image.d.ts.map +1 -1
- package/build/cli/index.d.ts +1 -1
- package/build/lib/catalog/catalog.d.ts +43 -3
- package/build/lib/catalog/catalog.d.ts.map +1 -1
- package/build/lib/catalog/catalog.js +67 -5
- package/build/lib/catalog/catalog.js.map +1 -1
- package/build/lib/catalog/versioned.d.ts +11 -1
- package/build/lib/catalog/versioned.d.ts.map +1 -1
- package/build/lib/catalog/versioned.js +23 -5
- package/build/lib/catalog/versioned.js.map +1 -1
- package/build/lib/document/document.d.ts +55 -5
- package/build/lib/document/document.d.ts.map +1 -1
- package/build/lib/document/document.js +96 -2
- package/build/lib/document/document.js.map +1 -1
- package/build/lib/document/versioned.d.ts +2 -2
- package/build/lib/document/versioned.d.ts.map +1 -1
- package/build/lib/document/versioned.js +7 -7
- package/build/lib/document/versioned.js.map +1 -1
- package/build/lib/lifecycles/lifecycles.d.ts +5 -4
- package/build/lib/lifecycles/lifecycles.d.ts.map +1 -1
- package/build/lib/lifecycles/lifecycles.js +14 -12
- package/build/lib/lifecycles/lifecycles.js.map +1 -1
- package/build/lib/version-coverage/$$.d.ts +2 -0
- package/build/lib/version-coverage/$$.d.ts.map +1 -0
- package/build/lib/version-coverage/$$.js +2 -0
- package/build/lib/version-coverage/$$.js.map +1 -0
- package/build/lib/version-coverage/$.d.ts.map +1 -0
- package/build/lib/version-coverage/$.js.map +1 -0
- package/build/lib/{version-selection/version-selection.d.ts → version-coverage/version-coverage.d.ts} +1 -1
- package/build/lib/version-coverage/version-coverage.d.ts.map +1 -0
- package/build/lib/{version-selection/version-selection.js → version-coverage/version-coverage.js} +2 -2
- package/build/lib/version-coverage/version-coverage.js.map +1 -0
- package/build/template/components/GraphQLDocument.d.ts +1 -1
- package/build/template/components/GraphQLDocument.d.ts.map +1 -1
- package/build/template/components/GraphQLDocument.js +10 -39
- package/build/template/components/GraphQLDocument.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts +28 -0
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +60 -27
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/ReferenceVersionPicker.d.ts +9 -0
- package/build/template/components/ReferenceVersionPicker.d.ts.map +1 -0
- package/build/template/components/ReferenceVersionPicker.js +79 -0
- package/build/template/components/ReferenceVersionPicker.js.map +1 -0
- package/build/template/components/VersionCoveragePicker.d.ts +1 -1
- package/build/template/components/VersionCoveragePicker.d.ts.map +1 -1
- package/build/template/components/VersionCoveragePicker.js +4 -6
- package/build/template/components/VersionCoveragePicker.js.map +1 -1
- package/build/template/components/VersionPicker.d.ts +8 -3
- package/build/template/components/VersionPicker.d.ts.map +1 -1
- package/build/template/components/VersionPicker.js +12 -77
- package/build/template/components/VersionPicker.js.map +1 -1
- package/build/template/components/home/QuickStart.d.ts.map +1 -1
- package/build/template/components/home/QuickStart.js +8 -4
- package/build/template/components/home/QuickStart.js.map +1 -1
- package/build/template/hooks/use-highlighted.d.ts.map +1 -1
- package/build/template/hooks/use-highlighted.js +19 -13
- package/build/template/hooks/use-highlighted.js.map +1 -1
- package/build/template/lib/fetch-text.d.ts +18 -0
- package/build/template/lib/fetch-text.d.ts.map +1 -1
- package/build/template/lib/fetch-text.js +32 -4
- package/build/template/lib/fetch-text.js.map +1 -1
- package/build/template/routes/changelog/ChangelogBody.d.ts +6 -0
- package/build/template/routes/changelog/ChangelogBody.d.ts.map +1 -0
- package/build/template/{components/Changelog/Changelog.js → routes/changelog/ChangelogBody.js} +8 -58
- package/build/template/routes/changelog/ChangelogBody.js.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebar.d.ts +7 -0
- package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebar.js +46 -0
- package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebarItem.d.ts +11 -0
- package/build/template/routes/changelog/ChangelogSidebarItem.d.ts.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebarItem.js +35 -0
- package/build/template/routes/changelog/ChangelogSidebarItem.js.map +1 -0
- package/build/template/routes/changelog/_.d.ts +3264 -0
- package/build/template/routes/changelog/_.d.ts.map +1 -0
- package/build/template/routes/changelog/_.js +111 -0
- package/build/template/routes/changelog/_.js.map +1 -0
- package/build/template/routes/changelog/utils.d.ts +3 -0
- package/build/template/routes/changelog/utils.d.ts.map +1 -0
- package/build/template/routes/changelog/utils.js +11 -0
- package/build/template/routes/changelog/utils.js.map +1 -0
- package/build/template/routes/examples/name.d.ts.map +1 -1
- package/build/template/routes/examples/name.js +4 -2
- package/build/template/routes/examples/name.js.map +1 -1
- package/build/template/routes/reference.js +2 -2
- package/build/template/routes/reference.js.map +1 -1
- package/build/template/routes/root.js +1 -1
- package/build/template/routes/root.js.map +1 -1
- package/build/template/stores/toast.d.ts.map +1 -1
- package/build/template/stores/toast.js +5 -3
- package/build/template/stores/toast.js.map +1 -1
- package/build/template/theme/swiss-sharp.css +14 -14
- package/build/vite/plugins/schemas.d.ts +1 -2
- package/build/vite/plugins/schemas.d.ts.map +1 -1
- package/build/vite/plugins/schemas.js +0 -1
- package/build/vite/plugins/schemas.js.map +1 -1
- package/package.json +7 -7
- package/src/api/builder/ssg/generate.ts +10 -5
- package/src/api/builder/ssg/page-generator.worker.ts +18 -3
- package/src/api/config/normalized.ts +12 -3
- package/src/api/config-template/template.ts +2 -2
- package/src/api/content/sidebar.ts +3 -3
- package/src/api/errors.ts +227 -0
- package/src/api/examples/config.test.ts +10 -0
- package/src/api/examples/config.ts +33 -4
- package/src/api/examples/diagnostic/validation-error.ts +9 -3
- package/src/api/examples/diagnostic/validator.test.ts +30 -0
- package/src/api/examples/diagnostic/validator.ts +148 -103
- package/src/api/examples/filter.ts +9 -6
- package/src/api/examples/scanner.ts +136 -117
- package/src/api/examples/type-usage-indexer.ts +24 -36
- package/src/api/iso/schema/routing.ts +10 -10
- package/src/api/iso/schema/validation.ts +3 -2
- package/src/api/schema/input-source/$$.ts +1 -0
- package/src/api/schema/input-source/errors.ts +26 -0
- package/src/api/schema/input-source/input-source.ts +1 -22
- package/src/api/schema/input-sources/directory.ts +20 -15
- package/src/api/schema/input-sources/file.ts +17 -4
- package/src/api/schema/input-sources/introspection-file.ts +30 -15
- package/src/api/schema/input-sources/introspection.ts +38 -7
- package/src/api/schema/input-sources/memory.ts +19 -3
- package/src/api/schema/input-sources/versioned-directory.ts +25 -27
- package/src/api/schema/load.ts +2 -1
- package/src/lib/catalog/catalog.ts +89 -6
- package/src/lib/catalog/versioned.ts +26 -5
- package/src/lib/document/document.ts +135 -2
- package/src/lib/document/versioned.ts +8 -8
- package/src/lib/lifecycles/lifecycles.ts +32 -27
- package/src/lib/version-coverage/$$.ts +1 -0
- package/src/lib/{version-selection/version-selection.ts → version-coverage/version-coverage.ts} +1 -1
- package/src/template/components/GraphQLDocument.tsx +11 -69
- package/src/template/components/GraphQLInteractive/lib/parser.ts +81 -29
- package/src/template/components/ReferenceVersionPicker.tsx +107 -0
- package/src/template/components/VersionCoveragePicker.tsx +4 -5
- package/src/template/components/VersionPicker.tsx +32 -98
- package/src/template/components/home/QuickStart.tsx +16 -7
- package/src/template/hooks/use-highlighted.ts +31 -19
- package/src/template/lib/fetch-text.ts +45 -4
- package/src/template/{components/Changelog/Changelog.tsx → routes/changelog/ChangelogBody.tsx} +7 -64
- package/src/template/routes/changelog/ChangelogSidebar.tsx +80 -0
- package/src/template/routes/changelog/ChangelogSidebarItem.tsx +68 -0
- package/src/template/routes/changelog/_.tsx +129 -0
- package/src/template/routes/changelog/utils.ts +13 -0
- package/src/template/routes/examples/name.tsx +4 -2
- package/src/template/routes/reference.tsx +2 -2
- package/src/template/routes/root.tsx +1 -1
- package/src/template/stores/toast.ts +6 -3
- package/src/template/theme/swiss-sharp.css +14 -14
- package/src/vite/plugins/schemas.ts +0 -1
- package/build/lib/graph/$$.d.ts +0 -2
- package/build/lib/graph/$$.d.ts.map +0 -1
- package/build/lib/graph/$$.js +0 -2
- package/build/lib/graph/$$.js.map +0 -1
- package/build/lib/graph/$.d.ts +0 -2
- package/build/lib/graph/$.d.ts.map +0 -1
- package/build/lib/graph/$.js +0 -2
- package/build/lib/graph/$.js.map +0 -1
- package/build/lib/graph/graph.d.ts +0 -127
- package/build/lib/graph/graph.d.ts.map +0 -1
- package/build/lib/graph/graph.js +0 -152
- package/build/lib/graph/graph.js.map +0 -1
- package/build/lib/mask/$$.d.ts +0 -3
- package/build/lib/mask/$$.d.ts.map +0 -1
- package/build/lib/mask/$$.js +0 -3
- package/build/lib/mask/$$.js.map +0 -1
- package/build/lib/mask/$.d.ts +0 -2
- package/build/lib/mask/$.d.ts.map +0 -1
- package/build/lib/mask/$.js +0 -2
- package/build/lib/mask/$.js.map +0 -1
- package/build/lib/mask/apply.d.ts +0 -86
- package/build/lib/mask/apply.d.ts.map +0 -1
- package/build/lib/mask/apply.js +0 -86
- package/build/lib/mask/apply.js.map +0 -1
- package/build/lib/mask/mask.d.ts +0 -124
- package/build/lib/mask/mask.d.ts.map +0 -1
- package/build/lib/mask/mask.js +0 -137
- package/build/lib/mask/mask.js.map +0 -1
- package/build/lib/mask/mask.test-d.d.ts +0 -2
- package/build/lib/mask/mask.test-d.d.ts.map +0 -1
- package/build/lib/mask/mask.test-d.js +0 -102
- package/build/lib/mask/mask.test-d.js.map +0 -1
- package/build/lib/version-selection/$$.d.ts +0 -2
- package/build/lib/version-selection/$$.d.ts.map +0 -1
- package/build/lib/version-selection/$$.js +0 -2
- package/build/lib/version-selection/$$.js.map +0 -1
- package/build/lib/version-selection/$.d.ts.map +0 -1
- package/build/lib/version-selection/$.js.map +0 -1
- package/build/lib/version-selection/version-selection.d.ts.map +0 -1
- package/build/lib/version-selection/version-selection.js.map +0 -1
- package/build/sandbox.d.ts +0 -2
- package/build/sandbox.d.ts.map +0 -1
- package/build/sandbox.js +0 -17
- package/build/sandbox.js.map +0 -1
- package/build/template/components/Changelog/Changelog.d.ts +0 -8
- package/build/template/components/Changelog/Changelog.d.ts.map +0 -1
- package/build/template/components/Changelog/Changelog.js.map +0 -1
- package/build/template/components/Changelog/ChangelogVersionPicker.d.ts +0 -8
- package/build/template/components/Changelog/ChangelogVersionPicker.d.ts.map +0 -1
- package/build/template/components/Changelog/ChangelogVersionPicker.js +0 -16
- package/build/template/components/Changelog/ChangelogVersionPicker.js.map +0 -1
- package/build/template/components/SimpleVersionPicker.d.ts +0 -15
- package/build/template/components/SimpleVersionPicker.d.ts.map +0 -1
- package/build/template/components/SimpleVersionPicker.js +0 -15
- package/build/template/components/SimpleVersionPicker.js.map +0 -1
- package/build/template/routes/changelog.d.ts +0 -1635
- package/build/template/routes/changelog.d.ts.map +0 -1
- package/build/template/routes/changelog.js +0 -168
- package/build/template/routes/changelog.js.map +0 -1
- package/src/lib/graph/$$.ts +0 -1
- package/src/lib/graph/$.ts +0 -1
- package/src/lib/graph/graph.ts +0 -197
- package/src/lib/mask/$$.ts +0 -2
- package/src/lib/mask/$.test.ts +0 -226
- package/src/lib/mask/$.ts +0 -1
- package/src/lib/mask/apply.ts +0 -134
- package/src/lib/mask/mask.test-d.ts +0 -156
- package/src/lib/mask/mask.ts +0 -244
- package/src/lib/version-selection/$$.ts +0 -1
- package/src/sandbox.ts +0 -15
- package/src/template/components/Changelog/ChangelogVersionPicker.tsx +0 -36
- package/src/template/components/SimpleVersionPicker.tsx +0 -48
- package/src/template/routes/changelog.tsx +0 -267
- /package/build/lib/{version-selection → version-coverage}/$.d.ts +0 -0
- /package/build/lib/{version-selection → version-coverage}/$.js +0 -0
- /package/src/lib/{version-selection → version-coverage}/$.ts +0 -0
@@ -0,0 +1,129 @@
|
|
1
|
+
import { Catalog } from '#lib/catalog'
|
2
|
+
import { S } from '#lib/kit-temp/$'
|
3
|
+
import { route } from '#lib/react-router-effect/route'
|
4
|
+
import { useLoaderData } from '#lib/react-router-effect/use-loader-data'
|
5
|
+
import { Schema } from '#lib/schema/$'
|
6
|
+
import { Swiss } from '#lib/swiss'
|
7
|
+
import { Version } from '#lib/version'
|
8
|
+
import { Http } from '@wollybeard/kit'
|
9
|
+
import { Effect, Option } from 'effect'
|
10
|
+
import { HashMap } from 'effect'
|
11
|
+
import { redirect } from 'react-router'
|
12
|
+
import { schemasCatalog } from 'virtual:polen/project/schemas'
|
13
|
+
import { ChangelogBody } from './ChangelogBody.js'
|
14
|
+
import { ChangelogSidebar } from './ChangelogSidebar.js'
|
15
|
+
|
16
|
+
//
|
17
|
+
//
|
18
|
+
//
|
19
|
+
//
|
20
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Schema
|
21
|
+
//
|
22
|
+
//
|
23
|
+
|
24
|
+
const LoaderSchema = S.Struct({
|
25
|
+
catalog: Catalog.Catalog,
|
26
|
+
schema: Schema.Schema,
|
27
|
+
})
|
28
|
+
|
29
|
+
//
|
30
|
+
//
|
31
|
+
//
|
32
|
+
//
|
33
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Loader
|
34
|
+
//
|
35
|
+
//
|
36
|
+
|
37
|
+
const loader = ({ params }: { params: { version?: string } }) => {
|
38
|
+
const catalog = schemasCatalog!
|
39
|
+
|
40
|
+
// If catalog is versioned and no version is provided in URL, redirect to latest version
|
41
|
+
if (Catalog.Versioned.is(catalog) && !params.version) {
|
42
|
+
const latestVersion = Catalog.getLatestVersion(catalog)
|
43
|
+
const urlVersion = Version.encodeSync(Option.getOrThrow(latestVersion))
|
44
|
+
throw redirect(`/changelog/version/${urlVersion}`)
|
45
|
+
}
|
46
|
+
|
47
|
+
const schemaMaybe = ((): Option.Option<Schema.Schema> => {
|
48
|
+
if (Catalog.Versioned.is(catalog)) {
|
49
|
+
const version = Version.decodeSync(params.version!)
|
50
|
+
const schema = HashMap.get(catalog.entries, version)
|
51
|
+
return schema
|
52
|
+
}
|
53
|
+
return Option.some(catalog.schema)
|
54
|
+
})()
|
55
|
+
|
56
|
+
if (Option.isNone(schemaMaybe)) {
|
57
|
+
throw Http.Response.notFound
|
58
|
+
}
|
59
|
+
|
60
|
+
return Effect.succeed({ catalog, schema: schemaMaybe.value })
|
61
|
+
}
|
62
|
+
|
63
|
+
//
|
64
|
+
//
|
65
|
+
//
|
66
|
+
//
|
67
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Component
|
68
|
+
//
|
69
|
+
//
|
70
|
+
|
71
|
+
const Component = () => {
|
72
|
+
const { catalog, schema } = useLoaderData(LoaderSchema)
|
73
|
+
|
74
|
+
return (
|
75
|
+
<Swiss.Body subgrid>
|
76
|
+
<ChangelogSidebar schema={schema} catalog={catalog} />
|
77
|
+
<Swiss.Item start={5} cols={8}>
|
78
|
+
<ChangelogBody schema={schema} />
|
79
|
+
</Swiss.Item>
|
80
|
+
</Swiss.Body>
|
81
|
+
)
|
82
|
+
}
|
83
|
+
|
84
|
+
//
|
85
|
+
//
|
86
|
+
//
|
87
|
+
//
|
88
|
+
// ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ • Routes
|
89
|
+
//
|
90
|
+
//
|
91
|
+
|
92
|
+
export const changelog = !schemasCatalog
|
93
|
+
? null
|
94
|
+
: Catalog.Versioned.is(schemasCatalog)
|
95
|
+
? route({
|
96
|
+
path: `changelog`,
|
97
|
+
loader,
|
98
|
+
Component,
|
99
|
+
children: [
|
100
|
+
route({
|
101
|
+
path: `version/:version`,
|
102
|
+
schema: LoaderSchema,
|
103
|
+
loader,
|
104
|
+
Component,
|
105
|
+
// children: [
|
106
|
+
// route({
|
107
|
+
// path: `revision/:revision`,
|
108
|
+
// schema: LoaderSchema,
|
109
|
+
// loader,
|
110
|
+
// Component,
|
111
|
+
// }),
|
112
|
+
// ],
|
113
|
+
}),
|
114
|
+
],
|
115
|
+
})
|
116
|
+
: route({
|
117
|
+
path: `changelog`,
|
118
|
+
loader,
|
119
|
+
schema: LoaderSchema,
|
120
|
+
Component,
|
121
|
+
// children: [
|
122
|
+
// route({
|
123
|
+
// path: `revision/:revision`,
|
124
|
+
// schema: LoaderSchema,
|
125
|
+
// loader,
|
126
|
+
// Component,
|
127
|
+
// }),
|
128
|
+
// ],
|
129
|
+
})
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { DateOnly } from '#lib/date-only/$'
|
2
|
+
|
3
|
+
export const renderDate = (dateOnly: DateOnly.DateOnly) => {
|
4
|
+
const date = DateOnly.toDate(dateOnly)
|
5
|
+
const year = date.getUTCFullYear()
|
6
|
+
return `${year} ${
|
7
|
+
date.toLocaleString('default', {
|
8
|
+
month: 'long',
|
9
|
+
day: 'numeric',
|
10
|
+
timeZone: 'UTC',
|
11
|
+
})
|
12
|
+
}`
|
13
|
+
}
|
@@ -4,6 +4,7 @@ import { useLoaderData } from '#lib/react-router-effect/use-loader-data'
|
|
4
4
|
import { Version } from '#lib/version/$'
|
5
5
|
import { Heading } from '@radix-ui/themes'
|
6
6
|
import { Str } from '@wollybeard/kit'
|
7
|
+
import { Array, Option } from 'effect'
|
7
8
|
import { useSearchParams } from 'react-router'
|
8
9
|
import { examplesCatalog } from 'virtual:polen/project/examples'
|
9
10
|
import { schemasCatalog } from 'virtual:polen/project/schemas'
|
@@ -23,10 +24,11 @@ export const nameLoader = async ({ params }: any) => {
|
|
23
24
|
}
|
24
25
|
|
25
26
|
// Check if the example exists
|
26
|
-
const
|
27
|
-
if (
|
27
|
+
const exampleOption = Array.findFirst(examplesCatalog.examples, (e) => e.name === name)
|
28
|
+
if (Option.isNone(exampleOption)) {
|
28
29
|
throw new Response('Not Found', { status: 404 })
|
29
30
|
}
|
31
|
+
const example = exampleOption.value
|
30
32
|
|
31
33
|
return example
|
32
34
|
}
|
@@ -18,7 +18,7 @@ import { Field } from '../components/Field.js'
|
|
18
18
|
import { TypeKindIcon } from '../components/graphql/graphql.js'
|
19
19
|
import { MissingSchema } from '../components/MissingSchema.js'
|
20
20
|
import { NamedType } from '../components/NamedType.js'
|
21
|
-
import {
|
21
|
+
import { ReferenceVersionPicker } from '../components/ReferenceVersionPicker.js'
|
22
22
|
import { GraphqlLifecycleProvider } from '../contexts/GraphqlLifecycleContext.js'
|
23
23
|
import { SidebarLayout } from '../layouts/index.js'
|
24
24
|
|
@@ -160,7 +160,7 @@ const ReferenceView = () => {
|
|
160
160
|
const version = Schema.getVersion(schema)
|
161
161
|
return catalog._tag === 'CatalogVersioned' && version
|
162
162
|
? (
|
163
|
-
<
|
163
|
+
<ReferenceVersionPicker
|
164
164
|
data={Catalog.Versioned.getVersions(catalog)}
|
165
165
|
current={version}
|
166
166
|
/>
|
@@ -20,7 +20,7 @@ import { ThemeProvider, useTheme } from '../contexts/ThemeContext.js'
|
|
20
20
|
import { swissSharpTheme } from '../theme/swiss-sharp.js'
|
21
21
|
import '../theme/swiss-sharp.css'
|
22
22
|
import '../../lib/swiss/styles.css'
|
23
|
-
import { changelog } from './changelog.js'
|
23
|
+
import { changelog } from './changelog/_.js'
|
24
24
|
import { examplesRoute } from './examples/_.js'
|
25
25
|
import { index } from './index.js'
|
26
26
|
import { pages } from './pages.js'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Schema as S } from 'effect'
|
1
|
+
import { Duration, Schema as S } from 'effect'
|
2
2
|
import { proxy } from 'valtio'
|
3
3
|
|
4
4
|
// ============================================================================
|
@@ -68,8 +68,10 @@ export const initialState: State = {
|
|
68
68
|
toasts: [],
|
69
69
|
}
|
70
70
|
|
71
|
+
const DEFAULT_TOAST_DURATION = Duration.seconds(5)
|
72
|
+
|
71
73
|
const toastDefaults = {
|
72
|
-
duration:
|
74
|
+
duration: Duration.toMillis(DEFAULT_TOAST_DURATION),
|
73
75
|
actions: [],
|
74
76
|
} satisfies Partial<Toast>
|
75
77
|
|
@@ -96,7 +98,8 @@ export const store = proxy({
|
|
96
98
|
|
97
99
|
// Auto-remove after duration (default 5 seconds). Set duration to 0 to disable auto-dismiss
|
98
100
|
if (toast.duration !== 0) {
|
99
|
-
|
101
|
+
const durationMs = toast.duration || toastDefaults.duration
|
102
|
+
setTimeout(() => store.remove(id), durationMs)
|
100
103
|
}
|
101
104
|
|
102
105
|
return id
|
@@ -40,18 +40,18 @@ body {
|
|
40
40
|
"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
|
41
41
|
|
42
42
|
/* Font adjustments for impact */
|
43
|
-
|
43
|
+
/*--heading-font-size-adjust: 1.05;
|
44
44
|
--heading-letter-spacing: -0.04em;
|
45
|
-
--heading-line-height: 0.9
|
45
|
+
--heading-line-height: 0.9;*/
|
46
46
|
|
47
47
|
/* Weight system - extreme contrast */
|
48
|
-
|
48
|
+
/*--font-weight-light: 200;
|
49
49
|
--font-weight-regular: 400;
|
50
50
|
--font-weight-medium: 500;
|
51
|
-
--font-weight-bold: 900
|
51
|
+
--font-weight-bold: 900;*/
|
52
52
|
|
53
53
|
/* Letter spacing - tighter for sharpness */
|
54
|
-
|
54
|
+
/*--letter-spacing-1: 0.04em;
|
55
55
|
--letter-spacing-2: 0.02em;
|
56
56
|
--letter-spacing-3: 0em;
|
57
57
|
--letter-spacing-4: -0.01em;
|
@@ -59,16 +59,16 @@ body {
|
|
59
59
|
--letter-spacing-6: -0.025em;
|
60
60
|
--letter-spacing-7: -0.03em;
|
61
61
|
--letter-spacing-8: -0.035em;
|
62
|
-
--letter-spacing-9: -0.04em
|
62
|
+
--letter-spacing-9: -0.04em;*/
|
63
63
|
|
64
64
|
/* ============================================================================
|
65
65
|
* Accent Color - Sharp Blue
|
66
66
|
* ============================================================================ */
|
67
67
|
|
68
68
|
/* Override accent with a sharp blue - works in both light and dark */
|
69
|
-
|
69
|
+
/*--accent-9: #0055ff;
|
70
70
|
--accent-10: #0044dd;
|
71
|
-
--accent-11: #0033bb
|
71
|
+
--accent-11: #0033bb;*/
|
72
72
|
|
73
73
|
/* ============================================================================
|
74
74
|
* Spacing - Using Radix defaults to avoid breaking components
|
@@ -80,32 +80,32 @@ body {
|
|
80
80
|
* Radius - All Sharp (Zero Radius)
|
81
81
|
* ============================================================================ */
|
82
82
|
|
83
|
-
|
83
|
+
/*--radius-1: 0px;
|
84
84
|
--radius-2: 0px;
|
85
85
|
--radius-3: 0px;
|
86
86
|
--radius-4: 0px;
|
87
87
|
--radius-5: 0px;
|
88
88
|
--radius-6: 0px;
|
89
89
|
--radius-full: 0px;
|
90
|
-
--radius-thumb: 0px
|
90
|
+
--radius-thumb: 0px;*/
|
91
91
|
|
92
92
|
/* ============================================================================
|
93
93
|
* Shadows - Minimal & Sharp
|
94
94
|
* ============================================================================ */
|
95
95
|
|
96
96
|
/* Minimal shadows - using semi-transparent blacks for theme compatibility */
|
97
|
-
|
97
|
+
/*--shadow-1: 0 1px 0 0 rgba(0, 0, 0, 0.05);
|
98
98
|
--shadow-2: 0 2px 0 0 rgba(0, 0, 0, 0.1);
|
99
99
|
--shadow-3: 0 4px 0 0 rgba(0, 0, 0, 0.15);
|
100
100
|
--shadow-4: 0 8px 0 0 rgba(0, 0, 0, 0.2);
|
101
101
|
--shadow-5: 0 12px 0 0 rgba(0, 0, 0, 0.25);
|
102
|
-
--shadow-6: 0 16px 0 0 rgba(0, 0, 0, 0.3)
|
102
|
+
--shadow-6: 0 16px 0 0 rgba(0, 0, 0, 0.3);*/
|
103
103
|
|
104
104
|
/* ============================================================================
|
105
105
|
* Cursors - Minimal
|
106
106
|
* ============================================================================ */
|
107
107
|
|
108
|
-
|
108
|
+
/*--cursor-button: pointer;
|
109
109
|
--cursor-checkbox: pointer;
|
110
110
|
--cursor-disabled: not-allowed;
|
111
111
|
--cursor-link: pointer;
|
@@ -113,5 +113,5 @@ body {
|
|
113
113
|
--cursor-radio: pointer;
|
114
114
|
--cursor-slider-thumb: grab;
|
115
115
|
--cursor-slider-thumb-active: grabbing;
|
116
|
-
--cursor-switch: pointer
|
116
|
+
--cursor-switch: pointer;*/
|
117
117
|
}
|
@@ -6,7 +6,6 @@ import { createAssetReader } from '#lib/vite-reactive/reactive-asset-plugin'
|
|
6
6
|
import { ViteVirtual } from '#lib/vite-virtual/$'
|
7
7
|
import { debugPolen } from '#singletons/debug'
|
8
8
|
import { polenVirtual } from '#vite/vi'
|
9
|
-
import { FileSystem } from '@effect/platform'
|
10
9
|
import * as NodeFileSystem from '@effect/platform-node/NodeFileSystem'
|
11
10
|
import { Effect } from 'effect'
|
12
11
|
import * as NodePath from 'node:path'
|
package/build/lib/graph/$$.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/lib/graph/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
package/build/lib/graph/$$.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../src/lib/graph/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
|
package/build/lib/graph/$.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../src/lib/graph/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
|
package/build/lib/graph/$.js
DELETED
package/build/lib/graph/$.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$.js","sourceRoot":"","sources":["../../../src/lib/graph/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
|
@@ -1,127 +0,0 @@
|
|
1
|
-
import { S } from '#lib/kit-temp/effect';
|
2
|
-
/**
|
3
|
-
* Dependency graph for tracking relationships between nodes
|
4
|
-
* Used to efficiently handle dependencies in various contexts
|
5
|
-
*/
|
6
|
-
export declare const DependencyGraph: S.Struct<{
|
7
|
-
/**
|
8
|
-
* Map from parent ID to array of child IDs (parent depends on children)
|
9
|
-
*/
|
10
|
-
dependencies: S.Record$<typeof S.String, S.Array$<typeof S.String>>;
|
11
|
-
/**
|
12
|
-
* Map from child ID to array of parent IDs (child is depended on by parents)
|
13
|
-
*/
|
14
|
-
dependents: S.Record$<typeof S.String, S.Array$<typeof S.String>>;
|
15
|
-
}>;
|
16
|
-
export type DependencyGraph = typeof DependencyGraph.Type;
|
17
|
-
export declare const make: (props: {
|
18
|
-
readonly dependencies: {
|
19
|
-
readonly [x: string]: readonly string[];
|
20
|
-
};
|
21
|
-
readonly dependents: {
|
22
|
-
readonly [x: string]: readonly string[];
|
23
|
-
};
|
24
|
-
}, options?: S.MakeOptions) => {
|
25
|
-
readonly dependencies: {
|
26
|
-
readonly [x: string]: readonly string[];
|
27
|
-
};
|
28
|
-
readonly dependents: {
|
29
|
-
readonly [x: string]: readonly string[];
|
30
|
-
};
|
31
|
-
};
|
32
|
-
/**
|
33
|
-
* Create an empty dependency graph
|
34
|
-
*/
|
35
|
-
export declare const create: () => DependencyGraph;
|
36
|
-
/**
|
37
|
-
* Add a dependency relationship (immutable)
|
38
|
-
* @param graph - The dependency graph
|
39
|
-
* @param parent - The parent node ID
|
40
|
-
* @param child - The child node ID that the parent depends on
|
41
|
-
* @returns A new graph with the dependency added
|
42
|
-
*/
|
43
|
-
export declare const addDependency: (graph: DependencyGraph, parent: string, child: string) => DependencyGraph;
|
44
|
-
/**
|
45
|
-
* Add a dependency relationship (mutable)
|
46
|
-
* @param graph - The dependency graph to mutate
|
47
|
-
* @param parent - The parent node ID
|
48
|
-
* @param child - The child node ID that the parent depends on
|
49
|
-
*/
|
50
|
-
export declare const addDependencyMutable: (graph: DependencyGraph, parent: string, child: string) => void;
|
51
|
-
/**
|
52
|
-
* Find all nodes that have no dependencies (leaf nodes)
|
53
|
-
*/
|
54
|
-
export declare const findLeafNodes: (graph: DependencyGraph) => Set<string>;
|
55
|
-
/**
|
56
|
-
* Check if all dependencies of a node have been processed
|
57
|
-
*/
|
58
|
-
export declare const areDependenciesReady: (node: string, graph: DependencyGraph, processed: Set<string>) => boolean;
|
59
|
-
/**
|
60
|
-
* Get topological ordering of nodes (children before parents)
|
61
|
-
* This ensures we process dependencies before the nodes that depend on them
|
62
|
-
*
|
63
|
-
* @param graph - The dependency graph
|
64
|
-
* @returns Array of node IDs in topological order
|
65
|
-
*/
|
66
|
-
export declare const topologicalSort: (graph: DependencyGraph) => string[];
|
67
|
-
export declare const decode: (i: {
|
68
|
-
readonly dependencies: {
|
69
|
-
readonly [x: string]: readonly string[];
|
70
|
-
};
|
71
|
-
readonly dependents: {
|
72
|
-
readonly [x: string]: readonly string[];
|
73
|
-
};
|
74
|
-
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
|
75
|
-
readonly dependencies: {
|
76
|
-
readonly [x: string]: readonly string[];
|
77
|
-
};
|
78
|
-
readonly dependents: {
|
79
|
-
readonly [x: string]: readonly string[];
|
80
|
-
};
|
81
|
-
}, import("effect/ParseResult").ParseError, never>;
|
82
|
-
export declare const decodeSync: (i: {
|
83
|
-
readonly dependencies: {
|
84
|
-
readonly [x: string]: readonly string[];
|
85
|
-
};
|
86
|
-
readonly dependents: {
|
87
|
-
readonly [x: string]: readonly string[];
|
88
|
-
};
|
89
|
-
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => {
|
90
|
-
readonly dependencies: {
|
91
|
-
readonly [x: string]: readonly string[];
|
92
|
-
};
|
93
|
-
readonly dependents: {
|
94
|
-
readonly [x: string]: readonly string[];
|
95
|
-
};
|
96
|
-
};
|
97
|
-
export declare const encode: (a: {
|
98
|
-
readonly dependencies: {
|
99
|
-
readonly [x: string]: readonly string[];
|
100
|
-
};
|
101
|
-
readonly dependents: {
|
102
|
-
readonly [x: string]: readonly string[];
|
103
|
-
};
|
104
|
-
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => import("effect/Effect").Effect<{
|
105
|
-
readonly dependencies: {
|
106
|
-
readonly [x: string]: readonly string[];
|
107
|
-
};
|
108
|
-
readonly dependents: {
|
109
|
-
readonly [x: string]: readonly string[];
|
110
|
-
};
|
111
|
-
}, import("effect/ParseResult").ParseError, never>;
|
112
|
-
export declare const encodeSync: (a: {
|
113
|
-
readonly dependencies: {
|
114
|
-
readonly [x: string]: readonly string[];
|
115
|
-
};
|
116
|
-
readonly dependents: {
|
117
|
-
readonly [x: string]: readonly string[];
|
118
|
-
};
|
119
|
-
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => {
|
120
|
-
readonly dependencies: {
|
121
|
-
readonly [x: string]: readonly string[];
|
122
|
-
};
|
123
|
-
readonly dependents: {
|
124
|
-
readonly [x: string]: readonly string[];
|
125
|
-
};
|
126
|
-
};
|
127
|
-
//# sourceMappingURL=graph.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/lib/graph/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAIxC;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;;IAGH;;OAEG;;EAKH,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AAIzD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;CAAuB,CAAA;AAExC;;GAEG;AACH,eAAO,MAAM,MAAM,QAAO,eAItB,CAAA;AAIJ;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,eAAe,EACtB,QAAQ,MAAM,EACd,OAAO,MAAM,KACZ,eAqBF,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,eAAe,EACtB,QAAQ,MAAM,EACd,OAAO,MAAM,KACZ,IAsBF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,eAAe,KAAG,GAAG,CAAC,MAAM,CAYhE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAC/B,MAAM,MAAM,EACZ,OAAO,eAAe,EACtB,WAAW,GAAG,CAAC,MAAM,CAAC,KACrB,OAKF,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,eAAe,KAAG,MAAM,EA2C9D,CAAA;AAID,eAAO,MAAM,MAAM;;;;;;;;;;;;;;kDAA4B,CAAA;AAC/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAAgC,CAAA;AACvD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;kDAA4B,CAAA;AAC/C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;CAAgC,CAAA"}
|
package/build/lib/graph/graph.js
DELETED
@@ -1,152 +0,0 @@
|
|
1
|
-
import { S } from '#lib/kit-temp/effect';
|
2
|
-
// ─── Schema ──────────────────────────────────────────────────────────────────
|
3
|
-
/**
|
4
|
-
* Dependency graph for tracking relationships between nodes
|
5
|
-
* Used to efficiently handle dependencies in various contexts
|
6
|
-
*/
|
7
|
-
export const DependencyGraph = S.Struct({
|
8
|
-
/**
|
9
|
-
* Map from parent ID to array of child IDs (parent depends on children)
|
10
|
-
*/
|
11
|
-
dependencies: S.Record({ key: S.String, value: S.Array(S.String) }),
|
12
|
-
/**
|
13
|
-
* Map from child ID to array of parent IDs (child is depended on by parents)
|
14
|
-
*/
|
15
|
-
dependents: S.Record({ key: S.String, value: S.Array(S.String) }),
|
16
|
-
}).annotations({
|
17
|
-
identifier: 'DependencyGraph',
|
18
|
-
description: 'A directed graph tracking dependencies between nodes',
|
19
|
-
});
|
20
|
-
// ─── Constructors ────────────────────────────────────────────────────────────
|
21
|
-
export const make = DependencyGraph.make;
|
22
|
-
/**
|
23
|
-
* Create an empty dependency graph
|
24
|
-
*/
|
25
|
-
export const create = () => make({
|
26
|
-
dependencies: {},
|
27
|
-
dependents: {},
|
28
|
-
});
|
29
|
-
// ─── Domain Logic ────────────────────────────────────────────────────────────
|
30
|
-
/**
|
31
|
-
* Add a dependency relationship (immutable)
|
32
|
-
* @param graph - The dependency graph
|
33
|
-
* @param parent - The parent node ID
|
34
|
-
* @param child - The child node ID that the parent depends on
|
35
|
-
* @returns A new graph with the dependency added
|
36
|
-
*/
|
37
|
-
export const addDependency = (graph, parent, child) => {
|
38
|
-
// Get existing arrays or create empty ones
|
39
|
-
const children = graph.dependencies[parent] || [];
|
40
|
-
const parents = graph.dependents[child] || [];
|
41
|
-
// Add child if not already present
|
42
|
-
const newChildren = children.includes(child) ? children : [...children, child];
|
43
|
-
// Add parent if not already present
|
44
|
-
const newParents = parents.includes(parent) ? parents : [...parents, parent];
|
45
|
-
return make({
|
46
|
-
dependencies: {
|
47
|
-
...graph.dependencies,
|
48
|
-
[parent]: newChildren,
|
49
|
-
},
|
50
|
-
dependents: {
|
51
|
-
...graph.dependents,
|
52
|
-
[child]: newParents,
|
53
|
-
},
|
54
|
-
});
|
55
|
-
};
|
56
|
-
/**
|
57
|
-
* Add a dependency relationship (mutable)
|
58
|
-
* @param graph - The dependency graph to mutate
|
59
|
-
* @param parent - The parent node ID
|
60
|
-
* @param child - The child node ID that the parent depends on
|
61
|
-
*/
|
62
|
-
export const addDependencyMutable = (graph, parent, child) => {
|
63
|
-
// Cast to mutable for mutation
|
64
|
-
const mutableGraph = graph;
|
65
|
-
// Add to dependencies
|
66
|
-
if (!mutableGraph.dependencies[parent]) {
|
67
|
-
mutableGraph.dependencies[parent] = [];
|
68
|
-
}
|
69
|
-
if (!mutableGraph.dependencies[parent].includes(child)) {
|
70
|
-
mutableGraph.dependencies[parent].push(child);
|
71
|
-
}
|
72
|
-
// Add to dependents
|
73
|
-
if (!mutableGraph.dependents[child]) {
|
74
|
-
mutableGraph.dependents[child] = [];
|
75
|
-
}
|
76
|
-
if (!mutableGraph.dependents[child].includes(parent)) {
|
77
|
-
mutableGraph.dependents[child].push(parent);
|
78
|
-
}
|
79
|
-
};
|
80
|
-
/**
|
81
|
-
* Find all nodes that have no dependencies (leaf nodes)
|
82
|
-
*/
|
83
|
-
export const findLeafNodes = (graph) => {
|
84
|
-
const leaves = new Set();
|
85
|
-
// Check all nodes that appear as children
|
86
|
-
for (const child of Object.keys(graph.dependents)) {
|
87
|
-
const deps = graph.dependencies[child];
|
88
|
-
if (!deps || deps.length === 0) {
|
89
|
-
leaves.add(child);
|
90
|
-
}
|
91
|
-
}
|
92
|
-
return leaves;
|
93
|
-
};
|
94
|
-
/**
|
95
|
-
* Check if all dependencies of a node have been processed
|
96
|
-
*/
|
97
|
-
export const areDependenciesReady = (node, graph, processed) => {
|
98
|
-
const deps = graph.dependencies[node];
|
99
|
-
if (!deps)
|
100
|
-
return true;
|
101
|
-
return deps.every(dep => processed.has(dep));
|
102
|
-
};
|
103
|
-
/**
|
104
|
-
* Get topological ordering of nodes (children before parents)
|
105
|
-
* This ensures we process dependencies before the nodes that depend on them
|
106
|
-
*
|
107
|
-
* @param graph - The dependency graph
|
108
|
-
* @returns Array of node IDs in topological order
|
109
|
-
*/
|
110
|
-
export const topologicalSort = (graph) => {
|
111
|
-
const result = [];
|
112
|
-
const visited = new Set();
|
113
|
-
const visiting = new Set(); // For cycle detection
|
114
|
-
// Get all nodes
|
115
|
-
const allNodes = new Set();
|
116
|
-
for (const parent of Object.keys(graph.dependencies)) {
|
117
|
-
allNodes.add(parent);
|
118
|
-
}
|
119
|
-
for (const child of Object.keys(graph.dependents)) {
|
120
|
-
allNodes.add(child);
|
121
|
-
}
|
122
|
-
const visit = (node) => {
|
123
|
-
if (visited.has(node))
|
124
|
-
return;
|
125
|
-
if (visiting.has(node)) {
|
126
|
-
// Cycle detected - just skip this node
|
127
|
-
return;
|
128
|
-
}
|
129
|
-
visiting.add(node);
|
130
|
-
// Visit all children first
|
131
|
-
const children = graph.dependencies[node];
|
132
|
-
if (children) {
|
133
|
-
for (const child of children) {
|
134
|
-
visit(child);
|
135
|
-
}
|
136
|
-
}
|
137
|
-
visiting.delete(node);
|
138
|
-
visited.add(node);
|
139
|
-
result.push(node);
|
140
|
-
};
|
141
|
-
// Visit all nodes
|
142
|
-
for (const node of allNodes) {
|
143
|
-
visit(node);
|
144
|
-
}
|
145
|
-
return result;
|
146
|
-
};
|
147
|
-
// ─── Codec ───────────────────────────────────────────────────────────────────
|
148
|
-
export const decode = S.decode(DependencyGraph);
|
149
|
-
export const decodeSync = S.decodeSync(DependencyGraph);
|
150
|
-
export const encode = S.encode(DependencyGraph);
|
151
|
-
export const encodeSync = S.encodeSync(DependencyGraph);
|
152
|
-
//# sourceMappingURL=graph.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/lib/graph/graph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IAEnE;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CAClE,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,iBAAiB;IAC7B,WAAW,EAAE,sDAAsD;CACpE,CAAC,CAAA;AAIF,gFAAgF;AAEhF,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAoB,EAAE,CAC1C,IAAI,CAAC;IACH,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,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I,CAAC,CAAA;QACjB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnB,CAAC,CAAA;IAED,kBAAkB;IAClB,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AAED,gFAAgF;AAEhF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA"}
|
package/build/lib/mask/$$.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../src/lib/mask/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
package/build/lib/mask/$$.js
DELETED
package/build/lib/mask/$$.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../src/lib/mask/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA"}
|
package/build/lib/mask/$.d.ts
DELETED