@bleedingdev/modern-js-create 3.5.0-ultramodern.30 → 3.5.0-ultramodern.31
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/dist/cjs/cli/flags.cjs +326 -0
- package/dist/cjs/cli/help.cjs +106 -0
- package/dist/cjs/cli/package-source.cjs +186 -0
- package/dist/cjs/cli/project-setup.cjs +138 -0
- package/dist/cjs/cli/prompts.cjs +118 -0
- package/dist/cjs/index.cjs +24 -581
- package/dist/cjs/ultramodern-tooling/commands/cloudflare-output-verify.cjs +132 -0
- package/dist/cjs/ultramodern-tooling/commands/context.cjs +131 -0
- package/dist/cjs/ultramodern-tooling/commands/mf-types.cjs +55 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.cjs +158 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.cjs +49 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.cjs +87 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.cjs +58 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.cjs +62 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.cjs +60 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.cjs +132 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.cjs +67 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.cjs +93 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.cjs +60 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.cjs +67 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.cjs +67 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/help.cjs +54 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/install.cjs +52 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/io.cjs +133 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.cjs +219 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/package-source.cjs +76 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.cjs +131 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.cjs +161 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.cjs +88 -0
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect.cjs +149 -0
- package/dist/cjs/ultramodern-tooling/commands/options.cjs +59 -0
- package/dist/cjs/ultramodern-tooling/commands/routes-generate.cjs +122 -0
- package/dist/cjs/ultramodern-tooling/commands/skills.cjs +49 -0
- package/dist/cjs/ultramodern-tooling/commands/sync-delivery-unit.cjs +40 -0
- package/dist/cjs/ultramodern-tooling/commands/validate.cjs +49 -0
- package/dist/cjs/ultramodern-tooling/commands.cjs +17 -1165
- package/dist/cjs/ultramodern-tooling/config/constants.cjs +48 -0
- package/dist/cjs/ultramodern-tooling/config/index.cjs +104 -0
- package/dist/cjs/ultramodern-tooling/config/json.cjs +61 -0
- package/dist/cjs/ultramodern-tooling/config/load.cjs +62 -0
- package/dist/cjs/ultramodern-tooling/config/metadata.cjs +92 -0
- package/dist/cjs/ultramodern-tooling/config/normalize.cjs +160 -0
- package/dist/cjs/ultramodern-tooling/config/synthesize.cjs +157 -0
- package/dist/cjs/ultramodern-tooling/config/types.cjs +18 -0
- package/dist/cjs/ultramodern-tooling/config.cjs +23 -274
- package/dist/cjs/ultramodern-workspace/add-vertical/constants.cjs +52 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/execute.cjs +156 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/plan.cjs +246 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/preflight.cjs +198 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/shell-files.cjs +116 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/topology.cjs +133 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/workspace-state.cjs +107 -0
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +22 -596
- package/dist/cjs/ultramodern-workspace/api/checkout-cart.cjs +145 -0
- package/dist/cjs/ultramodern-workspace/api/client.cjs +218 -0
- package/dist/cjs/ultramodern-workspace/api/contracts.cjs +222 -0
- package/dist/cjs/ultramodern-workspace/api/names.cjs +98 -0
- package/dist/cjs/ultramodern-workspace/api/service.cjs +220 -0
- package/dist/cjs/ultramodern-workspace/api/shared.cjs +252 -0
- package/dist/cjs/ultramodern-workspace/api.cjs +27 -1046
- package/dist/cjs/ultramodern-workspace/app-files.cjs +3 -18
- package/dist/cjs/ultramodern-workspace/backend-federation.cjs +38 -24
- package/dist/cjs/ultramodern-workspace/bridge-config/cli.cjs +71 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/defaults.cjs +43 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/gates.cjs +93 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/index.cjs +60 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/normalize.cjs +68 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/schema.cjs +78 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/shared.cjs +110 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/validation.cjs +68 -0
- package/dist/cjs/ultramodern-workspace/bridge-config/workspace-packages.cjs +108 -0
- package/dist/cjs/ultramodern-workspace/bridge-config.cjs +32 -297
- package/dist/cjs/ultramodern-workspace/delivery-unit-sync.cjs +22 -20
- package/dist/cjs/ultramodern-workspace/delivery-unit.cjs +7 -20
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +47 -189
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +12 -1
- package/dist/cjs/ultramodern-workspace/effect-diagnostics.cjs +114 -0
- package/dist/cjs/ultramodern-workspace/fs-io.cjs +24 -2
- package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/constants.cjs +69 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/discovery.cjs +77 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/inspect.cjs +92 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/object-literal.cjs +203 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/path-utils.cjs +171 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/syntax.cjs +228 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/types.cjs +18 -0
- package/dist/cjs/ultramodern-workspace/mf-validation/validate.cjs +112 -0
- package/dist/cjs/ultramodern-workspace/mf-validation.cjs +6 -529
- package/dist/cjs/ultramodern-workspace/module-federation/config.cjs +251 -0
- package/dist/cjs/ultramodern-workspace/module-federation/index.cjs +73 -0
- package/dist/cjs/ultramodern-workspace/module-federation/reexport-module.cjs +73 -0
- package/dist/cjs/ultramodern-workspace/module-federation/remote-refs.cjs +105 -0
- package/dist/cjs/ultramodern-workspace/module-federation/shared-config.cjs +53 -0
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +14 -584
- package/dist/cjs/ultramodern-workspace/package-json.cjs +13 -229
- package/dist/cjs/ultramodern-workspace/routes.cjs +8 -142
- package/dist/cjs/ultramodern-workspace/shared-patches.cjs +44 -0
- package/dist/cjs/ultramodern-workspace/tsconfigs.cjs +199 -0
- package/dist/cjs/ultramodern-workspace/workspace-script-plan.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/write-app.cjs +128 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +4 -61
- package/dist/cjs/ultramodern-workspace/zerops.cjs +13 -10
- package/dist/esm/cli/flags.js +228 -0
- package/dist/esm/cli/help.js +65 -0
- package/dist/esm/cli/package-source.js +119 -0
- package/dist/esm/cli/project-setup.js +81 -0
- package/dist/esm/cli/prompts.js +63 -0
- package/dist/esm/index.js +6 -559
- package/dist/esm/ultramodern-tooling/commands/cloudflare-output-verify.js +84 -0
- package/dist/esm/ultramodern-tooling/commands/context.js +66 -0
- package/dist/esm/ultramodern-tooling/commands/mf-types.js +17 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.js +106 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +11 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.js +38 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.js +10 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +14 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +12 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.js +83 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.js +16 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.js +44 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.js +12 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.js +7 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.js +15 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/help.js +16 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/install.js +14 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/io.js +69 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +175 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/package-source.js +38 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +76 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +105 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +16 -0
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect.js +100 -0
- package/dist/esm/ultramodern-tooling/commands/options.js +18 -0
- package/dist/esm/ultramodern-tooling/commands/routes-generate.js +74 -0
- package/dist/esm/ultramodern-tooling/commands/skills.js +11 -0
- package/dist/esm/ultramodern-tooling/commands/sync-delivery-unit.js +1 -0
- package/dist/esm/ultramodern-tooling/commands/validate.js +11 -0
- package/dist/esm/ultramodern-tooling/commands.js +9 -1152
- package/dist/esm/ultramodern-tooling/config/constants.js +4 -0
- package/dist/esm/ultramodern-tooling/config/index.js +7 -0
- package/dist/esm/ultramodern-tooling/config/json.js +10 -0
- package/dist/esm/ultramodern-tooling/config/load.js +13 -0
- package/dist/esm/ultramodern-tooling/config/metadata.js +37 -0
- package/dist/esm/ultramodern-tooling/config/normalize.js +106 -0
- package/dist/esm/ultramodern-tooling/config/synthesize.js +108 -0
- package/dist/esm/ultramodern-tooling/config/types.js +0 -0
- package/dist/esm/ultramodern-tooling/config.js +1 -255
- package/dist/esm/ultramodern-workspace/add-vertical/constants.js +5 -0
- package/dist/esm/ultramodern-workspace/add-vertical/execute.js +108 -0
- package/dist/esm/ultramodern-workspace/add-vertical/plan.js +184 -0
- package/dist/esm/ultramodern-workspace/add-vertical/preflight.js +122 -0
- package/dist/esm/ultramodern-workspace/add-vertical/shell-files.js +59 -0
- package/dist/esm/ultramodern-workspace/add-vertical/topology.js +89 -0
- package/dist/esm/ultramodern-workspace/add-vertical/workspace-state.js +43 -0
- package/dist/esm/ultramodern-workspace/add-vertical.js +6 -569
- package/dist/esm/ultramodern-workspace/api/checkout-cart.js +86 -0
- package/dist/esm/ultramodern-workspace/api/client.js +177 -0
- package/dist/esm/ultramodern-workspace/api/contracts.js +172 -0
- package/dist/esm/ultramodern-workspace/api/names.js +33 -0
- package/dist/esm/ultramodern-workspace/api/service.js +179 -0
- package/dist/esm/ultramodern-workspace/api/shared.js +208 -0
- package/dist/esm/ultramodern-workspace/api.js +5 -1025
- package/dist/esm/ultramodern-workspace/app-files.js +3 -18
- package/dist/esm/ultramodern-workspace/backend-federation.js +27 -13
- package/dist/esm/ultramodern-workspace/bridge-config/cli.js +30 -0
- package/dist/esm/ultramodern-workspace/bridge-config/defaults.js +5 -0
- package/dist/esm/ultramodern-workspace/bridge-config/gates.js +52 -0
- package/dist/esm/ultramodern-workspace/bridge-config/index.js +3 -0
- package/dist/esm/ultramodern-workspace/bridge-config/normalize.js +30 -0
- package/dist/esm/ultramodern-workspace/bridge-config/schema.js +31 -0
- package/dist/esm/ultramodern-workspace/bridge-config/shared.js +51 -0
- package/dist/esm/ultramodern-workspace/bridge-config/validation.js +27 -0
- package/dist/esm/ultramodern-workspace/bridge-config/workspace-packages.js +67 -0
- package/dist/esm/ultramodern-workspace/bridge-config.js +1 -270
- package/dist/esm/ultramodern-workspace/delivery-unit-sync.js +23 -21
- package/dist/esm/ultramodern-workspace/delivery-unit.js +6 -16
- package/dist/esm/ultramodern-workspace/demo-components.js +47 -189
- package/dist/esm/ultramodern-workspace/descriptors.js +12 -1
- package/dist/esm/ultramodern-workspace/effect-diagnostics.js +76 -0
- package/dist/esm/ultramodern-workspace/fs-io.js +24 -2
- package/dist/esm/ultramodern-workspace/index.js +1 -0
- package/dist/esm/ultramodern-workspace/mf-validation/constants.js +19 -0
- package/dist/esm/ultramodern-workspace/mf-validation/discovery.js +28 -0
- package/dist/esm/ultramodern-workspace/mf-validation/inspect.js +45 -0
- package/dist/esm/ultramodern-workspace/mf-validation/object-literal.js +144 -0
- package/dist/esm/ultramodern-workspace/mf-validation/path-utils.js +89 -0
- package/dist/esm/ultramodern-workspace/mf-validation/syntax.js +154 -0
- package/dist/esm/ultramodern-workspace/mf-validation/types.js +0 -0
- package/dist/esm/ultramodern-workspace/mf-validation/validate.js +57 -0
- package/dist/esm/ultramodern-workspace/mf-validation.js +3 -516
- package/dist/esm/ultramodern-workspace/module-federation/config.js +204 -0
- package/dist/esm/ultramodern-workspace/module-federation/index.js +4 -0
- package/dist/esm/ultramodern-workspace/module-federation/reexport-module.js +29 -0
- package/dist/esm/ultramodern-workspace/module-federation/remote-refs.js +64 -0
- package/dist/esm/ultramodern-workspace/module-federation/shared-config.js +12 -0
- package/dist/esm/ultramodern-workspace/module-federation.js +2 -576
- package/dist/esm/ultramodern-workspace/package-json.js +7 -210
- package/dist/esm/ultramodern-workspace/routes.js +8 -142
- package/dist/esm/ultramodern-workspace/shared-patches.js +6 -0
- package/dist/esm/ultramodern-workspace/tsconfigs.js +136 -0
- package/dist/esm/ultramodern-workspace/workspace-script-plan.js +2 -2
- package/dist/esm/ultramodern-workspace/write-app.js +90 -0
- package/dist/esm/ultramodern-workspace/write-workspace.js +4 -61
- package/dist/esm/ultramodern-workspace/zerops.js +13 -10
- package/dist/esm-node/cli/flags.js +229 -0
- package/dist/esm-node/cli/help.js +66 -0
- package/dist/esm-node/cli/package-source.js +120 -0
- package/dist/esm-node/cli/project-setup.js +82 -0
- package/dist/esm-node/cli/prompts.js +64 -0
- package/dist/esm-node/index.js +6 -559
- package/dist/esm-node/ultramodern-tooling/commands/cloudflare-output-verify.js +85 -0
- package/dist/esm-node/ultramodern-tooling/commands/context.js +67 -0
- package/dist/esm-node/ultramodern-tooling/commands/mf-types.js +18 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.js +107 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +12 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.js +39 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.js +11 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +15 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +13 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.js +84 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.js +17 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.js +45 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.js +13 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.js +8 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.js +16 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/help.js +17 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/install.js +15 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/io.js +70 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +176 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/package-source.js +39 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +77 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +106 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +17 -0
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect.js +101 -0
- package/dist/esm-node/ultramodern-tooling/commands/options.js +19 -0
- package/dist/esm-node/ultramodern-tooling/commands/routes-generate.js +75 -0
- package/dist/esm-node/ultramodern-tooling/commands/skills.js +12 -0
- package/dist/esm-node/ultramodern-tooling/commands/sync-delivery-unit.js +2 -0
- package/dist/esm-node/ultramodern-tooling/commands/validate.js +12 -0
- package/dist/esm-node/ultramodern-tooling/commands.js +9 -1152
- package/dist/esm-node/ultramodern-tooling/config/constants.js +5 -0
- package/dist/esm-node/ultramodern-tooling/config/index.js +8 -0
- package/dist/esm-node/ultramodern-tooling/config/json.js +11 -0
- package/dist/esm-node/ultramodern-tooling/config/load.js +14 -0
- package/dist/esm-node/ultramodern-tooling/config/metadata.js +38 -0
- package/dist/esm-node/ultramodern-tooling/config/normalize.js +107 -0
- package/dist/esm-node/ultramodern-tooling/config/synthesize.js +109 -0
- package/dist/esm-node/ultramodern-tooling/config/types.js +1 -0
- package/dist/esm-node/ultramodern-tooling/config.js +1 -255
- package/dist/esm-node/ultramodern-workspace/add-vertical/constants.js +6 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/execute.js +109 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/plan.js +185 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/preflight.js +123 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/shell-files.js +60 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/topology.js +90 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/workspace-state.js +44 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +6 -569
- package/dist/esm-node/ultramodern-workspace/api/checkout-cart.js +87 -0
- package/dist/esm-node/ultramodern-workspace/api/client.js +178 -0
- package/dist/esm-node/ultramodern-workspace/api/contracts.js +173 -0
- package/dist/esm-node/ultramodern-workspace/api/names.js +34 -0
- package/dist/esm-node/ultramodern-workspace/api/service.js +180 -0
- package/dist/esm-node/ultramodern-workspace/api/shared.js +209 -0
- package/dist/esm-node/ultramodern-workspace/api.js +5 -1025
- package/dist/esm-node/ultramodern-workspace/app-files.js +3 -18
- package/dist/esm-node/ultramodern-workspace/backend-federation.js +27 -13
- package/dist/esm-node/ultramodern-workspace/bridge-config/cli.js +31 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/defaults.js +6 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/gates.js +53 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/index.js +4 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/normalize.js +31 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/schema.js +32 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/shared.js +52 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/validation.js +28 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config/workspace-packages.js +68 -0
- package/dist/esm-node/ultramodern-workspace/bridge-config.js +1 -270
- package/dist/esm-node/ultramodern-workspace/delivery-unit-sync.js +23 -21
- package/dist/esm-node/ultramodern-workspace/delivery-unit.js +6 -16
- package/dist/esm-node/ultramodern-workspace/demo-components.js +47 -189
- package/dist/esm-node/ultramodern-workspace/descriptors.js +12 -1
- package/dist/esm-node/ultramodern-workspace/effect-diagnostics.js +77 -0
- package/dist/esm-node/ultramodern-workspace/fs-io.js +24 -2
- package/dist/esm-node/ultramodern-workspace/index.js +1 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/constants.js +20 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/discovery.js +29 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/inspect.js +46 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/object-literal.js +145 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/path-utils.js +90 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/syntax.js +155 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/types.js +1 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/validate.js +58 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation.js +3 -516
- package/dist/esm-node/ultramodern-workspace/module-federation/config.js +205 -0
- package/dist/esm-node/ultramodern-workspace/module-federation/index.js +5 -0
- package/dist/esm-node/ultramodern-workspace/module-federation/reexport-module.js +30 -0
- package/dist/esm-node/ultramodern-workspace/module-federation/remote-refs.js +65 -0
- package/dist/esm-node/ultramodern-workspace/module-federation/shared-config.js +13 -0
- package/dist/esm-node/ultramodern-workspace/module-federation.js +2 -576
- package/dist/esm-node/ultramodern-workspace/package-json.js +7 -210
- package/dist/esm-node/ultramodern-workspace/routes.js +8 -142
- package/dist/esm-node/ultramodern-workspace/shared-patches.js +7 -0
- package/dist/esm-node/ultramodern-workspace/tsconfigs.js +137 -0
- package/dist/esm-node/ultramodern-workspace/workspace-script-plan.js +2 -2
- package/dist/esm-node/ultramodern-workspace/write-app.js +91 -0
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +4 -61
- package/dist/esm-node/ultramodern-workspace/zerops.js +13 -10
- package/dist/types/cli/flags.d.ts +30 -0
- package/dist/types/cli/help.d.ts +2 -0
- package/dist/types/cli/package-source.d.ts +15 -0
- package/dist/types/cli/project-setup.d.ts +8 -0
- package/dist/types/cli/prompts.d.ts +6 -0
- package/dist/types/ultramodern-tooling/commands/cloudflare-output-verify.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/context.d.ts +11 -0
- package/dist/types/ultramodern-tooling/commands/mf-types.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.d.ts +4 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.d.ts +4 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.d.ts +1 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.d.ts +4 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.d.ts +7 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/help.d.ts +1 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/install.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/io.d.ts +14 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.d.ts +9 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/package-source.d.ts +3 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.d.ts +4 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.d.ts +25 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.d.ts +9 -0
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/options.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/routes-generate.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/skills.d.ts +2 -0
- package/dist/types/ultramodern-tooling/commands/sync-delivery-unit.d.ts +1 -0
- package/dist/types/ultramodern-tooling/commands/validate.d.ts +2 -0
- package/dist/types/ultramodern-tooling/config/constants.d.ts +3 -0
- package/dist/types/ultramodern-tooling/config/index.d.ts +7 -0
- package/dist/types/ultramodern-tooling/config/json.d.ts +2 -0
- package/dist/types/ultramodern-tooling/config/load.d.ts +2 -0
- package/dist/types/ultramodern-tooling/config/metadata.d.ts +4 -0
- package/dist/types/ultramodern-tooling/config/normalize.d.ts +5 -0
- package/dist/types/ultramodern-tooling/config/synthesize.d.ts +5 -0
- package/dist/types/ultramodern-tooling/config/types.d.ts +41 -0
- package/dist/types/ultramodern-tooling/config.d.ts +1 -49
- package/dist/types/ultramodern-workspace/add-vertical/constants.d.ts +4 -0
- package/dist/types/ultramodern-workspace/add-vertical/execute.d.ts +2 -0
- package/dist/types/ultramodern-workspace/add-vertical/plan.d.ts +7 -0
- package/dist/types/ultramodern-workspace/add-vertical/preflight.d.ts +28 -0
- package/dist/types/ultramodern-workspace/add-vertical/shell-files.d.ts +6 -0
- package/dist/types/ultramodern-workspace/add-vertical/topology.d.ts +9 -0
- package/dist/types/ultramodern-workspace/add-vertical/workspace-state.d.ts +8 -0
- package/dist/types/ultramodern-workspace/add-vertical.d.ts +7 -39
- package/dist/types/ultramodern-workspace/api/checkout-cart.d.ts +33 -0
- package/dist/types/ultramodern-workspace/api/client.d.ts +6 -0
- package/dist/types/ultramodern-workspace/api/contracts.d.ts +15 -0
- package/dist/types/ultramodern-workspace/api/names.d.ts +41 -0
- package/dist/types/ultramodern-workspace/api/service.d.ts +6 -0
- package/dist/types/ultramodern-workspace/api/shared.d.ts +10 -0
- package/dist/types/ultramodern-workspace/api.d.ts +5 -74
- package/dist/types/ultramodern-workspace/backend-federation.d.ts +2 -2
- package/dist/types/ultramodern-workspace/bridge-config/cli.d.ts +3 -0
- package/dist/types/ultramodern-workspace/bridge-config/defaults.d.ts +1 -0
- package/dist/types/ultramodern-workspace/bridge-config/gates.d.ts +3 -0
- package/dist/types/ultramodern-workspace/bridge-config/index.d.ts +4 -0
- package/dist/types/ultramodern-workspace/bridge-config/normalize.d.ts +2 -0
- package/dist/types/ultramodern-workspace/bridge-config/schema.d.ts +61 -0
- package/dist/types/ultramodern-workspace/bridge-config/shared.d.ts +12 -0
- package/dist/types/ultramodern-workspace/bridge-config/validation.d.ts +3 -0
- package/dist/types/ultramodern-workspace/bridge-config/workspace-packages.d.ts +3 -0
- package/dist/types/ultramodern-workspace/bridge-config.d.ts +1 -64
- package/dist/types/ultramodern-workspace/delivery-unit.d.ts +2 -21
- package/dist/types/ultramodern-workspace/effect-diagnostics.d.ts +1 -0
- package/dist/types/ultramodern-workspace/index.d.ts +1 -0
- package/dist/types/ultramodern-workspace/mf-validation/constants.d.ts +5 -0
- package/dist/types/ultramodern-workspace/mf-validation/discovery.d.ts +2 -0
- package/dist/types/ultramodern-workspace/mf-validation/inspect.d.ts +5 -0
- package/dist/types/ultramodern-workspace/mf-validation/object-literal.d.ts +9 -0
- package/dist/types/ultramodern-workspace/mf-validation/path-utils.d.ts +13 -0
- package/dist/types/ultramodern-workspace/mf-validation/syntax.d.ts +14 -0
- package/dist/types/ultramodern-workspace/mf-validation/types.d.ts +33 -0
- package/dist/types/ultramodern-workspace/mf-validation/validate.d.ts +4 -0
- package/dist/types/ultramodern-workspace/mf-validation.d.ts +4 -27
- package/dist/types/ultramodern-workspace/module-federation/config.d.ts +5 -0
- package/dist/types/ultramodern-workspace/module-federation/index.d.ts +4 -0
- package/dist/types/ultramodern-workspace/module-federation/reexport-module.d.ts +4 -0
- package/dist/types/ultramodern-workspace/module-federation/remote-refs.d.ts +3 -0
- package/dist/types/ultramodern-workspace/module-federation/shared-config.d.ts +2 -0
- package/dist/types/ultramodern-workspace/module-federation.d.ts +1 -11
- package/dist/types/ultramodern-workspace/package-json.d.ts +1 -13
- package/dist/types/ultramodern-workspace/shared-patches.d.ts +2 -0
- package/dist/types/ultramodern-workspace/tsconfigs.d.ts +13 -0
- package/dist/types/ultramodern-workspace/workspace-validation-contract.d.ts +1 -1
- package/dist/types/ultramodern-workspace/write-app.d.ts +3 -0
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +2 -1
- package/package.json +4 -3
- package/templates/workspace/apps/modern.config.shared-module-federation.ts.handlebars +37 -0
- package/templates/workspace/apps/modern.config.ts.handlebars +252 -0
- package/templates/workspace/apps/shared/src/routes/ultramodern-jsonld.ts.handlebars +119 -0
- package/templates/workspace/apps/shared/src/routes/ultramodern-route-metadata.ts.handlebars +21 -0
- package/templates/workspace/apps/shell-super-app/src/routes/[lang]/page.tsx.handlebars +49 -0
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.helpers.tsx.handlebars +79 -0
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.imports.tsx.handlebars +11 -0
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.tsx.handlebars +46 -0
- package/templates/workspace/packages/shared-design-tokens/tokens.css.handlebars +7 -0
- package/templates/workspace/postcss.config.mjs.handlebars +5 -0
- package/templates/workspace/tailwind.config.ts.handlebars +3 -0
- package/templates/workspace/verticals/server/checkout-cart-handlers.ts.handlebars +49 -0
- package/templates/workspace/verticals/server/checkout-cart-state.ts.handlebars +23 -0
- package/templates/workspace/verticals/shared/api.checkout-cart-contract-fields.ts.handlebars +1 -0
- package/templates/workspace/verticals/shared/api.checkout-cart-endpoints.ts.handlebars +23 -0
- package/templates/workspace/verticals/shared/api.checkout-cart-operation-contexts.ts.handlebars +25 -0
- package/templates/workspace/verticals/shared/api.checkout-cart-schemas.ts.handlebars +48 -0
- package/templates/workspace/verticals/src/api/checkout-cart-client-exports.ts.handlebars +70 -0
- package/templates/workspace-scripts/generate-node-backend-federation.mjs +29 -0
- package/templates/workspace-scripts/proof-node-backend-federation.mjs +31 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +74 -40
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
const LEGACY_GENERATED_CONTRACT_PATH = '.modernjs/ultramodern-generated-contract.json';
|
|
3
|
+
const LEGACY_PACKAGE_SOURCE_METADATA_PATH = '.modernjs/ultramodern-package-source.json';
|
|
4
|
+
const LEGACY_DEVELOPMENT_OVERLAY_PATH = 'topology/local-overlays/development.json';
|
|
5
|
+
export { LEGACY_DEVELOPMENT_OVERLAY_PATH, LEGACY_GENERATED_CONTRACT_PATH, LEGACY_PACKAGE_SOURCE_METADATA_PATH };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_fs from "node:fs";
|
|
3
|
+
function readJsonObject(filePath) {
|
|
4
|
+
const value = JSON.parse(node_fs.readFileSync(filePath, 'utf-8'));
|
|
5
|
+
if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error(`UltraModern config must contain a JSON object: ${filePath}`);
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
function readOptionalJsonObject(filePath) {
|
|
9
|
+
return node_fs.existsSync(filePath) ? readJsonObject(filePath) : {};
|
|
10
|
+
}
|
|
11
|
+
export { readJsonObject, readOptionalJsonObject };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_fs from "node:fs";
|
|
3
|
+
import node_path from "node:path";
|
|
4
|
+
import { ULTRAMODERN_CONFIG_PATH } from "../../ultramodern-workspace/descriptors.js";
|
|
5
|
+
import { LEGACY_GENERATED_CONTRACT_PATH } from "./constants.js";
|
|
6
|
+
import { readJsonObject } from "./json.js";
|
|
7
|
+
import { normalizeCompactConfig } from "./normalize.js";
|
|
8
|
+
function readUltramodernConfig(workspaceRoot = process.cwd()) {
|
|
9
|
+
const compactPath = node_path.join(workspaceRoot, ULTRAMODERN_CONFIG_PATH);
|
|
10
|
+
if (node_fs.existsSync(compactPath)) return normalizeCompactConfig(workspaceRoot, compactPath, readJsonObject(compactPath));
|
|
11
|
+
if (node_fs.existsSync(node_path.join(workspaceRoot, LEGACY_GENERATED_CONTRACT_PATH))) throw new Error(`Missing ${ULTRAMODERN_CONFIG_PATH}. Legacy UltraModern metadata detected — run \`modern-js-create ultramodern migrate-strict-effect\` to synthesize it.`);
|
|
12
|
+
throw new Error(`Missing UltraModern config. Expected ${ULTRAMODERN_CONFIG_PATH}. Run \`modern-js-create ultramodern migrate-strict-effect\` if you have legacy UltraModern metadata to migrate.`);
|
|
13
|
+
}
|
|
14
|
+
export { readUltramodernConfig };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_fs from "node:fs";
|
|
3
|
+
import node_path from "node:path";
|
|
4
|
+
import { LEGACY_DEVELOPMENT_OVERLAY_PATH, LEGACY_PACKAGE_SOURCE_METADATA_PATH } from "./constants.js";
|
|
5
|
+
import { readJsonObject, readOptionalJsonObject } from "./json.js";
|
|
6
|
+
function packageScopeFromRoot(workspaceRoot) {
|
|
7
|
+
const rootPackage = readOptionalJsonObject(node_path.join(workspaceRoot, 'package.json'));
|
|
8
|
+
return 'string' == typeof rootPackage.name && rootPackage.name.length > 0 ? rootPackage.name : node_path.basename(workspaceRoot);
|
|
9
|
+
}
|
|
10
|
+
function packageSourceFromMetadata(workspaceRoot) {
|
|
11
|
+
const metadataPath = node_path.join(workspaceRoot, LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
12
|
+
if (!node_fs.existsSync(metadataPath)) return;
|
|
13
|
+
const metadata = readJsonObject(metadataPath);
|
|
14
|
+
const aliases = metadata.modernPackages?.aliases ?? {};
|
|
15
|
+
const firstAliasEntry = Object.entries(aliases).find((entry)=>'string' == typeof entry[1]);
|
|
16
|
+
const firstPackage = firstAliasEntry?.[0];
|
|
17
|
+
const firstAlias = firstAliasEntry?.[1];
|
|
18
|
+
const aliasScope = firstAlias?.match(/^@([^/]+)\//u)?.[1];
|
|
19
|
+
const unscopedName = firstPackage?.split('/').at(-1) ?? '';
|
|
20
|
+
const aliasUnscopedName = firstAlias?.split('/').at(-1) ?? '';
|
|
21
|
+
const aliasPackageNamePrefix = aliasUnscopedName && unscopedName && aliasUnscopedName.endsWith(unscopedName) ? aliasUnscopedName.slice(0, -unscopedName.length) : void 0;
|
|
22
|
+
return {
|
|
23
|
+
strategy: 'install' === metadata.strategy ? 'install' : 'workspace',
|
|
24
|
+
modernPackageVersion: 'string' == typeof metadata.modernPackages?.specifier ? metadata.modernPackages.specifier : 'workspace:*',
|
|
25
|
+
registry: 'string' == typeof metadata.modernPackages?.registry ? metadata.modernPackages.registry : void 0,
|
|
26
|
+
aliasScope,
|
|
27
|
+
aliasPackageNamePrefix
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function readOverlayPorts(workspaceRoot) {
|
|
31
|
+
const overlayPath = node_path.join(workspaceRoot, LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
32
|
+
if (!node_fs.existsSync(overlayPath)) return {};
|
|
33
|
+
const overlay = readJsonObject(overlayPath);
|
|
34
|
+
const ports = overlay.ports;
|
|
35
|
+
if (null === ports || 'object' != typeof ports || Array.isArray(ports)) return {};
|
|
36
|
+
return Object.fromEntries(Object.entries(ports).filter((entry)=>'number' == typeof entry[1]));
|
|
37
|
+
}
|
|
38
|
+
export { packageScopeFromRoot, packageSourceFromMetadata, readOverlayPorts };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_path from "node:path";
|
|
3
|
+
import { normalizeUltramodernBridgeConfig } from "../../ultramodern-workspace/bridge-config.js";
|
|
4
|
+
import { ULTRAMODERN_CONFIG_PATH, createNeutralOwnership, shellApp } from "../../ultramodern-workspace/descriptors.js";
|
|
5
|
+
import { toKebabCase } from "../../ultramodern-workspace/naming.js";
|
|
6
|
+
import { packageScopeFromRoot } from "./metadata.js";
|
|
7
|
+
function normalizeCompactConfig(workspaceRoot, sourcePath, config) {
|
|
8
|
+
const packageSource = config.packageSource && 'object' == typeof config.packageSource ? {
|
|
9
|
+
strategy: 'install' === config.packageSource.strategy ? 'install' : 'workspace',
|
|
10
|
+
modernPackageVersion: 'string' == typeof config.packageSource.modernPackageVersion ? config.packageSource.modernPackageVersion : 'workspace:*',
|
|
11
|
+
registry: 'string' == typeof config.packageSource.registry ? config.packageSource.registry : void 0,
|
|
12
|
+
aliasScope: 'string' == typeof config.packageSource.aliasScope ? config.packageSource.aliasScope : void 0,
|
|
13
|
+
aliasPackageNamePrefix: 'string' == typeof config.packageSource.aliasPackageNamePrefix ? config.packageSource.aliasPackageNamePrefix : void 0
|
|
14
|
+
} : void 0;
|
|
15
|
+
return {
|
|
16
|
+
schemaVersion: 'number' == typeof config.schemaVersion ? config.schemaVersion : 1,
|
|
17
|
+
profile: 'string' == typeof config.profile ? config.profile : void 0,
|
|
18
|
+
source: 'compact',
|
|
19
|
+
sourcePath,
|
|
20
|
+
workspace: {
|
|
21
|
+
packageScope: 'string' == typeof config.workspace?.packageScope ? config.workspace.packageScope : packageScopeFromRoot(workspaceRoot)
|
|
22
|
+
},
|
|
23
|
+
packageSource,
|
|
24
|
+
features: {
|
|
25
|
+
tailwind: config.features?.tailwind !== false
|
|
26
|
+
},
|
|
27
|
+
bridge: normalizeUltramodernBridgeConfig(config.bridge),
|
|
28
|
+
topology: {
|
|
29
|
+
apps: Array.isArray(config.topology?.apps) ? config.topology.apps.map((app)=>({
|
|
30
|
+
id: String(app.id),
|
|
31
|
+
kind: 'vertical' === app.kind ? 'vertical' : 'shell',
|
|
32
|
+
path: 'string' == typeof app.path ? app.path : '.',
|
|
33
|
+
package: 'string' == typeof app.package ? app.package : void 0,
|
|
34
|
+
packageSuffix: 'string' == typeof app.packageSuffix ? app.packageSuffix : void 0,
|
|
35
|
+
displayName: 'string' == typeof app.displayName ? app.displayName : void 0,
|
|
36
|
+
domain: 'string' == typeof app.domain ? app.domain : void 0,
|
|
37
|
+
port: 'number' == typeof app.port ? app.port : void 0,
|
|
38
|
+
portEnv: 'string' == typeof app.portEnv ? app.portEnv : void 0,
|
|
39
|
+
moduleFederation: app.moduleFederation && 'object' == typeof app.moduleFederation ? {
|
|
40
|
+
role: 'remote' === app.moduleFederation.role ? 'remote' : 'host',
|
|
41
|
+
name: 'string' == typeof app.moduleFederation.name ? app.moduleFederation.name : void 0,
|
|
42
|
+
exposes: Array.isArray(app.moduleFederation.exposes) ? app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose) : void 0,
|
|
43
|
+
exposePaths: null === app.moduleFederation.exposePaths || 'object' != typeof app.moduleFederation.exposePaths || Array.isArray(app.moduleFederation.exposePaths) ? void 0 : Object.fromEntries(Object.entries(app.moduleFederation.exposePaths).filter((entry)=>'string' == typeof entry[0] && 'string' == typeof entry[1])),
|
|
44
|
+
verticalRefs: Array.isArray(app.moduleFederation.verticalRefs) ? app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref) : void 0,
|
|
45
|
+
hostOnly: true === app.moduleFederation.hostOnly,
|
|
46
|
+
noExposes: true === app.moduleFederation.noExposes
|
|
47
|
+
} : void 0,
|
|
48
|
+
api: app.api && 'object' == typeof app.api ? {
|
|
49
|
+
stem: 'string' == typeof app.api.stem ? app.api.stem : String(app.id),
|
|
50
|
+
prefix: 'string' == typeof app.api.prefix ? app.api.prefix : `/${String(app.id)}-api`,
|
|
51
|
+
consumedBy: Array.isArray(app.api.consumedBy) ? app.api.consumedBy.filter((consumer)=>'string' == typeof consumer) : [
|
|
52
|
+
shellApp.id,
|
|
53
|
+
String(app.id)
|
|
54
|
+
]
|
|
55
|
+
} : void 0
|
|
56
|
+
})) : []
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function normalizeCompactUltramodernConfig(workspaceRoot, compact) {
|
|
61
|
+
return normalizeCompactConfig(workspaceRoot, node_path.join(workspaceRoot, ULTRAMODERN_CONFIG_PATH), compact);
|
|
62
|
+
}
|
|
63
|
+
function workspaceAppsFromToolingConfig(config) {
|
|
64
|
+
return config.topology.apps.map((app)=>{
|
|
65
|
+
if ('shell' === app.kind) return {
|
|
66
|
+
...shellApp,
|
|
67
|
+
directory: app.path,
|
|
68
|
+
packageSuffix: app.packageSuffix ?? shellApp.packageSuffix,
|
|
69
|
+
displayName: app.displayName ?? shellApp.displayName,
|
|
70
|
+
port: app.port ?? shellApp.port,
|
|
71
|
+
portEnv: app.portEnv ?? shellApp.portEnv,
|
|
72
|
+
mfName: app.moduleFederation?.name ?? shellApp.mfName,
|
|
73
|
+
verticalRefs: app.moduleFederation?.verticalRefs ?? []
|
|
74
|
+
};
|
|
75
|
+
const domain = app.domain ?? app.id;
|
|
76
|
+
const packageSuffix = app.packageSuffix ?? domain;
|
|
77
|
+
const exposePaths = app.moduleFederation?.exposePaths ?? {};
|
|
78
|
+
const exposes = Object.fromEntries((app.moduleFederation?.exposes ?? []).map((expose)=>{
|
|
79
|
+
const configuredPath = exposePaths[expose];
|
|
80
|
+
const inferredPath = './Route' === expose ? './src/federation-entry.tsx' : './Widget' === expose ? `./src/components/${domain}-widget.tsx` : `./src/components/${toKebabCase(expose.replace(/^\.\//u, ''))}.tsx`;
|
|
81
|
+
return [
|
|
82
|
+
expose,
|
|
83
|
+
configuredPath ?? inferredPath
|
|
84
|
+
];
|
|
85
|
+
}));
|
|
86
|
+
return {
|
|
87
|
+
id: app.id,
|
|
88
|
+
directory: app.path,
|
|
89
|
+
packageSuffix,
|
|
90
|
+
displayName: app.displayName ?? `${domain} Vertical`,
|
|
91
|
+
kind: 'vertical',
|
|
92
|
+
domain,
|
|
93
|
+
portEnv: app.portEnv ?? `VERTICAL_${domain.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase()}_PORT`,
|
|
94
|
+
port: app.port ?? 0,
|
|
95
|
+
mfName: app.moduleFederation?.name ?? app.id,
|
|
96
|
+
exposes,
|
|
97
|
+
...app.moduleFederation?.verticalRefs ? {
|
|
98
|
+
verticalRefs: app.moduleFederation.verticalRefs
|
|
99
|
+
} : {},
|
|
100
|
+
...app.api ? {
|
|
101
|
+
api: app.api
|
|
102
|
+
} : {},
|
|
103
|
+
ownership: createNeutralOwnership(app.id)
|
|
104
|
+
};
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export { normalizeCompactConfig, normalizeCompactUltramodernConfig, workspaceAppsFromToolingConfig };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import node_fs from "node:fs";
|
|
3
|
+
import node_path from "node:path";
|
|
4
|
+
import { shellApp } from "../../ultramodern-workspace/descriptors.js";
|
|
5
|
+
import { toKebabCase } from "../../ultramodern-workspace/naming.js";
|
|
6
|
+
import { LEGACY_DEVELOPMENT_OVERLAY_PATH, LEGACY_GENERATED_CONTRACT_PATH, LEGACY_PACKAGE_SOURCE_METADATA_PATH } from "./constants.js";
|
|
7
|
+
import { readJsonObject } from "./json.js";
|
|
8
|
+
import { packageScopeFromRoot, packageSourceFromMetadata, readOverlayPorts } from "./metadata.js";
|
|
9
|
+
function synthesizeCompactUltramodernConfig(workspaceRoot) {
|
|
10
|
+
const contractPath = node_path.join(workspaceRoot, LEGACY_GENERATED_CONTRACT_PATH);
|
|
11
|
+
if (!node_fs.existsSync(contractPath)) return;
|
|
12
|
+
const contract = readJsonObject(contractPath);
|
|
13
|
+
const sources = [
|
|
14
|
+
LEGACY_GENERATED_CONTRACT_PATH
|
|
15
|
+
];
|
|
16
|
+
const missing = [];
|
|
17
|
+
const packageSource = packageSourceFromMetadata(workspaceRoot);
|
|
18
|
+
if (packageSource) sources.push(LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
19
|
+
else missing.push(LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
20
|
+
const ports = readOverlayPorts(workspaceRoot);
|
|
21
|
+
if (node_fs.existsSync(node_path.join(workspaceRoot, LEGACY_DEVELOPMENT_OVERLAY_PATH))) sources.push(LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
22
|
+
else missing.push(LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
23
|
+
const apps = Array.isArray(contract.apps) ? contract.apps : [];
|
|
24
|
+
const shell = apps.find((app)=>app?.id === shellApp.id);
|
|
25
|
+
const compact = {
|
|
26
|
+
schemaVersion: 'number' == typeof contract.schemaVersion ? contract.schemaVersion : 1,
|
|
27
|
+
...'string' == typeof contract.profile ? {
|
|
28
|
+
profile: contract.profile
|
|
29
|
+
} : {},
|
|
30
|
+
workspace: {
|
|
31
|
+
packageScope: packageScopeFromRoot(workspaceRoot)
|
|
32
|
+
},
|
|
33
|
+
...packageSource ? {
|
|
34
|
+
packageSource: {
|
|
35
|
+
strategy: packageSource.strategy,
|
|
36
|
+
modernPackageVersion: packageSource.modernPackageVersion,
|
|
37
|
+
...packageSource.registry ? {
|
|
38
|
+
registry: packageSource.registry
|
|
39
|
+
} : {},
|
|
40
|
+
...packageSource.aliasScope ? {
|
|
41
|
+
aliasScope: packageSource.aliasScope
|
|
42
|
+
} : {},
|
|
43
|
+
...packageSource.aliasPackageNamePrefix ? {
|
|
44
|
+
aliasPackageNamePrefix: packageSource.aliasPackageNamePrefix
|
|
45
|
+
} : {}
|
|
46
|
+
}
|
|
47
|
+
} : {},
|
|
48
|
+
features: {
|
|
49
|
+
tailwind: shell?.styling?.tailwind !== false
|
|
50
|
+
},
|
|
51
|
+
topology: {
|
|
52
|
+
apps: apps.map((app)=>{
|
|
53
|
+
const id = String(app.id);
|
|
54
|
+
const appPath = 'string' == typeof app.path ? app.path : id === shellApp.id ? shellApp.directory : `verticals/${toKebabCase(id)}`;
|
|
55
|
+
const domain = 'string' == typeof app.i18n?.namespace && 'shell' !== app.i18n.namespace ? app.i18n.namespace : appPath.split('/').at(-1);
|
|
56
|
+
const moduleFederation = app.moduleFederation && 'object' == typeof app.moduleFederation ? {
|
|
57
|
+
role: 'vertical' === app.kind ? 'remote' : 'host',
|
|
58
|
+
...'string' == typeof app.moduleFederation.name ? {
|
|
59
|
+
name: app.moduleFederation.name
|
|
60
|
+
} : {},
|
|
61
|
+
...Array.isArray(app.moduleFederation.exposes) ? {
|
|
62
|
+
exposes: app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose)
|
|
63
|
+
} : {},
|
|
64
|
+
...Array.isArray(app.moduleFederation.verticalRefs) ? {
|
|
65
|
+
verticalRefs: app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref)
|
|
66
|
+
} : {}
|
|
67
|
+
} : void 0;
|
|
68
|
+
const api = app.effect && 'object' == typeof app.effect ? {
|
|
69
|
+
stem: 'string' == typeof app.effect.prefix ? app.effect.prefix.split('/').filter(Boolean).at(-1) ?? domain ?? id : domain ?? id,
|
|
70
|
+
prefix: 'string' == typeof app.effect.prefix ? app.effect.prefix : `/${domain ?? id}-api`,
|
|
71
|
+
consumedBy: [
|
|
72
|
+
shellApp.id,
|
|
73
|
+
id
|
|
74
|
+
]
|
|
75
|
+
} : void 0;
|
|
76
|
+
return {
|
|
77
|
+
id,
|
|
78
|
+
kind: 'vertical' === app.kind ? 'vertical' : 'shell',
|
|
79
|
+
path: appPath,
|
|
80
|
+
...'string' == typeof app.package ? {
|
|
81
|
+
package: app.package
|
|
82
|
+
} : {},
|
|
83
|
+
packageSuffix: 'string' == typeof app.package ? app.package.split('/').at(-1) : appPath.split('/').at(-1),
|
|
84
|
+
...id === shellApp.id ? {
|
|
85
|
+
displayName: shellApp.displayName
|
|
86
|
+
} : {},
|
|
87
|
+
...domain ? {
|
|
88
|
+
domain
|
|
89
|
+
} : {},
|
|
90
|
+
...'number' == typeof ports[id] ? {
|
|
91
|
+
port: ports[id]
|
|
92
|
+
} : {},
|
|
93
|
+
...moduleFederation ? {
|
|
94
|
+
moduleFederation
|
|
95
|
+
} : {},
|
|
96
|
+
...api ? {
|
|
97
|
+
api
|
|
98
|
+
} : {}
|
|
99
|
+
};
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
compact,
|
|
105
|
+
missing,
|
|
106
|
+
sources
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export { synthesizeCompactUltramodernConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "node:module";
|
|
@@ -1,256 +1,2 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
3
|
-
import node_path from "node:path";
|
|
4
|
-
import { normalizeUltramodernBridgeConfig } from "../ultramodern-workspace/bridge-config.js";
|
|
5
|
-
import { ULTRAMODERN_CONFIG_PATH, createNeutralOwnership, shellApp } from "../ultramodern-workspace/descriptors.js";
|
|
6
|
-
import { toKebabCase } from "../ultramodern-workspace/naming.js";
|
|
7
|
-
const LEGACY_GENERATED_CONTRACT_PATH = '.modernjs/ultramodern-generated-contract.json';
|
|
8
|
-
const LEGACY_PACKAGE_SOURCE_METADATA_PATH = '.modernjs/ultramodern-package-source.json';
|
|
9
|
-
const LEGACY_DEVELOPMENT_OVERLAY_PATH = 'topology/local-overlays/development.json';
|
|
10
|
-
function readJsonObject(filePath) {
|
|
11
|
-
const value = JSON.parse(node_fs.readFileSync(filePath, 'utf-8'));
|
|
12
|
-
if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error(`UltraModern config must contain a JSON object: ${filePath}`);
|
|
13
|
-
return value;
|
|
14
|
-
}
|
|
15
|
-
function readOptionalJsonObject(filePath) {
|
|
16
|
-
return node_fs.existsSync(filePath) ? readJsonObject(filePath) : {};
|
|
17
|
-
}
|
|
18
|
-
function packageScopeFromRoot(workspaceRoot) {
|
|
19
|
-
const rootPackage = readOptionalJsonObject(node_path.join(workspaceRoot, 'package.json'));
|
|
20
|
-
return 'string' == typeof rootPackage.name && rootPackage.name.length > 0 ? rootPackage.name : node_path.basename(workspaceRoot);
|
|
21
|
-
}
|
|
22
|
-
function packageSourceFromMetadata(workspaceRoot) {
|
|
23
|
-
const metadataPath = node_path.join(workspaceRoot, LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
24
|
-
if (!node_fs.existsSync(metadataPath)) return;
|
|
25
|
-
const metadata = readJsonObject(metadataPath);
|
|
26
|
-
const aliases = metadata.modernPackages?.aliases ?? {};
|
|
27
|
-
const firstAliasEntry = Object.entries(aliases).find((entry)=>'string' == typeof entry[1]);
|
|
28
|
-
const firstPackage = firstAliasEntry?.[0];
|
|
29
|
-
const firstAlias = firstAliasEntry?.[1];
|
|
30
|
-
const aliasScope = firstAlias?.match(/^@([^/]+)\//u)?.[1];
|
|
31
|
-
const unscopedName = firstPackage?.split('/').at(-1) ?? '';
|
|
32
|
-
const aliasUnscopedName = firstAlias?.split('/').at(-1) ?? '';
|
|
33
|
-
const aliasPackageNamePrefix = aliasUnscopedName && unscopedName && aliasUnscopedName.endsWith(unscopedName) ? aliasUnscopedName.slice(0, -unscopedName.length) : void 0;
|
|
34
|
-
return {
|
|
35
|
-
strategy: 'install' === metadata.strategy ? 'install' : 'workspace',
|
|
36
|
-
modernPackageVersion: 'string' == typeof metadata.modernPackages?.specifier ? metadata.modernPackages.specifier : 'workspace:*',
|
|
37
|
-
registry: 'string' == typeof metadata.modernPackages?.registry ? metadata.modernPackages.registry : void 0,
|
|
38
|
-
aliasScope,
|
|
39
|
-
aliasPackageNamePrefix
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function readOverlayPorts(workspaceRoot) {
|
|
43
|
-
const overlayPath = node_path.join(workspaceRoot, LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
44
|
-
if (!node_fs.existsSync(overlayPath)) return {};
|
|
45
|
-
const overlay = readJsonObject(overlayPath);
|
|
46
|
-
const ports = overlay.ports;
|
|
47
|
-
if (null === ports || 'object' != typeof ports || Array.isArray(ports)) return {};
|
|
48
|
-
return Object.fromEntries(Object.entries(ports).filter((entry)=>'number' == typeof entry[1]));
|
|
49
|
-
}
|
|
50
|
-
function normalizeCompactConfig(workspaceRoot, sourcePath, config) {
|
|
51
|
-
const packageSource = config.packageSource && 'object' == typeof config.packageSource ? {
|
|
52
|
-
strategy: 'install' === config.packageSource.strategy ? 'install' : 'workspace',
|
|
53
|
-
modernPackageVersion: 'string' == typeof config.packageSource.modernPackageVersion ? config.packageSource.modernPackageVersion : 'workspace:*',
|
|
54
|
-
registry: 'string' == typeof config.packageSource.registry ? config.packageSource.registry : void 0,
|
|
55
|
-
aliasScope: 'string' == typeof config.packageSource.aliasScope ? config.packageSource.aliasScope : void 0,
|
|
56
|
-
aliasPackageNamePrefix: 'string' == typeof config.packageSource.aliasPackageNamePrefix ? config.packageSource.aliasPackageNamePrefix : void 0
|
|
57
|
-
} : void 0;
|
|
58
|
-
return {
|
|
59
|
-
schemaVersion: 'number' == typeof config.schemaVersion ? config.schemaVersion : 1,
|
|
60
|
-
profile: 'string' == typeof config.profile ? config.profile : void 0,
|
|
61
|
-
source: 'compact',
|
|
62
|
-
sourcePath,
|
|
63
|
-
workspace: {
|
|
64
|
-
packageScope: 'string' == typeof config.workspace?.packageScope ? config.workspace.packageScope : packageScopeFromRoot(workspaceRoot)
|
|
65
|
-
},
|
|
66
|
-
packageSource,
|
|
67
|
-
features: {
|
|
68
|
-
tailwind: config.features?.tailwind !== false
|
|
69
|
-
},
|
|
70
|
-
bridge: normalizeUltramodernBridgeConfig(config.bridge),
|
|
71
|
-
topology: {
|
|
72
|
-
apps: Array.isArray(config.topology?.apps) ? config.topology.apps.map((app)=>({
|
|
73
|
-
id: String(app.id),
|
|
74
|
-
kind: 'vertical' === app.kind ? 'vertical' : 'shell',
|
|
75
|
-
path: 'string' == typeof app.path ? app.path : '.',
|
|
76
|
-
package: 'string' == typeof app.package ? app.package : void 0,
|
|
77
|
-
packageSuffix: 'string' == typeof app.packageSuffix ? app.packageSuffix : void 0,
|
|
78
|
-
displayName: 'string' == typeof app.displayName ? app.displayName : void 0,
|
|
79
|
-
domain: 'string' == typeof app.domain ? app.domain : void 0,
|
|
80
|
-
port: 'number' == typeof app.port ? app.port : void 0,
|
|
81
|
-
portEnv: 'string' == typeof app.portEnv ? app.portEnv : void 0,
|
|
82
|
-
moduleFederation: app.moduleFederation && 'object' == typeof app.moduleFederation ? {
|
|
83
|
-
role: 'remote' === app.moduleFederation.role ? 'remote' : 'host',
|
|
84
|
-
name: 'string' == typeof app.moduleFederation.name ? app.moduleFederation.name : void 0,
|
|
85
|
-
exposes: Array.isArray(app.moduleFederation.exposes) ? app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose) : void 0,
|
|
86
|
-
exposePaths: null === app.moduleFederation.exposePaths || 'object' != typeof app.moduleFederation.exposePaths || Array.isArray(app.moduleFederation.exposePaths) ? void 0 : Object.fromEntries(Object.entries(app.moduleFederation.exposePaths).filter((entry)=>'string' == typeof entry[0] && 'string' == typeof entry[1])),
|
|
87
|
-
verticalRefs: Array.isArray(app.moduleFederation.verticalRefs) ? app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref) : void 0,
|
|
88
|
-
hostOnly: true === app.moduleFederation.hostOnly,
|
|
89
|
-
noExposes: true === app.moduleFederation.noExposes
|
|
90
|
-
} : void 0,
|
|
91
|
-
api: app.api && 'object' == typeof app.api ? {
|
|
92
|
-
stem: 'string' == typeof app.api.stem ? app.api.stem : String(app.id),
|
|
93
|
-
prefix: 'string' == typeof app.api.prefix ? app.api.prefix : `/${String(app.id)}-api`,
|
|
94
|
-
consumedBy: Array.isArray(app.api.consumedBy) ? app.api.consumedBy.filter((consumer)=>'string' == typeof consumer) : [
|
|
95
|
-
shellApp.id,
|
|
96
|
-
String(app.id)
|
|
97
|
-
]
|
|
98
|
-
} : void 0
|
|
99
|
-
})) : []
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
function normalizeCompactUltramodernConfig(workspaceRoot, compact) {
|
|
104
|
-
return normalizeCompactConfig(workspaceRoot, node_path.join(workspaceRoot, ULTRAMODERN_CONFIG_PATH), compact);
|
|
105
|
-
}
|
|
106
|
-
function synthesizeCompactUltramodernConfig(workspaceRoot) {
|
|
107
|
-
const contractPath = node_path.join(workspaceRoot, LEGACY_GENERATED_CONTRACT_PATH);
|
|
108
|
-
if (!node_fs.existsSync(contractPath)) return;
|
|
109
|
-
const contract = readJsonObject(contractPath);
|
|
110
|
-
const sources = [
|
|
111
|
-
LEGACY_GENERATED_CONTRACT_PATH
|
|
112
|
-
];
|
|
113
|
-
const missing = [];
|
|
114
|
-
const packageSource = packageSourceFromMetadata(workspaceRoot);
|
|
115
|
-
if (packageSource) sources.push(LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
116
|
-
else missing.push(LEGACY_PACKAGE_SOURCE_METADATA_PATH);
|
|
117
|
-
const ports = readOverlayPorts(workspaceRoot);
|
|
118
|
-
if (node_fs.existsSync(node_path.join(workspaceRoot, LEGACY_DEVELOPMENT_OVERLAY_PATH))) sources.push(LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
119
|
-
else missing.push(LEGACY_DEVELOPMENT_OVERLAY_PATH);
|
|
120
|
-
const apps = Array.isArray(contract.apps) ? contract.apps : [];
|
|
121
|
-
const shell = apps.find((app)=>app?.id === shellApp.id);
|
|
122
|
-
const compact = {
|
|
123
|
-
schemaVersion: 'number' == typeof contract.schemaVersion ? contract.schemaVersion : 1,
|
|
124
|
-
...'string' == typeof contract.profile ? {
|
|
125
|
-
profile: contract.profile
|
|
126
|
-
} : {},
|
|
127
|
-
workspace: {
|
|
128
|
-
packageScope: packageScopeFromRoot(workspaceRoot)
|
|
129
|
-
},
|
|
130
|
-
...packageSource ? {
|
|
131
|
-
packageSource: {
|
|
132
|
-
strategy: packageSource.strategy,
|
|
133
|
-
modernPackageVersion: packageSource.modernPackageVersion,
|
|
134
|
-
...packageSource.registry ? {
|
|
135
|
-
registry: packageSource.registry
|
|
136
|
-
} : {},
|
|
137
|
-
...packageSource.aliasScope ? {
|
|
138
|
-
aliasScope: packageSource.aliasScope
|
|
139
|
-
} : {},
|
|
140
|
-
...packageSource.aliasPackageNamePrefix ? {
|
|
141
|
-
aliasPackageNamePrefix: packageSource.aliasPackageNamePrefix
|
|
142
|
-
} : {}
|
|
143
|
-
}
|
|
144
|
-
} : {},
|
|
145
|
-
features: {
|
|
146
|
-
tailwind: shell?.styling?.tailwind !== false
|
|
147
|
-
},
|
|
148
|
-
topology: {
|
|
149
|
-
apps: apps.map((app)=>{
|
|
150
|
-
const id = String(app.id);
|
|
151
|
-
const appPath = 'string' == typeof app.path ? app.path : id === shellApp.id ? shellApp.directory : `verticals/${toKebabCase(id)}`;
|
|
152
|
-
const domain = 'string' == typeof app.i18n?.namespace && 'shell' !== app.i18n.namespace ? app.i18n.namespace : appPath.split('/').at(-1);
|
|
153
|
-
const moduleFederation = app.moduleFederation && 'object' == typeof app.moduleFederation ? {
|
|
154
|
-
role: 'vertical' === app.kind ? 'remote' : 'host',
|
|
155
|
-
...'string' == typeof app.moduleFederation.name ? {
|
|
156
|
-
name: app.moduleFederation.name
|
|
157
|
-
} : {},
|
|
158
|
-
...Array.isArray(app.moduleFederation.exposes) ? {
|
|
159
|
-
exposes: app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose)
|
|
160
|
-
} : {},
|
|
161
|
-
...Array.isArray(app.moduleFederation.verticalRefs) ? {
|
|
162
|
-
verticalRefs: app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref)
|
|
163
|
-
} : {}
|
|
164
|
-
} : void 0;
|
|
165
|
-
const api = app.effect && 'object' == typeof app.effect ? {
|
|
166
|
-
stem: 'string' == typeof app.effect.prefix ? app.effect.prefix.split('/').filter(Boolean).at(-1) ?? domain ?? id : domain ?? id,
|
|
167
|
-
prefix: 'string' == typeof app.effect.prefix ? app.effect.prefix : `/${domain ?? id}-api`,
|
|
168
|
-
consumedBy: [
|
|
169
|
-
shellApp.id,
|
|
170
|
-
id
|
|
171
|
-
]
|
|
172
|
-
} : void 0;
|
|
173
|
-
return {
|
|
174
|
-
id,
|
|
175
|
-
kind: 'vertical' === app.kind ? 'vertical' : 'shell',
|
|
176
|
-
path: appPath,
|
|
177
|
-
...'string' == typeof app.package ? {
|
|
178
|
-
package: app.package
|
|
179
|
-
} : {},
|
|
180
|
-
packageSuffix: 'string' == typeof app.package ? app.package.split('/').at(-1) : appPath.split('/').at(-1),
|
|
181
|
-
...id === shellApp.id ? {
|
|
182
|
-
displayName: shellApp.displayName
|
|
183
|
-
} : {},
|
|
184
|
-
...domain ? {
|
|
185
|
-
domain
|
|
186
|
-
} : {},
|
|
187
|
-
...'number' == typeof ports[id] ? {
|
|
188
|
-
port: ports[id]
|
|
189
|
-
} : {},
|
|
190
|
-
...moduleFederation ? {
|
|
191
|
-
moduleFederation
|
|
192
|
-
} : {},
|
|
193
|
-
...api ? {
|
|
194
|
-
api
|
|
195
|
-
} : {}
|
|
196
|
-
};
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
return {
|
|
201
|
-
compact,
|
|
202
|
-
missing,
|
|
203
|
-
sources
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
function readUltramodernConfig(workspaceRoot = process.cwd()) {
|
|
207
|
-
const compactPath = node_path.join(workspaceRoot, ULTRAMODERN_CONFIG_PATH);
|
|
208
|
-
if (node_fs.existsSync(compactPath)) return normalizeCompactConfig(workspaceRoot, compactPath, readJsonObject(compactPath));
|
|
209
|
-
if (node_fs.existsSync(node_path.join(workspaceRoot, LEGACY_GENERATED_CONTRACT_PATH))) throw new Error(`Missing ${ULTRAMODERN_CONFIG_PATH}. Legacy UltraModern metadata detected — run \`modern-js-create ultramodern migrate-strict-effect\` to synthesize it.`);
|
|
210
|
-
throw new Error(`Missing UltraModern config. Expected ${ULTRAMODERN_CONFIG_PATH}. Run \`modern-js-create ultramodern migrate-strict-effect\` if you have legacy UltraModern metadata to migrate.`);
|
|
211
|
-
}
|
|
212
|
-
function workspaceAppsFromToolingConfig(config) {
|
|
213
|
-
return config.topology.apps.map((app)=>{
|
|
214
|
-
if ('shell' === app.kind) return {
|
|
215
|
-
...shellApp,
|
|
216
|
-
directory: app.path,
|
|
217
|
-
packageSuffix: app.packageSuffix ?? shellApp.packageSuffix,
|
|
218
|
-
displayName: app.displayName ?? shellApp.displayName,
|
|
219
|
-
port: app.port ?? shellApp.port,
|
|
220
|
-
portEnv: app.portEnv ?? shellApp.portEnv,
|
|
221
|
-
mfName: app.moduleFederation?.name ?? shellApp.mfName,
|
|
222
|
-
verticalRefs: app.moduleFederation?.verticalRefs ?? []
|
|
223
|
-
};
|
|
224
|
-
const domain = app.domain ?? app.id;
|
|
225
|
-
const packageSuffix = app.packageSuffix ?? domain;
|
|
226
|
-
const exposePaths = app.moduleFederation?.exposePaths ?? {};
|
|
227
|
-
const exposes = Object.fromEntries((app.moduleFederation?.exposes ?? []).map((expose)=>{
|
|
228
|
-
const configuredPath = exposePaths[expose];
|
|
229
|
-
const inferredPath = './Route' === expose ? './src/federation-entry.tsx' : './Widget' === expose ? `./src/components/${domain}-widget.tsx` : `./src/components/${toKebabCase(expose.replace(/^\.\//u, ''))}.tsx`;
|
|
230
|
-
return [
|
|
231
|
-
expose,
|
|
232
|
-
configuredPath ?? inferredPath
|
|
233
|
-
];
|
|
234
|
-
}));
|
|
235
|
-
return {
|
|
236
|
-
id: app.id,
|
|
237
|
-
directory: app.path,
|
|
238
|
-
packageSuffix,
|
|
239
|
-
displayName: app.displayName ?? `${domain} Vertical`,
|
|
240
|
-
kind: 'vertical',
|
|
241
|
-
domain,
|
|
242
|
-
portEnv: app.portEnv ?? `VERTICAL_${domain.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase()}_PORT`,
|
|
243
|
-
port: app.port ?? 0,
|
|
244
|
-
mfName: app.moduleFederation?.name ?? app.id,
|
|
245
|
-
exposes,
|
|
246
|
-
...app.moduleFederation?.verticalRefs ? {
|
|
247
|
-
verticalRefs: app.moduleFederation.verticalRefs
|
|
248
|
-
} : {},
|
|
249
|
-
...app.api ? {
|
|
250
|
-
api: app.api
|
|
251
|
-
} : {},
|
|
252
|
-
ownership: createNeutralOwnership(app.id)
|
|
253
|
-
};
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
export { normalizeCompactUltramodernConfig, readUltramodernConfig, synthesizeCompactUltramodernConfig, workspaceAppsFromToolingConfig };
|
|
2
|
+
export * from "./config/index.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
const FIRST_VERTICAL_PORT = 4101;
|
|
3
|
+
const TOPOLOGY_PATH = 'topology/reference-topology.json';
|
|
4
|
+
const OWNERSHIP_PATH = 'topology/ownership.json';
|
|
5
|
+
const DEVELOPMENT_OVERLAY_PATH = 'topology/local-overlays/development.json';
|
|
6
|
+
export { DEVELOPMENT_OVERLAY_PATH, FIRST_VERTICAL_PORT, OWNERSHIP_PATH, TOPOLOGY_PATH };
|