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

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 (114) hide show
  1. package/dist/cjs/ultramodern-tooling/commands/cloudflare-output-verify.cjs +29 -53
  2. package/dist/cjs/ultramodern-tooling/commands/context.cjs +0 -27
  3. package/dist/cjs/ultramodern-tooling/commands/routes-generate-app.cjs +60 -0
  4. package/dist/cjs/ultramodern-tooling/commands/routes-generate.cjs +12 -48
  5. package/dist/cjs/ultramodern-tooling/commands/validate.cjs +5 -3
  6. package/dist/cjs/ultramodern-tooling/commands.cjs +2 -2
  7. package/dist/cjs/ultramodern-tooling/config/normalize.cjs +11 -1
  8. package/dist/cjs/ultramodern-workspace/add-shell.cjs +61 -138
  9. package/dist/cjs/ultramodern-workspace/add-vertical/execute.cjs +23 -57
  10. package/dist/cjs/ultramodern-workspace/add-vertical/plan.cjs +13 -159
  11. package/dist/cjs/ultramodern-workspace/add-vertical/preflight.cjs +6 -5
  12. package/dist/cjs/ultramodern-workspace/add-vertical/preview.cjs +78 -0
  13. package/dist/cjs/ultramodern-workspace/add-vertical/transaction.cjs +2 -2
  14. package/dist/cjs/ultramodern-workspace/add-vertical/workspace-state.cjs +18 -34
  15. package/dist/cjs/ultramodern-workspace/add-vertical.cjs +0 -9
  16. package/dist/cjs/ultramodern-workspace/demo-components.cjs +62 -115
  17. package/dist/cjs/ultramodern-workspace/module-federation/config.cjs +1 -1
  18. package/dist/cjs/ultramodern-workspace/module-federation/remote-refs.cjs +1 -43
  19. package/dist/cjs/ultramodern-workspace/patch-inventory.cjs +131 -0
  20. package/dist/cjs/ultramodern-workspace/policy.cjs +13 -39
  21. package/dist/cjs/ultramodern-workspace/shared-patches.cjs +12 -2
  22. package/dist/cjs/ultramodern-workspace/validation/architecture.cjs +397 -0
  23. package/dist/cjs/ultramodern-workspace/validation/assertions.cjs +140 -0
  24. package/dist/cjs/ultramodern-workspace/validation/types.cjs +18 -0
  25. package/dist/cjs/ultramodern-workspace/validation/workspace.cjs +1317 -0
  26. package/dist/cjs/ultramodern-workspace/workspace-artifact-ownership.cjs +76 -31
  27. package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +29 -60
  28. package/dist/cjs/ultramodern-workspace/write-workspace.cjs +1 -1
  29. package/dist/esm/ultramodern-tooling/commands/cloudflare-output-verify.js +29 -53
  30. package/dist/esm/ultramodern-tooling/commands/context.js +1 -23
  31. package/dist/esm/ultramodern-tooling/commands/routes-generate-app.js +28 -0
  32. package/dist/esm/ultramodern-tooling/commands/routes-generate.js +13 -49
  33. package/dist/esm/ultramodern-tooling/commands/validate.js +6 -4
  34. package/dist/esm/ultramodern-tooling/commands.js +2 -2
  35. package/dist/esm/ultramodern-tooling/config/normalize.js +12 -2
  36. package/dist/esm/ultramodern-workspace/add-shell.js +63 -139
  37. package/dist/esm/ultramodern-workspace/add-vertical/execute.js +22 -59
  38. package/dist/esm/ultramodern-workspace/add-vertical/plan.js +15 -149
  39. package/dist/esm/ultramodern-workspace/add-vertical/preflight.js +3 -5
  40. package/dist/esm/ultramodern-workspace/add-vertical/preview.js +40 -0
  41. package/dist/esm/ultramodern-workspace/add-vertical/transaction.js +2 -2
  42. package/dist/esm/ultramodern-workspace/add-vertical/workspace-state.js +14 -24
  43. package/dist/esm/ultramodern-workspace/add-vertical.js +1 -1
  44. package/dist/esm/ultramodern-workspace/demo-components.js +62 -115
  45. package/dist/esm/ultramodern-workspace/module-federation/config.js +1 -1
  46. package/dist/esm/ultramodern-workspace/module-federation/remote-refs.js +1 -43
  47. package/dist/esm/ultramodern-workspace/patch-inventory.js +93 -0
  48. package/dist/esm/ultramodern-workspace/policy.js +4 -40
  49. package/dist/esm/ultramodern-workspace/shared-patches.js +2 -2
  50. package/dist/esm/ultramodern-workspace/validation/architecture.js +348 -0
  51. package/dist/esm/ultramodern-workspace/validation/assertions.js +65 -0
  52. package/dist/esm/ultramodern-workspace/validation/types.js +0 -0
  53. package/dist/esm/ultramodern-workspace/validation/workspace.js +1268 -0
  54. package/dist/esm/ultramodern-workspace/workspace-artifact-ownership.js +69 -30
  55. package/dist/esm/ultramodern-workspace/workspace-scripts.js +31 -59
  56. package/dist/esm/ultramodern-workspace/write-workspace.js +1 -1
  57. package/dist/esm-node/ultramodern-tooling/commands/cloudflare-output-verify.js +29 -53
  58. package/dist/esm-node/ultramodern-tooling/commands/context.js +1 -23
  59. package/dist/esm-node/ultramodern-tooling/commands/routes-generate-app.js +29 -0
  60. package/dist/esm-node/ultramodern-tooling/commands/routes-generate.js +13 -49
  61. package/dist/esm-node/ultramodern-tooling/commands/validate.js +6 -4
  62. package/dist/esm-node/ultramodern-tooling/commands.js +2 -2
  63. package/dist/esm-node/ultramodern-tooling/config/normalize.js +12 -2
  64. package/dist/esm-node/ultramodern-workspace/add-shell.js +63 -139
  65. package/dist/esm-node/ultramodern-workspace/add-vertical/execute.js +22 -59
  66. package/dist/esm-node/ultramodern-workspace/add-vertical/plan.js +15 -149
  67. package/dist/esm-node/ultramodern-workspace/add-vertical/preflight.js +3 -5
  68. package/dist/esm-node/ultramodern-workspace/add-vertical/preview.js +41 -0
  69. package/dist/esm-node/ultramodern-workspace/add-vertical/transaction.js +2 -2
  70. package/dist/esm-node/ultramodern-workspace/add-vertical/workspace-state.js +14 -24
  71. package/dist/esm-node/ultramodern-workspace/add-vertical.js +1 -1
  72. package/dist/esm-node/ultramodern-workspace/demo-components.js +62 -115
  73. package/dist/esm-node/ultramodern-workspace/module-federation/config.js +1 -1
  74. package/dist/esm-node/ultramodern-workspace/module-federation/remote-refs.js +1 -43
  75. package/dist/esm-node/ultramodern-workspace/patch-inventory.js +94 -0
  76. package/dist/esm-node/ultramodern-workspace/policy.js +4 -40
  77. package/dist/esm-node/ultramodern-workspace/shared-patches.js +2 -2
  78. package/dist/esm-node/ultramodern-workspace/validation/architecture.js +349 -0
  79. package/dist/esm-node/ultramodern-workspace/validation/assertions.js +66 -0
  80. package/dist/esm-node/ultramodern-workspace/validation/types.js +1 -0
  81. package/dist/esm-node/ultramodern-workspace/validation/workspace.js +1269 -0
  82. package/dist/esm-node/ultramodern-workspace/workspace-artifact-ownership.js +69 -30
  83. package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +31 -59
  84. package/dist/esm-node/ultramodern-workspace/write-workspace.js +1 -1
  85. package/dist/types/ultramodern-tooling/commands/cloudflare-output-verify.d.ts +2 -2
  86. package/dist/types/ultramodern-tooling/commands/context.d.ts +0 -1
  87. package/dist/types/ultramodern-tooling/commands/routes-generate-app.d.ts +1 -0
  88. package/dist/types/ultramodern-tooling/commands/routes-generate.d.ts +1 -1
  89. package/dist/types/ultramodern-tooling/commands/validate.d.ts +1 -1
  90. package/dist/types/ultramodern-tooling/config/normalize.d.ts +3 -1
  91. package/dist/types/ultramodern-workspace/add-shell.d.ts +1 -1
  92. package/dist/types/ultramodern-workspace/add-vertical/execute.d.ts +1 -0
  93. package/dist/types/ultramodern-workspace/add-vertical/preflight.d.ts +1 -0
  94. package/dist/types/ultramodern-workspace/add-vertical/preview.d.ts +4 -0
  95. package/dist/types/ultramodern-workspace/add-vertical/transaction.d.ts +4 -1
  96. package/dist/types/ultramodern-workspace/add-vertical/workspace-state.d.ts +8 -5
  97. package/dist/types/ultramodern-workspace/add-vertical.d.ts +1 -1
  98. package/dist/types/ultramodern-workspace/patch-inventory.d.ts +18 -0
  99. package/dist/types/ultramodern-workspace/validation/architecture.d.ts +2 -0
  100. package/dist/types/ultramodern-workspace/validation/assertions.d.ts +14 -0
  101. package/dist/types/ultramodern-workspace/validation/types.d.ts +20 -0
  102. package/dist/types/ultramodern-workspace/validation/workspace.d.ts +3 -0
  103. package/dist/types/ultramodern-workspace/workspace-artifact-ownership.d.ts +5 -0
  104. package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -7
  105. package/package.json +9 -9
  106. package/template-workspace/.modernjs/release-cohort.json +48 -48
  107. package/template-workspace/patches/@module-federation__dts-plugin@2.9.0.patch +40 -8
  108. package/template-workspace/patches/@module-federation__modern-js-v3@2.9.0.patch +39 -20
  109. package/templates/workspace/apps/modern.config.ts.handlebars +1 -1
  110. package/templates/workspace/apps/shell-super-app/src/routes/[lang]/page.tsx.handlebars +20 -20
  111. package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.helpers.tsx.handlebars +1 -1
  112. package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.tsx.handlebars +11 -11
  113. package/templates/workspace/apps/shell-super-app/src/routes/vertical-components.worker.helpers.tsx.handlebars +1 -1
  114. package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +0 -4046
@@ -39,10 +39,10 @@ __webpack_require__.r(__webpack_exports__);
39
39
  __webpack_require__.d(__webpack_exports__, {
40
40
  runCloudflareOutputVerify: ()=>runCloudflareOutputVerify
41
41
  });
42
+ const external_node_module_namespaceObject = require("node:module");
42
43
  const external_node_path_namespaceObject = require("node:path");
43
44
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
44
45
  const external_config_cjs_namespaceObject = require("../config.cjs");
45
- const external_context_cjs_namespaceObject = require("./context.cjs");
46
46
  const external_options_cjs_namespaceObject = require("./options.cjs");
47
47
  const resolveCloudflareOutputVerifyTargets = (args, context)=>{
48
48
  const outputDirectory = (0, external_options_cjs_namespaceObject.readOption)(args, '--output');
@@ -60,51 +60,7 @@ const resolveCloudflareOutputVerifyTargets = (args, context)=>{
60
60
  if (0 === targets.length) throw new Error(`No generated UltraModern app matched ${appId}.`);
61
61
  return targets;
62
62
  };
63
- const renderCloudflareOutputVerifyModule = ({ workspaceRoot, targets, excludePaths })=>`
64
- import { createRequire } from 'node:module';
65
- import path from 'node:path';
66
-
67
- const workspaceRoot = ${JSON.stringify(workspaceRoot)};
68
- const targets = ${JSON.stringify(targets, null, 2)};
69
- const scanRoots = [workspaceRoot];
70
- const excludePaths = ${JSON.stringify(excludePaths)};
71
- const verifierRequire = createRequire(path.join(workspaceRoot, 'package.json'));
72
- const {
73
- verifyCloudflareOutput,
74
- verifyCloudflareOutputMutationPolicy,
75
- } = verifierRequire('@modern-js/app-tools-extensions/cloudflare-output-verifier');
76
-
77
- let failed = false;
78
- for (const target of targets) {
79
- const result = await verifyCloudflareOutput({
80
- outputDirectory: target.outputDirectory,
81
- importWorker: true,
82
- });
83
- if (result.ok) {
84
- console.log(\`[ultramodern] Cloudflare output verified: \${target.label}\`);
85
- } else {
86
- failed = true;
87
- console.error(\`[ultramodern] Cloudflare output failed: \${target.label}\`);
88
- for (const issue of result.issues) {
89
- console.error(\`- \${issue.code}: \${issue.message}\${issue.path ? \` (\${issue.path})\` : ''}\`);
90
- }
91
- }
92
- }
93
-
94
- if (scanRoots.length > 0) {
95
- const policyResult = await verifyCloudflareOutputMutationPolicy({ scanRoots, excludePaths });
96
- if (!policyResult.ok) {
97
- failed = true;
98
- console.error('[ultramodern] generated-output mutation policy failed');
99
- for (const issue of policyResult.issues) {
100
- console.error(\`- \${issue.code}: \${issue.message}\${issue.path ? \` (\${issue.path})\` : ''}\`);
101
- }
102
- }
103
- }
104
-
105
- process.exit(failed ? 1 : 0);
106
- `;
107
- function runCloudflareOutputVerify(args, context) {
63
+ async function runCloudflareOutputVerify(args, context) {
108
64
  if (args.includes('--help') || args.includes('-h')) {
109
65
  process.stdout.write(`Usage:
110
66
  ultramodern-create ultramodern cloudflare-output-verify [--app <id> | --output <dir>]
@@ -114,14 +70,34 @@ Without --app or --output, every generated workspace app is verified.
114
70
  `);
115
71
  return 0;
116
72
  }
117
- const source = renderCloudflareOutputVerifyModule({
118
- workspaceRoot: context.workspaceRoot,
119
- targets: resolveCloudflareOutputVerifyTargets(args, context),
120
- excludePaths: [
121
- external_node_path_default().join(context.workspaceRoot, "scripts", 'validate-ultramodern-workspace.mts')
122
- ]
73
+ const targets = resolveCloudflareOutputVerifyTargets(args, context);
74
+ const verifierRequire = (0, external_node_module_namespaceObject.createRequire)(external_node_path_default().join(context.workspaceRoot, 'package.json'));
75
+ const { verifyCloudflareOutput, verifyCloudflareOutputMutationPolicy } = verifierRequire('@modern-js/app-tools-extensions/cloudflare-output-verifier');
76
+ let failed = false;
77
+ for (const target of targets){
78
+ const result = await verifyCloudflareOutput({
79
+ outputDirectory: target.outputDirectory,
80
+ importWorker: true
81
+ });
82
+ if (result.ok) console.log(`[ultramodern] Cloudflare output verified: ${target.label}`);
83
+ else {
84
+ failed = true;
85
+ console.error(`[ultramodern] Cloudflare output failed: ${target.label}`);
86
+ for (const issue of result.issues)console.error(`- ${issue.code}: ${issue.message}${issue.path ? ` (${issue.path})` : ''}`);
87
+ }
88
+ }
89
+ const policyResult = await verifyCloudflareOutputMutationPolicy({
90
+ scanRoots: [
91
+ context.workspaceRoot
92
+ ],
93
+ excludePaths: []
123
94
  });
124
- return (0, external_context_cjs_namespaceObject.runRenderedModule)(source, context);
95
+ if (!policyResult.ok) {
96
+ failed = true;
97
+ console.error('[ultramodern] generated-output mutation policy failed');
98
+ for (const issue of policyResult.issues)console.error(`- ${issue.code}: ${issue.message}${issue.path ? ` (${issue.path})` : ''}`);
99
+ }
100
+ return failed ? 1 : 0;
125
101
  }
126
102
  exports.runCloudflareOutputVerify = __webpack_exports__.runCloudflareOutputVerify;
127
103
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -43,15 +43,10 @@ __webpack_require__.d(__webpack_exports__, {
43
43
  AD_HOC_TOOLING_COMMANDS: ()=>AD_HOC_TOOLING_COMMANDS,
44
44
  createPackageRoot: ()=>createPackageRoot,
45
45
  printHelp: ()=>printHelp,
46
- runRenderedModule: ()=>runRenderedModule,
47
46
  runTemplateBackedToolingCommand: ()=>runTemplateBackedToolingCommand,
48
47
  spawnNodeScript: ()=>spawnNodeScript
49
48
  });
50
49
  const external_node_child_process_namespaceObject = require("node:child_process");
51
- const external_node_fs_namespaceObject = require("node:fs");
52
- var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
53
- const external_node_os_namespaceObject = require("node:os");
54
- var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
55
50
  const external_node_path_namespaceObject = require("node:path");
56
51
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
57
52
  const external_node_url_namespaceObject = require("node:url");
@@ -100,37 +95,15 @@ function runTemplateBackedToolingCommand(command, args, context) {
100
95
  cwd: 'invocation' === toolingCommand.cwd ? context.invocationCwd : context.workspaceRoot
101
96
  });
102
97
  }
103
- function runRenderedModule(source, context) {
104
- const tempDir = external_node_fs_default().mkdtempSync(external_node_path_default().join(external_node_os_default().tmpdir(), 'ultramodern-tool-'));
105
- const tempFile = external_node_path_default().join(tempDir, 'command.mjs');
106
- try {
107
- external_node_fs_default().writeFileSync(tempFile, source, 'utf-8');
108
- const result = (0, external_node_child_process_namespaceObject.spawnSync)(process.execPath, [
109
- tempFile
110
- ], {
111
- cwd: context.workspaceRoot,
112
- stdio: 'inherit'
113
- });
114
- if (result.error) throw result.error;
115
- return result.status ?? 1;
116
- } finally{
117
- external_node_fs_default().rmSync(tempDir, {
118
- force: true,
119
- recursive: true
120
- });
121
- }
122
- }
123
98
  exports.AD_HOC_TOOLING_COMMANDS = __webpack_exports__.AD_HOC_TOOLING_COMMANDS;
124
99
  exports.createPackageRoot = __webpack_exports__.createPackageRoot;
125
100
  exports.printHelp = __webpack_exports__.printHelp;
126
- exports.runRenderedModule = __webpack_exports__.runRenderedModule;
127
101
  exports.runTemplateBackedToolingCommand = __webpack_exports__.runTemplateBackedToolingCommand;
128
102
  exports.spawnNodeScript = __webpack_exports__.spawnNodeScript;
129
103
  for(var __rspack_i in __webpack_exports__)if (-1 === [
130
104
  "AD_HOC_TOOLING_COMMANDS",
131
105
  "createPackageRoot",
132
106
  "printHelp",
133
- "runRenderedModule",
134
107
  "runTemplateBackedToolingCommand",
135
108
  "spawnNodeScript"
136
109
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
@@ -0,0 +1,60 @@
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
+ var __webpack_exports__ = {};
28
+ const external_node_module_namespaceObject = require("node:module");
29
+ const external_node_path_namespaceObject = require("node:path");
30
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
31
+ const external_node_url_namespaceObject = require("node:url");
32
+ async function main() {
33
+ const [appDirectory, label] = process.argv.slice(2);
34
+ try {
35
+ if (!appDirectory || !label) throw new Error('Route generation requires an app directory and label.');
36
+ const appRequire = (0, external_node_module_namespaceObject.createRequire)(external_node_path_default().join(appDirectory, 'package.json'));
37
+ const pluginUrl = (0, external_node_url_namespaceObject.pathToFileURL)(appRequire.resolve('@modern-js/plugin-tanstack')).href;
38
+ const { generateTanstackRouteArtifacts } = await import(pluginUrl);
39
+ await generateTanstackRouteArtifacts({
40
+ appDirectory
41
+ });
42
+ console.log(`[ultramodern] TanStack route artifacts generated: ${label}`);
43
+ } catch (error) {
44
+ process.exitCode = 1;
45
+ console.error(`[ultramodern] TanStack route generation failed: ${label}`);
46
+ let current = error;
47
+ let depth = 0;
48
+ while(current){
49
+ const detail = current instanceof Error ? current.stack ?? `${current.name}: ${current.message}` : String(current);
50
+ console.error(`${0 === depth ? '-' : ' caused by:'} ${detail}`);
51
+ current = current instanceof Error ? current.cause : void 0;
52
+ depth += 1;
53
+ }
54
+ }
55
+ }
56
+ main();
57
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
58
+ Object.defineProperty(exports, '__esModule', {
59
+ value: true
60
+ });
@@ -53,49 +53,6 @@ const resolveRoutesGenerateTargets = (args, context)=>{
53
53
  if (0 === targets.length) throw new Error(`No generated UltraModern app matched ${appId ?? '<any>'}.`);
54
54
  return targets;
55
55
  };
56
- const renderRoutesGenerateModule = ({ workspaceRoot, targets })=>`
57
- import { createRequire } from 'node:module';
58
- import path from 'node:path';
59
- import { pathToFileURL } from 'node:url';
60
-
61
- const workspaceRoot = ${JSON.stringify(workspaceRoot)};
62
- const targets = ${JSON.stringify(targets, null, 2)};
63
- const appRequire = createRequire(path.join(workspaceRoot, 'package.json'));
64
- const pluginUrl = pathToFileURL(
65
- appRequire.resolve('@modern-js/plugin-tanstack'),
66
- ).href;
67
- const { generateTanstackRouteArtifacts } = await import(pluginUrl);
68
-
69
- let failed = false;
70
- // Sequential — the app-tools cli singleton is not re-entrant.
71
- for (const target of targets) {
72
- try {
73
- await generateTanstackRouteArtifacts({ appDirectory: target.appDirectory });
74
- console.log(\`[ultramodern] TanStack route artifacts generated: \${target.label}\`);
75
- } catch (error) {
76
- failed = true;
77
- console.error(\`[ultramodern] TanStack route generation failed: \${target.label}\`);
78
- // Print the full underlying failure, including the cause chain. The
79
- // route-generate crash is often an opaque node error thrown deep inside
80
- // app-tools/plugin (e.g. a path TypeError), so surfacing only
81
- // \`error.message\` swallows the stack that points at the real culprit.
82
- let current = error;
83
- let depth = 0;
84
- while (current) {
85
- const label = depth === 0 ? '-' : ' caused by:';
86
- const detail =
87
- current instanceof Error
88
- ? current.stack ?? \`\${current.name}: \${current.message}\`
89
- : String(current);
90
- console.error(\`\${label} \${detail}\`);
91
- current = current instanceof Error ? current.cause : undefined;
92
- depth += 1;
93
- }
94
- }
95
- }
96
-
97
- process.exit(failed ? 1 : 0);
98
- `;
99
56
  function runRoutesGenerate(args, context) {
100
57
  if (args.includes('--help') || args.includes('-h')) {
101
58
  process.stdout.write(`Usage:
@@ -107,11 +64,18 @@ generated workspace app is regenerated.
107
64
  `);
108
65
  return 0;
109
66
  }
110
- const source = renderRoutesGenerateModule({
111
- workspaceRoot: context.workspaceRoot,
112
- targets: resolveRoutesGenerateTargets(args, context)
113
- });
114
- return (0, external_context_cjs_namespaceObject.runRenderedModule)(source, context);
67
+ const targets = resolveRoutesGenerateTargets(args, context);
68
+ let failed = false;
69
+ for (const target of targets){
70
+ const status = (0, external_context_cjs_namespaceObject.spawnNodeScript)('dist/esm-node/ultramodern-tooling/commands/routes-generate-app.js', [
71
+ target.appDirectory,
72
+ target.label
73
+ ], context, {
74
+ cwd: target.appDirectory
75
+ });
76
+ failed ||= 0 !== status;
77
+ }
78
+ return failed ? 1 : 0;
115
79
  }
116
80
  exports.runRoutesGenerate = __webpack_exports__.runRoutesGenerate;
117
81
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -46,7 +46,8 @@ const cohort_parity_cjs_namespaceObject = require("../../ultramodern-workspace/c
46
46
  const contracts_cjs_namespaceObject = require("../../ultramodern-workspace/contracts.cjs");
47
47
  const descriptors_cjs_namespaceObject = require("../../ultramodern-workspace/descriptors.cjs");
48
48
  const patch_parity_cjs_namespaceObject = require("../../ultramodern-workspace/patch-parity.cjs");
49
- const workspace_scripts_cjs_namespaceObject = require("../../ultramodern-workspace/workspace-scripts.cjs");
49
+ const workspace_cjs_namespaceObject = require("../../ultramodern-workspace/validation/workspace.cjs");
50
+ const workspace_validation_contract_cjs_namespaceObject = require("../../ultramodern-workspace/workspace-validation-contract.cjs");
50
51
  const external_config_cjs_namespaceObject = require("../config.cjs");
51
52
  const external_context_cjs_namespaceObject = require("./context.cjs");
52
53
  function runValidate(context) {
@@ -88,8 +89,9 @@ function runValidate(context) {
88
89
  return 1;
89
90
  }
90
91
  const releaseCohort = config.packageSource?.strategy === 'install' ? (0, external_ultramodern_release_cohort_cjs_namespaceObject.readWorkspaceReleaseCohort)(context.workspaceRoot) : void 0;
91
- const source = (0, workspace_scripts_cjs_namespaceObject.createPackagedWorkspaceValidationScript)(config.workspace.packageScope, config.features.tailwind, remotes, releaseCohort, additionalShells, primaryShell, compactConfig, (0, external_config_cjs_namespaceObject.readJsonObject)(external_node_path_default().join(context.workspaceRoot, 'topology/ownership.json')), void 0, context.workspaceRoot);
92
- return (0, external_context_cjs_namespaceObject.runRenderedModule)(source, context);
92
+ const contract = (0, workspace_validation_contract_cjs_namespaceObject.createWorkspaceValidationContract)(config.workspace.packageScope, config.features.tailwind, remotes, releaseCohort, additionalShells, primaryShell, compactConfig, (0, external_config_cjs_namespaceObject.readJsonObject)(external_node_path_default().join(context.workspaceRoot, 'topology/ownership.json')), void 0, context.workspaceRoot);
93
+ (0, workspace_cjs_namespaceObject.validateWorkspace)(context.workspaceRoot, contract);
94
+ return 0;
93
95
  }
94
96
  exports.runValidate = __webpack_exports__.runValidate;
95
97
  for(var __rspack_i in __webpack_exports__)if (-1 === [
@@ -67,9 +67,9 @@ async function runUltramodernToolingCli(args, workspaceRoot = process.env.ULTRAM
67
67
  case tooling_command_catalog_cjs_namespaceObject.GENERATED_TOOLING_COMMANDS.mfTypes.command:
68
68
  return (0, mf_types_cjs_namespaceObject.runMfTypes)(rest, context);
69
69
  case tooling_command_catalog_cjs_namespaceObject.GENERATED_TOOLING_COMMANDS.cloudflareOutputVerify.command:
70
- return (0, cloudflare_output_verify_cjs_namespaceObject.runCloudflareOutputVerify)(rest, context);
70
+ return await (0, cloudflare_output_verify_cjs_namespaceObject.runCloudflareOutputVerify)(rest, context);
71
71
  case tooling_command_catalog_cjs_namespaceObject.GENERATED_TOOLING_COMMANDS.routesGenerate.command:
72
- return (0, routes_generate_cjs_namespaceObject.runRoutesGenerate)(rest, context);
72
+ return await (0, routes_generate_cjs_namespaceObject.runRoutesGenerate)(rest, context);
73
73
  case context_cjs_namespaceObject.AD_HOC_TOOLING_COMMANDS.syncDeliveryUnit:
74
74
  return (0, sync_delivery_unit_cjs_namespaceObject.runSyncDeliveryUnit)(rest, context);
75
75
  case context_cjs_namespaceObject.AD_HOC_TOOLING_COMMANDS.skills:
@@ -232,7 +232,7 @@ function allWorkspaceAppsFromToolingConfig(config, workspaceRoot) {
232
232
  ...additionalShellsFromToolingConfig(config)
233
233
  ];
234
234
  }
235
- function normalizeWorkspaceInputs(workspaceRoot, inputs, sourcePath = external_node_path_default().join(workspaceRoot, descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH)) {
235
+ function normalizeWorkspaceInputs(workspaceRoot, inputs, sourcePath = external_node_path_default().join(workspaceRoot, descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH), options = {}) {
236
236
  const config = normalizeCompactConfig(workspaceRoot, sourcePath, inputs.config);
237
237
  const ports = inputs.overlay?.ports ?? {};
238
238
  const additionalShells = additionalShellsFromToolingConfig(config);
@@ -240,6 +240,16 @@ function normalizeWorkspaceInputs(workspaceRoot, inputs, sourcePath = external_n
240
240
  (0, topology_cjs_namespaceObject.createPrimaryShellDescriptor)(inputs.topology, inputs.config),
241
241
  ...(0, topology_cjs_namespaceObject.verticalsFromTopology)(inputs.topology, ports)
242
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
+ }
243
253
  const apps = [
244
254
  ...topologyApps.map((app)=>({
245
255
  ...app,
@@ -42,15 +42,13 @@ __webpack_require__.d(__webpack_exports__, {
42
42
  });
43
43
  const external_node_fs_namespaceObject = require("node:fs");
44
44
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
45
- const external_node_os_namespaceObject = require("node:os");
46
- var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
47
45
  const external_node_path_namespaceObject = require("node:path");
48
46
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
49
47
  const config_cjs_namespaceObject = require("../ultramodern-tooling/config.cjs");
50
48
  const constants_cjs_namespaceObject = require("./add-vertical/constants.cjs");
51
49
  const preflight_cjs_namespaceObject = require("./add-vertical/preflight.cjs");
50
+ const preview_cjs_namespaceObject = require("./add-vertical/preview.cjs");
52
51
  const shell_files_cjs_namespaceObject = require("./add-vertical/shell-files.cjs");
53
- const topology_cjs_namespaceObject = require("./add-vertical/topology.cjs");
54
52
  const transaction_cjs_namespaceObject = require("./add-vertical/transaction.cjs");
55
53
  const workspace_state_cjs_namespaceObject = require("./add-vertical/workspace-state.cjs");
56
54
  const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
@@ -60,40 +58,37 @@ const external_module_federation_cjs_namespaceObject = require("./module-federat
60
58
  const external_naming_cjs_namespaceObject = require("./naming.cjs");
61
59
  const external_shells_cjs_namespaceObject = require("./shells.cjs");
62
60
  const external_tsconfigs_cjs_namespaceObject = require("./tsconfigs.cjs");
63
- const external_types_cjs_namespaceObject = require("./types.cjs");
64
61
  const external_workspace_artifact_ownership_cjs_namespaceObject = require("./workspace-artifact-ownership.cjs");
65
62
  const external_workspace_scripts_cjs_namespaceObject = require("./workspace-scripts.cjs");
66
63
  const external_write_app_cjs_namespaceObject = require("./write-app.cjs");
67
64
  const external_zerops_cjs_namespaceObject = require("./zerops.cjs");
68
- function readRequiredJsonObject(filePath) {
69
- if (!external_node_fs_default().existsSync(filePath)) throw new Error(`Missing UltraModern workspace file: ${filePath}`);
70
- const value = (0, external_fs_io_cjs_namespaceObject.readJsonFile)(filePath);
71
- if (!(0, external_types_cjs_namespaceObject.isRecord)(value)) throw new Error(`UltraModern workspace file must contain a JSON object: ${filePath}`);
72
- return value;
73
- }
74
65
  function prepareAddUltramodernShell(options) {
75
66
  const name = (0, external_shells_cjs_namespaceObject.assertValidShellName)(options.name);
76
67
  const configPath = external_node_path_default().join(options.workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
77
68
  const overlayPath = external_node_path_default().join(options.workspaceRoot, constants_cjs_namespaceObject.DEVELOPMENT_OVERLAY_PATH);
78
69
  const topologyPath = external_node_path_default().join(options.workspaceRoot, constants_cjs_namespaceObject.TOPOLOGY_PATH);
79
- const rootPackage = readRequiredJsonObject(external_node_path_default().join(options.workspaceRoot, 'package.json'));
80
- const config = readRequiredJsonObject(configPath);
81
- const overlay = readRequiredJsonObject(overlayPath);
82
- const topology = readRequiredJsonObject(topologyPath);
70
+ 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
+ const overlay = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(overlayPath);
73
+ const topology = (0, preflight_cjs_namespaceObject.readRequiredJsonObject)(topologyPath);
83
74
  overlay.ports ??= {};
84
75
  const scope = (0, external_naming_cjs_namespaceObject.toPackageScope)(String(rootPackage.name ?? external_node_path_default().basename(options.workspaceRoot)));
85
- const packageSource = (0, workspace_state_cjs_namespaceObject.existingPackageSource)(options.workspaceRoot, options.modernVersion, options.packageSource);
86
- const enableTailwind = options.enableTailwind ?? (0, workspace_state_cjs_namespaceObject.existingTailwindEnabled)(options.workspaceRoot);
87
- const bridge = (0, workspace_state_cjs_namespaceObject.existingBridgeConfig)(options.workspaceRoot);
88
- const existingVerticals = (0, topology_cjs_namespaceObject.verticalsFromTopology)(topology, overlay.ports);
89
- const existingAdditionalShells = (0, external_shells_cjs_namespaceObject.resolveConfiguredAdditionalShells)(config);
76
+ const workspace = (0, config_cjs_namespaceObject.normalizeWorkspaceInputs)(options.workspaceRoot, {
77
+ config,
78
+ topology,
79
+ overlay
80
+ }, void 0, {
81
+ primaryComposition: 'compact'
82
+ });
83
+ const { packageSource, enableTailwind, bridge } = (0, workspace_state_cjs_namespaceObject.workspaceOperationSettings)(options, workspace.config);
84
+ const { primaryShell: resolvedPrimaryShell, verticals: existingVerticals, additionalShells: existingAdditionalShells } = workspace;
85
+ const primaryShell = resolvedPrimaryShell;
90
86
  const shellId = `shell-${name}`;
91
87
  if (shellId === external_shells_cjs_namespaceObject.PRIMARY_SHELL_ID || existingAdditionalShells.some((existing)=>existing.id === shellId)) throw new Error(`Shell "${shellId}" already exists in this workspace.`);
92
88
  if (external_node_fs_default().existsSync(external_node_path_default().join(options.workspaceRoot, `apps/${shellId}`))) throw new Error(`Refusing to overwrite existing path: apps/${shellId}`);
93
- const overlayPorts = overlay.ports ?? {};
94
89
  const portsWithPrimary = {
95
- ...overlayPorts,
96
- [external_descriptors_cjs_namespaceObject.shellApp.id]: 'number' == typeof overlayPorts[external_descriptors_cjs_namespaceObject.shellApp.id] ? overlayPorts[external_descriptors_cjs_namespaceObject.shellApp.id] : external_descriptors_cjs_namespaceObject.shellApp.port
90
+ ...overlay.ports,
91
+ [primaryShell.id]: primaryShell.port
97
92
  };
98
93
  (0, workspace_state_cjs_namespaceObject.assertGlobalPortUniqueness)(portsWithPrimary, existingAdditionalShells);
99
94
  const shell = (0, external_shells_cjs_namespaceObject.createShellDescriptor)(name, (0, workspace_state_cjs_namespaceObject.nextAvailablePort)(portsWithPrimary, existingAdditionalShells, external_shells_cjs_namespaceObject.FIRST_ADDITIONAL_SHELL_PORT));
@@ -126,10 +121,10 @@ function prepareAddUltramodernShell(options) {
126
121
  packageSource,
127
122
  enableTailwind,
128
123
  bridge,
124
+ primaryShell,
129
125
  existingVerticals,
130
126
  existingAdditionalShells,
131
- shell,
132
- composedVerticals
127
+ shell
133
128
  };
134
129
  }
135
130
  function addUltramodernShell(options) {
@@ -141,22 +136,16 @@ function addUltramodernShell(options) {
141
136
  function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.workspaceRoot) {
142
137
  const beforeFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
143
138
  const preflight = prepareAddUltramodernShell(options);
144
- const { scope, configPath, config, packageSource, enableTailwind, bridge, existingVerticals, existingAdditionalShells, shell, composedVerticals } = preflight;
145
- const configuredPrimary = (0, preflight_cjs_namespaceObject.createPrimaryShellDescriptor)({}, config);
146
- const primaryRefsConfigured = Array.isArray(config.topology?.apps?.find((app)=>app?.id === external_descriptors_cjs_namespaceObject.shellApp.id)?.moduleFederation?.verticalRefs);
147
- const primaryShell = {
148
- ...configuredPrimary,
149
- port: 'number' == typeof preflight.overlay.ports?.[configuredPrimary.id] ? preflight.overlay.ports[configuredPrimary.id] : configuredPrimary.port,
150
- verticalRefs: primaryRefsConfigured ? configuredPrimary.verticalRefs : existingVerticals.filter(external_descriptors_cjs_namespaceObject.appEmitsBrowserUi).map((v)=>v.id)
151
- };
139
+ const { scope, configPath, config, packageSource, enableTailwind, bridge, primaryShell, existingVerticals, existingAdditionalShells, shell } = preflight;
152
140
  const allAdditionalShells = [
153
141
  ...existingAdditionalShells,
154
142
  shell
155
143
  ];
156
- const configuredDevPorts = (0, workspace_state_cjs_namespaceObject.configuredDevelopmentPorts)({
157
- ...preflight.overlay.ports,
158
- [shell.id]: shell.port
159
- }, allAdditionalShells).toSorted((left, right)=>left - right);
144
+ const configuredDevPorts = (0, external_workspace_artifact_ownership_cjs_namespaceObject.workspaceDevelopmentPorts)([
145
+ primaryShell,
146
+ ...existingVerticals,
147
+ ...allAdditionalShells
148
+ ], preflight.overlay.ports);
160
149
  const previousApps = [
161
150
  primaryShell,
162
151
  ...existingVerticals,
@@ -165,39 +154,7 @@ function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.work
165
154
  const compactWorkspace = (0, config_cjs_namespaceObject.normalizeWorkspaceInputs)(options.workspaceRoot, {
166
155
  config
167
156
  });
168
- const previousDevPorts = existingAdditionalShells.length > 0 ? previousApps.map((app)=>app.port).toSorted((left, right)=>left - right) : void 0;
169
- const { io: ownedIo } = (0, external_workspace_artifact_ownership_cjs_namespaceObject.preserveConsumerWorkspaceArtifacts)(options.workspaceRoot, [
170
- ...(0, external_workspace_scripts_cjs_namespaceObject.createWorkspaceScriptArtifacts)({
171
- shellOnly: 0 === existingVerticals.length,
172
- hasBackendSurface: existingVerticals.some((app)=>Boolean(app.api)),
173
- validationScript: (0, external_workspace_scripts_cjs_namespaceObject.createWorkspaceValidationScript)(scope, enableTailwind, existingVerticals)
174
- }),
175
- {
176
- relativePath: "scripts/validate-ultramodern-workspace.mts",
177
- generatedDataBinding: 'workspaceValidationContract',
178
- content: (0, external_workspace_scripts_cjs_namespaceObject.createPackagedWorkspaceValidationScript)(scope, enableTailwind, existingVerticals, void 0, existingAdditionalShells, primaryShell, void 0, void 0, void 0, logicalWorkspaceRoot)
179
- },
180
- {
181
- relativePath: 'zerops.yaml',
182
- content: `${(0, external_zerops_cjs_namespaceObject.createZeropsYaml)(scope, previousApps)}\n`
183
- },
184
- {
185
- relativePath: 'zerops.yaml',
186
- content: `${(0, external_zerops_cjs_namespaceObject.createZeropsYaml)(scope, compactWorkspace.apps)}\n`
187
- },
188
- {
189
- relativePath: 'tsconfig.json',
190
- content: `${JSON.stringify((0, external_tsconfigs_cjs_namespaceObject.createRootTsConfig)(previousApps), null, 2)}\n`
191
- },
192
- ...previousApps.map((app)=>({
193
- relativePath: `${app.directory}/modern.config.ts`,
194
- content: (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, app, 'shell' === app.kind ? (0, external_descriptors_cjs_namespaceObject.resolveRemoteRefs)(app, existingVerticals) : existingVerticals, enableTailwind, previousDevPorts)
195
- })),
196
- ...compactWorkspace.apps.map((app)=>({
197
- relativePath: `${app.directory}/modern.config.ts`,
198
- content: (0, external_module_federation_cjs_namespaceObject.createAppModernConfig)(scope, app, 'shell' === app.kind ? (0, external_descriptors_cjs_namespaceObject.resolveRemoteRefs)(app, compactWorkspace.verticals) : compactWorkspace.verticals, enableTailwind, existingAdditionalShells.length > 0 ? compactWorkspace.apps.map((app)=>app.port).toSorted((left, right)=>left - right) : void 0)
199
- }))
200
- ]);
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));
201
158
  (0, external_write_app_cjs_namespaceObject.writeApp)(options.workspaceRoot, scope, shell, packageSource, enableTailwind, existingVerticals, bridge, configuredDevPorts);
202
159
  const shellsCollection = Array.isArray(config.shells) ? config.shells.filter((entry)=>entry?.id !== shell.id) : [];
203
160
  shellsCollection.push((0, external_shells_cjs_namespaceObject.createAdditionalShellConfigEntry)(scope, shell, existingVerticals));
@@ -210,13 +167,10 @@ function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.work
210
167
  ...existingVerticals,
211
168
  ...allAdditionalShells
212
169
  ]), null, 2)}\n`);
213
- (0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.workspaceRoot, scope, enableTailwind, existingVerticals, void 0, allAdditionalShells, primaryShell, {
170
+ (0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.workspaceRoot, existingVerticals, {
214
171
  io: {
215
- ...ownedIo,
216
172
  writeGenerated: ownedIo.write
217
- },
218
- compactConfig: config,
219
- developmentOverlay: preflight.overlay
173
+ }
220
174
  });
221
175
  ownedIo.write(external_node_path_default().join(options.workspaceRoot, 'zerops.yaml'), `${(0, external_zerops_cjs_namespaceObject.createZeropsYaml)(scope, [
222
176
  primaryShell,
@@ -244,71 +198,40 @@ function executeAddUltramodernShell(options, logicalWorkspaceRoot = options.work
244
198
  });
245
199
  }
246
200
  function planUltramodernShell(options) {
247
- prepareAddUltramodernShell(options);
248
- const tempRoot = external_node_fs_default().mkdtempSync(external_node_path_default().join(external_node_os_default().tmpdir(), 'um-shell-plan-'));
249
- const copiedWorkspaceRoot = external_node_path_default().join(tempRoot, 'workspace');
250
- const skippedDirectories = new Set([
251
- '.git',
252
- '.nx',
253
- '.output',
254
- 'coverage',
255
- 'dist',
256
- 'node_modules'
257
- ]);
258
- try {
259
- external_node_fs_default().cpSync(options.workspaceRoot, copiedWorkspaceRoot, {
260
- recursive: true,
261
- filter: (sourcePath)=>!skippedDirectories.has(external_node_path_default().basename(sourcePath))
262
- });
263
- const plannedResult = addUltramodernShell({
201
+ const preflight = prepareAddUltramodernShell(options);
202
+ let jsonMutations = [];
203
+ const plannedResult = (0, transaction_cjs_namespaceObject.runWorkspaceTransaction)(options.workspaceRoot, (stagingRoot)=>executeAddUltramodernShell({
264
204
  ...options,
265
- workspaceRoot: copiedWorkspaceRoot
266
- });
267
- const shell = plannedResult.createdApps[0];
268
- return {
269
- ...plannedResult,
270
- workspaceRoot: options.workspaceRoot,
271
- dryRun: true,
272
- selectedPort: shell?.port ?? 0,
273
- moduleFederationRemote: {
274
- id: shell?.id ?? '',
275
- name: shell?.moduleFederationName ?? '',
276
- manifestUrl: `http://localhost:${shell?.port ?? 0}/mf-manifest.json`
277
- },
278
- jsonMutations: [
279
- {
280
- path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
281
- pointer: '/shells/-',
282
- description: `Register additional shell ${shell?.id}`
283
- },
284
- {
285
- path: 'package.json',
286
- pointer: "/scripts",
287
- description: "Enumerate all configured shells in workspace scripts"
288
- },
289
- {
290
- path: 'tsconfig.json',
291
- pointer: '/references',
292
- description: `Add ${shell?.id} to the root TS-Go build graph`
293
- }
294
- ],
295
- shellDependencyChanges: [],
296
- generatedContractChanges: [
297
- {
298
- path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
299
- addedAppIds: [
300
- shell?.id ?? ''
301
- ],
302
- shellVerticalRefs: options.verticals ?? []
303
- }
304
- ]
305
- };
306
- } finally{
307
- external_node_fs_default().rmSync(tempRoot, {
308
- recursive: true,
309
- force: true
310
- });
311
- }
205
+ workspaceRoot: stagingRoot
206
+ }, options.workspaceRoot), {
207
+ mode: 'preview',
208
+ inspectChanges: (changes)=>{
209
+ jsonMutations = (0, preview_cjs_namespaceObject.describeJsonChanges)(changes);
210
+ }
211
+ });
212
+ const shell = plannedResult.createdApps[0];
213
+ return {
214
+ ...plannedResult,
215
+ workspaceRoot: options.workspaceRoot,
216
+ dryRun: true,
217
+ selectedPort: shell?.port ?? 0,
218
+ moduleFederationRemote: {
219
+ id: shell?.id ?? '',
220
+ name: shell?.moduleFederationName ?? '',
221
+ manifestUrl: `http://localhost:${shell?.port ?? 0}/mf-manifest.json`
222
+ },
223
+ jsonMutations,
224
+ shellDependencyChanges: [],
225
+ generatedContractChanges: [
226
+ {
227
+ path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
228
+ addedAppIds: [
229
+ shell?.id ?? ''
230
+ ],
231
+ shellVerticalRefs: preflight.shell.verticalRefs ?? []
232
+ }
233
+ ]
234
+ };
312
235
  }
313
236
  exports.addUltramodernShell = __webpack_exports__.addUltramodernShell;
314
237
  exports.planUltramodernShell = __webpack_exports__.planUltramodernShell;