@bleedingdev/modern-js-ultramodern-create 3.9.0-ultramodern.12 → 3.9.0-ultramodern.13

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.
Files changed (201) hide show
  1. package/README.md +32 -36
  2. package/dist/cjs/ultramodern-release-cohort.cjs +6 -21
  3. package/dist/cjs/ultramodern-tooling/commands/context.cjs +2 -1
  4. package/dist/cjs/ultramodern-tooling/commands/validate.cjs +2 -57
  5. package/dist/cjs/ultramodern-tooling/commands.cjs +11 -1
  6. package/dist/cjs/ultramodern-tooling/config/index.cjs +11 -4
  7. package/dist/cjs/ultramodern-tooling/config/load.cjs +4 -17
  8. package/dist/cjs/ultramodern-tooling/config/metadata.cjs +41 -2
  9. package/dist/cjs/ultramodern-tooling/config/normalize.cjs +121 -208
  10. package/dist/cjs/ultramodern-workspace/add-shell.cjs +51 -18
  11. package/dist/cjs/ultramodern-workspace/add-vertical/execute.cjs +40 -39
  12. package/dist/cjs/ultramodern-workspace/add-vertical/plan.cjs +1 -1
  13. package/dist/cjs/ultramodern-workspace/add-vertical/preflight.cjs +2 -8
  14. package/dist/cjs/ultramodern-workspace/add-vertical/topology.cjs +0 -32
  15. package/dist/cjs/ultramodern-workspace/add-vertical/workspace-state.cjs +3 -10
  16. package/dist/cjs/ultramodern-workspace/api/contracts.cjs +2 -2
  17. package/dist/cjs/ultramodern-workspace/api/rpc.cjs +16 -14
  18. package/dist/cjs/ultramodern-workspace/api/service.cjs +4 -8
  19. package/dist/cjs/ultramodern-workspace/api/shared.cjs +1 -1
  20. package/dist/cjs/ultramodern-workspace/backend-federation.cjs +3 -3
  21. package/dist/cjs/ultramodern-workspace/contracts.cjs +14 -183
  22. package/dist/cjs/ultramodern-workspace/delivery-unit-stamp.cjs +10 -5
  23. package/dist/cjs/ultramodern-workspace/delivery-unit-sync.cjs +27 -17
  24. package/dist/cjs/ultramodern-workspace/delivery-unit.cjs +11 -6
  25. package/dist/cjs/ultramodern-workspace/descriptors.cjs +0 -4
  26. package/dist/cjs/ultramodern-workspace/generation-result.cjs +1 -1
  27. package/dist/cjs/ultramodern-workspace/index.cjs +2 -5
  28. package/dist/cjs/ultramodern-workspace/mf-validation/constants.cjs +0 -6
  29. package/dist/cjs/ultramodern-workspace/mf-validation/discovery.cjs +6 -6
  30. package/dist/cjs/ultramodern-workspace/mf-validation/path-utils.cjs +37 -38
  31. package/dist/cjs/ultramodern-workspace/module-federation/config.cjs +8 -15
  32. package/dist/cjs/ultramodern-workspace/package-json.cjs +47 -54
  33. package/dist/cjs/ultramodern-workspace/patch-inventory.cjs +27 -36
  34. package/dist/cjs/ultramodern-workspace/policy.cjs +6 -354
  35. package/dist/cjs/ultramodern-workspace/public-surface.cjs +2 -2
  36. package/dist/cjs/ultramodern-workspace/routes.cjs +11 -7
  37. package/dist/cjs/ultramodern-workspace/shells.cjs +0 -70
  38. package/dist/cjs/ultramodern-workspace/tooling-command-catalog.cjs +6 -43
  39. package/dist/cjs/ultramodern-workspace/tsconfigs.cjs +3 -1
  40. package/dist/cjs/ultramodern-workspace/validation/architecture.cjs +5 -5
  41. package/dist/cjs/ultramodern-workspace/validation/workspace.cjs +275 -1249
  42. package/dist/cjs/ultramodern-workspace/versions.cjs +25 -41
  43. package/dist/cjs/ultramodern-workspace/workspace-artifact-ownership.cjs +1 -6
  44. package/dist/cjs/ultramodern-workspace/workspace-script-plan.cjs +7 -7
  45. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +17 -112
  46. package/dist/cjs/ultramodern-workspace/workspace-validation-contract.cjs +62 -371
  47. package/dist/cjs/ultramodern-workspace/write-app.cjs +5 -4
  48. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +10 -50
  49. package/dist/esm/ultramodern-release-cohort.js +5 -14
  50. package/dist/esm/ultramodern-tooling/commands/context.js +2 -1
  51. package/dist/esm/ultramodern-tooling/commands/validate.js +3 -48
  52. package/dist/esm/ultramodern-tooling/commands.js +10 -1
  53. package/dist/esm/ultramodern-tooling/config/index.js +1 -0
  54. package/dist/esm/ultramodern-tooling/config/load.js +5 -17
  55. package/dist/esm/ultramodern-tooling/config/metadata.js +36 -1
  56. package/dist/esm/ultramodern-tooling/config/normalize.js +125 -201
  57. package/dist/esm/ultramodern-workspace/add-shell.js +55 -22
  58. package/dist/esm/ultramodern-workspace/add-vertical/execute.js +41 -41
  59. package/dist/esm/ultramodern-workspace/add-vertical/plan.js +2 -2
  60. package/dist/esm/ultramodern-workspace/add-vertical/preflight.js +3 -6
  61. package/dist/esm/ultramodern-workspace/add-vertical/topology.js +1 -30
  62. package/dist/esm/ultramodern-workspace/add-vertical/workspace-state.js +3 -10
  63. package/dist/esm/ultramodern-workspace/api/contracts.js +2 -2
  64. package/dist/esm/ultramodern-workspace/api/rpc.js +16 -14
  65. package/dist/esm/ultramodern-workspace/api/service.js +4 -8
  66. package/dist/esm/ultramodern-workspace/api/shared.js +1 -1
  67. package/dist/esm/ultramodern-workspace/backend-federation.js +3 -3
  68. package/dist/esm/ultramodern-workspace/contracts.js +14 -180
  69. package/dist/esm/ultramodern-workspace/delivery-unit-stamp.js +10 -5
  70. package/dist/esm/ultramodern-workspace/delivery-unit-sync.js +28 -18
  71. package/dist/esm/ultramodern-workspace/delivery-unit.js +11 -6
  72. package/dist/esm/ultramodern-workspace/descriptors.js +1 -2
  73. package/dist/esm/ultramodern-workspace/generation-result.js +2 -2
  74. package/dist/esm/ultramodern-workspace/index.js +1 -1
  75. package/dist/esm/ultramodern-workspace/mf-validation/constants.js +1 -4
  76. package/dist/esm/ultramodern-workspace/mf-validation/discovery.js +7 -7
  77. package/dist/esm/ultramodern-workspace/mf-validation/path-utils.js +36 -34
  78. package/dist/esm/ultramodern-workspace/module-federation/config.js +9 -16
  79. package/dist/esm/ultramodern-workspace/package-json.js +48 -55
  80. package/dist/esm/ultramodern-workspace/patch-inventory.js +27 -36
  81. package/dist/esm/ultramodern-workspace/policy.js +6 -335
  82. package/dist/esm/ultramodern-workspace/public-surface.js +2 -2
  83. package/dist/esm/ultramodern-workspace/routes.js +11 -7
  84. package/dist/esm/ultramodern-workspace/shells.js +3 -67
  85. package/dist/esm/ultramodern-workspace/tooling-command-catalog.js +7 -41
  86. package/dist/esm/ultramodern-workspace/tsconfigs.js +4 -2
  87. package/dist/esm/ultramodern-workspace/validation/architecture.js +5 -5
  88. package/dist/esm/ultramodern-workspace/validation/workspace.js +267 -1250
  89. package/dist/esm/ultramodern-workspace/versions.js +24 -28
  90. package/dist/esm/ultramodern-workspace/workspace-artifact-ownership.js +3 -8
  91. package/dist/esm/ultramodern-workspace/workspace-script-plan.js +7 -7
  92. package/dist/esm/ultramodern-workspace/workspace-scripts.js +18 -107
  93. package/dist/esm/ultramodern-workspace/workspace-validation-contract.js +64 -373
  94. package/dist/esm/ultramodern-workspace/write-app.js +4 -3
  95. package/dist/esm/ultramodern-workspace/write-workspace.js +16 -53
  96. package/dist/esm-node/ultramodern-release-cohort.js +5 -14
  97. package/dist/esm-node/ultramodern-tooling/commands/context.js +2 -1
  98. package/dist/esm-node/ultramodern-tooling/commands/validate.js +3 -48
  99. package/dist/esm-node/ultramodern-tooling/commands.js +10 -1
  100. package/dist/esm-node/ultramodern-tooling/config/index.js +1 -0
  101. package/dist/esm-node/ultramodern-tooling/config/load.js +5 -17
  102. package/dist/esm-node/ultramodern-tooling/config/metadata.js +36 -1
  103. package/dist/esm-node/ultramodern-tooling/config/normalize.js +125 -201
  104. package/dist/esm-node/ultramodern-workspace/add-shell.js +55 -22
  105. package/dist/esm-node/ultramodern-workspace/add-vertical/execute.js +41 -41
  106. package/dist/esm-node/ultramodern-workspace/add-vertical/plan.js +2 -2
  107. package/dist/esm-node/ultramodern-workspace/add-vertical/preflight.js +3 -6
  108. package/dist/esm-node/ultramodern-workspace/add-vertical/topology.js +1 -30
  109. package/dist/esm-node/ultramodern-workspace/add-vertical/workspace-state.js +3 -10
  110. package/dist/esm-node/ultramodern-workspace/api/contracts.js +2 -2
  111. package/dist/esm-node/ultramodern-workspace/api/rpc.js +16 -14
  112. package/dist/esm-node/ultramodern-workspace/api/service.js +4 -8
  113. package/dist/esm-node/ultramodern-workspace/api/shared.js +1 -1
  114. package/dist/esm-node/ultramodern-workspace/backend-federation.js +3 -3
  115. package/dist/esm-node/ultramodern-workspace/contracts.js +14 -180
  116. package/dist/esm-node/ultramodern-workspace/delivery-unit-stamp.js +10 -5
  117. package/dist/esm-node/ultramodern-workspace/delivery-unit-sync.js +28 -18
  118. package/dist/esm-node/ultramodern-workspace/delivery-unit.js +11 -6
  119. package/dist/esm-node/ultramodern-workspace/descriptors.js +1 -2
  120. package/dist/esm-node/ultramodern-workspace/generation-result.js +2 -2
  121. package/dist/esm-node/ultramodern-workspace/index.js +1 -1
  122. package/dist/esm-node/ultramodern-workspace/mf-validation/constants.js +1 -4
  123. package/dist/esm-node/ultramodern-workspace/mf-validation/discovery.js +7 -7
  124. package/dist/esm-node/ultramodern-workspace/mf-validation/path-utils.js +36 -34
  125. package/dist/esm-node/ultramodern-workspace/module-federation/config.js +9 -16
  126. package/dist/esm-node/ultramodern-workspace/package-json.js +48 -55
  127. package/dist/esm-node/ultramodern-workspace/patch-inventory.js +27 -36
  128. package/dist/esm-node/ultramodern-workspace/policy.js +6 -335
  129. package/dist/esm-node/ultramodern-workspace/public-surface.js +2 -2
  130. package/dist/esm-node/ultramodern-workspace/routes.js +11 -7
  131. package/dist/esm-node/ultramodern-workspace/shells.js +3 -67
  132. package/dist/esm-node/ultramodern-workspace/tooling-command-catalog.js +7 -41
  133. package/dist/esm-node/ultramodern-workspace/tsconfigs.js +4 -2
  134. package/dist/esm-node/ultramodern-workspace/validation/architecture.js +5 -5
  135. package/dist/esm-node/ultramodern-workspace/validation/workspace.js +267 -1250
  136. package/dist/esm-node/ultramodern-workspace/versions.js +24 -28
  137. package/dist/esm-node/ultramodern-workspace/workspace-artifact-ownership.js +3 -8
  138. package/dist/esm-node/ultramodern-workspace/workspace-script-plan.js +7 -7
  139. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +18 -107
  140. package/dist/esm-node/ultramodern-workspace/workspace-validation-contract.js +64 -373
  141. package/dist/esm-node/ultramodern-workspace/write-app.js +4 -3
  142. package/dist/esm-node/ultramodern-workspace/write-workspace.js +16 -53
  143. package/dist/types/ultramodern-release-cohort.d.ts +1 -3
  144. package/dist/types/ultramodern-tooling/commands/validate.d.ts +2 -2
  145. package/dist/types/ultramodern-tooling/config/index.d.ts +1 -0
  146. package/dist/types/ultramodern-tooling/config/load.d.ts +6 -58
  147. package/dist/types/ultramodern-tooling/config/metadata.d.ts +3 -0
  148. package/dist/types/ultramodern-tooling/config/normalize.d.ts +9 -90
  149. package/dist/types/ultramodern-tooling/config/types.d.ts +1 -9
  150. package/dist/types/ultramodern-workspace/add-vertical/preflight.d.ts +3 -3
  151. package/dist/types/ultramodern-workspace/add-vertical/topology.d.ts +0 -1
  152. package/dist/types/ultramodern-workspace/add-vertical/workspace-state.d.ts +1 -1
  153. package/dist/types/ultramodern-workspace/api/rpc.d.ts +1 -1
  154. package/dist/types/ultramodern-workspace/contracts.d.ts +1 -3
  155. package/dist/types/ultramodern-workspace/delivery-unit-stamp.d.ts +2 -2
  156. package/dist/types/ultramodern-workspace/delivery-unit.d.ts +2 -2
  157. package/dist/types/ultramodern-workspace/descriptors.d.ts +0 -1
  158. package/dist/types/ultramodern-workspace/index.d.ts +1 -1
  159. package/dist/types/ultramodern-workspace/mf-validation/constants.d.ts +0 -1
  160. package/dist/types/ultramodern-workspace/mf-validation/path-utils.d.ts +2 -3
  161. package/dist/types/ultramodern-workspace/module-federation/config.d.ts +1 -1
  162. package/dist/types/ultramodern-workspace/patch-inventory.d.ts +2 -10
  163. package/dist/types/ultramodern-workspace/policy.d.ts +60 -182
  164. package/dist/types/ultramodern-workspace/shells.d.ts +1 -14
  165. package/dist/types/ultramodern-workspace/tooling-command-catalog.d.ts +1 -6
  166. package/dist/types/ultramodern-workspace/validation/types.d.ts +1 -12
  167. package/dist/types/ultramodern-workspace/validation/workspace.d.ts +5 -2
  168. package/dist/types/ultramodern-workspace/versions.d.ts +23 -27
  169. package/dist/types/ultramodern-workspace/workspace-script-plan.d.ts +1 -1
  170. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +7 -14
  171. package/dist/types/ultramodern-workspace/workspace-validation-contract.d.ts +22 -188
  172. package/dist/types/ultramodern-workspace/write-workspace.d.ts +1 -3
  173. package/package.json +17 -16
  174. package/{template-workspace/.modernjs/release-cohort.json → release-cohort.json} +48 -48
  175. package/template-workspace/README.md.handlebars +9 -16
  176. package/template-workspace/pnpm-workspace.yaml.handlebars +0 -24
  177. package/templates/workspace/apps/modern.config.ts.handlebars +5 -5
  178. package/templates/workspace/apps/shared/src/routes/ultramodern-route-metadata.ts.handlebars +8 -21
  179. package/templates/workspace-scripts/generate-node-backend-federation.mjs +39 -49
  180. package/templates/workspace-scripts/generate-public-surface-assets.mjs +142 -206
  181. package/templates/workspace-scripts/materialize-zerops-runtime.mjs +3 -11
  182. package/templates/workspace-scripts/proof-cloudflare-version.mjs +53 -444
  183. package/templates/workspace-scripts/proof-node-backend-federation.mjs +193 -39
  184. package/templates/workspace-scripts/proof-workerd-ssr.mjs +126 -66
  185. package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +45 -147
  186. package/dist/cjs/ultramodern-workspace/cohort-parity.cjs +0 -129
  187. package/dist/cjs/ultramodern-workspace/patch-parity.cjs +0 -163
  188. package/dist/esm/ultramodern-workspace/cohort-parity.js +0 -74
  189. package/dist/esm/ultramodern-workspace/patch-parity.js +0 -99
  190. package/dist/esm-node/ultramodern-workspace/cohort-parity.js +0 -75
  191. package/dist/esm-node/ultramodern-workspace/patch-parity.js +0 -100
  192. package/dist/types/ultramodern-workspace/cohort-parity.d.ts +0 -31
  193. package/dist/types/ultramodern-workspace/patch-parity.d.ts +0 -39
  194. package/template-workspace/patches/@module-federation__bridge-react@2.9.0.patch +0 -47
  195. package/template-workspace/patches/@module-federation__dts-plugin@2.9.0.patch +0 -132
  196. package/template-workspace/patches/@module-federation__modern-js-v3@2.9.0.patch +0 -287
  197. package/template-workspace/patches/@module-federation__runtime-core@2.9.0.patch +0 -13
  198. package/template-workspace/patches/drizzle-orm-ts7-strict-declarations.patch +0 -471
  199. package/template-workspace/patches/msgpackr@2.1.0.patch +0 -30
  200. package/template-workspace/patches/zod@4.5.4.patch +0 -56
  201. package/templates/packages/effect-bff-runtime.ts +0 -2
@@ -37,234 +37,155 @@ var __webpack_require__ = {};
37
37
  var __webpack_exports__ = {};
38
38
  __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
- UnsupportedUltramodernConfigError: ()=>UnsupportedUltramodernConfigError,
41
- additionalShellsFromToolingConfig: ()=>additionalShellsFromToolingConfig,
42
40
  allWorkspaceAppsFromToolingConfig: ()=>allWorkspaceAppsFromToolingConfig,
43
- normalizeCompactConfig: ()=>normalizeCompactConfig,
44
- normalizeCompactUltramodernConfig: ()=>normalizeCompactUltramodernConfig,
45
41
  normalizeWorkspaceInputs: ()=>normalizeWorkspaceInputs,
46
42
  preserveUnknownProjectionFields: ()=>preserveUnknownProjectionFields,
47
43
  reconcileGeneratedOverlayUrls: ()=>reconcileGeneratedOverlayUrls,
48
44
  workspaceAppsFromToolingConfig: ()=>workspaceAppsFromToolingConfig
49
45
  });
46
+ const external_node_fs_namespaceObject = require("node:fs");
47
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
50
48
  const external_node_path_namespaceObject = require("node:path");
51
49
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
52
50
  const topology_cjs_namespaceObject = require("../../ultramodern-workspace/add-vertical/topology.cjs");
53
- const bridge_config_cjs_namespaceObject = require("../../ultramodern-workspace/bridge-config.cjs");
54
51
  const descriptors_cjs_namespaceObject = require("../../ultramodern-workspace/descriptors.cjs");
55
52
  const mf_validation_cjs_namespaceObject = require("../../ultramodern-workspace/mf-validation.cjs");
56
53
  const naming_cjs_namespaceObject = require("../../ultramodern-workspace/naming.cjs");
57
- const shells_cjs_namespaceObject = require("../../ultramodern-workspace/shells.cjs");
58
- const types_cjs_namespaceObject = require("../../ultramodern-workspace/types.cjs");
54
+ const external_json_cjs_namespaceObject = require("./json.cjs");
59
55
  const external_metadata_cjs_namespaceObject = require("./metadata.cjs");
60
- class UnsupportedUltramodernConfigError extends Error {
61
- constructor(sourcePath, issue){
62
- const value = formatUnsupportedConfigValue(issue.value);
63
- const message = 'schemaVersion' === issue.field ? formatSchemaVersionError(sourcePath, issue.reason, value) : `Unsupported UltraModern config app kind ${value} at ${sourcePath} topology.apps[${issue.index}].kind. Supported kinds: shell, vertical.`;
64
- super(message), this.sourcePath = sourcePath, this.issue = issue;
65
- this.name = 'UnsupportedUltramodernConfigError';
66
- }
67
- }
68
- function normalizeCompactConfig(workspaceRoot, sourcePath, config) {
69
- const schemaVersion = config.schemaVersion;
70
- if (1 !== schemaVersion) throw new UnsupportedUltramodernConfigError(sourcePath, {
71
- field: 'schemaVersion',
72
- value: schemaVersion,
73
- reason: void 0 === schemaVersion ? 'missing' : Number.isInteger(schemaVersion) ? 'unsupported' : 'non-integer'
56
+ function normalizeWorkspaceInputs(workspaceRoot, inputs) {
57
+ const { topology, overlay } = inputs;
58
+ if (1 !== topology.schemaVersion || !topology.shell || !Array.isArray(topology.verticals) || void 0 !== topology.shells && !Array.isArray(topology.shells)) throw new Error('Invalid topology/reference-topology.json: expected schemaVersion 1, shell, verticals and optional shells.');
59
+ if (1 !== overlay.schemaVersion || !overlay.ports || 'object' != typeof overlay.ports) throw new Error('Invalid development overlay: expected schemaVersion 1 and ports.');
60
+ const records = [
61
+ topology.shell,
62
+ ...topology.verticals,
63
+ ...topology.shells ?? []
64
+ ];
65
+ const ids = new Set();
66
+ const paths = new Set();
67
+ const ports = new Map();
68
+ const root = external_node_fs_default().realpathSync(workspaceRoot);
69
+ const manifests = new Map();
70
+ const apps = records.map((entry, index)=>{
71
+ if ('string' != typeof entry.id || !entry.id || ids.has(entry.id)) throw new Error(`Missing or duplicate topology app id: ${entry.id}.`);
72
+ ids.add(entry.id);
73
+ if ('string' != typeof entry.path || !entry.path || external_node_path_default().isAbsolute(entry.path)) throw new Error(`Topology ${entry.id} requires a relative path.`);
74
+ const appRoot = external_node_fs_default().realpathSync(external_node_path_default().resolve(root, entry.path));
75
+ const relative = external_node_path_default().relative(root, appRoot);
76
+ if (!relative || '..' === relative || relative.startsWith(`..${external_node_path_default().sep}`) || external_node_path_default().isAbsolute(relative) || paths.has(appRoot)) throw new Error(`Topology ${entry.id} has an unsafe or duplicate path: ${entry.path}.`);
77
+ paths.add(appRoot);
78
+ const manifest = (0, external_json_cjs_namespaceObject.readJsonObject)(external_node_path_default().join(appRoot, 'package.json'));
79
+ if ('string' != typeof manifest.name || !manifest.name || void 0 !== entry.package && manifest.name !== entry.package) throw new Error(`Topology ${entry.id} package identity disagrees with ${entry.path}/package.json.`);
80
+ manifests.set(entry.id, manifest);
81
+ const port = overlay.ports[entry.id];
82
+ if (!Number.isInteger(port) || port < 1 || port > 65535 || ports.has(port)) throw new Error(`Invalid or duplicate development port for ${entry.id}: ${port}.`);
83
+ ports.set(port, entry.id);
84
+ const isShell = 0 === index || index > topology.verticals.length;
85
+ if (entry.kind !== (isShell ? 'shell' : 'vertical')) throw new Error(`Invalid topology app kind for ${entry.id}.`);
86
+ const packageSuffix = manifest.name.split('/').at(-1);
87
+ if (isShell) return {
88
+ ...descriptors_cjs_namespaceObject.shellApp,
89
+ id: entry.id,
90
+ directory: entry.path,
91
+ packageSuffix,
92
+ displayName: entry.displayName ?? entry.id,
93
+ port,
94
+ portEnv: entry.portEnv ?? (entry.id === descriptors_cjs_namespaceObject.shellApp.id ? descriptors_cjs_namespaceObject.shellApp.portEnv : `SHELL_${(0, naming_cjs_namespaceObject.toEnvSegment)(entry.id.replace(/^shell-/u, ''))}_PORT`),
95
+ mfName: entry.moduleFederation?.name ?? entry.id,
96
+ verticalRefs: entry.verticalRefs ?? entry.moduleFederation?.verticalRefs ?? [],
97
+ ...entry.deliveryUnit ? {
98
+ deliveryUnit: entry.deliveryUnit
99
+ } : {},
100
+ ownership: entry.ownership ?? (0, descriptors_cjs_namespaceObject.createNeutralOwnership)(entry.id, 'tier-0-shell')
101
+ };
102
+ const [app] = (0, topology_cjs_namespaceObject.verticalsFromTopology)({
103
+ verticals: [
104
+ entry
105
+ ]
106
+ }, overlay.ports);
107
+ const actualExposes = (0, mf_validation_cjs_namespaceObject.readModuleFederationExposePaths)(workspaceRoot, entry.path);
108
+ return {
109
+ ...app,
110
+ packageSuffix,
111
+ ...actualExposes ? {
112
+ exposes: actualExposes
113
+ } : {}
114
+ };
74
115
  });
75
- return normalizeCompactConfigV1(workspaceRoot, sourcePath, config);
76
- }
77
- function normalizeCompactConfigV1(workspaceRoot, sourcePath, config) {
78
- const packageSource = config.packageSource && 'object' == typeof config.packageSource ? {
79
- strategy: 'install' === config.packageSource.strategy ? 'install' : 'workspace',
80
- modernPackageVersion: 'string' == typeof config.packageSource.modernPackageVersion ? config.packageSource.modernPackageVersion : 'workspace:*',
81
- registry: 'string' == typeof config.packageSource.registry ? config.packageSource.registry : void 0,
82
- aliasScope: 'string' == typeof config.packageSource.aliasScope ? config.packageSource.aliasScope : void 0,
83
- aliasPackageNamePrefix: 'string' == typeof config.packageSource.aliasPackageNamePrefix ? config.packageSource.aliasPackageNamePrefix : void 0
84
- } : void 0;
85
- return {
86
- schemaVersion: 1,
87
- profile: 'string' == typeof config.profile ? config.profile : void 0,
88
- source: 'compact',
89
- sourcePath,
116
+ const knownPackages = new Set([
117
+ ...[
118
+ ...manifests.values()
119
+ ].map((manifest)=>manifest.name),
120
+ ...(topology.sharedPackages ?? []).map((entry)=>entry.package)
121
+ ]);
122
+ const primaryManifest = manifests.get(apps[0].id);
123
+ const inheritedWorkspaceDependencies = Object.fromEntries(Object.entries(primaryManifest.dependencies ?? {}).filter(([name, value])=>'string' == typeof value && value.startsWith('workspace:') && !name.startsWith('@modern-js/') && !knownPackages.has(name)));
124
+ const config = {
90
125
  workspace: {
91
- packageScope: 'string' == typeof config.workspace?.packageScope ? config.workspace.packageScope : (0, external_metadata_cjs_namespaceObject.packageScopeFromRoot)(workspaceRoot)
126
+ packageScope: (0, external_metadata_cjs_namespaceObject.packageScopeFromRoot)(workspaceRoot)
92
127
  },
93
- packageSource,
128
+ packageSource: (0, external_metadata_cjs_namespaceObject.readWorkspacePackageSource)(workspaceRoot),
94
129
  features: {
95
- tailwind: config.features?.tailwind !== false
130
+ tailwind: Boolean(primaryManifest.devDependencies?.tailwindcss ?? primaryManifest.dependencies?.tailwindcss)
96
131
  },
97
- bridge: (0, bridge_config_cjs_namespaceObject.normalizeUltramodernBridgeConfig)(config.bridge),
132
+ inheritedWorkspaceDependencies,
98
133
  topology: {
99
- apps: Array.isArray(config.topology?.apps) ? config.topology.apps.map((app, index)=>{
100
- if ('shell' !== app.kind && 'vertical' !== app.kind) throw new UnsupportedUltramodernConfigError(sourcePath, {
101
- field: 'topology.apps.kind',
102
- index,
103
- value: app.kind
104
- });
105
- return {
106
- id: String(app.id),
107
- ...app.deliveryUnit ? {
108
- deliveryUnit: app.deliveryUnit
109
- } : {},
134
+ apps: apps.map((app)=>({
135
+ id: app.id,
110
136
  kind: app.kind,
111
- path: 'string' == typeof app.path ? app.path : '.',
112
- package: 'string' == typeof app.package ? app.package : void 0,
113
- packageSuffix: 'string' == typeof app.packageSuffix ? app.packageSuffix : void 0,
114
- displayName: 'string' == typeof app.displayName ? app.displayName : void 0,
115
- domain: 'string' == typeof app.domain ? app.domain : void 0,
116
- ...(0, types_cjs_namespaceObject.isVerticalPreset)(app.surfaceProfile) ? {
117
- surfaceProfile: app.surfaceProfile
118
- } : {},
119
- ...(0, types_cjs_namespaceObject.isWorkspaceDeliveryUnitKind)(app.deliveryUnitKind) ? {
120
- deliveryUnitKind: app.deliveryUnitKind
121
- } : {},
122
- port: 'number' == typeof app.port ? app.port : void 0,
123
- portEnv: 'string' == typeof app.portEnv ? app.portEnv : void 0,
124
- moduleFederation: app.moduleFederation && 'object' == typeof app.moduleFederation ? {
125
- role: 'remote' === app.moduleFederation.role ? 'remote' : 'host',
126
- name: 'string' == typeof app.moduleFederation.name ? app.moduleFederation.name : void 0,
127
- exposes: Array.isArray(app.moduleFederation.exposes) ? app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose) : void 0,
128
- 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])),
129
- verticalRefs: Array.isArray(app.moduleFederation.verticalRefs) ? app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref) : void 0,
130
- hostOnly: true === app.moduleFederation.hostOnly,
131
- noExposes: true === app.moduleFederation.noExposes
132
- } : void 0,
133
- api: app.api && 'object' == typeof app.api ? {
134
- stem: 'string' == typeof app.api.stem ? app.api.stem : String(app.id),
135
- prefix: 'string' == typeof app.api.prefix ? app.api.prefix : `/${String(app.id)}-api`,
136
- consumedBy: Array.isArray(app.api.consumedBy) ? app.api.consumedBy.filter((consumer)=>'string' == typeof consumer) : [
137
- descriptors_cjs_namespaceObject.shellApp.id,
138
- String(app.id)
139
- ],
140
- ...(0, types_cjs_namespaceObject.isVerticalApiProtocol)(app.api.protocol) ? {
141
- protocol: app.api.protocol
142
- } : {}
143
- } : void 0
144
- };
145
- }) : []
146
- },
147
- ...Array.isArray(config.shells) && config.shells.length > 0 ? {
148
- shells: config.shells.filter((shell)=>null !== shell && 'object' == typeof shell && !Array.isArray(shell))
149
- } : {}
137
+ path: app.directory,
138
+ package: manifests.get(app.id).name,
139
+ packageSuffix: app.packageSuffix,
140
+ displayName: app.displayName,
141
+ domain: app.domain,
142
+ port: app.port,
143
+ portEnv: app.portEnv,
144
+ surfaceProfile: app.surfaceProfile,
145
+ deliveryUnitKind: app.deliveryUnitKind,
146
+ deliveryUnit: app.deliveryUnit,
147
+ moduleFederation: {
148
+ role: 'shell' === app.kind ? 'host' : 'remote',
149
+ name: app.mfName,
150
+ exposes: Object.keys(app.exposes ?? {}),
151
+ exposePaths: app.exposes,
152
+ verticalRefs: app.verticalRefs
153
+ },
154
+ api: app.api
155
+ }))
156
+ }
157
+ };
158
+ return {
159
+ raw: inputs,
160
+ config,
161
+ apps,
162
+ primaryShell: apps[0],
163
+ verticals: apps.filter((app)=>'vertical' === app.kind),
164
+ additionalShells: apps.filter((app, index)=>index > 0 && 'shell' === app.kind)
150
165
  };
151
166
  }
152
- function formatUnsupportedConfigValue(value) {
153
- if (void 0 === value) return 'missing';
154
- return JSON.stringify(value) ?? String(value);
155
- }
156
- function formatSchemaVersionError(sourcePath, reason, value) {
157
- switch(reason){
158
- case 'missing':
159
- return `UltraModern config schemaVersion is required in ${sourcePath}. Versionless v1 configs are not supported; set schemaVersion to the integer 1.`;
160
- case 'non-integer':
161
- return `Invalid UltraModern config schemaVersion ${value} in ${sourcePath}. schemaVersion must be the integer 1; versionless v1 configs are not supported.`;
162
- case 'unsupported':
163
- return `Unsupported UltraModern config schemaVersion ${value} in ${sourcePath}. Supported schema versions: 1. Versionless v1 configs are not supported.`;
164
- }
165
- }
166
- function normalizeCompactUltramodernConfig(workspaceRoot, compact) {
167
- return normalizeCompactConfig(workspaceRoot, external_node_path_default().join(workspaceRoot, descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH), compact);
168
- }
169
- function workspaceAppsFromToolingConfig(config, workspaceRoot) {
170
- return config.topology.apps.map((app)=>{
171
- if ('shell' === app.kind) return {
172
- ...descriptors_cjs_namespaceObject.shellApp,
173
- ...app.deliveryUnit ? {
174
- deliveryUnit: app.deliveryUnit
175
- } : {},
176
- directory: app.path,
177
- packageSuffix: app.packageSuffix ?? descriptors_cjs_namespaceObject.shellApp.packageSuffix,
178
- displayName: app.displayName ?? descriptors_cjs_namespaceObject.shellApp.displayName,
179
- port: app.port ?? descriptors_cjs_namespaceObject.shellApp.port,
180
- portEnv: app.portEnv ?? descriptors_cjs_namespaceObject.shellApp.portEnv,
181
- mfName: app.moduleFederation?.name ?? descriptors_cjs_namespaceObject.shellApp.mfName,
182
- verticalRefs: app.moduleFederation?.verticalRefs ?? []
183
- };
184
- const domain = app.domain ?? app.id;
185
- const packageSuffix = app.packageSuffix ?? domain;
186
- const exposePaths = app.moduleFederation?.exposePaths ?? {};
187
- const federatedPaths = void 0 === workspaceRoot ? void 0 : (0, mf_validation_cjs_namespaceObject.readModuleFederationExposePaths)(workspaceRoot, app.path);
188
- const exposes = Object.fromEntries((app.moduleFederation?.exposes ?? []).map((expose)=>{
189
- const configuredPath = federatedPaths?.[expose] ?? exposePaths[expose];
190
- const inferredPath = './Route' === expose ? './src/federation-entry.tsx' : './Widget' === expose ? `./src/components/${domain}-widget.tsx` : `./src/components/${(0, naming_cjs_namespaceObject.toKebabCase)(expose.replace(/^\.\//u, ''))}.tsx`;
191
- return [
192
- expose,
193
- configuredPath ?? inferredPath
194
- ];
195
- }));
196
- return {
167
+ function workspaceAppsFromToolingConfig(config, _workspaceRoot) {
168
+ return config.topology.apps.map((app)=>({
197
169
  id: app.id,
198
- ...app.deliveryUnit ? {
199
- deliveryUnit: app.deliveryUnit
200
- } : {},
170
+ kind: app.kind,
201
171
  directory: app.path,
202
- packageSuffix,
203
- displayName: app.displayName ?? `${domain} Vertical`,
204
- kind: 'vertical',
205
- domain,
206
- portEnv: app.portEnv ?? `VERTICAL_${domain.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase()}_PORT`,
207
- port: app.port ?? 0,
172
+ packageSuffix: app.packageSuffix ?? app.id,
173
+ displayName: app.displayName ?? app.id,
174
+ port: app.port,
175
+ portEnv: app.portEnv,
208
176
  mfName: app.moduleFederation?.name ?? app.id,
209
- exposes,
210
- ...app.moduleFederation?.verticalRefs ? {
211
- verticalRefs: app.moduleFederation.verticalRefs
212
- } : {},
213
- ...void 0 === app.surfaceProfile ? {} : {
214
- surfaceProfile: app.surfaceProfile
215
- },
216
- ...void 0 === app.deliveryUnitKind ? {} : {
217
- deliveryUnitKind: app.deliveryUnitKind
218
- },
219
- ...app.api ? {
220
- api: app.api
221
- } : {},
177
+ domain: app.domain,
178
+ surfaceProfile: app.surfaceProfile,
179
+ deliveryUnitKind: app.deliveryUnitKind,
180
+ deliveryUnit: app.deliveryUnit,
181
+ exposes: app.moduleFederation?.exposePaths,
182
+ verticalRefs: app.moduleFederation?.verticalRefs,
183
+ api: app.api,
222
184
  ownership: (0, descriptors_cjs_namespaceObject.createNeutralOwnership)(app.id)
223
- };
224
- });
225
- }
226
- function additionalShellsFromToolingConfig(config) {
227
- return (0, shells_cjs_namespaceObject.resolveConfiguredAdditionalShells)(config);
185
+ }));
228
186
  }
229
187
  function allWorkspaceAppsFromToolingConfig(config, workspaceRoot) {
230
- return [
231
- ...workspaceAppsFromToolingConfig(config, workspaceRoot),
232
- ...additionalShellsFromToolingConfig(config)
233
- ];
234
- }
235
- function normalizeWorkspaceInputs(workspaceRoot, inputs, sourcePath = external_node_path_default().join(workspaceRoot, descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH), options = {}) {
236
- const config = normalizeCompactConfig(workspaceRoot, sourcePath, inputs.config);
237
- const ports = inputs.overlay?.ports ?? {};
238
- const additionalShells = additionalShellsFromToolingConfig(config);
239
- const topologyApps = inputs.topology ? [
240
- (0, topology_cjs_namespaceObject.createPrimaryShellDescriptor)(inputs.topology, inputs.config),
241
- ...(0, topology_cjs_namespaceObject.verticalsFromTopology)(inputs.topology, ports)
242
- ] : workspaceAppsFromToolingConfig(config, workspaceRoot);
243
- if ('compact' === options.primaryComposition) {
244
- const primary = topologyApps.find((app)=>app.id === descriptors_cjs_namespaceObject.shellApp.id);
245
- if (primary) {
246
- const configured = (0, topology_cjs_namespaceObject.createPrimaryShellDescriptor)({}, inputs.config);
247
- const refs = inputs.config.topology?.apps?.find((app)=>app.id === descriptors_cjs_namespaceObject.shellApp.id)?.moduleFederation?.verticalRefs;
248
- Object.assign(primary, configured, {
249
- verticalRefs: Array.isArray(refs) ? configured.verticalRefs : topologyApps.filter((app)=>'vertical' === app.kind && (0, descriptors_cjs_namespaceObject.appEmitsBrowserUi)(app)).map((app)=>app.id)
250
- });
251
- }
252
- }
253
- const apps = [
254
- ...topologyApps.map((app)=>({
255
- ...app,
256
- port: 'number' == typeof ports[app.id] ? ports[app.id] : app.port
257
- })),
258
- ...additionalShells
259
- ];
260
- return {
261
- raw: inputs,
262
- config,
263
- apps,
264
- primaryShell: apps.find((app)=>app.id === descriptors_cjs_namespaceObject.shellApp.id),
265
- verticals: apps.filter((app)=>'vertical' === app.kind),
266
- additionalShells
267
- };
188
+ return workspaceAppsFromToolingConfig(config, workspaceRoot);
268
189
  }
269
190
  function reconcileGeneratedOverlayUrls(existing, previous, projected) {
270
191
  return Object.fromEntries([
@@ -299,21 +220,13 @@ function preserveUnknownProjectionFields(current, projected) {
299
220
  ]))
300
221
  };
301
222
  }
302
- exports.UnsupportedUltramodernConfigError = __webpack_exports__.UnsupportedUltramodernConfigError;
303
- exports.additionalShellsFromToolingConfig = __webpack_exports__.additionalShellsFromToolingConfig;
304
223
  exports.allWorkspaceAppsFromToolingConfig = __webpack_exports__.allWorkspaceAppsFromToolingConfig;
305
- exports.normalizeCompactConfig = __webpack_exports__.normalizeCompactConfig;
306
- exports.normalizeCompactUltramodernConfig = __webpack_exports__.normalizeCompactUltramodernConfig;
307
224
  exports.normalizeWorkspaceInputs = __webpack_exports__.normalizeWorkspaceInputs;
308
225
  exports.preserveUnknownProjectionFields = __webpack_exports__.preserveUnknownProjectionFields;
309
226
  exports.reconcileGeneratedOverlayUrls = __webpack_exports__.reconcileGeneratedOverlayUrls;
310
227
  exports.workspaceAppsFromToolingConfig = __webpack_exports__.workspaceAppsFromToolingConfig;
311
228
  for(var __rspack_i in __webpack_exports__)if (-1 === [
312
- "UnsupportedUltramodernConfigError",
313
- "additionalShellsFromToolingConfig",
314
229
  "allWorkspaceAppsFromToolingConfig",
315
- "normalizeCompactConfig",
316
- "normalizeCompactUltramodernConfig",
317
230
  "normalizeWorkspaceInputs",
318
231
  "preserveUnknownProjectionFields",
319
232
  "reconcileGeneratedOverlayUrls",
@@ -49,6 +49,7 @@ const constants_cjs_namespaceObject = require("./add-vertical/constants.cjs");
49
49
  const preflight_cjs_namespaceObject = require("./add-vertical/preflight.cjs");
50
50
  const preview_cjs_namespaceObject = require("./add-vertical/preview.cjs");
51
51
  const shell_files_cjs_namespaceObject = require("./add-vertical/shell-files.cjs");
52
+ const topology_cjs_namespaceObject = require("./add-vertical/topology.cjs");
52
53
  const transaction_cjs_namespaceObject = require("./add-vertical/transaction.cjs");
53
54
  const workspace_state_cjs_namespaceObject = require("./add-vertical/workspace-state.cjs");
54
55
  const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
@@ -56,6 +57,7 @@ const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
56
57
  const external_generation_result_cjs_namespaceObject = require("./generation-result.cjs");
57
58
  const external_module_federation_cjs_namespaceObject = require("./module-federation.cjs");
58
59
  const external_naming_cjs_namespaceObject = require("./naming.cjs");
60
+ const external_policy_cjs_namespaceObject = require("./policy.cjs");
59
61
  const external_shells_cjs_namespaceObject = require("./shells.cjs");
60
62
  const external_tsconfigs_cjs_namespaceObject = require("./tsconfigs.cjs");
61
63
  const external_workspace_artifact_ownership_cjs_namespaceObject = require("./workspace-artifact-ownership.cjs");
@@ -64,21 +66,18 @@ const external_write_app_cjs_namespaceObject = require("./write-app.cjs");
64
66
  const external_zerops_cjs_namespaceObject = require("./zerops.cjs");
65
67
  function prepareAddUltramodernShell(options) {
66
68
  const name = (0, external_shells_cjs_namespaceObject.assertValidShellName)(options.name);
67
- const configPath = external_node_path_default().join(options.workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
68
69
  const overlayPath = external_node_path_default().join(options.workspaceRoot, constants_cjs_namespaceObject.DEVELOPMENT_OVERLAY_PATH);
69
70
  const topologyPath = external_node_path_default().join(options.workspaceRoot, constants_cjs_namespaceObject.TOPOLOGY_PATH);
71
+ const ownershipPath = external_node_path_default().join(options.workspaceRoot, constants_cjs_namespaceObject.OWNERSHIP_PATH);
70
72
  const rootPackage = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(external_node_path_default().join(options.workspaceRoot, 'package.json'));
71
- const config = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(configPath);
72
73
  const overlay = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(overlayPath);
73
74
  const topology = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(topologyPath);
75
+ const ownership = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(ownershipPath);
74
76
  overlay.ports ??= {};
75
77
  const scope = (0, external_naming_cjs_namespaceObject.toPackageScope)(String(rootPackage.name ?? external_node_path_default().basename(options.workspaceRoot)));
76
78
  const workspace = (0, config_cjs_namespaceObject.normalizeWorkspaceInputs)(options.workspaceRoot, {
77
- config,
78
79
  topology,
79
80
  overlay
80
- }, void 0, {
81
- primaryComposition: 'compact'
82
81
  });
83
82
  const { packageSource, enableTailwind, bridge } = (0, workspace_state_cjs_namespaceObject.workspaceOperationSettings)(options, workspace.config);
84
83
  const { primaryShell: resolvedPrimaryShell, verticals: existingVerticals, additionalShells: existingAdditionalShells } = workspace;
@@ -114,9 +113,12 @@ function prepareAddUltramodernShell(options) {
114
113
  ]);
115
114
  return {
116
115
  scope,
117
- configPath,
116
+ topologyPath,
117
+ ownershipPath,
118
118
  overlayPath,
119
- config,
119
+ config: workspace.config,
120
+ topology,
121
+ ownership,
120
122
  overlay,
121
123
  packageSource,
122
124
  enableTailwind,
@@ -136,7 +138,7 @@ function addUltramodernShell(options) {
136
138
  function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.workspaceRoot) {
137
139
  const beforeFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
138
140
  const preflight = prepareAddUltramodernShell(options);
139
- const { scope, configPath, config, packageSource, enableTailwind, bridge, primaryShell, existingVerticals, existingAdditionalShells, shell } = preflight;
141
+ const { scope, topologyPath, ownershipPath, topology, ownership, config, packageSource, enableTailwind, bridge, primaryShell, existingVerticals, existingAdditionalShells, shell } = preflight;
140
142
  const allAdditionalShells = [
141
143
  ...existingAdditionalShells,
142
144
  shell
@@ -151,15 +153,46 @@ function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.work
151
153
  ...existingVerticals,
152
154
  ...existingAdditionalShells
153
155
  ];
154
- const compactWorkspace = (0, config_cjs_namespaceObject.normalizeWorkspaceInputs)(options.workspaceRoot, {
155
- config
156
- });
157
- const { io: ownedIo } = (0, external_workspace_artifact_ownership_cjs_namespaceObject.preserveConsumerWorkspaceArtifacts)(options.workspaceRoot, (0, external_workspace_artifact_ownership_cjs_namespaceObject.workspaceArtifactCandidates)(scope, previousApps, enableTailwind, compactWorkspace.apps));
156
+ const { io: ownedIo } = (0, external_workspace_artifact_ownership_cjs_namespaceObject.preserveConsumerWorkspaceArtifacts)(options.workspaceRoot, (0, external_workspace_artifact_ownership_cjs_namespaceObject.workspaceArtifactCandidates)(scope, previousApps, enableTailwind, previousApps));
158
157
  (0, external_write_app_cjs_namespaceObject.writeApp)(options.workspaceRoot, scope, shell, packageSource, enableTailwind, existingVerticals, bridge, configuredDevPorts);
159
- const shellsCollection = Array.isArray(config.shells) ? config.shells.filter((entry)=>entry?.id !== shell.id) : [];
160
- shellsCollection.push((0, external_shells_cjs_namespaceObject.createAdditionalShellConfigEntry)(scope, shell, existingVerticals));
161
- config.shells = shellsCollection;
162
- (0, external_fs_io_cjs_namespaceObject.writeJsonFile)(configPath, config);
158
+ topology.shells ??= [];
159
+ topology.shells.push({
160
+ id: shell.id,
161
+ kind: 'shell',
162
+ package: (0, external_naming_cjs_namespaceObject.packageName)(scope, shell.packageSuffix),
163
+ path: shell.directory,
164
+ displayName: shell.displayName,
165
+ portEnv: shell.portEnv,
166
+ verticalRefs: shell.verticalRefs,
167
+ moduleFederation: {
168
+ role: 'host',
169
+ name: shell.mfName,
170
+ verticalRefs: shell.verticalRefs,
171
+ remotes: (0, external_descriptors_cjs_namespaceObject.resolveRemoteRefs)(shell, existingVerticals).map((remote)=>({
172
+ id: remote.id,
173
+ name: remote.mfName,
174
+ manifestUrl: `http://localhost:${remote.port}/mf-manifest.json`
175
+ })),
176
+ ssr: true,
177
+ sharedContractVersion: 'mf-ssr-contract-v1'
178
+ },
179
+ deliveryUnit: (0, external_shells_cjs_namespaceObject.shellDeliveryUnitBlock)(scope, shell),
180
+ cloudflare: (0, external_policy_cjs_namespaceObject.createCloudflareDeployContract)(scope, shell),
181
+ ownership: shell.ownership
182
+ });
183
+ (0, external_fs_io_cjs_namespaceObject.writeJsonFile)(topologyPath, topology);
184
+ ownership.owners ??= [];
185
+ ownership.owners.push((0, topology_cjs_namespaceObject.ownershipEntry)(scope, shell));
186
+ (0, external_fs_io_cjs_namespaceObject.writeJsonFile)(ownershipPath, ownership);
187
+ preflight.overlay.ports[shell.id] = shell.port;
188
+ (0, external_fs_io_cjs_namespaceObject.writeJsonFile)(preflight.overlayPath, preflight.overlay);
189
+ const newPackagePath = external_node_path_default().join(options.workspaceRoot, shell.directory, 'package.json');
190
+ const newPackage = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(newPackagePath);
191
+ newPackage.dependencies = {
192
+ ...newPackage.dependencies,
193
+ ...config.inheritedWorkspaceDependencies
194
+ };
195
+ (0, external_fs_io_cjs_namespaceObject.writeJsonFile)(newPackagePath, newPackage);
163
196
  for (const app of previousApps)ownedIo.write(external_node_path_default().join(options.workspaceRoot, app.directory, 'modern.config.ts'), (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, app, 'shell' === app.kind ? (0, external_descriptors_cjs_namespaceObject.resolveRemoteRefs)(app, existingVerticals) : existingVerticals, enableTailwind, configuredDevPorts));
164
197
  (0, shell_files_cjs_namespaceObject.updateRootWorkspaceScripts)(options.workspaceRoot, scope, packageSource, existingVerticals, bridge, allAdditionalShells, existingVerticals, primaryShell, existingAdditionalShells);
165
198
  ownedIo.write(external_node_path_default().join(options.workspaceRoot, 'tsconfig.json'), `${JSON.stringify((0, external_tsconfigs_cjs_namespaceObject.createRootTsConfig)([
@@ -167,7 +200,7 @@ function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.work
167
200
  ...existingVerticals,
168
201
  ...allAdditionalShells
169
202
  ]), null, 2)}\n`);
170
- (0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.workspaceRoot, existingVerticals, {
203
+ (0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.workspaceRoot, {
171
204
  io: {
172
205
  writeGenerated: ownedIo.write
173
206
  }
@@ -224,7 +257,7 @@ function planUltramodernShell(options) {
224
257
  shellDependencyChanges: [],
225
258
  generatedContractChanges: [
226
259
  {
227
- path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
260
+ path: 'topology/reference-topology.json',
228
261
  addedAppIds: [
229
262
  shell?.id ?? ''
230
263
  ],