@bleedingdev/modern-js-ultramodern-create 3.9.0-ultramodern.2 → 3.9.0-ultramodern.21
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/README.md +43 -74
- package/dist/cjs/cli/package-source.cjs +2 -2
- package/dist/cjs/cli/project-setup.cjs +2 -22
- package/dist/cjs/index.cjs +9 -1
- package/dist/cjs/locale/en.cjs +2 -1
- package/dist/cjs/locale/zh.cjs +2 -1
- package/dist/cjs/ultramodern-package-source.cjs +13 -9
- package/dist/cjs/ultramodern-release-cohort.cjs +6 -21
- package/dist/cjs/ultramodern-tooling/commands/cloudflare-output-verify.cjs +49 -56
- package/dist/cjs/ultramodern-tooling/commands/context.cjs +11 -29
- package/dist/cjs/ultramodern-tooling/commands/routes-generate-app.cjs +67 -0
- package/dist/cjs/ultramodern-tooling/commands/routes-generate.cjs +24 -53
- package/dist/cjs/ultramodern-tooling/commands/validate.cjs +5 -11
- package/dist/cjs/ultramodern-tooling/commands.cjs +15 -8
- package/dist/cjs/ultramodern-tooling/config/index.cjs +10 -24
- package/dist/cjs/ultramodern-tooling/config/load.cjs +12 -10
- package/dist/cjs/ultramodern-tooling/config/metadata.cjs +34 -32
- package/dist/cjs/ultramodern-tooling/config/normalize.cjs +165 -164
- package/dist/cjs/ultramodern-workspace/add-shell.cjs +118 -118
- package/dist/cjs/ultramodern-workspace/add-vertical/execute.cjs +121 -25
- package/dist/cjs/ultramodern-workspace/add-vertical/plan.cjs +14 -160
- package/dist/cjs/ultramodern-workspace/add-vertical/preflight.cjs +16 -48
- package/dist/cjs/ultramodern-workspace/add-vertical/preview.cjs +78 -0
- package/dist/cjs/ultramodern-workspace/add-vertical/shell-files.cjs +87 -24
- package/dist/cjs/ultramodern-workspace/add-vertical/topology.cjs +4 -1
- package/dist/cjs/ultramodern-workspace/add-vertical/transaction.cjs +378 -45
- package/dist/cjs/ultramodern-workspace/add-vertical/workspace-state.cjs +21 -44
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +0 -9
- package/dist/cjs/ultramodern-workspace/api/client.cjs +5 -5
- package/dist/cjs/ultramodern-workspace/api/contracts.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/api/rpc.cjs +20 -18
- package/dist/cjs/ultramodern-workspace/api/service.cjs +49 -24
- package/dist/cjs/ultramodern-workspace/api/shared.cjs +28 -18
- package/dist/cjs/ultramodern-workspace/app-files.cjs +3 -23
- package/dist/cjs/ultramodern-workspace/backend-federation.cjs +27 -27
- package/dist/cjs/ultramodern-workspace/contracts.cjs +14 -183
- package/dist/cjs/ultramodern-workspace/delivery-unit-schema/surfaces.cjs +85 -0
- package/dist/cjs/ultramodern-workspace/delivery-unit-schema/types.cjs +8 -85
- package/dist/cjs/ultramodern-workspace/delivery-unit-stamp.cjs +16 -4
- package/dist/cjs/ultramodern-workspace/delivery-unit-sync.cjs +27 -17
- package/dist/cjs/ultramodern-workspace/delivery-unit.cjs +16 -10
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +66 -433
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +0 -4
- package/dist/cjs/ultramodern-workspace/fs-io.cjs +37 -2
- package/dist/cjs/ultramodern-workspace/generation-result.cjs +4 -4
- package/dist/cjs/ultramodern-workspace/index.cjs +2 -5
- package/dist/cjs/ultramodern-workspace/mf-validation/constants.cjs +0 -6
- package/dist/cjs/ultramodern-workspace/mf-validation/discovery.cjs +6 -6
- package/dist/cjs/{ultramodern-tooling/commands/migrate-strict-effect/generated-patches.cjs → ultramodern-workspace/mf-validation/exposes.cjs} +13 -17
- package/dist/cjs/ultramodern-workspace/mf-validation/inspect.cjs +26 -7
- package/dist/cjs/ultramodern-workspace/mf-validation/object-literal.cjs +21 -122
- package/dist/cjs/ultramodern-workspace/mf-validation/path-utils.cjs +37 -38
- package/dist/cjs/ultramodern-workspace/mf-validation/syntax.cjs +93 -153
- package/dist/cjs/ultramodern-workspace/mf-validation.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/module-federation/config.cjs +24 -29
- package/dist/cjs/ultramodern-workspace/module-federation/reexport-module.cjs +39 -58
- package/dist/cjs/ultramodern-workspace/module-federation/remote-refs.cjs +1 -43
- package/dist/cjs/ultramodern-workspace/package-json.cjs +63 -37
- package/dist/cjs/ultramodern-workspace/patch-inventory.cjs +104 -0
- package/dist/cjs/ultramodern-workspace/policy.cjs +3 -577
- package/dist/cjs/ultramodern-workspace/public-surface.cjs +3 -3
- package/dist/cjs/ultramodern-workspace/routes.cjs +2 -11
- package/dist/cjs/ultramodern-workspace/shared-patches.cjs +12 -2
- package/dist/cjs/ultramodern-workspace/shells.cjs +0 -70
- package/dist/cjs/ultramodern-workspace/tooling-command-catalog.cjs +27 -41
- package/dist/cjs/ultramodern-workspace/tsconfigs.cjs +8 -2
- package/dist/cjs/ultramodern-workspace/validation/architecture.cjs +397 -0
- package/dist/cjs/ultramodern-workspace/validation/assertions.cjs +140 -0
- package/dist/cjs/ultramodern-workspace/validation/types.cjs +18 -0
- package/dist/cjs/ultramodern-workspace/validation/workspace.cjs +344 -0
- package/dist/cjs/ultramodern-workspace/versions.cjs +81 -45
- package/dist/cjs/ultramodern-workspace/workspace-artifact-ownership.cjs +183 -0
- package/dist/cjs/ultramodern-workspace/workspace-script-plan.cjs +36 -25
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +11 -200
- package/dist/cjs/ultramodern-workspace/workspace-validation-contract.cjs +62 -373
- package/dist/cjs/ultramodern-workspace/write-app.cjs +19 -11
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +20 -50
- package/dist/cjs/ultramodern-workspace/zerops.cjs +2 -0
- package/dist/esm/cli/package-source.js +3 -3
- package/dist/esm/cli/project-setup.js +2 -22
- package/dist/esm/index.js +10 -2
- package/dist/esm/locale/en.js +2 -1
- package/dist/esm/locale/zh.js +2 -1
- package/dist/esm/ultramodern-package-source.js +14 -4
- package/dist/esm/ultramodern-release-cohort.js +5 -14
- package/dist/esm/ultramodern-tooling/commands/cloudflare-output-verify.js +49 -56
- package/dist/esm/ultramodern-tooling/commands/context.js +10 -26
- package/dist/esm/ultramodern-tooling/commands/routes-generate-app.js +35 -0
- package/dist/esm/ultramodern-tooling/commands/routes-generate.js +25 -54
- package/dist/esm/ultramodern-tooling/commands/validate.js +6 -12
- package/dist/esm/ultramodern-tooling/commands.js +15 -9
- package/dist/esm/ultramodern-tooling/config/index.js +0 -2
- package/dist/esm/ultramodern-tooling/config/load.js +9 -9
- package/dist/esm/ultramodern-tooling/config/metadata.js +33 -28
- package/dist/esm/ultramodern-tooling/config/normalize.js +159 -156
- package/dist/esm/ultramodern-workspace/add-shell.js +124 -123
- package/dist/esm/ultramodern-workspace/add-vertical/execute.js +119 -27
- package/dist/esm/ultramodern-workspace/add-vertical/plan.js +16 -150
- package/dist/esm/ultramodern-workspace/add-vertical/preflight.js +15 -47
- package/dist/esm/ultramodern-workspace/add-vertical/preview.js +40 -0
- package/dist/esm/ultramodern-workspace/add-vertical/shell-files.js +87 -25
- package/dist/esm/ultramodern-workspace/add-vertical/topology.js +4 -1
- package/dist/esm/ultramodern-workspace/add-vertical/transaction.js +373 -46
- package/dist/esm/ultramodern-workspace/add-vertical/workspace-state.js +17 -34
- package/dist/esm/ultramodern-workspace/add-vertical.js +1 -1
- package/dist/esm/ultramodern-workspace/api/client.js +5 -5
- package/dist/esm/ultramodern-workspace/api/contracts.js +2 -2
- package/dist/esm/ultramodern-workspace/api/rpc.js +20 -18
- package/dist/esm/ultramodern-workspace/api/service.js +49 -24
- package/dist/esm/ultramodern-workspace/api/shared.js +28 -18
- package/dist/esm/ultramodern-workspace/app-files.js +3 -23
- package/dist/esm/ultramodern-workspace/backend-federation.js +5 -5
- package/dist/esm/ultramodern-workspace/contracts.js +14 -180
- package/dist/esm/ultramodern-workspace/delivery-unit-schema/surfaces.js +41 -0
- package/dist/esm/ultramodern-workspace/delivery-unit-schema/types.js +1 -75
- package/dist/esm/ultramodern-workspace/delivery-unit-stamp.js +16 -4
- package/dist/esm/ultramodern-workspace/delivery-unit-sync.js +28 -18
- package/dist/esm/ultramodern-workspace/delivery-unit.js +12 -6
- package/dist/esm/ultramodern-workspace/demo-components.js +67 -428
- package/dist/esm/ultramodern-workspace/descriptors.js +1 -2
- package/dist/esm/ultramodern-workspace/fs-io.js +37 -2
- package/dist/esm/ultramodern-workspace/generation-result.js +3 -3
- package/dist/esm/ultramodern-workspace/index.js +1 -1
- package/dist/esm/ultramodern-workspace/mf-validation/constants.js +1 -4
- package/dist/esm/ultramodern-workspace/mf-validation/discovery.js +7 -7
- package/dist/esm/ultramodern-workspace/mf-validation/exposes.js +14 -0
- package/dist/esm/ultramodern-workspace/mf-validation/inspect.js +27 -8
- package/dist/esm/ultramodern-workspace/mf-validation/object-literal.js +22 -123
- package/dist/esm/ultramodern-workspace/mf-validation/path-utils.js +36 -34
- package/dist/esm/ultramodern-workspace/mf-validation/syntax.js +83 -143
- package/dist/esm/ultramodern-workspace/mf-validation.js +1 -0
- package/dist/esm/ultramodern-workspace/module-federation/config.js +25 -30
- package/dist/esm/ultramodern-workspace/module-federation/reexport-module.js +39 -58
- package/dist/esm/ultramodern-workspace/module-federation/remote-refs.js +1 -43
- package/dist/esm/ultramodern-workspace/package-json.js +58 -32
- package/dist/esm/ultramodern-workspace/patch-inventory.js +66 -0
- package/dist/esm/ultramodern-workspace/policy.js +2 -564
- package/dist/esm/ultramodern-workspace/public-surface.js +3 -3
- package/dist/esm/ultramodern-workspace/routes.js +2 -11
- package/dist/esm/ultramodern-workspace/shared-patches.js +2 -2
- package/dist/esm/ultramodern-workspace/shells.js +3 -67
- package/dist/esm/ultramodern-workspace/tooling-command-catalog.js +22 -37
- package/dist/esm/ultramodern-workspace/tsconfigs.js +9 -3
- package/dist/esm/ultramodern-workspace/validation/architecture.js +348 -0
- package/dist/esm/ultramodern-workspace/validation/assertions.js +65 -0
- package/dist/esm/ultramodern-workspace/validation/types.js +0 -0
- package/dist/esm/ultramodern-workspace/validation/workspace.js +286 -0
- package/dist/esm/ultramodern-workspace/versions.js +74 -29
- package/dist/esm/ultramodern-workspace/workspace-artifact-ownership.js +128 -0
- package/dist/esm/ultramodern-workspace/workspace-script-plan.js +35 -27
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +10 -190
- package/dist/esm/ultramodern-workspace/workspace-validation-contract.js +65 -376
- package/dist/esm/ultramodern-workspace/write-app.js +18 -10
- package/dist/esm/ultramodern-workspace/write-workspace.js +25 -52
- package/dist/esm/ultramodern-workspace/zerops.js +2 -0
- package/dist/esm-node/cli/package-source.js +3 -3
- package/dist/esm-node/cli/project-setup.js +2 -22
- package/dist/esm-node/index.js +10 -2
- package/dist/esm-node/locale/en.js +2 -1
- package/dist/esm-node/locale/zh.js +2 -1
- package/dist/esm-node/ultramodern-package-source.js +14 -4
- package/dist/esm-node/ultramodern-release-cohort.js +5 -14
- package/dist/esm-node/ultramodern-tooling/commands/cloudflare-output-verify.js +49 -56
- package/dist/esm-node/ultramodern-tooling/commands/context.js +10 -26
- package/dist/esm-node/ultramodern-tooling/commands/routes-generate-app.js +36 -0
- package/dist/esm-node/ultramodern-tooling/commands/routes-generate.js +25 -54
- package/dist/esm-node/ultramodern-tooling/commands/validate.js +6 -12
- package/dist/esm-node/ultramodern-tooling/commands.js +15 -9
- package/dist/esm-node/ultramodern-tooling/config/index.js +0 -2
- package/dist/esm-node/ultramodern-tooling/config/load.js +9 -9
- package/dist/esm-node/ultramodern-tooling/config/metadata.js +33 -28
- package/dist/esm-node/ultramodern-tooling/config/normalize.js +159 -156
- package/dist/esm-node/ultramodern-workspace/add-shell.js +124 -123
- package/dist/esm-node/ultramodern-workspace/add-vertical/execute.js +119 -27
- package/dist/esm-node/ultramodern-workspace/add-vertical/plan.js +16 -150
- package/dist/esm-node/ultramodern-workspace/add-vertical/preflight.js +15 -47
- package/dist/esm-node/ultramodern-workspace/add-vertical/preview.js +41 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical/shell-files.js +87 -25
- package/dist/esm-node/ultramodern-workspace/add-vertical/topology.js +4 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical/transaction.js +373 -46
- package/dist/esm-node/ultramodern-workspace/add-vertical/workspace-state.js +17 -34
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +1 -1
- package/dist/esm-node/ultramodern-workspace/api/client.js +5 -5
- package/dist/esm-node/ultramodern-workspace/api/contracts.js +2 -2
- package/dist/esm-node/ultramodern-workspace/api/rpc.js +20 -18
- package/dist/esm-node/ultramodern-workspace/api/service.js +49 -24
- package/dist/esm-node/ultramodern-workspace/api/shared.js +28 -18
- package/dist/esm-node/ultramodern-workspace/app-files.js +3 -23
- package/dist/esm-node/ultramodern-workspace/backend-federation.js +5 -5
- package/dist/esm-node/ultramodern-workspace/contracts.js +14 -180
- package/dist/esm-node/ultramodern-workspace/delivery-unit-schema/surfaces.js +42 -0
- package/dist/esm-node/ultramodern-workspace/delivery-unit-schema/types.js +1 -75
- package/dist/esm-node/ultramodern-workspace/delivery-unit-stamp.js +16 -4
- package/dist/esm-node/ultramodern-workspace/delivery-unit-sync.js +28 -18
- package/dist/esm-node/ultramodern-workspace/delivery-unit.js +12 -6
- package/dist/esm-node/ultramodern-workspace/demo-components.js +67 -428
- package/dist/esm-node/ultramodern-workspace/descriptors.js +1 -2
- package/dist/esm-node/ultramodern-workspace/fs-io.js +37 -2
- package/dist/esm-node/ultramodern-workspace/generation-result.js +3 -3
- package/dist/esm-node/ultramodern-workspace/index.js +1 -1
- package/dist/esm-node/ultramodern-workspace/mf-validation/constants.js +1 -4
- package/dist/esm-node/ultramodern-workspace/mf-validation/discovery.js +7 -7
- package/dist/esm-node/ultramodern-workspace/mf-validation/exposes.js +15 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation/inspect.js +27 -8
- package/dist/esm-node/ultramodern-workspace/mf-validation/object-literal.js +22 -123
- package/dist/esm-node/ultramodern-workspace/mf-validation/path-utils.js +36 -34
- package/dist/esm-node/ultramodern-workspace/mf-validation/syntax.js +83 -143
- package/dist/esm-node/ultramodern-workspace/mf-validation.js +1 -0
- package/dist/esm-node/ultramodern-workspace/module-federation/config.js +25 -30
- package/dist/esm-node/ultramodern-workspace/module-federation/reexport-module.js +39 -58
- package/dist/esm-node/ultramodern-workspace/module-federation/remote-refs.js +1 -43
- package/dist/esm-node/ultramodern-workspace/package-json.js +58 -32
- package/dist/esm-node/ultramodern-workspace/patch-inventory.js +67 -0
- package/dist/esm-node/ultramodern-workspace/policy.js +2 -564
- package/dist/esm-node/ultramodern-workspace/public-surface.js +3 -3
- package/dist/esm-node/ultramodern-workspace/routes.js +2 -11
- package/dist/esm-node/ultramodern-workspace/shared-patches.js +2 -2
- package/dist/esm-node/ultramodern-workspace/shells.js +3 -67
- package/dist/esm-node/ultramodern-workspace/tooling-command-catalog.js +22 -37
- package/dist/esm-node/ultramodern-workspace/tsconfigs.js +9 -3
- package/dist/esm-node/ultramodern-workspace/validation/architecture.js +349 -0
- package/dist/esm-node/ultramodern-workspace/validation/assertions.js +66 -0
- package/dist/esm-node/ultramodern-workspace/validation/types.js +1 -0
- package/dist/esm-node/ultramodern-workspace/validation/workspace.js +287 -0
- package/dist/esm-node/ultramodern-workspace/versions.js +74 -29
- package/dist/esm-node/ultramodern-workspace/workspace-artifact-ownership.js +129 -0
- package/dist/esm-node/ultramodern-workspace/workspace-script-plan.js +35 -27
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +10 -190
- package/dist/esm-node/ultramodern-workspace/workspace-validation-contract.js +65 -376
- package/dist/esm-node/ultramodern-workspace/write-app.js +18 -10
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +25 -52
- package/dist/esm-node/ultramodern-workspace/zerops.js +2 -0
- package/dist/types/cli/project-setup.d.ts +1 -1
- package/dist/types/locale/en.d.ts +1 -0
- package/dist/types/locale/index.d.ts +2 -0
- package/dist/types/locale/zh.d.ts +1 -0
- package/dist/types/ultramodern-package-source.d.ts +2 -4
- package/dist/types/ultramodern-release-cohort.d.ts +1 -3
- package/dist/types/ultramodern-tooling/commands/cloudflare-output-verify.d.ts +2 -2
- package/dist/types/ultramodern-tooling/commands/context.d.ts +4 -1
- package/dist/types/ultramodern-tooling/commands/routes-generate-app.d.ts +1 -0
- package/dist/types/ultramodern-tooling/commands/routes-generate.d.ts +1 -1
- package/dist/types/ultramodern-tooling/commands/validate.d.ts +1 -1
- package/dist/types/ultramodern-tooling/config/index.d.ts +0 -2
- package/dist/types/ultramodern-tooling/config/load.d.ts +10 -2
- package/dist/types/ultramodern-tooling/config/metadata.d.ts +2 -2
- package/dist/types/ultramodern-tooling/config/normalize.d.ts +19 -19
- package/dist/types/ultramodern-tooling/config/types.d.ts +2 -9
- package/dist/types/ultramodern-workspace/add-shell.d.ts +1 -1
- package/dist/types/ultramodern-workspace/add-vertical/execute.d.ts +1 -0
- package/dist/types/ultramodern-workspace/add-vertical/preflight.d.ts +4 -3
- package/dist/types/ultramodern-workspace/add-vertical/preview.d.ts +4 -0
- package/dist/types/ultramodern-workspace/add-vertical/shell-files.d.ts +7 -2
- package/dist/types/ultramodern-workspace/add-vertical/transaction.d.ts +32 -6
- package/dist/types/ultramodern-workspace/add-vertical/workspace-state.d.ts +10 -7
- package/dist/types/ultramodern-workspace/add-vertical.d.ts +1 -1
- package/dist/types/ultramodern-workspace/api/client.d.ts +3 -1
- package/dist/types/ultramodern-workspace/api/rpc.d.ts +1 -1
- package/dist/types/ultramodern-workspace/api/service.d.ts +3 -1
- package/dist/types/ultramodern-workspace/api/shared.d.ts +2 -0
- package/dist/types/ultramodern-workspace/backend-federation.d.ts +1 -1
- package/dist/types/ultramodern-workspace/contracts.d.ts +1 -3
- package/dist/types/ultramodern-workspace/delivery-unit-schema/surfaces.d.ts +17 -0
- package/dist/types/ultramodern-workspace/delivery-unit-schema/types.d.ts +3 -68
- package/dist/types/ultramodern-workspace/delivery-unit-stamp.d.ts +2 -2
- package/dist/types/ultramodern-workspace/delivery-unit.d.ts +3 -3
- package/dist/types/ultramodern-workspace/demo-components.d.ts +0 -3
- package/dist/types/ultramodern-workspace/descriptors.d.ts +0 -1
- package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -1
- package/dist/types/ultramodern-workspace/index.d.ts +1 -1
- package/dist/types/ultramodern-workspace/mf-validation/constants.d.ts +0 -1
- package/dist/types/ultramodern-workspace/mf-validation/exposes.d.ts +11 -0
- package/dist/types/ultramodern-workspace/mf-validation/path-utils.d.ts +2 -3
- package/dist/types/ultramodern-workspace/mf-validation/syntax.d.ts +4 -3
- package/dist/types/ultramodern-workspace/mf-validation/types.d.ts +1 -0
- package/dist/types/ultramodern-workspace/mf-validation.d.ts +1 -0
- package/dist/types/ultramodern-workspace/module-federation/config.d.ts +1 -1
- package/dist/types/ultramodern-workspace/module-federation/reexport-module.d.ts +2 -2
- package/dist/types/ultramodern-workspace/package-json.d.ts +1 -1
- package/dist/types/ultramodern-workspace/patch-inventory.d.ts +10 -0
- package/dist/types/ultramodern-workspace/policy.d.ts +31 -209
- package/dist/types/ultramodern-workspace/routes.d.ts +6 -1
- package/dist/types/ultramodern-workspace/shells.d.ts +2 -15
- package/dist/types/ultramodern-workspace/tooling-command-catalog.d.ts +8 -7
- package/dist/types/ultramodern-workspace/types.d.ts +9 -9
- package/dist/types/ultramodern-workspace/validation/architecture.d.ts +2 -0
- package/dist/types/ultramodern-workspace/validation/assertions.d.ts +14 -0
- package/dist/types/ultramodern-workspace/validation/types.d.ts +9 -0
- package/dist/types/ultramodern-workspace/validation/workspace.d.ts +6 -0
- package/dist/types/ultramodern-workspace/versions.d.ts +73 -28
- package/dist/types/ultramodern-workspace/workspace-artifact-ownership.d.ts +18 -0
- package/dist/types/ultramodern-workspace/workspace-script-plan.d.ts +4 -5
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +8 -13
- package/dist/types/ultramodern-workspace/workspace-validation-contract.d.ts +22 -188
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +1 -3
- package/package.json +18 -11
- package/{template-workspace/.modernjs/release-cohort.json → release-cohort.json} +88 -40
- package/template-workspace/.codex/skills/rspack-tracing/scripts/analyze_trace.js +1 -1
- package/template-workspace/README.md.handlebars +20 -35
- package/template-workspace/oxfmt.config.ts +3 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +0 -24
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +4 -4
- package/templates/packages/shared-contracts-index.ts +4 -332
- package/templates/workspace/apps/modern.config.shared-module-federation.ts.handlebars +10 -0
- package/templates/workspace/apps/modern.config.ts.handlebars +13 -27
- package/templates/workspace/apps/shared/src/routes/ultramodern-route-metadata.ts.handlebars +21 -11
- package/templates/workspace/apps/shell-super-app/src/routes/[lang]/page.tsx.handlebars +20 -20
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.helpers.tsx.handlebars +4 -6
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.imports.tsx.handlebars +2 -2
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.tsx.handlebars +11 -11
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.worker.helpers.tsx.handlebars +1 -1
- package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.worker.imports.tsx.handlebars +1 -1
- package/templates/workspace-scripts/generate-node-backend-federation.mjs +68 -77
- package/templates/workspace-scripts/generate-public-surface-assets.mjs +107 -207
- package/templates/workspace-scripts/materialize-zerops-runtime.mjs +12 -19
- package/templates/workspace-scripts/proof-cloudflare-version.mjs +53 -444
- package/templates/workspace-scripts/proof-node-backend-federation.mjs +212 -91
- package/templates/workspace-scripts/{proof-workerd-ssr.mts → proof-workerd-ssr.mjs} +434 -239
- package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +25 -7
- package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +45 -147
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +1 -1
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.cjs +0 -212
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.cjs +0 -47
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.cjs +0 -112
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.cjs +0 -55
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.cjs +0 -102
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.cjs +0 -195
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.cjs +0 -146
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxlint.cjs +0 -110
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.cjs +0 -67
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.cjs +0 -307
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.cjs +0 -58
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.cjs +0 -71
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/generated-ui-source.cjs +0 -151
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/help.cjs +0 -67
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/install.cjs +0 -52
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/io.cjs +0 -447
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.cjs +0 -323
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/package-source.cjs +0 -87
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.cjs +0 -612
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.cjs +0 -376
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.cjs +0 -73
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/react-router-retirement.cjs +0 -215
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect/toolchain-pins.cjs +0 -135
- package/dist/cjs/ultramodern-tooling/commands/migrate-strict-effect.cjs +0 -454
- package/dist/cjs/ultramodern-tooling/config/constants.cjs +0 -48
- package/dist/cjs/ultramodern-tooling/config/synthesize.cjs +0 -157
- package/dist/cjs/ultramodern-workspace/delivery-unit-schema/up-projection.cjs +0 -188
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.js +0 -154
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +0 -9
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.js +0 -63
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.js +0 -7
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +0 -47
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +0 -146
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.js +0 -97
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxlint.js +0 -61
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.js +0 -16
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.js +0 -258
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.js +0 -10
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.js +0 -8
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.js +0 -15
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/generated-ui-source.js +0 -100
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/help.js +0 -29
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/install.js +0 -14
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/io.js +0 -385
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +0 -276
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/package-source.js +0 -49
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +0 -559
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +0 -329
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +0 -19
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/react-router-retirement.js +0 -148
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect/toolchain-pins.js +0 -80
- package/dist/esm/ultramodern-tooling/commands/migrate-strict-effect.js +0 -405
- package/dist/esm/ultramodern-tooling/config/constants.js +0 -4
- package/dist/esm/ultramodern-tooling/config/synthesize.js +0 -108
- package/dist/esm/ultramodern-workspace/delivery-unit-schema/up-projection.js +0 -129
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.js +0 -155
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.js +0 -10
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.js +0 -64
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.js +0 -8
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.js +0 -48
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.js +0 -147
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.js +0 -98
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxlint.js +0 -62
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.js +0 -17
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.js +0 -259
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.js +0 -11
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.js +0 -9
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.js +0 -16
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/generated-ui-source.js +0 -101
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/help.js +0 -30
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/install.js +0 -15
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/io.js +0 -386
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.js +0 -277
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/package-source.js +0 -50
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.js +0 -560
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.js +0 -330
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.js +0 -20
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/react-router-retirement.js +0 -149
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect/toolchain-pins.js +0 -81
- package/dist/esm-node/ultramodern-tooling/commands/migrate-strict-effect.js +0 -406
- package/dist/esm-node/ultramodern-tooling/config/constants.js +0 -5
- package/dist/esm-node/ultramodern-tooling/config/synthesize.js +0 -109
- package/dist/esm-node/ultramodern-workspace/delivery-unit-schema/up-projection.js +0 -130
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/api-metadata.d.ts +0 -12
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/declaration-patches.d.ts +0 -4
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/dependency-usage.d.ts +0 -1
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-backend-federation.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-build-identity.d.ts +0 -5
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-modern-configs.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxfmt.d.ts +0 -2
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-oxlint.d.ts +0 -2
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-removal.d.ts +0 -4
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-typescript.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts-zerops.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-artifacts.d.ts +0 -8
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-patches.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/generated-ui-source.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/help.d.ts +0 -1
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/install.d.ts +0 -2
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/io.d.ts +0 -26
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/package-cohort.d.ts +0 -25
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/package-source.d.ts +0 -3
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/pnpm-policy.d.ts +0 -26
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/pnpm-yaml.d.ts +0 -26
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/policy-constants.d.ts +0 -6
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/react-router-retirement.d.ts +0 -37
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect/toolchain-pins.d.ts +0 -4
- package/dist/types/ultramodern-tooling/commands/migrate-strict-effect.d.ts +0 -2
- package/dist/types/ultramodern-tooling/config/constants.d.ts +0 -3
- package/dist/types/ultramodern-tooling/config/synthesize.d.ts +0 -5
- package/dist/types/ultramodern-workspace/delivery-unit-schema/up-projection.d.ts +0 -189
- package/template-workspace/patches/@module-federation__bridge-react@2.9.0.patch +0 -47
- package/template-workspace/patches/@module-federation__dts-plugin@2.9.0.patch +0 -26
- package/template-workspace/patches/@module-federation__modern-js-v3@2.9.0.patch +0 -268
- package/template-workspace/patches/@module-federation__runtime-core@2.9.0.patch +0 -13
- package/template-workspace/patches/drizzle-orm-ts7-strict-declarations.patch +0 -471
- package/template-workspace/patches/msgpackr@2.1.0.patch +0 -30
- package/template-workspace/patches/zod@4.5.4.patch +0 -56
- package/templates/workspace-scripts/check-ultramodern-api-boundaries.mts +0 -779
- package/templates/workspace-scripts/check-ultramodern-i18n-boundaries.mts +0 -9
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +0 -4109
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
import node_fs from "node:fs";
|
|
3
|
-
import node_path from "node:path";
|
|
4
|
-
import { RELEASE_COHORT_PROJECTION_PATH, readCreateReleaseCohort } from "../../ultramodern-release-cohort.js";
|
|
5
|
-
import { createDevelopmentOverlay, createTopology, createUltramodernConfig } from "../../ultramodern-workspace/contracts.js";
|
|
6
|
-
import { stampDeliveryUnitIdentity } from "../../ultramodern-workspace/delivery-unit-stamp.js";
|
|
7
|
-
import { ULTRAMODERN_WORKSPACE_POLICY } from "../../ultramodern-workspace/policy.js";
|
|
8
|
-
import { createAdditionalShellConfigEntry } from "../../ultramodern-workspace/shells.js";
|
|
9
|
-
import { createWorkspaceValidationScript, migratedWorkspaceScriptArtifacts } from "../../ultramodern-workspace/workspace-scripts.js";
|
|
10
|
-
import { additionalShellsFromToolingConfig, allWorkspaceAppsFromToolingConfig, normalizeCompactUltramodernConfig, synthesizeCompactUltramodernConfig, workspaceAppsFromToolingConfig } from "../config.js";
|
|
11
|
-
import { reconcileCompactPackageSourceMetadata, reconcilePackageSourceMetadata, updateReferenceTopology, updateUltramodernConfig } from "./migrate-strict-effect/api-metadata.js";
|
|
12
|
-
import { ensureGeneratedDeclarationPatches } from "./migrate-strict-effect/declaration-patches.js";
|
|
13
|
-
import { workspaceUsesDependency } from "./migrate-strict-effect/dependency-usage.js";
|
|
14
|
-
import { ensureGeneratedOxfmtIgnorePatterns, ensureGeneratedOxlintComponentStyle, removeGeneratedFileIfExists, removeStaleBackendFederationArtifacts, updateGeneratedBackendFederationContractFiles, updateGeneratedBuildIdentityModules, updateGeneratedModernConfigs, updateGeneratedTypeScriptSurfaces, updateGeneratedZeropsArtifacts } from "./migrate-strict-effect/generated-artifacts.js";
|
|
15
|
-
import { migrateStrictEffectHelp } from "./migrate-strict-effect/help.js";
|
|
16
|
-
import { runPnpmLockfileRefresh } from "./migrate-strict-effect/install.js";
|
|
17
|
-
import { createMigrationIo, listWorkspacePackageFiles, readJsonFile, withStagedDryRunMigrationIo, writeJsonFile } from "./migrate-strict-effect/io.js";
|
|
18
|
-
import { ensureBffEffectDependencies, updateGeneratedPackageScripts, updateGeneratedToolingDependencies, updateModernDependencies } from "./migrate-strict-effect/package-cohort.js";
|
|
19
|
-
import { createMigrationPackageSource } from "./migrate-strict-effect/package-source.js";
|
|
20
|
-
import { updateGeneratedPnpmWorkspacePolicy, validateGeneratedPnpmLockReleaseAgePolicy } from "./migrate-strict-effect/pnpm-policy.js";
|
|
21
|
-
import { ensureGeneratedModuleFederationBridgeRouterOptOut, preflightModuleFederationBridgeRouter, removeRetiredReactRouterDependency } from "./migrate-strict-effect/react-router-retirement.js";
|
|
22
|
-
import { updateGeneratedToolchainFiles, updateRootPackageToolchain } from "./migrate-strict-effect/toolchain-pins.js";
|
|
23
|
-
import { hasFlag } from "./options.js";
|
|
24
|
-
const retiredMetadataPaths = [
|
|
25
|
-
'.modernjs/ultramodern-generated-contract.json',
|
|
26
|
-
'.modernjs/ultramodern-package-source.json',
|
|
27
|
-
'.modernjs/ultramodern-workspace-template-manifest.json'
|
|
28
|
-
];
|
|
29
|
-
const rootPackageSourceOwnedKeys = [
|
|
30
|
-
...ULTRAMODERN_WORKSPACE_POLICY.metadata.packageSource.ownedKeys,
|
|
31
|
-
'config'
|
|
32
|
-
];
|
|
33
|
-
function requireRecord(value, label) {
|
|
34
|
-
if (!value || 'object' != typeof value || Array.isArray(value)) throw new Error(`${label} must be an object.`);
|
|
35
|
-
return value;
|
|
36
|
-
}
|
|
37
|
-
function synchronizeMigrationDeliveryUnitMetadata(io, raw, packageSource) {
|
|
38
|
-
const normalized = normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
39
|
-
const apps = workspaceAppsFromToolingConfig(normalized);
|
|
40
|
-
const appById = new Map(apps.map((app)=>[
|
|
41
|
-
app.id,
|
|
42
|
-
app
|
|
43
|
-
]));
|
|
44
|
-
const scope = normalized.workspace.packageScope;
|
|
45
|
-
apps.filter((app)=>'shell' !== app.kind);
|
|
46
|
-
const primaryShell = apps.find((app)=>'shell' === app.kind);
|
|
47
|
-
const canonicalCompact = requireRecord(createUltramodernConfig(scope, packageSource.modernPackageVersion, packageSource, apps, normalized.features.tailwind, normalized.bridge, additionalShellsFromToolingConfig(normalized), primaryShell), 'Generated compact config');
|
|
48
|
-
const canonicalCompactApps = new Map((canonicalCompact.topology?.apps ?? []).map((entry)=>[
|
|
49
|
-
String(entry.id),
|
|
50
|
-
entry
|
|
51
|
-
]));
|
|
52
|
-
for (const entry of raw.topology?.apps ?? []){
|
|
53
|
-
if (!entry || 'object' != typeof entry || Array.isArray(entry)) continue;
|
|
54
|
-
const app = appById.get(String(entry.id));
|
|
55
|
-
if (app) {
|
|
56
|
-
stampDeliveryUnitIdentity(entry, scope, app);
|
|
57
|
-
const canonicalEntry = canonicalCompactApps.get(app.id);
|
|
58
|
-
if (canonicalEntry) {
|
|
59
|
-
entry.moduleFederation = canonicalEntry.moduleFederation;
|
|
60
|
-
entry.backendFederation = canonicalEntry.backendFederation;
|
|
61
|
-
entry.api = canonicalEntry.api;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
writeJsonFile(io, node_path.join(io.workspaceRoot, '.modernjs/ultramodern.json'), raw);
|
|
66
|
-
const topologyPath = node_path.join(io.workspaceRoot, 'topology/reference-topology.json');
|
|
67
|
-
if (!node_fs.existsSync(topologyPath)) return;
|
|
68
|
-
const topology = readJsonFile(topologyPath);
|
|
69
|
-
const synchronizedConfig = normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
70
|
-
const synchronizedApps = workspaceAppsFromToolingConfig(synchronizedConfig);
|
|
71
|
-
const synchronizedRemotes = synchronizedApps.filter((app)=>'shell' !== app.kind);
|
|
72
|
-
const synchronizedPrimaryShell = synchronizedApps.find((app)=>'shell' === app.kind);
|
|
73
|
-
const canonicalTopology = requireRecord(createTopology(scope, synchronizedRemotes, synchronizedPrimaryShell), 'Generated reference topology');
|
|
74
|
-
for (const key of [
|
|
75
|
-
'schemaVersion',
|
|
76
|
-
'id',
|
|
77
|
-
"description",
|
|
78
|
-
'preset',
|
|
79
|
-
'sharedPackages',
|
|
80
|
-
'validation'
|
|
81
|
-
])topology[key] = canonicalTopology[key];
|
|
82
|
-
const canonicalTopologyApps = new Map([
|
|
83
|
-
canonicalTopology.shell,
|
|
84
|
-
...canonicalTopology.verticals ?? []
|
|
85
|
-
].map((entry)=>[
|
|
86
|
-
String(entry.id),
|
|
87
|
-
entry
|
|
88
|
-
]));
|
|
89
|
-
for (const entry of [
|
|
90
|
-
topology.shell,
|
|
91
|
-
...topology.verticals ?? []
|
|
92
|
-
]){
|
|
93
|
-
if (!entry || 'object' != typeof entry || Array.isArray(entry)) continue;
|
|
94
|
-
const app = appById.get(String(entry.id));
|
|
95
|
-
if (app) {
|
|
96
|
-
stampDeliveryUnitIdentity(entry, scope, app);
|
|
97
|
-
const canonicalEntry = canonicalTopologyApps.get(app.id);
|
|
98
|
-
if (canonicalEntry) for (const key of [
|
|
99
|
-
'moduleFederation',
|
|
100
|
-
'backendFederation',
|
|
101
|
-
'api',
|
|
102
|
-
'cloudflare',
|
|
103
|
-
'ownership'
|
|
104
|
-
])if (Object.hasOwn(canonicalEntry, key)) entry[key] = canonicalEntry[key];
|
|
105
|
-
else delete entry[key];
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
writeJsonFile(io, topologyPath, topology);
|
|
109
|
-
}
|
|
110
|
-
const compactPolicyKeys = [
|
|
111
|
-
'schemaVersion',
|
|
112
|
-
'profile',
|
|
113
|
-
'workspace',
|
|
114
|
-
'features',
|
|
115
|
-
'deploy',
|
|
116
|
-
'moduleFederation',
|
|
117
|
-
'backendFederation',
|
|
118
|
-
'agentSkills',
|
|
119
|
-
'tooling'
|
|
120
|
-
];
|
|
121
|
-
function synchronizeMigrationCompactPolicy(io, raw, packageSource) {
|
|
122
|
-
const migrated = normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
123
|
-
const apps = workspaceAppsFromToolingConfig(migrated);
|
|
124
|
-
apps.filter((app)=>'shell' !== app.kind);
|
|
125
|
-
const canonical = requireRecord(createUltramodernConfig(migrated.workspace.packageScope, packageSource.modernPackageVersion, packageSource, apps, migrated.features.tailwind, migrated.bridge, additionalShellsFromToolingConfig(migrated), apps.find((app)=>'shell' === app.kind)), 'Generated compact policy');
|
|
126
|
-
for (const key of compactPolicyKeys)raw[key] = canonical[key];
|
|
127
|
-
writeJsonFile(io, node_path.join(io.workspaceRoot, '.modernjs/ultramodern.json'), raw);
|
|
128
|
-
}
|
|
129
|
-
function reconcileRootPackageSourceMetadata(packageJson, packageSource) {
|
|
130
|
-
const modernjs = void 0 === packageJson.modernjs ? {} : requireRecord(packageJson.modernjs, 'package.json modernjs');
|
|
131
|
-
packageJson.modernjs = modernjs;
|
|
132
|
-
modernjs.packageSource = reconcilePackageSourceMetadata(modernjs.packageSource, {
|
|
133
|
-
canonical: {
|
|
134
|
-
strategy: packageSource.strategy,
|
|
135
|
-
config: './.modernjs/ultramodern.json'
|
|
136
|
-
},
|
|
137
|
-
label: 'package.json modernjs.packageSource',
|
|
138
|
-
ownedKeys: rootPackageSourceOwnedKeys
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
function requireString(value, label) {
|
|
142
|
-
if ('string' != typeof value || 0 === value.length) throw new Error(`${label} must be a non-empty string.`);
|
|
143
|
-
return value;
|
|
144
|
-
}
|
|
145
|
-
function assertUnique(values, label) {
|
|
146
|
-
if (new Set(values).size !== values.length) throw new Error(`${label} contains duplicate identities.`);
|
|
147
|
-
}
|
|
148
|
-
function deriveValidationContractInputs(workspaceRoot, migrated, migratedApps) {
|
|
149
|
-
const rootPackage = readJsonFile(node_path.join(workspaceRoot, 'package.json'));
|
|
150
|
-
const scope = requireString(rootPackage.name, 'Root package name');
|
|
151
|
-
if (migrated.workspace.packageScope !== scope) throw new Error(`Compact package scope ${migrated.workspace.packageScope} does not match root package ${scope}.`);
|
|
152
|
-
const topologyPath = node_path.join(workspaceRoot, 'topology/reference-topology.json');
|
|
153
|
-
if (!node_fs.existsSync(topologyPath)) throw new Error('Cannot render the migration validation contract without topology/reference-topology.json.');
|
|
154
|
-
const topology = readJsonFile(topologyPath);
|
|
155
|
-
const shell = requireRecord(topology.shell, 'Reference topology shell');
|
|
156
|
-
if (!Array.isArray(topology.verticals)) throw new Error('Reference topology verticals must be an array.');
|
|
157
|
-
const verticals = topology.verticals.map((value, index)=>requireRecord(value, `Reference topology verticals[${index}]`));
|
|
158
|
-
const expectedApps = [
|
|
159
|
-
{
|
|
160
|
-
id: requireString(shell.id, 'Reference topology shell.id'),
|
|
161
|
-
kind: 'shell',
|
|
162
|
-
packageName: requireString(shell.package, 'Reference topology shell.package'),
|
|
163
|
-
path: void 0,
|
|
164
|
-
hasApi: false
|
|
165
|
-
},
|
|
166
|
-
...verticals.map((vertical, index)=>({
|
|
167
|
-
id: requireString(vertical.id, `Reference topology verticals[${index}].id`),
|
|
168
|
-
kind: 'vertical',
|
|
169
|
-
packageName: requireString(vertical.package, `Reference topology verticals[${index}].package`),
|
|
170
|
-
path: requireString(vertical.path, `Reference topology verticals[${index}].path`),
|
|
171
|
-
hasApi: void 0 !== vertical.api
|
|
172
|
-
}))
|
|
173
|
-
];
|
|
174
|
-
assertUnique(expectedApps.map((app)=>app.id), 'Reference topology app cohort');
|
|
175
|
-
assertUnique(expectedApps.map((app)=>app.packageName), 'Reference topology package cohort');
|
|
176
|
-
const migratedById = new Map(migratedApps.map((app)=>[
|
|
177
|
-
app.id,
|
|
178
|
-
app
|
|
179
|
-
]));
|
|
180
|
-
assertUnique(migratedApps.map((app)=>app.id), 'Compact topology app cohort');
|
|
181
|
-
const expectedIds = expectedApps.map((app)=>app.id).sort();
|
|
182
|
-
const migratedIds = migratedApps.map((app)=>app.id).sort();
|
|
183
|
-
if (JSON.stringify(expectedIds) !== JSON.stringify(migratedIds)) throw new Error(`Compact topology app cohort ${migratedIds.join(', ')} does not match reference topology ${expectedIds.join(', ')}.`);
|
|
184
|
-
const appPackageFiles = listWorkspacePackageFiles(workspaceRoot).filter((relativePath)=>relativePath.startsWith('apps/') || relativePath.startsWith('verticals/'));
|
|
185
|
-
const manifests = appPackageFiles.map((relativePath)=>({
|
|
186
|
-
relativePath,
|
|
187
|
-
packageJson: readJsonFile(node_path.join(workspaceRoot, relativePath))
|
|
188
|
-
}));
|
|
189
|
-
const manifestsByName = new Map();
|
|
190
|
-
for (const manifest of manifests){
|
|
191
|
-
const name = requireString(manifest.packageJson.name, `${manifest.relativePath} name`);
|
|
192
|
-
if (manifestsByName.has(name)) throw new Error(`Duplicate workspace app package name ${name}.`);
|
|
193
|
-
manifestsByName.set(name, manifest);
|
|
194
|
-
}
|
|
195
|
-
const tailwindStates = [];
|
|
196
|
-
for (const expected of expectedApps){
|
|
197
|
-
const app = migratedById.get(expected.id);
|
|
198
|
-
if (!app || app.kind !== expected.kind) throw new Error(`Compact topology app ${expected.id} does not match reference kind ${expected.kind}.`);
|
|
199
|
-
if (Boolean(app.api) !== expected.hasApi) throw new Error(`Compact topology app ${expected.id} API presence does not match reference topology.`);
|
|
200
|
-
const manifest = manifestsByName.get(expected.packageName);
|
|
201
|
-
if (!manifest) throw new Error(`Reference topology package ${expected.packageName} has no workspace manifest.`);
|
|
202
|
-
const expectedManifestPath = `${app.directory}/package.json`;
|
|
203
|
-
if (manifest.relativePath !== expectedManifestPath) throw new Error(`${expected.packageName} is at ${manifest.relativePath}, expected ${expectedManifestPath}.`);
|
|
204
|
-
if (expected.path && expected.path !== app.directory) throw new Error(`Compact topology app ${expected.id} path ${app.directory} does not match reference path ${expected.path}.`);
|
|
205
|
-
tailwindStates.push(Object.hasOwn(requireRecord(manifest.packageJson.devDependencies ?? {}, `${manifest.relativePath} devDependencies`), '@rsbuild/plugin-tailwindcss'));
|
|
206
|
-
}
|
|
207
|
-
if (1 !== new Set(tailwindStates).size) throw new Error('Generated app package manifests disagree on the Tailwind feature state.');
|
|
208
|
-
const enableTailwind = tailwindStates[0] ?? false;
|
|
209
|
-
if (migrated.features.tailwind !== enableTailwind) throw new Error(`Compact Tailwind state ${migrated.features.tailwind} does not match package manifests ${enableTailwind}.`);
|
|
210
|
-
return {
|
|
211
|
-
scope,
|
|
212
|
-
enableTailwind,
|
|
213
|
-
remotes: migratedApps.filter((app)=>'shell' !== app.kind),
|
|
214
|
-
primaryShell: migratedApps.find((app)=>'shell' === app.kind),
|
|
215
|
-
additionalShells: additionalShellsFromToolingConfig(migrated)
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
function reconcileAdditionalShellConfig(raw, migrated, migratedApps, io) {
|
|
219
|
-
const additionalShells = additionalShellsFromToolingConfig(migrated);
|
|
220
|
-
if (0 === additionalShells.length) return migrated;
|
|
221
|
-
const existingShells = new Map((Array.isArray(raw.shells) ? raw.shells : []).filter((entry)=>null !== entry && 'object' == typeof entry && !Array.isArray(entry) && 'id' in entry && 'string' == typeof entry.id).map((entry)=>[
|
|
222
|
-
entry.id,
|
|
223
|
-
entry
|
|
224
|
-
]));
|
|
225
|
-
const remotes = migratedApps.filter((app)=>'shell' !== app.kind);
|
|
226
|
-
raw.shells = additionalShells.map((shell)=>({
|
|
227
|
-
...existingShells.get(shell.id),
|
|
228
|
-
...createAdditionalShellConfigEntry(migrated.workspace.packageScope, shell, remotes)
|
|
229
|
-
}));
|
|
230
|
-
writeJsonFile(io, node_path.join(io.workspaceRoot, '.modernjs/ultramodern.json'), raw);
|
|
231
|
-
return normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
232
|
-
}
|
|
233
|
-
function synchronizeMigrationDevelopmentOverlay(io, migrated, migratedApps) {
|
|
234
|
-
const overlayPath = node_path.join(io.workspaceRoot, 'topology/local-overlays/development.json');
|
|
235
|
-
const existing = node_fs.existsSync(overlayPath) ? requireRecord(readJsonFile(overlayPath), 'Development topology overlay') : {};
|
|
236
|
-
const canonical = requireRecord(createDevelopmentOverlay(migrated.workspace.packageScope, migratedApps.filter((app)=>'shell' !== app.kind)), 'Generated development topology overlay');
|
|
237
|
-
canonical.ports = Object.fromEntries(migratedApps.map((app)=>[
|
|
238
|
-
app.id,
|
|
239
|
-
app.port
|
|
240
|
-
]));
|
|
241
|
-
const frameworkOwnedKeys = new Set(Object.keys(canonical));
|
|
242
|
-
const reconciled = Object.fromEntries(Object.entries(existing).filter(([key])=>!frameworkOwnedKeys.has(key)));
|
|
243
|
-
Object.assign(reconciled, canonical);
|
|
244
|
-
writeJsonFile(io, overlayPath, reconciled);
|
|
245
|
-
return reconciled;
|
|
246
|
-
}
|
|
247
|
-
function migrateStrictEffect(args, context, io, dryRun, skipInstall) {
|
|
248
|
-
const compactPath = node_path.join(io.workspaceRoot, '.modernjs/ultramodern.json');
|
|
249
|
-
let raw;
|
|
250
|
-
if (node_fs.existsSync(compactPath)) raw = readJsonFile(compactPath);
|
|
251
|
-
else {
|
|
252
|
-
const synthesized = synthesizeCompactUltramodernConfig(io.workspaceRoot);
|
|
253
|
-
if (!synthesized) throw new Error("Missing .modernjs/ultramodern.json and no legacy UltraModern metadata (.modernjs/ultramodern-generated-contract.json) was found to synthesize it from.");
|
|
254
|
-
raw = synthesized.compact;
|
|
255
|
-
io.log(`Synthesized .modernjs/ultramodern.json from legacy metadata: ${synthesized.sources.join(', ')}.`);
|
|
256
|
-
if (synthesized.missing.length > 0) io.log(`Legacy metadata not found (using defaults): ${synthesized.missing.join(', ')}.`);
|
|
257
|
-
}
|
|
258
|
-
const current = normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
259
|
-
preflightModuleFederationBridgeRouter(io.workspaceRoot, allWorkspaceAppsFromToolingConfig(current));
|
|
260
|
-
const packageSource = createMigrationPackageSource(args, current);
|
|
261
|
-
const result = (status)=>({
|
|
262
|
-
status,
|
|
263
|
-
version: packageSource.modernPackageVersion
|
|
264
|
-
});
|
|
265
|
-
const releaseCohort = 'install' === packageSource.strategy ? readCreateReleaseCohort() : void 0;
|
|
266
|
-
reconcileCompactPackageSourceMetadata(raw.packageSource, packageSource);
|
|
267
|
-
reconcileRootPackageSourceMetadata(readJsonFile(node_path.join(io.workspaceRoot, 'package.json')), packageSource);
|
|
268
|
-
updateGeneratedPnpmWorkspacePolicy(createMigrationIo(io.workspaceRoot, true), packageSource, {
|
|
269
|
-
releaseCohort
|
|
270
|
-
});
|
|
271
|
-
updateUltramodernConfig(io, raw, packageSource);
|
|
272
|
-
if (releaseCohort) io.write(node_path.join(io.workspaceRoot, RELEASE_COHORT_PROJECTION_PATH), `${JSON.stringify(releaseCohort, null, 2)}\n`);
|
|
273
|
-
updateReferenceTopology(io);
|
|
274
|
-
synchronizeMigrationDeliveryUnitMetadata(io, raw, packageSource);
|
|
275
|
-
synchronizeMigrationCompactPolicy(io, raw, packageSource);
|
|
276
|
-
let migrated = normalizeCompactUltramodernConfig(io.workspaceRoot, raw);
|
|
277
|
-
let migratedApps = workspaceAppsFromToolingConfig(migrated);
|
|
278
|
-
migrated = reconcileAdditionalShellConfig(raw, migrated, migratedApps, io);
|
|
279
|
-
migratedApps = workspaceAppsFromToolingConfig(migrated);
|
|
280
|
-
const allMigratedApps = allWorkspaceAppsFromToolingConfig(migrated);
|
|
281
|
-
const developmentOverlay = synchronizeMigrationDevelopmentOverlay(io, migrated, allMigratedApps);
|
|
282
|
-
const validationContractInputs = deriveValidationContractInputs(io.workspaceRoot, migrated, migratedApps);
|
|
283
|
-
const verticalApps = migrated.topology.apps.filter((app)=>'shell' !== app.kind);
|
|
284
|
-
const hasBackendSurface = verticalApps.some((app)=>app.api);
|
|
285
|
-
const shellOnly = 0 === verticalApps.length;
|
|
286
|
-
if (shellOnly) {
|
|
287
|
-
io.log('Shell-only workspace: skipping backend-federation and Zerops runtime stages.');
|
|
288
|
-
for (const relativePath of [
|
|
289
|
-
"scripts/generate-node-backend-federation.mts",
|
|
290
|
-
"scripts/generate-node-backend-federation.mjs",
|
|
291
|
-
"scripts/proof-node-backend-federation.mts",
|
|
292
|
-
"scripts/proof-node-backend-federation.mjs",
|
|
293
|
-
"scripts/materialize-zerops-runtime.mjs",
|
|
294
|
-
'zerops.yaml'
|
|
295
|
-
])removeGeneratedFileIfExists(io, relativePath);
|
|
296
|
-
} else {
|
|
297
|
-
if (hasBackendSurface) {
|
|
298
|
-
removeStaleBackendFederationArtifacts(io, migrated);
|
|
299
|
-
updateGeneratedBackendFederationContractFiles(io, migrated);
|
|
300
|
-
} else for (const relativePath of [
|
|
301
|
-
"scripts/generate-node-backend-federation.mts",
|
|
302
|
-
"scripts/generate-node-backend-federation.mjs",
|
|
303
|
-
"scripts/proof-node-backend-federation.mts",
|
|
304
|
-
"scripts/proof-node-backend-federation.mjs"
|
|
305
|
-
])removeGeneratedFileIfExists(io, relativePath);
|
|
306
|
-
updateGeneratedZeropsArtifacts(io, migrated);
|
|
307
|
-
}
|
|
308
|
-
for (const artifact of migratedWorkspaceScriptArtifacts({
|
|
309
|
-
shellOnly,
|
|
310
|
-
hasBackendSurface
|
|
311
|
-
}))if ("scripts/validate-ultramodern-workspace.mts" !== artifact.relativePath) {
|
|
312
|
-
if (artifact.legacyPath) io.remove(node_path.join(io.workspaceRoot, artifact.legacyPath));
|
|
313
|
-
io.writeGenerated(node_path.join(io.workspaceRoot, artifact.relativePath), artifact.content);
|
|
314
|
-
}
|
|
315
|
-
io.writeGenerated(node_path.join(io.workspaceRoot, "scripts/validate-ultramodern-workspace.mts"), createWorkspaceValidationScript(validationContractInputs.scope, validationContractInputs.enableTailwind, validationContractInputs.remotes, releaseCohort, validationContractInputs.additionalShells, validationContractInputs.primaryShell, raw, node_fs.existsSync(node_path.join(io.workspaceRoot, 'topology/ownership.json')) ? requireRecord(readJsonFile(node_path.join(io.workspaceRoot, 'topology/ownership.json')), 'Ownership topology') : void 0, developmentOverlay));
|
|
316
|
-
for (const relativePath of retiredMetadataPaths)io.remove(node_path.join(io.workspaceRoot, relativePath));
|
|
317
|
-
updateGeneratedBuildIdentityModules(io, migrated);
|
|
318
|
-
updateGeneratedTypeScriptSurfaces(io, migrated);
|
|
319
|
-
const canRetireLegacyOxfmtCliExclusion = ensureGeneratedOxfmtIgnorePatterns(io);
|
|
320
|
-
const rootScripts = readJsonFile(node_path.join(io.workspaceRoot, 'package.json')).scripts;
|
|
321
|
-
const hasLegacyOxfmtCliExclusion = rootScripts && 'object' == typeof rootScripts && !Array.isArray(rootScripts) && Object.values(rootScripts).some((script)=>'string' == typeof script && /\boxfmt(?: --check)? \. '!repos\/\*\*'(?:\s*&&|$)/u.test(script));
|
|
322
|
-
if (hasLegacyOxfmtCliExclusion && !canRetireLegacyOxfmtCliExclusion) throw new Error("Cannot replace the legacy Oxfmt '!repos/**' CLI exclusion until oxfmt.config.ts has a static ignorePatterns array containing 'repos/**'.");
|
|
323
|
-
for (const relativePackageFile of listWorkspacePackageFiles(io.workspaceRoot)){
|
|
324
|
-
const packageFile = node_path.join(io.workspaceRoot, relativePackageFile);
|
|
325
|
-
const packageJson = readJsonFile(packageFile);
|
|
326
|
-
if ('package.json' === relativePackageFile) {
|
|
327
|
-
reconcileRootPackageSourceMetadata(packageJson, packageSource);
|
|
328
|
-
updateRootPackageToolchain(packageJson);
|
|
329
|
-
}
|
|
330
|
-
updateModernDependencies(packageJson, packageSource);
|
|
331
|
-
const ownsGeneratedScripts = 'package.json' === relativePackageFile || allMigratedApps.some((app)=>`${app.directory}/package.json` === relativePackageFile);
|
|
332
|
-
updateGeneratedToolingDependencies(packageJson, {
|
|
333
|
-
ownsGeneratedScripts
|
|
334
|
-
});
|
|
335
|
-
ensureBffEffectDependencies(packageJson);
|
|
336
|
-
const retiredReactRouter = removeRetiredReactRouterDependency(packageJson, node_path.join(io.workspaceRoot, node_path.dirname(relativePackageFile)));
|
|
337
|
-
if ('preserved' === retiredReactRouter) io.log(`${relativePackageFile} keeps its react-router dependency: authored source imports React Router directly, so its generated Module Federation config keeps bridge.enableBridgeRouter: true.`);
|
|
338
|
-
else if ('removed' === retiredReactRouter) io.log(`${relativePackageFile} dropped its obsolete react-router dependency: no authored source imports React Router.`);
|
|
339
|
-
updateGeneratedPackageScripts(packageJson, {
|
|
340
|
-
relativePackageFile,
|
|
341
|
-
apps: allMigratedApps,
|
|
342
|
-
shellOnly,
|
|
343
|
-
canRetireLegacyOxfmtCliExclusion,
|
|
344
|
-
onPreserveScript: (scriptName)=>io.log(`${relativePackageFile} script ${JSON.stringify(scriptName)} was preserved: an existing command is mixed consumer/framework ownership.`)
|
|
345
|
-
});
|
|
346
|
-
writeJsonFile(io, packageFile, packageJson);
|
|
347
|
-
}
|
|
348
|
-
updateGeneratedModernConfigs(io, migrated);
|
|
349
|
-
ensureGeneratedModuleFederationBridgeRouterOptOut(io, allMigratedApps);
|
|
350
|
-
updateGeneratedPnpmWorkspacePolicy(io, packageSource, {
|
|
351
|
-
releaseCohort
|
|
352
|
-
});
|
|
353
|
-
updateGeneratedToolchainFiles(io);
|
|
354
|
-
const drizzleOrmPatch = ULTRAMODERN_WORKSPACE_POLICY.pnpm.patchedDependencies.conditional.find((patch)=>'drizzle-orm' === patch.packageName);
|
|
355
|
-
ensureGeneratedDeclarationPatches(io, {
|
|
356
|
-
includeDrizzleOrmPatch: void 0 !== drizzleOrmPatch && workspaceUsesDependency(io.workspaceRoot, drizzleOrmPatch.packageName, drizzleOrmPatch.version)
|
|
357
|
-
});
|
|
358
|
-
ensureGeneratedOxlintComponentStyle(io);
|
|
359
|
-
if (!skipInstall) return io.withStagedWorkspace((stagedWorkspaceRoot)=>{
|
|
360
|
-
node_fs.rmSync(node_path.join(stagedWorkspaceRoot, 'pnpm-lock.yaml'), {
|
|
361
|
-
force: true
|
|
362
|
-
});
|
|
363
|
-
const status = runPnpmLockfileRefresh({
|
|
364
|
-
...context,
|
|
365
|
-
workspaceRoot: stagedWorkspaceRoot
|
|
366
|
-
});
|
|
367
|
-
if (0 !== status) return result(status);
|
|
368
|
-
return validateGeneratedPnpmLockReleaseAgePolicy(stagedWorkspaceRoot, packageSource, {
|
|
369
|
-
releaseCohort
|
|
370
|
-
}).then(()=>{
|
|
371
|
-
io.write(node_path.join(io.workspaceRoot, 'pnpm-lock.yaml'), node_fs.readFileSync(node_path.join(stagedWorkspaceRoot, 'pnpm-lock.yaml'), 'utf-8'));
|
|
372
|
-
return result(0);
|
|
373
|
-
});
|
|
374
|
-
});
|
|
375
|
-
if (dryRun) {
|
|
376
|
-
for (const line of io.plan)process.stdout.write(`${line}\n`);
|
|
377
|
-
process.stdout.write(`[dry-run] migrate-strict-effect would migrate UltraModern strict Effect metadata to ${packageSource.modernPackageVersion}.\n`);
|
|
378
|
-
}
|
|
379
|
-
return result(0);
|
|
380
|
-
}
|
|
381
|
-
function runMigrateStrictEffect(args, context) {
|
|
382
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
383
|
-
process.stdout.write(migrateStrictEffectHelp);
|
|
384
|
-
return 0;
|
|
385
|
-
}
|
|
386
|
-
const dryRun = hasFlag(args, '--dry-run');
|
|
387
|
-
const skipInstall = dryRun || hasFlag(args, '--skip-install');
|
|
388
|
-
const runMigration = (io, migrationContext)=>io.transaction(()=>migrateStrictEffect(args, migrationContext, io, dryRun, skipInstall), {
|
|
389
|
-
commitWhen: (migrationResult)=>0 === migrationResult.status
|
|
390
|
-
});
|
|
391
|
-
const migration = dryRun ? withStagedDryRunMigrationIo(context.workspaceRoot, (io)=>{
|
|
392
|
-
const invocationRelativePath = node_path.relative(context.workspaceRoot, context.invocationCwd);
|
|
393
|
-
const invocationIsOutsideWorkspace = '..' === invocationRelativePath || invocationRelativePath.startsWith(`..${node_path.sep}`) || node_path.isAbsolute(invocationRelativePath);
|
|
394
|
-
return runMigration(io, {
|
|
395
|
-
workspaceRoot: io.workspaceRoot,
|
|
396
|
-
invocationCwd: invocationIsOutsideWorkspace ? context.invocationCwd : node_path.join(io.workspaceRoot, invocationRelativePath)
|
|
397
|
-
});
|
|
398
|
-
}) : runMigration(createMigrationIo(context.workspaceRoot, false), context);
|
|
399
|
-
const report = (migrationResult)=>{
|
|
400
|
-
if (0 === migrationResult.status && !dryRun) process.stdout.write(`UltraModern strict Effect metadata migrated to ${migrationResult.version}. Run pnpm api:check && pnpm contract:check next.\n`);
|
|
401
|
-
return migrationResult.status;
|
|
402
|
-
};
|
|
403
|
-
if (migration instanceof Promise) return migration.then(report);
|
|
404
|
-
return report(migration);
|
|
405
|
-
}
|
|
406
|
-
export { runMigrateStrictEffect };
|
|
@@ -1,5 +0,0 @@
|
|
|
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 };
|
|
@@ -1,109 +0,0 @@
|
|
|
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 };
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import "node:module";
|
|
2
|
-
function ownershipToOwner(ownership) {
|
|
3
|
-
if (void 0 !== ownership.owner) {
|
|
4
|
-
const { kind, id, contact } = ownership.owner;
|
|
5
|
-
return void 0 === contact ? {
|
|
6
|
-
kind,
|
|
7
|
-
id
|
|
8
|
-
} : {
|
|
9
|
-
kind,
|
|
10
|
-
id,
|
|
11
|
-
contact
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
return {
|
|
15
|
-
kind: 'team',
|
|
16
|
-
id: ownership.team,
|
|
17
|
-
contact: ownership.slack
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function projectKindUp(app, mode) {
|
|
21
|
-
if ('shell' === app.kind) return 'shell';
|
|
22
|
-
return 'extended-v1' === mode && 'horizontal-remote' === app.deliveryUnitKind ? 'horizontal-remote' : 'microvertical';
|
|
23
|
-
}
|
|
24
|
-
const SEGMENT_UNSAFE = /[^A-Za-z0-9._-]+/g;
|
|
25
|
-
const SEGMENT_TRIM = /^-+|-+$/g;
|
|
26
|
-
function exposeSurfaceId(key) {
|
|
27
|
-
const trimmed = key.replace(/^\.\//, '');
|
|
28
|
-
const cleaned = trimmed.replace(SEGMENT_UNSAFE, '-').replace(SEGMENT_TRIM, '');
|
|
29
|
-
return '' === cleaned ? 'surface' : cleaned;
|
|
30
|
-
}
|
|
31
|
-
function exposeSurface(app, key, value) {
|
|
32
|
-
const isRoute = /route/i.test(key) || /route/i.test(value);
|
|
33
|
-
const location = {
|
|
34
|
-
platform: 'browser-mf',
|
|
35
|
-
manifestUrl: `http://localhost:${app.port}/mf-manifest.json`
|
|
36
|
-
};
|
|
37
|
-
const common = {
|
|
38
|
-
surfaceId: exposeSurfaceId(key),
|
|
39
|
-
locations: [
|
|
40
|
-
location
|
|
41
|
-
]
|
|
42
|
-
};
|
|
43
|
-
return isRoute ? {
|
|
44
|
-
kind: 'route',
|
|
45
|
-
...common
|
|
46
|
-
} : {
|
|
47
|
-
kind: 'component',
|
|
48
|
-
...common
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
function apiSurface(api, protocol, address = api.prefix) {
|
|
52
|
-
return {
|
|
53
|
-
kind: 'api',
|
|
54
|
-
surfaceId: api.stem,
|
|
55
|
-
protocol,
|
|
56
|
-
locations: [
|
|
57
|
-
{
|
|
58
|
-
platform: 'http',
|
|
59
|
-
address
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function projectSurfaces(app, protocol) {
|
|
65
|
-
const surfaces = [];
|
|
66
|
-
for (const [key, value] of Object.entries(app.exposes ?? {}))surfaces.push(exposeSurface(app, key, value));
|
|
67
|
-
if (void 0 !== app.api) surfaces.push(apiSurface(app.api, protocol));
|
|
68
|
-
return surfaces;
|
|
69
|
-
}
|
|
70
|
-
function projectV1ToDeliveryUnit(app, context) {
|
|
71
|
-
const mode = context.mode ?? 'strict-legacy';
|
|
72
|
-
const protocol = context.apiProtocol ?? ('extended-v1' === mode ? app.api?.protocol : void 0) ?? 'rest';
|
|
73
|
-
return {
|
|
74
|
-
unitId: `${context.scope}/${app.domain ?? app.id}`,
|
|
75
|
-
kind: projectKindUp(app, mode),
|
|
76
|
-
owner: ownershipToOwner(app.ownership),
|
|
77
|
-
sourceRevision: context.sourceRevision,
|
|
78
|
-
buildMarker: context.buildMarker,
|
|
79
|
-
baselineCohort: context.baselineCohort,
|
|
80
|
-
publicationZone: {
|
|
81
|
-
zone: 'coordinated'
|
|
82
|
-
},
|
|
83
|
-
surfaces: projectSurfaces(app, protocol)
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
class V1UnrepresentableError extends Error {
|
|
87
|
-
constructor(reason){
|
|
88
|
-
super(`Descriptor unrepresentable in v1: ${reason}.`), this.code = 'unrepresentable-in-v1';
|
|
89
|
-
this.name = 'V1UnrepresentableError';
|
|
90
|
-
this.reason = reason;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
function checkSurfaceRepresentable(surface, mode) {
|
|
94
|
-
if ('component' === surface.kind || 'route' === surface.kind) return 'component-or-route-surface';
|
|
95
|
-
if ('backend' === surface.kind) return 'backend-surface';
|
|
96
|
-
if ('rest' !== surface.protocol && !('extended-v1' === mode && 'rpc' === surface.protocol)) return 'non-rest-protocol';
|
|
97
|
-
const [first, ...rest] = surface.locations;
|
|
98
|
-
if (void 0 === first || rest.length > 0 || 'http' !== first.platform) return 'unsupported-surface-shape';
|
|
99
|
-
if (void 0 !== surface.externallyPublished || void 0 !== surface.unknownFields) return 'unsupported-surface-shape';
|
|
100
|
-
}
|
|
101
|
-
function checkV1Representable(descriptor, mode = 'strict-legacy') {
|
|
102
|
-
const unrepresentable = (reason)=>({
|
|
103
|
-
representable: false,
|
|
104
|
-
code: 'unrepresentable-in-v1',
|
|
105
|
-
reason
|
|
106
|
-
});
|
|
107
|
-
if ('strict-legacy' === mode && 'horizontal-remote' === descriptor.kind) return unrepresentable('horizontal-remote-kind');
|
|
108
|
-
if (void 0 !== descriptor.unknownFields) return unrepresentable('unknown-fields');
|
|
109
|
-
const zone = descriptor.publicationZone;
|
|
110
|
-
if (void 0 === zone) return unrepresentable('non-canonical-zone');
|
|
111
|
-
if ('external' === zone.zone) return unrepresentable('external-zone');
|
|
112
|
-
if ('coordinated' !== zone.zone || 1 !== Object.keys(zone).length) return unrepresentable('non-canonical-zone');
|
|
113
|
-
let apiSurfaceCount = 0;
|
|
114
|
-
for (const surface of descriptor.surfaces){
|
|
115
|
-
if ('api' === surface.kind) {
|
|
116
|
-
apiSurfaceCount += 1;
|
|
117
|
-
if (apiSurfaceCount > 1) return unrepresentable('multiple-api-surfaces');
|
|
118
|
-
}
|
|
119
|
-
const reason = checkSurfaceRepresentable(surface, mode);
|
|
120
|
-
if (void 0 !== reason) return unrepresentable(reason);
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
representable: true
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
function assertV1Representable(descriptor, mode = 'strict-legacy') {
|
|
127
|
-
const result = checkV1Representable(descriptor, mode);
|
|
128
|
-
if (!result.representable) throw new V1UnrepresentableError(result.reason);
|
|
129
|
-
}
|
|
130
|
-
export { V1UnrepresentableError, apiSurface, assertV1Representable, checkV1Representable, exposeSurface, exposeSurfaceId, ownershipToOwner, projectV1ToDeliveryUnit };
|