@bleedingdev/modern-js-create 3.2.0-ultramodern.43 → 3.2.0-ultramodern.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +40 -0
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1465,6 +1465,7 @@ export default defineConfig(
1465
1465
  presetUltramodern(
1466
1466
  {
1467
1467
  ${bffConfig} output: {
1468
+ assetPrefix: siteUrl,
1468
1469
  disableTsChecker: true,
1469
1470
  distPath: {
1470
1471
  html: './',
@@ -1558,6 +1559,16 @@ ${bffPluginEntry} moduleFederationPlugin(),
1558
1559
  }
1559
1560
  function createSharedModuleFederationConfig() {
1560
1561
  return ` shared: {
1562
+ '@modern-js/plugin-i18n/runtime': {
1563
+ requiredVersion: pluginI18nVersion,
1564
+ singleton: true,
1565
+ treeShaking: false,
1566
+ },
1567
+ '@modern-js/plugin-tanstack/runtime': {
1568
+ requiredVersion: pluginTanstackVersion,
1569
+ singleton: true,
1570
+ treeShaking: false,
1571
+ },
1561
1572
  '@modern-js/runtime': {
1562
1573
  requiredVersion: runtimeVersion,
1563
1574
  singleton: true,
@@ -1619,6 +1630,8 @@ import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
1619
1630
  import { dependencies } from './package.json';
1620
1631
 
1621
1632
  const require = createRequire(import.meta.url);
1633
+ const pluginI18nVersion = (require('@modern-js/plugin-i18n/package.json') as { version: string }).version;
1634
+ const pluginTanstackVersion = (require('@modern-js/plugin-tanstack/package.json') as { version: string }).version;
1622
1635
  const runtimeVersion = (require('@modern-js/runtime/package.json') as { version: string }).version;
1623
1636
  const reactVersion = (require('react/package.json') as { version: string }).version;
1624
1637
  const reactDomVersion = (require('react-dom/package.json') as { version: string }).version;
@@ -1671,6 +1684,8 @@ import { createModuleFederationConfig } from '@module-federation/modern-js-v3';
1671
1684
  import { dependencies } from './package.json';
1672
1685
 
1673
1686
  const require = createRequire(import.meta.url);
1687
+ const pluginI18nVersion = (require('@modern-js/plugin-i18n/package.json') as { version: string }).version;
1688
+ const pluginTanstackVersion = (require('@modern-js/plugin-tanstack/package.json') as { version: string }).version;
1674
1689
  const runtimeVersion = (require('@modern-js/runtime/package.json') as { version: string }).version;
1675
1690
  const reactVersion = (require('react/package.json') as { version: string }).version;
1676
1691
  const reactDomVersion = (require('react-dom/package.json') as { version: string }).version;
@@ -4267,6 +4282,14 @@ function createAppConfigContract(app) {
4267
4282
  'zephyrRspackPlugin'
4268
4283
  ],
4269
4284
  output: {
4285
+ assetPrefix: {
4286
+ envFallbackOrder: [
4287
+ 'MODERN_PUBLIC_SITE_URL',
4288
+ createCloudflarePublicUrlEnv(app),
4289
+ app.portEnv
4290
+ ],
4291
+ defaultLocalhostPort: app.port
4292
+ },
4270
4293
  disableTsChecker: true,
4271
4294
  distPath: {
4272
4295
  html: './'
@@ -5133,6 +5156,10 @@ function joinUrl(baseUrl, routePath) {
5133
5156
  return new URL(routePath, baseUrl.endsWith('/') ? baseUrl : \`\${baseUrl}/\`);
5134
5157
  }
5135
5158
 
5159
+ function normalizeUrlWithTrailingSlash(url) {
5160
+ return url.endsWith('/') ? url : \`\${url}/\`;
5161
+ }
5162
+
5136
5163
  async function fetchText(url) {
5137
5164
  const response = await fetch(url);
5138
5165
  return {
@@ -5237,6 +5264,7 @@ async function validateApp(app, publicUrl) {
5237
5264
 
5238
5265
  const manifestRoute = routes.mfManifest ?? '/mf-manifest.json';
5239
5266
  const manifest = await fetchText(joinUrl(publicUrl, manifestRoute));
5267
+ const manifestJson = parseMaybeJson(manifest.body);
5240
5268
  evidence.assertions.push({
5241
5269
  type: 'mf-manifest',
5242
5270
  route: manifestRoute,
@@ -5257,6 +5285,18 @@ async function validateApp(app, publicUrl) {
5257
5285
  manifest.accessControlAllowOrigin === '*',
5258
5286
  \`\${app.id} MF manifest is missing Cloudflare CORS headers\`,
5259
5287
  );
5288
+ const expectedPublicPath = normalizeUrlWithTrailingSlash(publicUrl);
5289
+ const manifestPublicPath = manifestJson?.metaData?.publicPath;
5290
+ evidence.assertions.push({
5291
+ type: 'mf-manifest-public-path',
5292
+ expected: expectedPublicPath,
5293
+ actual: manifestPublicPath,
5294
+ status: manifestPublicPath === expectedPublicPath ? 'pass' : 'fail',
5295
+ });
5296
+ assert(
5297
+ manifestPublicPath === expectedPublicPath,
5298
+ \`\${app.id} MF manifest publicPath must resolve remote assets from \${expectedPublicPath}\`,
5299
+ );
5260
5300
 
5261
5301
  const localeRoute = routes.locale ?? \`/locales/en/\${app.i18n?.namespace}.json\`;
5262
5302
  const locale = await fetchText(joinUrl(publicUrl, localeRoute));
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.2.0-ultramodern.43",
24
+ "version": "3.2.0-ultramodern.45",
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "main": "./dist/index.js",
27
27
  "bin": {
@@ -41,7 +41,7 @@
41
41
  "@types/node": "^25.9.1",
42
42
  "@typescript/native-preview": "7.0.0-dev.20260527.2",
43
43
  "tsx": "^4.22.3",
44
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.43"
44
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.45"
45
45
  },
46
46
  "publishConfig": {
47
47
  "registry": "https://registry.npmjs.org/",
@@ -54,6 +54,6 @@
54
54
  "start": "node ./dist/index.js"
55
55
  },
56
56
  "ultramodern": {
57
- "frameworkVersion": "3.2.0-ultramodern.43"
57
+ "frameworkVersion": "3.2.0-ultramodern.45"
58
58
  }
59
59
  }