every-plugin 2.10.0 → 3.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +47 -0
- package/dist/build/rspack/chunk-completeness-plugin.cjs.map +1 -0
- package/dist/build/rspack/chunk-completeness-plugin.mjs +47 -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 +118 -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 +111 -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/dev/serve.cjs +390 -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 +384 -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 +49 -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 +8 -5
- package/dist/index.d.cts +8 -6
- package/dist/index.d.mts +8 -6
- package/dist/index.mjs +6 -4
- package/dist/plugin.cjs +12 -26
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +44 -25
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +45 -26
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +15 -29
- package/dist/plugin.mjs.map +1 -1
- package/dist/remote-entry.cjs +103 -0
- package/dist/remote-entry.cjs.map +1 -0
- package/dist/remote-entry.d.cts +53 -0
- package/dist/remote-entry.d.cts.map +1 -0
- package/dist/remote-entry.d.mts +53 -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 +140 -34
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts +42 -7
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts +42 -7
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs +136 -31
- 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 +63 -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 +63 -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 +30 -29
- 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 +29 -30
- 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 +22 -41
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +22 -41
- package/dist/types.d.mts.map +1 -1
- package/dist/ui/manifest/construct.cjs +268 -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 +268 -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 +65 -0
- package/dist/version-manifest.cjs.map +1 -0
- package/dist/version-manifest.d.cts +52 -0
- package/dist/version-manifest.d.cts.map +1 -0
- package/dist/version-manifest.d.mts +52 -0
- package/dist/version-manifest.d.mts.map +1 -0
- package/dist/version-manifest.mjs +63 -0
- package/dist/version-manifest.mjs.map +1 -0
- package/package.json +165 -68
- package/skills/plugin-client/SKILL.md +24 -5
- package/skills/plugin-development/SKILL.md +79 -47
- package/skills/plugin-testing/SKILL.md +41 -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 +57 -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 +133 -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/dev/serve.ts +477 -0
- package/src/dev/watch-kill.ts +58 -0
- package/src/effect-helpers.ts +25 -0
- package/src/errors.ts +16 -18
- package/src/identity.ts +36 -0
- package/src/index.ts +4 -0
- package/src/plugin.ts +70 -92
- package/src/remote-entry.ts +171 -0
- package/src/runtime/errors.ts +186 -27
- package/src/runtime/index.ts +132 -43
- package/src/runtime/mf-config.ts +12 -107
- package/src/runtime/services/module-federation.service.ts +221 -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 +239 -212
- 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 +22 -48
- package/src/ui/manifest/construct.ts +403 -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 +88 -0
- package/dist/build/rspack/dev-server-middleware.cjs +0 -194
- package/dist/build/rspack/dev-server-middleware.cjs.map +0 -1
- package/dist/build/rspack/dev-server-middleware.mjs +0 -193
- 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 -250
- 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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/testing/index.ts"],"sourcesContent":["import type { LoadedPluginWithBinding } from \"../plugin\";\nimport { createPluginRuntime } from \"../runtime\";\nimport type { AnyPluginConstructor, PluginRegistryEntry, PluginRuntimeConfig } from \"../types\";\n\nexport type PluginMap = Record<string, LoadedPluginWithBinding<any, any, any, any>>;\n\n/**\n * Simplified type inference for local plugin maps.\n * Just use the constructor types directly.\n *\n * @example\n * ```ts\n * const pluginMap = { \"my-plugin\": MyPlugin } as const;\n * type MyBindings = InferBindingsFromMap<typeof pluginMap>;\n * ```\n */\nexport type InferBindingsFromMap<T extends PluginMap> = {\n [K in keyof T]: T[K];\n};\n\n/**\n * Converts old pluginMap format to new registry format\n */\nfunction convertPluginMapToRegistry<T extends PluginMap>(\n oldRegistry: Record<string, { remoteUrl: string; version?: string; description?: string }>,\n pluginMap: T,\n): Record<keyof T, PluginRegistryEntry> {\n const registry: Record<string, PluginRegistryEntry> = {};\n\n for (const [pluginId, ctor] of Object.entries(pluginMap)) {\n const oldEntry = oldRegistry[pluginId];\n registry[pluginId] = {\n module: ctor as AnyPluginConstructor,\n remote: oldEntry?.remoteUrl,\n version: oldEntry?.version,\n description: oldEntry?.description,\n };\n }\n\n return registry as Record<keyof T, PluginRegistryEntry>;\n}\n\n/**\n * Creates a plugin runtime for locally available plugins (non-remote).\n * Automatically infers type bindings from the plugin map, eliminating\n * the need for manual RegistryBindings definitions.\n *\n * @deprecated Use `createPluginRuntime` with module entries directly instead.\n * @example\n * ```ts\n * // Old API (deprecated)\n * const runtime = createLocalPluginRuntime(\n * { registry: { \"my-plugin\": { remoteUrl: \"...\" } }, secrets },\n * { \"my-plugin\": MyPlugin }\n * );\n *\n * // New API (recommended)\n * const runtime = createPluginRuntime({\n * registry: { \"my-plugin\": { module: MyPlugin } },\n * secrets\n * });\n * ```\n */\nexport function createLocalPluginRuntime<TMap extends PluginMap>(\n config: {\n registry: Record<string, { remoteUrl: string; version?: string; description?: string }>;\n secrets?: Record<string, string>;\n options?: any;\n },\n pluginMap: TMap,\n) {\n const newRegistry = convertPluginMapToRegistry(config.registry, pluginMap);\n\n return createPluginRuntime({\n registry: newRegistry,\n secrets: config.secrets,\n options: config.options,\n });\n}\n\n/**\n * @deprecated Use `createLocalPluginRuntime` or `createPluginRuntime` instead.\n */\nexport const createTestPluginRuntime = createLocalPluginRuntime;\n\nexport type { EveryPlugin, PluginRegistry, RegisteredPlugins } from \"../types\";\nexport type { PluginRuntimeConfig };\n"],"mappings":";;;;;;AAuBA,SAAS,2BACP,aACA,WACsC;CACtC,MAAM,WAAgD,CAAC;CAEvD,KAAK,MAAM,CAAC,UAAU,SAAS,OAAO,QAAQ,SAAS,GAAG;EACxD,MAAM,WAAW,YAAY;EAC7B,SAAS,YAAY;GACnB,QAAQ;GACR,QAAQ,UAAU;GAClB,SAAS,UAAU;GACnB,aAAa,UAAU;EACzB;CACF;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,yBACd,QAKA,WACA;CAGA,OAAO,oBAAoB;EACzB,UAHkB,2BAA2B,OAAO,UAAU,SAG1C;EACpB,SAAS,OAAO;EAChB,SAAS,OAAO;CAClB,CAAC;AACH;;;;AAKA,MAAa,0BAA0B"}
|
package/dist/zod-core.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var zod_v4_core = require("zod/v4/core");
|
|
4
|
-
Object.keys(zod_v4_core).forEach(function (k) {
|
|
5
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function () { return zod_v4_core[k]; }
|
|
8
|
-
});
|
|
9
|
-
});
|
package/dist/zod-core.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "zod/v4/core";
|
package/dist/zod-core.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "zod/v4/core";
|
package/dist/zod-core.mjs
DELETED
package/dist/zod.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let zod = require("zod");
|
|
4
|
-
zod = require_runtime.__toESM(zod, 1);
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, 'z', {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return zod;
|
|
10
|
-
}
|
|
11
|
-
});
|
package/dist/zod.d.cts
DELETED
package/dist/zod.d.mts
DELETED
package/dist/zod.mjs
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import type { PluginInfo } from "./utils";
|
|
2
|
-
|
|
3
|
-
const corsHeaders = {
|
|
4
|
-
"Access-Control-Allow-Origin": "*",
|
|
5
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
6
|
-
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const applyCorsHeaders = (res: any) => {
|
|
10
|
-
Object.entries(corsHeaders).forEach(([key, value]) => {
|
|
11
|
-
res.setHeader(key, value);
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const normalizePrefix = (prefix?: string): string => {
|
|
16
|
-
if (!prefix) return "";
|
|
17
|
-
const cleaned = prefix.replace(/^\/+|\/+$/g, "");
|
|
18
|
-
return cleaned ? `/${cleaned}` : "";
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export function setupPluginMiddleware(
|
|
22
|
-
devServer: any,
|
|
23
|
-
pluginInfo: PluginInfo,
|
|
24
|
-
devConfig: any,
|
|
25
|
-
port: number,
|
|
26
|
-
) {
|
|
27
|
-
const rpcPrefix = normalizePrefix(devConfig?.prefix);
|
|
28
|
-
const handlers: { rpc: any; api: any } = { rpc: null, api: null };
|
|
29
|
-
let cleanup: (() => Promise<void>) | null = null;
|
|
30
|
-
|
|
31
|
-
const performCleanup = async () => {
|
|
32
|
-
if (cleanup) {
|
|
33
|
-
await cleanup();
|
|
34
|
-
cleanup = null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
(async () => {
|
|
39
|
-
await performCleanup();
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
const { createPluginRuntime } = await import("every-plugin");
|
|
43
|
-
const { RPCHandler } = await import("@orpc/server/fetch");
|
|
44
|
-
const { OpenAPIHandler } = await import("@orpc/openapi/fetch");
|
|
45
|
-
const { OpenAPIReferencePlugin } = await import("@orpc/openapi/plugins");
|
|
46
|
-
const { ZodToJsonSchemaConverter } = await import("@orpc/zod/zod4");
|
|
47
|
-
const { onError } = await import("every-plugin/orpc");
|
|
48
|
-
const { formatORPCError } = await import("every-plugin/errors");
|
|
49
|
-
|
|
50
|
-
const pluginId = devConfig?.pluginId || pluginInfo.normalizedName;
|
|
51
|
-
|
|
52
|
-
const runtime = createPluginRuntime({
|
|
53
|
-
registry: {
|
|
54
|
-
[pluginId]: {
|
|
55
|
-
remote: `http://localhost:${port}/remoteEntry.js`,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
const defaultConfig = { variables: {}, secrets: {} };
|
|
61
|
-
|
|
62
|
-
// @ts-expect-error we don't know the plugin id
|
|
63
|
-
const loaded = await runtime.usePlugin(pluginId, (devConfig?.config ?? defaultConfig) as any);
|
|
64
|
-
|
|
65
|
-
cleanup = async () => {
|
|
66
|
-
handlers.rpc = null;
|
|
67
|
-
handlers.api = null;
|
|
68
|
-
if (devServer.app.locals.handlers) {
|
|
69
|
-
devServer.app.locals.handlers = null;
|
|
70
|
-
}
|
|
71
|
-
if (runtime) await runtime.shutdown();
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
handlers.rpc = new RPCHandler(loaded.router, {
|
|
75
|
-
interceptors: [
|
|
76
|
-
onError((error: any) => {
|
|
77
|
-
const formatted = formatORPCError(error);
|
|
78
|
-
if (formatted) console.error(formatted);
|
|
79
|
-
}),
|
|
80
|
-
],
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
handlers.api = new OpenAPIHandler(loaded.router, {
|
|
84
|
-
plugins: [
|
|
85
|
-
new OpenAPIReferencePlugin({
|
|
86
|
-
schemaConverters: [new ZodToJsonSchemaConverter()],
|
|
87
|
-
}),
|
|
88
|
-
],
|
|
89
|
-
interceptors: [
|
|
90
|
-
onError((error: any) => {
|
|
91
|
-
const formatted = formatORPCError(error);
|
|
92
|
-
if (formatted) console.error(formatted);
|
|
93
|
-
}),
|
|
94
|
-
],
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
console.log(`╭─────────────────────────────────────────────`);
|
|
98
|
-
console.log(`│ ✅ Plugin dev server ready: `);
|
|
99
|
-
console.log(`├─────────────────────────────────────────────`);
|
|
100
|
-
console.log(`│ 📡 RPC: http://localhost:${port}/api/rpc${rpcPrefix}`);
|
|
101
|
-
console.log(`│ 📖 Docs: http://localhost:${port}/api`);
|
|
102
|
-
console.log(`│ 💚 Health: http://localhost:${port}/`);
|
|
103
|
-
console.log(`╰─────────────────────────────────────────────`);
|
|
104
|
-
|
|
105
|
-
devServer.app.locals.handlers = handlers;
|
|
106
|
-
|
|
107
|
-
if (devServer.server) {
|
|
108
|
-
devServer.server.once("close", async () => {
|
|
109
|
-
await performCleanup();
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
} catch (error) {
|
|
113
|
-
console.error("❌ Failed to load plugin:", error);
|
|
114
|
-
await performCleanup();
|
|
115
|
-
}
|
|
116
|
-
})().catch((err) => {
|
|
117
|
-
console.error("❌ Plugin dev server fatal error:", err);
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
process.once("SIGINT", async () => {
|
|
121
|
-
const timeout = setTimeout(() => process.exit(0), 3000);
|
|
122
|
-
await performCleanup();
|
|
123
|
-
clearTimeout(timeout);
|
|
124
|
-
});
|
|
125
|
-
process.once("SIGTERM", async () => {
|
|
126
|
-
const timeout = setTimeout(() => process.exit(0), 3000);
|
|
127
|
-
await performCleanup();
|
|
128
|
-
clearTimeout(timeout);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
devServer.app.options("*", (_req: any, res: any) => {
|
|
132
|
-
applyCorsHeaders(res);
|
|
133
|
-
res.status(200).end();
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
devServer.app.get("/", (_req: any, res: any) => {
|
|
137
|
-
applyCorsHeaders(res);
|
|
138
|
-
res.json({
|
|
139
|
-
ok: true,
|
|
140
|
-
plugin: pluginInfo.normalizedName,
|
|
141
|
-
version: pluginInfo.version,
|
|
142
|
-
status: devServer.app.locals.handlers?.rpc ? "ready" : "loading",
|
|
143
|
-
endpoints: {
|
|
144
|
-
health: "/",
|
|
145
|
-
docs: "/api",
|
|
146
|
-
rpc: `/api/rpc${rpcPrefix}`,
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
devServer.app.get("/health", (_req: any, res: any) => {
|
|
152
|
-
applyCorsHeaders(res);
|
|
153
|
-
res.status(200).send("OK");
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const buildDevContext = (_req: any, webRequest: Request) => {
|
|
157
|
-
const rawClone =
|
|
158
|
-
webRequest.method === "GET" || webRequest.method === "HEAD" ? null : webRequest.clone();
|
|
159
|
-
let cachedRawBody: string | null = null;
|
|
160
|
-
return {
|
|
161
|
-
reqHeaders: webRequest.headers,
|
|
162
|
-
getRawBody: async (): Promise<string> => {
|
|
163
|
-
if (cachedRawBody !== null) return cachedRawBody;
|
|
164
|
-
if (!rawClone) {
|
|
165
|
-
cachedRawBody = "";
|
|
166
|
-
return cachedRawBody;
|
|
167
|
-
}
|
|
168
|
-
cachedRawBody = await rawClone.text();
|
|
169
|
-
return cachedRawBody;
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const handleApiRequest = async (req: any, res: any) => {
|
|
175
|
-
applyCorsHeaders(res);
|
|
176
|
-
const apiHandler = devServer.app.locals.handlers?.api;
|
|
177
|
-
if (!apiHandler) {
|
|
178
|
-
return res.status(503).json({ error: "Plugin still loading..." });
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
try {
|
|
182
|
-
const url = `http://${req.headers.host}${req.url}`;
|
|
183
|
-
const webRequest = new Request(url, {
|
|
184
|
-
method: req.method,
|
|
185
|
-
headers: req.headers,
|
|
186
|
-
body: req.method !== "GET" && req.method !== "HEAD" ? req : undefined,
|
|
187
|
-
duplex: req.method !== "GET" && req.method !== "HEAD" ? "half" : undefined,
|
|
188
|
-
} as RequestInit);
|
|
189
|
-
|
|
190
|
-
const result = await apiHandler.handle(webRequest, {
|
|
191
|
-
prefix: "/api",
|
|
192
|
-
context: buildDevContext(req, webRequest),
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
if (result.response) {
|
|
196
|
-
res.status(result.response.status);
|
|
197
|
-
result.response.headers.forEach((value: string, key: string) => {
|
|
198
|
-
res.setHeader(key, value);
|
|
199
|
-
});
|
|
200
|
-
const text = await result.response.text();
|
|
201
|
-
res.send(text);
|
|
202
|
-
} else {
|
|
203
|
-
res.status(404).send("Not Found");
|
|
204
|
-
}
|
|
205
|
-
} catch (error) {
|
|
206
|
-
console.error("OpenAPI error:", error);
|
|
207
|
-
res.status(500).json({ error: (error as Error).message });
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
devServer.app.all(`/api/rpc${rpcPrefix}/*`, async (req: any, res: any) => {
|
|
212
|
-
applyCorsHeaders(res);
|
|
213
|
-
const rpcHandler = devServer.app.locals.handlers?.rpc;
|
|
214
|
-
if (!rpcHandler) {
|
|
215
|
-
return res.status(503).json({ error: "Plugin still loading..." });
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
try {
|
|
219
|
-
const url = `http://${req.headers.host}${req.url}`;
|
|
220
|
-
const webRequest = new Request(url, {
|
|
221
|
-
method: req.method,
|
|
222
|
-
headers: req.headers,
|
|
223
|
-
body: req.method !== "GET" && req.method !== "HEAD" ? req : undefined,
|
|
224
|
-
duplex: req.method !== "GET" && req.method !== "HEAD" ? "half" : undefined,
|
|
225
|
-
} as RequestInit);
|
|
226
|
-
|
|
227
|
-
const result = await rpcHandler.handle(webRequest, {
|
|
228
|
-
prefix: `/api/rpc${rpcPrefix}`,
|
|
229
|
-
context: buildDevContext(req, webRequest),
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
if (result.response) {
|
|
233
|
-
res.status(result.response.status);
|
|
234
|
-
result.response.headers.forEach((value: string, key: string) => {
|
|
235
|
-
res.setHeader(key, value);
|
|
236
|
-
});
|
|
237
|
-
const text = await result.response.text();
|
|
238
|
-
res.send(text);
|
|
239
|
-
} else {
|
|
240
|
-
res.status(404).send("Not Found");
|
|
241
|
-
}
|
|
242
|
-
} catch (error) {
|
|
243
|
-
console.error("RPC error:", error);
|
|
244
|
-
res.status(500).json({ error: (error as Error).message });
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
devServer.app.all("/api", handleApiRequest);
|
|
249
|
-
devServer.app.all("/api/*", handleApiRequest);
|
|
250
|
-
}
|
package/src/build/shared-deps.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { dirname, join } from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
|
|
6
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
let pkg: typeof import("../../package.json");
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
pkg = JSON.parse(readFileSync(join(__dirname, "../../package.json"), "utf-8"));
|
|
13
|
-
} catch {
|
|
14
|
-
pkg = require("every-plugin/package.json");
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface SharedDependencyConfig {
|
|
18
|
-
version: string;
|
|
19
|
-
requiredVersion: string | false;
|
|
20
|
-
singleton: boolean;
|
|
21
|
-
strictVersion: boolean;
|
|
22
|
-
eager: boolean;
|
|
23
|
-
shareScope: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type SharedDependencies = Record<string, SharedDependencyConfig>;
|
|
27
|
-
|
|
28
|
-
const DEFAULT_SHARE_CONFIG: Omit<SharedDependencyConfig, "version"> = {
|
|
29
|
-
requiredVersion: false,
|
|
30
|
-
singleton: true,
|
|
31
|
-
strictVersion: false,
|
|
32
|
-
eager: false,
|
|
33
|
-
shareScope: "default",
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
function extractExactVersion(input: string): string {
|
|
37
|
-
const match = input.match(/\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?/);
|
|
38
|
-
return match ? match[0] : input.replace(/^[\^~>=<\s]+/, "");
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getInstalledPackageVersion(packageName: string, fallbackVersion: string): string {
|
|
42
|
-
try {
|
|
43
|
-
let currentDir = dirname(require.resolve(packageName));
|
|
44
|
-
for (let i = 0; i < 5; i += 1) {
|
|
45
|
-
const packageJsonPath = join(currentDir, "package.json");
|
|
46
|
-
if (existsSync(packageJsonPath)) {
|
|
47
|
-
return (JSON.parse(readFileSync(packageJsonPath, "utf-8")) as { version: string }).version;
|
|
48
|
-
}
|
|
49
|
-
currentDir = dirname(currentDir);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
throw new Error(`Could not resolve installed version for ${packageName}`);
|
|
53
|
-
} catch {
|
|
54
|
-
return extractExactVersion(fallbackVersion);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const pluginSharedDependencies = {
|
|
59
|
-
"every-plugin": { version: pkg.version, ...DEFAULT_SHARE_CONFIG },
|
|
60
|
-
effect: {
|
|
61
|
-
version: getInstalledPackageVersion("effect", pkg.peerDependencies.effect),
|
|
62
|
-
...DEFAULT_SHARE_CONFIG,
|
|
63
|
-
},
|
|
64
|
-
zod: {
|
|
65
|
-
version: getInstalledPackageVersion("zod", pkg.peerDependencies.zod),
|
|
66
|
-
...DEFAULT_SHARE_CONFIG,
|
|
67
|
-
},
|
|
68
|
-
"@orpc/contract": {
|
|
69
|
-
version: getInstalledPackageVersion("@orpc/contract", pkg.peerDependencies["@orpc/contract"]),
|
|
70
|
-
...DEFAULT_SHARE_CONFIG,
|
|
71
|
-
},
|
|
72
|
-
"@orpc/client": {
|
|
73
|
-
version: getInstalledPackageVersion("@orpc/client", pkg.peerDependencies["@orpc/client"]),
|
|
74
|
-
...DEFAULT_SHARE_CONFIG,
|
|
75
|
-
},
|
|
76
|
-
"@orpc/server": {
|
|
77
|
-
version: getInstalledPackageVersion("@orpc/server", pkg.peerDependencies["@orpc/server"]),
|
|
78
|
-
...DEFAULT_SHARE_CONFIG,
|
|
79
|
-
},
|
|
80
|
-
} satisfies SharedDependencies;
|
|
81
|
-
|
|
82
|
-
export type PluginSharedDependencyName = keyof typeof pluginSharedDependencies;
|
|
83
|
-
|
|
84
|
-
export function getPluginSharedDependencies(): SharedDependencies {
|
|
85
|
-
return pluginSharedDependencies;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function getPluginSharedDependenciesVersionRange(): Record<string, string> {
|
|
89
|
-
return Object.fromEntries(
|
|
90
|
-
Object.entries(getPluginSharedDependencies()).map(([name, config]) => [
|
|
91
|
-
name,
|
|
92
|
-
getMajorMinorVersion(config.version),
|
|
93
|
-
]),
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function getMajorMinorVersion(version: string): string {
|
|
98
|
-
const clean = version.replace(/^[\^~>=<]+/, "");
|
|
99
|
-
const match = clean.match(/^(\d+)\.(\d+)/);
|
|
100
|
-
if (!match) return "^0.0.0";
|
|
101
|
-
return `^${match[1]}.${match[2]}.0`;
|
|
102
|
-
}
|
package/src/effect.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "effect";
|
package/src/orpc-openapi.ts
DELETED
package/src/orpc.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "@orpc/contract";
|
|
2
|
-
export * from "@orpc/experimental-publisher";
|
|
3
|
-
export type { IORedisPublisherOptions } from "@orpc/experimental-publisher/ioredis";
|
|
4
|
-
export { IORedisPublisher } from "@orpc/experimental-publisher/ioredis";
|
|
5
|
-
export type { MemoryPublisherOptions } from "@orpc/experimental-publisher/memory";
|
|
6
|
-
export { MemoryPublisher } from "@orpc/experimental-publisher/memory";
|
|
7
|
-
export type { UpstashRedisPublisherOptions } from "@orpc/experimental-publisher/upstash-redis";
|
|
8
|
-
export { UpstashRedisPublisher } from "@orpc/experimental-publisher/upstash-redis";
|
|
9
|
-
export * from "@orpc/server";
|
package/src/testing/index.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import type { LoadedPluginWithBinding } from "../plugin";
|
|
2
|
-
import { createPluginRuntime } from "../runtime";
|
|
3
|
-
import type { AnyPluginConstructor, PluginRegistryEntry, PluginRuntimeConfig } from "../types";
|
|
4
|
-
|
|
5
|
-
export type PluginMap = Record<string, LoadedPluginWithBinding<any, any, any, any>>;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Simplified type inference for local plugin maps.
|
|
9
|
-
* Just use the constructor types directly.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* const pluginMap = { "my-plugin": MyPlugin } as const;
|
|
14
|
-
* type MyBindings = InferBindingsFromMap<typeof pluginMap>;
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export type InferBindingsFromMap<T extends PluginMap> = {
|
|
18
|
-
[K in keyof T]: T[K];
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Converts old pluginMap format to new registry format
|
|
23
|
-
*/
|
|
24
|
-
function convertPluginMapToRegistry<T extends PluginMap>(
|
|
25
|
-
oldRegistry: Record<string, { remoteUrl: string; version?: string; description?: string }>,
|
|
26
|
-
pluginMap: T,
|
|
27
|
-
): Record<keyof T, PluginRegistryEntry> {
|
|
28
|
-
const registry: Record<string, PluginRegistryEntry> = {};
|
|
29
|
-
|
|
30
|
-
for (const [pluginId, ctor] of Object.entries(pluginMap)) {
|
|
31
|
-
const oldEntry = oldRegistry[pluginId];
|
|
32
|
-
registry[pluginId] = {
|
|
33
|
-
module: ctor as AnyPluginConstructor,
|
|
34
|
-
remote: oldEntry?.remoteUrl,
|
|
35
|
-
version: oldEntry?.version,
|
|
36
|
-
description: oldEntry?.description,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return registry as Record<keyof T, PluginRegistryEntry>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Creates a plugin runtime for locally available plugins (non-remote).
|
|
45
|
-
* Automatically infers type bindings from the plugin map, eliminating
|
|
46
|
-
* the need for manual RegistryBindings definitions.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated Use `createPluginRuntime` with module entries directly instead.
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* // Old API (deprecated)
|
|
52
|
-
* const runtime = createLocalPluginRuntime(
|
|
53
|
-
* { registry: { "my-plugin": { remoteUrl: "..." } }, secrets },
|
|
54
|
-
* { "my-plugin": MyPlugin }
|
|
55
|
-
* );
|
|
56
|
-
*
|
|
57
|
-
* // New API (recommended)
|
|
58
|
-
* const runtime = createPluginRuntime({
|
|
59
|
-
* registry: { "my-plugin": { module: MyPlugin } },
|
|
60
|
-
* secrets
|
|
61
|
-
* });
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export function createLocalPluginRuntime<TMap extends PluginMap>(
|
|
65
|
-
config: {
|
|
66
|
-
registry: Record<string, { remoteUrl: string; version?: string; description?: string }>;
|
|
67
|
-
secrets?: Record<string, string>;
|
|
68
|
-
options?: any;
|
|
69
|
-
},
|
|
70
|
-
pluginMap: TMap,
|
|
71
|
-
) {
|
|
72
|
-
const newRegistry = convertPluginMapToRegistry(config.registry, pluginMap);
|
|
73
|
-
|
|
74
|
-
return createPluginRuntime({
|
|
75
|
-
registry: newRegistry,
|
|
76
|
-
secrets: config.secrets,
|
|
77
|
-
options: config.options,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @deprecated Use `createLocalPluginRuntime` or `createPluginRuntime` instead.
|
|
83
|
-
*/
|
|
84
|
-
export const createTestPluginRuntime = createLocalPluginRuntime;
|
|
85
|
-
|
|
86
|
-
export type { EveryPlugin, PluginRegistry, RegisteredPlugins } from "../types";
|
|
87
|
-
export type { PluginRuntimeConfig };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Effect, Layer } from "effect";
|
|
2
|
-
import type { LoadedPluginWithBinding } from "../../plugin";
|
|
3
|
-
import { ModuleFederationError } from "../../runtime/errors";
|
|
4
|
-
import { ModuleFederationService } from "../../runtime/services/module-federation.service";
|
|
5
|
-
|
|
6
|
-
export type PluginMap = Record<string, LoadedPluginWithBinding<any, any, any, any>>;
|
|
7
|
-
|
|
8
|
-
export const createMockModuleFederationServiceLayer = (pluginMap: PluginMap) =>
|
|
9
|
-
Layer.succeed(ModuleFederationService, {
|
|
10
|
-
registerRemote: (pluginId: string, url: string) =>
|
|
11
|
-
Effect.gen(function* () {
|
|
12
|
-
console.log(`[MOCK] registerRemote called for ${pluginId}`);
|
|
13
|
-
if (!(pluginId in pluginMap)) {
|
|
14
|
-
return yield* Effect.fail(
|
|
15
|
-
new ModuleFederationError({
|
|
16
|
-
pluginId,
|
|
17
|
-
remoteUrl: url,
|
|
18
|
-
cause: new Error(`Mock: Plugin ${pluginId} not available in test plugin map`),
|
|
19
|
-
}),
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
console.log(`[MOCK] registerRemote succeeded for ${pluginId}`);
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
loadRemoteConstructor: (pluginId: string, url: string) =>
|
|
26
|
-
Effect.gen(function* () {
|
|
27
|
-
console.log(`[MOCK] loadRemoteConstructor called for ${pluginId}`);
|
|
28
|
-
const PluginConstructor = pluginMap[pluginId];
|
|
29
|
-
if (!PluginConstructor) {
|
|
30
|
-
return yield* Effect.fail(
|
|
31
|
-
new ModuleFederationError({
|
|
32
|
-
pluginId,
|
|
33
|
-
remoteUrl: url,
|
|
34
|
-
cause: new Error(`Mock: Constructor for ${pluginId} not found in test plugin map`),
|
|
35
|
-
}),
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
console.log(`[MOCK] loadRemoteConstructor succeeded for ${pluginId}`);
|
|
39
|
-
return PluginConstructor;
|
|
40
|
-
}),
|
|
41
|
-
} as any);
|
package/src/zod-core.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "zod/v4/core";
|
package/src/zod.ts
DELETED