@bleedingdev/modern-js-create 3.4.0-ultramodern.9 → 3.5.0-ultramodern.1

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 (135) hide show
  1. package/README.md +49 -23
  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 +431 -0
  6. package/dist/cjs/ultramodern-tooling/config.cjs +172 -0
  7. package/dist/cjs/ultramodern-workspace/add-vertical.cjs +87 -75
  8. package/dist/cjs/ultramodern-workspace/{effect-api.cjs → api.cjs} +207 -208
  9. package/dist/cjs/ultramodern-workspace/bridge-config.cjs +327 -0
  10. package/dist/cjs/ultramodern-workspace/codesmith.cjs +1 -0
  11. package/dist/cjs/ultramodern-workspace/contracts.cjs +128 -657
  12. package/dist/cjs/ultramodern-workspace/demo-components.cjs +12 -12
  13. package/dist/cjs/ultramodern-workspace/descriptors.cjs +25 -25
  14. package/dist/cjs/ultramodern-workspace/fs-io.cjs +117 -0
  15. package/dist/cjs/ultramodern-workspace/generation-result.cjs +5 -5
  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 +39 -12
  19. package/dist/cjs/ultramodern-workspace/overlays.cjs +2 -2
  20. package/dist/cjs/ultramodern-workspace/package-json.cjs +58 -41
  21. package/dist/cjs/ultramodern-workspace/policy.cjs +4 -4
  22. package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
  23. package/dist/cjs/ultramodern-workspace/public-surface.cjs +2 -2
  24. package/dist/cjs/ultramodern-workspace/versions.cjs +15 -0
  25. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +120 -50
  26. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +64 -21
  27. package/dist/esm/index.js +37 -4
  28. package/dist/esm/locale/en.js +12 -2
  29. package/dist/esm/locale/zh.js +12 -2
  30. package/dist/esm/ultramodern-tooling/commands.js +378 -0
  31. package/dist/esm/ultramodern-tooling/config.js +120 -0
  32. package/dist/esm/ultramodern-workspace/add-vertical.js +88 -79
  33. package/dist/esm/ultramodern-workspace/{effect-api.js → api.js} +146 -147
  34. package/dist/esm/ultramodern-workspace/bridge-config.js +270 -0
  35. package/dist/esm/ultramodern-workspace/codesmith.js +1 -0
  36. package/dist/esm/ultramodern-workspace/contracts.js +130 -611
  37. package/dist/esm/ultramodern-workspace/demo-components.js +13 -13
  38. package/dist/esm/ultramodern-workspace/descriptors.js +11 -11
  39. package/dist/esm/ultramodern-workspace/fs-io.js +116 -2
  40. package/dist/esm/ultramodern-workspace/generation-result.js +6 -6
  41. package/dist/esm/ultramodern-workspace/index.js +1 -0
  42. package/dist/esm/ultramodern-workspace/mf-validation.js +516 -0
  43. package/dist/esm/ultramodern-workspace/module-federation.js +40 -13
  44. package/dist/esm/ultramodern-workspace/overlays.js +2 -2
  45. package/dist/esm/ultramodern-workspace/package-json.js +57 -40
  46. package/dist/esm/ultramodern-workspace/policy.js +5 -5
  47. package/dist/esm/ultramodern-workspace/public-api.js +1 -0
  48. package/dist/esm/ultramodern-workspace/public-surface.js +2 -2
  49. package/dist/esm/ultramodern-workspace/versions.js +7 -1
  50. package/dist/esm/ultramodern-workspace/workspace-scripts.js +108 -34
  51. package/dist/esm/ultramodern-workspace/write-workspace.js +66 -26
  52. package/dist/esm-node/index.js +37 -4
  53. package/dist/esm-node/locale/en.js +12 -2
  54. package/dist/esm-node/locale/zh.js +12 -2
  55. package/dist/esm-node/ultramodern-tooling/commands.js +379 -0
  56. package/dist/esm-node/ultramodern-tooling/config.js +121 -0
  57. package/dist/esm-node/ultramodern-workspace/add-vertical.js +88 -79
  58. package/dist/esm-node/ultramodern-workspace/{effect-api.js → api.js} +146 -147
  59. package/dist/esm-node/ultramodern-workspace/bridge-config.js +271 -0
  60. package/dist/esm-node/ultramodern-workspace/codesmith.js +1 -0
  61. package/dist/esm-node/ultramodern-workspace/contracts.js +130 -611
  62. package/dist/esm-node/ultramodern-workspace/demo-components.js +13 -13
  63. package/dist/esm-node/ultramodern-workspace/descriptors.js +11 -11
  64. package/dist/esm-node/ultramodern-workspace/fs-io.js +116 -2
  65. package/dist/esm-node/ultramodern-workspace/generation-result.js +6 -6
  66. package/dist/esm-node/ultramodern-workspace/index.js +1 -0
  67. package/dist/esm-node/ultramodern-workspace/mf-validation.js +517 -0
  68. package/dist/esm-node/ultramodern-workspace/module-federation.js +40 -13
  69. package/dist/esm-node/ultramodern-workspace/overlays.js +2 -2
  70. package/dist/esm-node/ultramodern-workspace/package-json.js +57 -40
  71. package/dist/esm-node/ultramodern-workspace/policy.js +5 -5
  72. package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
  73. package/dist/esm-node/ultramodern-workspace/public-surface.js +2 -2
  74. package/dist/esm-node/ultramodern-workspace/versions.js +7 -1
  75. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +108 -34
  76. package/dist/esm-node/ultramodern-workspace/write-workspace.js +66 -26
  77. package/dist/types/locale/en.d.ts +10 -0
  78. package/dist/types/locale/index.d.ts +20 -0
  79. package/dist/types/locale/zh.d.ts +10 -0
  80. package/dist/types/ultramodern-tooling/commands.d.ts +1 -0
  81. package/dist/types/ultramodern-tooling/config.d.ts +43 -0
  82. package/dist/types/ultramodern-workspace/add-vertical.d.ts +5 -2
  83. package/dist/types/ultramodern-workspace/api.d.ts +73 -0
  84. package/dist/types/ultramodern-workspace/bridge-config.d.ts +64 -0
  85. package/dist/types/ultramodern-workspace/codesmith.d.ts +1 -0
  86. package/dist/types/ultramodern-workspace/contracts.d.ts +2 -17
  87. package/dist/types/ultramodern-workspace/descriptors.d.ts +10 -10
  88. package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -0
  89. package/dist/types/ultramodern-workspace/index.d.ts +2 -0
  90. package/dist/types/ultramodern-workspace/mf-validation.d.ts +27 -0
  91. package/dist/types/ultramodern-workspace/package-json.d.ts +5 -4
  92. package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
  93. package/dist/types/ultramodern-workspace/types.d.ts +9 -7
  94. package/dist/types/ultramodern-workspace/versions.d.ts +6 -0
  95. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -7
  96. package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
  97. package/package.json +5 -3
  98. package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
  99. package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +2 -0
  100. package/template-workspace/.gitignore.handlebars +3 -0
  101. package/template-workspace/AGENTS.md.handlebars +11 -5
  102. package/template-workspace/README.md.handlebars +55 -13
  103. package/template-workspace/oxfmt.config.ts +1 -0
  104. package/template-workspace/oxlint.config.ts +1 -0
  105. package/template-workspace/patches/@tanstack__router-core@1.171.13.patch +51 -0
  106. package/template-workspace/pnpm-workspace.yaml.handlebars +7 -0
  107. package/template-workspace/scripts/bootstrap-agent-skills.mjs +77 -67
  108. package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +51 -8
  109. package/templates/workspace-scripts/check-ultramodern-api-boundaries.mts +366 -0
  110. package/templates/workspace-scripts/{check-ultramodern-i18n-boundaries.mjs → check-ultramodern-i18n-boundaries.mts} +1 -1
  111. package/templates/workspace-scripts/generate-public-surface-assets.mjs +246 -9
  112. package/templates/workspace-scripts/proof-cloudflare-version.mjs +277 -9
  113. package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +35 -10
  114. package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +165 -2
  115. package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
  116. package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +842 -84
  117. package/dist/types/ultramodern-workspace/effect-api.d.ts +0 -73
  118. /package/template-workspace/{.agents → .codex}/rstackjs-agent-skills-LICENSE +0 -0
  119. /package/template-workspace/{.agents → .codex}/skills/rsbuild-best-practices/SKILL.md +0 -0
  120. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/SKILL.md +0 -0
  121. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/command-map.md +0 -0
  122. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/common-analysis-patterns.md +0 -0
  123. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +0 -0
  124. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +0 -0
  125. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +0 -0
  126. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor.md +0 -0
  127. /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +0 -0
  128. /package/template-workspace/{.agents → .codex}/skills/rslib-best-practices/SKILL.md +0 -0
  129. /package/template-workspace/{.agents → .codex}/skills/rslib-modern-package/SKILL.md +0 -0
  130. /package/template-workspace/{.agents → .codex}/skills/rspack-best-practices/SKILL.md +0 -0
  131. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/SKILL.md +0 -0
  132. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/bottlenecks.md +0 -0
  133. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/tracing-guide.md +0 -0
  134. /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/scripts/analyze_trace.js +0 -0
  135. /package/template-workspace/{.agents → .codex}/skills/rstest-best-practices/SKILL.md +0 -0
package/README.md CHANGED
@@ -35,10 +35,11 @@ domains to delete. It generates:
35
35
  - `apps/shell-super-app` as the Module Federation host and topology owner.
36
36
  - `verticals/*` empty until a real domain is added with `--vertical`.
37
37
  - `packages/shared-*` placeholders for shared contracts, tokens, and Effect
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.
38
+ API support.
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
 
@@ -80,8 +81,8 @@ such as Module Federation DTS generation, and use `@effect/tsgo` plus
80
81
  `@typescript/native-preview` as tooling for `pnpm typecheck`. Generated
81
82
  app/package source must not depend on compiler API internals. Existing compiler
82
83
  API tests in this package use the stable TypeScript 6 package. If a future AST
83
- utility is needed, keep it behind a dedicated compatibility module and test it
84
- against stable `typescript`, not native-preview internals.
84
+ utility is needed, keep it behind a dedicated stable-TypeScript adapter and test
85
+ it against stable `typescript`, not native-preview internals.
85
86
 
86
87
  Generated CI does not call the local aggregate. It runs format, lint,
87
88
  typecheck, skills, i18n boundary validation, contract validation, and build as
@@ -136,7 +137,7 @@ const vertical = addUltramodernVertical({
136
137
 
137
138
  Workspace generation returns `operation`, `workspaceRoot`, `packageScope`,
138
139
  `packageSource`, `createdApps`, `createdPaths`, `rewrittenPaths`,
139
- `assignedPorts`, `moduleFederationNames`, `effectApiPrefixes`,
140
+ `assignedPorts`, `moduleFederationNames`, `apiPrefixes`,
140
141
  `generatedContractPath`, and `warnings`. MicroVertical addition returns the
141
142
  same shape for the new vertical and all rewritten integration surfaces.
142
143
 
@@ -150,7 +151,7 @@ pnpm dlx @bleedingdev/modern-js-create --vertical-name new-vertical --dry-run
150
151
  ```
151
152
 
152
153
  The dry-run object adds `dryRun: true`, `selectedPort`,
153
- `moduleFederationRemote`, `effectApiPrefix`, `jsonMutations`,
154
+ `moduleFederationRemote`, `apiPrefix`, `jsonMutations`,
154
155
  `shellDependencyChanges`, and `generatedContractChanges`. It still validates
155
156
  the workspace before returning a plan.
156
157
 
@@ -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
@@ -188,13 +189,37 @@ mise exec -- pnpm check
188
189
  mise exec -- pnpm build
189
190
  ```
190
191
 
192
+ For strict Effect API migrations, update generated package metadata and Modern
193
+ package aliases through the framework command before hand-editing app code:
194
+
195
+ ```bash
196
+ pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.1 ultramodern \
197
+ migrate-strict-effect --version 3.5.0-ultramodern.1
198
+ pnpm api:check
199
+ pnpm contract:check
200
+ pnpm check
201
+ pnpm build
202
+ ```
203
+
204
+ The command updates `.modernjs/ultramodern.json`, root `modernjs.packageSource`,
205
+ generated Modern package aliases, old direct topology metadata, and the pnpm
206
+ lockfile. It does not invent compatibility shims or move business code behind
207
+ your back. If `pnpm api:check` still fails, migrate the source to
208
+ `shared/api.ts`, `api/index.ts`, and `src/api/*-client.ts` and delete
209
+ `api/effect`, `api/lambda`, `shared/effect`, and `src/effect` paths.
210
+
211
+ Generated strict Effect workspaces pin the compatible Effect cohort through
212
+ `pnpm-workspace.yaml` overrides: `effect@4.0.0-beta.89` and
213
+ `@effect/vitest@4.0.0-beta.89`. Do not override those in app packages; update
214
+ the framework cohort when the runtime moves.
215
+
191
216
  Use `--ultramodern-package-source=install` for published cohort proof and pin a
192
217
  specific release with `--ultramodern-package-version` when CI must prove an
193
218
  exact framework version. Keep `--workspace` only for local monorepo testing
194
219
  against unpublished packages. After install, run the generated
195
- `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.
220
+ `scripts/validate-ultramodern-workspace.mts` contract check and fix ownership
221
+ conflicts in the owning JSON/config files instead of editing generated metadata
222
+ by hand.
198
223
 
199
224
  ## CodeSmith Adapter And Overlays
200
225
 
@@ -257,8 +282,8 @@ addUltramodernVertical({
257
282
 
258
283
  Overlay config receives `workspaceRoot`, `packageScope`, `operation`,
259
284
  `generatedApp`, `generatedApps`, `assignedPort`, `assignedPorts`,
260
- `moduleFederationName`, `moduleFederationNames`, `effectApiPrefix`,
261
- `effectApiPrefixes`, `packageSource`, and `generationResult`. Overlays extend
285
+ `moduleFederationName`, `moduleFederationNames`, `apiPrefix`,
286
+ `apiPrefixes`, `packageSource`, and `generationResult`. Overlays extend
262
287
  the generated output after base generation; they do not replace, inherit, or
263
288
  shadow the base templates. Overlay failures stop the command with an
264
289
  `UltraModern CodeSmith overlay failed` error and do not report base generation
@@ -268,7 +293,7 @@ as fully successful.
268
293
 
269
294
  Use the workspace add flow from the UltraModern workspace root. It derives the
270
295
  package path, package name, port, Module Federation name, topology entry, local
271
- overlay, ownership entry, Effect BFF surface, and root `dev:*` script from the
296
+ overlay, ownership entry, strict Effect HttpApi surface, and root `dev:*` script from the
272
297
  requested vertical name.
273
298
 
274
299
  ```bash
@@ -298,7 +323,7 @@ exported by the vertical packages.
298
323
 
299
324
  Route metadata is route-owned and colocated in
300
325
  `src/routes/**/route.meta.ts`. The scaffold regenerates
301
- `src/routes/ultramodern-route-metadata.ts` as a compatibility manifest for
326
+ `src/routes/ultramodern-route-metadata.ts` as a generated route manifest for
302
327
  Modern.js config, i18n, public head, and public surface contracts; authors
303
328
  should not hand-maintain it. Locale JSON is served from
304
329
  `/locales/{{lng}}/{{ns}}.json`; Czech and English routes are generated from the
@@ -322,7 +347,7 @@ Dynamic public routes can expand sitemap entries through route-owned,
322
347
  Node-safe ESM providers, normally `route.sitemap.mjs` beside the route
323
348
  metadata. The public-surface generator discovers those providers for dynamic
324
349
  public routes and still honors explicit `routes.publicSurface.contentSources`
325
- entries in the generated compatibility manifest. Providers may export
350
+ entries in the generated route manifest. Providers may export
326
351
  `entries`, `entries()`, or a default entries/loader returning sitemap entries;
327
352
  draft entries and `indexable: false` entries are omitted.
328
353
 
@@ -348,7 +373,7 @@ updating workspaces.
348
373
  | --- | --- | --- |
349
374
  | `MODERN_PUBLIC_SITE_URL` | Canonical site origin for public SEO output only | Canonical, hreflang, sitemap `<loc>`, robots `Sitemap:` |
350
375
  | `MODERN_ASSET_PREFIX` | Preferred JS/CSS/static asset prefix | Modern/Rspack-emitted asset URLs |
351
- | `ULTRAMODERN_ASSET_PREFIX` | UltraModern compatibility asset prefix | Modern/Rspack-emitted asset URLs when `MODERN_ASSET_PREFIX` is unset |
376
+ | `ULTRAMODERN_ASSET_PREFIX` | UltraModern asset prefix fallback | Modern/Rspack-emitted asset URLs when `MODERN_ASSET_PREFIX` is unset |
352
377
  | `ULTRAMODERN_PUBLIC_URL_<APP_ID>` | Per-app deployment/proof URL | Cloudflare proof inputs and Module Federation remote URLs |
353
378
 
354
379
  Asset URLs use this precedence: `MODERN_ASSET_PREFIX` →
@@ -371,12 +396,13 @@ Each generated workspace app has:
371
396
 
372
397
  - `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
373
398
  `cloudflare:proof` scripts.
374
- - Cloudflare metadata in `.modernjs/ultramodern-generated-contract.json`.
399
+ - Cloudflare Worker deploy config from Modern config plus
400
+ `.modernjs/ultramodern.json`.
375
401
  - `zephyr:dependencies` for any consumed verticals.
376
402
  - `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
377
403
 
378
404
  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
405
+ the proof step. The proof script reads the compact UltraModern config and checks the
380
406
  Cloudflare Worker surface, including public-route sitemap/robots consistency,
381
407
  preview noindex behavior, unknown-route status, asset headers, byte budgets,
382
408
  and public sourcemap exposure. Shell-only workspaces only need the shell URL;
@@ -401,7 +427,7 @@ proven.
401
427
  | 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
428
  | Install failure | Check the active Node/pnpm from `mise install`; rerun `pnpm install` after the shell sees the pinned versions. | Toolchain setup |
403
429
  | 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 |
430
+ | 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
431
  | Cloudflare credentials | Confirm Wrangler credentials before `pnpm cloudflare:deploy`; local checks do not prove live Worker access. | Deployment operator |
406
432
  | 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
433
  | 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 一起使用)',