@bleedingdev/modern-js-create 3.4.0-ultramodern.2 → 3.4.0-ultramodern.20

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 (128) hide show
  1. package/README.md +13 -11
  2. package/dist/cjs/index.cjs +37 -4
  3. package/dist/cjs/locale/en.cjs +12 -2
  4. package/dist/cjs/locale/zh.cjs +12 -2
  5. package/dist/cjs/ultramodern-tooling/commands.cjs +185 -0
  6. package/dist/cjs/ultramodern-tooling/config.cjs +172 -0
  7. package/dist/cjs/ultramodern-workspace/add-vertical.cjs +79 -61
  8. package/dist/cjs/ultramodern-workspace/bridge-config.cjs +327 -0
  9. package/dist/cjs/ultramodern-workspace/codesmith.cjs +1 -0
  10. package/dist/cjs/ultramodern-workspace/contracts.cjs +121 -648
  11. package/dist/cjs/ultramodern-workspace/demo-components.cjs +26 -33
  12. package/dist/cjs/ultramodern-workspace/descriptors.cjs +4 -4
  13. package/dist/cjs/ultramodern-workspace/effect-api.cjs +230 -100
  14. package/dist/cjs/ultramodern-workspace/fs-io.cjs +117 -0
  15. package/dist/cjs/ultramodern-workspace/generation-result.cjs +1 -1
  16. package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
  17. package/dist/cjs/ultramodern-workspace/mf-validation.cjs +571 -0
  18. package/dist/cjs/ultramodern-workspace/module-federation.cjs +51 -20
  19. package/dist/cjs/ultramodern-workspace/package-json.cjs +62 -19
  20. package/dist/cjs/ultramodern-workspace/policy.cjs +2 -2
  21. package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
  22. package/dist/cjs/ultramodern-workspace/versions.cjs +5 -0
  23. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +80 -43
  24. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +63 -20
  25. package/dist/esm/index.js +37 -4
  26. package/dist/esm/locale/en.js +12 -2
  27. package/dist/esm/locale/zh.js +12 -2
  28. package/dist/esm/ultramodern-tooling/commands.js +132 -0
  29. package/dist/esm/ultramodern-tooling/config.js +120 -0
  30. package/dist/esm/ultramodern-workspace/add-vertical.js +81 -66
  31. package/dist/esm/ultramodern-workspace/bridge-config.js +270 -0
  32. package/dist/esm/ultramodern-workspace/codesmith.js +1 -0
  33. package/dist/esm/ultramodern-workspace/contracts.js +124 -603
  34. package/dist/esm/ultramodern-workspace/demo-components.js +26 -33
  35. package/dist/esm/ultramodern-workspace/descriptors.js +2 -2
  36. package/dist/esm/ultramodern-workspace/effect-api.js +230 -100
  37. package/dist/esm/ultramodern-workspace/fs-io.js +116 -2
  38. package/dist/esm/ultramodern-workspace/generation-result.js +2 -2
  39. package/dist/esm/ultramodern-workspace/index.js +1 -0
  40. package/dist/esm/ultramodern-workspace/mf-validation.js +516 -0
  41. package/dist/esm/ultramodern-workspace/module-federation.js +49 -21
  42. package/dist/esm/ultramodern-workspace/package-json.js +60 -20
  43. package/dist/esm/ultramodern-workspace/policy.js +2 -2
  44. package/dist/esm/ultramodern-workspace/public-api.js +1 -0
  45. package/dist/esm/ultramodern-workspace/versions.js +3 -1
  46. package/dist/esm/ultramodern-workspace/workspace-scripts.js +78 -26
  47. package/dist/esm/ultramodern-workspace/write-workspace.js +67 -27
  48. package/dist/esm-node/index.js +37 -4
  49. package/dist/esm-node/locale/en.js +12 -2
  50. package/dist/esm-node/locale/zh.js +12 -2
  51. package/dist/esm-node/ultramodern-tooling/commands.js +133 -0
  52. package/dist/esm-node/ultramodern-tooling/config.js +121 -0
  53. package/dist/esm-node/ultramodern-workspace/add-vertical.js +81 -66
  54. package/dist/esm-node/ultramodern-workspace/bridge-config.js +271 -0
  55. package/dist/esm-node/ultramodern-workspace/codesmith.js +1 -0
  56. package/dist/esm-node/ultramodern-workspace/contracts.js +124 -603
  57. package/dist/esm-node/ultramodern-workspace/demo-components.js +26 -33
  58. package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -2
  59. package/dist/esm-node/ultramodern-workspace/effect-api.js +230 -100
  60. package/dist/esm-node/ultramodern-workspace/fs-io.js +116 -2
  61. package/dist/esm-node/ultramodern-workspace/generation-result.js +2 -2
  62. package/dist/esm-node/ultramodern-workspace/index.js +1 -0
  63. package/dist/esm-node/ultramodern-workspace/mf-validation.js +517 -0
  64. package/dist/esm-node/ultramodern-workspace/module-federation.js +49 -21
  65. package/dist/esm-node/ultramodern-workspace/package-json.js +60 -20
  66. package/dist/esm-node/ultramodern-workspace/policy.js +2 -2
  67. package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
  68. package/dist/esm-node/ultramodern-workspace/versions.js +3 -1
  69. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +78 -26
  70. package/dist/esm-node/ultramodern-workspace/write-workspace.js +67 -27
  71. package/dist/types/locale/en.d.ts +10 -0
  72. package/dist/types/locale/index.d.ts +20 -0
  73. package/dist/types/locale/zh.d.ts +10 -0
  74. package/dist/types/ultramodern-tooling/commands.d.ts +1 -0
  75. package/dist/types/ultramodern-tooling/config.d.ts +43 -0
  76. package/dist/types/ultramodern-workspace/add-vertical.d.ts +5 -2
  77. package/dist/types/ultramodern-workspace/bridge-config.d.ts +64 -0
  78. package/dist/types/ultramodern-workspace/codesmith.d.ts +1 -0
  79. package/dist/types/ultramodern-workspace/contracts.d.ts +2 -17
  80. package/dist/types/ultramodern-workspace/descriptors.d.ts +1 -1
  81. package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -0
  82. package/dist/types/ultramodern-workspace/index.d.ts +2 -0
  83. package/dist/types/ultramodern-workspace/mf-validation.d.ts +27 -0
  84. package/dist/types/ultramodern-workspace/module-federation.d.ts +1 -0
  85. package/dist/types/ultramodern-workspace/package-json.d.ts +5 -3
  86. package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
  87. package/dist/types/ultramodern-workspace/types.d.ts +2 -0
  88. package/dist/types/ultramodern-workspace/versions.d.ts +2 -0
  89. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -7
  90. package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
  91. package/package.json +5 -3
  92. package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
  93. package/template-workspace/.gitignore.handlebars +3 -0
  94. package/template-workspace/AGENTS.md.handlebars +11 -5
  95. package/template-workspace/README.md.handlebars +15 -12
  96. package/template-workspace/oxfmt.config.ts +1 -0
  97. package/template-workspace/oxlint.config.ts +1 -0
  98. package/template-workspace/patches/@tanstack__router-core@1.171.13.patch +51 -0
  99. package/template-workspace/pnpm-workspace.yaml.handlebars +12 -0
  100. package/template-workspace/scripts/bootstrap-agent-skills.mjs +96 -69
  101. package/templates/app/shell-frame.tsx +1 -2
  102. package/templates/app/ultramodern-route-head.tsx.handlebars +5 -6
  103. package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +59 -7
  104. package/templates/workspace-scripts/check-ultramodern-api-boundaries.mjs +339 -0
  105. package/templates/workspace-scripts/generate-public-surface-assets.mjs +245 -8
  106. package/templates/workspace-scripts/proof-cloudflare-version.mjs +276 -8
  107. package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +35 -10
  108. package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +164 -1
  109. package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
  110. package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +949 -63
  111. /package/template-workspace/{.agents → .codex}/rstackjs-agent-skills-LICENSE +0 -0
  112. /package/template-workspace/{.agents → .codex}/skills/rsbuild-best-practices/SKILL.md +0 -0
  113. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/SKILL.md +0 -0
  114. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/command-map.md +0 -0
  115. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/common-analysis-patterns.md +0 -0
  116. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +0 -0
  117. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +0 -0
  118. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +0 -0
  119. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor.md +0 -0
  120. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +0 -0
  121. /package/template-workspace/{.agents → .codex}/skills/rslib-best-practices/SKILL.md +0 -0
  122. /package/template-workspace/{.agents → .codex}/skills/rslib-modern-package/SKILL.md +0 -0
  123. /package/template-workspace/{.agents → .codex}/skills/rspack-best-practices/SKILL.md +0 -0
  124. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/SKILL.md +0 -0
  125. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/bottlenecks.md +0 -0
  126. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/tracing-guide.md +0 -0
  127. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/scripts/analyze_trace.js +0 -0
  128. /package/template-workspace/{.agents → .codex}/skills/rstest-best-practices/SKILL.md +0 -0
package/README.md CHANGED
@@ -36,9 +36,10 @@ domains to delete. It generates:
36
36
  - `verticals/*` empty until a real domain is added with `--vertical`.
37
37
  - `packages/shared-*` placeholders for shared contracts, tokens, and Effect
38
38
  API support.
39
- - `.modernjs/ultramodern-generated-contract.json` with Module Federation,
40
- Effect, i18n, federated CSS, Cloudflare, route publicness, generated
41
- public-surface, and Zephyr dependency metadata.
39
+ - `.modernjs/ultramodern.json` as compact generator provenance, package-source
40
+ config, app topology, bridge, deploy, Module Federation, and tooling config.
41
+ - `topology/*` as app-owned topology, ownership, and local development overlay
42
+ JSON.
42
43
 
43
44
  Validate the generated workspace before making application changes:
44
45
 
@@ -161,11 +162,11 @@ contract so automation can stop safely:
161
162
  | --- | --- | --- |
162
163
  | Fresh input | Invalid or missing vertical name | Use `<name> --vertical`, `--vertical=<name>`, or `--vertical-name <name>` |
163
164
  | Existing topology | Duplicate app ID, package suffix, path, Module Federation name, port, API prefix, or manifest key | Choose a new vertical name or repair the existing topology/local overlay first |
164
- | Workspace files | Missing or non-object topology, ownership, package-source, local overlay, or generated contract JSON | Restore the generated contract file from source control or rerun from a valid workspace |
165
+ | Workspace files | Missing or non-object compact UltraModern config, topology, ownership, or local overlay JSON | Restore the generated config files from source control or rerun from a valid workspace |
165
166
  | Tailwind prefix | Existing app already owns the generated CSS prefix | Rename the vertical before generation |
166
167
  | Output path | A generated path already exists | Treat it as an existing vertical and do not overwrite it |
167
168
 
168
- Package source is explicit and recorded in `.modernjs/ultramodern-package-source.json`.
169
+ Package source is explicit and recorded in `.modernjs/ultramodern.json`.
169
170
 
170
171
  | Strategy | Use when | CLI |
171
172
  | --- | --- | --- |
@@ -177,7 +178,7 @@ Package source is explicit and recorded in `.modernjs/ultramodern-package-source
177
178
  Older generated repos should move by adopting one published BleedingDev cohort
178
179
  at a time. Start with a dry-run vertical addition so validation reports
179
180
  topology, ownership, package-source, overlay, Tailwind prefix, Module Federation,
180
- and generated-contract conflicts before files are written:
181
+ and compact UltraModern config conflicts before files are written:
181
182
 
182
183
  ```bash
183
184
  pnpm dlx @bleedingdev/modern-js-create@latest catalog --vertical --dry-run
@@ -193,8 +194,8 @@ specific release with `--ultramodern-package-version` when CI must prove an
193
194
  exact framework version. Keep `--workspace` only for local monorepo testing
194
195
  against unpublished packages. After install, run the generated
195
196
  `scripts/validate-ultramodern-workspace.mjs` contract check and fix ownership
196
- conflicts in the owning JSON/config files instead of editing generated package
197
- metadata by hand.
197
+ conflicts in the owning JSON/config files instead of editing generated metadata
198
+ by hand.
198
199
 
199
200
  ## CodeSmith Adapter And Overlays
200
201
 
@@ -371,12 +372,13 @@ Each generated workspace app has:
371
372
 
372
373
  - `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
373
374
  `cloudflare:proof` scripts.
374
- - Cloudflare metadata in `.modernjs/ultramodern-generated-contract.json`.
375
+ - Cloudflare Worker deploy config from Modern config plus
376
+ `.modernjs/ultramodern.json`.
375
377
  - `zephyr:dependencies` for any consumed verticals.
376
378
  - `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
377
379
 
378
380
  Deploy first, then pass each deployed app's generated public URL env key into
379
- the proof step. The proof script reads the generated contract and checks the
381
+ the proof step. The proof script reads the compact UltraModern config and checks the
380
382
  Cloudflare Worker surface, including public-route sitemap/robots consistency,
381
383
  preview noindex behavior, unknown-route status, asset headers, byte budgets,
382
384
  and public sourcemap exposure. Shell-only workspaces only need the shell URL;
@@ -401,7 +403,7 @@ proven.
401
403
  | Package cohort mismatch | Regenerate with one package source strategy, run `mise install`, then rerun `pnpm install` from the activated shell. | Generated workspace package source metadata |
402
404
  | Install failure | Check the active Node/pnpm from `mise install`; rerun `pnpm install` after the shell sees the pinned versions. | Toolchain setup |
403
405
  | Build failure | Run the matching primitive gate (`pnpm lint`, `pnpm typecheck`, `pnpm i18n:boundaries`, `pnpm contract:check`) before `pnpm build`; fix the owning failure first. | Owning package or generated contract |
404
- | Missing public URL | Set the env key from `.modernjs/ultramodern-generated-contract.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
406
+ | Missing public URL | Set the app public URL env key recorded in `.modernjs/ultramodern.json`, for example `ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP`. | Deployment operator |
405
407
  | Cloudflare credentials | Confirm Wrangler credentials before `pnpm cloudflare:deploy`; local checks do not prove live Worker access. | Deployment operator |
406
408
  | Asset or CSS 404 | Rebuild with `pnpm build` or `pnpm cloudflare:deploy` and inspect emitted Modern/Rspack asset paths instead of hardcoding CSS URLs. | Framework/runtime asset pipeline |
407
409
  | Federation manifest failure | Run the shell and vertical build scripts, then check each deployed `/mf-manifest.json` URL used by the shell. | Module Federation owner |
@@ -39,7 +39,9 @@ const external_node_url_namespaceObject = require("node:url");
39
39
  const external_create_package_root_cjs_namespaceObject = require("./create-package-root.cjs");
40
40
  const index_cjs_namespaceObject = require("./locale/index.cjs");
41
41
  const external_ultramodern_package_source_cjs_namespaceObject = require("./ultramodern-package-source.cjs");
42
+ const commands_cjs_namespaceObject = require("./ultramodern-tooling/commands.cjs");
42
43
  const external_ultramodern_workspace_index_cjs_namespaceObject = require("./ultramodern-workspace/index.cjs");
44
+ const bridge_config_cjs_namespaceObject = require("./ultramodern-workspace/bridge-config.cjs");
43
45
  const src_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
44
46
  const createPackageRoot = (0, external_create_package_root_cjs_namespaceObject.resolveCreatePackageRoot)(src_dirname);
45
47
  const semverPattern = /^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
@@ -117,6 +119,16 @@ function showHelp() {
117
119
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageRegistry));
118
120
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageScope));
119
121
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionUltramodernPackageNamePrefix));
122
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridge));
123
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeParentRoot));
124
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeWorkspacePackage));
125
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeWorkspacePackageName));
126
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeTestAlias));
127
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeDependency));
128
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeLockfilePolicy));
129
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeGate));
130
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeGateCwd));
131
+ console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionBridgeReactSingleton));
120
132
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionVertical));
121
133
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionVerticalName));
122
134
  console.log(index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.help.optionDryRun));
@@ -205,7 +217,7 @@ function detectBffRuntime(args) {
205
217
  process.exit(1);
206
218
  }
207
219
  if (!SUPPORTED_BFF_RUNTIMES.includes(runtime)) {
208
- console.error(`Unsupported BFF runtime "${runtime}". UltraModern workspaces scaffold an Effect BFF for every MicroVertical (supported: ${SUPPORTED_BFF_RUNTIMES.join(', ')}).`);
220
+ console.error(`Unsupported BFF runtime "${runtime}". UltraModern workspaces scaffold a strict Effect API runtime for every MicroVertical (supported: ${SUPPORTED_BFF_RUNTIMES.join(', ')}).`);
209
221
  process.exit(1);
210
222
  }
211
223
  return runtime;
@@ -230,7 +242,8 @@ function collectPositionalArgs(args) {
230
242
  '--ultramodern-package-scope',
231
243
  '--ultramodern-package-name-prefix',
232
244
  VERTICAL_NAME_FLAG,
233
- CODESMITH_OVERLAY_FLAG
245
+ CODESMITH_OVERLAY_FLAG,
246
+ ...bridge_config_cjs_namespaceObject.ultramodernBridgeCliValueFlags
234
247
  ]);
235
248
  const optionWithoutValue = new Set([
236
249
  '--help',
@@ -243,7 +256,8 @@ function collectPositionalArgs(args) {
243
256
  WORKSPACE_PROTOCOL_FLAG,
244
257
  DRY_RUN_FLAG,
245
258
  VERTICAL_FLAG,
246
- LEGACY_MODERN_JS_FLAG
259
+ LEGACY_MODERN_JS_FLAG,
260
+ ...bridge_config_cjs_namespaceObject.ultramodernBridgeCliBooleanFlags
247
261
  ]);
248
262
  const positionalArgs = [];
249
263
  for(let i = 0; i < args.length; i++){
@@ -253,7 +267,7 @@ function collectPositionalArgs(args) {
253
267
  i += 1;
254
268
  continue;
255
269
  }
256
- if (!(arg.startsWith('--lang=') || arg.startsWith(`${BFF_RUNTIME_OPTION}=`) || arg.startsWith('--ultramodern-package-source=') || arg.startsWith('--ultramodern-package-version=') || arg.startsWith('--ultramodern-package-registry=') || arg.startsWith('--ultramodern-package-scope=') || arg.startsWith('--ultramodern-package-name-prefix=') || arg.startsWith(`${VERTICAL_FLAG}=`) || arg.startsWith(`${VERTICAL_NAME_FLAG}=`) || arg.startsWith(`${CODESMITH_OVERLAY_FLAG}=`))) positionalArgs.push(arg);
270
+ if (!(arg.startsWith('--lang=') || arg.startsWith(`${BFF_RUNTIME_OPTION}=`) || arg.startsWith('--ultramodern-package-source=') || arg.startsWith('--ultramodern-package-version=') || arg.startsWith('--ultramodern-package-registry=') || arg.startsWith('--ultramodern-package-scope=') || arg.startsWith('--ultramodern-package-name-prefix=') || arg.startsWith(`${VERTICAL_FLAG}=`) || arg.startsWith(`${VERTICAL_NAME_FLAG}=`) || arg.startsWith(`${CODESMITH_OVERLAY_FLAG}=`) || bridge_config_cjs_namespaceObject.ultramodernBridgeCliBooleanFlags.some((flag)=>arg.startsWith(`${flag}=`)) || bridge_config_cjs_namespaceObject.ultramodernBridgeCliValueFlags.some((flag)=>arg.startsWith(`${flag}=`)))) positionalArgs.push(arg);
257
271
  }
258
272
  }
259
273
  return positionalArgs;
@@ -369,6 +383,14 @@ function detectCodeSmithOverlays(args) {
369
383
  }
370
384
  return overlays.length > 0 ? overlays : void 0;
371
385
  }
386
+ function readBridgeCliOptions(args) {
387
+ try {
388
+ return (0, bridge_config_cjs_namespaceObject.parseUltramodernBridgeCliOptions)(args);
389
+ } catch (error) {
390
+ console.error(error instanceof Error ? error.message : String(error));
391
+ process.exit(1);
392
+ }
393
+ }
372
394
  function detectUltramodernPackageSource(args, defaultPackageVersion, createPackage) {
373
395
  const bleedingDevDefaults = isBleedingDevCreatePackage(createPackage);
374
396
  const strategy = getOptionValue(args, [
@@ -578,6 +600,10 @@ async function getProjectName() {
578
600
  }
579
601
  async function main() {
580
602
  const args = process.argv.slice(2);
603
+ if ('ultramodern' === args[0]) {
604
+ process.exitCode = await (0, commands_cjs_namespaceObject.runUltramodernToolingCli)(args.slice(1));
605
+ return;
606
+ }
581
607
  if (args.includes('--help') || args.includes('-h')) return void showHelp();
582
608
  if (args.includes('--version') || args.includes('-v')) return void showVersion();
583
609
  if (detectLegacyModernJsFlag(args)) {
@@ -589,10 +615,16 @@ async function main() {
589
615
  const dryRun = detectDryRunFlag(args);
590
616
  const verticalInput = resolveVerticalCliInput(args);
591
617
  const overlays = detectCodeSmithOverlays(args);
618
+ const bridgeRequested = (0, bridge_config_cjs_namespaceObject.hasUltramodernBridgeCliOptions)(args);
592
619
  if (dryRun && !verticalInput.addVertical) {
593
620
  console.error(`${DRY_RUN_FLAG} is currently supported only with ${VERTICAL_FLAG}`);
594
621
  process.exit(1);
595
622
  }
623
+ if (verticalInput.addVertical && bridgeRequested) {
624
+ console.error('Bridge options are supported only when creating a new UltraModern workspace.');
625
+ process.exit(1);
626
+ }
627
+ const bridge = readBridgeCliOptions(args);
596
628
  if (!dryRun) console.log(`\n${index_cjs_namespaceObject.i18n.t(index_cjs_namespaceObject.localeKeys.message.welcome)}\n`);
597
629
  const createPackage = readCreatePackageJson();
598
630
  const version = createPackage.version || 'latest';
@@ -633,6 +665,7 @@ async function main() {
633
665
  packageName: generatedPackageName,
634
666
  modernVersion: version,
635
667
  enableTailwind: detectTailwindFlag(),
668
+ bridge,
636
669
  overlays,
637
670
  packageSource
638
671
  });
@@ -47,7 +47,7 @@ const EN_LOCALE = {
47
47
  step1: 'cd {projectName}',
48
48
  step2: 'pnpm install',
49
49
  step3: 'pnpm dev',
50
- legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nBRUTAL WARNING: YOU ARE OPTING OUT OF ULTRAMODERN.JS DEFAULTS.\nThe unattended default is the best UltraModern.js configuration:\na structured SuperApp workspace, presetUltramodern, TanStack Router,\nEffect BFF, Tailwind CSS v4, and the BleedingDev package cohort.\nThe original Modern.js setup is a dangerous opt-in path.\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
50
+ legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nBRUTAL WARNING: YOU ARE OPTING OUT OF ULTRAMODERN.JS DEFAULTS.\nThe unattended default is the best UltraModern.js configuration:\na structured SuperApp workspace, presetUltramodern, TanStack Router,\na strict Effect API runtime, Tailwind CSS v4, and the BleedingDev package cohort.\nThe original Modern.js setup is a dangerous opt-in path.\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
51
51
  },
52
52
  help: {
53
53
  title: '🚀 UltraModern.js Project Creator',
@@ -59,7 +59,7 @@ const EN_LOCALE = {
59
59
  optionVersion: ' -v, --version Display version information',
60
60
  optionLang: ' -l, --lang Set the language (en default; zh opt-in)',
61
61
  optionTailwind: ' --no-tailwind Disable default Tailwind CSS v4 workspace styling',
62
- optionBff: ' --bff Keep the default Effect BFF scaffolding (every MicroVertical ships an Effect BFF)',
62
+ optionBff: ' --bff Keep the default strict Effect API runtime (every MicroVertical ships one)',
63
63
  optionBffRuntime: ' --bff-runtime Select the BFF runtime for scaffolded MicroVerticals (supported: effect; default: effect)',
64
64
  optionWorkspace: ' --workspace Use workspace protocol for @modern-js dependencies (for local monorepo testing)',
65
65
  optionUltramodernPackageSource: ' --ultramodern-package-source Select UltraModern package source (workspace or install; BleedingDev defaults to install aliases)',
@@ -67,6 +67,16 @@ const EN_LOCALE = {
67
67
  optionUltramodernPackageRegistry: ' --ultramodern-package-registry npm registry URL used for install package sources',
68
68
  optionUltramodernPackageScope: ' --ultramodern-package-scope Publish scope for npm alias installs (for example bleedingdev)',
69
69
  optionUltramodernPackageNamePrefix: ' --ultramodern-package-name-prefix Prefix for npm alias package names (default: modern-js-)',
70
+ optionBridge: ' --bridge Enable explicit nested parent-monorepo bridge mode for new workspaces',
71
+ optionBridgeParentRoot: ' --bridge-parent-root <path> Parent monorepo root for bridge mode',
72
+ optionBridgeWorkspacePackage: ' --bridge-workspace-package <glob> Parent workspace package glob consumed by generated apps',
73
+ optionBridgeWorkspacePackageName: ' --bridge-workspace-package-name <glob=package[,package]> Package names covered by a bridge workspace glob',
74
+ optionBridgeTestAlias: ' --bridge-test-alias <glob:alias=target> Test/source alias for a bridge workspace package glob',
75
+ optionBridgeDependency: ' --bridge-dependency <package[,package]> Explicit parent package dependency consumed by generated apps',
76
+ optionBridgeLockfilePolicy: ' --bridge-lockfile-policy <nested|parent> Bridge lockfile ownership policy (default: nested)',
77
+ optionBridgeGate: ' --bridge-gate <name=command> Delegated parent workspace gate command for bridge packages',
78
+ optionBridgeGateCwd: ' --bridge-gate-cwd <name=cwd> Working directory for a named bridge gate',
79
+ optionBridgeReactSingleton: ' --bridge-react-singleton <package[,package]> React singleton package expectation (default: react,react-dom)',
70
80
  optionVertical: ' --vertical[=<name>] Mutate the current existing UltraModern workspace and wire a MicroVertical',
71
81
  optionVerticalName: ' --vertical-name <name> Explicit MicroVertical name for automation-friendly workspace mutation',
72
82
  optionDryRun: ' --dry-run Preview a MicroVertical mutation plan without writing files (supported with --vertical)',
@@ -47,7 +47,7 @@ const ZH_LOCALE = {
47
47
  step1: 'cd {projectName}',
48
48
  step2: 'pnpm install',
49
49
  step3: 'pnpm dev',
50
- legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n严重警告:你正在退出 ULTRAMODERN.JS 默认配置。\n免交互默认值是最佳 UltraModern.js 配置:\n结构化 SuperApp 工作区、presetUltramodern、TanStack Router、\nEffect BFF、Tailwind CSS v4,以及 BleedingDev 包版本队列。\n原始 Modern.js 初始化是危险的显式选择路径。\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
50
+ legacyModernJsWarning: "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n严重警告:你正在退出 ULTRAMODERN.JS 默认配置。\n免交互默认值是最佳 UltraModern.js 配置:\n结构化 SuperApp 工作区、presetUltramodern、TanStack Router、\n严格 Effect API 运行时、Tailwind CSS v4,以及 BleedingDev 包版本队列。\n原始 Modern.js 初始化是危险的显式选择路径。\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
51
51
  },
52
52
  help: {
53
53
  title: '🚀 UltraModern.js 项目创建工具',
@@ -59,7 +59,7 @@ const ZH_LOCALE = {
59
59
  optionVersion: ' -v, --version 显示版本信息',
60
60
  optionLang: ' -l, --lang 设置语言 (默认 en;zh 需显式选择)',
61
61
  optionTailwind: ' --no-tailwind 禁用默认 Tailwind CSS v4 工作区样式',
62
- optionBff: ' --bff 保留默认的 Effect BFF 脚手架(每个 MicroVertical 自带 Effect BFF)',
62
+ optionBff: ' --bff 保留默认的严格 Effect API 运行时(每个 MicroVertical 自带一个)',
63
63
  optionBffRuntime: ' --bff-runtime 选择 MicroVertical 脚手架的 BFF 运行时(支持: effect;默认: effect)',
64
64
  optionWorkspace: ' --workspace 对 @modern-js 依赖使用 workspace 协议(用于本地 monorepo 联调)',
65
65
  optionUltramodernPackageSource: ' --ultramodern-package-source 选择 UltraModern 依赖来源(workspace 或 install;BleedingDev 默认使用 install alias)',
@@ -67,6 +67,16 @@ const ZH_LOCALE = {
67
67
  optionUltramodernPackageRegistry: ' --ultramodern-package-registry install 依赖来源使用的 npm registry 地址',
68
68
  optionUltramodernPackageScope: ' --ultramodern-package-scope npm alias 安装使用的发布 scope(例如 bleedingdev)',
69
69
  optionUltramodernPackageNamePrefix: ' --ultramodern-package-name-prefix npm alias 包名前缀(默认:modern-js-)',
70
+ optionBridge: ' --bridge 为新工作区启用显式的嵌套父 monorepo 桥接模式',
71
+ optionBridgeParentRoot: ' --bridge-parent-root <路径> 桥接模式使用的父 monorepo 根目录',
72
+ optionBridgeWorkspacePackage: ' --bridge-workspace-package <glob> 生成应用消费的父工作区包 glob',
73
+ optionBridgeWorkspacePackageName: ' --bridge-workspace-package-name <glob=包名[,包名]> 桥接工作区 glob 覆盖的包名',
74
+ optionBridgeTestAlias: ' --bridge-test-alias <glob:别名=目标> 桥接工作区包 glob 的测试/源码 alias',
75
+ optionBridgeDependency: ' --bridge-dependency <包名[,包名]> 生成应用显式消费的父包依赖',
76
+ optionBridgeLockfilePolicy: ' --bridge-lockfile-policy <nested|parent> 桥接 lockfile 归属策略(默认:nested)',
77
+ optionBridgeGate: ' --bridge-gate <名称=命令> 桥接包委托给父工作区执行的 gate 命令',
78
+ optionBridgeGateCwd: ' --bridge-gate-cwd <名称=目录> 指定桥接 gate 的工作目录',
79
+ optionBridgeReactSingleton: ' --bridge-react-singleton <包名[,包名]> React 单例包预期(默认:react,react-dom)',
70
80
  optionVertical: ' --vertical[=<名称>] 修改当前已有的 UltraModern 工作区,并接入 MicroVertical',
71
81
  optionVerticalName: ' --vertical-name <名称> 为自动化工作流显式指定 MicroVertical 名称',
72
82
  optionDryRun: ' --dry-run 预览 MicroVertical 修改计划但不写入文件(与 --vertical 一起使用)',
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
3
+ return "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
4
+ }();
5
+ var __webpack_require__ = {};
6
+ (()=>{
7
+ __webpack_require__.n = (module)=>{
8
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
9
+ __webpack_require__.d(getter, {
10
+ a: getter
11
+ });
12
+ return getter;
13
+ };
14
+ })();
15
+ (()=>{
16
+ __webpack_require__.d = (exports1, getters, values)=>{
17
+ var define = (defs, kind)=>{
18
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
19
+ enumerable: true,
20
+ [kind]: defs[key]
21
+ });
22
+ };
23
+ define(getters, "get");
24
+ define(values, "value");
25
+ };
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
29
+ })();
30
+ (()=>{
31
+ __webpack_require__.r = (exports1)=>{
32
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
33
+ value: 'Module'
34
+ });
35
+ Object.defineProperty(exports1, '__esModule', {
36
+ value: true
37
+ });
38
+ };
39
+ })();
40
+ var __webpack_exports__ = {};
41
+ __webpack_require__.r(__webpack_exports__);
42
+ __webpack_require__.d(__webpack_exports__, {
43
+ runUltramodernToolingCli: ()=>runUltramodernToolingCli
44
+ });
45
+ const external_node_child_process_namespaceObject = require("node:child_process");
46
+ const external_node_fs_namespaceObject = require("node:fs");
47
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
48
+ const external_node_os_namespaceObject = require("node:os");
49
+ var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
50
+ const external_node_path_namespaceObject = require("node:path");
51
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
52
+ const external_node_url_namespaceObject = require("node:url");
53
+ const external_create_package_root_cjs_namespaceObject = require("../create-package-root.cjs");
54
+ const mf_validation_cjs_namespaceObject = require("../ultramodern-workspace/mf-validation.cjs");
55
+ const workspace_scripts_cjs_namespaceObject = require("../ultramodern-workspace/workspace-scripts.cjs");
56
+ const external_config_cjs_namespaceObject = require("./config.cjs");
57
+ const commands_dirname = external_node_path_default().dirname((0, external_node_url_namespaceObject.fileURLToPath)(__rslib_import_meta_url__));
58
+ const createPackageRoot = (0, external_create_package_root_cjs_namespaceObject.resolveCreatePackageRoot)(commands_dirname);
59
+ function printHelp() {
60
+ process.stdout.write(`Usage:
61
+ modern-js-create ultramodern <command> [args]
62
+
63
+ Commands:
64
+ validate
65
+ typecheck
66
+ mf-types
67
+ public-surface
68
+ cloudflare-proof
69
+ performance-readiness
70
+ skills install
71
+ skills check
72
+ `);
73
+ }
74
+ function spawnNodeScript(relativeScriptPath, args, context, options = {}) {
75
+ const scriptPath = external_node_path_default().join(createPackageRoot, relativeScriptPath);
76
+ const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
77
+ scriptPath,
78
+ ...args
79
+ ], {
80
+ cwd: options.cwd ?? context.workspaceRoot,
81
+ env: {
82
+ ...process.env,
83
+ ULTRAMODERN_WORKSPACE_ROOT: context.workspaceRoot
84
+ },
85
+ stdio: 'inherit'
86
+ });
87
+ if (result.error) throw result.error;
88
+ return result.status ?? 1;
89
+ }
90
+ function runRenderedModule(source, context) {
91
+ const tempDir = external_node_fs_default().mkdtempSync(external_node_path_default().join(external_node_os_default().tmpdir(), 'ultramodern-tool-'));
92
+ const tempFile = external_node_path_default().join(tempDir, 'command.mjs');
93
+ try {
94
+ external_node_fs_default().writeFileSync(tempFile, source, 'utf-8');
95
+ const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
96
+ tempFile
97
+ ], {
98
+ cwd: context.workspaceRoot,
99
+ stdio: 'inherit'
100
+ });
101
+ if (result.error) throw result.error;
102
+ return result.status ?? 1;
103
+ } finally{
104
+ external_node_fs_default().rmSync(tempDir, {
105
+ force: true,
106
+ recursive: true
107
+ });
108
+ }
109
+ }
110
+ function runValidate(context) {
111
+ const config = (0, external_config_cjs_namespaceObject.readUltramodernConfig)(context.workspaceRoot);
112
+ const apps = (0, external_config_cjs_namespaceObject.workspaceAppsFromToolingConfig)(config);
113
+ const remotes = apps.filter((app)=>'shell' !== app.kind);
114
+ const source = (0, workspace_scripts_cjs_namespaceObject.createWorkspaceValidationScript)(config.workspace.packageScope, config.features.tailwind, remotes);
115
+ return runRenderedModule(source, context);
116
+ }
117
+ function runMfTypes(args, context) {
118
+ if (args.includes('--help') || args.includes('-h')) {
119
+ process.stdout.write(`Usage:
120
+ modern-js-create ultramodern mf-types [app-dir...]
121
+
122
+ Checks real Module Federation config files and DTS archives for exposed apps.
123
+ `);
124
+ return 0;
125
+ }
126
+ (0, mf_validation_cjs_namespaceObject.validateModuleFederationTypes)({
127
+ workspaceRoot: context.workspaceRoot,
128
+ appDirs: args.length > 0 ? args : void 0
129
+ });
130
+ return 0;
131
+ }
132
+ function runSkills(args, context) {
133
+ const [subcommand, ...rest] = args;
134
+ if ('install' === subcommand) return spawnNodeScript("template-workspace/scripts/bootstrap-agent-skills.mjs", rest, context);
135
+ if ('check' === subcommand) return spawnNodeScript("template-workspace/scripts/bootstrap-agent-skills.mjs", [
136
+ '--check',
137
+ ...rest
138
+ ], context);
139
+ throw new Error('Usage: modern-js-create ultramodern skills <install|check>');
140
+ }
141
+ async function runUltramodernToolingCli(args, workspaceRoot = process.env.ULTRAMODERN_WORKSPACE_ROOT ?? process.cwd()) {
142
+ try {
143
+ const [command, ...rest] = args;
144
+ const context = {
145
+ workspaceRoot: external_node_path_default().resolve(workspaceRoot),
146
+ invocationCwd: process.cwd()
147
+ };
148
+ switch(command){
149
+ case void 0:
150
+ case '--help':
151
+ case '-h':
152
+ printHelp();
153
+ return 0;
154
+ case 'validate':
155
+ return runValidate(context);
156
+ case 'typecheck':
157
+ return spawnNodeScript("templates/workspace-scripts/ultramodern-typecheck.mjs", rest, context, {
158
+ cwd: context.invocationCwd
159
+ });
160
+ case 'mf-types':
161
+ return runMfTypes(rest, context);
162
+ case 'public-surface':
163
+ return spawnNodeScript("templates/workspace-scripts/generate-public-surface-assets.mjs", rest, context);
164
+ case 'cloudflare-proof':
165
+ return spawnNodeScript("templates/workspace-scripts/proof-cloudflare-version.mjs", rest, context);
166
+ case 'performance-readiness':
167
+ return spawnNodeScript("templates/workspace-scripts/ultramodern-performance-readiness.mjs", rest, context);
168
+ case 'skills':
169
+ return runSkills(rest, context);
170
+ default:
171
+ throw new Error(`Unknown UltraModern command: ${command}`);
172
+ }
173
+ } catch (error) {
174
+ const message = error instanceof Error ? error.message : String(error);
175
+ process.stderr.write(`[ultramodern] ${message}\n`);
176
+ return 1;
177
+ }
178
+ }
179
+ exports.runUltramodernToolingCli = __webpack_exports__.runUltramodernToolingCli;
180
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
181
+ "runUltramodernToolingCli"
182
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
183
+ Object.defineProperty(exports, '__esModule', {
184
+ value: true
185
+ });
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, getters, values)=>{
14
+ var define = (defs, kind)=>{
15
+ for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
+ enumerable: true,
17
+ [kind]: defs[key]
18
+ });
19
+ };
20
+ define(getters, "get");
21
+ define(values, "value");
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
+ })();
27
+ (()=>{
28
+ __webpack_require__.r = (exports1)=>{
29
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
30
+ value: 'Module'
31
+ });
32
+ Object.defineProperty(exports1, '__esModule', {
33
+ value: true
34
+ });
35
+ };
36
+ })();
37
+ var __webpack_exports__ = {};
38
+ __webpack_require__.r(__webpack_exports__);
39
+ __webpack_require__.d(__webpack_exports__, {
40
+ readUltramodernConfig: ()=>readUltramodernConfig,
41
+ workspaceAppsFromToolingConfig: ()=>workspaceAppsFromToolingConfig
42
+ });
43
+ const external_node_fs_namespaceObject = require("node:fs");
44
+ var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
45
+ const external_node_path_namespaceObject = require("node:path");
46
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
47
+ const bridge_config_cjs_namespaceObject = require("../ultramodern-workspace/bridge-config.cjs");
48
+ const descriptors_cjs_namespaceObject = require("../ultramodern-workspace/descriptors.cjs");
49
+ const naming_cjs_namespaceObject = require("../ultramodern-workspace/naming.cjs");
50
+ function readJsonObject(filePath) {
51
+ const value = JSON.parse(external_node_fs_default().readFileSync(filePath, 'utf-8'));
52
+ if (null === value || 'object' != typeof value || Array.isArray(value)) throw new Error(`UltraModern config must contain a JSON object: ${filePath}`);
53
+ return value;
54
+ }
55
+ function readOptionalJsonObject(filePath) {
56
+ return external_node_fs_default().existsSync(filePath) ? readJsonObject(filePath) : {};
57
+ }
58
+ function packageScopeFromRoot(workspaceRoot1) {
59
+ const rootPackage = readOptionalJsonObject(external_node_path_default().join(workspaceRoot1, 'package.json'));
60
+ return 'string' == typeof rootPackage.name && rootPackage.name.length > 0 ? rootPackage.name : external_node_path_default().basename(workspaceRoot1);
61
+ }
62
+ function normalizeCompactConfig(sourcePath, config) {
63
+ const packageSource = config.packageSource && 'object' == typeof config.packageSource ? {
64
+ strategy: 'install' === config.packageSource.strategy ? 'install' : 'workspace',
65
+ modernPackageVersion: 'string' == typeof config.packageSource.modernPackageVersion ? config.packageSource.modernPackageVersion : 'workspace:*',
66
+ registry: 'string' == typeof config.packageSource.registry ? config.packageSource.registry : void 0,
67
+ aliasScope: 'string' == typeof config.packageSource.aliasScope ? config.packageSource.aliasScope : void 0,
68
+ aliasPackageNamePrefix: 'string' == typeof config.packageSource.aliasPackageNamePrefix ? config.packageSource.aliasPackageNamePrefix : void 0
69
+ } : void 0;
70
+ return {
71
+ schemaVersion: 'number' == typeof config.schemaVersion ? config.schemaVersion : 1,
72
+ profile: 'string' == typeof config.profile ? config.profile : void 0,
73
+ source: 'compact',
74
+ sourcePath,
75
+ workspace: {
76
+ packageScope: 'string' == typeof config.workspace?.packageScope ? config.workspace.packageScope : packageScopeFromRoot(workspaceRoot)
77
+ },
78
+ packageSource,
79
+ features: {
80
+ tailwind: config.features?.tailwind !== false
81
+ },
82
+ bridge: (0, bridge_config_cjs_namespaceObject.normalizeUltramodernBridgeConfig)(config.bridge),
83
+ topology: {
84
+ apps: Array.isArray(config.topology?.apps) ? config.topology.apps.map((app)=>({
85
+ id: String(app.id),
86
+ kind: 'vertical' === app.kind ? 'vertical' : 'shell',
87
+ path: 'string' == typeof app.path ? app.path : '.',
88
+ package: 'string' == typeof app.package ? app.package : void 0,
89
+ packageSuffix: 'string' == typeof app.packageSuffix ? app.packageSuffix : void 0,
90
+ displayName: 'string' == typeof app.displayName ? app.displayName : void 0,
91
+ domain: 'string' == typeof app.domain ? app.domain : void 0,
92
+ port: 'number' == typeof app.port ? app.port : void 0,
93
+ portEnv: 'string' == typeof app.portEnv ? app.portEnv : void 0,
94
+ moduleFederation: app.moduleFederation && 'object' == typeof app.moduleFederation ? {
95
+ role: 'remote' === app.moduleFederation.role ? 'remote' : 'host',
96
+ name: 'string' == typeof app.moduleFederation.name ? app.moduleFederation.name : void 0,
97
+ exposes: Array.isArray(app.moduleFederation.exposes) ? app.moduleFederation.exposes.filter((expose)=>'string' == typeof expose) : void 0,
98
+ 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])),
99
+ verticalRefs: Array.isArray(app.moduleFederation.verticalRefs) ? app.moduleFederation.verticalRefs.filter((ref)=>'string' == typeof ref) : void 0,
100
+ hostOnly: true === app.moduleFederation.hostOnly,
101
+ noExposes: true === app.moduleFederation.noExposes
102
+ } : void 0,
103
+ effectApi: app.effectApi && 'object' == typeof app.effectApi ? {
104
+ stem: 'string' == typeof app.effectApi.stem ? app.effectApi.stem : String(app.id),
105
+ prefix: 'string' == typeof app.effectApi.prefix ? app.effectApi.prefix : `/${String(app.id)}-api`,
106
+ consumedBy: Array.isArray(app.effectApi.consumedBy) ? app.effectApi.consumedBy.filter((consumer)=>'string' == typeof consumer) : [
107
+ descriptors_cjs_namespaceObject.shellApp.id,
108
+ String(app.id)
109
+ ]
110
+ } : void 0
111
+ })) : []
112
+ }
113
+ };
114
+ }
115
+ function readUltramodernConfig(workspaceRoot1 = process.cwd()) {
116
+ const compactPath = external_node_path_default().join(workspaceRoot1, descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
117
+ if (external_node_fs_default().existsSync(compactPath)) return normalizeCompactConfig(compactPath, readJsonObject(compactPath));
118
+ throw new Error(`Missing UltraModern config. Expected ${descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH}.`);
119
+ }
120
+ function workspaceAppsFromToolingConfig(config) {
121
+ return config.topology.apps.map((app)=>{
122
+ if ('shell' === app.kind) return {
123
+ ...descriptors_cjs_namespaceObject.shellApp,
124
+ directory: app.path,
125
+ packageSuffix: app.packageSuffix ?? descriptors_cjs_namespaceObject.shellApp.packageSuffix,
126
+ displayName: app.displayName ?? descriptors_cjs_namespaceObject.shellApp.displayName,
127
+ port: app.port ?? descriptors_cjs_namespaceObject.shellApp.port,
128
+ portEnv: app.portEnv ?? descriptors_cjs_namespaceObject.shellApp.portEnv,
129
+ mfName: app.moduleFederation?.name ?? descriptors_cjs_namespaceObject.shellApp.mfName,
130
+ verticalRefs: app.moduleFederation?.verticalRefs ?? []
131
+ };
132
+ const domain = app.domain ?? app.id;
133
+ const packageSuffix = app.packageSuffix ?? domain;
134
+ const exposePaths = app.moduleFederation?.exposePaths ?? {};
135
+ const exposes = Object.fromEntries((app.moduleFederation?.exposes ?? []).map((expose)=>{
136
+ const configuredPath = exposePaths[expose];
137
+ 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`;
138
+ return [
139
+ expose,
140
+ configuredPath ?? inferredPath
141
+ ];
142
+ }));
143
+ return {
144
+ id: app.id,
145
+ directory: app.path,
146
+ packageSuffix,
147
+ displayName: app.displayName ?? `${domain} Vertical`,
148
+ kind: 'vertical',
149
+ domain,
150
+ portEnv: app.portEnv ?? `VERTICAL_${domain.replace(/[^a-zA-Z0-9]+/g, '_').toUpperCase()}_PORT`,
151
+ port: app.port ?? 0,
152
+ mfName: app.moduleFederation?.name ?? app.id,
153
+ exposes,
154
+ ...app.moduleFederation?.verticalRefs ? {
155
+ verticalRefs: app.moduleFederation.verticalRefs
156
+ } : {},
157
+ ...app.effectApi ? {
158
+ effectApi: app.effectApi
159
+ } : {},
160
+ ownership: (0, descriptors_cjs_namespaceObject.createNeutralOwnership)(app.id)
161
+ };
162
+ });
163
+ }
164
+ exports.readUltramodernConfig = __webpack_exports__.readUltramodernConfig;
165
+ exports.workspaceAppsFromToolingConfig = __webpack_exports__.workspaceAppsFromToolingConfig;
166
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
167
+ "readUltramodernConfig",
168
+ "workspaceAppsFromToolingConfig"
169
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
170
+ Object.defineProperty(exports, '__esModule', {
171
+ value: true
172
+ });