every-plugin 2.10.1 → 3.0.0-rc.3
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 +50 -69
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +13 -96
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.mts +13 -96
- package/dist/errors.d.mts.map +1 -1
- package/dist/errors.mjs +16 -34
- package/dist/errors.mjs.map +1 -1
- package/dist/identity.cjs +19 -0
- package/dist/identity.cjs.map +1 -0
- package/dist/identity.d.cts +33 -0
- package/dist/identity.d.cts.map +1 -0
- package/dist/identity.d.mts +33 -0
- package/dist/identity.d.mts.map +1 -0
- package/dist/identity.mjs +16 -0
- package/dist/identity.mjs.map +1 -0
- package/dist/index.cjs +9 -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 +13 -26
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +57 -24
- package/dist/plugin.d.cts.map +1 -1
- package/dist/plugin.d.mts +58 -25
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +16 -29
- package/dist/plugin.mjs.map +1 -1
- package/dist/remote-entry.cjs +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 +159 -33
- package/dist/runtime/errors.cjs.map +1 -1
- package/dist/runtime/errors.d.cts +64 -7
- package/dist/runtime/errors.d.cts.map +1 -1
- package/dist/runtime/errors.d.mts +64 -7
- package/dist/runtime/errors.d.mts.map +1 -1
- package/dist/runtime/errors.mjs +154 -30
- package/dist/runtime/errors.mjs.map +1 -1
- package/dist/runtime/index.cjs +95 -23
- package/dist/runtime/index.cjs.map +1 -1
- package/dist/runtime/index.d.cts +16 -0
- package/dist/runtime/index.d.cts.map +1 -1
- package/dist/runtime/index.d.mts +16 -0
- package/dist/runtime/index.d.mts.map +1 -1
- package/dist/runtime/index.mjs +98 -26
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/mf-config.cjs +3 -78
- package/dist/runtime/mf-config.cjs.map +1 -1
- package/dist/runtime/mf-config.d.cts +3 -49
- package/dist/runtime/mf-config.d.cts.map +1 -1
- package/dist/runtime/mf-config.d.mts +3 -49
- package/dist/runtime/mf-config.d.mts.map +1 -1
- package/dist/runtime/mf-config.mjs +5 -78
- package/dist/runtime/mf-config.mjs.map +1 -1
- package/dist/runtime/services/module-federation.service.cjs +57 -12
- package/dist/runtime/services/module-federation.service.cjs.map +1 -1
- package/dist/runtime/services/module-federation.service.d.cts +4 -13
- package/dist/runtime/services/module-federation.service.d.mts +4 -13
- package/dist/runtime/services/module-federation.service.mjs +57 -14
- package/dist/runtime/services/module-federation.service.mjs.map +1 -1
- package/dist/runtime/services/normalize.cjs +2 -22
- package/dist/runtime/services/normalize.d.cts +2 -21
- package/dist/runtime/services/normalize.d.mts +2 -21
- package/dist/runtime/services/normalize.mjs +2 -21
- package/dist/runtime/services/plugin-lifecycle.service.cjs +9 -11
- package/dist/runtime/services/plugin-lifecycle.service.cjs.map +1 -1
- package/dist/runtime/services/plugin-lifecycle.service.d.cts +3 -16
- package/dist/runtime/services/plugin-lifecycle.service.d.mts +3 -16
- package/dist/runtime/services/plugin-lifecycle.service.mjs +10 -13
- package/dist/runtime/services/plugin-lifecycle.service.mjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.cjs +56 -30
- package/dist/runtime/services/plugin-loader.service.cjs.map +1 -1
- package/dist/runtime/services/plugin-loader.service.d.cts +6 -53
- package/dist/runtime/services/plugin-loader.service.d.mts +6 -53
- package/dist/runtime/services/plugin-loader.service.mjs +55 -31
- package/dist/runtime/services/plugin-loader.service.mjs.map +1 -1
- package/dist/runtime/services/plugin.service.cjs +10 -12
- package/dist/runtime/services/plugin.service.cjs.map +1 -1
- package/dist/runtime/services/plugin.service.d.cts +14 -36
- package/dist/runtime/services/plugin.service.d.cts.map +1 -1
- package/dist/runtime/services/plugin.service.d.mts +14 -36
- package/dist/runtime/services/plugin.service.d.mts.map +1 -1
- package/dist/runtime/services/plugin.service.mjs +14 -18
- package/dist/runtime/services/plugin.service.mjs.map +1 -1
- package/dist/runtime/services/secrets.service.cjs +12 -12
- package/dist/runtime/services/secrets.service.cjs.map +1 -1
- package/dist/runtime/services/secrets.service.d.cts +3 -15
- package/dist/runtime/services/secrets.service.d.mts +3 -15
- package/dist/runtime/services/secrets.service.mjs +12 -13
- package/dist/runtime/services/secrets.service.mjs.map +1 -1
- package/dist/runtime/services/shared-identity.cjs +40 -0
- package/dist/runtime/services/shared-identity.cjs.map +1 -0
- package/dist/runtime/services/shared-identity.mjs +38 -0
- package/dist/runtime/services/shared-identity.mjs.map +1 -0
- package/dist/runtime/validation.cjs +2 -2
- package/dist/runtime/validation.cjs.map +1 -1
- package/dist/runtime/validation.mjs +2 -2
- package/dist/runtime/validation.mjs.map +1 -1
- package/dist/shared-deps-spec.cjs +384 -0
- package/dist/shared-deps-spec.cjs.map +1 -0
- package/dist/shared-deps-spec.d.cts +182 -0
- package/dist/shared-deps-spec.d.cts.map +1 -0
- package/dist/shared-deps-spec.d.mts +182 -0
- package/dist/shared-deps-spec.d.mts.map +1 -0
- package/dist/shared-deps-spec.mjs +368 -0
- package/dist/shared-deps-spec.mjs.map +1 -0
- package/dist/types.d.cts +25 -41
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +25 -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 +17 -18
- package/src/identity.ts +36 -0
- package/src/index.ts +4 -0
- package/src/plugin.ts +88 -91
- package/src/remote-entry.ts +171 -0
- package/src/runtime/errors.ts +229 -26
- package/src/runtime/index.ts +132 -43
- package/src/runtime/mf-config.ts +12 -107
- package/src/runtime/services/module-federation.service.ts +218 -117
- package/src/runtime/services/normalize.ts +1 -18
- package/src/runtime/services/plugin-lifecycle.service.ts +66 -75
- package/src/runtime/services/plugin-loader.service.ts +271 -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 +25 -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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import type { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
5
|
+
import { FixMfDataUriPlugin } from "./fix-mf-data-uri-plugin";
|
|
6
|
+
import { EmitPluginManifest, EveryPluginBuild } from "./plugin";
|
|
7
|
+
|
|
8
|
+
class EveryPluginComposedBuild implements RspackPluginInstance {
|
|
9
|
+
name = "EveryPluginComposedBuild";
|
|
10
|
+
|
|
11
|
+
constructor(private readonly dts: boolean = false) {}
|
|
12
|
+
|
|
13
|
+
apply(compiler: Compiler) {
|
|
14
|
+
new EmitPluginManifest().apply(compiler);
|
|
15
|
+
new EveryPluginBuild({ dts: this.dts }).apply(compiler);
|
|
16
|
+
new FixMfDataUriPlugin().apply(compiler);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface PluginBaseConfigOptions {
|
|
21
|
+
drizzle?: boolean;
|
|
22
|
+
externals?: string[];
|
|
23
|
+
/** Concrete rspack fields to merge over the defaults (devtool, infrastructureLogging, ...). */
|
|
24
|
+
rspack?: Partial<PluginBaseConfig>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const pluginRequire = createRequire(import.meta.url);
|
|
28
|
+
|
|
29
|
+
/** Config filenames that mark a project root, nearest-first. Authored
|
|
30
|
+
* descriptor projects (the platform) carry bos.app.ts; generated child
|
|
31
|
+
* projects carry bos.config.json. */
|
|
32
|
+
const CONFIG_FILENAMES = ["bos.config.json", "bos.app.ts"] as const;
|
|
33
|
+
|
|
34
|
+
export function findBosConfigPath(from: string = process.cwd()): string | null {
|
|
35
|
+
let current = path.resolve(from);
|
|
36
|
+
while (true) {
|
|
37
|
+
for (const filename of CONFIG_FILENAMES) {
|
|
38
|
+
const candidate = path.join(current, filename);
|
|
39
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
40
|
+
}
|
|
41
|
+
const parent = path.dirname(current);
|
|
42
|
+
if (parent === current) return null;
|
|
43
|
+
current = parent;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function loadDrizzleMigrationsPlugin(): ((...args: unknown[]) => unknown) | null {
|
|
48
|
+
try {
|
|
49
|
+
const mod = pluginRequire("@proj-airi/unplugin-drizzle-orm-migrations/rspack");
|
|
50
|
+
return (mod as { default?: (...args: unknown[]) => unknown }).default ?? mod;
|
|
51
|
+
} catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface PluginBaseConfig {
|
|
57
|
+
externals: string[];
|
|
58
|
+
devtool: false | "source-map";
|
|
59
|
+
plugins: unknown[];
|
|
60
|
+
infrastructureLogging: { level: "error" };
|
|
61
|
+
stats: "errors-warnings";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function createPluginBaseConfig(options: PluginBaseConfigOptions = {}): PluginBaseConfig {
|
|
65
|
+
const shouldDeploy = process.env.DEPLOY === "true";
|
|
66
|
+
const plugins: unknown[] = [new EveryPluginComposedBuild(false)];
|
|
67
|
+
|
|
68
|
+
if (options.drizzle !== false) {
|
|
69
|
+
const drizzlePlugin = loadDrizzleMigrationsPlugin();
|
|
70
|
+
if (drizzlePlugin) {
|
|
71
|
+
plugins.push(drizzlePlugin());
|
|
72
|
+
} else if (options.drizzle === true) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
"createPluginBaseConfig({ drizzle: true }) requires @proj-airi/unplugin-drizzle-orm-migrations to be installed.",
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
...options.rspack,
|
|
81
|
+
externals: options.externals ?? options.rspack?.externals ?? ["pg", "@electric-sql/pglite"],
|
|
82
|
+
devtool: options.rspack?.devtool ?? (shouldDeploy ? false : "source-map"),
|
|
83
|
+
plugins,
|
|
84
|
+
infrastructureLogging: options.rspack?.infrastructureLogging ?? { level: "error" },
|
|
85
|
+
stats: options.rspack?.stats ?? "errors-warnings",
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
2
2
|
|
|
3
3
|
const MF_DATA_URI_MARKER = "data:text/javascript,";
|
|
4
|
+
const NODE_MODULES_IMPORT_RE = /(["'])\/[^"']*?\/node_modules\/([^"']*)\1/g;
|
|
4
5
|
|
|
5
6
|
export class FixMfDataUriPlugin implements RspackPluginInstance {
|
|
6
7
|
name = "FixMfDataUriPlugin";
|
|
7
8
|
|
|
9
|
+
/** Bare specifier → on-disk absolute path, learned while rewriting. */
|
|
10
|
+
private redirects = new Map<string, string>();
|
|
11
|
+
|
|
8
12
|
apply(compiler: Compiler) {
|
|
9
13
|
compiler.hooks.compilation.tap(this.name, (_compilation, { normalModuleFactory }) => {
|
|
10
14
|
normalModuleFactory.hooks.beforeResolve.tap(this.name, (resolveData) => {
|
|
@@ -12,6 +16,12 @@ export class FixMfDataUriPlugin implements RspackPluginInstance {
|
|
|
12
16
|
if (!resolveData.request.includes(MF_DATA_URI_MARKER)) return;
|
|
13
17
|
this.reencodeDataUri(resolveData);
|
|
14
18
|
});
|
|
19
|
+
normalModuleFactory.hooks.resolve.tap(this.name, (resolveData) => {
|
|
20
|
+
const target = this.redirects.get(resolveData?.request ?? "");
|
|
21
|
+
if (target) {
|
|
22
|
+
resolveData.request = target;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
15
25
|
});
|
|
16
26
|
}
|
|
17
27
|
|
|
@@ -24,22 +34,23 @@ export class FixMfDataUriPlugin implements RspackPluginInstance {
|
|
|
24
34
|
const prefix = request.substring(0, contentStart);
|
|
25
35
|
const rawContent = request.substring(contentStart);
|
|
26
36
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
37
|
+
// The MF runtime's and rsbuild's generated data-URI modules import their
|
|
38
|
+
// runtime pieces by absolute node_modules paths (`require.resolve` output),
|
|
39
|
+
// which differ per machine. Rewriting them to bare specifiers keeps the
|
|
40
|
+
// module — and therefore the module id space — machine-independent; the
|
|
41
|
+
// recorded redirects resolve those specifiers back to this machine's
|
|
42
|
+
// on-disk copies while the request (and thus the module id) stays bare.
|
|
43
|
+
const decoded = safeDecode(rawContent).replace(
|
|
44
|
+
NODE_MODULES_IMPORT_RE,
|
|
45
|
+
(match, _quote: string, rest: string) => {
|
|
46
|
+
this.redirects.set(rest, match.slice(1, -1));
|
|
47
|
+
return _quote + rest + _quote;
|
|
48
|
+
},
|
|
49
|
+
);
|
|
30
50
|
resolveData.request = prefix + encodeURIComponent(decoded);
|
|
31
51
|
}
|
|
32
52
|
}
|
|
33
53
|
|
|
34
|
-
function isAlreadyEncoded(content: string): boolean {
|
|
35
|
-
try {
|
|
36
|
-
const decoded = decodeURIComponent(content);
|
|
37
|
-
return decoded !== content;
|
|
38
|
-
} catch {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
54
|
function safeDecode(content: string): string {
|
|
44
55
|
try {
|
|
45
56
|
return decodeURIComponent(content);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
import { findBosConfigPath } from "./compose";
|
|
5
|
+
|
|
6
|
+
export { findBosConfigPath };
|
|
7
|
+
|
|
8
|
+
function generatedRspackConfig(hasOverrides: boolean): string {
|
|
9
|
+
return `import { createPluginBaseConfig } from "every-plugin/build/rspack";
|
|
10
|
+
${hasOverrides ? `import buildOverrides from "../build.config.ts";\n` : ""}
|
|
11
|
+
export default createPluginBaseConfig(${hasOverrides ? "buildOverrides" : "{}"});
|
|
12
|
+
`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Ensures the synthesized rspack config exists for workspaces that no longer
|
|
17
|
+
* ship their own `rspack.config.js`. Returns the workspace-relative config
|
|
18
|
+
* path to pass via `--config`, or `null` when the workspace has its own
|
|
19
|
+
* `rspack.config.js` and bare `rspack build` should be used.
|
|
20
|
+
*/
|
|
21
|
+
export function ensureGeneratedRspackConfig(cwd: string = process.cwd()): string | null {
|
|
22
|
+
if (fs.existsSync(path.join(cwd, "rspack.config.js"))) return null;
|
|
23
|
+
|
|
24
|
+
const overridesPath = path.resolve(cwd, "build.config.ts");
|
|
25
|
+
const hasOverrides = fs.existsSync(overridesPath);
|
|
26
|
+
const generatedDir = path.join(cwd, ".every-plugin");
|
|
27
|
+
const generatedConfig = path.join(generatedDir, "rspack.config.generated.mjs");
|
|
28
|
+
fs.mkdirSync(generatedDir, { recursive: true });
|
|
29
|
+
fs.writeFileSync(generatedConfig, generatedRspackConfig(hasOverrides));
|
|
30
|
+
|
|
31
|
+
console.log(
|
|
32
|
+
"[every-plugin] rspack.config.js not found — using the every-plugin build composition.",
|
|
33
|
+
);
|
|
34
|
+
return path.join(".every-plugin", "rspack.config.generated.mjs");
|
|
35
|
+
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
export {
|
|
2
|
-
getMajorMinorVersion,
|
|
3
2
|
getPluginSharedDependencies,
|
|
4
|
-
|
|
3
|
+
isEffectCriticalSharedDep,
|
|
5
4
|
type SharedDependencies,
|
|
6
5
|
type SharedDependencyConfig,
|
|
7
|
-
} from "
|
|
6
|
+
} from "../../shared-deps-spec";
|
|
7
|
+
export { BuildReportPlugin } from "./build-report-plugin";
|
|
8
|
+
export {
|
|
9
|
+
createPluginBaseConfig,
|
|
10
|
+
type PluginBaseConfig,
|
|
11
|
+
type PluginBaseConfigOptions,
|
|
12
|
+
} from "./compose";
|
|
8
13
|
export { FixMfDataUriPlugin } from "./fix-mf-data-uri-plugin";
|
|
9
14
|
export {
|
|
10
15
|
EmitPluginManifest,
|
|
11
|
-
|
|
12
|
-
type
|
|
16
|
+
EveryPluginBuild,
|
|
17
|
+
type EveryPluginBuildOptions,
|
|
13
18
|
type PluginManifestEmitterOptions,
|
|
14
19
|
} from "./plugin";
|
|
@@ -3,26 +3,25 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { ModuleFederationPlugin } from "@module-federation/enhanced/rspack";
|
|
5
5
|
import type { Compiler, RspackPluginInstance } from "@rspack/core";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
DEV_ENTRY_FILENAME,
|
|
8
|
+
findHashedEntry,
|
|
9
|
+
isBuildInvocation,
|
|
10
|
+
uiEntryFilename,
|
|
11
|
+
} from "../artifact-names";
|
|
12
|
+
import { CONTRACT_TYPES_FILE, generateContractTypes } from "../contract-types";
|
|
13
|
+
import { BuildReportPlugin } from "./build-report-plugin";
|
|
14
|
+
import { ChunkCompletenessPlugin } from "./chunk-completeness-plugin";
|
|
7
15
|
import { buildSharedDependencies } from "./module-federation";
|
|
8
|
-
import { getPluginInfo
|
|
16
|
+
import { getPluginInfo } from "./utils";
|
|
9
17
|
|
|
10
|
-
export interface
|
|
11
|
-
devConfigPath?: string;
|
|
12
|
-
port?: number;
|
|
13
|
-
pluginId?: string;
|
|
18
|
+
export interface EveryPluginBuildOptions {
|
|
14
19
|
dts?: boolean;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
export interface AdditionalExport {
|
|
18
|
-
srcPath: string;
|
|
19
|
-
exportNames: string[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
22
|
export interface PluginManifestEmitterOptions {
|
|
23
23
|
manifestFileName?: string;
|
|
24
24
|
contractFileName?: string;
|
|
25
|
-
additionalExports?: AdditionalExport[];
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
export class EmitPluginManifest implements RspackPluginInstance {
|
|
@@ -42,9 +41,22 @@ export class EmitPluginManifest implements RspackPluginInstance {
|
|
|
42
41
|
const contractFileName = this.options.contractFileName ?? "contract.d.ts";
|
|
43
42
|
const manifestFileName = this.options.manifestFileName ?? "plugin.manifest.json";
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
let generationError: string | null = null;
|
|
45
|
+
try {
|
|
46
|
+
const status = await generateContractTypes(context);
|
|
47
|
+
if (status === "generated") {
|
|
48
|
+
console.log(`[EmitPluginManifest] Contract types regenerated (${context}).`);
|
|
49
|
+
}
|
|
50
|
+
} catch (error) {
|
|
51
|
+
generationError = error instanceof Error ? error.message : String(error);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (generationError) {
|
|
55
|
+
console.warn(`[EmitPluginManifest] Skipping manifest generation — ${generationError}`);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
const sourceContractPath = path.join(context, CONTRACT_TYPES_FILE);
|
|
48
60
|
|
|
49
61
|
const tryReadFile = async (filePath: string): Promise<string | null> => {
|
|
50
62
|
if (!fs.existsSync(filePath)) {
|
|
@@ -61,24 +73,18 @@ export class EmitPluginManifest implements RspackPluginInstance {
|
|
|
61
73
|
}
|
|
62
74
|
};
|
|
63
75
|
|
|
64
|
-
contractTypes = (await tryReadFile(sourceContractPath)) ?? "";
|
|
76
|
+
const contractTypes = (await tryReadFile(sourceContractPath)) ?? "";
|
|
65
77
|
|
|
66
78
|
if (!contractTypes) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!contractTypes) {
|
|
73
|
-
console.warn(
|
|
74
|
-
`[EmitPluginManifest] Contract file not found at ${sourceContractPath} or ${nestedPath}. ` +
|
|
75
|
-
`Skipping manifest generation.`,
|
|
76
|
-
);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
+
console.warn(
|
|
80
|
+
`[EmitPluginManifest] No contract types at ${sourceContractPath} ` +
|
|
81
|
+
`(no src/contract.ts in this workspace?). Skipping manifest generation.`,
|
|
82
|
+
);
|
|
83
|
+
return;
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
const contractSha256 = crypto.createHash("sha256").update(contractTypes).digest("hex");
|
|
87
|
+
const hashedEntry = findHashedEntry(Object.keys(compilation.assets), "remoteEntry");
|
|
82
88
|
const manifest: Record<string, unknown> = {
|
|
83
89
|
schemaVersion: 1,
|
|
84
90
|
kind: "every-plugin/manifest",
|
|
@@ -87,7 +93,7 @@ export class EmitPluginManifest implements RspackPluginInstance {
|
|
|
87
93
|
version: pluginInfo.version,
|
|
88
94
|
},
|
|
89
95
|
runtime: {
|
|
90
|
-
remoteEntry:
|
|
96
|
+
remoteEntry: `./${hashedEntry ?? DEV_ENTRY_FILENAME}`,
|
|
91
97
|
},
|
|
92
98
|
contract: {
|
|
93
99
|
kind: "orpc",
|
|
@@ -100,37 +106,6 @@ export class EmitPluginManifest implements RspackPluginInstance {
|
|
|
100
106
|
},
|
|
101
107
|
};
|
|
102
108
|
|
|
103
|
-
const additionalExportsEntries: Array<{ path: string; exports: string[]; sha256: string }> =
|
|
104
|
-
[];
|
|
105
|
-
|
|
106
|
-
if (this.options.additionalExports?.length) {
|
|
107
|
-
for (const additional of this.options.additionalExports) {
|
|
108
|
-
const sourcePath = path.join(context, "types", additional.srcPath);
|
|
109
|
-
const content = await tryReadFile(sourcePath);
|
|
110
|
-
if (!content) {
|
|
111
|
-
console.warn(
|
|
112
|
-
`[EmitPluginManifest] Additional export file not found at ${sourcePath}. Skipping.`,
|
|
113
|
-
);
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
const sha256 = crypto.createHash("sha256").update(content).digest("hex");
|
|
117
|
-
const distPath = `./types/${additional.srcPath}`;
|
|
118
|
-
additionalExportsEntries.push({
|
|
119
|
-
path: distPath,
|
|
120
|
-
exports: additional.exportNames,
|
|
121
|
-
sha256,
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
if (rawSource) {
|
|
125
|
-
compilation.emitAsset(`types/${additional.srcPath}`, new rawSource(content));
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (additionalExportsEntries.length > 0) {
|
|
130
|
-
manifest.additionalExports = additionalExportsEntries;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
109
|
if (rawSource) {
|
|
135
110
|
compilation.emitAsset(
|
|
136
111
|
manifestFileName,
|
|
@@ -143,27 +118,19 @@ export class EmitPluginManifest implements RspackPluginInstance {
|
|
|
143
118
|
}
|
|
144
119
|
}
|
|
145
120
|
|
|
146
|
-
export class
|
|
147
|
-
name = "
|
|
121
|
+
export class EveryPluginBuild implements RspackPluginInstance {
|
|
122
|
+
name = "EveryPluginBuild";
|
|
148
123
|
|
|
149
|
-
constructor(private options:
|
|
124
|
+
constructor(private options: EveryPluginBuildOptions = {}) {}
|
|
150
125
|
|
|
151
126
|
apply(compiler: Compiler) {
|
|
152
127
|
const pluginInfo = getPluginInfo(compiler.options.context || process.cwd());
|
|
153
|
-
const devConfig = loadDevConfig(this.options.devConfigPath || "./plugin.dev.ts");
|
|
154
|
-
const port = Number(process.env.PORT) || this.options.port || devConfig?.port || 3999;
|
|
155
128
|
|
|
156
129
|
this.configureDefaults(compiler, pluginInfo);
|
|
157
130
|
|
|
158
|
-
if (!compiler.options.devServer) {
|
|
159
|
-
compiler.options.devServer = {};
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
this.configureDevServer(compiler, pluginInfo, devConfig, port);
|
|
163
|
-
|
|
164
131
|
new ModuleFederationPlugin({
|
|
165
132
|
name: pluginInfo.normalizedName,
|
|
166
|
-
filename:
|
|
133
|
+
filename: uiEntryFilename({ isBuild: isBuildInvocation() }),
|
|
167
134
|
dts: this.options.dts !== false,
|
|
168
135
|
manifest: {},
|
|
169
136
|
runtimePlugins: [require.resolve("@module-federation/node/runtimePlugin")],
|
|
@@ -175,6 +142,9 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
175
142
|
shareStrategy: "version-first",
|
|
176
143
|
}).apply(compiler);
|
|
177
144
|
|
|
145
|
+
new BuildReportPlugin().apply(compiler);
|
|
146
|
+
new ChunkCompletenessPlugin().apply(compiler);
|
|
147
|
+
|
|
178
148
|
if (this.options.dts === false) {
|
|
179
149
|
compiler.options.plugins = (compiler.options.plugins ?? []).filter(
|
|
180
150
|
(p) =>
|
|
@@ -194,7 +164,10 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
194
164
|
compiler.options.output.uniqueName = pluginInfo.normalizedName;
|
|
195
165
|
compiler.options.output.publicPath = "auto";
|
|
196
166
|
compiler.options.output.path = path.resolve(context, "dist");
|
|
197
|
-
|
|
167
|
+
// Watch rebuilds must not wipe dist: the dev serve static handler serves
|
|
168
|
+
// this directory, and a clean on every rebuild opens a window where
|
|
169
|
+
// remoteEntry.js 404s for any consumer that loads mid-rebuild.
|
|
170
|
+
compiler.options.output.clean = !compiler.options.watch;
|
|
198
171
|
compiler.options.output.library = { type: "commonjs-module" };
|
|
199
172
|
|
|
200
173
|
if (!compiler.options.target) {
|
|
@@ -217,11 +190,38 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
217
190
|
|
|
218
191
|
this.ensureTypeScriptLoader(compiler);
|
|
219
192
|
|
|
193
|
+
if (!compiler.options.optimization) {
|
|
194
|
+
compiler.options.optimization = {};
|
|
195
|
+
}
|
|
196
|
+
// rspack 2.x splitChunks re-ids the final chunk graph while the federation
|
|
197
|
+
// get-factory codegen keeps pre-split ids — the entry then references
|
|
198
|
+
// chunks that were never emitted (ChunkCompletenessPlugin's exact failure
|
|
199
|
+
// mode). Splitting off keeps the emitted bundle self-consistent.
|
|
200
|
+
compiler.options.optimization.splitChunks = false;
|
|
201
|
+
// The default deterministic module ids hash module identifiers that embed
|
|
202
|
+
// absolute resource paths, so the same source builds to different id
|
|
203
|
+
// spaces on different machines (host deploy train vs the image's
|
|
204
|
+
// dist-builder stage). A mixed-generation load — CDN-pinned entry +
|
|
205
|
+
// staged chunks — then splices two incompatible id spaces and fails with
|
|
206
|
+
// "__webpack_modules__[r] is not a function". Named ids derive from
|
|
207
|
+
// context-relative requests, keeping builds machine-independent and the
|
|
208
|
+
// two generations semantically identical.
|
|
209
|
+
compiler.options.optimization.moduleIds = "named";
|
|
210
|
+
|
|
220
211
|
if (!compiler.options.resolve) {
|
|
221
212
|
compiler.options.resolve = {};
|
|
222
213
|
}
|
|
223
214
|
compiler.options.resolve.extensions = ["...", ".tsx", ".ts"];
|
|
215
|
+
// Source-first for local flows: resolve framework packages through the
|
|
216
|
+
// `development` export condition (TS source) unless DEPLOY=true — the
|
|
217
|
+
// manual dist-first switch deploy-identical builds opt into. (NODE_ENV
|
|
218
|
+
// is unusable as the gate here: the rspack CLI defaults it to
|
|
219
|
+
// "production" for every `build` invocation, including local dev watch.)
|
|
220
|
+
// byDependency entries inherit the root conditions via "...", so
|
|
221
|
+
// dropping the strip lets esm/cjs deps pick up `development` too.
|
|
222
|
+
const sourceFirst = process.env.DEPLOY !== "true";
|
|
224
223
|
compiler.options.resolve.conditionNames = [
|
|
224
|
+
...(sourceFirst ? ["development"] : []),
|
|
225
225
|
"webpack",
|
|
226
226
|
"import",
|
|
227
227
|
"module",
|
|
@@ -229,7 +229,18 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
229
229
|
"node",
|
|
230
230
|
"default",
|
|
231
231
|
];
|
|
232
|
-
if (
|
|
232
|
+
if (sourceFirst) {
|
|
233
|
+
// Source-resolved TS packages (e.g. better-near-auth) use node-style
|
|
234
|
+
// `.js` specifiers for their own relative imports; map them to the
|
|
235
|
+
// on-disk `.ts` sources. `.js` stays first in the expansion: the alias
|
|
236
|
+
// picks the first target that exists on disk, and .ts-first made
|
|
237
|
+
// packages that also ship index.ts (e.g. @scure/base) resolve their
|
|
238
|
+
// TypeScript over their real JavaScript entry.
|
|
239
|
+
compiler.options.resolve.extensionAlias = {
|
|
240
|
+
".js": [".js", ".ts", ".tsx"],
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (!sourceFirst && compiler.options.resolve.byDependency) {
|
|
233
244
|
for (const depType of Object.keys(compiler.options.resolve.byDependency)) {
|
|
234
245
|
const depConfig = (
|
|
235
246
|
compiler.options.resolve.byDependency as Record<string, { conditionNames?: string[] }>
|
|
@@ -255,6 +266,25 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
255
266
|
compiler.options.module.rules = [];
|
|
256
267
|
}
|
|
257
268
|
|
|
269
|
+
// Source-first resolution pulls every-plugin src into the graph, which
|
|
270
|
+
// imports package.json (runtime/mf-config.ts). The MF shared chunks
|
|
271
|
+
// must emit it as a json module, not parse it as JavaScript.
|
|
272
|
+
const hasJsonRule = compiler.options.module.rules.some(
|
|
273
|
+
(rule: any) =>
|
|
274
|
+
typeof rule === "object" &&
|
|
275
|
+
rule !== null &&
|
|
276
|
+
"test" in rule &&
|
|
277
|
+
rule.test instanceof RegExp &&
|
|
278
|
+
rule.test.test(".json"),
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
if (!hasJsonRule) {
|
|
282
|
+
compiler.options.module.rules.push({
|
|
283
|
+
test: /\.json$/,
|
|
284
|
+
type: "json",
|
|
285
|
+
} as any);
|
|
286
|
+
}
|
|
287
|
+
|
|
258
288
|
const hasTsLoader = compiler.options.module.rules.some(
|
|
259
289
|
(rule: any) =>
|
|
260
290
|
typeof rule === "object" &&
|
|
@@ -272,36 +302,4 @@ export class EveryPluginDevServer implements RspackPluginInstance {
|
|
|
272
302
|
});
|
|
273
303
|
}
|
|
274
304
|
}
|
|
275
|
-
|
|
276
|
-
private configureDevServer(compiler: Compiler, pluginInfo: any, devConfig: any, port: number) {
|
|
277
|
-
if (!compiler.options.devServer) {
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
const context = compiler.options.context || process.cwd();
|
|
282
|
-
const originalSetup = compiler.options.devServer.setupMiddlewares;
|
|
283
|
-
|
|
284
|
-
compiler.options.devServer.port = port;
|
|
285
|
-
compiler.options.devServer.static = path.join(context, "dist");
|
|
286
|
-
compiler.options.devServer.hot = true;
|
|
287
|
-
compiler.options.devServer.devMiddleware = { writeToDisk: true };
|
|
288
|
-
compiler.options.devServer.headers = {
|
|
289
|
-
"Access-Control-Allow-Origin": "*",
|
|
290
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
291
|
-
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
compiler.options.devServer.client = {
|
|
295
|
-
logging: "warn",
|
|
296
|
-
overlay: {
|
|
297
|
-
warnings: false,
|
|
298
|
-
errors: true,
|
|
299
|
-
},
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
compiler.options.devServer.setupMiddlewares = (middlewares, devServer) => {
|
|
303
|
-
setupPluginMiddleware(devServer, pluginInfo, devConfig, port);
|
|
304
|
-
return originalSetup ? originalSetup(middlewares, devServer) : middlewares;
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
305
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import path from "node:path";
|
|
3
|
-
import {
|
|
4
|
+
import { remoteName } from "../../identity";
|
|
5
|
+
|
|
6
|
+
// Bare `require` only exists under bun's ESM; node ESM needs an explicit
|
|
7
|
+
// binding. tsx patches the module loader, so this require still loads the
|
|
8
|
+
// plugin.dev.ts source.
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
4
10
|
|
|
5
11
|
export interface PluginInfo {
|
|
6
12
|
name: string;
|
|
@@ -17,7 +23,7 @@ export function getPluginInfo(context: string): PluginInfo {
|
|
|
17
23
|
return {
|
|
18
24
|
name: pkg.name,
|
|
19
25
|
version: pkg.version,
|
|
20
|
-
normalizedName:
|
|
26
|
+
normalizedName: remoteName(pkg.name),
|
|
21
27
|
dependencies: pkg.dependencies || {},
|
|
22
28
|
peerDependencies: pkg.peerDependencies || {},
|
|
23
29
|
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core ui's rsbuild factory — the workspace-form counterpart of
|
|
3
|
+
* `createUiRsbuildConfig` (folder-form plugin uis). The config object the
|
|
4
|
+
* generated `.every-plugin/ui.rsbuild.config.generated.mjs` materializes:
|
|
5
|
+
* the APP_NAME/APP_ACCOUNT defines come from the authored config through
|
|
6
|
+
* `readAuthoredConfigInput` (everything-dev/config), which the generated
|
|
7
|
+
* file loads in the workspace's own module graph.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { CORE_UI_PLUGIN_KEY } from "../../ui/manifest/contract";
|
|
13
|
+
import { createUiRsbuildConfig } from "./rsbuild-config";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The platform skill family ships inside the framework packages' npm tarballs
|
|
17
|
+
* (`files: ["skills"]`), so resolving them from `node_modules` gives the core
|
|
18
|
+
* ui the same copies in the parent workspace (pnpm symlinks) and every
|
|
19
|
+
* generated child repo (published tarball). Served at `/skills/<pkg>/<skill>`.
|
|
20
|
+
*/
|
|
21
|
+
const SKILL_PACKAGES = ["everything-dev", "every-plugin", "better-near-auth"] as const;
|
|
22
|
+
|
|
23
|
+
export function platformSkillCopies(workspaceRoot: string): Array<{
|
|
24
|
+
from: string;
|
|
25
|
+
to: string;
|
|
26
|
+
globOptions: { ignore: string[] };
|
|
27
|
+
}> {
|
|
28
|
+
return SKILL_PACKAGES.flatMap((name) => {
|
|
29
|
+
const from = path.join(workspaceRoot, "node_modules", name, "skills");
|
|
30
|
+
return fs.existsSync(from)
|
|
31
|
+
? [
|
|
32
|
+
{
|
|
33
|
+
from,
|
|
34
|
+
to: `./skills/${name}`,
|
|
35
|
+
globOptions: { ignore: ["**/_artifacts/**"] },
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
: [];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface CoreUiRsbuildConfigInput {
|
|
43
|
+
/** Authored config domain — stamped as `import.meta.env.APP_NAME`. */
|
|
44
|
+
domain?: string;
|
|
45
|
+
/** Authored config account — stamped as `import.meta.env.APP_ACCOUNT`. */
|
|
46
|
+
account?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The core ui's MF build surface — entry points and the declared exposes
|
|
51
|
+
* (ADR 0008 §2). Entries and the bootstrap exposes resolve to GENERATED
|
|
52
|
+
* stubs (ADR 0023); only surfaces with consumers are declared: the browser
|
|
53
|
+
* bootstrap, the shared component barrel, the SSR router module, the
|
|
54
|
+
* composition engine, and the generated route config.
|
|
55
|
+
*/
|
|
56
|
+
export const CORE_UI_WEB_ENTRY = "./src/entry.gen.ts";
|
|
57
|
+
|
|
58
|
+
export const CORE_UI_WEB_EXPOSES: Record<string, string> = {
|
|
59
|
+
"./Hydrate": "./src/hydrate.gen.tsx",
|
|
60
|
+
"./components": "./src/components/index.ts",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const CORE_UI_NODE_ENTRY = "./src/router.server.gen.tsx";
|
|
64
|
+
|
|
65
|
+
export const CORE_UI_NODE_EXPOSES: Record<string, string> = {
|
|
66
|
+
"./Router": "./src/router.server.gen.tsx",
|
|
67
|
+
"./compose": "./src/compose.gen.ts",
|
|
68
|
+
"./routeConfig": "./src/routeConfig.gen.ts",
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export function createCoreUiRsbuildConfig({ domain, account }: CoreUiRsbuildConfigInput = {}) {
|
|
72
|
+
const workspaceRoot = process.cwd();
|
|
73
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(workspaceRoot, "package.json"), "utf-8")) as {
|
|
74
|
+
name: string;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
return createUiRsbuildConfig({
|
|
78
|
+
workspaceRoot,
|
|
79
|
+
pkg,
|
|
80
|
+
role: "provider",
|
|
81
|
+
manifestName: CORE_UI_PLUGIN_KEY,
|
|
82
|
+
devPort: 3003,
|
|
83
|
+
webEntry: CORE_UI_WEB_ENTRY,
|
|
84
|
+
webExposes: CORE_UI_WEB_EXPOSES,
|
|
85
|
+
nodeEntry: CORE_UI_NODE_ENTRY,
|
|
86
|
+
nodeExposes: CORE_UI_NODE_EXPOSES,
|
|
87
|
+
copy: [
|
|
88
|
+
{ from: path.join(workspaceRoot, "public"), to: "./" },
|
|
89
|
+
...platformSkillCopies(workspaceRoot),
|
|
90
|
+
],
|
|
91
|
+
define: {
|
|
92
|
+
"import.meta.env.APP_NAME": JSON.stringify(domain),
|
|
93
|
+
"import.meta.env.APP_ACCOUNT": JSON.stringify(account),
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|