every-plugin 2.10.1 → 3.0.0-rc.10
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/bin/every-plugin-serve.mjs +12 -0
- package/bin/every-plugin.mjs +59 -0
- package/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/build/artifact-names.cjs +119 -0
- package/dist/build/artifact-names.cjs.map +1 -0
- package/dist/build/artifact-names.d.cts +68 -0
- package/dist/build/artifact-names.d.cts.map +1 -0
- package/dist/build/artifact-names.d.mts +68 -0
- package/dist/build/artifact-names.d.mts.map +1 -0
- package/dist/build/artifact-names.mjs +102 -0
- package/dist/build/artifact-names.mjs.map +1 -0
- package/dist/build/contract-types.cjs +89 -0
- package/dist/build/contract-types.cjs.map +1 -0
- package/dist/build/contract-types.mjs +81 -0
- package/dist/build/contract-types.mjs.map +1 -0
- package/dist/build/rspack/build-report-plugin.cjs +37 -0
- package/dist/build/rspack/build-report-plugin.cjs.map +1 -0
- package/dist/build/rspack/build-report-plugin.d.cts +18 -0
- package/dist/build/rspack/build-report-plugin.d.cts.map +1 -0
- package/dist/build/rspack/build-report-plugin.d.mts +18 -0
- package/dist/build/rspack/build-report-plugin.d.mts.map +1 -0
- package/dist/build/rspack/build-report-plugin.mjs +37 -0
- package/dist/build/rspack/build-report-plugin.mjs.map +1 -0
- package/dist/build/rspack/chunk-completeness-plugin.cjs +59 -0
- package/dist/build/rspack/chunk-completeness-plugin.cjs.map +1 -0
- package/dist/build/rspack/chunk-completeness-plugin.mjs +59 -0
- package/dist/build/rspack/chunk-completeness-plugin.mjs.map +1 -0
- package/dist/build/rspack/compose.cjs +69 -0
- package/dist/build/rspack/compose.cjs.map +1 -0
- package/dist/build/rspack/compose.d.cts +20 -0
- package/dist/build/rspack/compose.d.cts.map +1 -0
- package/dist/build/rspack/compose.d.mts +20 -0
- package/dist/build/rspack/compose.d.mts.map +1 -0
- package/dist/build/rspack/compose.mjs +65 -0
- package/dist/build/rspack/compose.mjs.map +1 -0
- package/dist/build/rspack/fix-mf-data-uri-plugin.cjs +11 -11
- package/dist/build/rspack/fix-mf-data-uri-plugin.cjs.map +1 -1
- package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts +2 -0
- package/dist/build/rspack/fix-mf-data-uri-plugin.d.cts.map +1 -1
- package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts +2 -0
- package/dist/build/rspack/fix-mf-data-uri-plugin.d.mts.map +1 -1
- package/dist/build/rspack/fix-mf-data-uri-plugin.mjs +11 -10
- package/dist/build/rspack/fix-mf-data-uri-plugin.mjs.map +1 -1
- package/dist/build/rspack/generated-config.cjs +35 -0
- package/dist/build/rspack/generated-config.cjs.map +1 -0
- package/dist/build/rspack/generated-config.mjs +32 -0
- package/dist/build/rspack/generated-config.mjs.map +1 -0
- package/dist/build/rspack/index.cjs +8 -5
- package/dist/build/rspack/index.d.cts +5 -3
- package/dist/build/rspack/index.d.mts +5 -3
- package/dist/build/rspack/index.mjs +5 -3
- package/dist/build/rspack/module-federation.cjs +2 -2
- package/dist/build/rspack/module-federation.cjs.map +1 -1
- package/dist/build/rspack/module-federation.mjs +1 -1
- package/dist/build/rspack/module-federation.mjs.map +1 -1
- package/dist/build/rspack/plugin.cjs +44 -69
- package/dist/build/rspack/plugin.cjs.map +1 -1
- package/dist/build/rspack/plugin.d.cts +4 -13
- package/dist/build/rspack/plugin.d.cts.map +1 -1
- package/dist/build/rspack/plugin.d.mts +4 -13
- package/dist/build/rspack/plugin.d.mts.map +1 -1
- package/dist/build/rspack/plugin.mjs +44 -69
- package/dist/build/rspack/plugin.mjs.map +1 -1
- package/dist/build/rspack/utils.cjs +7 -5
- package/dist/build/rspack/utils.cjs.map +1 -1
- package/dist/build/rspack/utils.mjs +7 -6
- package/dist/build/rspack/utils.mjs.map +1 -1
- package/dist/build/ui/factory.cjs +88 -0
- package/dist/build/ui/factory.cjs.map +1 -0
- package/dist/build/ui/factory.d.cts +11 -0
- package/dist/build/ui/factory.d.cts.map +1 -0
- package/dist/build/ui/factory.d.mts +11 -0
- package/dist/build/ui/factory.d.mts.map +1 -0
- package/dist/build/ui/factory.mjs +80 -0
- package/dist/build/ui/factory.mjs.map +1 -0
- package/dist/build/ui/generated-config.cjs +122 -0
- package/dist/build/ui/generated-config.cjs.map +1 -0
- package/dist/build/ui/generated-config.d.cts +33 -0
- package/dist/build/ui/generated-config.d.cts.map +1 -0
- package/dist/build/ui/generated-config.d.mts +33 -0
- package/dist/build/ui/generated-config.d.mts.map +1 -0
- package/dist/build/ui/generated-config.mjs +114 -0
- package/dist/build/ui/generated-config.mjs.map +1 -0
- package/dist/build/ui/hash-artifacts-plugin.cjs +61 -0
- package/dist/build/ui/hash-artifacts-plugin.cjs.map +1 -0
- package/dist/build/ui/hash-artifacts-plugin.d.cts +20 -0
- package/dist/build/ui/hash-artifacts-plugin.d.cts.map +1 -0
- package/dist/build/ui/hash-artifacts-plugin.d.mts +20 -0
- package/dist/build/ui/hash-artifacts-plugin.d.mts.map +1 -0
- package/dist/build/ui/hash-artifacts-plugin.mjs +58 -0
- package/dist/build/ui/hash-artifacts-plugin.mjs.map +1 -0
- package/dist/build/ui/index.cjs +90 -0
- package/dist/build/ui/index.cjs.map +1 -0
- package/dist/build/ui/index.d.cts +29 -0
- package/dist/build/ui/index.d.cts.map +1 -0
- package/dist/build/ui/index.d.mts +29 -0
- package/dist/build/ui/index.d.mts.map +1 -0
- package/dist/build/ui/index.mjs +68 -0
- package/dist/build/ui/index.mjs.map +1 -0
- package/dist/build/ui/manifest-plugin.cjs +37 -0
- package/dist/build/ui/manifest-plugin.cjs.map +1 -0
- package/dist/build/ui/manifest-plugin.d.cts +19 -0
- package/dist/build/ui/manifest-plugin.d.cts.map +1 -0
- package/dist/build/ui/manifest-plugin.d.mts +19 -0
- package/dist/build/ui/manifest-plugin.d.mts.map +1 -0
- package/dist/build/ui/manifest-plugin.mjs +37 -0
- package/dist/build/ui/manifest-plugin.mjs.map +1 -0
- package/dist/build/ui/rsbuild-config.cjs +203 -0
- package/dist/build/ui/rsbuild-config.cjs.map +1 -0
- package/dist/build/ui/rsbuild-config.d.cts +45 -0
- package/dist/build/ui/rsbuild-config.d.cts.map +1 -0
- package/dist/build/ui/rsbuild-config.d.mts +45 -0
- package/dist/build/ui/rsbuild-config.d.mts.map +1 -0
- package/dist/build/ui/rsbuild-config.mjs +200 -0
- package/dist/build/ui/rsbuild-config.mjs.map +1 -0
- package/dist/build/ui/stubs.cjs +107 -0
- package/dist/build/ui/stubs.cjs.map +1 -0
- package/dist/build/ui/stubs.d.cts +25 -0
- package/dist/build/ui/stubs.d.cts.map +1 -0
- package/dist/build/ui/stubs.d.mts +25 -0
- package/dist/build/ui/stubs.d.mts.map +1 -0
- package/dist/build/ui/stubs.mjs +106 -0
- package/dist/build/ui/stubs.mjs.map +1 -0
- package/dist/cli.cjs +83 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +6 -0
- package/dist/cli.d.cts.map +1 -0
- package/dist/cli.d.mts +6 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +82 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/client.cjs +69 -0
- package/dist/client.cjs.map +1 -0
- package/dist/client.d.cts +15 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.mts +15 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +68 -0
- package/dist/client.mjs.map +1 -0
- package/dist/dev/host.cjs +149 -0
- package/dist/dev/host.cjs.map +1 -0
- package/dist/dev/host.d.cts +32 -0
- package/dist/dev/host.d.cts.map +1 -0
- package/dist/dev/host.d.mts +32 -0
- package/dist/dev/host.d.mts.map +1 -0
- package/dist/dev/host.mjs +148 -0
- package/dist/dev/host.mjs.map +1 -0
- package/dist/dev/serve.cjs +295 -0
- package/dist/dev/serve.cjs.map +1 -0
- package/dist/dev/serve.d.cts +23 -0
- package/dist/dev/serve.d.cts.map +1 -0
- package/dist/dev/serve.d.mts +23 -0
- package/dist/dev/serve.d.mts.map +1 -0
- package/dist/dev/serve.mjs +289 -0
- package/dist/dev/serve.mjs.map +1 -0
- package/dist/dev/watch-kill.cjs +39 -0
- package/dist/dev/watch-kill.cjs.map +1 -0
- package/dist/dev/watch-kill.mjs +38 -0
- package/dist/dev/watch-kill.mjs.map +1 -0
- package/dist/effect-helpers.cjs +23 -0
- package/dist/effect-helpers.cjs.map +1 -0
- package/dist/effect-helpers.d.cts +20 -0
- package/dist/effect-helpers.d.cts.map +1 -0
- package/dist/effect-helpers.d.mts +20 -0
- package/dist/effect-helpers.d.mts.map +1 -0
- package/dist/effect-helpers.mjs +22 -0
- package/dist/effect-helpers.mjs.map +1 -0
- package/dist/errors.cjs +50 -69
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +13 -96
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.mts +13 -96
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +16 -34
- package/dist/errors.mjs.map +1 -1
- package/dist/identity.cjs +19 -0
- package/dist/identity.cjs.map +1 -0
- package/dist/identity.d.cts +33 -0
- package/dist/identity.d.cts.map +1 -0
- package/dist/identity.d.mts +33 -0
- package/dist/identity.d.mts.map +1 -0
- package/dist/identity.mjs +16 -0
- package/dist/identity.mjs.map +1 -0
- package/dist/index.cjs +11 -5
- package/dist/index.d.cts +9 -6
- package/dist/index.d.mts +9 -6
- package/dist/index.mjs +7 -4
- package/dist/plugin.cjs +13 -26
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +64 -25
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +64 -25
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +16 -29
- package/dist/plugin.mjs.map +1 -1
- package/dist/remote-entry.cjs +102 -0
- package/dist/remote-entry.cjs.map +1 -0
- package/dist/remote-entry.d.cts +52 -0
- package/dist/remote-entry.d.cts.map +1 -0
- package/dist/remote-entry.d.mts +52 -0
- package/dist/remote-entry.d.mts.map +1 -0
- package/dist/remote-entry.mjs +98 -0
- package/dist/remote-entry.mjs.map +1 -0
- package/dist/runtime/errors.cjs +159 -33
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts +64 -7
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts +64 -7
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs +154 -30
- package/dist/runtime/errors.mjs.map +1 -1
- package/dist/runtime/index.cjs +95 -23
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.cts +16 -0
- package/dist/runtime/index.d.cts.map +1 -1
- package/dist/runtime/index.d.mts +16 -0
- package/dist/runtime/index.d.mts.map +1 -1
- package/dist/runtime/index.mjs +98 -26
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/mf-config.cjs +3 -78
- package/dist/runtime/mf-config.cjs.map +1 -1
- package/dist/runtime/mf-config.d.cts +3 -49
- package/dist/runtime/mf-config.d.cts.map +1 -1
- package/dist/runtime/mf-config.d.mts +3 -49
- package/dist/runtime/mf-config.d.mts.map +1 -1
- package/dist/runtime/mf-config.mjs +5 -78
- package/dist/runtime/mf-config.mjs.map +1 -1
- package/dist/runtime/services/module-federation.service.cjs +57 -12
- package/dist/runtime/services/module-federation.service.cjs.map +1 -1
- package/dist/runtime/services/module-federation.service.d.cts +4 -13
- package/dist/runtime/services/module-federation.service.d.mts +4 -13
- package/dist/runtime/services/module-federation.service.mjs +57 -14
- package/dist/runtime/services/module-federation.service.mjs.map +1 -1
- package/dist/runtime/services/normalize.cjs +2 -22
- package/dist/runtime/services/normalize.d.cts +2 -21
- package/dist/runtime/services/normalize.d.mts +2 -21
- package/dist/runtime/services/normalize.mjs +2 -21
- package/dist/runtime/services/plugin-lifecycle.service.cjs +9 -11
- package/dist/runtime/services/plugin-lifecycle.service.cjs.map +1 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.cts +3 -16
- package/dist/runtime/services/plugin-lifecycle.service.d.mts +3 -16
- package/dist/runtime/services/plugin-lifecycle.service.mjs +10 -13
- package/dist/runtime/services/plugin-lifecycle.service.mjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.cjs +59 -30
- package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.d.cts +6 -53
- package/dist/runtime/services/plugin-loader.service.d.mts +6 -53
- package/dist/runtime/services/plugin-loader.service.mjs +58 -31
- package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
- package/dist/runtime/services/plugin.service.cjs +10 -12
- package/dist/runtime/services/plugin.service.cjs.map +1 -1
- package/dist/runtime/services/plugin.service.d.cts +14 -36
- package/dist/runtime/services/plugin.service.d.cts.map +1 -1
- package/dist/runtime/services/plugin.service.d.mts +14 -36
- package/dist/runtime/services/plugin.service.d.mts.map +1 -1
- package/dist/runtime/services/plugin.service.mjs +14 -18
- package/dist/runtime/services/plugin.service.mjs.map +1 -1
- package/dist/runtime/services/secrets.service.cjs +12 -12
- package/dist/runtime/services/secrets.service.cjs.map +1 -1
- package/dist/runtime/services/secrets.service.d.cts +3 -15
- package/dist/runtime/services/secrets.service.d.mts +3 -15
- package/dist/runtime/services/secrets.service.mjs +12 -13
- package/dist/runtime/services/secrets.service.mjs.map +1 -1
- package/dist/runtime/services/shared-identity.cjs +40 -0
- package/dist/runtime/services/shared-identity.cjs.map +1 -0
- package/dist/runtime/services/shared-identity.mjs +38 -0
- package/dist/runtime/services/shared-identity.mjs.map +1 -0
- package/dist/runtime/validation.cjs +2 -2
- package/dist/runtime/validation.cjs.map +1 -1
- package/dist/runtime/validation.mjs +2 -2
- package/dist/runtime/validation.mjs.map +1 -1
- package/dist/shared-deps-spec.cjs +384 -0
- package/dist/shared-deps-spec.cjs.map +1 -0
- package/dist/shared-deps-spec.d.cts +182 -0
- package/dist/shared-deps-spec.d.cts.map +1 -0
- package/dist/shared-deps-spec.d.mts +182 -0
- package/dist/shared-deps-spec.d.mts.map +1 -0
- package/dist/shared-deps-spec.mjs +368 -0
- package/dist/shared-deps-spec.mjs.map +1 -0
- package/dist/types.d.cts +47 -41
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +47 -41
- package/dist/types.d.mts.map +1 -1
- package/dist/ui/manifest/construct.cjs +319 -0
- package/dist/ui/manifest/construct.cjs.map +1 -0
- package/dist/ui/manifest/construct.d.cts +48 -0
- package/dist/ui/manifest/construct.d.cts.map +1 -0
- package/dist/ui/manifest/construct.d.mts +48 -0
- package/dist/ui/manifest/construct.d.mts.map +1 -0
- package/dist/ui/manifest/construct.mjs +319 -0
- package/dist/ui/manifest/construct.mjs.map +1 -0
- package/dist/ui/manifest/contract.cjs +34 -0
- package/dist/ui/manifest/contract.cjs.map +1 -0
- package/dist/ui/manifest/contract.d.cts +26 -0
- package/dist/ui/manifest/contract.d.cts.map +1 -0
- package/dist/ui/manifest/contract.d.mts +26 -0
- package/dist/ui/manifest/contract.d.mts.map +1 -0
- package/dist/ui/manifest/contract.mjs +26 -0
- package/dist/ui/manifest/contract.mjs.map +1 -0
- package/dist/ui/manifest/descriptor.cjs +64 -0
- package/dist/ui/manifest/descriptor.cjs.map +1 -0
- package/dist/ui/manifest/descriptor.d.cts +60 -0
- package/dist/ui/manifest/descriptor.d.cts.map +1 -0
- package/dist/ui/manifest/descriptor.d.mts +60 -0
- package/dist/ui/manifest/descriptor.d.mts.map +1 -0
- package/dist/ui/manifest/descriptor.mjs +61 -0
- package/dist/ui/manifest/descriptor.mjs.map +1 -0
- package/dist/ui/manifest/generator.cjs +128 -0
- package/dist/ui/manifest/generator.cjs.map +1 -0
- package/dist/ui/manifest/generator.d.cts +41 -0
- package/dist/ui/manifest/generator.d.cts.map +1 -0
- package/dist/ui/manifest/generator.d.mts +41 -0
- package/dist/ui/manifest/generator.d.mts.map +1 -0
- package/dist/ui/manifest/generator.mjs +125 -0
- package/dist/ui/manifest/generator.mjs.map +1 -0
- package/dist/ui/manifest/index.cjs +35 -0
- package/dist/ui/manifest/index.d.cts +9 -0
- package/dist/ui/manifest/index.d.mts +9 -0
- package/dist/ui/manifest/index.mjs +9 -0
- package/dist/ui/manifest/manifest-schema.cjs +97 -0
- package/dist/ui/manifest/manifest-schema.cjs.map +1 -0
- package/dist/ui/manifest/manifest-schema.d.cts +132 -0
- package/dist/ui/manifest/manifest-schema.d.cts.map +1 -0
- package/dist/ui/manifest/manifest-schema.d.mts +132 -0
- package/dist/ui/manifest/manifest-schema.d.mts.map +1 -0
- package/dist/ui/manifest/manifest-schema.mjs +90 -0
- package/dist/ui/manifest/manifest-schema.mjs.map +1 -0
- package/dist/ui/manifest/mount-registry.cjs +52 -0
- package/dist/ui/manifest/mount-registry.cjs.map +1 -0
- package/dist/ui/manifest/mount-registry.d.cts +61 -0
- package/dist/ui/manifest/mount-registry.d.cts.map +1 -0
- package/dist/ui/manifest/mount-registry.d.mts +61 -0
- package/dist/ui/manifest/mount-registry.d.mts.map +1 -0
- package/dist/ui/manifest/mount-registry.mjs +48 -0
- package/dist/ui/manifest/mount-registry.mjs.map +1 -0
- package/dist/ui/manifest/nav.cjs +13 -0
- package/dist/ui/manifest/nav.cjs.map +1 -0
- package/dist/ui/manifest/nav.d.cts +34 -0
- package/dist/ui/manifest/nav.d.cts.map +1 -0
- package/dist/ui/manifest/nav.d.mts +34 -0
- package/dist/ui/manifest/nav.d.mts.map +1 -0
- package/dist/ui/manifest/nav.mjs +13 -0
- package/dist/ui/manifest/nav.mjs.map +1 -0
- package/dist/ui/manifest/route-config.cjs +33 -0
- package/dist/ui/manifest/route-config.cjs.map +1 -0
- package/dist/ui/manifest/route-config.d.cts +40 -0
- package/dist/ui/manifest/route-config.d.cts.map +1 -0
- package/dist/ui/manifest/route-config.d.mts +40 -0
- package/dist/ui/manifest/route-config.d.mts.map +1 -0
- package/dist/ui/manifest/route-config.mjs +33 -0
- package/dist/ui/manifest/route-config.mjs.map +1 -0
- package/dist/version-manifest.cjs +77 -0
- package/dist/version-manifest.cjs.map +1 -0
- package/dist/version-manifest.d.cts +62 -0
- package/dist/version-manifest.d.cts.map +1 -0
- package/dist/version-manifest.d.mts +62 -0
- package/dist/version-manifest.d.mts.map +1 -0
- package/dist/version-manifest.mjs +75 -0
- package/dist/version-manifest.mjs.map +1 -0
- package/package.json +182 -68
- package/skills/plugin-client/SKILL.md +34 -9
- package/skills/plugin-development/SKILL.md +79 -47
- package/skills/plugin-testing/SKILL.md +42 -12
- package/src/build/artifact-names.ts +117 -0
- package/src/build/contract-types.ts +101 -0
- package/src/build/rspack/build-report-plugin.ts +34 -0
- package/src/build/rspack/chunk-completeness-plugin.ts +66 -0
- package/src/build/rspack/compose.ts +87 -0
- package/src/build/rspack/fix-mf-data-uri-plugin.ts +23 -12
- package/src/build/rspack/generated-config.ts +35 -0
- package/src/build/rspack/index.ts +10 -5
- package/src/build/rspack/module-federation.ts +1 -1
- package/src/build/rspack/plugin.ts +103 -105
- package/src/build/rspack/utils.ts +8 -2
- package/src/build/ui/factory.ts +96 -0
- package/src/build/ui/generated-config.ts +137 -0
- package/src/build/ui/hash-artifacts-plugin.ts +79 -0
- package/src/build/ui/index.ts +98 -0
- package/src/build/ui/manifest-plugin.ts +54 -0
- package/src/build/ui/rsbuild-config.ts +256 -0
- package/src/build/ui/stubs.ts +103 -0
- package/src/cli.ts +100 -0
- package/src/client.ts +111 -0
- package/src/dev/host.ts +235 -0
- package/src/dev/serve.ts +359 -0
- package/src/dev/watch-kill.ts +58 -0
- package/src/effect-helpers.ts +25 -0
- package/src/errors.ts +17 -18
- package/src/identity.ts +36 -0
- package/src/index.ts +13 -0
- package/src/plugin.ts +94 -91
- package/src/remote-entry.ts +170 -0
- package/src/runtime/errors.ts +229 -26
- package/src/runtime/index.ts +132 -43
- package/src/runtime/mf-config.ts +12 -107
- package/src/runtime/services/module-federation.service.ts +218 -117
- package/src/runtime/services/normalize.ts +1 -18
- package/src/runtime/services/plugin-lifecycle.service.ts +66 -75
- package/src/runtime/services/plugin-loader.service.ts +280 -209
- package/src/runtime/services/plugin.service.ts +61 -43
- package/src/runtime/services/secrets.service.ts +20 -15
- package/src/runtime/services/shared-identity.ts +68 -0
- package/src/runtime/validation.ts +5 -7
- package/src/shared-deps-spec.ts +478 -0
- package/src/types.ts +62 -50
- package/src/ui/manifest/construct.ts +456 -0
- package/src/ui/manifest/contract.ts +33 -0
- package/src/ui/manifest/descriptor.ts +96 -0
- package/src/ui/manifest/generator.ts +238 -0
- package/src/ui/manifest/index.ts +55 -0
- package/src/ui/manifest/manifest-schema.ts +107 -0
- package/src/ui/manifest/mount-registry.ts +50 -0
- package/src/ui/manifest/nav.ts +43 -0
- package/src/ui/manifest/route-config.ts +82 -0
- package/src/version-manifest.ts +106 -0
- package/dist/build/rspack/dev-server-middleware.cjs +0 -248
- package/dist/build/rspack/dev-server-middleware.cjs.map +0 -1
- package/dist/build/rspack/dev-server-middleware.mjs +0 -247
- package/dist/build/rspack/dev-server-middleware.mjs.map +0 -1
- package/dist/build/shared-deps.cjs +0 -83
- package/dist/build/shared-deps.cjs.map +0 -1
- package/dist/build/shared-deps.d.cts +0 -67
- package/dist/build/shared-deps.d.cts.map +0 -1
- package/dist/build/shared-deps.d.mts +0 -67
- package/dist/build/shared-deps.d.mts.map +0 -1
- package/dist/build/shared-deps.mjs +0 -79
- package/dist/build/shared-deps.mjs.map +0 -1
- package/dist/effect.cjs +0 -9
- package/dist/effect.d.cts +0 -1
- package/dist/effect.d.mts +0 -1
- package/dist/effect.mjs +0 -3
- package/dist/orpc-openapi.cjs +0 -17
- package/dist/orpc-openapi.d.cts +0 -2
- package/dist/orpc-openapi.d.mts +0 -2
- package/dist/orpc-openapi.mjs +0 -5
- package/dist/orpc.cjs +0 -46
- package/dist/orpc.d.cts +0 -7
- package/dist/orpc.d.mts +0 -7
- package/dist/orpc.mjs +0 -11
- package/dist/package.cjs +0 -23
- package/dist/package.cjs.map +0 -1
- package/dist/package.mjs +0 -17
- package/dist/package.mjs.map +0 -1
- package/dist/runtime/services/module-federation.service.d.cts.map +0 -1
- package/dist/runtime/services/module-federation.service.d.mts.map +0 -1
- package/dist/runtime/services/normalize.cjs.map +0 -1
- package/dist/runtime/services/normalize.d.cts.map +0 -1
- package/dist/runtime/services/normalize.d.mts.map +0 -1
- package/dist/runtime/services/normalize.mjs.map +0 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.cts.map +0 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.mts.map +0 -1
- package/dist/runtime/services/plugin-loader.service.d.cts.map +0 -1
- package/dist/runtime/services/plugin-loader.service.d.mts.map +0 -1
- package/dist/runtime/services/secrets.service.d.cts.map +0 -1
- package/dist/runtime/services/secrets.service.d.mts.map +0 -1
- package/dist/testing/index.cjs +0 -57
- package/dist/testing/index.cjs.map +0 -1
- package/dist/testing/index.d.cts +0 -54
- package/dist/testing/index.d.cts.map +0 -1
- package/dist/testing/index.d.mts +0 -54
- package/dist/testing/index.d.mts.map +0 -1
- package/dist/testing/index.mjs +0 -55
- package/dist/testing/index.mjs.map +0 -1
- package/dist/zod-core.cjs +0 -9
- package/dist/zod-core.d.cts +0 -1
- package/dist/zod-core.d.mts +0 -1
- package/dist/zod-core.mjs +0 -3
- package/dist/zod.cjs +0 -11
- package/dist/zod.d.cts +0 -2
- package/dist/zod.d.mts +0 -2
- package/dist/zod.mjs +0 -3
- package/src/build/rspack/dev-server-middleware.ts +0 -324
- package/src/build/shared-deps.ts +0 -102
- package/src/effect.ts +0 -1
- package/src/orpc-openapi.ts +0 -2
- package/src/orpc.ts +0 -9
- package/src/testing/index.ts +0 -87
- package/src/testing/mocks/module-federation.service.ts +0 -41
- package/src/zod-core.ts +0 -1
- package/src/zod.ts +0 -3
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { PluginWarningInfo } from "./runtime/errors.mjs";
|
|
1
2
|
import { Plugin } from "./plugin.mjs";
|
|
3
|
+
import { Context, Scope } from "effect";
|
|
4
|
+
import { ContractedRouter, RouterClient } from "@orpc/server";
|
|
2
5
|
import { AnyContractRouter, AnySchema, InferSchemaInput, InferSchemaOutput } from "@orpc/contract";
|
|
3
|
-
import { Scope } from "effect";
|
|
4
|
-
import { Router, RouterClient } from "@orpc/server";
|
|
5
6
|
//#region src/types.d.ts
|
|
6
7
|
/**
|
|
7
8
|
* Registry bindings interface - populated via module augmentation
|
|
@@ -16,10 +17,22 @@ import { Router, RouterClient } from "@orpc/server";
|
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
19
|
interface RegisteredPlugins {}
|
|
20
|
+
type ModuleTransport = "inproc" | "rpc" | "mf";
|
|
21
|
+
type ModuleSurface = "api" | "ui" | "jobs";
|
|
22
|
+
interface ModuleEndpoint {
|
|
23
|
+
readonly transport: ModuleTransport;
|
|
24
|
+
readonly surface?: ModuleSurface;
|
|
25
|
+
readonly url: string;
|
|
26
|
+
readonly path?: `/${string}`;
|
|
27
|
+
readonly manifest?: string;
|
|
28
|
+
}
|
|
29
|
+
type PluginTransport = ModuleTransport;
|
|
30
|
+
type PluginSurface = ModuleSurface;
|
|
31
|
+
type PluginEndpoint = ModuleEndpoint;
|
|
19
32
|
/**
|
|
20
33
|
* Base type for any plugin instance.
|
|
21
34
|
*/
|
|
22
|
-
type AnyPlugin = Plugin<AnyContractRouter, AnySchema, AnySchema, AnySchema | undefined
|
|
35
|
+
type AnyPlugin = Plugin<AnyContractRouter, AnySchema, AnySchema, AnySchema | undefined>;
|
|
23
36
|
/**
|
|
24
37
|
* Loaded plugin constructor with binding information
|
|
25
38
|
*/
|
|
@@ -38,10 +51,12 @@ type AnyPluginConstructor = {
|
|
|
38
51
|
type PluginRegistryEntry = {
|
|
39
52
|
module: AnyPluginConstructor;
|
|
40
53
|
remote?: string;
|
|
54
|
+
endpoint?: PluginEndpoint;
|
|
41
55
|
version?: string;
|
|
42
56
|
description?: string;
|
|
43
57
|
} | {
|
|
44
58
|
remote: string;
|
|
59
|
+
endpoint?: PluginEndpoint;
|
|
45
60
|
version?: string;
|
|
46
61
|
description?: string;
|
|
47
62
|
};
|
|
@@ -93,11 +108,27 @@ type PluginContext<T> = T extends {
|
|
|
93
108
|
* Extract router type from plugin binding
|
|
94
109
|
* Uses 'any' for context to support nested router compositions
|
|
95
110
|
*/
|
|
96
|
-
type PluginRouterType<T> =
|
|
111
|
+
type PluginRouterType<T> = ContractedRouter<PluginContract<T>, any>;
|
|
97
112
|
/**
|
|
98
113
|
* Extract client type from plugin binding
|
|
99
114
|
*/
|
|
100
115
|
type PluginClientType<T> = RouterClient<PluginRouterType<T>>;
|
|
116
|
+
/**
|
|
117
|
+
* Sibling plugin entry passed to `initialize` and `createRouter`.
|
|
118
|
+
* `client` creates a typed in-process client for the plugin's router;
|
|
119
|
+
* `router` is the raw implemented router for cross-plugin merging.
|
|
120
|
+
*/
|
|
121
|
+
type PluginServicesEntry<T = any> = {
|
|
122
|
+
client: (context?: PluginContextInput<T>) => PluginClientType<T>;
|
|
123
|
+
router: PluginRouterType<T>;
|
|
124
|
+
endpoint?: PluginEndpoint;
|
|
125
|
+
};
|
|
126
|
+
type ModuleClientEntry<C extends AnyContractRouter = AnyContractRouter> = {
|
|
127
|
+
client: (context?: Record<string, unknown>) => RouterClient<ContractedRouter<C, any>>;
|
|
128
|
+
router?: ContractedRouter<C, any>;
|
|
129
|
+
endpoint?: PluginEndpoint;
|
|
130
|
+
};
|
|
131
|
+
type PluginClientEntry<C extends AnyContractRouter = AnyContractRouter> = ModuleClientEntry<C>;
|
|
101
132
|
/**
|
|
102
133
|
* Extract plugin type from registered plugins by key
|
|
103
134
|
* @param K - The plugin key
|
|
@@ -110,11 +141,7 @@ type RegisteredPlugin<K extends keyof R, R = RegisteredPlugins> = R[K] extends {
|
|
|
110
141
|
variables: infer V extends AnySchema;
|
|
111
142
|
secrets: infer S extends AnySchema;
|
|
112
143
|
context: infer TRequestContext extends AnySchema | undefined;
|
|
113
|
-
} ? Plugin<C, V, S, TRequestContext
|
|
114
|
-
/**
|
|
115
|
-
* Extract plugin constructor type from registry entry
|
|
116
|
-
*/
|
|
117
|
-
type PluginConstructor<K extends keyof R, R = RegisteredPlugins> = RegisteredPlugin<K, R>;
|
|
144
|
+
} ? Plugin<C, V, S, TRequestContext> : never : never;
|
|
118
145
|
/**
|
|
119
146
|
* Extract context input type from plugin binding (for client creation)
|
|
120
147
|
*/
|
|
@@ -126,10 +153,6 @@ type PluginConfigInput<T> = {
|
|
|
126
153
|
variables: InferSchemaInput<PluginVariables<T>>;
|
|
127
154
|
secrets: InferSchemaInput<PluginSecrets<T>>;
|
|
128
155
|
};
|
|
129
|
-
/**
|
|
130
|
-
* Extract deps context type from plugin instance (used for initialization)
|
|
131
|
-
*/
|
|
132
|
-
type ContextOf<T extends AnyPlugin> = T extends Plugin<AnyContractRouter, AnySchema, AnySchema, AnySchema | undefined, infer TDeps> ? TDeps : never;
|
|
133
156
|
/**
|
|
134
157
|
* Plugin metadata for remote loading
|
|
135
158
|
*/
|
|
@@ -142,10 +165,6 @@ type PluginMetadata = {
|
|
|
142
165
|
* Runtime registry configuration supporting both module and remote entries
|
|
143
166
|
*/
|
|
144
167
|
type PluginRegistry = Record<string, PluginRegistryEntry>;
|
|
145
|
-
/**
|
|
146
|
-
* Legacy metadata-only registry (for backwards compatibility)
|
|
147
|
-
*/
|
|
148
|
-
type PluginMetadataRegistry = Record<string, PluginMetadata>;
|
|
149
168
|
/**
|
|
150
169
|
* Configuration for secrets injection.
|
|
151
170
|
* Secrets are hydrated into plugin configs using template replacement.
|
|
@@ -174,11 +193,19 @@ interface InitializedPlugin<T extends AnyPlugin = AnyPlugin> {
|
|
|
174
193
|
readonly plugin: T;
|
|
175
194
|
readonly metadata: PluginMetadata;
|
|
176
195
|
readonly config: {
|
|
196
|
+
pluginId: string;
|
|
177
197
|
variables: InferSchemaOutput<T["configSchema"]["variables"]>;
|
|
178
198
|
secrets: InferSchemaOutput<T["configSchema"]["secrets"]>;
|
|
179
199
|
};
|
|
180
|
-
|
|
181
|
-
|
|
200
|
+
/**
|
|
201
|
+
* Built Effect context from the plugin's initialize Layer. Provided to
|
|
202
|
+
* handlers as `effect/context` — `.effect()` handlers `yield* Tag`,
|
|
203
|
+
* plain handlers use `Context.get(context["effect/context"], Tag)`.
|
|
204
|
+
*/
|
|
205
|
+
readonly effectContext: Context.Context<any>;
|
|
206
|
+
readonly scope: Scope.Closeable;
|
|
207
|
+
/** Non-fatal config warnings collected during initialization (empty when none). */
|
|
208
|
+
readonly warnings: PluginWarningInfo[];
|
|
182
209
|
}
|
|
183
210
|
/**
|
|
184
211
|
* Helper type to detect type errors when looking up RegisteredPlugins
|
|
@@ -202,17 +229,6 @@ type UsePluginResult<K extends keyof R, R = RegisteredPlugins> = VerifyPluginBin
|
|
|
202
229
|
readonly metadata: PluginMetadata;
|
|
203
230
|
readonly initialized: InitializedPlugin<RegisteredPlugin<K, R>>;
|
|
204
231
|
} : VerifyPluginBinding<K, R>;
|
|
205
|
-
/**
|
|
206
|
-
* Runtime options
|
|
207
|
-
*/
|
|
208
|
-
interface RuntimeOptions {
|
|
209
|
-
isolation?: "strict" | "shared" | "none";
|
|
210
|
-
memoryLimit?: string;
|
|
211
|
-
concurrency?: number;
|
|
212
|
-
resourceTimeout?: string;
|
|
213
|
-
debug?: boolean;
|
|
214
|
-
metrics?: boolean;
|
|
215
|
-
}
|
|
216
232
|
/**
|
|
217
233
|
* Extract registry type from runtime instance or use type directly
|
|
218
234
|
* This allows EveryPlugin.Infer to work with both:
|
|
@@ -251,17 +267,7 @@ declare namespace EveryPlugin {
|
|
|
251
267
|
interface PluginRuntimeConfig<R extends Record<string, PluginRegistryEntry> = Record<string, PluginRegistryEntry>> {
|
|
252
268
|
registry: R;
|
|
253
269
|
secrets?: SecretsConfig;
|
|
254
|
-
options?: RuntimeOptions;
|
|
255
|
-
}
|
|
256
|
-
/**
|
|
257
|
-
* Legacy plugin runtime configuration (metadata-only registry)
|
|
258
|
-
* @deprecated Use PluginRuntimeConfig with module/remote entries instead
|
|
259
|
-
*/
|
|
260
|
-
interface LegacyPluginRuntimeConfig {
|
|
261
|
-
registry: PluginMetadataRegistry;
|
|
262
|
-
secrets?: SecretsConfig;
|
|
263
|
-
options?: RuntimeOptions;
|
|
264
270
|
}
|
|
265
271
|
//#endregion
|
|
266
|
-
export { AnyPlugin, AnyPluginConstructor,
|
|
272
|
+
export { AnyPlugin, AnyPluginConstructor, EveryPlugin, ExtractPluginType, InferRegistryFromEntries, InitializedPlugin, LoadedPlugin, ModuleClientEntry, ModuleEndpoint, ModuleSurface, ModuleTransport, PluginClientEntry, PluginClientType, PluginConfigInput, PluginContext, PluginContextInput, PluginContract, PluginEndpoint, PluginInstance, PluginMetadata, PluginRegistry, PluginRegistryEntry, PluginRouterType, PluginRuntimeConfig, PluginSecrets, PluginServicesEntry, PluginSurface, PluginTransport, PluginVariables, RegisteredPlugin, RegisteredPlugins, SecretsConfig, UsePluginResult };
|
|
267
273
|
//# sourceMappingURL=types.d.mts.map
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAwBiB;KAEL;KAEA;UAEK;WACN,WAAW;WACX,UAAU;WACV;WACA;WACA;;KAGC,kBAAkB;KAElB,gBAAgB;KAEhB,iBAAiB;;;;KAKjB,YAAY,OAAO,mBAAmB,WAAW,WAAW;;;;KAK5D;UACF;EACR;IACE,UAAU;IACV,WAAW;IACX,SAAS;IACT,SAAS;;;;;;KAOD;EAEN,QAAQ;EACR;EACA,WAAW;EACX;EACA;;EAEA;EAAgB,WAAW;EAAgB;EAAkB;;;;;KAKvD,kBAAkB,KAAK;EAAY,cAAc;IAAM;;;;KAKvD,yBAAyB,UAAU,eAAe,2BAC3D,WAAW,IAAI,EAAE;EAAa,cAAc;IACzC,IACA,gBAAgB,oBACd,kBAAkB;;;;KAOd,eAAe,KAAK;EAC9B;I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,IAAI,qBAAqB,EAAE;EACrE,eAAe;IAEb;EACE,UAAU;EACV,WAAW;EACX,SAAS;EACT,SAAS;wBAGI,4IACF;;;;;;KAOL,gBAAgB,gBAAgB,GAAG,IAAI,qBACjD,oBAAoB,GAAG;WAER,eAAe,UAAU,mBAAmB,EAAE,QAAQ,iBAAiB,EAAE;WACzE,QAAQ,iBAAiB,EAAE;WAC3B,UAAU;WACV,aAAa,kBAAkB,iBAAiB,GAAG;IAE9D,oBAAoB,GAAG;;;;;;;KAQxB,WAAW,KAAK;EAAY,uBAAuB;IAAM,IAAI;;;;kBAKjD;;;;;;;;;;;;;;;;;;OAkBH,MACV,kBACA,SAAS,qBACP,gBAAgB,WAAW,UAAU,gBAAgB,GAAG,WAAW;;;;;UAMxD,oBACf,UAAU,eAAe,uBAAuB,eAAe;EAE/D,UAAU;EACV,UAAU"}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
const require_ui_manifest_contract = require('./contract.cjs');
|
|
2
|
+
const require_mount_registry = require('./mount-registry.cjs');
|
|
3
|
+
const require_descriptor = require('./descriptor.cjs');
|
|
4
|
+
const require_nav = require('./nav.cjs');
|
|
5
|
+
const require_route_config = require('./route-config.cjs');
|
|
6
|
+
let _tanstack_react_router = require("@tanstack/react-router");
|
|
7
|
+
|
|
8
|
+
//#region src/ui/manifest/construct.ts
|
|
9
|
+
/**
|
|
10
|
+
* Host-side route-graph construction (ADR 0008 §1): manifests + route
|
|
11
|
+
* configs in → host-built tree out. The host constructs ITS OWN Route
|
|
12
|
+
* objects from validated manifest data via public `createRoute` APIs; no
|
|
13
|
+
* foreign route object is ever mutated. Gates are attached HOST-side from
|
|
14
|
+
* the mount registry — plugins cannot ship a route that escapes its
|
|
15
|
+
* mount's gate because plugins never construct route objects.
|
|
16
|
+
*
|
|
17
|
+
* Mounts are the ONLY cross-source parenting points: a root-level
|
|
18
|
+
* pathless layout file (`_public.tsx`) declares the mount for the whole
|
|
19
|
+
* composition (exactly one declaring source per mount); every other
|
|
20
|
+
* source's routes live under the same `_mount/` directory prefix and
|
|
21
|
+
* parent onto the shared mount route. This module executes inside the
|
|
22
|
+
* core ui's module graph (production MF expose `./compose`, dev source
|
|
23
|
+
* import) so constructed routes are minted by the same react/router
|
|
24
|
+
* instance that renders them.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* TanStack's Route generics are intentionally invariant — routes built from
|
|
28
|
+
* manifest data can't satisfy them structurally. One named boundary for
|
|
29
|
+
* handing a constructed route to the tree-building APIs.
|
|
30
|
+
*/
|
|
31
|
+
function toAnyRoute(route) {
|
|
32
|
+
return route;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gate redirects are absolute: gates attach to root-level mount routes, and
|
|
36
|
+
* relatives would silently shift if a mount ever moved deeper in the tree.
|
|
37
|
+
* The login surface is plugin-owned, never core-known.
|
|
38
|
+
*/
|
|
39
|
+
const LOGIN_TO = "/login";
|
|
40
|
+
const HOME_TO = "/";
|
|
41
|
+
/**
|
|
42
|
+
* Gate implementations by mount gate kind. Only `session` and `admin` are
|
|
43
|
+
* implemented (ADR 0008 §3); unimplemented mounts are rejected during mount
|
|
44
|
+
* declaration before any gate lookup, and gates are optional by type — a
|
|
45
|
+
* mount without an entry (or `none`) renders ungated.
|
|
46
|
+
*/
|
|
47
|
+
const GATES = {
|
|
48
|
+
session: ({ context, location }) => {
|
|
49
|
+
if (!userOf(context)) throw (0, _tanstack_react_router.redirect)({
|
|
50
|
+
to: LOGIN_TO,
|
|
51
|
+
search: { redirect: location.pathname + location.searchStr }
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
admin: ({ context }) => {
|
|
55
|
+
const user = userOf(context);
|
|
56
|
+
if (!user) throw (0, _tanstack_react_router.redirect)({ to: LOGIN_TO });
|
|
57
|
+
if (user.role !== "admin") throw (0, _tanstack_react_router.redirect)({ to: HOME_TO });
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const userOf = (context) => context?.user ?? context?.session?.user;
|
|
61
|
+
function joinPath(a, b) {
|
|
62
|
+
const left = a && a !== "/" ? a.replace(/\/+$/, "") : "";
|
|
63
|
+
const right = b && b !== "/" ? b.replace(/^\/+/, "") : "";
|
|
64
|
+
if (!left) return right ? `/${right}` : "/";
|
|
65
|
+
if (!right) return left;
|
|
66
|
+
return `${left}/${right}`;
|
|
67
|
+
}
|
|
68
|
+
const navOf = (options) => {
|
|
69
|
+
const nav = options.staticData?.nav;
|
|
70
|
+
if (nav && typeof nav === "object" && typeof nav.label === "string") return nav;
|
|
71
|
+
};
|
|
72
|
+
/** Layout routes (mount or pathless) pass their authored options through,
|
|
73
|
+
* like every other route kind. On mount routes the registry gate composes
|
|
74
|
+
* BEFORE the declaration's own beforeLoad so a source can never escape its
|
|
75
|
+
* mount's gate (ADR 0008 §3), while the declaration's return value still
|
|
76
|
+
* flows to children as route context. */
|
|
77
|
+
function layoutBeforeLoad(gate, declared) {
|
|
78
|
+
if (!gate) return declared;
|
|
79
|
+
return (args) => {
|
|
80
|
+
gate(args);
|
|
81
|
+
return declared?.(args);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const AUTHORED_OPTION_KEYS = require_route_config.ROUTE_OPTION_KEYS.filter((key) => key !== "beforeLoad" && key !== "component");
|
|
85
|
+
function authoredOptions(options) {
|
|
86
|
+
const authored = {};
|
|
87
|
+
for (const key of AUTHORED_OPTION_KEYS) if (options[key] !== void 0) authored[key] = options[key];
|
|
88
|
+
return authored;
|
|
89
|
+
}
|
|
90
|
+
function rootAuthoredOptions(options) {
|
|
91
|
+
const { params: _params, ...authored } = authoredOptions(options);
|
|
92
|
+
return authored;
|
|
93
|
+
}
|
|
94
|
+
async function constructTree(input) {
|
|
95
|
+
const refs = [...input.plugins].sort((a, b) => a.key.localeCompare(b.key));
|
|
96
|
+
const resolved = [];
|
|
97
|
+
for (const ref of refs) resolved.push(await input.resolve(ref));
|
|
98
|
+
const ordered = [...resolved.filter((plugin) => plugin.key === "ui"), ...resolved.filter((plugin) => plugin.key !== "ui")];
|
|
99
|
+
const optionsByPlugin = /* @__PURE__ */ new Map();
|
|
100
|
+
const skippedByPlugin = /* @__PURE__ */ new Map();
|
|
101
|
+
for (const plugin of resolved) {
|
|
102
|
+
if (!plugin.manifest?.routes) continue;
|
|
103
|
+
const optionsById = /* @__PURE__ */ new Map();
|
|
104
|
+
const skipped = /* @__PURE__ */ new Set();
|
|
105
|
+
await Promise.all(plugin.manifest.routes.map(async (record) => {
|
|
106
|
+
const loader = plugin.routeConfig.routeConfigLoaders[record.id];
|
|
107
|
+
if (!loader) {
|
|
108
|
+
console.log(`[Compose] skipping route "${record.id}" in "${plugin.key}" — no routeConfig loader`);
|
|
109
|
+
skipped.add(record.id);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
optionsById.set(record.id, await loader());
|
|
113
|
+
}));
|
|
114
|
+
let changed = true;
|
|
115
|
+
while (changed) {
|
|
116
|
+
changed = false;
|
|
117
|
+
for (const record of plugin.manifest.routes) {
|
|
118
|
+
if (skipped.has(record.id)) continue;
|
|
119
|
+
if (record.parentId && skipped.has(record.parentId)) {
|
|
120
|
+
skipped.add(record.id);
|
|
121
|
+
changed = true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
optionsByPlugin.set(plugin.key, optionsById);
|
|
126
|
+
skippedByPlugin.set(plugin.key, skipped);
|
|
127
|
+
}
|
|
128
|
+
const declarations = /* @__PURE__ */ new Map();
|
|
129
|
+
const mountByLayoutId = /* @__PURE__ */ new Map();
|
|
130
|
+
for (const plugin of ordered) {
|
|
131
|
+
if (!plugin.manifest?.routes) continue;
|
|
132
|
+
for (const record of plugin.manifest.routes) {
|
|
133
|
+
if (!record.mount) continue;
|
|
134
|
+
const mountId = record.mount;
|
|
135
|
+
if (!require_mount_registry.MOUNT_REGISTRY[mountId].implemented) throw new Error(`mount "${record.mount}" is declared vocabulary but unimplemented (ADR 0008 §3) — declared by "${plugin.key}"`);
|
|
136
|
+
const existing = declarations.get(mountId);
|
|
137
|
+
if (existing) {
|
|
138
|
+
if (existing.key === "ui" && plugin.key !== "ui") {
|
|
139
|
+
console.log(`[Compose] mount declaration "${existing.key}:${existing.record.id}" (${mountId}) shadows "${plugin.key}:${record.id}" — core ui wins; shadowed declaration skipped`);
|
|
140
|
+
mountByLayoutId.set(record.id, mountId);
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
throw new Error(`mount "${mountId}" declared by multiple sources: "${existing.key}" (${existing.record.file}) and "${plugin.key}" (${record.file})`);
|
|
144
|
+
}
|
|
145
|
+
if (skippedByPlugin.get(plugin.key).has(record.id)) continue;
|
|
146
|
+
declarations.set(mountId, {
|
|
147
|
+
key: plugin.key,
|
|
148
|
+
record,
|
|
149
|
+
options: optionsByPlugin.get(plugin.key).get(record.id)
|
|
150
|
+
});
|
|
151
|
+
mountByLayoutId.set(record.id, mountId);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const rootRoute = toAnyRoute((0, _tanstack_react_router.createRootRoute)({
|
|
155
|
+
...input.rootOptions ? rootAuthoredOptions(input.rootOptions) : {},
|
|
156
|
+
component: input.rootOptions?.component ?? _tanstack_react_router.Outlet,
|
|
157
|
+
...input.rootOptions?.beforeLoad ? { beforeLoad: input.rootOptions.beforeLoad } : {}
|
|
158
|
+
}));
|
|
159
|
+
const mountRoutes = /* @__PURE__ */ new Map();
|
|
160
|
+
for (const mountId of Object.keys(require_mount_registry.MOUNT_REGISTRY)) {
|
|
161
|
+
const declaration = declarations.get(mountId);
|
|
162
|
+
if (!declaration) continue;
|
|
163
|
+
const def = require_mount_registry.MOUNT_REGISTRY[mountId];
|
|
164
|
+
const gate = GATES[def.gate];
|
|
165
|
+
const options = declaration.options;
|
|
166
|
+
const route = (0, _tanstack_react_router.createRoute)({
|
|
167
|
+
id: `__mount_${mountId}`,
|
|
168
|
+
getParentRoute: () => rootRoute,
|
|
169
|
+
...gate || options.beforeLoad ? { beforeLoad: layoutBeforeLoad(gate, options.beforeLoad) } : {},
|
|
170
|
+
...authoredOptions(options),
|
|
171
|
+
component: options.component ?? _tanstack_react_router.Outlet
|
|
172
|
+
});
|
|
173
|
+
mountRoutes.set(mountId, toAnyRoute(route));
|
|
174
|
+
}
|
|
175
|
+
const nav = [];
|
|
176
|
+
const mountCounts = {};
|
|
177
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
178
|
+
/** cross-plugin path-collision guard: claimed paths per parent route */
|
|
179
|
+
const claimedPathsByParent = /* @__PURE__ */ new Map();
|
|
180
|
+
const attach = (parent, child) => {
|
|
181
|
+
const list = childrenByParent.get(parent) ?? [];
|
|
182
|
+
list.push(child);
|
|
183
|
+
childrenByParent.set(parent, list);
|
|
184
|
+
};
|
|
185
|
+
for (const plugin of ordered) {
|
|
186
|
+
if (!plugin.manifest?.routes) continue;
|
|
187
|
+
const optionsById = optionsByPlugin.get(plugin.key);
|
|
188
|
+
const fullPathById = /* @__PURE__ */ new Map();
|
|
189
|
+
const mountById = /* @__PURE__ */ new Map();
|
|
190
|
+
const byId = /* @__PURE__ */ new Map();
|
|
191
|
+
const parentFor = (record) => {
|
|
192
|
+
if (record.parentId) {
|
|
193
|
+
const local = byId.get(record.parentId);
|
|
194
|
+
if (local) return {
|
|
195
|
+
route: local.route,
|
|
196
|
+
fullPath: fullPathById.get(record.parentId),
|
|
197
|
+
mount: mountById.get(record.parentId)
|
|
198
|
+
};
|
|
199
|
+
const mount = mountByLayoutId.get(record.parentId);
|
|
200
|
+
if (mount) return {
|
|
201
|
+
route: mountRoutes.get(mount),
|
|
202
|
+
fullPath: "",
|
|
203
|
+
mount
|
|
204
|
+
};
|
|
205
|
+
throw new Error(`unresolvable parent "${record.parentId}" for "${record.id}" in "${plugin.key}" — mounts are the only cross-source parenting points`);
|
|
206
|
+
}
|
|
207
|
+
const firstSegment = record.id.split("/")[0] ?? "";
|
|
208
|
+
if (firstSegment.startsWith("_")) {
|
|
209
|
+
const mount = require_mount_registry.resolveMountSegment(firstSegment.slice(1));
|
|
210
|
+
if (mount && mountRoutes.has(mount)) return {
|
|
211
|
+
route: mountRoutes.get(mount),
|
|
212
|
+
fullPath: "",
|
|
213
|
+
mount
|
|
214
|
+
};
|
|
215
|
+
if (mount) throw new Error(`mount "${mount}" is not declared by any source (route "${record.id}" in "${plugin.key}")`);
|
|
216
|
+
throw new Error(`unknown mount "_${firstSegment.slice(1)}" (route "${record.id}" in "${plugin.key}")`);
|
|
217
|
+
}
|
|
218
|
+
throw new Error(`route "${record.id}" in "${plugin.key}" must live under a mount`);
|
|
219
|
+
};
|
|
220
|
+
const pending = plugin.manifest.routes.filter((record) => !record.mount && !skippedByPlugin.get(plugin.key).has(record.id));
|
|
221
|
+
const shadowedIds = /* @__PURE__ */ new Set();
|
|
222
|
+
let progressed = true;
|
|
223
|
+
while (pending.length > 0 && progressed) {
|
|
224
|
+
progressed = false;
|
|
225
|
+
for (let i = 0; i < pending.length; i += 1) {
|
|
226
|
+
const record = pending[i];
|
|
227
|
+
const parentId = record.parentId;
|
|
228
|
+
if (parentId) {
|
|
229
|
+
if (shadowedIds.has(parentId)) {
|
|
230
|
+
shadowedIds.add(record.id);
|
|
231
|
+
pending.splice(i, 1);
|
|
232
|
+
i -= 1;
|
|
233
|
+
progressed = true;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
if (!byId.has(parentId) && !mountByLayoutId.has(parentId)) continue;
|
|
237
|
+
}
|
|
238
|
+
pending.splice(i, 1);
|
|
239
|
+
progressed = true;
|
|
240
|
+
const options = optionsById.get(record.id);
|
|
241
|
+
const parent = parentFor(record);
|
|
242
|
+
const routePath = record.path;
|
|
243
|
+
const isLayoutRoute = record.type === "layout" || routePath === void 0;
|
|
244
|
+
if (!isLayoutRoute) {
|
|
245
|
+
const siblings = claimedPathsByParent.get(parent.route) ?? /* @__PURE__ */ new Map();
|
|
246
|
+
const claimant = siblings.get(routePath);
|
|
247
|
+
if (claimant) {
|
|
248
|
+
if (plugin.key !== "ui" && claimant.startsWith(`${"ui"}:`)) {
|
|
249
|
+
console.log(`[Compose] route claim "${claimant}" (${routePath}) shadows "${plugin.key}:${record.id}" — core ui wins; shadowed route skipped`);
|
|
250
|
+
shadowedIds.add(record.id);
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
throw new Error(`path collision: "${plugin.key}" route "${record.id}" declares "${routePath}" which is already claimed by "${claimant}" under the same parent`);
|
|
254
|
+
}
|
|
255
|
+
siblings.set(routePath, `${plugin.key}:${record.id}`);
|
|
256
|
+
claimedPathsByParent.set(parent.route, siblings);
|
|
257
|
+
}
|
|
258
|
+
const fullPath = joinPath(parent.fullPath, routePath);
|
|
259
|
+
let route;
|
|
260
|
+
if (isLayoutRoute) route = (0, _tanstack_react_router.createRoute)({
|
|
261
|
+
id: `${plugin.key}__${record.id}`,
|
|
262
|
+
getParentRoute: () => parent.route,
|
|
263
|
+
...authoredOptions(options),
|
|
264
|
+
...options.beforeLoad ? { beforeLoad: options.beforeLoad } : {},
|
|
265
|
+
component: options.component ?? _tanstack_react_router.Outlet
|
|
266
|
+
});
|
|
267
|
+
else route = (0, _tanstack_react_router.createRoute)({
|
|
268
|
+
path: routePath,
|
|
269
|
+
getParentRoute: () => parent.route,
|
|
270
|
+
...authoredOptions(options),
|
|
271
|
+
...options.beforeLoad ? { beforeLoad: options.beforeLoad } : {},
|
|
272
|
+
component: options.component ?? _tanstack_react_router.Outlet
|
|
273
|
+
});
|
|
274
|
+
byId.set(record.id, {
|
|
275
|
+
record,
|
|
276
|
+
route: toAnyRoute(route)
|
|
277
|
+
});
|
|
278
|
+
fullPathById.set(record.id, fullPath);
|
|
279
|
+
mountById.set(record.id, parent.mount);
|
|
280
|
+
attach(parent.route, toAnyRoute(route));
|
|
281
|
+
mountCounts[parent.mount] = (mountCounts[parent.mount] ?? 0) + 1;
|
|
282
|
+
const navDeclaration = navOf(options);
|
|
283
|
+
if (navDeclaration && navDeclaration.hidden !== true) nav.push({
|
|
284
|
+
id: `${plugin.key}:${record.id}`,
|
|
285
|
+
label: navDeclaration.label,
|
|
286
|
+
...typeof navDeclaration.icon === "string" ? { icon: navDeclaration.icon } : {},
|
|
287
|
+
...typeof navDeclaration.group === "string" ? { group: navDeclaration.group } : {},
|
|
288
|
+
...typeof navDeclaration.order === "number" ? { order: navDeclaration.order } : {},
|
|
289
|
+
to: navDeclaration.to ?? fullPath,
|
|
290
|
+
plugin: plugin.key,
|
|
291
|
+
mount: parent.mount
|
|
292
|
+
});
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (pending.length > 0) throw new Error(`unresolvable parentage in "${plugin.key}": ${pending.map((record) => record.id).join(", ")}`);
|
|
297
|
+
}
|
|
298
|
+
for (const [parent, children] of childrenByParent) parent.addChildren(children);
|
|
299
|
+
rootRoute.addChildren([...mountRoutes.values()]);
|
|
300
|
+
nav.sort(require_nav.compareNavItems);
|
|
301
|
+
return {
|
|
302
|
+
rootRoute,
|
|
303
|
+
routeTree: rootRoute,
|
|
304
|
+
digest: await require_descriptor.digestOf({
|
|
305
|
+
plugins: refs.map((ref) => ({
|
|
306
|
+
key: ref.key,
|
|
307
|
+
mfName: ref.mfName
|
|
308
|
+
})),
|
|
309
|
+
manifests: resolved.map((plugin) => plugin.manifest)
|
|
310
|
+
}),
|
|
311
|
+
manifests: resolved.map((plugin) => plugin.manifest),
|
|
312
|
+
nav: { items: nav },
|
|
313
|
+
mountCounts
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
//#endregion
|
|
318
|
+
exports.constructTree = constructTree;
|
|
319
|
+
//# sourceMappingURL=construct.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct.cjs","names":["redirect","ROUTE_OPTION_KEYS","MOUNT_REGISTRY","createRootRoute","Outlet","createRoute","resolveMountSegment","compareNavItems","digestOf"],"sources":["../../../src/ui/manifest/construct.ts"],"sourcesContent":["import type { AnyRoute } from \"@tanstack/react-router\";\nimport { createRootRoute, createRoute, Outlet, redirect } from \"@tanstack/react-router\";\nimport { CORE_UI_PLUGIN_KEY } from \"./contract\";\nimport { digestOf } from \"./descriptor\";\nimport type { PluginManifest, RouteRecord } from \"./manifest-schema\";\nimport { MOUNT_REGISTRY, type MountDef, type MountId, resolveMountSegment } from \"./mount-registry\";\nimport { compareNavItems, type NavDeclaration, type NavItem, type NavManifest } from \"./nav\";\nimport { ROUTE_OPTION_KEYS, type RouteConfigModule, type RouteOptionsBundle } from \"./route-config\";\n\n/**\n * Host-side route-graph construction (ADR 0008 §1): manifests + route\n * configs in → host-built tree out. The host constructs ITS OWN Route\n * objects from validated manifest data via public `createRoute` APIs; no\n * foreign route object is ever mutated. Gates are attached HOST-side from\n * the mount registry — plugins cannot ship a route that escapes its\n * mount's gate because plugins never construct route objects.\n *\n * Mounts are the ONLY cross-source parenting points: a root-level\n * pathless layout file (`_public.tsx`) declares the mount for the whole\n * composition (exactly one declaring source per mount); every other\n * source's routes live under the same `_mount/` directory prefix and\n * parent onto the shared mount route. This module executes inside the\n * core ui's module graph (production MF expose `./compose`, dev source\n * import) so constructed routes are minted by the same react/router\n * instance that renders them.\n */\n\n/**\n * TanStack's Route generics are intentionally invariant — routes built from\n * manifest data can't satisfy them structurally. One named boundary for\n * handing a constructed route to the tree-building APIs.\n */\nfunction toAnyRoute(route: unknown): AnyRoute {\n return route as AnyRoute;\n}\n\nexport interface GateUser {\n id: string;\n name?: string;\n /** Better Auth user role — \"admin\" gates the admin mount. */\n role?: string;\n}\n\nexport interface HostContext {\n user?: GateUser;\n session?: { user?: GateUser };\n}\n\ntype GateFn = (args: {\n context: HostContext;\n location: { pathname: string; searchStr: string };\n}) => void;\n\n/**\n * Gate redirects are absolute: gates attach to root-level mount routes, and\n * relatives would silently shift if a mount ever moved deeper in the tree.\n * The login surface is plugin-owned, never core-known.\n */\nconst LOGIN_TO: string = \"/login\";\nconst HOME_TO: string = \"/\";\n\n/**\n * Gate implementations by mount gate kind. Only `session` and `admin` are\n * implemented (ADR 0008 §3); unimplemented mounts are rejected during mount\n * declaration before any gate lookup, and gates are optional by type — a\n * mount without an entry (or `none`) renders ungated.\n */\nconst GATES: Partial<Record<MountDef[\"gate\"], GateFn>> = {\n session: ({ context, location }) => {\n const user = userOf(context);\n if (!user) {\n throw redirect({\n to: LOGIN_TO,\n search: { redirect: location.pathname + location.searchStr } as never,\n });\n }\n },\n admin: ({ context }) => {\n const user = userOf(context);\n if (!user) throw redirect({ to: LOGIN_TO });\n if (user.role !== \"admin\") throw redirect({ to: HOME_TO });\n },\n};\n\nconst userOf = (context: HostContext | undefined): GateUser | undefined =>\n context?.user ?? context?.session?.user;\n\nexport interface ConstructPluginRef {\n /** composition identity — plugin key; participates in the digest */\n key: string;\n /** deployment identity — the MF container name loadRemote targets */\n mfName: string;\n}\n\nexport interface ResolvedPlugin {\n key: string;\n manifest: PluginManifest;\n routeConfig: RouteConfigModule;\n}\n\nexport interface ConstructInput {\n name: string;\n plugins: ReadonlyArray<ConstructPluginRef>;\n resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;\n /** core ui `__root` options — component/error/notFound + head baseline */\n rootOptions?: RouteOptionsBundle;\n}\n\nexport interface ConstructedTree {\n rootRoute: AnyRoute;\n routeTree: AnyRoute;\n digest: string;\n manifests: PluginManifest[];\n nav: NavManifest;\n /** constructed route count per mount id */\n mountCounts: Record<string, number>;\n}\n\ninterface MountDeclaration {\n key: string;\n record: RouteRecord;\n options: RouteOptionsBundle;\n}\n\nfunction joinPath(a: string | undefined, b: string | undefined): string {\n const left = a && a !== \"/\" ? a.replace(/\\/+$/, \"\") : \"\";\n const right = b && b !== \"/\" ? b.replace(/^\\/+/, \"\") : \"\";\n if (!left) return right ? `/${right}` : \"/\";\n if (!right) return left;\n return `${left}/${right}`;\n}\n\nconst navOf = (options: RouteOptionsBundle): NavDeclaration | undefined => {\n const nav = options.staticData?.nav;\n if (nav && typeof nav === \"object\" && typeof (nav as NavDeclaration).label === \"string\") {\n return nav as NavDeclaration;\n }\n return undefined;\n};\n\n/** Layout routes (mount or pathless) pass their authored options through,\n * like every other route kind. On mount routes the registry gate composes\n * BEFORE the declaration's own beforeLoad so a source can never escape its\n * mount's gate (ADR 0008 §3), while the declaration's return value still\n * flows to children as route context. */\nfunction layoutBeforeLoad(\n gate: GateFn | undefined,\n declared: RouteOptionsBundle[\"beforeLoad\"],\n): RouteOptionsBundle[\"beforeLoad\"] {\n if (!gate) return declared;\n return (args) => {\n gate(args);\n return declared?.(args);\n };\n}\n\nconst AUTHORED_OPTION_KEYS = ROUTE_OPTION_KEYS.filter(\n (key) => key !== \"beforeLoad\" && key !== \"component\",\n);\n\nfunction authoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const authored: Partial<Record<keyof RouteOptionsBundle, unknown>> = {};\n for (const key of AUTHORED_OPTION_KEYS) {\n if (options[key] !== undefined) authored[key] = options[key];\n }\n return authored as Partial<RouteOptionsBundle>;\n}\n\nfunction rootAuthoredOptions(options: RouteOptionsBundle): Partial<RouteOptionsBundle> {\n const { params: _params, ...authored } = authoredOptions(options);\n return authored;\n}\n\nexport async function constructTree(input: ConstructInput): Promise<ConstructedTree> {\n const refs = [...input.plugins].sort((a, b) => a.key.localeCompare(b.key));\n const resolved: ResolvedPlugin[] = [];\n for (const ref of refs) {\n resolved.push(await input.resolve(ref));\n }\n\n const ordered = [\n ...resolved.filter((plugin) => plugin.key === CORE_UI_PLUGIN_KEY),\n ...resolved.filter((plugin) => plugin.key !== CORE_UI_PLUGIN_KEY),\n ];\n\n const optionsByPlugin = new Map<string, Map<string, RouteOptionsBundle>>();\n const skippedByPlugin = new Map<string, Set<string>>();\n for (const plugin of resolved) {\n // A plugin with no manifest at all contributes no routes — skip it rather\n // than crashing SSR composition (same contract as the missing-loader skip\n // below).\n if (!plugin.manifest?.routes) continue;\n const optionsById = new Map<string, RouteOptionsBundle>();\n const skipped = new Set<string>();\n await Promise.all(\n plugin.manifest.routes.map(async (record) => {\n const loader = plugin.routeConfig.routeConfigLoaders[record.id];\n if (!loader) {\n console.log(\n `[Compose] skipping route \"${record.id}\" in \"${plugin.key}\" — no routeConfig loader`,\n );\n skipped.add(record.id);\n return;\n }\n optionsById.set(record.id, await loader());\n }),\n );\n // cascade: any route whose parent is skipped is also skipped\n let changed = true;\n while (changed) {\n changed = false;\n for (const record of plugin.manifest.routes) {\n if (skipped.has(record.id)) continue;\n if (record.parentId && skipped.has(record.parentId)) {\n skipped.add(record.id);\n changed = true;\n }\n }\n }\n optionsByPlugin.set(plugin.key, optionsById);\n skippedByPlugin.set(plugin.key, skipped);\n }\n\n const declarations = new Map<MountId, MountDeclaration>();\n const mountByLayoutId = new Map<string, MountId>();\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n for (const record of plugin.manifest.routes) {\n if (!record.mount) continue;\n const mountId = record.mount as MountId;\n const def = MOUNT_REGISTRY[mountId];\n if (!def.implemented) {\n throw new Error(\n `mount \"${record.mount}\" is declared vocabulary but unimplemented (ADR 0008 §3) — declared by \"${plugin.key}\"`,\n );\n }\n const existing = declarations.get(mountId);\n if (existing) {\n if (existing.key === CORE_UI_PLUGIN_KEY && plugin.key !== CORE_UI_PLUGIN_KEY) {\n console.log(\n `[Compose] mount declaration \"${existing.key}:${existing.record.id}\" (${mountId}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed declaration skipped`,\n );\n mountByLayoutId.set(record.id, mountId);\n continue;\n }\n throw new Error(\n `mount \"${mountId}\" declared by multiple sources: \"${existing.key}\" (${existing.record.file}) and \"${plugin.key}\" (${record.file})`,\n );\n }\n if (skippedByPlugin.get(plugin.key)!.has(record.id)) continue;\n declarations.set(mountId, {\n key: plugin.key,\n record,\n options: optionsByPlugin.get(plugin.key)!.get(record.id)!,\n });\n mountByLayoutId.set(record.id, mountId);\n }\n }\n\n const rootRoute = toAnyRoute(\n createRootRoute({\n ...(input.rootOptions ? rootAuthoredOptions(input.rootOptions) : {}),\n component: input.rootOptions?.component ?? Outlet,\n ...(input.rootOptions?.beforeLoad ? { beforeLoad: input.rootOptions.beforeLoad } : {}),\n }),\n );\n\n const mountRoutes = new Map<MountId, AnyRoute>();\n for (const mountId of Object.keys(MOUNT_REGISTRY) as MountId[]) {\n const declaration = declarations.get(mountId);\n if (!declaration) continue;\n const def = MOUNT_REGISTRY[mountId]!;\n const gate = GATES[def.gate];\n const options = declaration.options;\n const route = createRoute({\n id: `__mount_${mountId}`,\n getParentRoute: () => rootRoute,\n ...(gate || options.beforeLoad\n ? { beforeLoad: layoutBeforeLoad(gate, options.beforeLoad) }\n : {}),\n ...authoredOptions(options),\n component: options.component ?? Outlet,\n });\n mountRoutes.set(mountId, toAnyRoute(route));\n }\n\n const nav: NavItem[] = [];\n const mountCounts: Record<string, number> = {};\n const childrenByParent = new Map<AnyRoute, AnyRoute[]>();\n /** cross-plugin path-collision guard: claimed paths per parent route */\n const claimedPathsByParent = new Map<AnyRoute, Map<string, string>>();\n const attach = (parent: AnyRoute, child: AnyRoute) => {\n const list = childrenByParent.get(parent) ?? [];\n list.push(child);\n childrenByParent.set(parent, list);\n };\n\n for (const plugin of ordered) {\n if (!plugin.manifest?.routes) continue;\n const optionsById = optionsByPlugin.get(plugin.key)!;\n const fullPathById = new Map<string, string>();\n const mountById = new Map<string, MountId>();\n const byId = new Map<string, { record: RouteRecord; route: AnyRoute }>();\n\n const parentFor = (\n record: RouteRecord,\n ): { route: AnyRoute; fullPath: string; mount: MountId } => {\n if (record.parentId) {\n const local = byId.get(record.parentId);\n if (local) {\n return {\n route: local.route,\n fullPath: fullPathById.get(record.parentId)!,\n mount: mountById.get(record.parentId)!,\n };\n }\n const mount = mountByLayoutId.get(record.parentId);\n if (mount) return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n throw new Error(\n `unresolvable parent \"${record.parentId}\" for \"${record.id}\" in \"${plugin.key}\" — mounts are the only cross-source parenting points`,\n );\n }\n const firstSegment = record.id.split(\"/\")[0] ?? \"\";\n if (firstSegment.startsWith(\"_\")) {\n const mount = resolveMountSegment(firstSegment.slice(1));\n if (mount && mountRoutes.has(mount))\n return { route: mountRoutes.get(mount)!, fullPath: \"\", mount };\n if (mount) {\n throw new Error(\n `mount \"${mount}\" is not declared by any source (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(\n `unknown mount \"_${firstSegment.slice(1)}\" (route \"${record.id}\" in \"${plugin.key}\")`,\n );\n }\n throw new Error(`route \"${record.id}\" in \"${plugin.key}\" must live under a mount`);\n };\n\n const pending = plugin.manifest.routes.filter(\n (record) => !record.mount && !skippedByPlugin.get(plugin.key)!.has(record.id),\n );\n const shadowedIds = new Set<string>();\n let progressed = true;\n while (pending.length > 0 && progressed) {\n progressed = false;\n for (let i = 0; i < pending.length; i += 1) {\n const record = pending[i]!;\n const parentId = record.parentId;\n if (parentId) {\n if (shadowedIds.has(parentId)) {\n shadowedIds.add(record.id);\n pending.splice(i, 1);\n i -= 1;\n progressed = true;\n continue;\n }\n if (!byId.has(parentId) && !mountByLayoutId.has(parentId)) continue;\n }\n pending.splice(i, 1);\n progressed = true;\n\n const options = optionsById.get(record.id)!;\n const parent = parentFor(record);\n const routePath = record.path;\n const isLayoutRoute = record.type === \"layout\" || routePath === undefined;\n if (!isLayoutRoute) {\n const siblings = claimedPathsByParent.get(parent.route) ?? new Map<string, string>();\n const claimant = siblings.get(routePath);\n if (claimant) {\n if (\n plugin.key !== CORE_UI_PLUGIN_KEY &&\n claimant.startsWith(`${CORE_UI_PLUGIN_KEY}:`)\n ) {\n console.log(\n `[Compose] route claim \"${claimant}\" (${routePath}) shadows \"${plugin.key}:${record.id}\" — core ui wins; shadowed route skipped`,\n );\n shadowedIds.add(record.id);\n break;\n }\n throw new Error(\n `path collision: \"${plugin.key}\" route \"${record.id}\" declares \"${routePath}\" which is already claimed by \"${claimant}\" under the same parent`,\n );\n }\n siblings.set(routePath, `${plugin.key}:${record.id}`);\n claimedPathsByParent.set(parent.route, siblings);\n }\n const fullPath = joinPath(parent.fullPath, routePath);\n let route: AnyRoute;\n if (isLayoutRoute) {\n route = createRoute({\n id: `${plugin.key}__${record.id}`,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n } else {\n route = createRoute({\n path: routePath,\n getParentRoute: () => parent.route,\n ...authoredOptions(options),\n ...(options.beforeLoad ? { beforeLoad: options.beforeLoad } : {}),\n component: options.component ?? Outlet,\n });\n }\n\n byId.set(record.id, { record, route: toAnyRoute(route) });\n fullPathById.set(record.id, fullPath);\n mountById.set(record.id, parent.mount);\n attach(parent.route, toAnyRoute(route));\n mountCounts[parent.mount] = (mountCounts[parent.mount] ?? 0) + 1;\n\n const navDeclaration = navOf(options);\n if (navDeclaration && navDeclaration.hidden !== true) {\n nav.push({\n id: `${plugin.key}:${record.id}`,\n label: navDeclaration.label,\n ...(typeof navDeclaration.icon === \"string\" ? { icon: navDeclaration.icon } : {}),\n ...(typeof navDeclaration.group === \"string\" ? { group: navDeclaration.group } : {}),\n ...(typeof navDeclaration.order === \"number\" ? { order: navDeclaration.order } : {}),\n to: navDeclaration.to ?? fullPath,\n plugin: plugin.key,\n mount: parent.mount,\n });\n }\n break;\n }\n }\n if (pending.length > 0) {\n throw new Error(\n `unresolvable parentage in \"${plugin.key}\": ${pending.map((record) => record.id).join(\", \")}`,\n );\n }\n }\n\n for (const [parent, children] of childrenByParent) {\n (parent as { addChildren: (children: AnyRoute[]) => void }).addChildren(children);\n }\n rootRoute.addChildren([...mountRoutes.values()] as AnyRoute[]);\n nav.sort(compareNavItems);\n\n const digest = await digestOf({\n plugins: refs.map((ref) => ({ key: ref.key, mfName: ref.mfName })),\n manifests: resolved.map((plugin) => plugin.manifest),\n });\n\n return {\n rootRoute,\n routeTree: rootRoute,\n digest,\n manifests: resolved.map((plugin) => plugin.manifest),\n nav: { items: nav },\n mountCounts,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;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,OAAO,QAAQ;EACrD,CAAC;EAMC,WAAW,SAAS,KAAK,WAAW,OAAO,QAAQ;EACnD,KAAK,EAAE,OAAO,IAAI;EAClB;CACF;AACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PluginManifest } from "./manifest-schema.cjs";
|
|
2
|
+
import { NavManifest } from "./nav.cjs";
|
|
3
|
+
import { RouteConfigModule, RouteOptionsBundle } from "./route-config.cjs";
|
|
4
|
+
import { AnyRoute } from "@tanstack/react-router";
|
|
5
|
+
//#region src/ui/manifest/construct.d.ts
|
|
6
|
+
interface GateUser {
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Better Auth user role — "admin" gates the admin mount. */
|
|
10
|
+
role?: string;
|
|
11
|
+
}
|
|
12
|
+
interface HostContext {
|
|
13
|
+
user?: GateUser;
|
|
14
|
+
session?: {
|
|
15
|
+
user?: GateUser;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface ConstructPluginRef {
|
|
19
|
+
/** composition identity — plugin key; participates in the digest */
|
|
20
|
+
key: string;
|
|
21
|
+
/** deployment identity — the MF container name loadRemote targets */
|
|
22
|
+
mfName: string;
|
|
23
|
+
}
|
|
24
|
+
interface ResolvedPlugin {
|
|
25
|
+
key: string;
|
|
26
|
+
manifest: PluginManifest;
|
|
27
|
+
routeConfig: RouteConfigModule;
|
|
28
|
+
}
|
|
29
|
+
interface ConstructInput {
|
|
30
|
+
name: string;
|
|
31
|
+
plugins: ReadonlyArray<ConstructPluginRef>;
|
|
32
|
+
resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;
|
|
33
|
+
/** core ui `__root` options — component/error/notFound + head baseline */
|
|
34
|
+
rootOptions?: RouteOptionsBundle;
|
|
35
|
+
}
|
|
36
|
+
interface ConstructedTree {
|
|
37
|
+
rootRoute: AnyRoute;
|
|
38
|
+
routeTree: AnyRoute;
|
|
39
|
+
digest: string;
|
|
40
|
+
manifests: PluginManifest[];
|
|
41
|
+
nav: NavManifest;
|
|
42
|
+
/** constructed route count per mount id */
|
|
43
|
+
mountCounts: Record<string, number>;
|
|
44
|
+
}
|
|
45
|
+
declare function constructTree(input: ConstructInput): Promise<ConstructedTree>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ConstructInput, ConstructPluginRef, ConstructedTree, GateUser, HostContext, ResolvedPlugin, constructTree };
|
|
48
|
+
//# sourceMappingURL=construct.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct.d.cts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;UAoCiB;EACf;EACA;;EAEA;;UAGe;EACf,OAAO;EACP;IAAY,OAAO;;;UA0CJ;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;UAGC;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PluginManifest } from "./manifest-schema.mjs";
|
|
2
|
+
import { NavManifest } from "./nav.mjs";
|
|
3
|
+
import { RouteConfigModule, RouteOptionsBundle } from "./route-config.mjs";
|
|
4
|
+
import { AnyRoute } from "@tanstack/react-router";
|
|
5
|
+
//#region src/ui/manifest/construct.d.ts
|
|
6
|
+
interface GateUser {
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Better Auth user role — "admin" gates the admin mount. */
|
|
10
|
+
role?: string;
|
|
11
|
+
}
|
|
12
|
+
interface HostContext {
|
|
13
|
+
user?: GateUser;
|
|
14
|
+
session?: {
|
|
15
|
+
user?: GateUser;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
interface ConstructPluginRef {
|
|
19
|
+
/** composition identity — plugin key; participates in the digest */
|
|
20
|
+
key: string;
|
|
21
|
+
/** deployment identity — the MF container name loadRemote targets */
|
|
22
|
+
mfName: string;
|
|
23
|
+
}
|
|
24
|
+
interface ResolvedPlugin {
|
|
25
|
+
key: string;
|
|
26
|
+
manifest: PluginManifest;
|
|
27
|
+
routeConfig: RouteConfigModule;
|
|
28
|
+
}
|
|
29
|
+
interface ConstructInput {
|
|
30
|
+
name: string;
|
|
31
|
+
plugins: ReadonlyArray<ConstructPluginRef>;
|
|
32
|
+
resolve: (ref: ConstructPluginRef) => Promise<ResolvedPlugin>;
|
|
33
|
+
/** core ui `__root` options — component/error/notFound + head baseline */
|
|
34
|
+
rootOptions?: RouteOptionsBundle;
|
|
35
|
+
}
|
|
36
|
+
interface ConstructedTree {
|
|
37
|
+
rootRoute: AnyRoute;
|
|
38
|
+
routeTree: AnyRoute;
|
|
39
|
+
digest: string;
|
|
40
|
+
manifests: PluginManifest[];
|
|
41
|
+
nav: NavManifest;
|
|
42
|
+
/** constructed route count per mount id */
|
|
43
|
+
mountCounts: Record<string, number>;
|
|
44
|
+
}
|
|
45
|
+
declare function constructTree(input: ConstructInput): Promise<ConstructedTree>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { ConstructInput, ConstructPluginRef, ConstructedTree, GateUser, HostContext, ResolvedPlugin, constructTree };
|
|
48
|
+
//# sourceMappingURL=construct.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"construct.d.mts","names":[],"sources":["../../../src/ui/manifest/construct.ts"],"mappings":";;;;;UAoCiB;EACf;EACA;;EAEA;;UAGe;EACf,OAAO;EACP;IAAY,OAAO;;;UA0CJ;;EAEf;;EAEA;;UAGe;EACf;EACA,UAAU;EACV,aAAa;;UAGE;EACf;EACA,SAAS,cAAc;EACvB,UAAU,KAAK,uBAAuB,QAAQ;;EAE9C,cAAc;;UAGC;EACf,WAAW;EACX,WAAW;EACX;EACA,WAAW;EACX,KAAK;;EAEL,aAAa;;iBA0DO,cAAc,OAAO,iBAAiB,QAAQ"}
|