every-plugin 2.10.1 → 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 -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/cli.cjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_contract_types = require('./build/contract-types.cjs');
|
|
3
|
+
const require_generated_config = require('./build/ui/generated-config.cjs');
|
|
4
|
+
const require_generated_config$1 = require('./build/rspack/generated-config.cjs');
|
|
5
|
+
let node_child_process = require("node:child_process");
|
|
6
|
+
|
|
7
|
+
//#region src/cli.ts
|
|
8
|
+
function run(cmd, args, env = {}) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const child = (0, node_child_process.spawn)(cmd, args, {
|
|
11
|
+
stdio: "inherit",
|
|
12
|
+
env: {
|
|
13
|
+
...process.env,
|
|
14
|
+
...env
|
|
15
|
+
},
|
|
16
|
+
shell: process.platform === "win32"
|
|
17
|
+
});
|
|
18
|
+
child.on("exit", (code) => code === 0 ? resolve() : reject(/* @__PURE__ */ new Error(`${cmd} ${args.join(" ")} exited with code ${code}`)));
|
|
19
|
+
child.on("error", reject);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function emitContractTypes() {
|
|
23
|
+
const status = await require_contract_types.generateContractTypes();
|
|
24
|
+
if (status === "skipped") console.log("[every-plugin] No src/contract.ts — nothing to emit.");
|
|
25
|
+
else console.log(`[every-plugin] Contract types ${status}.`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Workspace-form core ui build surface — the /api model applied to the ui:
|
|
29
|
+
* the generated config (or a local rsbuild.config.ts override) drives
|
|
30
|
+
* rsbuild; extra args pass through (`--environment web|node`).
|
|
31
|
+
*/
|
|
32
|
+
async function runCoreUi(args) {
|
|
33
|
+
const generatedConfig = require_generated_config.ensureGeneratedCoreUiRsbuildConfig();
|
|
34
|
+
const [command = "build", ...rest] = args;
|
|
35
|
+
await run("rsbuild", [
|
|
36
|
+
command,
|
|
37
|
+
...generatedConfig ? ["--config", generatedConfig] : [],
|
|
38
|
+
...rest
|
|
39
|
+
], {});
|
|
40
|
+
}
|
|
41
|
+
async function runRspack() {
|
|
42
|
+
const generatedConfig = require_generated_config$1.ensureGeneratedRspackConfig();
|
|
43
|
+
await run("rspack", generatedConfig ? [
|
|
44
|
+
"build",
|
|
45
|
+
"--config",
|
|
46
|
+
generatedConfig
|
|
47
|
+
] : ["build"], {});
|
|
48
|
+
const uiConfig = require_generated_config.ensureGeneratedUiRsbuildConfig(process.cwd());
|
|
49
|
+
if (uiConfig) {
|
|
50
|
+
console.log("[every-plugin] Building folder-form ui source…");
|
|
51
|
+
await run("rsbuild", [
|
|
52
|
+
"build",
|
|
53
|
+
"--config",
|
|
54
|
+
uiConfig
|
|
55
|
+
], {});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function runCliCommand(raw, args = []) {
|
|
59
|
+
const command = raw.replace(/=.*/, "");
|
|
60
|
+
if (command === "dev") process.env.BOS_DEV_SERVER = "1";
|
|
61
|
+
if (require_generated_config.hasCoreUiWorkspace()) switch (command) {
|
|
62
|
+
case "build": return runCoreUi(["build", ...args]);
|
|
63
|
+
case "preview": return runCoreUi(["preview", ...args]);
|
|
64
|
+
case "dev": return runCoreUi(["dev", ...args]);
|
|
65
|
+
default: return Promise.reject(/* @__PURE__ */ new Error(`Unknown every-plugin command for a core ui workspace: ${raw}`));
|
|
66
|
+
}
|
|
67
|
+
switch (command) {
|
|
68
|
+
case "types": return emitContractTypes();
|
|
69
|
+
case "build":
|
|
70
|
+
case "deploy": return runRspack();
|
|
71
|
+
case "dev": return (async () => {
|
|
72
|
+
const { startPluginDevServer } = await Promise.resolve().then(() => require("./dev/serve.cjs"));
|
|
73
|
+
await startPluginDevServer();
|
|
74
|
+
return new Promise(() => {});
|
|
75
|
+
})();
|
|
76
|
+
default: return Promise.reject(/* @__PURE__ */ new Error(`Unknown every-plugin command: ${raw} (expected dev|types|build|deploy)`));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
exports.emitContractTypes = emitContractTypes;
|
|
82
|
+
exports.runCliCommand = runCliCommand;
|
|
83
|
+
//# sourceMappingURL=cli.cjs.map
|
package/dist/cli.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":["spawn","generateContractTypes","ensureGeneratedCoreUiRsbuildConfig","ensureGeneratedRspackConfig","ensureGeneratedUiRsbuildConfig","hasCoreUiWorkspace"],"sources":["../src/cli.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport { generateContractTypes } from \"./build/contract-types\";\nimport { ensureGeneratedRspackConfig } from \"./build/rspack/generated-config\";\nimport {\n ensureGeneratedCoreUiRsbuildConfig,\n ensureGeneratedUiRsbuildConfig,\n hasCoreUiWorkspace,\n} from \"./build/ui/generated-config\";\n\nfunction run(\n cmd: string,\n args: string[],\n env: Record<string, string | undefined> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(cmd, args, {\n stdio: \"inherit\",\n env: { ...process.env, ...env },\n shell: process.platform === \"win32\",\n });\n child.on(\"exit\", (code) =>\n code === 0\n ? resolve()\n : reject(new Error(`${cmd} ${args.join(\" \")} exited with code ${code}`)),\n );\n child.on(\"error\", reject);\n });\n}\n\nexport async function emitContractTypes(): Promise<void> {\n const status = await generateContractTypes();\n if (status === \"skipped\") {\n console.log(\"[every-plugin] No src/contract.ts — nothing to emit.\");\n } else {\n console.log(`[every-plugin] Contract types ${status}.`);\n }\n}\n\n/**\n * Workspace-form core ui build surface — the /api model applied to the ui:\n * the generated config (or a local rsbuild.config.ts override) drives\n * rsbuild; extra args pass through (`--environment web|node`).\n */\nasync function runCoreUi(args: string[]): Promise<void> {\n const generatedConfig = ensureGeneratedCoreUiRsbuildConfig();\n const [command = \"build\", ...rest] = args;\n const configArgs = generatedConfig ? [\"--config\", generatedConfig] : [];\n await run(\"rsbuild\", [command, ...configArgs, ...rest], {});\n}\n\nasync function runRspack(): Promise<void> {\n const generatedConfig = ensureGeneratedRspackConfig();\n\n const args = generatedConfig ? [\"build\", \"--config\", generatedConfig] : [\"build\"];\n await run(\"rspack\", args, {});\n\n const uiConfig = ensureGeneratedUiRsbuildConfig(process.cwd());\n if (uiConfig) {\n console.log(\"[every-plugin] Building folder-form ui source…\");\n await run(\"rsbuild\", [\"build\", \"--config\", uiConfig], {});\n }\n}\n\nexport function runCliCommand(raw: string, args: string[] = []): Promise<void> {\n const command = raw.replace(/=.*/, \"\");\n if (command === \"dev\") process.env.BOS_DEV_SERVER = \"1\";\n // The core ui workspace form routes build/dev/preview through rsbuild;\n // plugin workspaces keep the rspack/dev-server surface.\n if (hasCoreUiWorkspace()) {\n switch (command) {\n case \"build\":\n return runCoreUi([\"build\", ...args]);\n case \"preview\":\n return runCoreUi([\"preview\", ...args]);\n case \"dev\":\n return runCoreUi([\"dev\", ...args]);\n default:\n return Promise.reject(\n new Error(`Unknown every-plugin command for a core ui workspace: ${raw}`),\n );\n }\n }\n switch (command) {\n case \"types\":\n return emitContractTypes();\n case \"build\":\n case \"deploy\":\n return runRspack();\n case \"dev\":\n return (async () => {\n const { startPluginDevServer } = await import(\"./dev/serve\");\n await startPluginDevServer();\n return new Promise<void>(() => {});\n })();\n default:\n return Promise.reject(\n new Error(`Unknown every-plugin command: ${raw} (expected dev|types|build|deploy)`),\n );\n }\n}\n"],"mappings":";;;;;;;AASA,SAAS,IACP,KACA,MACA,MAA0C,CAAC,GAC5B;CACf,OAAO,IAAI,SAAS,SAAS,WAAW;EACtC,MAAM,YAAQA,0BAAM,KAAK,MAAM;GAC7B,OAAO;GACP,KAAK;IAAE,GAAG,QAAQ;IAAK,GAAG;GAAI;GAC9B,OAAO,QAAQ,aAAa;EAC9B,CAAC;EACD,MAAM,GAAG,SAAS,SAChB,SAAS,IACL,QAAQ,IACR,uBAAO,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,oBAAoB,MAAM,CAAC,CAC3E;EACA,MAAM,GAAG,SAAS,MAAM;CAC1B,CAAC;AACH;AAEA,eAAsB,oBAAmC;CACvD,MAAM,SAAS,MAAMC,6CAAsB;CAC3C,IAAI,WAAW,WACb,QAAQ,IAAI,sDAAsD;MAElE,QAAQ,IAAI,iCAAiC,OAAO,EAAE;AAE1D;;;;;;AAOA,eAAe,UAAU,MAA+B;CACtD,MAAM,kBAAkBC,4DAAmC;CAC3D,MAAM,CAAC,UAAU,SAAS,GAAG,QAAQ;CAErC,MAAM,IAAI,WAAW;EAAC;EAAS,GADZ,kBAAkB,CAAC,YAAY,eAAe,IAAI,CAAC;EACxB,GAAG;CAAI,GAAG,CAAC,CAAC;AAC5D;AAEA,eAAe,YAA2B;CACxC,MAAM,kBAAkBC,uDAA4B;CAGpD,MAAM,IAAI,UADG,kBAAkB;EAAC;EAAS;EAAY;CAAe,IAAI,CAAC,OAAO,GACtD,CAAC,CAAC;CAE5B,MAAM,WAAWC,wDAA+B,QAAQ,IAAI,CAAC;CAC7D,IAAI,UAAU;EACZ,QAAQ,IAAI,gDAAgD;EAC5D,MAAM,IAAI,WAAW;GAAC;GAAS;GAAY;EAAQ,GAAG,CAAC,CAAC;CAC1D;AACF;AAEA,SAAgB,cAAc,KAAa,OAAiB,CAAC,GAAkB;CAC7E,MAAM,UAAU,IAAI,QAAQ,OAAO,EAAE;CACrC,IAAI,YAAY,OAAO,QAAQ,IAAI,iBAAiB;CAGpD,IAAIC,4CAAmB,GACrB,QAAQ,SAAR;EACE,KAAK,SACH,OAAO,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC;EACrC,KAAK,WACH,OAAO,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC;EACvC,KAAK,OACH,OAAO,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;EACnC,SACE,OAAO,QAAQ,uBACb,IAAI,MAAM,yDAAyD,KAAK,CAC1E;CACJ;CAEF,QAAQ,SAAR;EACE,KAAK,SACH,OAAO,kBAAkB;EAC3B,KAAK;EACL,KAAK,UACH,OAAO,UAAU;EACnB,KAAK,OACH,QAAQ,YAAY;GAClB,MAAM,EAAE,yBAAyB,2CAAM;GACvC,MAAM,qBAAqB;GAC3B,OAAO,IAAI,cAAoB,CAAC,CAAC;EACnC,EAAC,CAAE;EACL,SACE,OAAO,QAAQ,uBACb,IAAI,MAAM,iCAAiC,IAAI,mCAAmC,CACpF;CACJ;AACF"}
|
package/dist/cli.d.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.cts","names":[],"sources":["../src/cli.ts"],"mappings":";iBA6BsB,qBAAqB;iBAkC3B,cAAc,aAAa,kBAAsB"}
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../src/cli.ts"],"mappings":";iBA6BsB,qBAAqB;iBAkC3B,cAAc,aAAa,kBAAsB"}
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { generateContractTypes } from "./build/contract-types.mjs";
|
|
3
|
+
import { ensureGeneratedCoreUiRsbuildConfig, ensureGeneratedUiRsbuildConfig, hasCoreUiWorkspace } from "./build/ui/generated-config.mjs";
|
|
4
|
+
import { ensureGeneratedRspackConfig } from "./build/rspack/generated-config.mjs";
|
|
5
|
+
import { spawn } from "node:child_process";
|
|
6
|
+
|
|
7
|
+
//#region src/cli.ts
|
|
8
|
+
function run(cmd, args, env = {}) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const child = spawn(cmd, args, {
|
|
11
|
+
stdio: "inherit",
|
|
12
|
+
env: {
|
|
13
|
+
...process.env,
|
|
14
|
+
...env
|
|
15
|
+
},
|
|
16
|
+
shell: process.platform === "win32"
|
|
17
|
+
});
|
|
18
|
+
child.on("exit", (code) => code === 0 ? resolve() : reject(/* @__PURE__ */ new Error(`${cmd} ${args.join(" ")} exited with code ${code}`)));
|
|
19
|
+
child.on("error", reject);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async function emitContractTypes() {
|
|
23
|
+
const status = await generateContractTypes();
|
|
24
|
+
if (status === "skipped") console.log("[every-plugin] No src/contract.ts — nothing to emit.");
|
|
25
|
+
else console.log(`[every-plugin] Contract types ${status}.`);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Workspace-form core ui build surface — the /api model applied to the ui:
|
|
29
|
+
* the generated config (or a local rsbuild.config.ts override) drives
|
|
30
|
+
* rsbuild; extra args pass through (`--environment web|node`).
|
|
31
|
+
*/
|
|
32
|
+
async function runCoreUi(args) {
|
|
33
|
+
const generatedConfig = ensureGeneratedCoreUiRsbuildConfig();
|
|
34
|
+
const [command = "build", ...rest] = args;
|
|
35
|
+
await run("rsbuild", [
|
|
36
|
+
command,
|
|
37
|
+
...generatedConfig ? ["--config", generatedConfig] : [],
|
|
38
|
+
...rest
|
|
39
|
+
], {});
|
|
40
|
+
}
|
|
41
|
+
async function runRspack() {
|
|
42
|
+
const generatedConfig = ensureGeneratedRspackConfig();
|
|
43
|
+
await run("rspack", generatedConfig ? [
|
|
44
|
+
"build",
|
|
45
|
+
"--config",
|
|
46
|
+
generatedConfig
|
|
47
|
+
] : ["build"], {});
|
|
48
|
+
const uiConfig = ensureGeneratedUiRsbuildConfig(process.cwd());
|
|
49
|
+
if (uiConfig) {
|
|
50
|
+
console.log("[every-plugin] Building folder-form ui source…");
|
|
51
|
+
await run("rsbuild", [
|
|
52
|
+
"build",
|
|
53
|
+
"--config",
|
|
54
|
+
uiConfig
|
|
55
|
+
], {});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function runCliCommand(raw, args = []) {
|
|
59
|
+
const command = raw.replace(/=.*/, "");
|
|
60
|
+
if (command === "dev") process.env.BOS_DEV_SERVER = "1";
|
|
61
|
+
if (hasCoreUiWorkspace()) switch (command) {
|
|
62
|
+
case "build": return runCoreUi(["build", ...args]);
|
|
63
|
+
case "preview": return runCoreUi(["preview", ...args]);
|
|
64
|
+
case "dev": return runCoreUi(["dev", ...args]);
|
|
65
|
+
default: return Promise.reject(/* @__PURE__ */ new Error(`Unknown every-plugin command for a core ui workspace: ${raw}`));
|
|
66
|
+
}
|
|
67
|
+
switch (command) {
|
|
68
|
+
case "types": return emitContractTypes();
|
|
69
|
+
case "build":
|
|
70
|
+
case "deploy": return runRspack();
|
|
71
|
+
case "dev": return (async () => {
|
|
72
|
+
const { startPluginDevServer } = await import("./dev/serve.mjs");
|
|
73
|
+
await startPluginDevServer();
|
|
74
|
+
return new Promise(() => {});
|
|
75
|
+
})();
|
|
76
|
+
default: return Promise.reject(/* @__PURE__ */ new Error(`Unknown every-plugin command: ${raw} (expected dev|types|build|deploy)`));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { emitContractTypes, runCliCommand };
|
|
82
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport { generateContractTypes } from \"./build/contract-types\";\nimport { ensureGeneratedRspackConfig } from \"./build/rspack/generated-config\";\nimport {\n ensureGeneratedCoreUiRsbuildConfig,\n ensureGeneratedUiRsbuildConfig,\n hasCoreUiWorkspace,\n} from \"./build/ui/generated-config\";\n\nfunction run(\n cmd: string,\n args: string[],\n env: Record<string, string | undefined> = {},\n): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(cmd, args, {\n stdio: \"inherit\",\n env: { ...process.env, ...env },\n shell: process.platform === \"win32\",\n });\n child.on(\"exit\", (code) =>\n code === 0\n ? resolve()\n : reject(new Error(`${cmd} ${args.join(\" \")} exited with code ${code}`)),\n );\n child.on(\"error\", reject);\n });\n}\n\nexport async function emitContractTypes(): Promise<void> {\n const status = await generateContractTypes();\n if (status === \"skipped\") {\n console.log(\"[every-plugin] No src/contract.ts — nothing to emit.\");\n } else {\n console.log(`[every-plugin] Contract types ${status}.`);\n }\n}\n\n/**\n * Workspace-form core ui build surface — the /api model applied to the ui:\n * the generated config (or a local rsbuild.config.ts override) drives\n * rsbuild; extra args pass through (`--environment web|node`).\n */\nasync function runCoreUi(args: string[]): Promise<void> {\n const generatedConfig = ensureGeneratedCoreUiRsbuildConfig();\n const [command = \"build\", ...rest] = args;\n const configArgs = generatedConfig ? [\"--config\", generatedConfig] : [];\n await run(\"rsbuild\", [command, ...configArgs, ...rest], {});\n}\n\nasync function runRspack(): Promise<void> {\n const generatedConfig = ensureGeneratedRspackConfig();\n\n const args = generatedConfig ? [\"build\", \"--config\", generatedConfig] : [\"build\"];\n await run(\"rspack\", args, {});\n\n const uiConfig = ensureGeneratedUiRsbuildConfig(process.cwd());\n if (uiConfig) {\n console.log(\"[every-plugin] Building folder-form ui source…\");\n await run(\"rsbuild\", [\"build\", \"--config\", uiConfig], {});\n }\n}\n\nexport function runCliCommand(raw: string, args: string[] = []): Promise<void> {\n const command = raw.replace(/=.*/, \"\");\n if (command === \"dev\") process.env.BOS_DEV_SERVER = \"1\";\n // The core ui workspace form routes build/dev/preview through rsbuild;\n // plugin workspaces keep the rspack/dev-server surface.\n if (hasCoreUiWorkspace()) {\n switch (command) {\n case \"build\":\n return runCoreUi([\"build\", ...args]);\n case \"preview\":\n return runCoreUi([\"preview\", ...args]);\n case \"dev\":\n return runCoreUi([\"dev\", ...args]);\n default:\n return Promise.reject(\n new Error(`Unknown every-plugin command for a core ui workspace: ${raw}`),\n );\n }\n }\n switch (command) {\n case \"types\":\n return emitContractTypes();\n case \"build\":\n case \"deploy\":\n return runRspack();\n case \"dev\":\n return (async () => {\n const { startPluginDevServer } = await import(\"./dev/serve\");\n await startPluginDevServer();\n return new Promise<void>(() => {});\n })();\n default:\n return Promise.reject(\n new Error(`Unknown every-plugin command: ${raw} (expected dev|types|build|deploy)`),\n );\n }\n}\n"],"mappings":";;;;;;AASA,SAAS,IACP,KACA,MACA,MAA0C,CAAC,GAC5B;CACf,OAAO,IAAI,SAAS,SAAS,WAAW;EACtC,MAAM,QAAQ,MAAM,KAAK,MAAM;GAC7B,OAAO;GACP,KAAK;IAAE,GAAG,QAAQ;IAAK,GAAG;GAAI;GAC9B,OAAO,QAAQ,aAAa;EAC9B,CAAC;EACD,MAAM,GAAG,SAAS,SAChB,SAAS,IACL,QAAQ,IACR,uBAAO,IAAI,MAAM,GAAG,IAAI,GAAG,KAAK,KAAK,GAAG,EAAE,oBAAoB,MAAM,CAAC,CAC3E;EACA,MAAM,GAAG,SAAS,MAAM;CAC1B,CAAC;AACH;AAEA,eAAsB,oBAAmC;CACvD,MAAM,SAAS,MAAM,sBAAsB;CAC3C,IAAI,WAAW,WACb,QAAQ,IAAI,sDAAsD;MAElE,QAAQ,IAAI,iCAAiC,OAAO,EAAE;AAE1D;;;;;;AAOA,eAAe,UAAU,MAA+B;CACtD,MAAM,kBAAkB,mCAAmC;CAC3D,MAAM,CAAC,UAAU,SAAS,GAAG,QAAQ;CAErC,MAAM,IAAI,WAAW;EAAC;EAAS,GADZ,kBAAkB,CAAC,YAAY,eAAe,IAAI,CAAC;EACxB,GAAG;CAAI,GAAG,CAAC,CAAC;AAC5D;AAEA,eAAe,YAA2B;CACxC,MAAM,kBAAkB,4BAA4B;CAGpD,MAAM,IAAI,UADG,kBAAkB;EAAC;EAAS;EAAY;CAAe,IAAI,CAAC,OAAO,GACtD,CAAC,CAAC;CAE5B,MAAM,WAAW,+BAA+B,QAAQ,IAAI,CAAC;CAC7D,IAAI,UAAU;EACZ,QAAQ,IAAI,gDAAgD;EAC5D,MAAM,IAAI,WAAW;GAAC;GAAS;GAAY;EAAQ,GAAG,CAAC,CAAC;CAC1D;AACF;AAEA,SAAgB,cAAc,KAAa,OAAiB,CAAC,GAAkB;CAC7E,MAAM,UAAU,IAAI,QAAQ,OAAO,EAAE;CACrC,IAAI,YAAY,OAAO,QAAQ,IAAI,iBAAiB;CAGpD,IAAI,mBAAmB,GACrB,QAAQ,SAAR;EACE,KAAK,SACH,OAAO,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC;EACrC,KAAK,WACH,OAAO,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC;EACvC,KAAK,OACH,OAAO,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;EACnC,SACE,OAAO,QAAQ,uBACb,IAAI,MAAM,yDAAyD,KAAK,CAC1E;CACJ;CAEF,QAAQ,SAAR;EACE,KAAK,SACH,OAAO,kBAAkB;EAC3B,KAAK;EACL,KAAK,UACH,OAAO,UAAU;EACnB,KAAK,OACH,QAAQ,YAAY;GAClB,MAAM,EAAE,yBAAyB,MAAM,OAAO;GAC9C,MAAM,qBAAqB;GAC3B,OAAO,IAAI,cAAoB,CAAC,CAAC;EACnC,EAAC,CAAE;EACL,SACE,OAAO,QAAQ,uBACb,IAAI,MAAM,iCAAiC,IAAI,mCAAmC,CACpF;CACJ;AACF"}
|
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_errors = require('../errors.cjs');
|
|
4
|
+
const require_build_artifact_names = require('../build/artifact-names.cjs');
|
|
5
|
+
const require_remote_entry = require('../remote-entry.cjs');
|
|
6
|
+
const require_utils = require('../build/rspack/utils.cjs');
|
|
7
|
+
const require_generated_config = require('../build/ui/generated-config.cjs');
|
|
8
|
+
const require_generated_config$1 = require('../build/rspack/generated-config.cjs');
|
|
9
|
+
const require_watch_kill = require('./watch-kill.cjs');
|
|
10
|
+
let effect = require("effect");
|
|
11
|
+
let node_fs = require("node:fs");
|
|
12
|
+
node_fs = require_runtime.__toESM(node_fs, 1);
|
|
13
|
+
let node_path = require("node:path");
|
|
14
|
+
node_path = require_runtime.__toESM(node_path, 1);
|
|
15
|
+
let node_child_process = require("node:child_process");
|
|
16
|
+
let node_http = require("node:http");
|
|
17
|
+
node_http = require_runtime.__toESM(node_http, 1);
|
|
18
|
+
let sirv = require("sirv");
|
|
19
|
+
sirv = require_runtime.__toESM(sirv, 1);
|
|
20
|
+
|
|
21
|
+
//#region src/dev/serve.ts
|
|
22
|
+
const corsHeaders = {
|
|
23
|
+
"Access-Control-Allow-Origin": "*",
|
|
24
|
+
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
25
|
+
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
|
|
26
|
+
};
|
|
27
|
+
const applyCorsHeaders = (res) => {
|
|
28
|
+
Object.entries(corsHeaders).forEach(([key, value]) => {
|
|
29
|
+
res.setHeader(key, value);
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const normalizePrefix = (prefix) => {
|
|
33
|
+
if (!prefix) return "";
|
|
34
|
+
const cleaned = prefix.replace(/^\/+|\/+$/g, "");
|
|
35
|
+
return cleaned ? `/${cleaned}` : "";
|
|
36
|
+
};
|
|
37
|
+
const readRuntimeConfigFromEnv = () => {
|
|
38
|
+
const raw = process.env.BOS_RUNTIME_CONFIG;
|
|
39
|
+
if (!raw) return null;
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(raw);
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const collectSiblingRemotes = (runtimeConfig, pluginId) => {
|
|
47
|
+
const siblings = {};
|
|
48
|
+
const isApi = pluginId === "api" || runtimeConfig?.api?.name === pluginId;
|
|
49
|
+
const ownKey = runtimeConfig?.plugins?.[pluginId] ? pluginId : null;
|
|
50
|
+
let dependsOn = [];
|
|
51
|
+
if (ownKey) dependsOn = runtimeConfig.plugins[ownKey].dependsOn ?? [];
|
|
52
|
+
else if (isApi) dependsOn = runtimeConfig?.api?.dependsOn ?? [];
|
|
53
|
+
for (const depId of dependsOn) {
|
|
54
|
+
const dep = runtimeConfig?.plugins?.[depId];
|
|
55
|
+
if (!dep || dep.source !== "local" || !dep.url) continue;
|
|
56
|
+
if (depId === pluginId) continue;
|
|
57
|
+
siblings[depId] = { remote: `${dep.url.replace(/\/$/, "")}/${require_build_artifact_names.DEV_ENTRY_FILENAME}` };
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
siblings,
|
|
61
|
+
dependsOn
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const loadPluginWithRetry = (runtime, pluginId, remoteUrl, options = {
|
|
65
|
+
variables: {},
|
|
66
|
+
secrets: {}
|
|
67
|
+
}, pluginsMap, timeoutMs = 9e4) => effect.Effect.runPromise(require_remote_entry.loadRemoteWithRetry({
|
|
68
|
+
label: pluginId,
|
|
69
|
+
remoteUrl,
|
|
70
|
+
load: () => runtime.usePlugin(pluginId, options, pluginsMap),
|
|
71
|
+
timeoutMs
|
|
72
|
+
}));
|
|
73
|
+
const sendJson = (res, status, body) => {
|
|
74
|
+
res.statusCode = status;
|
|
75
|
+
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
76
|
+
res.end(JSON.stringify(body));
|
|
77
|
+
};
|
|
78
|
+
const sendText = (res, status, text) => {
|
|
79
|
+
res.statusCode = status;
|
|
80
|
+
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
81
|
+
res.end(text);
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* The dev server's plugin id — the workspace's npm package name, the same
|
|
85
|
+
* value the host passes as `runtimeId`. Both initialize sites must agree:
|
|
86
|
+
* `registerRemote` derives the MF remote name from it, and the plugin's
|
|
87
|
+
* database layer derives its migration slug from it, so a pre-normalized
|
|
88
|
+
* remote name here would migrate into a different schema than the host
|
|
89
|
+
* expects. plugin.dev.ts no longer carries a pluginId field.
|
|
90
|
+
*/
|
|
91
|
+
const resolveDevPluginId = (cwd) => require_utils.getPluginInfo(cwd).name;
|
|
92
|
+
async function startPluginDevServer(options = {}) {
|
|
93
|
+
process.env.BOS_DEV_SERVER = "1";
|
|
94
|
+
const cwd = options.cwd ?? process.cwd();
|
|
95
|
+
const pluginInfo = require_utils.getPluginInfo(cwd);
|
|
96
|
+
const devConfig = require_utils.loadDevConfig(node_path.default.join(cwd, "plugin.dev.ts"));
|
|
97
|
+
const pluginId = resolveDevPluginId(cwd);
|
|
98
|
+
const compositionKey = require_generated_config.pluginLayoutKey(cwd) ?? pluginId;
|
|
99
|
+
const port = options.port ?? (Number(process.env.PORT) || devConfig?.port || 3999);
|
|
100
|
+
const rpcPrefix = normalizePrefix(devConfig?.prefix);
|
|
101
|
+
const rpcBase = `/api/rpc${rpcPrefix}`;
|
|
102
|
+
const distDir = node_path.default.join(cwd, "dist");
|
|
103
|
+
const serveStatic = (0, sirv.default)(distDir, { dev: true });
|
|
104
|
+
const noWatch = options.watch === false || process.env.BOS_NO_WATCH === "1";
|
|
105
|
+
const runOnce = (cmd, args) => new Promise((resolve, reject) => {
|
|
106
|
+
const child = (0, node_child_process.spawn)(cmd, args, {
|
|
107
|
+
cwd,
|
|
108
|
+
stdio: "inherit",
|
|
109
|
+
env: process.env
|
|
110
|
+
});
|
|
111
|
+
child.on("error", reject);
|
|
112
|
+
child.on("exit", (code) => {
|
|
113
|
+
if (code === 0) resolve();
|
|
114
|
+
else reject(/* @__PURE__ */ new Error(`❌ ${cmd} ${args.join(" ")} exited with ${code}`));
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
let watcher = null;
|
|
118
|
+
if (noWatch) {
|
|
119
|
+
const generatedConfig = require_generated_config$1.ensureGeneratedRspackConfig(cwd);
|
|
120
|
+
await runOnce("rspack", generatedConfig ? [
|
|
121
|
+
"build",
|
|
122
|
+
"--config",
|
|
123
|
+
generatedConfig
|
|
124
|
+
] : ["build"]);
|
|
125
|
+
} else if (options.watch !== false) {
|
|
126
|
+
const generatedConfig = require_generated_config$1.ensureGeneratedRspackConfig(cwd);
|
|
127
|
+
watcher = (0, node_child_process.spawn)("rspack", generatedConfig ? [
|
|
128
|
+
"build",
|
|
129
|
+
"--watch",
|
|
130
|
+
"--config",
|
|
131
|
+
generatedConfig
|
|
132
|
+
] : ["build", "--watch"], {
|
|
133
|
+
cwd,
|
|
134
|
+
stdio: "inherit",
|
|
135
|
+
env: process.env
|
|
136
|
+
});
|
|
137
|
+
watcher.on("error", (error) => {
|
|
138
|
+
console.error(`❌ Failed to spawn rspack build --watch: ${error.message}`);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
let uiWatcher = null;
|
|
142
|
+
let uiStaticServer = null;
|
|
143
|
+
const uiPort = process.env.BOS_UI_PORT;
|
|
144
|
+
const uiConfig = require_generated_config.ensureGeneratedUiRsbuildConfig(cwd);
|
|
145
|
+
if (uiConfig && noWatch && uiPort) {
|
|
146
|
+
await runOnce("rsbuild", [
|
|
147
|
+
"build",
|
|
148
|
+
"--config",
|
|
149
|
+
uiConfig
|
|
150
|
+
]);
|
|
151
|
+
const uiDistDir = node_path.default.basename(cwd) === "ui" ? node_path.default.join(cwd, "dist") : node_path.default.join(cwd, "ui", "dist");
|
|
152
|
+
if (!node_fs.default.existsSync(node_path.default.join(uiDistDir, "remoteEntry.js"))) console.error(`❌ UI dist is missing at ${uiDistDir} — the ui static server would serve 404s for every asset (build output layout mismatch?)`);
|
|
153
|
+
const serveUiStatic = (0, sirv.default)(uiDistDir, { dev: true });
|
|
154
|
+
uiStaticServer = node_http.default.createServer((req, res) => {
|
|
155
|
+
applyCorsHeaders(res);
|
|
156
|
+
serveUiStatic(req, res, () => {
|
|
157
|
+
sendText(res, 404, "Not Found");
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
await new Promise((resolve, reject) => {
|
|
161
|
+
uiStaticServer.once("error", reject);
|
|
162
|
+
uiStaticServer.listen(Number(uiPort), () => resolve());
|
|
163
|
+
});
|
|
164
|
+
console.log(`├─ 🎨 UI: http://localhost:${uiPort} (built, no watch)`);
|
|
165
|
+
} else if (uiConfig) {
|
|
166
|
+
uiWatcher = (0, node_child_process.spawn)("rsbuild", [
|
|
167
|
+
"dev",
|
|
168
|
+
"--config",
|
|
169
|
+
uiConfig
|
|
170
|
+
], {
|
|
171
|
+
cwd,
|
|
172
|
+
stdio: "inherit",
|
|
173
|
+
env: uiPort ? {
|
|
174
|
+
...process.env,
|
|
175
|
+
PORT: uiPort
|
|
176
|
+
} : process.env
|
|
177
|
+
});
|
|
178
|
+
uiWatcher.on("error", (error) => {
|
|
179
|
+
console.error(`❌ Failed to spawn rsbuild ui dev: ${error.message}`);
|
|
180
|
+
});
|
|
181
|
+
console.log(`├─ 🎨 UI: ${uiPort ? `http://localhost:${uiPort}` : "(rsbuild auto port)"}`);
|
|
182
|
+
}
|
|
183
|
+
const handlers = {
|
|
184
|
+
rpc: null,
|
|
185
|
+
api: null
|
|
186
|
+
};
|
|
187
|
+
const effectContextHolder = { context: null };
|
|
188
|
+
let runtime = null;
|
|
189
|
+
const pathnameOf = (req) => ((req.url ?? "/").split("?")[0] ?? "/").replace(/\/+$/, "") || "/";
|
|
190
|
+
const buildDevContext = (_req, webRequest) => {
|
|
191
|
+
const rawClone = webRequest.method === "GET" || webRequest.method === "HEAD" ? null : webRequest.clone();
|
|
192
|
+
let cachedRawBody = null;
|
|
193
|
+
return {
|
|
194
|
+
reqHeaders: webRequest.headers,
|
|
195
|
+
"effect/context": effectContextHolder.context,
|
|
196
|
+
getRawBody: async () => {
|
|
197
|
+
if (cachedRawBody !== null) return cachedRawBody;
|
|
198
|
+
if (!rawClone) {
|
|
199
|
+
cachedRawBody = "";
|
|
200
|
+
return cachedRawBody;
|
|
201
|
+
}
|
|
202
|
+
cachedRawBody = await rawClone.text();
|
|
203
|
+
return cachedRawBody;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
const toWebRequest = (req) => {
|
|
208
|
+
const url = `http://localhost:${port}${req.url}`;
|
|
209
|
+
return new Request(url, {
|
|
210
|
+
method: req.method,
|
|
211
|
+
headers: req.headers,
|
|
212
|
+
body: req.method !== "GET" && req.method !== "HEAD" ? req : void 0,
|
|
213
|
+
duplex: req.method !== "GET" && req.method !== "HEAD" ? "half" : void 0
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
const handleOrpc = async (req, res, handler, prefix, errorLabel) => {
|
|
217
|
+
try {
|
|
218
|
+
const webRequest = toWebRequest(req);
|
|
219
|
+
const result = await handler.handle(webRequest, {
|
|
220
|
+
prefix,
|
|
221
|
+
context: buildDevContext(req, webRequest)
|
|
222
|
+
});
|
|
223
|
+
if (result.response) {
|
|
224
|
+
res.statusCode = result.response.status;
|
|
225
|
+
result.response.headers.forEach((value, key) => {
|
|
226
|
+
res.setHeader(key, value);
|
|
227
|
+
});
|
|
228
|
+
const text = await result.response.text();
|
|
229
|
+
if (!res.getHeader("content-length")) res.setHeader("content-length", Buffer.byteLength(text).toString());
|
|
230
|
+
res.end(text);
|
|
231
|
+
} else sendText(res, 404, "Not Found");
|
|
232
|
+
} catch (error) {
|
|
233
|
+
console.error(`${errorLabel} error:`, error);
|
|
234
|
+
sendJson(res, 500, { error: error.message });
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const server = node_http.default.createServer((req, res) => {
|
|
238
|
+
applyCorsHeaders(res);
|
|
239
|
+
const pathname = pathnameOf(req);
|
|
240
|
+
if (req.method === "OPTIONS") {
|
|
241
|
+
res.statusCode = 200;
|
|
242
|
+
res.end();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (pathname === "/" && (req.method === "GET" || req.method === "HEAD")) {
|
|
246
|
+
sendJson(res, 200, {
|
|
247
|
+
ok: true,
|
|
248
|
+
plugin: pluginInfo.normalizedName,
|
|
249
|
+
version: pluginInfo.version,
|
|
250
|
+
status: handlers.rpc ? "ready" : "loading",
|
|
251
|
+
endpoints: {
|
|
252
|
+
health: "/",
|
|
253
|
+
docs: "/api",
|
|
254
|
+
rpc: rpcBase
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (pathname === "/health" && (req.method === "GET" || req.method === "HEAD")) {
|
|
260
|
+
sendText(res, 200, "OK");
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
if (pathname.startsWith(`${rpcBase}/`)) {
|
|
264
|
+
if (!handlers.rpc) {
|
|
265
|
+
sendJson(res, 503, { error: "Plugin still loading..." });
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
handleOrpc(req, res, handlers.rpc, rpcBase, "RPC").catch(() => {});
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (pathname === "/api" || pathname.startsWith("/api/")) {
|
|
272
|
+
if (!handlers.api) {
|
|
273
|
+
sendJson(res, 503, { error: "Plugin still loading..." });
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
handleOrpc(req, res, handlers.api, "/api", "OpenAPI").catch(() => {});
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
serveStatic(req, res, () => {
|
|
280
|
+
sendText(res, 404, "Not Found");
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
await new Promise((resolve, reject) => {
|
|
284
|
+
server.once("error", reject);
|
|
285
|
+
server.listen(port, () => resolve());
|
|
286
|
+
});
|
|
287
|
+
console.log(`🚀 ${pluginInfo.name} dev server listening on port ${port}`);
|
|
288
|
+
console.log(`├─ 📡 RPC: http://localhost:${port}/api/rpc${rpcPrefix}`);
|
|
289
|
+
console.log(`├─ 📖 Docs: http://localhost:${port}/api`);
|
|
290
|
+
console.log(`└─ 💚 Health: http://localhost:${port}/`);
|
|
291
|
+
const load = async () => {
|
|
292
|
+
try {
|
|
293
|
+
const { createPluginRuntime } = await Promise.resolve().then(() => require("../runtime/index.cjs"));
|
|
294
|
+
const { RPCHandler } = await import("@orpc/server/fetch");
|
|
295
|
+
const { OpenAPIHandler } = await import("@orpc/openapi/fetch");
|
|
296
|
+
const { OpenAPIGenerator } = await import("@orpc/openapi");
|
|
297
|
+
const { OpenAPIReferenceHandlerPlugin } = await import("@orpc/openapi/plugins");
|
|
298
|
+
const { ZodToJsonSchemaConverter } = await import("@orpc/zod");
|
|
299
|
+
const { onError } = await import("@orpc/server");
|
|
300
|
+
const { formatORPCError } = await Promise.resolve().then(() => require("../errors.cjs"));
|
|
301
|
+
const runtimeConfig = readRuntimeConfigFromEnv();
|
|
302
|
+
const { siblings, dependsOn } = collectSiblingRemotes(runtimeConfig, compositionKey);
|
|
303
|
+
if (dependsOn.length > 0) console.log(`🔗 Loading sibling plugin(s): ${dependsOn.join(", ")}`);
|
|
304
|
+
const registry = {
|
|
305
|
+
[pluginId]: { remote: `http://localhost:${port}/${require_build_artifact_names.DEV_ENTRY_FILENAME}` },
|
|
306
|
+
...siblings
|
|
307
|
+
};
|
|
308
|
+
const mfRuntime = createPluginRuntime({ registry });
|
|
309
|
+
runtime = mfRuntime;
|
|
310
|
+
const pluginsMap = {};
|
|
311
|
+
const siblingEffectContexts = [];
|
|
312
|
+
for (const depId of Object.keys(siblings)) {
|
|
313
|
+
const dep = await loadPluginWithRetry(mfRuntime, depId, siblings[depId].remote);
|
|
314
|
+
pluginsMap[depId] = {
|
|
315
|
+
client: dep.createClient,
|
|
316
|
+
router: dep.router
|
|
317
|
+
};
|
|
318
|
+
if (dep.initialized?.effectContext) siblingEffectContexts.push(dep.initialized.effectContext);
|
|
319
|
+
console.log(`✅ Loaded dependency plugin: ${depId}`);
|
|
320
|
+
}
|
|
321
|
+
const loaded = await loadPluginWithRetry(mfRuntime, pluginId, registry[pluginId].remote, devConfig?.config ?? {
|
|
322
|
+
variables: {},
|
|
323
|
+
secrets: {}
|
|
324
|
+
}, Object.keys(pluginsMap).length > 0 ? pluginsMap : void 0);
|
|
325
|
+
const { Context } = await import("effect");
|
|
326
|
+
effectContextHolder.context = [loaded.initialized?.effectContext, ...siblingEffectContexts].filter(Boolean).reduce((acc, ctx) => Context.merge(acc, ctx), Context.empty());
|
|
327
|
+
handlers.rpc = new RPCHandler(loaded.router, {
|
|
328
|
+
errorStatusMap: require_errors.PLUGIN_ERROR_STATUS_MAP,
|
|
329
|
+
interceptors: [onError((error) => {
|
|
330
|
+
const formatted = formatORPCError(error);
|
|
331
|
+
if (formatted) console.error(formatted);
|
|
332
|
+
})]
|
|
333
|
+
});
|
|
334
|
+
const generator = new OpenAPIGenerator({ converters: [new ZodToJsonSchemaConverter()] });
|
|
335
|
+
handlers.api = new OpenAPIHandler(loaded.router, {
|
|
336
|
+
errorStatusMap: require_errors.PLUGIN_ERROR_STATUS_MAP,
|
|
337
|
+
plugins: [new OpenAPIReferenceHandlerPlugin({ spec: () => generator.generate(loaded.router, { version: "3.1.1" }) })],
|
|
338
|
+
interceptors: [onError((error) => {
|
|
339
|
+
const formatted = formatORPCError(error);
|
|
340
|
+
if (formatted) console.error(formatted);
|
|
341
|
+
})]
|
|
342
|
+
});
|
|
343
|
+
console.log(`✅ Plugin ready: ${pluginId}`);
|
|
344
|
+
} catch (error) {
|
|
345
|
+
console.error(`❌ Failed to load plugin ${pluginId}:`, error);
|
|
346
|
+
console.error(" Server stays up; fix the build and retry via rebuild.");
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
load();
|
|
350
|
+
const close = async () => {
|
|
351
|
+
handlers.rpc = null;
|
|
352
|
+
handlers.api = null;
|
|
353
|
+
effectContextHolder.context = null;
|
|
354
|
+
for (const child of [watcher, uiWatcher]) if (child) await require_watch_kill.killChildEscalating(child);
|
|
355
|
+
if (uiStaticServer) await new Promise((resolve) => uiStaticServer.close(() => resolve()));
|
|
356
|
+
if (runtime) await runtime.shutdown().catch(() => {});
|
|
357
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
358
|
+
};
|
|
359
|
+
process.once("SIGINT", async () => {
|
|
360
|
+
const timeout = setTimeout(() => process.exit(0), 3e3);
|
|
361
|
+
await close();
|
|
362
|
+
clearTimeout(timeout);
|
|
363
|
+
process.exit(0);
|
|
364
|
+
});
|
|
365
|
+
process.once("SIGTERM", async () => {
|
|
366
|
+
const timeout = setTimeout(() => process.exit(0), 3e3);
|
|
367
|
+
await close();
|
|
368
|
+
clearTimeout(timeout);
|
|
369
|
+
process.exit(0);
|
|
370
|
+
});
|
|
371
|
+
require_watch_kill.watchParentDeath(async () => {
|
|
372
|
+
const timeout = setTimeout(() => process.exit(0), 3e3);
|
|
373
|
+
await close();
|
|
374
|
+
clearTimeout(timeout);
|
|
375
|
+
process.exit(0);
|
|
376
|
+
});
|
|
377
|
+
return {
|
|
378
|
+
port,
|
|
379
|
+
close
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
if ({}.main || (process.argv[1] ?? "").includes("every-plugin-serve")) startPluginDevServer().catch((error) => {
|
|
383
|
+
console.error("❌ Plugin dev server fatal error:", error);
|
|
384
|
+
process.exit(1);
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
//#endregion
|
|
388
|
+
exports.resolveDevPluginId = resolveDevPluginId;
|
|
389
|
+
exports.startPluginDevServer = startPluginDevServer;
|
|
390
|
+
//# sourceMappingURL=serve.cjs.map
|