@bleedingdev/modern-js-create 3.4.0-ultramodern.11 → 3.4.0-ultramodern.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/dist/cjs/index.cjs +36 -3
- package/dist/cjs/locale/en.cjs +10 -0
- package/dist/cjs/locale/zh.cjs +10 -0
- package/dist/cjs/ultramodern-tooling/commands.cjs +185 -0
- package/dist/cjs/ultramodern-tooling/config.cjs +248 -0
- package/dist/cjs/ultramodern-workspace/add-vertical.cjs +39 -18
- 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 +119 -653
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/generation-result.cjs +1 -1
- package/dist/cjs/ultramodern-workspace/index.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/mf-validation.cjs +572 -0
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +14 -0
- package/dist/cjs/ultramodern-workspace/package-json.cjs +26 -12
- package/dist/cjs/ultramodern-workspace/public-api.cjs +4 -0
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +74 -44
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +37 -8
- package/dist/esm/index.js +36 -3
- package/dist/esm/locale/en.js +10 -0
- package/dist/esm/locale/zh.js +10 -0
- package/dist/esm/ultramodern-tooling/commands.js +132 -0
- package/dist/esm/ultramodern-tooling/config.js +196 -0
- package/dist/esm/ultramodern-workspace/add-vertical.js +39 -21
- 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 +122 -608
- package/dist/esm/ultramodern-workspace/descriptors.js +2 -1
- package/dist/esm/ultramodern-workspace/generation-result.js +2 -2
- package/dist/esm/ultramodern-workspace/index.js +1 -0
- package/dist/esm/ultramodern-workspace/mf-validation.js +517 -0
- package/dist/esm/ultramodern-workspace/module-federation.js +14 -0
- package/dist/esm/ultramodern-workspace/package-json.js +26 -12
- package/dist/esm/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +75 -27
- package/dist/esm/ultramodern-workspace/write-workspace.js +38 -12
- package/dist/esm-node/index.js +36 -3
- package/dist/esm-node/locale/en.js +10 -0
- package/dist/esm-node/locale/zh.js +10 -0
- package/dist/esm-node/ultramodern-tooling/commands.js +133 -0
- package/dist/esm-node/ultramodern-tooling/config.js +197 -0
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +39 -21
- 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 +122 -608
- package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -1
- package/dist/esm-node/ultramodern-workspace/generation-result.js +2 -2
- package/dist/esm-node/ultramodern-workspace/index.js +1 -0
- package/dist/esm-node/ultramodern-workspace/mf-validation.js +518 -0
- package/dist/esm-node/ultramodern-workspace/module-federation.js +14 -0
- package/dist/esm-node/ultramodern-workspace/package-json.js +26 -12
- package/dist/esm-node/ultramodern-workspace/public-api.js +1 -0
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +75 -27
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +38 -12
- 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/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 +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 +4 -3
- package/dist/types/ultramodern-workspace/public-api.d.ts +2 -0
- package/dist/types/ultramodern-workspace/types.d.ts +2 -0
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +1 -7
- package/dist/types/ultramodern-workspace/write-workspace.d.ts +4 -2
- package/package.json +3 -3
- package/template-workspace/{.agents → .codex}/skills-lock.json +12 -12
- 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/scripts/bootstrap-agent-skills.mjs +77 -67
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +56 -3
- package/templates/workspace-scripts/generate-public-surface-assets.mjs +239 -4
- package/templates/workspace-scripts/proof-cloudflare-version.mjs +282 -4
- package/templates/workspace-scripts/ultramodern-performance-readiness.mjs +172 -1
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +4 -2
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +783 -26
- /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
|
@@ -81,7 +81,7 @@ const effectDiagnostics = [
|
|
|
81
81
|
'unnecessaryPipe',
|
|
82
82
|
'unnecessaryPipeChain'
|
|
83
83
|
];
|
|
84
|
-
function appDependencies(scope, packageSource, app, remotes = []) {
|
|
84
|
+
function appDependencies(scope, packageSource, app, remotes = [], bridge) {
|
|
85
85
|
const dependencies = {
|
|
86
86
|
'@modern-js/plugin-tanstack': modernPackageSpecifier('@modern-js/plugin-tanstack', packageSource),
|
|
87
87
|
'@modern-js/plugin-i18n': modernPackageSpecifier('@modern-js/plugin-i18n', packageSource),
|
|
@@ -98,6 +98,7 @@ function appDependencies(scope, packageSource, app, remotes = []) {
|
|
|
98
98
|
'react-dom': REACT_DOM_VERSION,
|
|
99
99
|
'react-router': REACT_ROUTER_VERSION
|
|
100
100
|
};
|
|
101
|
+
for (const dependency of bridge?.dependencies ?? [])dependencies[dependency] = WORKSPACE_PACKAGE_VERSION;
|
|
101
102
|
if ('shell' === app.kind) {
|
|
102
103
|
dependencies['@modern-js/plugin-bff'] = modernPackageSpecifier('@modern-js/plugin-bff', packageSource);
|
|
103
104
|
for (const remote of verticalEffectApps(remotes))dependencies[packageName(scope, remote.packageSuffix)] = WORKSPACE_PACKAGE_VERSION;
|
|
@@ -124,12 +125,28 @@ function appDevDependencies(packageSource, enableTailwind) {
|
|
|
124
125
|
wrangler: WRANGLER_VERSION
|
|
125
126
|
};
|
|
126
127
|
}
|
|
127
|
-
function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
128
|
+
function createRootPackageJson(scope, packageSource, remotes = [], bridge) {
|
|
128
129
|
const shellFilter = `--filter ${packageName(scope, shellApp.packageSuffix)}`;
|
|
129
130
|
const remoteFilters = remotes.map((remote)=>`--filter ${packageName(scope, remote.packageSuffix)}`);
|
|
130
131
|
const remoteBuildPrefix = remotes.length > 0 ? 'ULTRAMODERN_ZEPHYR=false pnpm -r --filter "./verticals/*" run build && ' : '';
|
|
131
132
|
const remoteCloudflareBuildPrefix = remotes.length > 0 ? 'pnpm -r --filter "./verticals/*" run cloudflare:build && ' : '';
|
|
132
133
|
const remoteCloudflareDeployPrefix = remotes.length > 0 ? 'pnpm -r --filter "./verticals/*" run cloudflare:deploy && ' : '';
|
|
134
|
+
const generatedPackageTypecheck = 'pnpm -r --filter "./apps/*" --filter "./verticals/*" --filter "./packages/*" run typecheck';
|
|
135
|
+
const typecheck = bridge ? generatedPackageTypecheck : "node ./scripts/ultramodern-typecheck.mjs --build tsconfig.json";
|
|
136
|
+
const bridgeScripts = bridge ? {
|
|
137
|
+
...Object.fromEntries(bridge.gates.map((gate)=>[
|
|
138
|
+
`bridge:${gate.name}`,
|
|
139
|
+
`${gate.cwd ? `cd ${gate.cwd} && ` : ''}${gate.command}`
|
|
140
|
+
])),
|
|
141
|
+
'bridge:check': bridge.gates.map((gate)=>`pnpm run bridge:${gate.name}`).join(' && ')
|
|
142
|
+
} : {};
|
|
143
|
+
const bridgeCheck = bridge ? ' && pnpm bridge:check' : '';
|
|
144
|
+
const workspacePackages = [
|
|
145
|
+
'apps/*',
|
|
146
|
+
'verticals/*',
|
|
147
|
+
'packages/*',
|
|
148
|
+
...bridge?.workspacePackages.map((entry)=>entry.pattern) ?? []
|
|
149
|
+
];
|
|
133
150
|
return {
|
|
134
151
|
private: true,
|
|
135
152
|
name: scope,
|
|
@@ -151,7 +168,7 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
|
151
168
|
'format:check': "oxfmt --check . '!repos/**'",
|
|
152
169
|
lint: 'oxlint apps verticals packages',
|
|
153
170
|
'lint:fix': 'oxlint apps verticals packages --fix',
|
|
154
|
-
typecheck
|
|
171
|
+
typecheck,
|
|
155
172
|
'cloudflare:build': `${remoteCloudflareBuildPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm mf:types`,
|
|
156
173
|
'cloudflare:deploy': `${remoteCloudflareDeployPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:deploy`,
|
|
157
174
|
'cloudflare:proof': "node ./scripts/proof-cloudflare-version.mjs --out .codex/reports/cloudflare-version-proof/public-url-proof.json",
|
|
@@ -163,18 +180,15 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
|
163
180
|
'performance:readiness': "node ./scripts/ultramodern-performance-readiness.mjs",
|
|
164
181
|
'contract:check': "node ./scripts/validate-ultramodern-workspace.mjs",
|
|
165
182
|
'i18n:boundaries': "node ./scripts/check-ultramodern-i18n-boundaries.mjs",
|
|
183
|
+
...bridgeScripts,
|
|
166
184
|
postinstall: "oxfmt . '!repos/**' && node ./scripts/bootstrap-agent-skills.mjs --postinstall",
|
|
167
|
-
check:
|
|
185
|
+
check: `pnpm format:check && pnpm lint && pnpm typecheck && pnpm skills:check && pnpm i18n:boundaries && pnpm contract:check && pnpm performance:readiness${bridgeCheck}`
|
|
168
186
|
},
|
|
169
187
|
engines: {
|
|
170
188
|
node: '>=26',
|
|
171
189
|
pnpm: '>=11'
|
|
172
190
|
},
|
|
173
|
-
workspaces:
|
|
174
|
-
'apps/*',
|
|
175
|
-
'verticals/*',
|
|
176
|
-
'packages/*'
|
|
177
|
-
],
|
|
191
|
+
workspaces: workspacePackages,
|
|
178
192
|
modernjs: {
|
|
179
193
|
preset: 'presetUltramodern',
|
|
180
194
|
workspace: 'ultramodern-superapp',
|
|
@@ -182,7 +196,7 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
|
182
196
|
ownership: './topology/ownership.json',
|
|
183
197
|
packageSource: {
|
|
184
198
|
strategy: packageSource.strategy,
|
|
185
|
-
config: './.modernjs/ultramodern
|
|
199
|
+
config: './.modernjs/ultramodern.json#packageSource'
|
|
186
200
|
}
|
|
187
201
|
},
|
|
188
202
|
devDependencies: {
|
|
@@ -340,7 +354,7 @@ function createRootTsConfig(apps = []) {
|
|
|
340
354
|
]
|
|
341
355
|
};
|
|
342
356
|
}
|
|
343
|
-
function createAppPackage(scope, app, packageSource, enableTailwind, remotes = []) {
|
|
357
|
+
function createAppPackage(scope, app, packageSource, enableTailwind, remotes = [], bridge) {
|
|
344
358
|
const publicSurfaceBuildCommand = createPublicSurfaceGenerationCommand(app, 'dist');
|
|
345
359
|
const publicSurfaceCloudflareBuildCommand = createPublicSurfaceGenerationCommand(app, 'dist');
|
|
346
360
|
const publicSurfaceCloudflareOutputCommand = createPublicSurfaceGenerationCommand(app, 'cloudflare');
|
|
@@ -372,7 +386,7 @@ function createAppPackage(scope, app, packageSource, enableTailwind, remotes = [
|
|
|
372
386
|
} : {}
|
|
373
387
|
},
|
|
374
388
|
'zephyr:dependencies': createZephyrDependencies(scope, app, remotes),
|
|
375
|
-
dependencies: appDependencies(scope, packageSource, app, remotes),
|
|
389
|
+
dependencies: appDependencies(scope, packageSource, app, remotes, bridge),
|
|
376
390
|
devDependencies: appDevDependencies(packageSource, enableTailwind)
|
|
377
391
|
};
|
|
378
392
|
if (appHasEffectApi(app)) Object.assign(packageExports, {
|
|
@@ -8,10 +8,73 @@ import { createCloudflareSecurityContract } from "./policy.js";
|
|
|
8
8
|
import { publicSurfaceManagedSourceAssetPaths } from "./public-surface.js";
|
|
9
9
|
import { createLocalisedUrlsMap, createRouteMetaFilePath, createRouteOwnedI18nPaths, createRoutePageFilePath } from "./routes.js";
|
|
10
10
|
import { CLOUDFLARE_COMPATIBILITY_DATE, NODE_VERSION, PNPM_VERSION } from "./versions.js";
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
function createToolWrapperScript(command, extraArgs = []) {
|
|
12
|
+
const commandJson = JSON.stringify(command);
|
|
13
|
+
const extraArgsJson = JSON.stringify(extraArgs);
|
|
14
|
+
return `#!/usr/bin/env node
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
import path from 'node:path';
|
|
17
|
+
import { fileURLToPath } from 'node:url';
|
|
18
|
+
|
|
19
|
+
const createBin = process.env.ULTRAMODERN_CREATE_BIN;
|
|
20
|
+
const forwardedArgs = process.argv.slice(2);
|
|
21
|
+
const workspaceRoot =
|
|
22
|
+
process.env.ULTRAMODERN_WORKSPACE_ROOT ??
|
|
23
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
24
|
+
const ultramodernArgs = ['ultramodern', ${commandJson}, ...${extraArgsJson}, ...forwardedArgs];
|
|
25
|
+
const result = createBin
|
|
26
|
+
? spawnSync(process.execPath, [createBin, ...ultramodernArgs], {
|
|
27
|
+
env: { ...process.env, ULTRAMODERN_WORKSPACE_ROOT: workspaceRoot },
|
|
28
|
+
stdio: 'inherit',
|
|
29
|
+
})
|
|
30
|
+
: spawnSync('modern-js-create', ultramodernArgs, {
|
|
31
|
+
env: { ...process.env, ULTRAMODERN_WORKSPACE_ROOT: workspaceRoot },
|
|
32
|
+
shell: process.platform === 'win32',
|
|
33
|
+
stdio: 'inherit',
|
|
14
34
|
});
|
|
35
|
+
|
|
36
|
+
if (result.error) {
|
|
37
|
+
console.error(result.error.message);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
process.exit(result.status ?? 1);
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
function createSkillsToolWrapperScript() {
|
|
45
|
+
return `#!/usr/bin/env node
|
|
46
|
+
import { spawnSync } from 'node:child_process';
|
|
47
|
+
import path from 'node:path';
|
|
48
|
+
import { fileURLToPath } from 'node:url';
|
|
49
|
+
|
|
50
|
+
const createBin = process.env.ULTRAMODERN_CREATE_BIN;
|
|
51
|
+
const forwardedArgs = process.argv.slice(2);
|
|
52
|
+
const workspaceRoot =
|
|
53
|
+
process.env.ULTRAMODERN_WORKSPACE_ROOT ??
|
|
54
|
+
path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
55
|
+
const checkOnly = forwardedArgs.includes('--check');
|
|
56
|
+
const skillArgs = checkOnly
|
|
57
|
+
? ['skills', 'check', ...forwardedArgs.filter(arg => arg !== '--check')]
|
|
58
|
+
: ['skills', 'install', ...forwardedArgs];
|
|
59
|
+
const ultramodernArgs = ['ultramodern', ...skillArgs];
|
|
60
|
+
const result = createBin
|
|
61
|
+
? spawnSync(process.execPath, [createBin, ...ultramodernArgs], {
|
|
62
|
+
env: { ...process.env, ULTRAMODERN_WORKSPACE_ROOT: workspaceRoot },
|
|
63
|
+
stdio: 'inherit',
|
|
64
|
+
})
|
|
65
|
+
: spawnSync('modern-js-create', ultramodernArgs, {
|
|
66
|
+
env: { ...process.env, ULTRAMODERN_WORKSPACE_ROOT: workspaceRoot },
|
|
67
|
+
shell: process.platform === 'win32',
|
|
68
|
+
stdio: 'inherit',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
if (result.error) {
|
|
72
|
+
console.error(result.error.message);
|
|
73
|
+
process.exit(1);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
process.exit(result.status ?? 1);
|
|
77
|
+
`;
|
|
15
78
|
}
|
|
16
79
|
function createWorkspaceValidationScript(scope, enableTailwind, remotes = []) {
|
|
17
80
|
const verticals = remotes.filter(appHasEffectApi).map((remote)=>({
|
|
@@ -65,33 +128,18 @@ function createWorkspaceValidationScript(scope, enableTailwind, remotes = []) {
|
|
|
65
128
|
function createWorkspaceI18nBoundaryValidationScript() {
|
|
66
129
|
return readFileTemplate("workspace-scripts/check-ultramodern-i18n-boundaries.mjs");
|
|
67
130
|
}
|
|
68
|
-
function createPublicSurfaceAssetsScript() {
|
|
69
|
-
return readFileTemplate("workspace-scripts/generate-public-surface-assets.mjs");
|
|
70
|
-
}
|
|
71
|
-
function createCloudflareProofHelperScript() {
|
|
72
|
-
return readFileTemplate("workspace-scripts/ultramodern-cloudflare-proof.mjs");
|
|
73
|
-
}
|
|
74
|
-
function createCloudflareVersionProofScript() {
|
|
75
|
-
return readFileTemplate("workspace-scripts/proof-cloudflare-version.mjs");
|
|
76
|
-
}
|
|
77
131
|
function createPerformanceReadinessConfigScript() {
|
|
78
132
|
return readFileTemplate("workspace-scripts/ultramodern-performance-readiness.config.mjs");
|
|
79
133
|
}
|
|
80
|
-
function
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
function createUltramodernTypecheckScript() {
|
|
84
|
-
return readFileTemplate("workspace-scripts/ultramodern-typecheck.mjs");
|
|
85
|
-
}
|
|
86
|
-
function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remotes = []) {
|
|
87
|
-
writeFileReplacing(targetDir, "scripts/assert-mf-types.mjs", createAssertMfTypesScript(remotes));
|
|
88
|
-
writeFileReplacing(targetDir, "scripts/validate-ultramodern-workspace.mjs", createWorkspaceValidationScript(scope, enableTailwind, remotes));
|
|
134
|
+
function writeGeneratedWorkspaceScripts(targetDir, _scope, _enableTailwind, _remotes = []) {
|
|
135
|
+
writeFileReplacing(targetDir, "scripts/assert-mf-types.mjs", createToolWrapperScript('mf-types'));
|
|
136
|
+
writeFileReplacing(targetDir, "scripts/validate-ultramodern-workspace.mjs", createToolWrapperScript('validate'));
|
|
89
137
|
writeFileReplacing(targetDir, "scripts/check-ultramodern-i18n-boundaries.mjs", createWorkspaceI18nBoundaryValidationScript());
|
|
90
|
-
writeFileReplacing(targetDir, "scripts/generate-public-surface-assets.mjs",
|
|
91
|
-
writeFileReplacing(targetDir, "scripts/
|
|
92
|
-
writeFileReplacing(targetDir, "scripts/proof-cloudflare-version.mjs", createCloudflareVersionProofScript());
|
|
138
|
+
writeFileReplacing(targetDir, "scripts/generate-public-surface-assets.mjs", createToolWrapperScript('public-surface'));
|
|
139
|
+
writeFileReplacing(targetDir, "scripts/proof-cloudflare-version.mjs", createToolWrapperScript('cloudflare-proof'));
|
|
93
140
|
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.config.mjs", createPerformanceReadinessConfigScript());
|
|
94
|
-
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.mjs",
|
|
95
|
-
writeFileReplacing(targetDir, "scripts/ultramodern-typecheck.mjs",
|
|
141
|
+
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.mjs", createToolWrapperScript('performance-readiness'));
|
|
142
|
+
writeFileReplacing(targetDir, "scripts/ultramodern-typecheck.mjs", createToolWrapperScript('typecheck'));
|
|
143
|
+
writeFileReplacing(targetDir, "scripts/bootstrap-agent-skills.mjs", createSkillsToolWrapperScript());
|
|
96
144
|
}
|
|
97
|
-
export {
|
|
145
|
+
export { createPerformanceReadinessConfigScript, createWorkspaceI18nBoundaryValidationScript, createWorkspaceValidationScript, writeGeneratedWorkspaceScripts };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import node_fs from "node:fs";
|
|
3
3
|
import { createAppEnvDts, createAppRuntimeConfig, createAppStyles, createPostcssConfig, createSharedDesignTokensCss, createShellFrameComponent, createTailwindConfig } from "./app-files.js";
|
|
4
|
-
import {
|
|
4
|
+
import { normalizeUltramodernBridgeConfig } from "./bridge-config.js";
|
|
5
|
+
import { createDevelopmentOverlay, createOwnership, createTopology, createUltramodernConfig } from "./contracts.js";
|
|
5
6
|
import { createLayout, createRemoteEntry, createRemoteExposeComponent, createRemotePage, createShellPage, createShellRemoteComponents, remoteComponentOutputPath } from "./demo-components.js";
|
|
6
|
-
import {
|
|
7
|
+
import { ULTRAMODERN_CONFIG_PATH, appHasEffectApi, appI18nNamespace, createShellHost, sharedPackages, shellApp } from "./descriptors.js";
|
|
7
8
|
import { createEffectClient, createEffectServiceEntry, createEffectSharedApi, createShellEffectClient } from "./effect-api.js";
|
|
8
|
-
import { copyRootTemplate, writeFile, writeJson } from "./fs-io.js";
|
|
9
|
+
import { copyRootTemplate, writeFile, writeFileReplacing, writeJson } from "./fs-io.js";
|
|
9
10
|
import { createFileSnapshot, createGenerationResult, diffFileSnapshots } from "./generation-result.js";
|
|
10
11
|
import { createAppPublicLocaleMessages } from "./locales.js";
|
|
11
12
|
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule, createUltramodernBuildReexportModule } from "./module-federation.js";
|
|
@@ -16,13 +17,13 @@ import { resolvePackageSource } from "./package-source.js";
|
|
|
16
17
|
import { createPublicWebAppArtifacts } from "./public-surface.js";
|
|
17
18
|
import { NODE_FETCH_VERSION, NODE_VERSION, PNPM_VERSION, TANSTACK_ROUTER_CORE_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_VERSION } from "./versions.js";
|
|
18
19
|
import { writeGeneratedWorkspaceScripts } from "./workspace-scripts.js";
|
|
19
|
-
function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes = []) {
|
|
20
|
+
function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes = [], bridge) {
|
|
20
21
|
const resolvedApp = 'shell' === app.kind ? createShellHost(remotes) : app;
|
|
21
22
|
const publicWeb = createPublicWebAppArtifacts(resolvedApp);
|
|
22
23
|
const writeAppFile = (relativePath, content)=>{
|
|
23
24
|
writeFile(targetDir, `${resolvedApp.directory}/${relativePath}`, content);
|
|
24
25
|
};
|
|
25
|
-
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
26
|
+
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes, bridge));
|
|
26
27
|
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`, createAppTsConfig(resolvedApp, remotes));
|
|
27
28
|
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.mf-types.json`, createAppMfTypesTsConfig(resolvedApp));
|
|
28
29
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
@@ -81,10 +82,36 @@ function writeSharedPackages(targetDir, scope) {
|
|
|
81
82
|
`);
|
|
82
83
|
writeFile(targetDir, 'packages/shared-design-tokens/src/tokens.css', createSharedDesignTokensCss());
|
|
83
84
|
}
|
|
85
|
+
function createCompactRootPackageJson(scope, packageSource, remotes, bridge) {
|
|
86
|
+
const rootPackage = createRootPackageJson(scope, packageSource, remotes, bridge);
|
|
87
|
+
if (rootPackage.modernjs?.packageSource && 'object' == typeof rootPackage.modernjs.packageSource) rootPackage.modernjs.packageSource.config = `./${ULTRAMODERN_CONFIG_PATH}`;
|
|
88
|
+
return rootPackage;
|
|
89
|
+
}
|
|
90
|
+
function createCompactUltramodernConfig(scope, modernVersion, packageSource, apps = [
|
|
91
|
+
createShellHost()
|
|
92
|
+
], enableTailwind = true, bridge) {
|
|
93
|
+
const config = createUltramodernConfig(scope, modernVersion, packageSource, apps, enableTailwind, bridge);
|
|
94
|
+
if (config.packageSource && 'object' == typeof config.packageSource && !Array.isArray(config.packageSource)) delete config.packageSource.metadata;
|
|
95
|
+
return config;
|
|
96
|
+
}
|
|
97
|
+
function writePnpmWorkspacePackages(targetDir, bridge) {
|
|
98
|
+
if (!bridge) return;
|
|
99
|
+
const pnpmWorkspacePath = `${targetDir}/pnpm-workspace.yaml`;
|
|
100
|
+
const pnpmWorkspace = node_fs.readFileSync(pnpmWorkspacePath, 'utf-8');
|
|
101
|
+
const packages = [
|
|
102
|
+
'apps/*',
|
|
103
|
+
'verticals/*',
|
|
104
|
+
'packages/*',
|
|
105
|
+
...bridge.workspacePackages.map((entry)=>entry.pattern)
|
|
106
|
+
];
|
|
107
|
+
const renderedPackages = packages.map((pattern)=>` - ${pattern}`).join('\n');
|
|
108
|
+
writeFileReplacing(targetDir, 'pnpm-workspace.yaml', pnpmWorkspace.replace(/^packages:\n(?: {2}- .+\n)+/u, `packages:\n${renderedPackages}\n`));
|
|
109
|
+
}
|
|
84
110
|
function generateUltramodernWorkspace(options) {
|
|
85
111
|
const beforeFiles = createFileSnapshot(options.targetDir);
|
|
86
112
|
const scope = toPackageScope(options.packageName);
|
|
87
113
|
const packageSource = resolvePackageSource(options);
|
|
114
|
+
const bridge = normalizeUltramodernBridgeConfig(options.bridge);
|
|
88
115
|
const enableTailwind = false !== options.enableTailwind;
|
|
89
116
|
const initialVerticals = [];
|
|
90
117
|
const createdApps = [
|
|
@@ -109,17 +136,16 @@ function generateUltramodernWorkspace(options) {
|
|
|
109
136
|
typescriptVersion: TYPESCRIPT_VERSION,
|
|
110
137
|
tailwindEnabled: String(enableTailwind)
|
|
111
138
|
});
|
|
112
|
-
|
|
139
|
+
writePnpmWorkspacePackages(options.targetDir, bridge);
|
|
140
|
+
writeJson(options.targetDir, 'package.json', createCompactRootPackageJson(scope, packageSource, initialVerticals, bridge));
|
|
113
141
|
writeJson(options.targetDir, 'tsconfig.base.json', createTsConfigBase());
|
|
114
142
|
writeJson(options.targetDir, 'tsconfig.json', createRootTsConfig(createdApps));
|
|
115
143
|
writeJson(options.targetDir, 'topology/reference-topology.json', createTopology(scope, initialVerticals));
|
|
116
144
|
writeJson(options.targetDir, 'topology/ownership.json', createOwnership(scope, initialVerticals));
|
|
117
145
|
writeJson(options.targetDir, 'topology/local-overlays/development.json', createDevelopmentOverlay(initialVerticals));
|
|
118
|
-
writeJson(options.targetDir,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
writeApp(options.targetDir, scope, shellApp, packageSource, enableTailwind, initialVerticals);
|
|
122
|
-
for (const remote of initialVerticals)writeApp(options.targetDir, scope, remote, packageSource, enableTailwind, initialVerticals);
|
|
146
|
+
writeJson(options.targetDir, ULTRAMODERN_CONFIG_PATH, createCompactUltramodernConfig(scope, options.modernVersion, packageSource, createdApps, enableTailwind, bridge));
|
|
147
|
+
writeApp(options.targetDir, scope, shellApp, packageSource, enableTailwind, initialVerticals, bridge);
|
|
148
|
+
for (const remote of initialVerticals)writeApp(options.targetDir, scope, remote, packageSource, enableTailwind, initialVerticals, bridge);
|
|
123
149
|
writeSharedPackages(options.targetDir, scope);
|
|
124
150
|
writeGeneratedWorkspaceScripts(options.targetDir, scope, enableTailwind, initialVerticals);
|
|
125
151
|
const afterFiles = createFileSnapshot(options.targetDir);
|
|
@@ -140,4 +166,4 @@ function generateUltramodernWorkspace(options) {
|
|
|
140
166
|
});
|
|
141
167
|
return result;
|
|
142
168
|
}
|
|
143
|
-
export { generateUltramodernWorkspace, writeApp, writeSharedPackages };
|
|
169
|
+
export { createCompactUltramodernConfig, generateUltramodernWorkspace, writeApp, writeSharedPackages };
|
|
@@ -38,6 +38,16 @@ export declare const EN_LOCALE: {
|
|
|
38
38
|
optionUltramodernPackageRegistry: string;
|
|
39
39
|
optionUltramodernPackageScope: string;
|
|
40
40
|
optionUltramodernPackageNamePrefix: string;
|
|
41
|
+
optionBridge: string;
|
|
42
|
+
optionBridgeParentRoot: string;
|
|
43
|
+
optionBridgeWorkspacePackage: string;
|
|
44
|
+
optionBridgeWorkspacePackageName: string;
|
|
45
|
+
optionBridgeTestAlias: string;
|
|
46
|
+
optionBridgeDependency: string;
|
|
47
|
+
optionBridgeLockfilePolicy: string;
|
|
48
|
+
optionBridgeGate: string;
|
|
49
|
+
optionBridgeGateCwd: string;
|
|
50
|
+
optionBridgeReactSingleton: string;
|
|
41
51
|
optionVertical: string;
|
|
42
52
|
optionVerticalName: string;
|
|
43
53
|
optionDryRun: string;
|
|
@@ -40,6 +40,16 @@ declare const localeKeys: {
|
|
|
40
40
|
optionUltramodernPackageRegistry: string;
|
|
41
41
|
optionUltramodernPackageScope: string;
|
|
42
42
|
optionUltramodernPackageNamePrefix: string;
|
|
43
|
+
optionBridge: string;
|
|
44
|
+
optionBridgeParentRoot: string;
|
|
45
|
+
optionBridgeWorkspacePackage: string;
|
|
46
|
+
optionBridgeWorkspacePackageName: string;
|
|
47
|
+
optionBridgeTestAlias: string;
|
|
48
|
+
optionBridgeDependency: string;
|
|
49
|
+
optionBridgeLockfilePolicy: string;
|
|
50
|
+
optionBridgeGate: string;
|
|
51
|
+
optionBridgeGateCwd: string;
|
|
52
|
+
optionBridgeReactSingleton: string;
|
|
43
53
|
optionVertical: string;
|
|
44
54
|
optionVerticalName: string;
|
|
45
55
|
optionDryRun: string;
|
|
@@ -101,6 +111,16 @@ declare const localeKeys: {
|
|
|
101
111
|
optionUltramodernPackageRegistry: string;
|
|
102
112
|
optionUltramodernPackageScope: string;
|
|
103
113
|
optionUltramodernPackageNamePrefix: string;
|
|
114
|
+
optionBridge: string;
|
|
115
|
+
optionBridgeParentRoot: string;
|
|
116
|
+
optionBridgeWorkspacePackage: string;
|
|
117
|
+
optionBridgeWorkspacePackageName: string;
|
|
118
|
+
optionBridgeTestAlias: string;
|
|
119
|
+
optionBridgeDependency: string;
|
|
120
|
+
optionBridgeLockfilePolicy: string;
|
|
121
|
+
optionBridgeGate: string;
|
|
122
|
+
optionBridgeGateCwd: string;
|
|
123
|
+
optionBridgeReactSingleton: string;
|
|
104
124
|
optionVertical: string;
|
|
105
125
|
optionVerticalName: string;
|
|
106
126
|
optionDryRun: string;
|
|
@@ -38,6 +38,16 @@ export declare const ZH_LOCALE: {
|
|
|
38
38
|
optionUltramodernPackageRegistry: string;
|
|
39
39
|
optionUltramodernPackageScope: string;
|
|
40
40
|
optionUltramodernPackageNamePrefix: string;
|
|
41
|
+
optionBridge: string;
|
|
42
|
+
optionBridgeParentRoot: string;
|
|
43
|
+
optionBridgeWorkspacePackage: string;
|
|
44
|
+
optionBridgeWorkspacePackageName: string;
|
|
45
|
+
optionBridgeTestAlias: string;
|
|
46
|
+
optionBridgeDependency: string;
|
|
47
|
+
optionBridgeLockfilePolicy: string;
|
|
48
|
+
optionBridgeGate: string;
|
|
49
|
+
optionBridgeGateCwd: string;
|
|
50
|
+
optionBridgeReactSingleton: string;
|
|
41
51
|
optionVertical: string;
|
|
42
52
|
optionVerticalName: string;
|
|
43
53
|
optionDryRun: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runUltramodernToolingCli(args: string[], workspaceRoot?: any): Promise<number>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type UltramodernBridgeConfig } from '../ultramodern-workspace/bridge-config';
|
|
2
|
+
import type { ResolvedPackageSource, WorkspaceApp, WorkspaceEffectApi } from '../ultramodern-workspace/types';
|
|
3
|
+
export type UltramodernToolingConfigSource = 'compact' | 'legacy';
|
|
4
|
+
export type UltramodernToolingConfigApp = {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: WorkspaceApp['kind'];
|
|
7
|
+
path: string;
|
|
8
|
+
package?: string;
|
|
9
|
+
packageSuffix?: string;
|
|
10
|
+
displayName?: string;
|
|
11
|
+
domain?: string;
|
|
12
|
+
port?: number;
|
|
13
|
+
portEnv?: string;
|
|
14
|
+
moduleFederation?: {
|
|
15
|
+
role?: 'host' | 'remote';
|
|
16
|
+
name?: string;
|
|
17
|
+
exposes?: string[];
|
|
18
|
+
verticalRefs?: string[];
|
|
19
|
+
hostOnly?: boolean;
|
|
20
|
+
noExposes?: boolean;
|
|
21
|
+
};
|
|
22
|
+
effectApi?: WorkspaceEffectApi;
|
|
23
|
+
};
|
|
24
|
+
export type UltramodernToolingConfig = {
|
|
25
|
+
schemaVersion: number;
|
|
26
|
+
profile?: string;
|
|
27
|
+
source: UltramodernToolingConfigSource;
|
|
28
|
+
sourcePath: string;
|
|
29
|
+
workspace: {
|
|
30
|
+
packageScope: string;
|
|
31
|
+
};
|
|
32
|
+
packageSource?: ResolvedPackageSource;
|
|
33
|
+
features: {
|
|
34
|
+
tailwind: boolean;
|
|
35
|
+
};
|
|
36
|
+
bridge?: UltramodernBridgeConfig;
|
|
37
|
+
topology: {
|
|
38
|
+
apps: UltramodernToolingConfigApp[];
|
|
39
|
+
};
|
|
40
|
+
legacyContract?: Record<string, any>;
|
|
41
|
+
};
|
|
42
|
+
export declare function readUltramodernConfig(workspaceRoot?: any): UltramodernToolingConfig;
|
|
43
|
+
export declare function workspaceAppsFromToolingConfig(config: UltramodernToolingConfig): WorkspaceApp[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UltramodernBridgeConfig } from './bridge-config';
|
|
1
2
|
import type { AddUltramodernVerticalOptions, JsonValue, Ownership, ResolvedPackageSource, UltramodernGenerationResult, UltramodernVerticalPlan, UltramodernWorkspaceOptions, WorkspaceApp } from './types';
|
|
2
3
|
export type AddUltramodernVerticalPreflight = {
|
|
3
4
|
name: string;
|
|
@@ -11,16 +12,18 @@ export type AddUltramodernVerticalPreflight = {
|
|
|
11
12
|
overlay: Record<string, any>;
|
|
12
13
|
packageSource: ResolvedPackageSource;
|
|
13
14
|
enableTailwind: boolean;
|
|
15
|
+
bridge?: UltramodernBridgeConfig;
|
|
14
16
|
vertical: WorkspaceApp;
|
|
15
17
|
updatedVerticals: WorkspaceApp[];
|
|
16
18
|
};
|
|
17
19
|
export declare function existingPackageSource(workspaceRoot: string, modernVersion: string, packageSource?: UltramodernWorkspaceOptions['packageSource']): ResolvedPackageSource;
|
|
18
20
|
export declare function existingTailwindEnabled(workspaceRoot: string): boolean;
|
|
21
|
+
export declare function existingBridgeConfig(workspaceRoot: string): UltramodernBridgeConfig | undefined;
|
|
19
22
|
export declare function assertValidVerticalName(name: string): string;
|
|
20
23
|
export declare function nextAvailablePort(ports: Record<string, unknown>): number;
|
|
21
24
|
export declare function assertCanCreate(workspaceRoot: string, relativePath: string): void;
|
|
22
|
-
export declare function updateRootWorkspaceScripts(workspaceRoot: string, scope: string, packageSource: ResolvedPackageSource, remotes: WorkspaceApp[]): void;
|
|
23
|
-
export declare function rewriteShellAppFiles(workspaceRoot: string, scope: string, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes: WorkspaceApp[]): void;
|
|
25
|
+
export declare function updateRootWorkspaceScripts(workspaceRoot: string, scope: string, packageSource: ResolvedPackageSource, remotes: WorkspaceApp[], bridge?: UltramodernBridgeConfig): void;
|
|
26
|
+
export declare function rewriteShellAppFiles(workspaceRoot: string, scope: string, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes: WorkspaceApp[], bridge?: UltramodernBridgeConfig): void;
|
|
24
27
|
export declare function addShellZephyrDependency(workspaceRoot: string, scope: string, remote: WorkspaceApp): void;
|
|
25
28
|
export declare function addShellWorkspaceDependency(workspaceRoot: string, scope: string, remote: WorkspaceApp): void;
|
|
26
29
|
export declare function verticalTopologyEntry(scope: string, vertical: WorkspaceApp, remotes?: WorkspaceApp[]): JsonValue;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export declare const ultramodernBridgeCliFlags: {
|
|
2
|
+
readonly enabled: '--bridge';
|
|
3
|
+
readonly parentRoot: '--bridge-parent-root';
|
|
4
|
+
readonly workspacePackage: '--bridge-workspace-package';
|
|
5
|
+
readonly workspacePackageName: '--bridge-workspace-package-name';
|
|
6
|
+
readonly testAlias: '--bridge-test-alias';
|
|
7
|
+
readonly dependency: '--bridge-dependency';
|
|
8
|
+
readonly lockfilePolicy: '--bridge-lockfile-policy';
|
|
9
|
+
readonly gate: '--bridge-gate';
|
|
10
|
+
readonly gateCwd: '--bridge-gate-cwd';
|
|
11
|
+
readonly reactSingleton: '--bridge-react-singleton';
|
|
12
|
+
};
|
|
13
|
+
export declare const ultramodernBridgeCliValueFlags: readonly ["--bridge-parent-root", "--bridge-workspace-package", "--bridge-workspace-package-name", "--bridge-test-alias", "--bridge-dependency", "--bridge-lockfile-policy", "--bridge-gate", "--bridge-gate-cwd", "--bridge-react-singleton"];
|
|
14
|
+
export declare const ultramodernBridgeCliBooleanFlags: readonly ["--bridge"];
|
|
15
|
+
export declare const ultramodernBridgeLockfilePolicies: readonly ['nested', 'parent'];
|
|
16
|
+
export type UltramodernBridgeLockfilePolicy = (typeof ultramodernBridgeLockfilePolicies)[number];
|
|
17
|
+
export type UltramodernBridgeTestAlias = {
|
|
18
|
+
alias: string;
|
|
19
|
+
target: string;
|
|
20
|
+
};
|
|
21
|
+
export type UltramodernBridgeWorkspacePackage = {
|
|
22
|
+
pattern: string;
|
|
23
|
+
packageNames?: string[];
|
|
24
|
+
testAliases?: UltramodernBridgeTestAlias[];
|
|
25
|
+
};
|
|
26
|
+
export type UltramodernBridgeGate = {
|
|
27
|
+
name: string;
|
|
28
|
+
command: string;
|
|
29
|
+
cwd?: string;
|
|
30
|
+
};
|
|
31
|
+
export type UltramodernBridgeConfig = {
|
|
32
|
+
enabled: true;
|
|
33
|
+
parentRoot: string;
|
|
34
|
+
workspacePackages: UltramodernBridgeWorkspacePackage[];
|
|
35
|
+
dependencies: string[];
|
|
36
|
+
lockfilePolicy: UltramodernBridgeLockfilePolicy;
|
|
37
|
+
gates: UltramodernBridgeGate[];
|
|
38
|
+
reactSingletons: string[];
|
|
39
|
+
};
|
|
40
|
+
export type UltramodernBridgeWorkspacePackageInput = {
|
|
41
|
+
pattern: string;
|
|
42
|
+
packageNames?: readonly string[];
|
|
43
|
+
testAliases?: readonly UltramodernBridgeTestAlias[];
|
|
44
|
+
};
|
|
45
|
+
export type UltramodernBridgeGateInput = {
|
|
46
|
+
name: string;
|
|
47
|
+
command: string;
|
|
48
|
+
cwd?: string;
|
|
49
|
+
};
|
|
50
|
+
export type UltramodernEnabledBridgeConfigInput = {
|
|
51
|
+
enabled?: true;
|
|
52
|
+
parentRoot: string;
|
|
53
|
+
workspacePackages: readonly UltramodernBridgeWorkspacePackageInput[];
|
|
54
|
+
dependencies: readonly string[];
|
|
55
|
+
lockfilePolicy?: UltramodernBridgeLockfilePolicy;
|
|
56
|
+
gates: readonly UltramodernBridgeGateInput[];
|
|
57
|
+
reactSingletons?: readonly string[];
|
|
58
|
+
};
|
|
59
|
+
export type UltramodernBridgeConfigInput = UltramodernEnabledBridgeConfigInput | {
|
|
60
|
+
enabled: false;
|
|
61
|
+
};
|
|
62
|
+
export declare function hasUltramodernBridgeCliOptions(args: string[]): boolean;
|
|
63
|
+
export declare function parseUltramodernBridgeCliOptions(args: string[]): UltramodernBridgeConfig | undefined;
|
|
64
|
+
export declare function normalizeUltramodernBridgeConfig(bridge: UltramodernBridgeConfigInput | undefined): UltramodernBridgeConfig | undefined;
|
|
@@ -12,6 +12,7 @@ export type UltramodernCodeSmithConfig = {
|
|
|
12
12
|
tailwind?: boolean;
|
|
13
13
|
dryRun?: boolean;
|
|
14
14
|
logResult?: boolean;
|
|
15
|
+
bridge?: UltramodernWorkspaceOptions['bridge'];
|
|
15
16
|
overlays?: UltramodernWorkspaceOptions['overlays'];
|
|
16
17
|
packageSource?: UltramodernWorkspaceOptions['packageSource'];
|
|
17
18
|
packageSourceStrategy?: NonNullable<UltramodernWorkspaceOptions['packageSource']>['strategy'];
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
+
import type { UltramodernBridgeConfig } from './bridge-config';
|
|
1
2
|
import type { JsonValue, ResolvedPackageSource, WorkspaceApp } from './types';
|
|
2
|
-
export declare const baselineAgentSkills: string[];
|
|
3
|
-
export declare const moduleFederationAgentSkills: string[];
|
|
4
|
-
export declare const privateAgentSkills: string[];
|
|
5
3
|
export declare function createTopology(scope: string, remotes?: WorkspaceApp[]): JsonValue;
|
|
6
4
|
export declare function createOwnership(scope: string, remotes?: WorkspaceApp[]): JsonValue;
|
|
7
5
|
export declare function createDevelopmentOverlay(remotes?: WorkspaceApp[]): JsonValue;
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function createAppConfigContract(app: WorkspaceApp): JsonValue;
|
|
10
|
-
export declare function createPerformanceReadinessContract(): JsonValue;
|
|
11
|
-
export declare function cssLayerName(app: WorkspaceApp): string;
|
|
12
|
-
export declare function cssRole(app: WorkspaceApp): string;
|
|
13
|
-
export declare function cssClassPrefix(app: WorkspaceApp): string;
|
|
14
|
-
export declare function createCssDedupeContract(scope: string): JsonValue;
|
|
15
|
-
export declare function createCssSsrContract(app: WorkspaceApp): JsonValue;
|
|
16
|
-
export declare function createAppCssFederationContract(scope: string, app: WorkspaceApp): JsonValue;
|
|
17
|
-
export declare function createCssFederationContract(scope: string): JsonValue;
|
|
18
|
-
export declare function createStylingContract(scope: string, app: WorkspaceApp, enableTailwind: boolean): JsonValue;
|
|
19
|
-
export declare function createAppGeneratedContract(scope: string, app: WorkspaceApp, apps: WorkspaceApp[], enableTailwind: boolean): JsonValue;
|
|
20
|
-
export declare function createGeneratedContract(scope: string, apps?: WorkspaceApp[], enableTailwind?: boolean): JsonValue;
|
|
21
|
-
export declare function createTemplateManifest(modernVersion: string, packageSource: ResolvedPackageSource): JsonValue;
|
|
6
|
+
export declare function createUltramodernConfig(scope: string, modernVersion: string, packageSource: ResolvedPackageSource, apps?: WorkspaceApp[], enableTailwind?: boolean, bridge?: UltramodernBridgeConfig): JsonValue;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Ownership, WorkspaceApp, WorkspaceEffectApi } from './types';
|
|
2
2
|
export declare const GENERATED_CONTRACT_PATH = ".modernjs/ultramodern-generated-contract.json";
|
|
3
|
+
export declare const ULTRAMODERN_CONFIG_PATH = ".modernjs/ultramodern.json";
|
|
3
4
|
export declare const shellApp: WorkspaceApp;
|
|
4
5
|
export declare function createShellHost(remotes?: WorkspaceApp[]): WorkspaceApp;
|
|
5
6
|
export declare const sharedPackages: {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { addUltramodernVertical, planUltramodernVertical, } from './add-vertical';
|
|
2
|
+
export type { UltramodernBridgeConfig, UltramodernBridgeConfigInput, UltramodernBridgeGate, UltramodernBridgeGateInput, UltramodernBridgeLockfilePolicy, UltramodernBridgeTestAlias, UltramodernBridgeWorkspacePackage, UltramodernBridgeWorkspacePackageInput, UltramodernEnabledBridgeConfigInput, } from './bridge-config';
|
|
3
|
+
export { normalizeUltramodernBridgeConfig } from './bridge-config';
|
|
2
4
|
export type { AddUltramodernVerticalOptions, UltramodernCodeSmithOverlay, UltramodernCodeSmithOverlayRuntimeConfig, UltramodernGeneratedAppDescriptor, UltramodernGeneratedContractChange, UltramodernGenerationOperation, UltramodernGenerationResult, UltramodernGenerationWarning, UltramodernJsonMutation, UltramodernShellDependencyChange, UltramodernVerticalPlan, UltramodernWorkspaceOptions, } from './types';
|
|
3
5
|
export { ultramodernWorkspaceVersions } from './versions';
|
|
4
6
|
export { generateUltramodernWorkspace } from './write-workspace';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ModuleFederationConfigInspection = {
|
|
2
|
+
appDir: string;
|
|
3
|
+
configPath: string;
|
|
4
|
+
dts: {
|
|
5
|
+
compilerInstance?: string;
|
|
6
|
+
tsConfigPath?: string;
|
|
7
|
+
};
|
|
8
|
+
exposes: string[];
|
|
9
|
+
hostOnlyNoExposes: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type ModuleFederationDiscoveredConfig = {
|
|
12
|
+
appDir: string;
|
|
13
|
+
configPath: string;
|
|
14
|
+
};
|
|
15
|
+
export type ModuleFederationValidationResult = {
|
|
16
|
+
configCount: number;
|
|
17
|
+
exposedAppCount: number;
|
|
18
|
+
hostOnlyAppCount: number;
|
|
19
|
+
apps: ModuleFederationConfigInspection[];
|
|
20
|
+
};
|
|
21
|
+
export type ModuleFederationValidationOptions = {
|
|
22
|
+
workspaceRoot: string;
|
|
23
|
+
appDirs?: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare function discoverModuleFederationConfigs(options: ModuleFederationValidationOptions): ModuleFederationDiscoveredConfig[];
|
|
26
|
+
export declare function inspectModuleFederationConfigSource(source: string, appDir: string, configPath: string): ModuleFederationConfigInspection;
|
|
27
|
+
export declare function validateModuleFederationTypes(options: ModuleFederationValidationOptions): ModuleFederationValidationResult;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { UltramodernBridgeConfig } from './bridge-config';
|
|
1
2
|
import type { JsonValue, ResolvedPackageSource, WorkspaceApp } from './types';
|
|
2
3
|
export declare const createEffectTsgoTypecheckCommand: (packageDir: string) => string;
|
|
3
4
|
export declare const effectDiagnostics: string[];
|
|
4
|
-
export declare function appDependencies(scope: string, packageSource: ResolvedPackageSource, app: WorkspaceApp, remotes?: WorkspaceApp[]): Record<string, string>;
|
|
5
|
+
export declare function appDependencies(scope: string, packageSource: ResolvedPackageSource, app: WorkspaceApp, remotes?: WorkspaceApp[], bridge?: UltramodernBridgeConfig): Record<string, string>;
|
|
5
6
|
export declare function appDevDependencies(packageSource: ResolvedPackageSource, enableTailwind: boolean): Record<string, string>;
|
|
6
|
-
export declare function createRootPackageJson(scope: string, packageSource: ResolvedPackageSource, remotes?: WorkspaceApp[]): JsonValue;
|
|
7
|
+
export declare function createRootPackageJson(scope: string, packageSource: ResolvedPackageSource, remotes?: WorkspaceApp[], bridge?: UltramodernBridgeConfig): JsonValue;
|
|
7
8
|
export declare function createZephyrDependencies(scope: string, app: WorkspaceApp, remotes?: WorkspaceApp[]): JsonValue;
|
|
8
9
|
export declare function createTsConfigBase(): JsonValue;
|
|
9
10
|
type CreatePackageTsConfigOptions = {
|
|
@@ -16,7 +17,7 @@ export declare function createAppTsConfig(app: WorkspaceApp, remotes?: Workspace
|
|
|
16
17
|
export declare function createAppMfTypesTsConfig(app: WorkspaceApp): JsonValue;
|
|
17
18
|
export declare function createSharedPackageTsConfig(packageDir: string): JsonValue;
|
|
18
19
|
export declare function createRootTsConfig(apps?: WorkspaceApp[]): JsonValue;
|
|
19
|
-
export declare function createAppPackage(scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[]): JsonValue;
|
|
20
|
+
export declare function createAppPackage(scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[], bridge?: UltramodernBridgeConfig): JsonValue;
|
|
20
21
|
export declare function createSharedPackage(scope: string, id: string, description: string): JsonValue;
|
|
21
22
|
export declare function createSharedContractsIndex(): string;
|
|
22
23
|
export {};
|