@bleedingdev/modern-js-create 3.4.0-ultramodern.5 → 3.4.0-ultramodern.7
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 +6 -0
- package/dist/cjs/ultramodern-workspace/contracts.cjs +2 -1
- package/dist/cjs/ultramodern-workspace/module-federation.cjs +2 -0
- package/dist/cjs/ultramodern-workspace/package-json.cjs +15 -0
- package/dist/cjs/ultramodern-workspace/write-workspace.cjs +1 -0
- package/dist/esm/ultramodern-workspace/add-vertical.js +7 -1
- package/dist/esm/ultramodern-workspace/contracts.js +2 -1
- package/dist/esm/ultramodern-workspace/module-federation.js +2 -0
- package/dist/esm/ultramodern-workspace/package-json.js +13 -1
- package/dist/esm/ultramodern-workspace/write-workspace.js +2 -1
- package/dist/esm-node/ultramodern-workspace/add-vertical.js +7 -1
- package/dist/esm-node/ultramodern-workspace/contracts.js +2 -1
- package/dist/esm-node/ultramodern-workspace/module-federation.js +2 -0
- package/dist/esm-node/ultramodern-workspace/package-json.js +13 -1
- package/dist/esm-node/ultramodern-workspace/write-workspace.js +2 -1
- package/dist/types/ultramodern-workspace/package-json.d.ts +1 -0
- package/package.json +3 -3
- package/templates/workspace-scripts/assert-mf-types.mjs.handlebars +9 -0
- package/templates/workspace-scripts/validate-ultramodern-workspace.mjs.handlebars +39 -0
|
@@ -144,6 +144,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
144
144
|
const publicWeb = (0, external_public_surface_cjs_namespaceObject.createPublicWebAppArtifacts)(shellHost);
|
|
145
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));
|
|
146
146
|
(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
|
+
(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));
|
|
147
148
|
(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));
|
|
148
149
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
149
150
|
(0, external_fs_io_cjs_namespaceObject.writeFileReplacing)(workspaceRoot, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
@@ -494,6 +495,11 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
494
495
|
pointer: '/references',
|
|
495
496
|
description: `Add ${vertical.id} to the shell TS-Go project references`
|
|
496
497
|
},
|
|
498
|
+
{
|
|
499
|
+
path: `${external_descriptors_cjs_namespaceObject.shellApp.directory}/tsconfig.mf-types.json`,
|
|
500
|
+
pointer: '/include',
|
|
501
|
+
description: 'Keep shell Module Federation DTS compilation scoped'
|
|
502
|
+
},
|
|
497
503
|
{
|
|
498
504
|
path: external_descriptors_cjs_namespaceObject.GENERATED_CONTRACT_PATH,
|
|
499
505
|
pointer: '/apps',
|
|
@@ -595,8 +595,9 @@ function createAppGeneratedContract(scope, app, apps, enableTailwind) {
|
|
|
595
595
|
} : {},
|
|
596
596
|
exposes: Object.keys(app.exposes ?? {}),
|
|
597
597
|
dts: {
|
|
598
|
+
compilerInstance: 'tsgo',
|
|
598
599
|
displayErrorInTerminal: true,
|
|
599
|
-
|
|
600
|
+
tsConfigPath: './tsconfig.mf-types.json'
|
|
600
601
|
},
|
|
601
602
|
browserSafeExposesOnly: true,
|
|
602
603
|
zephyrRspackPlugin: external_versions_cjs_namespaceObject.ZEPHYR_RSPACK_PLUGIN_VERSION
|
|
@@ -407,6 +407,7 @@ const moduleFederationConfig: Parameters<
|
|
|
407
407
|
generateTypes: {
|
|
408
408
|
compilerInstance: 'tsgo',
|
|
409
409
|
},
|
|
410
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
410
411
|
},
|
|
411
412
|
filename: 'remoteEntry.js',
|
|
412
413
|
name: '${external_descriptors_cjs_namespaceObject.shellApp.mfName}',
|
|
@@ -477,6 +478,7 @@ const moduleFederationConfig: Parameters<
|
|
|
477
478
|
generateTypes: {
|
|
478
479
|
compilerInstance: 'tsgo',
|
|
479
480
|
},
|
|
481
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
480
482
|
},
|
|
481
483
|
exposes: ${exposes},
|
|
482
484
|
filename: 'remoteEntry.js',
|
|
@@ -30,6 +30,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
30
30
|
__webpack_require__.d(__webpack_exports__, {
|
|
31
31
|
appDependencies: ()=>appDependencies,
|
|
32
32
|
appDevDependencies: ()=>appDevDependencies,
|
|
33
|
+
createAppMfTypesTsConfig: ()=>createAppMfTypesTsConfig,
|
|
33
34
|
createAppPackage: ()=>createAppPackage,
|
|
34
35
|
createAppTsConfig: ()=>createAppTsConfig,
|
|
35
36
|
createEffectTsgoTypecheckCommand: ()=>createEffectTsgoTypecheckCommand,
|
|
@@ -352,6 +353,18 @@ function createAppTsConfig(app, remotes = []) {
|
|
|
352
353
|
references
|
|
353
354
|
});
|
|
354
355
|
}
|
|
356
|
+
function createAppMfTypesTsConfig(app) {
|
|
357
|
+
const exposedFiles = Object.values(app.exposes ?? {}).map((exposePath)=>exposePath.replace(/^\.\//u, ''));
|
|
358
|
+
return {
|
|
359
|
+
extends: './tsconfig.json',
|
|
360
|
+
include: [
|
|
361
|
+
...new Set([
|
|
362
|
+
...exposedFiles,
|
|
363
|
+
'src/modern-app-env.d.ts'
|
|
364
|
+
])
|
|
365
|
+
]
|
|
366
|
+
};
|
|
367
|
+
}
|
|
355
368
|
function createSharedPackageTsConfig(packageDir) {
|
|
356
369
|
return createPackageTsConfig(packageDir, {
|
|
357
370
|
include: [
|
|
@@ -446,6 +459,7 @@ function createSharedContractsIndex() {
|
|
|
446
459
|
}
|
|
447
460
|
exports.appDependencies = __webpack_exports__.appDependencies;
|
|
448
461
|
exports.appDevDependencies = __webpack_exports__.appDevDependencies;
|
|
462
|
+
exports.createAppMfTypesTsConfig = __webpack_exports__.createAppMfTypesTsConfig;
|
|
449
463
|
exports.createAppPackage = __webpack_exports__.createAppPackage;
|
|
450
464
|
exports.createAppTsConfig = __webpack_exports__.createAppTsConfig;
|
|
451
465
|
exports.createEffectTsgoTypecheckCommand = __webpack_exports__.createEffectTsgoTypecheckCommand;
|
|
@@ -461,6 +475,7 @@ exports.effectDiagnostics = __webpack_exports__.effectDiagnostics;
|
|
|
461
475
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
462
476
|
"appDependencies",
|
|
463
477
|
"appDevDependencies",
|
|
478
|
+
"createAppMfTypesTsConfig",
|
|
464
479
|
"createAppPackage",
|
|
465
480
|
"createAppTsConfig",
|
|
466
481
|
"createEffectTsgoTypecheckCommand",
|
|
@@ -67,6 +67,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
67
67
|
};
|
|
68
68
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/package.json`, (0, external_package_json_cjs_namespaceObject.createAppPackage)(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
69
69
|
(0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/tsconfig.json`, (0, external_package_json_cjs_namespaceObject.createAppTsConfig)(resolvedApp, remotes));
|
|
70
|
+
(0, external_fs_io_cjs_namespaceObject.writeJson)(targetDir, `${resolvedApp.directory}/tsconfig.mf-types.json`, (0, external_package_json_cjs_namespaceObject.createAppMfTypesTsConfig)(resolvedApp));
|
|
70
71
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, (0, external_app_files_cjs_namespaceObject.createAppEnvDts)(resolvedApp, remotes));
|
|
71
72
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, (0, external_module_federation_cjs_namespaceObject.createUltramodernBuildReexportModule)());
|
|
72
73
|
(0, external_fs_io_cjs_namespaceObject.writeFile)(targetDir, `${resolvedApp.directory}/shared/ultramodern-build.ts`, (0, external_module_federation_cjs_namespaceObject.createUltramodernBuildModule)(scope, resolvedApp));
|
|
@@ -13,7 +13,7 @@ import { createAppPublicLocaleMessages } from "./locales.js";
|
|
|
13
13
|
import { createShellModuleFederationConfig } from "./module-federation.js";
|
|
14
14
|
import { assertUniqueTailwindPrefixes, normalizePath, packageName, toEnvSegment, toKebabCase, toPackageScope, toPascalCase } from "./naming.js";
|
|
15
15
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
16
|
-
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig } from "./package-json.js";
|
|
16
|
+
import { createAppMfTypesTsConfig, createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig } from "./package-json.js";
|
|
17
17
|
import { resolvePackageSource } from "./package-source.js";
|
|
18
18
|
import { createCloudflareDeployContract } from "./policy.js";
|
|
19
19
|
import { createPublicWebAppArtifacts, rewriteWorkspaceAssetsForApp } from "./public-surface.js";
|
|
@@ -86,6 +86,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
86
86
|
const publicWeb = createPublicWebAppArtifacts(shellHost);
|
|
87
87
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/package.json`), createAppPackage(scope, shellHost, packageSource, enableTailwind, remotes));
|
|
88
88
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.json`), createAppTsConfig(shellHost, remotes));
|
|
89
|
+
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.mf-types.json`), createAppMfTypesTsConfig(shellHost));
|
|
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);
|
|
@@ -436,6 +437,11 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
436
437
|
pointer: '/references',
|
|
437
438
|
description: `Add ${vertical.id} to the shell TS-Go project references`
|
|
438
439
|
},
|
|
440
|
+
{
|
|
441
|
+
path: `${shellApp.directory}/tsconfig.mf-types.json`,
|
|
442
|
+
pointer: '/include',
|
|
443
|
+
description: 'Keep shell Module Federation DTS compilation scoped'
|
|
444
|
+
},
|
|
439
445
|
{
|
|
440
446
|
path: GENERATED_CONTRACT_PATH,
|
|
441
447
|
pointer: '/apps',
|
|
@@ -544,8 +544,9 @@ function createAppGeneratedContract(scope, app, apps, enableTailwind) {
|
|
|
544
544
|
} : {},
|
|
545
545
|
exposes: Object.keys(app.exposes ?? {}),
|
|
546
546
|
dts: {
|
|
547
|
+
compilerInstance: 'tsgo',
|
|
547
548
|
displayErrorInTerminal: true,
|
|
548
|
-
|
|
549
|
+
tsConfigPath: './tsconfig.mf-types.json'
|
|
549
550
|
},
|
|
550
551
|
browserSafeExposesOnly: true,
|
|
551
552
|
zephyrRspackPlugin: ZEPHYR_RSPACK_PLUGIN_VERSION
|
|
@@ -356,6 +356,7 @@ const moduleFederationConfig: Parameters<
|
|
|
356
356
|
generateTypes: {
|
|
357
357
|
compilerInstance: 'tsgo',
|
|
358
358
|
},
|
|
359
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
359
360
|
},
|
|
360
361
|
filename: 'remoteEntry.js',
|
|
361
362
|
name: '${shellApp.mfName}',
|
|
@@ -426,6 +427,7 @@ const moduleFederationConfig: Parameters<
|
|
|
426
427
|
generateTypes: {
|
|
427
428
|
compilerInstance: 'tsgo',
|
|
428
429
|
},
|
|
430
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
429
431
|
},
|
|
430
432
|
exposes: ${exposes},
|
|
431
433
|
filename: 'remoteEntry.js',
|
|
@@ -307,6 +307,18 @@ function createAppTsConfig(app, remotes = []) {
|
|
|
307
307
|
references
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
+
function createAppMfTypesTsConfig(app) {
|
|
311
|
+
const exposedFiles = Object.values(app.exposes ?? {}).map((exposePath)=>exposePath.replace(/^\.\//u, ''));
|
|
312
|
+
return {
|
|
313
|
+
extends: './tsconfig.json',
|
|
314
|
+
include: [
|
|
315
|
+
...new Set([
|
|
316
|
+
...exposedFiles,
|
|
317
|
+
'src/modern-app-env.d.ts'
|
|
318
|
+
])
|
|
319
|
+
]
|
|
320
|
+
};
|
|
321
|
+
}
|
|
310
322
|
function createSharedPackageTsConfig(packageDir) {
|
|
311
323
|
return createPackageTsConfig(packageDir, {
|
|
312
324
|
include: [
|
|
@@ -399,4 +411,4 @@ function createSharedPackage(scope, id, description) {
|
|
|
399
411
|
function createSharedContractsIndex() {
|
|
400
412
|
return readFileTemplate('packages/shared-contracts-index.ts');
|
|
401
413
|
}
|
|
402
|
-
export { appDependencies, appDevDependencies, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
414
|
+
export { appDependencies, appDevDependencies, createAppMfTypesTsConfig, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
@@ -10,7 +10,7 @@ import { createAppPublicLocaleMessages } from "./locales.js";
|
|
|
10
10
|
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule, createUltramodernBuildReexportModule } from "./module-federation.js";
|
|
11
11
|
import { assertUniqueTailwindPrefixes, toPackageScope } from "./naming.js";
|
|
12
12
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
13
|
-
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase } from "./package-json.js";
|
|
13
|
+
import { createAppMfTypesTsConfig, 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";
|
|
@@ -23,6 +23,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
23
23
|
};
|
|
24
24
|
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
25
25
|
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`, createAppTsConfig(resolvedApp, remotes));
|
|
26
|
+
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.mf-types.json`, createAppMfTypesTsConfig(resolvedApp));
|
|
26
27
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
27
28
|
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, createUltramodernBuildReexportModule());
|
|
28
29
|
writeFile(targetDir, `${resolvedApp.directory}/shared/ultramodern-build.ts`, createUltramodernBuildModule(scope, resolvedApp));
|
|
@@ -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, createAppTsConfig, createRootPackageJson, createRootTsConfig } from "./package-json.js";
|
|
17
|
+
import { createAppMfTypesTsConfig, 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";
|
|
@@ -87,6 +87,7 @@ function rewriteShellAppFiles(workspaceRoot, scope, packageSource, enableTailwin
|
|
|
87
87
|
const publicWeb = createPublicWebAppArtifacts(shellHost);
|
|
88
88
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/package.json`), createAppPackage(scope, shellHost, packageSource, enableTailwind, remotes));
|
|
89
89
|
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.json`), createAppTsConfig(shellHost, remotes));
|
|
90
|
+
writeJsonFile(node_path.join(workspaceRoot, `${shellApp.directory}/tsconfig.mf-types.json`), createAppMfTypesTsConfig(shellHost));
|
|
90
91
|
writeFileReplacing(workspaceRoot, `${shellApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(shellHost, remotes));
|
|
91
92
|
writeFileReplacing(workspaceRoot, publicWeb.jsonLdHelperFile.path, publicWeb.jsonLdHelperFile.content);
|
|
92
93
|
writeFileReplacing(workspaceRoot, publicWeb.routeMetadataFile.path, publicWeb.routeMetadataFile.content);
|
|
@@ -437,6 +438,11 @@ function createDryRunJsonMutations(preflight, manifestUrl) {
|
|
|
437
438
|
pointer: '/references',
|
|
438
439
|
description: `Add ${vertical.id} to the shell TS-Go project references`
|
|
439
440
|
},
|
|
441
|
+
{
|
|
442
|
+
path: `${shellApp.directory}/tsconfig.mf-types.json`,
|
|
443
|
+
pointer: '/include',
|
|
444
|
+
description: 'Keep shell Module Federation DTS compilation scoped'
|
|
445
|
+
},
|
|
440
446
|
{
|
|
441
447
|
path: GENERATED_CONTRACT_PATH,
|
|
442
448
|
pointer: '/apps',
|
|
@@ -545,8 +545,9 @@ function createAppGeneratedContract(scope, app, apps, enableTailwind) {
|
|
|
545
545
|
} : {},
|
|
546
546
|
exposes: Object.keys(app.exposes ?? {}),
|
|
547
547
|
dts: {
|
|
548
|
+
compilerInstance: 'tsgo',
|
|
548
549
|
displayErrorInTerminal: true,
|
|
549
|
-
|
|
550
|
+
tsConfigPath: './tsconfig.mf-types.json'
|
|
550
551
|
},
|
|
551
552
|
browserSafeExposesOnly: true,
|
|
552
553
|
zephyrRspackPlugin: ZEPHYR_RSPACK_PLUGIN_VERSION
|
|
@@ -357,6 +357,7 @@ const moduleFederationConfig: Parameters<
|
|
|
357
357
|
generateTypes: {
|
|
358
358
|
compilerInstance: 'tsgo',
|
|
359
359
|
},
|
|
360
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
360
361
|
},
|
|
361
362
|
filename: 'remoteEntry.js',
|
|
362
363
|
name: '${shellApp.mfName}',
|
|
@@ -427,6 +428,7 @@ const moduleFederationConfig: Parameters<
|
|
|
427
428
|
generateTypes: {
|
|
428
429
|
compilerInstance: 'tsgo',
|
|
429
430
|
},
|
|
431
|
+
tsConfigPath: './tsconfig.mf-types.json',
|
|
430
432
|
},
|
|
431
433
|
exposes: ${exposes},
|
|
432
434
|
filename: 'remoteEntry.js',
|
|
@@ -308,6 +308,18 @@ function createAppTsConfig(app, remotes = []) {
|
|
|
308
308
|
references
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
|
+
function createAppMfTypesTsConfig(app) {
|
|
312
|
+
const exposedFiles = Object.values(app.exposes ?? {}).map((exposePath)=>exposePath.replace(/^\.\//u, ''));
|
|
313
|
+
return {
|
|
314
|
+
extends: './tsconfig.json',
|
|
315
|
+
include: [
|
|
316
|
+
...new Set([
|
|
317
|
+
...exposedFiles,
|
|
318
|
+
'src/modern-app-env.d.ts'
|
|
319
|
+
])
|
|
320
|
+
]
|
|
321
|
+
};
|
|
322
|
+
}
|
|
311
323
|
function createSharedPackageTsConfig(packageDir) {
|
|
312
324
|
return createPackageTsConfig(packageDir, {
|
|
313
325
|
include: [
|
|
@@ -400,4 +412,4 @@ function createSharedPackage(scope, id, description) {
|
|
|
400
412
|
function createSharedContractsIndex() {
|
|
401
413
|
return readFileTemplate('packages/shared-contracts-index.ts');
|
|
402
414
|
}
|
|
403
|
-
export { appDependencies, appDevDependencies, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
415
|
+
export { appDependencies, appDevDependencies, createAppMfTypesTsConfig, createAppPackage, createAppTsConfig, createEffectTsgoTypecheckCommand, createPackageTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase, createZephyrDependencies, effectDiagnostics };
|
|
@@ -11,7 +11,7 @@ import { createAppPublicLocaleMessages } from "./locales.js";
|
|
|
11
11
|
import { createAppModernConfig, createRemoteModuleFederationConfig, createShellModuleFederationConfig, createUltramodernBuildModule, createUltramodernBuildReexportModule } from "./module-federation.js";
|
|
12
12
|
import { assertUniqueTailwindPrefixes, toPackageScope } from "./naming.js";
|
|
13
13
|
import { runCodeSmithOverlays } from "./overlays.js";
|
|
14
|
-
import { createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase } from "./package-json.js";
|
|
14
|
+
import { createAppMfTypesTsConfig, createAppPackage, createAppTsConfig, createRootPackageJson, createRootTsConfig, createSharedContractsIndex, createSharedPackage, createSharedPackageTsConfig, createTsConfigBase } from "./package-json.js";
|
|
15
15
|
import { resolvePackageSource } from "./package-source.js";
|
|
16
16
|
import { createPublicWebAppArtifacts } from "./public-surface.js";
|
|
17
17
|
import { NODE_FETCH_VERSION, NODE_VERSION, PNPM_VERSION, TANSTACK_ROUTER_VERSION, TYPESCRIPT_VERSION } from "./versions.js";
|
|
@@ -24,6 +24,7 @@ function writeApp(targetDir, scope, app, packageSource, enableTailwind, remotes
|
|
|
24
24
|
};
|
|
25
25
|
writeJson(targetDir, `${resolvedApp.directory}/package.json`, createAppPackage(scope, resolvedApp, packageSource, enableTailwind, remotes));
|
|
26
26
|
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.json`, createAppTsConfig(resolvedApp, remotes));
|
|
27
|
+
writeJson(targetDir, `${resolvedApp.directory}/tsconfig.mf-types.json`, createAppMfTypesTsConfig(resolvedApp));
|
|
27
28
|
writeFile(targetDir, `${resolvedApp.directory}/src/modern-app-env.d.ts`, createAppEnvDts(resolvedApp, remotes));
|
|
28
29
|
writeFile(targetDir, `${resolvedApp.directory}/src/ultramodern-build.ts`, createUltramodernBuildReexportModule());
|
|
29
30
|
writeFile(targetDir, `${resolvedApp.directory}/shared/ultramodern-build.ts`, createUltramodernBuildModule(scope, resolvedApp));
|
|
@@ -13,6 +13,7 @@ type CreatePackageTsConfigOptions = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare function createPackageTsConfig(packageDir: string, options?: CreatePackageTsConfigOptions | boolean): JsonValue;
|
|
15
15
|
export declare function createAppTsConfig(app: WorkspaceApp, remotes?: WorkspaceApp[]): JsonValue;
|
|
16
|
+
export declare function createAppMfTypesTsConfig(app: WorkspaceApp): JsonValue;
|
|
16
17
|
export declare function createSharedPackageTsConfig(packageDir: string): JsonValue;
|
|
17
18
|
export declare function createRootTsConfig(apps?: WorkspaceApp[]): JsonValue;
|
|
18
19
|
export declare function createAppPackage(scope: string, app: WorkspaceApp, packageSource: ResolvedPackageSource, enableTailwind: boolean, remotes?: WorkspaceApp[]): JsonValue;
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=20"
|
|
23
23
|
},
|
|
24
|
-
"version": "3.4.0-ultramodern.
|
|
24
|
+
"version": "3.4.0-ultramodern.7",
|
|
25
25
|
"types": "./dist/types/index.d.ts",
|
|
26
26
|
"main": "./dist/esm-node/index.js",
|
|
27
27
|
"bin": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@modern-js/codesmith": "2.6.9",
|
|
78
|
-
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.
|
|
78
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.4.0-ultramodern.7"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@rslib/core": "0.23.0",
|
|
@@ -97,6 +97,6 @@
|
|
|
97
97
|
"test": "rm -rf dist && rslib build -c rslibconfig.mts && rstest --passWithNoTests"
|
|
98
98
|
},
|
|
99
99
|
"ultramodern": {
|
|
100
|
-
"frameworkVersion": "3.4.0-ultramodern.
|
|
100
|
+
"frameworkVersion": "3.4.0-ultramodern.7"
|
|
101
101
|
}
|
|
102
102
|
}
|
|
@@ -48,6 +48,15 @@ for (const appDir of appDirs) {
|
|
|
48
48
|
`Module Federation DTS must use the workspace TypeScript compiler: ${appDir}`,
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
+
if (
|
|
52
|
+
contractEntry &&
|
|
53
|
+
contractEntry.moduleFederation?.dts?.tsConfigPath !==
|
|
54
|
+
'./tsconfig.mf-types.json'
|
|
55
|
+
) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
`Module Federation DTS must use the dedicated public-surface tsconfig: ${appDir}`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
51
60
|
|
|
52
61
|
if (contractEntry && contractEntry.moduleFederation?.exposes?.length === 0) {
|
|
53
62
|
continue;
|
|
@@ -92,6 +92,7 @@ const expectedRemoteSubsetsForRefs = refs =>
|
|
|
92
92
|
const requiredMicroVerticalPaths = vertical => [
|
|
93
93
|
`${vertical.path}/package.json`,
|
|
94
94
|
`${vertical.path}/tsconfig.json`,
|
|
95
|
+
`${vertical.path}/tsconfig.mf-types.json`,
|
|
95
96
|
`${vertical.path}/modern.config.ts`,
|
|
96
97
|
`${vertical.path}/module-federation.config.ts`,
|
|
97
98
|
`${vertical.path}/api/effect/index.ts`,
|
|
@@ -419,6 +420,9 @@ const assertProjectReferenceEmitConfig = (tsConfig, packagePath) => {
|
|
|
419
420
|
const assertTsConfigReferenceGraph = () => {
|
|
420
421
|
const rootTsConfig = readJson('tsconfig.json');
|
|
421
422
|
const shellTsConfig = readJson('apps/shell-super-app/tsconfig.json');
|
|
423
|
+
const shellMfTypesTsConfig = readJson(
|
|
424
|
+
'apps/shell-super-app/tsconfig.mf-types.json',
|
|
425
|
+
);
|
|
422
426
|
const expectedRootReferences = [
|
|
423
427
|
...sharedPackagePaths,
|
|
424
428
|
'apps/shell-super-app',
|
|
@@ -453,6 +457,15 @@ const assertTsConfigReferenceGraph = () => {
|
|
|
453
457
|
shellTsConfig,
|
|
454
458
|
'apps/shell-super-app',
|
|
455
459
|
);
|
|
460
|
+
assertSameJson(
|
|
461
|
+
shellMfTypesTsConfig,
|
|
462
|
+
{
|
|
463
|
+
extends: './tsconfig.json',
|
|
464
|
+
include: ['src/modern-app-env.d.ts'],
|
|
465
|
+
},
|
|
466
|
+
'apps/shell-super-app/tsconfig.mf-types.json',
|
|
467
|
+
'restore the generated shell Module Federation DTS boundary',
|
|
468
|
+
);
|
|
456
469
|
for (const sharedPackagePath of sharedPackagePaths) {
|
|
457
470
|
assertProjectReferenceEmitConfig(
|
|
458
471
|
readJson(`${sharedPackagePath}/tsconfig.json`),
|
|
@@ -462,6 +475,9 @@ const assertTsConfigReferenceGraph = () => {
|
|
|
462
475
|
|
|
463
476
|
for (const vertical of fullStackVerticals) {
|
|
464
477
|
const verticalTsConfig = readJson(`${vertical.path}/tsconfig.json`);
|
|
478
|
+
const verticalMfTypesTsConfig = readJson(
|
|
479
|
+
`${vertical.path}/tsconfig.mf-types.json`,
|
|
480
|
+
);
|
|
465
481
|
const expectedVerticalReferences = [
|
|
466
482
|
...sharedPackagePaths,
|
|
467
483
|
...(vertical.verticalRefs ?? [])
|
|
@@ -478,6 +494,21 @@ const assertTsConfigReferenceGraph = () => {
|
|
|
478
494
|
'restore the generated MicroVertical project-reference graph',
|
|
479
495
|
);
|
|
480
496
|
assertProjectReferenceEmitConfig(verticalTsConfig, vertical.path);
|
|
497
|
+
assertSameJson(
|
|
498
|
+
verticalMfTypesTsConfig,
|
|
499
|
+
{
|
|
500
|
+
extends: './tsconfig.json',
|
|
501
|
+
include: [
|
|
502
|
+
'src/federation-entry.tsx',
|
|
503
|
+
...vertical.componentPaths.map(componentPath =>
|
|
504
|
+
componentPath.replace(`${vertical.path}/`, ''),
|
|
505
|
+
),
|
|
506
|
+
'src/modern-app-env.d.ts',
|
|
507
|
+
],
|
|
508
|
+
},
|
|
509
|
+
`${vertical.path}/tsconfig.mf-types.json`,
|
|
510
|
+
'restore the generated MicroVertical Module Federation DTS boundary',
|
|
511
|
+
);
|
|
481
512
|
}
|
|
482
513
|
};
|
|
483
514
|
const packageJsonFiles = startDir => {
|
|
@@ -759,6 +790,7 @@ const requiredPaths = [
|
|
|
759
790
|
'scripts/ultramodern-typecheck.mjs',
|
|
760
791
|
'apps/shell-super-app/package.json',
|
|
761
792
|
'apps/shell-super-app/tsconfig.json',
|
|
793
|
+
'apps/shell-super-app/tsconfig.mf-types.json',
|
|
762
794
|
'apps/shell-super-app/modern.config.ts',
|
|
763
795
|
'apps/shell-super-app/module-federation.config.ts',
|
|
764
796
|
'apps/shell-super-app/src/modern-app-env.d.ts',
|
|
@@ -966,6 +998,7 @@ assert(generatedContract.performanceReadiness?.optOut?.env === 'ULTRAMODERN_PERF
|
|
|
966
998
|
assert(JSON.stringify(generatedContract.performanceReadiness?.signals?.map(signal => signal.id)) === JSON.stringify(expectedPerformanceReadinessSignals), 'Performance readiness signal ids are incorrect');
|
|
967
999
|
|
|
968
1000
|
const shellModernConfig = readText('apps/shell-super-app/modern.config.ts');
|
|
1001
|
+
const shellModuleFederationConfig = readText('apps/shell-super-app/module-federation.config.ts');
|
|
969
1002
|
const shellRouteHead = readText('apps/shell-super-app/src/routes/ultramodern-route-head.tsx');
|
|
970
1003
|
const shellRouteMetadata = readText('apps/shell-super-app/src/routes/ultramodern-route-metadata.ts');
|
|
971
1004
|
assert(shellRouteMetadata.includes('@generated by @modern-js/create'), 'Shell route metadata compatibility manifest must be marked generated');
|
|
@@ -1017,6 +1050,9 @@ assert(shellContract?.config?.performance?.readinessDiagnostics?.optOut?.env ===
|
|
|
1017
1050
|
assert(JSON.stringify(shellContract?.config?.source?.siteUrl?.envFallbackOrder) === JSON.stringify(['MODERN_PUBLIC_SITE_URL', 'ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP', 'ULTRAMODERN_CLOUDFLARE_WORKERS_DEV_SUBDOMAIN', 'SHELL_SUPER_APP_PORT']), 'Shell site URL env fallback order is incorrect');
|
|
1018
1051
|
assert(shellContract?.config?.rspack?.output?.uniqueName === 'shellSuperApp', 'Shell Rspack uniqueName is incorrect');
|
|
1019
1052
|
assert(shellContract?.config?.rspack?.output?.chunkLoadingGlobal === expectedChunkLoadingGlobal('shellSuperApp'), 'Shell Rspack chunkLoadingGlobal is incorrect');
|
|
1053
|
+
assert(shellContract?.moduleFederation?.dts?.compilerInstance === 'tsgo', 'Shell must keep mandatory DTS compiler');
|
|
1054
|
+
assert(shellContract?.moduleFederation?.dts?.tsConfigPath === './tsconfig.mf-types.json', 'Shell must keep dedicated Module Federation DTS tsconfig');
|
|
1055
|
+
assert(shellModuleFederationConfig.includes("tsConfigPath: './tsconfig.mf-types.json'"), 'Shell Module Federation config must use the dedicated DTS tsconfig');
|
|
1020
1056
|
assert(topology.shell?.cloudflare?.workerName === expectedWorkerName('shell-super-app'), 'Shell topology Cloudflare workerName is incorrect');
|
|
1021
1057
|
assert(shellContract?.styling?.federation?.owner?.id === 'shell-super-app', 'Shell CSS federation owner is missing');
|
|
1022
1058
|
assert(shellContract?.styling?.federation?.role === 'shell-base-overlay', 'Shell must own base and overlay CSS');
|
|
@@ -1051,6 +1087,7 @@ assert(!('effectServices' in topology), 'Default APIs must be vertical-owned, no
|
|
|
1051
1087
|
for (const vertical of fullStackVerticals) {
|
|
1052
1088
|
const packageJson = readJson(`${vertical.path}/package.json`);
|
|
1053
1089
|
const modernConfig = readText(`${vertical.path}/modern.config.ts`);
|
|
1090
|
+
const moduleFederationConfig = readText(`${vertical.path}/module-federation.config.ts`);
|
|
1054
1091
|
const routeHead = readText(`${vertical.path}/src/routes/ultramodern-route-head.tsx`);
|
|
1055
1092
|
const routeMetadata = readText(`${vertical.path}/src/routes/ultramodern-route-metadata.ts`);
|
|
1056
1093
|
assert(routeMetadata.includes('@generated by @modern-js/create'), `${vertical.id} route metadata compatibility manifest must be marked generated`);
|
|
@@ -1115,6 +1152,8 @@ for (const vertical of fullStackVerticals) {
|
|
|
1115
1152
|
assert(contractEntry?.moduleFederation?.name === vertical.mfName, `${vertical.id} MF name is incorrect`);
|
|
1116
1153
|
assert(JSON.stringify(contractEntry?.moduleFederation?.exposes) === JSON.stringify(vertical.exposes), `${vertical.id} MF exposes are incorrect`);
|
|
1117
1154
|
assert(contractEntry?.moduleFederation?.dts?.compilerInstance === 'tsgo', `${vertical.id} must keep mandatory DTS compiler`);
|
|
1155
|
+
assert(contractEntry?.moduleFederation?.dts?.tsConfigPath === './tsconfig.mf-types.json', `${vertical.id} must keep dedicated Module Federation DTS tsconfig`);
|
|
1156
|
+
assert(moduleFederationConfig.includes("tsConfigPath: './tsconfig.mf-types.json'"), `${vertical.id} Module Federation config must use the dedicated DTS tsconfig`);
|
|
1118
1157
|
assert(JSON.stringify(contractEntry?.moduleFederation?.verticalRefs ?? []) === JSON.stringify(vertical.verticalRefs), `${vertical.id} MF verticalRefs are incorrect`);
|
|
1119
1158
|
assert(
|
|
1120
1159
|
JSON.stringify((contractEntry?.moduleFederation?.remotes ?? []).map(remote => remote.id)) ===
|