@bleedingdev/modern-js-create 3.4.0-ultramodern.8 → 3.5.0-ultramodern.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -23
- package/dist/cjs/index.cjs +37 -4
- package/dist/cjs/locale/en.cjs +12 -2
- package/dist/cjs/locale/zh.cjs +12 -2
- package/dist/cjs/ultramodern-tooling/commands.cjs +185 -0
- package/dist/cjs/ultramodern-tooling/config.cjs +172 -0
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +87 -75
- package/dist/cjs/ultramodern-workspace/{effect-api.cjs → api.cjs} +207 -208
- package/dist/cjs/ultramodern-workspace/bridge-config.cjs +327 -0
- package/dist/cjs/ultramodern-workspace/codesmith.cjs +1 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +127 -657
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +12 -12
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +25 -25
- package/dist/cjs/ultramodern-workspace/fs-io.cjs +117 -0
- package/dist/cjs/ultramodern-workspace/generation-result.cjs +5 -5
- package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/mf-validation.cjs +571 -0
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +33 -18
- package/dist/cjs/ultramodern-workspace/overlays.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/package-json.cjs +57 -41
- package/dist/cjs/ultramodern-workspace/policy.cjs +4 -4
- package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/public-surface.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/versions.cjs +5 -0
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +119 -50
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +62 -21
- package/dist/esm/index.js +37 -4
- package/dist/esm/locale/en.js +12 -2
- package/dist/esm/locale/zh.js +12 -2
- package/dist/esm/ultramodern-tooling/commands.js +132 -0
- package/dist/esm/ultramodern-tooling/config.js +120 -0
- package/dist/esm/ultramodern-workspace/add-vertical.js +88 -79
- package/dist/esm/ultramodern-workspace/{effect-api.js → api.js} +146 -147
- package/dist/esm/ultramodern-workspace/bridge-config.js +270 -0
- package/dist/esm/ultramodern-workspace/codesmith.js +1 -0
- package/dist/esm/ultramodern-workspace/contracts.js +129 -611
- package/dist/esm/ultramodern-workspace/demo-components.js +13 -13
- package/dist/esm/ultramodern-workspace/descriptors.js +11 -11
- package/dist/esm/ultramodern-workspace/fs-io.js +116 -2
- package/dist/esm/ultramodern-workspace/generation-result.js +6 -6
- package/dist/esm/ultramodern-workspace/index.js +1 -0
- package/dist/esm/ultramodern-workspace/mf-validation.js +516 -0
- package/dist/esm/ultramodern-workspace/module-federation.js +34 -19
- package/dist/esm/ultramodern-workspace/overlays.js +2 -2
- package/dist/esm/ultramodern-workspace/package-json.js +56 -40
- package/dist/esm/ultramodern-workspace/policy.js +5 -5
- package/dist/esm/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm/ultramodern-workspace/public-surface.js +2 -2
- package/dist/esm/ultramodern-workspace/versions.js +3 -1
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +107 -34
- package/dist/esm/ultramodern-workspace/write-workspace.js +64 -26
- package/dist/esm-node/index.js +37 -4
- package/dist/esm-node/locale/en.js +12 -2
- package/dist/esm-node/locale/zh.js +12 -2
- package/dist/esm-node/ultramodern-tooling/commands.js +133 -0
- package/dist/esm-node/ultramodern-tooling/config.js +121 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +88 -79
- package/dist/esm-node/ultramodern-workspace/{effect-api.js → api.js} +146 -147
- package/dist/esm-node/ultramodern-workspace/bridge-config.js +271 -0
- package/dist/esm-node/ultramodern-workspace/codesmith.js +1 -0
- package/dist/esm-node/ultramodern-workspace/contracts.js +129 -611
- package/dist/esm-node/ultramodern-workspace/demo-components.js +13 -13
- package/dist/esm-node/ultramodern-workspace/descriptors.js +11 -11
- package/dist/esm-node/ultramodern-workspace/fs-io.js +116 -2
- package/dist/esm-node/ultramodern-workspace/generation-result.js +6 -6
- package/dist/esm-node/ultramodern-workspace/index.js +1 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation.js +517 -0
- package/dist/esm-node/ultramodern-workspace/module-federation.js +34 -19
- package/dist/esm-node/ultramodern-workspace/overlays.js +2 -2
- package/dist/esm-node/ultramodern-workspace/package-json.js +56 -40
- package/dist/esm-node/ultramodern-workspace/policy.js +5 -5
- package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm-node/ultramodern-workspace/public-surface.js +2 -2
- package/dist/esm-node/ultramodern-workspace/versions.js +3 -1
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +107 -34
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +64 -26
- package/dist/types/locale/en.d.ts +10 -0
- package/dist/types/locale/index.d.ts +20 -0
- package/dist/types/locale/zh.d.ts +10 -0
- package/dist/types/ultramodern-tooling/commands.d.ts +1 -0
- package/dist/types/ultramodern-tooling/config.d.ts +43 -0
- package/dist/types/ultramodern-workspace/add-vertical.d.ts +5 -2
- package/dist/types/ultramodern-workspace/api.d.ts +73 -0
- package/dist/types/ultramodern-workspace/bridge-config.d.ts +64 -0
- package/dist/types/ultramodern-workspace/codesmith.d.ts +1 -0
- package/dist/types/ultramodern-workspace/contracts.d.ts +2 -17
- package/dist/types/ultramodern-workspace/descriptors.d.ts +10 -10
- package/dist/types/ultramodern-workspace/fs-io.d.ts +1 -0
- package/dist/types/ultramodern-workspace/index.d.ts +2 -0
- package/dist/types/ultramodern-workspace/mf-validation.d.ts +27 -0
- package/dist/types/ultramodern-workspace/package-json.d.ts +5 -4
- package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
- package/dist/types/ultramodern-workspace/types.d.ts +9 -7
- package/dist/types/ultramodern-workspace/versions.d.ts +2 -0
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +2 -7
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
- package/package.json +5 -3
- package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
- package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +2 -0
- package/template-workspace/.gitignore.handlebars +3 -0
- package/template-workspace/AGENTS.md.handlebars +11 -5
- package/template-workspace/README.md.handlebars +15 -12
- package/template-workspace/oxfmt.config.ts +1 -0
- package/template-workspace/oxlint.config.ts +1 -0
- package/template-workspace/patches/@tanstack__router-core@1.171.13.patch +51 -0
- package/template-workspace/pnpm-workspace.yaml.handlebars +4 -0
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +77 -67
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +51 -8
- package/templates/workspace-scripts/check-ultramodern-api-boundaries.mts +344 -0
- package/templates/workspace-scripts/{check-ultramodern-i18n-boundaries.mjs → check-ultramodern-i18n-boundaries.mts} +1 -1
- package/templates/workspace-scripts/generate-public-surface-assets.mjs +246 -9
- package/templates/workspace-scripts/proof-cloudflare-version.mjs +277 -9
- package/templates/workspace-scripts/ultramodern-cloudflare-proof.mjs +35 -10
- package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +165 -2
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +840 -84
- package/dist/types/ultramodern-workspace/effect-api.d.ts +0 -73
- /package/template-workspace/{.agents → .codex}/rstackjs-agent-skills-LICENSE +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsbuild-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/command-map.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/common-analysis-patterns.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/install-rsdoctor.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rslib-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rslib-modern-package/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-best-practices/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/SKILL.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/bottlenecks.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/references/tracing-guide.md +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rspack-tracing/scripts/analyze_trace.js +0 -0
- /package/template-workspace/{.agents → .codex}/skills/rstest-best-practices/SKILL.md +0 -0
|
@@ -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
|
+
api: app.api && 'object' == typeof app.api ? {
|
|
104
|
+
stem: 'string' == typeof app.api.stem ? app.api.stem : String(app.id),
|
|
105
|
+
prefix: 'string' == typeof app.api.prefix ? app.api.prefix : `/${String(app.id)}-api`,
|
|
106
|
+
consumedBy: Array.isArray(app.api.consumedBy) ? app.api.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.api ? {
|
|
158
|
+
api: app.api
|
|
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
|
+
});
|
|
@@ -42,6 +42,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
42
42
|
addUltramodernVertical: ()=>addUltramodernVertical,
|
|
43
43
|
assertCanCreate: ()=>assertCanCreate,
|
|
44
44
|
assertValidVerticalName: ()=>assertValidVerticalName,
|
|
45
|
+
existingBridgeConfig: ()=>existingBridgeConfig,
|
|
45
46
|
existingPackageSource: ()=>existingPackageSource,
|
|
46
47
|
existingTailwindEnabled: ()=>existingTailwindEnabled,
|
|
47
48
|
nextAvailablePort: ()=>nextAvailablePort,
|
|
@@ -60,11 +61,11 @@ var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node
|
|
|
60
61
|
const external_node_path_namespaceObject = require("node:path");
|
|
61
62
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
62
63
|
const external_ultramodern_package_source_cjs_namespaceObject = require("../ultramodern-package-source.cjs");
|
|
64
|
+
const config_cjs_namespaceObject = require("../ultramodern-tooling/config.cjs");
|
|
65
|
+
const external_api_cjs_namespaceObject = require("./api.cjs");
|
|
63
66
|
const external_app_files_cjs_namespaceObject = require("./app-files.cjs");
|
|
64
|
-
const external_contracts_cjs_namespaceObject = require("./contracts.cjs");
|
|
65
67
|
const external_demo_components_cjs_namespaceObject = require("./demo-components.cjs");
|
|
66
68
|
const external_descriptors_cjs_namespaceObject = require("./descriptors.cjs");
|
|
67
|
-
const external_effect_api_cjs_namespaceObject = require("./effect-api.cjs");
|
|
68
69
|
const external_fs_io_cjs_namespaceObject = require("./fs-io.cjs");
|
|
69
70
|
const external_generation_result_cjs_namespaceObject = require("./generation-result.cjs");
|
|
70
71
|
const external_locales_cjs_namespaceObject = require("./locales.cjs");
|
|
@@ -82,7 +83,6 @@ const FIRST_VERTICAL_PORT = 4101;
|
|
|
82
83
|
const TOPOLOGY_PATH = 'topology/reference-topology.json';
|
|
83
84
|
const OWNERSHIP_PATH = 'topology/ownership.json';
|
|
84
85
|
const DEVELOPMENT_OVERLAY_PATH = 'topology/local-overlays/development.json';
|
|
85
|
-
const PACKAGE_SOURCE_METADATA_PATH = '.modernjs/ultramodern-package-source.json';
|
|
86
86
|
function existingPackageSource(workspaceRoot, modernVersion, packageSource) {
|
|
87
87
|
if (packageSource) return (0, external_package_source_cjs_namespaceObject.resolvePackageSource)({
|
|
88
88
|
targetDir: workspaceRoot,
|
|
@@ -90,35 +90,21 @@ function existingPackageSource(workspaceRoot, modernVersion, packageSource) {
|
|
|
90
90
|
modernVersion,
|
|
91
91
|
packageSource
|
|
92
92
|
});
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
const metadata = (0, external_fs_io_cjs_namespaceObject.readJsonFile)(metadataPath);
|
|
100
|
-
const aliases = metadata.modernPackages?.aliases ?? {};
|
|
101
|
-
const firstAlias = Object.values(aliases).find((value)=>'string' == typeof value);
|
|
102
|
-
const firstPackage = Object.keys(aliases)[0];
|
|
103
|
-
const aliasScope = firstAlias?.match(/^@([^/]+)\//)?.[1];
|
|
104
|
-
const unscopedName = firstPackage?.split('/').at(-1) ?? '';
|
|
105
|
-
const aliasUnscopedName = firstAlias?.split('/').at(-1) ?? '';
|
|
106
|
-
const aliasPackageNamePrefix = aliasUnscopedName && unscopedName && aliasUnscopedName.endsWith(unscopedName) ? aliasUnscopedName.slice(0, -unscopedName.length) : void 0;
|
|
107
|
-
return {
|
|
108
|
-
strategy: 'install' === metadata.strategy ? 'install' : 'workspace',
|
|
109
|
-
modernPackageVersion: 'string' == typeof metadata.modernPackages?.specifier ? metadata.modernPackages.specifier : modernVersion,
|
|
110
|
-
registry: metadata.modernPackages?.registry,
|
|
111
|
-
aliasScope,
|
|
112
|
-
aliasPackageNamePrefix
|
|
113
|
-
};
|
|
93
|
+
const compactPath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
|
|
94
|
+
if (external_node_fs_default().existsSync(compactPath)) {
|
|
95
|
+
const compactConfig = (0, config_cjs_namespaceObject.readUltramodernConfig)(workspaceRoot);
|
|
96
|
+
if (compactConfig.packageSource) return compactConfig.packageSource;
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Missing UltraModern workspace file: ${compactPath}`);
|
|
114
99
|
}
|
|
115
100
|
function existingTailwindEnabled(workspaceRoot) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
101
|
+
const compactPath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
|
|
102
|
+
if (external_node_fs_default().existsSync(compactPath)) return (0, config_cjs_namespaceObject.readUltramodernConfig)(workspaceRoot).features.tailwind;
|
|
103
|
+
throw new Error(`Missing UltraModern workspace file: ${compactPath}`);
|
|
104
|
+
}
|
|
105
|
+
function existingBridgeConfig(workspaceRoot) {
|
|
106
|
+
const compactPath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
|
|
107
|
+
return external_node_fs_default().existsSync(compactPath) ? (0, config_cjs_namespaceObject.readUltramodernConfig)(workspaceRoot).bridge : void 0;
|
|
122
108
|
}
|
|
123
109
|
function assertValidVerticalName(name) {
|
|
124
110
|
const normalized = (0, external_naming_cjs_namespaceObject.toKebabCase)(name);
|
|
@@ -132,17 +118,17 @@ function nextAvailablePort(ports) {
|
|
|
132
118
|
function assertCanCreate(workspaceRoot, relativePath) {
|
|
133
119
|
if (external_node_fs_default().existsSync(external_node_path_default().join(workspaceRoot, relativePath))) throw new Error(`Refusing to overwrite existing path: ${relativePath}`);
|
|
134
120
|
}
|
|
135
|
-
function updateRootWorkspaceScripts(workspaceRoot, scope, packageSource, remotes) {
|
|
121
|
+
function updateRootWorkspaceScripts(workspaceRoot, scope, packageSource, remotes, bridge) {
|
|
136
122
|
const packagePath = external_node_path_default().join(workspaceRoot, 'package.json');
|
|
137
123
|
const rootPackage = (0, external_fs_io_cjs_namespaceObject.readJsonFile)(packagePath);
|
|
138
|
-
const generatedRootPackage = (0, external_package_json_cjs_namespaceObject.createRootPackageJson)(scope, packageSource, remotes);
|
|
124
|
+
const generatedRootPackage = (0, external_package_json_cjs_namespaceObject.createRootPackageJson)(scope, packageSource, remotes, bridge);
|
|
139
125
|
rootPackage.scripts = generatedRootPackage.scripts;
|
|
140
126
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(packagePath, rootPackage);
|
|
141
127
|
}
|
|
142
|
-
function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwind, remotes) {
|
|
128
|
+
function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwind, remotes, bridge) {
|
|
143
129
|
const shellHost = (0, external_descriptors_cjs_namespaceObject.createShellHost)(remotes);
|
|
144
130
|
const publicWeb = (0, external_public_surface_cjs_namespaceObject.createPublicWebAppArtifacts)(shellHost);
|
|
145
|
-
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/package.json`), (0, external_package_json_cjs_namespaceObject.createAppPackage)(scope, shellHost, packageSource, enableTailwind, remotes));
|
|
131
|
+
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/package.json`), (0, external_package_json_cjs_namespaceObject.createAppPackage)(scope, shellHost, packageSource, enableTailwind, remotes, bridge));
|
|
146
132
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/tsconfig.json`), (0, external_package_json_cjs_namespaceObject.createAppTsConfig)(shellHost, remotes));
|
|
147
133
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/tsconfig.mf-types.json`), (0, external_package_json_cjs_namespaceObject.createAppMfTypesTsConfig)(shellHost));
|
|
148
134
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/modern-app-env.d.ts`, (0, external_app_files_cjs_namespaceObject.createAppEnvDts)(shellHost, remotes));
|
|
@@ -160,7 +146,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
160
146
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/routes/[lang]/page.tsx`, (0, external_demo_components_cjs_namespaceObject.createShellPage)(remotes));
|
|
161
147
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/routes/vertical-components.tsx`, (0, external_demo_components_cjs_namespaceObject.createShellRemoteComponents)(scope, remotes));
|
|
162
148
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/routes/shell-frame.tsx`, (0, external_app_files_cjs_namespaceObject.createShellFrameComponent)());
|
|
163
|
-
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/
|
|
149
|
+
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, `${external_descriptors_cjs_namespaceObject.shellApp.directory}/src/api/vertical-clients.ts`, (0, external_api_cjs_namespaceObject.createShellApiClient)(scope, remotes));
|
|
164
150
|
}
|
|
165
151
|
function addShellZephyrDependency(workspaceRoot, scope, remote) {
|
|
166
152
|
const packagePath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.shellApp.directory, 'package.json');
|
|
@@ -170,7 +156,7 @@ function addShellZephyrDependency(workspaceRoot, scope, remote) {
|
|
|
170
156
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(packagePath, shellPackage);
|
|
171
157
|
}
|
|
172
158
|
function addShellWorkspaceDependency(workspaceRoot, scope, remote) {
|
|
173
|
-
if (!(0, external_descriptors_cjs_namespaceObject.
|
|
159
|
+
if (!(0, external_descriptors_cjs_namespaceObject.appHasApi)(remote)) return;
|
|
174
160
|
const packagePath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.shellApp.directory, 'package.json');
|
|
175
161
|
const shellPackage = (0, external_fs_io_cjs_namespaceObject.readJsonFile)(packagePath);
|
|
176
162
|
shellPackage.dependencies ??= {};
|
|
@@ -197,8 +183,8 @@ function verticalTopologyEntry(scope, vertical, remotes = []) {
|
|
|
197
183
|
fallbackTelemetryEvent: 'modernjs:mv-runtime-parity',
|
|
198
184
|
sharedContractVersion: 'mf-ssr-contract-v1'
|
|
199
185
|
},
|
|
200
|
-
...(0,
|
|
201
|
-
api: (0,
|
|
186
|
+
...(0, external_api_cjs_namespaceObject.apiTopologyMetadata)(vertical) ? {
|
|
187
|
+
api: (0, external_api_cjs_namespaceObject.apiTopologyMetadata)(vertical)
|
|
202
188
|
} : {},
|
|
203
189
|
cloudflare: (0, external_policy_cjs_namespaceObject.createCloudflareDeployContract)(scope, vertical),
|
|
204
190
|
ownership: vertical.ownership
|
|
@@ -216,10 +202,11 @@ function verticalsFromTopology(topology, ports) {
|
|
|
216
202
|
return (topology.verticals ?? []).map((vertical)=>{
|
|
217
203
|
const domain = vertical.domain ?? String(vertical.id);
|
|
218
204
|
const packageSuffix = vertical.package?.split('/').at(-1) ?? domain;
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
205
|
+
const apiTopology = vertical.api;
|
|
206
|
+
const api = apiTopology?.runtime === 'effect' ? {
|
|
207
|
+
stem: 'string' == typeof apiTopology.basePath ? apiTopology.basePath.split('/').filter(Boolean).at(-1) ?? domain : domain,
|
|
208
|
+
prefix: apiTopology.bff?.prefix ?? `/${domain}-api`,
|
|
209
|
+
consumedBy: Array.isArray(apiTopology.consumedBy) ? apiTopology.consumedBy : [
|
|
223
210
|
external_descriptors_cjs_namespaceObject.shellApp.id,
|
|
224
211
|
vertical.id
|
|
225
212
|
]
|
|
@@ -245,8 +232,8 @@ function verticalsFromTopology(topology, ports) {
|
|
|
245
232
|
} : Array.isArray(vertical.moduleFederation?.remotes) ? {
|
|
246
233
|
verticalRefs: vertical.moduleFederation.remotes.map((entry)=>entry.id).filter((id)=>'string' == typeof id)
|
|
247
234
|
} : {},
|
|
248
|
-
...
|
|
249
|
-
|
|
235
|
+
...api ? {
|
|
236
|
+
api
|
|
250
237
|
} : {},
|
|
251
238
|
ownership: vertical.ownership ?? (0, external_descriptors_cjs_namespaceObject.createNeutralOwnership)(vertical.id)
|
|
252
239
|
};
|
|
@@ -261,8 +248,7 @@ function prepareAddUltramodernVertical(options) {
|
|
|
261
248
|
const topology = readRequiredJsonObject(topologyPath);
|
|
262
249
|
const ownership = readRequiredJsonObject(ownershipPath);
|
|
263
250
|
const overlay = readRequiredJsonObject(overlayPath);
|
|
264
|
-
|
|
265
|
-
readRequiredJsonObject(external_node_path_default().join(options.workspaceRoot, PACKAGE_SOURCE_METADATA_PATH));
|
|
251
|
+
readRequiredWorkspaceConfig(options.workspaceRoot);
|
|
266
252
|
assertOptionalJsonObject(topology.shell, 'topology.shell', topologyPath);
|
|
267
253
|
assertOptionalJsonArray(topology.verticals, 'topology.verticals', topologyPath);
|
|
268
254
|
assertOptionalJsonArray(ownership.owners, 'ownership.owners', ownershipPath);
|
|
@@ -273,6 +259,7 @@ function prepareAddUltramodernVertical(options) {
|
|
|
273
259
|
const scope = (0, external_naming_cjs_namespaceObject.toPackageScope)(String(rootPackage.name ?? external_node_path_default().basename(options.workspaceRoot)));
|
|
274
260
|
const packageSource = existingPackageSource(options.workspaceRoot, options.modernVersion, options.packageSource);
|
|
275
261
|
const enableTailwind = options.enableTailwind ?? existingTailwindEnabled(options.workspaceRoot);
|
|
262
|
+
const bridge = existingBridgeConfig(options.workspaceRoot);
|
|
276
263
|
const existingVerticals = verticalsFromTopology(topology, overlay.ports);
|
|
277
264
|
const port = nextAvailablePort(overlay.ports);
|
|
278
265
|
const vertical = (0, external_descriptors_cjs_namespaceObject.createVerticalDescriptor)(name, port);
|
|
@@ -300,6 +287,7 @@ function prepareAddUltramodernVertical(options) {
|
|
|
300
287
|
overlay,
|
|
301
288
|
packageSource,
|
|
302
289
|
enableTailwind,
|
|
290
|
+
bridge,
|
|
303
291
|
vertical,
|
|
304
292
|
updatedVerticals
|
|
305
293
|
};
|
|
@@ -310,6 +298,10 @@ function readRequiredJsonObject(filePath) {
|
|
|
310
298
|
if (!(0, external_types_cjs_namespaceObject.isRecord)(value)) throw new Error(`UltraModern workspace file must contain a JSON object: ${filePath}`);
|
|
311
299
|
return value;
|
|
312
300
|
}
|
|
301
|
+
function readRequiredWorkspaceConfig(workspaceRoot) {
|
|
302
|
+
const compactPath = external_node_path_default().join(workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH);
|
|
303
|
+
readRequiredJsonObject(compactPath);
|
|
304
|
+
}
|
|
313
305
|
function assertOptionalJsonObject(value, label, filePath) {
|
|
314
306
|
if (void 0 !== value && !(0, external_types_cjs_namespaceObject.isRecord)(value)) throw new Error(`${label} in ${filePath} must be a JSON object`);
|
|
315
307
|
}
|
|
@@ -328,9 +320,9 @@ function validateWorkspaceAppDescriptors(apps) {
|
|
|
328
320
|
assertNonEmptyString(app.portEnv, `port env for ${appLabel}`);
|
|
329
321
|
if ('number' != typeof app.port || !Number.isFinite(app.port) || app.port <= 0) throw new Error(`Invalid development port for ${appLabel}`);
|
|
330
322
|
assertNonEmptyString(app.mfName, `Module Federation name for ${appLabel}`);
|
|
331
|
-
if (app.
|
|
332
|
-
assertNonEmptyString(app.
|
|
333
|
-
if (!app.
|
|
323
|
+
if (app.api) {
|
|
324
|
+
assertNonEmptyString(app.api.prefix, `API prefix for ${appLabel}`);
|
|
325
|
+
if (!app.api.prefix.startsWith('/')) throw new Error(`API prefix for ${appLabel} must start with "/"`);
|
|
334
326
|
}
|
|
335
327
|
}
|
|
336
328
|
}
|
|
@@ -340,7 +332,7 @@ function validateUniqueWorkspaceAppDescriptors(apps) {
|
|
|
340
332
|
assertUniqueAppField(apps, 'output path', (app)=>(0, external_naming_cjs_namespaceObject.normalizePath)(app.directory));
|
|
341
333
|
assertUniqueAppField(apps, 'Module Federation name', (app)=>app.mfName);
|
|
342
334
|
assertUniqueAppField(apps, 'development port', (app)=>String(app.port));
|
|
343
|
-
assertUniqueAppField(apps, '
|
|
335
|
+
assertUniqueAppField(apps, 'API prefix', (app)=>app.api?.prefix);
|
|
344
336
|
assertUniqueAppField(apps, 'manifest environment name', (app)=>'vertical' === app.kind ? (0, external_descriptors_cjs_namespaceObject.createRemoteManifestEnv)(app) : void 0);
|
|
345
337
|
}
|
|
346
338
|
function assertUniqueAppField(apps, label, readValue) {
|
|
@@ -407,14 +399,14 @@ function createVerticalPlan(preflight, result) {
|
|
|
407
399
|
name: vertical.mfName,
|
|
408
400
|
manifestUrl
|
|
409
401
|
},
|
|
410
|
-
...vertical.
|
|
411
|
-
|
|
402
|
+
...vertical.api ? {
|
|
403
|
+
apiPrefix: (0, external_descriptors_cjs_namespaceObject.resolveApiPrefix)(vertical)
|
|
412
404
|
} : {},
|
|
413
405
|
jsonMutations: createDryRunJsonMutations(preflight, manifestUrl),
|
|
414
406
|
shellDependencyChanges: createShellDependencyChanges(scope, vertical),
|
|
415
407
|
generatedContractChanges: [
|
|
416
408
|
{
|
|
417
|
-
path: external_descriptors_cjs_namespaceObject.
|
|
409
|
+
path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
|
|
418
410
|
addedAppIds: [
|
|
419
411
|
vertical.id
|
|
420
412
|
],
|
|
@@ -425,12 +417,12 @@ function createVerticalPlan(preflight, result) {
|
|
|
425
417
|
}
|
|
426
418
|
function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
427
419
|
const { scope, vertical } = preflight;
|
|
428
|
-
const
|
|
420
|
+
const apiMutation = (0, external_descriptors_cjs_namespaceObject.appHasApi)(vertical) ? [
|
|
429
421
|
{
|
|
430
422
|
path: DEVELOPMENT_OVERLAY_PATH,
|
|
431
423
|
pointer: `/apis/${vertical.id}`,
|
|
432
|
-
description: `Add local
|
|
433
|
-
value: `http://localhost:${vertical.port}${(0, external_descriptors_cjs_namespaceObject.
|
|
424
|
+
description: `Add local API URL for ${vertical.id}`,
|
|
425
|
+
value: `http://localhost:${vertical.port}${(0, external_descriptors_cjs_namespaceObject.resolveApiPrefix)(vertical)}`
|
|
434
426
|
}
|
|
435
427
|
] : [];
|
|
436
428
|
return [
|
|
@@ -474,7 +466,7 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
474
466
|
description: `Add local Module Federation manifest URL for ${vertical.id}`,
|
|
475
467
|
value: manifestUrl
|
|
476
468
|
},
|
|
477
|
-
...
|
|
469
|
+
...apiMutation,
|
|
478
470
|
{
|
|
479
471
|
path: 'package.json',
|
|
480
472
|
pointer: "/scripts",
|
|
@@ -501,9 +493,9 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
501
493
|
description: 'Keep shell Module Federation DTS compilation scoped'
|
|
502
494
|
},
|
|
503
495
|
{
|
|
504
|
-
path: external_descriptors_cjs_namespaceObject.
|
|
505
|
-
pointer: '/apps',
|
|
506
|
-
description: `Regenerate
|
|
496
|
+
path: external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH,
|
|
497
|
+
pointer: '/topology/apps',
|
|
498
|
+
description: `Regenerate compact config with ${vertical.id}`
|
|
507
499
|
}
|
|
508
500
|
];
|
|
509
501
|
}
|
|
@@ -515,7 +507,7 @@ function createShellDependencyChanges(scope, vertical) {
|
|
|
515
507
|
packageName: (0, external_descriptors_cjs_namespaceObject.remoteDependencyAlias)(vertical),
|
|
516
508
|
version: (0, external_descriptors_cjs_namespaceObject.zephyrRemoteDependency)(scope, vertical)
|
|
517
509
|
},
|
|
518
|
-
...(0, external_descriptors_cjs_namespaceObject.
|
|
510
|
+
...(0, external_descriptors_cjs_namespaceObject.appHasApi)(vertical) ? [
|
|
519
511
|
{
|
|
520
512
|
path: `${external_descriptors_cjs_namespaceObject.shellApp.directory}/package.json`,
|
|
521
513
|
section: 'dependencies',
|
|
@@ -527,8 +519,8 @@ function createShellDependencyChanges(scope, vertical) {
|
|
|
527
519
|
}
|
|
528
520
|
function addUltramodernVertical(options) {
|
|
529
521
|
const beforeFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
|
|
530
|
-
const { scope, topologyPath, ownershipPath, overlayPath, topology, ownership, overlay, packageSource, enableTailwind, vertical, updatedVerticals } = prepareAddUltramodernVertical(options);
|
|
531
|
-
(0, external_write_workspace_cjs_namespaceObject.writeApp)(options.workspaceRoot, scope, vertical, packageSource, enableTailwind);
|
|
522
|
+
const { scope, topologyPath, ownershipPath, overlayPath, topology, ownership, overlay, packageSource, enableTailwind, bridge, vertical, updatedVerticals } = prepareAddUltramodernVertical(options);
|
|
523
|
+
(0, external_write_workspace_cjs_namespaceObject.writeApp)(options.workspaceRoot, scope, vertical, packageSource, enableTailwind, updatedVerticals, bridge);
|
|
532
524
|
topology.shell ??= {};
|
|
533
525
|
topology.shell.verticalRefs ??= [];
|
|
534
526
|
topology.shell.verticalRefs.push(vertical.id);
|
|
@@ -547,22 +539,22 @@ function addUltramodernVertical(options) {
|
|
|
547
539
|
overlay.manifests ??= {};
|
|
548
540
|
overlay.manifests[vertical.id] = `http://localhost:${vertical.port}/mf-manifest.json`;
|
|
549
541
|
overlay.apis ??= {};
|
|
550
|
-
overlay.apis[vertical.id] = `http://localhost:${vertical.port}${(0, external_descriptors_cjs_namespaceObject.
|
|
542
|
+
overlay.apis[vertical.id] = `http://localhost:${vertical.port}${(0, external_descriptors_cjs_namespaceObject.resolveApiPrefix)(vertical)}`;
|
|
551
543
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(topologyPath, topology);
|
|
552
544
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(ownershipPath, ownership);
|
|
553
545
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(overlayPath, overlay);
|
|
554
|
-
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(options.workspaceRoot, external_descriptors_cjs_namespaceObject.
|
|
546
|
+
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(options.workspaceRoot, external_descriptors_cjs_namespaceObject.ULTRAMODERN_CONFIG_PATH), (0, external_write_workspace_cjs_namespaceObject.createCompactUltramodernConfig)(scope, options.modernVersion, packageSource, [
|
|
555
547
|
{
|
|
556
548
|
...external_descriptors_cjs_namespaceObject.shellApp,
|
|
557
549
|
verticalRefs: updatedVerticals.map((vertical)=>vertical.id)
|
|
558
550
|
},
|
|
559
551
|
...updatedVerticals
|
|
560
|
-
], enableTailwind));
|
|
561
|
-
rewriteShellAppFiles(options.workspaceRoot, scope, packageSource, enableTailwind, updatedVerticals);
|
|
552
|
+
], enableTailwind, bridge));
|
|
553
|
+
rewriteShellAppFiles(options.workspaceRoot, scope, packageSource, enableTailwind, updatedVerticals, bridge);
|
|
562
554
|
(0, external_workspace_scripts_cjs_namespaceObject.writeGeneratedWorkspaceScripts)(options.workspaceRoot, scope, enableTailwind, updatedVerticals);
|
|
563
555
|
addShellZephyrDependency(options.workspaceRoot, scope, vertical);
|
|
564
556
|
addShellWorkspaceDependency(options.workspaceRoot, scope, vertical);
|
|
565
|
-
updateRootWorkspaceScripts(options.workspaceRoot, scope, packageSource, updatedVerticals);
|
|
557
|
+
updateRootWorkspaceScripts(options.workspaceRoot, scope, packageSource, updatedVerticals, bridge);
|
|
566
558
|
(0, external_fs_io_cjs_namespaceObject.writeJsonFile)(external_node_path_default().join(options.workspaceRoot, 'tsconfig.json'), (0, external_package_json_cjs_namespaceObject.createRootTsConfig)([
|
|
567
559
|
{
|
|
568
560
|
...external_descriptors_cjs_namespaceObject.shellApp,
|
|
@@ -570,9 +562,9 @@ function addUltramodernVertical(options) {
|
|
|
570
562
|
},
|
|
571
563
|
...updatedVerticals
|
|
572
564
|
]));
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
const
|
|
565
|
+
const preliminaryAfterFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
|
|
566
|
+
const preliminaryDiff = (0, external_generation_result_cjs_namespaceObject.diffFileSnapshots)(beforeFiles, preliminaryAfterFiles);
|
|
567
|
+
const preliminaryResult = (0, external_generation_result_cjs_namespaceObject.createGenerationResult)({
|
|
576
568
|
operation: 'vertical',
|
|
577
569
|
workspaceRoot: options.workspaceRoot,
|
|
578
570
|
packageScope: scope,
|
|
@@ -580,21 +572,40 @@ function addUltramodernVertical(options) {
|
|
|
580
572
|
createdApps: [
|
|
581
573
|
vertical
|
|
582
574
|
],
|
|
583
|
-
createdPaths,
|
|
584
|
-
rewrittenPaths
|
|
575
|
+
createdPaths: preliminaryDiff.createdPaths,
|
|
576
|
+
rewrittenPaths: preliminaryDiff.rewrittenPaths
|
|
585
577
|
});
|
|
586
578
|
(0, external_overlays_cjs_namespaceObject.runCodeSmithOverlays)({
|
|
587
579
|
workspaceRoot: options.workspaceRoot,
|
|
588
580
|
overlays: options.overlays,
|
|
589
|
-
result
|
|
581
|
+
result: preliminaryResult
|
|
582
|
+
});
|
|
583
|
+
const afterOverlaysFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
|
|
584
|
+
const changedPaths = (0, external_generation_result_cjs_namespaceObject.diffFileSnapshots)(beforeFiles, afterOverlaysFiles);
|
|
585
|
+
(0, external_fs_io_cjs_namespaceObject.formatGeneratedWorkspaceFiles)(options.workspaceRoot, [
|
|
586
|
+
...changedPaths.createdPaths,
|
|
587
|
+
...changedPaths.rewrittenPaths
|
|
588
|
+
]);
|
|
589
|
+
const afterFiles = (0, external_generation_result_cjs_namespaceObject.createFileSnapshot)(options.workspaceRoot);
|
|
590
|
+
const { createdPaths, rewrittenPaths } = (0, external_generation_result_cjs_namespaceObject.diffFileSnapshots)(beforeFiles, afterFiles);
|
|
591
|
+
return (0, external_generation_result_cjs_namespaceObject.createGenerationResult)({
|
|
592
|
+
operation: 'vertical',
|
|
593
|
+
workspaceRoot: options.workspaceRoot,
|
|
594
|
+
packageScope: scope,
|
|
595
|
+
packageSource,
|
|
596
|
+
createdApps: [
|
|
597
|
+
vertical
|
|
598
|
+
],
|
|
599
|
+
createdPaths,
|
|
600
|
+
rewrittenPaths
|
|
590
601
|
});
|
|
591
|
-
return result;
|
|
592
602
|
}
|
|
593
603
|
exports.addShellWorkspaceDependency = __webpack_exports__.addShellWorkspaceDependency;
|
|
594
604
|
exports.addShellZephyrDependency = __webpack_exports__.addShellZephyrDependency;
|
|
595
605
|
exports.addUltramodernVertical = __webpack_exports__.addUltramodernVertical;
|
|
596
606
|
exports.assertCanCreate = __webpack_exports__.assertCanCreate;
|
|
597
607
|
exports.assertValidVerticalName = __webpack_exports__.assertValidVerticalName;
|
|
608
|
+
exports.existingBridgeConfig = __webpack_exports__.existingBridgeConfig;
|
|
598
609
|
exports.existingPackageSource = __webpack_exports__.existingPackageSource;
|
|
599
610
|
exports.existingTailwindEnabled = __webpack_exports__.existingTailwindEnabled;
|
|
600
611
|
exports.nextAvailablePort = __webpack_exports__.nextAvailablePort;
|
|
@@ -611,6 +622,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
611
622
|
"addUltramodernVertical",
|
|
612
623
|
"assertCanCreate",
|
|
613
624
|
"assertValidVerticalName",
|
|
625
|
+
"existingBridgeConfig",
|
|
614
626
|
"existingPackageSource",
|
|
615
627
|
"existingTailwindEnabled",
|
|
616
628
|
"nextAvailablePort",
|