@bleedingdev/modern-js-create 3.2.0-ultramodern.80 → 3.2.0-ultramodern.81

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 +54 -66
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -984,8 +984,8 @@ function createRootPackageJson(scope, packageSource, remotes = []) {
984
984
  build: `${remoteBuildPrefix}ULTRAMODERN_ZEPHYR=false pnpm --filter "./apps/shell-super-app" run build && pnpm ultramodern:assert-mf-types`,
985
985
  format: "oxfmt . '!repos/**'",
986
986
  'format:check': "oxfmt --check . '!repos/**'",
987
- lint: 'oxlint .',
988
- 'lint:fix': 'oxlint . --fix',
987
+ lint: 'oxlint apps verticals packages',
988
+ 'lint:fix': 'oxlint apps verticals packages --fix',
989
989
  typecheck: `pnpm -r --filter "@${scope}/*" typecheck`,
990
990
  'cloudflare:build': `${remoteCloudflareBuildPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:build && pnpm ultramodern:assert-mf-types`,
991
991
  'cloudflare:deploy': `${remoteCloudflareDeployPrefix}pnpm --filter "./apps/shell-super-app" run cloudflare:deploy`,
@@ -1309,7 +1309,10 @@ if (
1309
1309
  export default defineConfig(
1310
1310
  presetUltramodern(
1311
1311
  {
1312
- ${bffConfig} output: {
1312
+ ${bffConfig} html: {
1313
+ outputStructure: 'flat',
1314
+ },
1315
+ output: {
1313
1316
  assetPrefix: siteUrl,
1314
1317
  disableTsChecker: true,
1315
1318
  distPath: {
@@ -1320,13 +1323,10 @@ ${bffConfig} output: {
1320
1323
  },
1321
1324
  performance: {
1322
1325
  rsdoctor: {
1323
- enabled: process.env['ULTRAMODERN_RSDOCTOR'] === 'true',
1324
1326
  disableClientServer: true,
1327
+ enabled: process.env['ULTRAMODERN_RSDOCTOR'] === 'true',
1325
1328
  },
1326
1329
  },
1327
- html: {
1328
- outputStructure: 'flat',
1329
- },
1330
1330
  plugins: [
1331
1331
  appTools(),
1332
1332
  tanstackRouterPlugin(),
@@ -1335,12 +1335,8 @@ ${bffConfig} output: {
1335
1335
  enabled: true,
1336
1336
  loadPath: '/locales/{{lng}}/{{ns}}.json',
1337
1337
  },
1338
- reactI18next: false,
1339
1338
  localeDetection: {
1340
1339
  fallbackLanguage: 'en',
1341
- languages: ['en', 'cs'],
1342
- localePathRedirect: true,
1343
- localisedUrls: ultramodernLocalisedUrls as Record<string, Record<string, string>>,
1344
1340
  ignoreRedirectRoutes: [
1345
1341
  '/@mf-types',
1346
1342
  '/assets',
@@ -1353,7 +1349,11 @@ ${bffConfig} output: {
1353
1349
  '/static',
1354
1350
  '/zephyr-manifest.json',
1355
1351
  ],
1352
+ languages: ['en', 'cs'],
1353
+ localePathRedirect: true,
1354
+ localisedUrls: ultramodernLocalisedUrls as Record<string, Record<string, string>>,
1356
1355
  },
1356
+ reactI18next: false,
1357
1357
  }),
1358
1358
  ${bffPluginEntry} moduleFederationPlugin(),
1359
1359
  zephyrRspackPlugin(),
@@ -1389,10 +1389,10 @@ ${bffPluginEntry} moduleFederationPlugin(),
1389
1389
  },
1390
1390
  },
1391
1391
  source: {
1392
- mainEntryName: 'index',
1393
1392
  globalVars: {
1394
1393
  ULTRAMODERN_SITE_URL: siteUrl,
1395
1394
  },
1395
+ mainEntryName: 'index',
1396
1396
  },
1397
1397
  },
1398
1398
  {
@@ -1464,13 +1464,13 @@ const cloudflareWorkersDevSubdomain =
1464
1464
  const requireCloudflarePublicUrls =
1465
1465
  process.env['ULTRAMODERN_CLOUDFLARE_REQUIRE_PUBLIC_URLS'] === 'true';
1466
1466
 
1467
- function createRemoteManifestUrl(options: {
1467
+ const createRemoteManifestUrl = (options: {
1468
1468
  manifestEnv: string;
1469
- publicUrlEnv: string;
1470
- workerName: string;
1471
1469
  mfName: string;
1472
1470
  port: number;
1473
- }) {
1471
+ publicUrlEnv: string;
1472
+ workerName: string;
1473
+ }) => {
1474
1474
  const configuredManifest = process.env[options.manifestEnv]?.trim();
1475
1475
  if (configuredManifest !== undefined && configuredManifest.length > 0) {
1476
1476
  return configuredManifest;
@@ -1492,7 +1492,7 @@ function createRemoteManifestUrl(options: {
1492
1492
  }
1493
1493
 
1494
1494
  return \`\${options.mfName}@http://localhost:\${options.port}/mf-manifest.json\`;
1495
- }
1495
+ };
1496
1496
 
1497
1497
  `;
1498
1498
  }
@@ -1501,10 +1501,10 @@ function createModuleFederationRemotesConfig(scope, app, remotes = []) {
1501
1501
  const key = remoteDependencyAlias(remote);
1502
1502
  return ` ${key}: createRemoteManifestUrl({
1503
1503
  manifestEnv: '${createRemoteManifestEnv(remote)}',
1504
- publicUrlEnv: '${createCloudflarePublicUrlEnv(remote)}',
1505
- workerName: '${createCloudflareWorkerName(scope, remote)}',
1506
1504
  mfName: '${remote.mfName}',
1507
1505
  port: ${remote.port},
1506
+ publicUrlEnv: '${createCloudflarePublicUrlEnv(remote)}',
1507
+ workerName: '${createCloudflareWorkerName(scope, remote)}',
1508
1508
  }),`;
1509
1509
  }).join('\n');
1510
1510
  if (!remoteEntries) return '';
@@ -1532,7 +1532,6 @@ const reactDomVersion = (require('react-dom/package.json') as { version: string
1532
1532
 
1533
1533
  ${createModuleFederationRemoteUrlHelpers(shellHost, remotes)}
1534
1534
  export default createModuleFederationConfig({
1535
- treeShakingSharedExcludePlugins: ['RspackModuleFederationPlugin'],
1536
1535
  dev: {
1537
1536
  disableDynamicRemoteTypeHints: true,
1538
1537
  },
@@ -1545,6 +1544,7 @@ export default createModuleFederationConfig({
1545
1544
  filename: 'remoteEntry.js',
1546
1545
  name: '${shellApp.mfName}',
1547
1546
  ${createModuleFederationRemotesConfig(scope, shellHost, remotes)}${createSharedModuleFederationConfig()},
1547
+ treeShakingSharedExcludePlugins: ['RspackModuleFederationPlugin'],
1548
1548
  });
1549
1549
  `;
1550
1550
  }
@@ -1587,7 +1587,6 @@ const reactDomVersion = (require('react-dom/package.json') as { version: string
1587
1587
 
1588
1588
  ${createModuleFederationRemoteUrlHelpers(app, remotes)}
1589
1589
  export default createModuleFederationConfig({
1590
- treeShakingSharedExcludePlugins: ['RspackModuleFederationPlugin'],
1591
1590
  dev: {
1592
1591
  disableDynamicRemoteTypeHints: true,
1593
1592
  },
@@ -1601,6 +1600,7 @@ export default createModuleFederationConfig({
1601
1600
  filename: 'remoteEntry.js',
1602
1601
  name: '${app.mfName}',
1603
1602
  ${createModuleFederationRemotesConfig(scope, app, remotes)}${createSharedModuleFederationConfig()},
1603
+ treeShakingSharedExcludePlugins: ['RspackModuleFederationPlugin'],
1604
1604
  });
1605
1605
  `;
1606
1606
  }
@@ -1963,7 +1963,7 @@ function createTw(prefix) {
1963
1963
  function workspaceAssetsForApp(_app) {
1964
1964
  return {};
1965
1965
  }
1966
- function createLocalizedHeadComponent(includeLocationSuffix = true) {
1966
+ function createLocalizedHeadComponent() {
1967
1967
  return `const fallbackLanguage = 'en';
1968
1968
  const supportedLanguages = ['en', 'cs'] as const;
1969
1969
  type SupportedLanguage = (typeof supportedLanguages)[number];
@@ -2078,23 +2078,6 @@ const absoluteUrl = (pathname: string) => {
2078
2078
  return \`\${origin}\${pathname}\`;
2079
2079
  };
2080
2080
 
2081
- ${includeLocationSuffix ? `const locationSuffix = (location: {
2082
- hash?: unknown;
2083
- search?: unknown;
2084
- searchStr?: unknown;
2085
- }) => {
2086
- let locationSearch = '';
2087
- if (typeof location.searchStr === 'string') {
2088
- locationSearch = location.searchStr;
2089
- } else if (typeof location.search === 'string') {
2090
- locationSearch = location.search;
2091
- }
2092
- const locationHash = typeof location.hash === 'string' ? location.hash : '';
2093
-
2094
- return \`\${locationSearch}\${locationHash}\`;
2095
- };
2096
- ` : ''}
2097
-
2098
2081
  const LocalizedHead = () => {
2099
2082
  const location = useLocation();
2100
2083
  const canonicalPath = localizedPath(location.pathname, fallbackLanguage);
@@ -2131,7 +2114,7 @@ import { VerticalShowcase } from '../vertical-components';
2131
2114
  import { ultramodernLocalisedUrls } from '../ultramodern-route-metadata';
2132
2115
  import { ultramodernUiMarker } from '../../ultramodern-build';
2133
2116
 
2134
- ${createLocalizedHeadComponent(false)}
2117
+ ${createLocalizedHeadComponent()}
2135
2118
  export default function ShellHome() {
2136
2119
  const { i18nInstance } = useModernI18n();
2137
2120
  const t = i18nInstance['t'].bind(i18nInstance);
@@ -3321,11 +3304,11 @@ function createEffectSharedApiContract(service) {
3321
3304
  const apiPrefix = effectApiPrefix(service);
3322
3305
  return `export const ${markerSchemaExport} = Schema.Struct({
3323
3306
  appId: Schema.String,
3324
- packageName: Schema.String,
3325
- version: Schema.String,
3326
3307
  build: Schema.String,
3327
3308
  deployProfile: Schema.String,
3309
+ packageName: Schema.String,
3328
3310
  surface: Schema.String,
3311
+ version: Schema.String,
3329
3312
  });
3330
3313
 
3331
3314
  export const ${schemaExport} = Schema.Struct({
@@ -3361,13 +3344,13 @@ export const ${notFoundSchemaExport} = ${notFoundErrorExport}.pipe(
3361
3344
  HttpApiSchema.status(404),
3362
3345
  );
3363
3346
 
3364
- export type OperationContext = {
3347
+ export interface OperationContext {
3348
+ method: string;
3365
3349
  operationId: string;
3366
3350
  routePath: string;
3367
- method: string;
3368
3351
  source: string;
3369
3352
  traceId?: string;
3370
- };
3353
+ }
3371
3354
 
3372
3355
  export const ${apiExport} = HttpApi.make('${apiName}').add(
3373
3356
  HttpApiGroup.make('${groupName}')
@@ -3388,11 +3371,11 @@ export const ${apiExport} = HttpApi.make('${apiName}').add(
3388
3371
  )
3389
3372
  .add(
3390
3373
  HttpApiEndpoint.get('get', '/effect/${stem}/:id', {
3374
+ error: ${notFoundSchemaExport},
3391
3375
  params: {
3392
3376
  id: Schema.String,
3393
3377
  },
3394
3378
  success: ${schemaExport},
3395
- error: ${notFoundSchemaExport},
3396
3379
  }),
3397
3380
  )
3398
3381
  .add(
@@ -3406,28 +3389,28 @@ export const ${apiExport} = HttpApi.make('${apiName}').add(
3406
3389
  );
3407
3390
 
3408
3391
  export const ${groupName}OperationContexts = {
3409
- list: {
3410
- operationId: '${apiName}:${groupName}:list',
3392
+ create: {
3393
+ method: 'POST',
3394
+ operationId: '${apiName}:${groupName}:create',
3411
3395
  routePath: '/effect/${stem}',
3412
- method: 'GET',
3413
- source: 'generated-client',
3414
- },
3415
- readiness: {
3416
- operationId: '${apiName}:${groupName}:readiness',
3417
- routePath: '/effect/${stem}/readiness',
3418
- method: 'GET',
3419
3396
  source: 'generated-client',
3420
3397
  },
3421
3398
  get: {
3399
+ method: 'GET',
3422
3400
  operationId: '${apiName}:${groupName}:get',
3423
3401
  routePath: '/effect/${stem}/:id',
3424
- method: 'GET',
3425
3402
  source: 'generated-client',
3426
3403
  },
3427
- create: {
3428
- operationId: '${apiName}:${groupName}:create',
3404
+ list: {
3405
+ method: 'GET',
3406
+ operationId: '${apiName}:${groupName}:list',
3429
3407
  routePath: '/effect/${stem}',
3430
- method: 'POST',
3408
+ source: 'generated-client',
3409
+ },
3410
+ readiness: {
3411
+ method: 'GET',
3412
+ operationId: '${apiName}:${groupName}:readiness',
3413
+ routePath: '/effect/${stem}/readiness',
3431
3414
  source: 'generated-client',
3432
3415
  },
3433
3416
  } satisfies Record<string, OperationContext>;
@@ -3464,8 +3447,8 @@ import {
3464
3447
  ${apiExport},
3465
3448
  ${groupName}OperationContexts,
3466
3449
  ${notFoundErrorExport},
3467
- type OperationContext,
3468
3450
  } from '${contractImportPath}';
3451
+ import type { OperationContext } from '${contractImportPath}';
3469
3452
 
3470
3453
  const ${groupName}Items = [
3471
3454
  {
@@ -3522,10 +3505,15 @@ const ${groupName}Layer = HttpApiBuilder.group(
3522
3505
  ),
3523
3506
  )
3524
3507
  .handle('get', ({ params }) => {
3525
- const item = ${groupName}Items.find(item => item.id === params.id);
3526
- return (item !== undefined
3527
- ? Effect.succeed(item)
3528
- : Effect.fail(new ${notFoundErrorExport}({ id: params.id }))).pipe(
3508
+ const matchedItem = ${groupName}Items.find(
3509
+ candidate => candidate.id === params.id,
3510
+ );
3511
+ const result =
3512
+ matchedItem === undefined
3513
+ ? Effect.fail(new ${notFoundErrorExport}({ id: params.id }))
3514
+ : Effect.succeed(matchedItem);
3515
+
3516
+ return result.pipe(
3529
3517
  Effect.withSpan('ultramodern.effect.${groupName}.get', {
3530
3518
  attributes: operationAttributes(${groupName}OperationContexts.get),
3531
3519
  kind: 'server',
@@ -3537,8 +3525,8 @@ const ${groupName}Layer = HttpApiBuilder.group(
3537
3525
  item: {
3538
3526
  id: \`generated-${stem}-\${payload.title
3539
3527
  .toLowerCase()
3540
- .replaceAll(/[^a-z0-9]+/g, '-')
3541
- .replaceAll(/^-|-$/g, '')}\`,
3528
+ .replaceAll(/[^a-z0-9]+/gu, '-')
3529
+ .replaceAll(/^-|-$/gu, '')}\`,
3542
3530
  marker: ultramodernApiMarker,
3543
3531
  title: payload.title,
3544
3532
  },
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.2.0-ultramodern.80",
24
+ "version": "3.2.0-ultramodern.81",
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.80"
44
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.2.0-ultramodern.81"
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.80"
57
+ "frameworkVersion": "3.2.0-ultramodern.81"
58
58
  }
59
59
  }