@bleedingdev/modern-js-create 3.4.0-ultramodern.1 → 3.4.0-ultramodern.3
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/dist/cjs/ultramodern-workspace/add-vertical.cjs +18 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +5 -3
- package/dist/cjs/ultramodern-workspace/demo-components.cjs +9 -18
- package/dist/cjs/ultramodern-workspace/descriptors.cjs +2 -2
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +10 -1
- package/dist/cjs/ultramodern-workspace/package-json.cjs +74 -13
- package/dist/cjs/ultramodern-workspace/versions.cjs +1 -5
- package/dist/cjs/ultramodern-workspace/workspace-scripts.cjs +7 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +3 -7
- package/dist/esm/ultramodern-workspace/add-vertical.js +19 -1
- package/dist/esm/ultramodern-workspace/contracts.js +6 -4
- package/dist/esm/ultramodern-workspace/demo-components.js +9 -18
- package/dist/esm/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm/ultramodern-workspace/module-federation.js +10 -1
- package/dist/esm/ultramodern-workspace/package-json.js +62 -10
- package/dist/esm/ultramodern-workspace/versions.js +2 -3
- package/dist/esm/ultramodern-workspace/workspace-scripts.js +5 -1
- package/dist/esm/ultramodern-workspace/write-workspace.js +5 -9
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +19 -1
- package/dist/esm-node/ultramodern-workspace/contracts.js +6 -4
- package/dist/esm-node/ultramodern-workspace/demo-components.js +9 -18
- package/dist/esm-node/ultramodern-workspace/descriptors.js +2 -2
- package/dist/esm-node/ultramodern-workspace/module-federation.js +10 -1
- package/dist/esm-node/ultramodern-workspace/package-json.js +62 -10
- package/dist/esm-node/ultramodern-workspace/versions.js +2 -3
- package/dist/esm-node/ultramodern-workspace/workspace-scripts.js +5 -1
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +5 -9
- package/dist/types/ultramodern-workspace/package-json.d.ts +11 -2
- package/dist/types/ultramodern-workspace/versions.d.ts +1 -2
- package/dist/types/ultramodern-workspace/workspace-scripts.d.ts +1 -0
- package/package.json +4 -4
- package/template-workspace/AGENTS.md.handlebars +2 -1
- package/template-workspace/README.md.handlebars +7 -0
- package/template-workspace/oxfmt.config.ts +3 -1
- package/template-workspace/oxlint.config.ts +3 -1
- package/template-workspace/pnpm-workspace.yaml.handlebars +8 -0
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +42 -10
- package/templates/app/shell-frame.tsx +1 -2
- package/templates/app/ultramodern-route-head.tsx.handlebars +23 -12
- package/templates/packages/shared-contracts-index.ts +206 -272
- package/templates/workspace-scripts/ultramodern-typecheck.mjs +197 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +166 -2
|
@@ -10,8 +10,7 @@ import { VerticalShowcase } from '../vertical-components';
|
|
|
10
10
|
import { ultramodernUiMarker } from '../../ultramodern-build';
|
|
11
11
|
|
|
12
12
|
export default function ShellHome() {
|
|
13
|
-
const {
|
|
14
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
13
|
+
const { t } = useModernI18n();
|
|
15
14
|
|
|
16
15
|
return (
|
|
17
16
|
<ShellFrame>
|
|
@@ -84,8 +83,7 @@ const loadRemoteComponent = (specifier: string) =>
|
|
|
84
83
|
|
|
85
84
|
const createRemoteFallback = (specifier: string) =>
|
|
86
85
|
({ error }: { error: Error }) => {
|
|
87
|
-
const {
|
|
88
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
86
|
+
const { t } = useModernI18n();
|
|
89
87
|
const classification = classifyModuleFederationFallback(error);
|
|
90
88
|
const telemetry = createModuleFederationFallbackTelemetry({
|
|
91
89
|
appName: '${shellApp.id}',
|
|
@@ -167,8 +165,7 @@ const createHydratedRemote =
|
|
|
167
165
|
${hydratedExports}
|
|
168
166
|
|
|
169
167
|
export const Header = () => {
|
|
170
|
-
const {
|
|
171
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
168
|
+
const { t } = useModernI18n();
|
|
172
169
|
|
|
173
170
|
return (
|
|
174
171
|
<header className="${tw('flex min-w-0 flex-wrap items-center gap-x-8 gap-y-2 md:flex-1')}" data-modern-boundary-id="${shellApp.mfName}" data-modern-mf-expose="shell/Header">
|
|
@@ -178,8 +175,7 @@ const createHydratedRemote =
|
|
|
178
175
|
};
|
|
179
176
|
|
|
180
177
|
export const StatusBadge = () => {
|
|
181
|
-
const {
|
|
182
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
178
|
+
const { t } = useModernI18n();
|
|
183
179
|
|
|
184
180
|
return (
|
|
185
181
|
<span className="${tw('inline-flex h-10 shrink-0 items-center justify-center rounded-full border border-stone-900/15 bg-white px-4 text-sm font-extrabold text-stone-950 shadow-lg shadow-stone-900/5')}">
|
|
@@ -189,8 +185,7 @@ export const StatusBadge = () => {
|
|
|
189
185
|
};
|
|
190
186
|
|
|
191
187
|
export const VerticalShowcase = () => {
|
|
192
|
-
const {
|
|
193
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
188
|
+
const { t } = useModernI18n();
|
|
194
189
|
|
|
195
190
|
if (widgetCount === 0) {
|
|
196
191
|
return (
|
|
@@ -257,8 +252,7 @@ import { ultramodernUiMarker } from '../../ultramodern-build';
|
|
|
257
252
|
` : '';
|
|
258
253
|
return `${effectBffImport}
|
|
259
254
|
export default function ${toPascalCase(app.id)}Home() {
|
|
260
|
-
const {
|
|
261
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
255
|
+
const { language, supportedLanguages, t } = useModernI18n();
|
|
262
256
|
${effectBffState} return (
|
|
263
257
|
<main className="${tw('min-h-screen bg-um-canvas px-4 py-6 text-um-foreground sm:px-8')}">
|
|
264
258
|
<UltramodernRouteHead />
|
|
@@ -304,8 +298,7 @@ function createRemoteEntry(app) {
|
|
|
304
298
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
305
299
|
|
|
306
300
|
export default function ${toPascalCase(domain)}Route() {
|
|
307
|
-
const {
|
|
308
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
301
|
+
const { t } = useModernI18n();
|
|
309
302
|
|
|
310
303
|
return (
|
|
311
304
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="./Route">
|
|
@@ -323,8 +316,7 @@ function createRemoteWidget(app) {
|
|
|
323
316
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
324
317
|
|
|
325
318
|
export default function ${componentName}() {
|
|
326
|
-
const {
|
|
327
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
319
|
+
const { t } = useModernI18n();
|
|
328
320
|
|
|
329
321
|
return (
|
|
330
322
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="./Widget">
|
|
@@ -343,8 +335,7 @@ function createRemoteExposeComponent(app, expose) {
|
|
|
343
335
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
344
336
|
|
|
345
337
|
export default function ${componentName}() {
|
|
346
|
-
const {
|
|
347
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
338
|
+
const { t } = useModernI18n();
|
|
348
339
|
|
|
349
340
|
return (
|
|
350
341
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="${expose}">
|
|
@@ -35,12 +35,12 @@ const sharedPackages = [
|
|
|
35
35
|
{
|
|
36
36
|
id: 'shared-contracts',
|
|
37
37
|
directory: 'packages/shared-contracts',
|
|
38
|
-
description: '
|
|
38
|
+
description: 'Generated route, ownership, and topology contracts.'
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
id: 'shared-design-tokens',
|
|
42
42
|
directory: 'packages/shared-design-tokens',
|
|
43
|
-
description: '
|
|
43
|
+
description: 'Generated design tokens consumed by shell and verticals.'
|
|
44
44
|
}
|
|
45
45
|
];
|
|
46
46
|
function createNeutralOwnership(id, tier = 'tier-2-vertical') {
|
|
@@ -122,7 +122,7 @@ ${bffConfig} ...(cloudflareDeployEnabled
|
|
|
122
122
|
},
|
|
123
123
|
output: {
|
|
124
124
|
assetPrefix,
|
|
125
|
-
disableTsChecker:
|
|
125
|
+
disableTsChecker: false,
|
|
126
126
|
distPath: {
|
|
127
127
|
html: './',
|
|
128
128
|
},
|
|
@@ -178,6 +178,10 @@ ${bffPluginEntry} moduleFederationPlugin(),
|
|
|
178
178
|
},
|
|
179
179
|
},
|
|
180
180
|
source: {
|
|
181
|
+
alias: {
|
|
182
|
+
'@modern-js/plugin-i18n/runtime':
|
|
183
|
+
'@modern-js/plugin-i18n/runtime/no-react-i18next',
|
|
184
|
+
},
|
|
181
185
|
globalVars: {
|
|
182
186
|
ULTRAMODERN_SITE_URL: siteUrl,
|
|
183
187
|
},
|
|
@@ -213,6 +217,11 @@ ${bffPluginEntry} moduleFederationPlugin(),
|
|
|
213
217
|
}
|
|
214
218
|
function createSharedModuleFederationConfig() {
|
|
215
219
|
return ` shared: {
|
|
220
|
+
'@modern-js/plugin-i18n/runtime/no-react-i18next': {
|
|
221
|
+
requiredVersion: pluginI18nVersion,
|
|
222
|
+
singleton: true,
|
|
223
|
+
treeShaking: false,
|
|
224
|
+
},
|
|
216
225
|
'@modern-js/plugin-i18n/runtime': {
|
|
217
226
|
requiredVersion: pluginI18nVersion,
|
|
218
227
|
singleton: true,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WORKSPACE_PACKAGE_VERSION, modernPackageSpecifier } from "../ultramodern-package-source.js";
|
|
2
|
-
import { appHasEffectApi, remoteDependencyAlias, resolveRemoteRefs, shellApp, verticalEffectApps, zephyrRemoteDependency } from "./descriptors.js";
|
|
2
|
+
import { appHasEffectApi, remoteDependencyAlias, resolveRemoteRefs, sharedPackages, shellApp, verticalEffectApps, zephyrRemoteDependency } from "./descriptors.js";
|
|
3
3
|
import { readFileTemplate } from "./fs-io.js";
|
|
4
4
|
import { packageName, relativeRootFor } from "./naming.js";
|
|
5
5
|
import { createPublicSurfaceGenerationCommand } from "./public-surface.js";
|
|
6
6
|
import { EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_NATIVE_PREVIEW_VERSION, TYPESCRIPT_VERSION, TYPES_REACT_DOM_VERSION, TYPES_REACT_VERSION, ULTRACITE_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION } from "./versions.js";
|
|
7
|
-
const
|
|
7
|
+
const createEffectTsgoTypecheckCommand = (packageDir)=>`node ${relativeRootFor(packageDir)}/scripts/ultramodern-typecheck.mjs --project tsconfig.json`;
|
|
8
8
|
const effectDiagnostics = [
|
|
9
9
|
'anyUnknownInErrorContext',
|
|
10
10
|
'classSelfMismatch',
|
|
@@ -150,7 +150,7 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
|
|
|
150
150
|
'format:check': "oxfmt --check . '!repos/**'",
|
|
151
151
|
lint: 'oxlint apps verticals packages',
|
|
152
152
|
'lint:fix': 'oxlint apps verticals packages --fix',
|
|
153
|
-
typecheck:
|
|
153
|
+
typecheck: "node ./scripts/ultramodern-typecheck.mjs --build tsconfig.json",
|
|
154
154
|
'cloudflare:build': `${remoteCloudflareBuildPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm mf:types`,
|
|
155
155
|
'cloudflare:deploy': `${remoteCloudflareDeployPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:deploy`,
|
|
156
156
|
'cloudflare:proof': "node ./scripts/proof-cloudflare-version.mjs --out .codex/reports/cloudflare-version-proof/public-url-proof.json",
|
|
@@ -251,17 +251,69 @@ function createTsConfigBase() {
|
|
|
251
251
|
}
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
const
|
|
254
|
+
function createTsBuildInfoFile(packageDir) {
|
|
255
|
+
const cacheKey = packageDir.replace(/[^a-zA-Z0-9._-]+/gu, '__');
|
|
256
|
+
return `${relativeRootFor(packageDir)}/node_modules/.cache/tsgo/${cacheKey}.tsbuildinfo`;
|
|
257
|
+
}
|
|
258
|
+
function createReferences(packageDir, references) {
|
|
259
|
+
return [
|
|
260
|
+
...new Set(references)
|
|
261
|
+
].filter((reference)=>reference !== packageDir).map((reference)=>({
|
|
262
|
+
path: `${relativeRootFor(packageDir)}/${reference}`
|
|
263
|
+
}));
|
|
264
|
+
}
|
|
265
|
+
function createPackageTsConfig(packageDir, options = {}) {
|
|
266
|
+
const resolvedOptions = 'boolean' == typeof options ? {
|
|
267
|
+
includeApi: options
|
|
268
|
+
} : options;
|
|
269
|
+
const include = resolvedOptions.include ?? [
|
|
256
270
|
'src',
|
|
257
271
|
'modern.config.ts',
|
|
258
272
|
'module-federation.config.ts'
|
|
259
273
|
];
|
|
260
|
-
if (includeApi) include.push('api', 'shared');
|
|
261
|
-
|
|
274
|
+
if (resolvedOptions.includeApi) include.push('api', 'shared');
|
|
275
|
+
const references = createReferences(packageDir, resolvedOptions.references ?? []);
|
|
276
|
+
const tsconfig = {
|
|
262
277
|
extends: `${relativeRootFor(packageDir)}/tsconfig.base.json`,
|
|
278
|
+
compilerOptions: {
|
|
279
|
+
composite: true,
|
|
280
|
+
incremental: true,
|
|
281
|
+
tsBuildInfoFile: createTsBuildInfoFile(packageDir)
|
|
282
|
+
},
|
|
263
283
|
include
|
|
264
284
|
};
|
|
285
|
+
if (references.length > 0) tsconfig.references = references;
|
|
286
|
+
return tsconfig;
|
|
287
|
+
}
|
|
288
|
+
function createAppTsConfig(app, remotes = []) {
|
|
289
|
+
const references = [
|
|
290
|
+
...sharedPackages.map((sharedPackage)=>sharedPackage.directory),
|
|
291
|
+
...'shell' === app.kind ? verticalEffectApps(remotes).map((remote)=>remote.directory) : resolveRemoteRefs(app, remotes).map((remote)=>remote.directory)
|
|
292
|
+
];
|
|
293
|
+
return createPackageTsConfig(app.directory, {
|
|
294
|
+
includeApi: appHasEffectApi(app),
|
|
295
|
+
references
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function createSharedPackageTsConfig(packageDir) {
|
|
299
|
+
return createPackageTsConfig(packageDir, {
|
|
300
|
+
include: [
|
|
301
|
+
'src'
|
|
302
|
+
]
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function createRootTsConfig(apps = []) {
|
|
306
|
+
return {
|
|
307
|
+
files: [],
|
|
308
|
+
references: [
|
|
309
|
+
...sharedPackages.map((sharedPackage)=>({
|
|
310
|
+
path: sharedPackage.directory
|
|
311
|
+
})),
|
|
312
|
+
...apps.map((app)=>({
|
|
313
|
+
path: app.directory
|
|
314
|
+
}))
|
|
315
|
+
]
|
|
316
|
+
};
|
|
265
317
|
}
|
|
266
318
|
function createAppPackage(scope, app, packageSource, enableTailwind, remotes = []) {
|
|
267
319
|
const publicSurfaceBuildCommand = createPublicSurfaceGenerationCommand(app, 'dist');
|
|
@@ -283,7 +335,7 @@ function createAppPackage(scope, app, packageSource, enableTailwind, remotes = [
|
|
|
283
335
|
'cloudflare:preview': 'pnpm run cloudflare:build && wrangler dev --config .output/wrangler.json',
|
|
284
336
|
'cloudflare:proof': `node ${relativeRootFor(app.directory)}/scripts/proof-cloudflare-version.mjs --app ${app.id}`,
|
|
285
337
|
serve: 'modern serve',
|
|
286
|
-
typecheck:
|
|
338
|
+
typecheck: createEffectTsgoTypecheckCommand(app.directory)
|
|
287
339
|
},
|
|
288
340
|
modernjs: {
|
|
289
341
|
preset: 'presetUltramodern',
|
|
@@ -319,7 +371,7 @@ function createSharedPackage(scope, id, description) {
|
|
|
319
371
|
'.': './src/index.ts'
|
|
320
372
|
},
|
|
321
373
|
scripts: {
|
|
322
|
-
typecheck:
|
|
374
|
+
typecheck: createEffectTsgoTypecheckCommand(`packages/${id}`)
|
|
323
375
|
},
|
|
324
376
|
devDependencies: {
|
|
325
377
|
'@effect/tsgo': EFFECT_TSGO_VERSION,
|
|
@@ -335,4 +387,4 @@ function createSharedPackage(scope, id, description) {
|
|
|
335
387
|
function createSharedContractsIndex() {
|
|
336
388
|
return readFileTemplate('packages/shared-contracts-index.ts');
|
|
337
389
|
}
|
|
338
|
-
export { appDependencies, appDevDependencies, createAppPackage, createPackageTsConfig, createRootPackageJson, createSharedContractsIndex, createSharedPackage, createTsConfigBase, createZephyrDependencies, effectDiagnostics
|
|
390
|
+
export { appDependencies, appDevDependencies, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
@@ -9,9 +9,8 @@ const TAILWIND_POSTCSS_VERSION = '4.3.1';
|
|
|
9
9
|
const POSTCSS_VERSION = '8.5.15';
|
|
10
10
|
const EFFECT_TSGO_VERSION = '0.14.6';
|
|
11
11
|
const TYPESCRIPT_STABLE_VERSION = '6.0.3';
|
|
12
|
-
const TYPESCRIPT_7_VERSION = '7.0.1-rc';
|
|
13
|
-
const TYPESCRIPT_VERSION = TYPESCRIPT_STABLE_VERSION;
|
|
14
12
|
const TYPESCRIPT_NATIVE_PREVIEW_VERSION = '7.0.0-dev.20260624.1';
|
|
13
|
+
const TYPESCRIPT_VERSION = TYPESCRIPT_STABLE_VERSION;
|
|
15
14
|
const OXLINT_VERSION = '1.71.0';
|
|
16
15
|
const OXFMT_VERSION = '0.55.0';
|
|
17
16
|
const ULTRACITE_VERSION = '7.8.3';
|
|
@@ -33,4 +32,4 @@ const ultramodernWorkspaceVersions = {
|
|
|
33
32
|
tailwind: TAILWIND_VERSION,
|
|
34
33
|
tailwindPostcss: TAILWIND_POSTCSS_VERSION
|
|
35
34
|
};
|
|
36
|
-
export { CLOUDFLARE_COMPATIBILITY_DATE, EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, NODE_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION,
|
|
35
|
+
export { CLOUDFLARE_COMPATIBILITY_DATE, EFFECT_TSGO_VERSION, I18NEXT_VERSION, LEFTHOOK_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_FETCH_VERSION, NODE_VERSION, OXFMT_VERSION, OXLINT_VERSION, PNPM_VERSION, POSTCSS_VERSION, REACT_DOM_VERSION, REACT_ROUTER_VERSION, REACT_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TAILWIND_POSTCSS_VERSION, TAILWIND_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_NATIVE_PREVIEW_VERSION, TYPESCRIPT_STABLE_VERSION, TYPESCRIPT_VERSION, TYPES_REACT_DOM_VERSION, TYPES_REACT_VERSION, ULTRACITE_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION, ultramodernWorkspaceVersions };
|
|
@@ -79,6 +79,9 @@ function createPerformanceReadinessConfigScript() {
|
|
|
79
79
|
function createPerformanceReadinessScript() {
|
|
80
80
|
return readFileTemplate("workspace-scripts/ultramodern-performance-readiness.mjs");
|
|
81
81
|
}
|
|
82
|
+
function createUltramodernTypecheckScript() {
|
|
83
|
+
return readFileTemplate("workspace-scripts/ultramodern-typecheck.mjs");
|
|
84
|
+
}
|
|
82
85
|
function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remotes = []) {
|
|
83
86
|
writeFileReplacing(targetDir, "scripts/assert-mf-types.mjs", createAssertMfTypesScript(remotes));
|
|
84
87
|
writeFileReplacing(targetDir, "scripts/validate-ultramodern-workspace.mjs", createWorkspaceValidationScript(scope, enableTailwind, remotes));
|
|
@@ -88,5 +91,6 @@ function writeGeneratedWorkspaceScripts(targetDir, scope, enableTailwind, remote
|
|
|
88
91
|
writeFileReplacing(targetDir, "scripts/proof-cloudflare-version.mjs", createCloudflareVersionProofScript());
|
|
89
92
|
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.config.mjs", createPerformanceReadinessConfigScript());
|
|
90
93
|
writeFileReplacing(targetDir, "scripts/ultramodern-performance-readiness.mjs", createPerformanceReadinessScript());
|
|
94
|
+
writeFileReplacing(targetDir, "scripts/ultramodern-typecheck.mjs", createUltramodernTypecheckScript());
|
|
91
95
|
}
|
|
92
|
-
export { createAssertMfTypesScript, createCloudflareProofHelperScript, createCloudflareVersionProofScript, createPerformanceReadinessConfigScript, createPerformanceReadinessScript, createPublicSurfaceAssetsScript, createWorkspaceI18nBoundaryValidationScript, createWorkspaceValidationScript, writeGeneratedWorkspaceScripts };
|
|
96
|
+
export { createAssertMfTypesScript, createCloudflareProofHelperScript, createCloudflareVersionProofScript, createPerformanceReadinessConfigScript, createPerformanceReadinessScript, createPublicSurfaceAssetsScript, createUltramodernTypecheckScript, createWorkspaceI18nBoundaryValidationScript, createWorkspaceValidationScript, writeGeneratedWorkspaceScripts };
|
|
@@ -8,9 +8,9 @@ import { copyRootTemplate, writeFile, writeJson } from "./fs-io.js";
|
|
|
8
8
|
import { createFileSnapshot, createGenerationResult, diffFileSnapshots } from "./generation-result.js";
|
|
9
9
|
import { createAppPublicLocaleMessages } from "./locales.js";
|
|
10
10
|
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule } from "./module-federation.js";
|
|
11
|
-
import { assertUniqueTailwindPrefixes,
|
|
11
|
+
import { assertUniqueTailwindPrefixes, toPackageScope } from "./naming.js";
|
|
12
12
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
13
|
-
import { createAppPackage,
|
|
13
|
+
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase } from "./package-json.js";
|
|
14
14
|
import { resolvePackageSource } from "./package-source.js";
|
|
15
15
|
import { createPublicWebAppArtifacts } from "./public-surface.js";
|
|
16
16
|
import { NODE_FETCH_VERSION, NODE_VERSION, PNPM_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_VERSION } from "./versions.js";
|
|
@@ -22,7 +22,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
22
22
|
writeFile(targetDir, `${resolvedApp.directory}/${relativePath}`, content);
|
|
23
23
|
};
|
|
24
24
|
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
25
|
-
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`,
|
|
25
|
+
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`, createAppTsConfig(resolvedApp, remotes));
|
|
26
26
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
27
27
|
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, createUltramodernBuildModule(scope, resolvedApp));
|
|
28
28
|
writeFile(targetDir, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
@@ -65,12 +65,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
65
65
|
function writeSharedPackages(targetDir, scope) {
|
|
66
66
|
for (const sharedPackage of sharedPackages){
|
|
67
67
|
writeJson(targetDir, `${sharedPackage.directory}/package.json`, createSharedPackage(scope, sharedPackage.id, sharedPackage.description));
|
|
68
|
-
writeJson(targetDir, `${sharedPackage.directory}/tsconfig.json`,
|
|
69
|
-
extends: `${relativeRootFor(sharedPackage.directory)}/tsconfig.base.json`,
|
|
70
|
-
include: [
|
|
71
|
-
'src'
|
|
72
|
-
]
|
|
73
|
-
});
|
|
68
|
+
writeJson(targetDir, `${sharedPackage.directory}/tsconfig.json`, createSharedPackageTsConfig(sharedPackage.directory));
|
|
74
69
|
}
|
|
75
70
|
writeFile(targetDir, 'packages/shared-contracts/src/index.ts', createSharedContractsIndex());
|
|
76
71
|
writeFile(targetDir, 'packages/shared-design-tokens/src/index.ts', `export const sharedDesignTokens = {
|
|
@@ -112,6 +107,7 @@ function generateUltramodernWorkspace(options) {
|
|
|
112
107
|
});
|
|
113
108
|
writeJson(options.targetDir, 'package.json', createRootPackageJson(scope, packageSource, initialVerticals));
|
|
114
109
|
writeJson(options.targetDir, 'tsconfig.base.json', createTsConfigBase());
|
|
110
|
+
writeJson(options.targetDir, 'tsconfig.json', createRootTsConfig(createdApps));
|
|
115
111
|
writeJson(options.targetDir, 'topology/reference-topology.json', createTopology(scope, initialVerticals));
|
|
116
112
|
writeJson(options.targetDir, 'topology/ownership.json', createOwnership(scope, initialVerticals));
|
|
117
113
|
writeJson(options.targetDir, 'topology/local-overlays/development.json', createDevelopmentOverlay(initialVerticals));
|
|
@@ -14,7 +14,7 @@ import { createAppPublicLocaleMessages } from "./locales.js";
|
|
|
14
14
|
import { createShellModuleFederationConfig } from "./module-federation.js";
|
|
15
15
|
import { assertUniqueTailwindPrefixes, normalizePath, packageName, toEnvSegment, toKebabCase, toPackageScope, toPascalCase } from "./naming.js";
|
|
16
16
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
17
|
-
import { createAppPackage, createRootPackageJson } from "./package-json.js";
|
|
17
|
+
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig } from "./package-json.js";
|
|
18
18
|
import { resolvePackageSource } from "./package-source.js";
|
|
19
19
|
import { createCloudflareDeployContract } from "./policy.js";
|
|
20
20
|
import { createPublicWebAppArtifacts, rewriteWorkspaceAssetsForApp } from "./public-surface.js";
|
|
@@ -86,6 +86,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
86
86
|
const shellHost = createShellHost(remotes);
|
|
87
87
|
const publicWeb = createPublicWebAppArtifacts(shellHost);
|
|
88
88
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/package.json`), createAppPackage(scope, shellHost, packageSource, enableTailwind, remotes));
|
|
89
|
+
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.json`), createAppTsConfig(shellHost, remotes));
|
|
89
90
|
writeFileReplacing(workspaceRoot, `${shellApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(shellHost, remotes));
|
|
90
91
|
writeFileReplacing(workspaceRoot, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
91
92
|
writeFileReplacing(workspaceRoot, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
@@ -426,6 +427,16 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
426
427
|
pointer: '/dependencies',
|
|
427
428
|
description: `Wire shell dependencies for ${vertical.id}`
|
|
428
429
|
},
|
|
430
|
+
{
|
|
431
|
+
path: 'tsconfig.json',
|
|
432
|
+
pointer: '/references',
|
|
433
|
+
description: `Add ${vertical.id} to the root TS-Go build graph`
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
path: `${shellApp.directory}/tsconfig.json`,
|
|
437
|
+
pointer: '/references',
|
|
438
|
+
description: `Add ${vertical.id} to the shell TS-Go project references`
|
|
439
|
+
},
|
|
429
440
|
{
|
|
430
441
|
path: GENERATED_CONTRACT_PATH,
|
|
431
442
|
pointer: '/apps',
|
|
@@ -489,6 +500,13 @@ function addUltramodernVertical(options) {
|
|
|
489
500
|
addShellZephyrDependency(options.workspaceRoot, scope, vertical);
|
|
490
501
|
addShellWorkspaceDependency(options.workspaceRoot, scope, vertical);
|
|
491
502
|
updateRootWorkspaceScripts(options.workspaceRoot, scope, packageSource, updatedVerticals);
|
|
503
|
+
writeJsonFile(node_path.join(options.workspaceRoot, 'tsconfig.json'), createRootTsConfig([
|
|
504
|
+
{
|
|
505
|
+
...shellApp,
|
|
506
|
+
verticalRefs: updatedVerticals.map((vertical)=>vertical.id)
|
|
507
|
+
},
|
|
508
|
+
...updatedVerticals
|
|
509
|
+
]));
|
|
492
510
|
const afterFiles = createFileSnapshot(options.workspaceRoot);
|
|
493
511
|
const { createdPaths, rewrittenPaths } = diffFileSnapshots(beforeFiles, afterFiles);
|
|
494
512
|
const result = createGenerationResult({
|
|
@@ -8,7 +8,7 @@ import { createRspackChunkLoadingGlobal, createRspackUniqueName, packageName, ta
|
|
|
8
8
|
import { createCloudflareDeployContract, createCloudflareSecurityContract } from "./policy.js";
|
|
9
9
|
import { createPublicWebAppArtifacts } from "./public-surface.js";
|
|
10
10
|
import { createLocalisedUrlsMap, createPublicRouteMetadata, createRouteOwnedI18nPaths } from "./routes.js";
|
|
11
|
-
import { CLOUDFLARE_COMPATIBILITY_DATE, I18NEXT_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_VERSION, PNPM_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TANSTACK_ROUTER_VERSION,
|
|
11
|
+
import { CLOUDFLARE_COMPATIBILITY_DATE, I18NEXT_VERSION, MODULE_FEDERATION_AGENT_SKILLS_COMMIT, MODULE_FEDERATION_VERSION, NODE_VERSION, PNPM_VERSION, RSTACK_AGENT_SKILLS_COMMIT, TANSTACK_ROUTER_VERSION, TYPESCRIPT_NATIVE_PREVIEW_VERSION, TYPESCRIPT_VERSION, WRANGLER_VERSION, ZEPHYR_AGENT_VERSION, ZEPHYR_RSPACK_PLUGIN_VERSION } from "./versions.js";
|
|
12
12
|
const baselineAgentSkills = [
|
|
13
13
|
'rsbuild-best-practices',
|
|
14
14
|
'rspack-best-practices',
|
|
@@ -186,7 +186,7 @@ function createAppConfigContract(app) {
|
|
|
186
186
|
],
|
|
187
187
|
default: '/'
|
|
188
188
|
},
|
|
189
|
-
disableTsChecker:
|
|
189
|
+
disableTsChecker: false,
|
|
190
190
|
distPath: {
|
|
191
191
|
html: './'
|
|
192
192
|
},
|
|
@@ -598,8 +598,8 @@ function createGeneratedContract(scope, apps = [
|
|
|
598
598
|
toolchain: 'mise'
|
|
599
599
|
},
|
|
600
600
|
versions: {
|
|
601
|
-
typescript:
|
|
602
|
-
|
|
601
|
+
typescript: TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
602
|
+
typescriptCompatibility: TYPESCRIPT_VERSION,
|
|
603
603
|
typescriptNativePreview: TYPESCRIPT_NATIVE_PREVIEW_VERSION,
|
|
604
604
|
moduleFederation: MODULE_FEDERATION_VERSION,
|
|
605
605
|
tanstackRouter: TANSTACK_ROUTER_VERSION,
|
|
@@ -669,6 +669,7 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
669
669
|
'pnpm-workspace.yaml',
|
|
670
670
|
"scripts/**",
|
|
671
671
|
'topology/**',
|
|
672
|
+
'tsconfig.json',
|
|
672
673
|
'tsconfig.base.json'
|
|
673
674
|
],
|
|
674
675
|
deniedPaths: [
|
|
@@ -733,6 +734,7 @@ function createTemplateManifest(modernVersion, packageSource) {
|
|
|
733
734
|
expectedCommands: [
|
|
734
735
|
'mise install',
|
|
735
736
|
'pnpm install',
|
|
737
|
+
'pnpm run typecheck',
|
|
736
738
|
'pnpm run i18n:boundaries',
|
|
737
739
|
'pnpm run contract:check',
|
|
738
740
|
'pnpm run performance:readiness'
|
|
@@ -11,8 +11,7 @@ import { VerticalShowcase } from '../vertical-components';
|
|
|
11
11
|
import { ultramodernUiMarker } from '../../ultramodern-build';
|
|
12
12
|
|
|
13
13
|
export default function ShellHome() {
|
|
14
|
-
const {
|
|
15
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
14
|
+
const { t } = useModernI18n();
|
|
16
15
|
|
|
17
16
|
return (
|
|
18
17
|
<ShellFrame>
|
|
@@ -85,8 +84,7 @@ const loadRemoteComponent = (specifier: string) =>
|
|
|
85
84
|
|
|
86
85
|
const createRemoteFallback = (specifier: string) =>
|
|
87
86
|
({ error }: { error: Error }) => {
|
|
88
|
-
const {
|
|
89
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
87
|
+
const { t } = useModernI18n();
|
|
90
88
|
const classification = classifyModuleFederationFallback(error);
|
|
91
89
|
const telemetry = createModuleFederationFallbackTelemetry({
|
|
92
90
|
appName: '${shellApp.id}',
|
|
@@ -168,8 +166,7 @@ const createHydratedRemote =
|
|
|
168
166
|
${hydratedExports}
|
|
169
167
|
|
|
170
168
|
export const Header = () => {
|
|
171
|
-
const {
|
|
172
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
169
|
+
const { t } = useModernI18n();
|
|
173
170
|
|
|
174
171
|
return (
|
|
175
172
|
<header className="${tw('flex min-w-0 flex-wrap items-center gap-x-8 gap-y-2 md:flex-1')}" data-modern-boundary-id="${shellApp.mfName}" data-modern-mf-expose="shell/Header">
|
|
@@ -179,8 +176,7 @@ const createHydratedRemote =
|
|
|
179
176
|
};
|
|
180
177
|
|
|
181
178
|
export const StatusBadge = () => {
|
|
182
|
-
const {
|
|
183
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
179
|
+
const { t } = useModernI18n();
|
|
184
180
|
|
|
185
181
|
return (
|
|
186
182
|
<span className="${tw('inline-flex h-10 shrink-0 items-center justify-center rounded-full border border-stone-900/15 bg-white px-4 text-sm font-extrabold text-stone-950 shadow-lg shadow-stone-900/5')}">
|
|
@@ -190,8 +186,7 @@ export const StatusBadge = () => {
|
|
|
190
186
|
};
|
|
191
187
|
|
|
192
188
|
export const VerticalShowcase = () => {
|
|
193
|
-
const {
|
|
194
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
189
|
+
const { t } = useModernI18n();
|
|
195
190
|
|
|
196
191
|
if (widgetCount === 0) {
|
|
197
192
|
return (
|
|
@@ -258,8 +253,7 @@ import { ultramodernUiMarker } from '../../ultramodern-build';
|
|
|
258
253
|
` : '';
|
|
259
254
|
return `${effectBffImport}
|
|
260
255
|
export default function ${toPascalCase(app.id)}Home() {
|
|
261
|
-
const {
|
|
262
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
256
|
+
const { language, supportedLanguages, t } = useModernI18n();
|
|
263
257
|
${effectBffState} return (
|
|
264
258
|
<main className="${tw('min-h-screen bg-um-canvas px-4 py-6 text-um-foreground sm:px-8')}">
|
|
265
259
|
<UltramodernRouteHead />
|
|
@@ -305,8 +299,7 @@ function createRemoteEntry(app) {
|
|
|
305
299
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
306
300
|
|
|
307
301
|
export default function ${toPascalCase(domain)}Route() {
|
|
308
|
-
const {
|
|
309
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
302
|
+
const { t } = useModernI18n();
|
|
310
303
|
|
|
311
304
|
return (
|
|
312
305
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="./Route">
|
|
@@ -324,8 +317,7 @@ function createRemoteWidget(app) {
|
|
|
324
317
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
325
318
|
|
|
326
319
|
export default function ${componentName}() {
|
|
327
|
-
const {
|
|
328
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
320
|
+
const { t } = useModernI18n();
|
|
329
321
|
|
|
330
322
|
return (
|
|
331
323
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="./Widget">
|
|
@@ -344,8 +336,7 @@ function createRemoteExposeComponent(app, expose) {
|
|
|
344
336
|
return `import { useModernI18n } from '@modern-js/plugin-i18n/runtime';
|
|
345
337
|
|
|
346
338
|
export default function ${componentName}() {
|
|
347
|
-
const {
|
|
348
|
-
const t = i18nInstance['t'].bind(i18nInstance);
|
|
339
|
+
const { t } = useModernI18n();
|
|
349
340
|
|
|
350
341
|
return (
|
|
351
342
|
<section className="${tw('rounded-2xl bg-white/90 p-5 shadow-xl shadow-stone-900/10')}" data-modern-boundary-id="${app.mfName}" data-modern-mf-expose="${expose}">
|
|
@@ -36,12 +36,12 @@ const sharedPackages = [
|
|
|
36
36
|
{
|
|
37
37
|
id: 'shared-contracts',
|
|
38
38
|
directory: 'packages/shared-contracts',
|
|
39
|
-
description: '
|
|
39
|
+
description: 'Generated route, ownership, and topology contracts.'
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
id: 'shared-design-tokens',
|
|
43
43
|
directory: 'packages/shared-design-tokens',
|
|
44
|
-
description: '
|
|
44
|
+
description: 'Generated design tokens consumed by shell and verticals.'
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
47
|
function createNeutralOwnership(id, tier = 'tier-2-vertical') {
|
|
@@ -123,7 +123,7 @@ ${bffConfig} ...(cloudflareDeployEnabled
|
|
|
123
123
|
},
|
|
124
124
|
output: {
|
|
125
125
|
assetPrefix,
|
|
126
|
-
disableTsChecker:
|
|
126
|
+
disableTsChecker: false,
|
|
127
127
|
distPath: {
|
|
128
128
|
html: './',
|
|
129
129
|
},
|
|
@@ -179,6 +179,10 @@ ${bffPluginEntry} moduleFederationPlugin(),
|
|
|
179
179
|
},
|
|
180
180
|
},
|
|
181
181
|
source: {
|
|
182
|
+
alias: {
|
|
183
|
+
'@modern-js/plugin-i18n/runtime':
|
|
184
|
+
'@modern-js/plugin-i18n/runtime/no-react-i18next',
|
|
185
|
+
},
|
|
182
186
|
globalVars: {
|
|
183
187
|
ULTRAMODERN_SITE_URL: siteUrl,
|
|
184
188
|
},
|
|
@@ -214,6 +218,11 @@ ${bffPluginEntry} moduleFederationPlugin(),
|
|
|
214
218
|
}
|
|
215
219
|
function createSharedModuleFederationConfig() {
|
|
216
220
|
return ` shared: {
|
|
221
|
+
'@modern-js/plugin-i18n/runtime/no-react-i18next': {
|
|
222
|
+
requiredVersion: pluginI18nVersion,
|
|
223
|
+
singleton: true,
|
|
224
|
+
treeShaking: false,
|
|
225
|
+
},
|
|
217
226
|
'@modern-js/plugin-i18n/runtime': {
|
|
218
227
|
requiredVersion: pluginI18nVersion,
|
|
219
228
|
singleton: true,
|