@bleedingdev/modern-js-create 3.2.0-ultramodern.42 → 3.2.0-ultramodern.44
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/index.js +26 -0
- 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: './',
|
|
@@ -4267,6 +4268,14 @@ function createAppConfigContract(app) {
|
|
|
4267
4268
|
'zephyrRspackPlugin'
|
|
4268
4269
|
],
|
|
4269
4270
|
output: {
|
|
4271
|
+
assetPrefix: {
|
|
4272
|
+
envFallbackOrder: [
|
|
4273
|
+
'MODERN_PUBLIC_SITE_URL',
|
|
4274
|
+
createCloudflarePublicUrlEnv(app),
|
|
4275
|
+
app.portEnv
|
|
4276
|
+
],
|
|
4277
|
+
defaultLocalhostPort: app.port
|
|
4278
|
+
},
|
|
4270
4279
|
disableTsChecker: true,
|
|
4271
4280
|
distPath: {
|
|
4272
4281
|
html: './'
|
|
@@ -5133,6 +5142,10 @@ function joinUrl(baseUrl, routePath) {
|
|
|
5133
5142
|
return new URL(routePath, baseUrl.endsWith('/') ? baseUrl : \`\${baseUrl}/\`);
|
|
5134
5143
|
}
|
|
5135
5144
|
|
|
5145
|
+
function normalizeUrlWithTrailingSlash(url) {
|
|
5146
|
+
return url.endsWith('/') ? url : \`\${url}/\`;
|
|
5147
|
+
}
|
|
5148
|
+
|
|
5136
5149
|
async function fetchText(url) {
|
|
5137
5150
|
const response = await fetch(url);
|
|
5138
5151
|
return {
|
|
@@ -5237,6 +5250,7 @@ async function validateApp(app, publicUrl) {
|
|
|
5237
5250
|
|
|
5238
5251
|
const manifestRoute = routes.mfManifest ?? '/mf-manifest.json';
|
|
5239
5252
|
const manifest = await fetchText(joinUrl(publicUrl, manifestRoute));
|
|
5253
|
+
const manifestJson = parseMaybeJson(manifest.body);
|
|
5240
5254
|
evidence.assertions.push({
|
|
5241
5255
|
type: 'mf-manifest',
|
|
5242
5256
|
route: manifestRoute,
|
|
@@ -5257,6 +5271,18 @@ async function validateApp(app, publicUrl) {
|
|
|
5257
5271
|
manifest.accessControlAllowOrigin === '*',
|
|
5258
5272
|
\`\${app.id} MF manifest is missing Cloudflare CORS headers\`,
|
|
5259
5273
|
);
|
|
5274
|
+
const expectedPublicPath = normalizeUrlWithTrailingSlash(publicUrl);
|
|
5275
|
+
const manifestPublicPath = manifestJson?.metaData?.publicPath;
|
|
5276
|
+
evidence.assertions.push({
|
|
5277
|
+
type: 'mf-manifest-public-path',
|
|
5278
|
+
expected: expectedPublicPath,
|
|
5279
|
+
actual: manifestPublicPath,
|
|
5280
|
+
status: manifestPublicPath === expectedPublicPath ? 'pass' : 'fail',
|
|
5281
|
+
});
|
|
5282
|
+
assert(
|
|
5283
|
+
manifestPublicPath === expectedPublicPath,
|
|
5284
|
+
\`\${app.id} MF manifest publicPath must resolve remote assets from \${expectedPublicPath}\`,
|
|
5285
|
+
);
|
|
5260
5286
|
|
|
5261
5287
|
const localeRoute = routes.locale ?? \`/locales/en/\${app.i18n?.namespace}.json\`;
|
|
5262
5288
|
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.
|
|
24
|
+
"version": "3.2.0-ultramodern.44",
|
|
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.
|
|
44
|
+
"@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.44"
|
|
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.
|
|
57
|
+
"frameworkVersion": "3.2.0-ultramodern.44"
|
|
58
58
|
}
|
|
59
59
|
}
|