@bleedingdev/modern-js-create 3.5.0-ultramodern.17 → 3.5.0-ultramodern.19

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.
@@ -238,6 +238,8 @@ const strictEffectPackageVersionPolicyExclusions = [
238
238
  ];
239
239
  const moduleFederationModernJsPatchPath = `patches/@module-federation__modern-js-v3@${versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION}.patch`;
240
240
  const moduleFederationModernJsPatchSourcePath = external_node_path_default().join(createPackageRoot, 'template-workspace', moduleFederationModernJsPatchPath);
241
+ const moduleFederationBridgeReactPatchPath = `patches/@module-federation__bridge-react@${versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION}.patch`;
242
+ const moduleFederationBridgeReactPatchSourcePath = external_node_path_default().join(createPackageRoot, 'template-workspace', moduleFederationBridgeReactPatchPath);
241
243
  const effectDeclarationPatchPath = 'patches/effect-schema-error-type-id.patch';
242
244
  const effectDeclarationPatchSourcePath = external_node_path_default().join(createPackageRoot, 'template-workspace', effectDeclarationPatchPath);
243
245
  const drizzleOrmDeclarationPatchPath = 'patches/drizzle-orm-ts7-strict-declarations.patch';
@@ -484,6 +486,7 @@ function workspaceUsesDependency(workspaceRoot, packageName) {
484
486
  function ensureGeneratedDeclarationPatches(workspaceRoot, options) {
485
487
  let changed = false;
486
488
  changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationModernJsPatchPath, moduleFederationModernJsPatchSourcePath) || changed;
489
+ changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationBridgeReactPatchPath, moduleFederationBridgeReactPatchSourcePath) || changed;
487
490
  changed = ensureGeneratedPatchFile(workspaceRoot, effectDeclarationPatchPath, effectDeclarationPatchSourcePath) || changed;
488
491
  changed = options.includeDrizzleOrmPatch ? ensureGeneratedPatchFile(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed : removeGeneratedPatchFileIfUnchanged(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed;
489
492
  return changed;
@@ -534,6 +537,9 @@ function updateGeneratedPnpmWorkspacePolicy(workspaceRoot) {
534
537
  const moduleFederationModernJsPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/modern-js-v3@${versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION}`, moduleFederationModernJsPatchPath);
535
538
  source = moduleFederationModernJsPatch.source;
536
539
  changed = moduleFederationModernJsPatch.changed || changed;
540
+ const moduleFederationBridgeReactPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/bridge-react@${versions_cjs_namespaceObject.MODULE_FEDERATION_VERSION}`, moduleFederationBridgeReactPatchPath);
541
+ source = moduleFederationBridgeReactPatch.source;
542
+ changed = moduleFederationBridgeReactPatch.changed || changed;
537
543
  const drizzleOrmPatch = usesDrizzleOrm ? ensureYamlMapEntry(source, 'patchedDependencies', `drizzle-orm@${versions_cjs_namespaceObject.DRIZZLE_ORM_VERSION}`, drizzleOrmDeclarationPatchPath) : removeYamlMapEntry(source, `drizzle-orm@${versions_cjs_namespaceObject.DRIZZLE_ORM_VERSION}`);
538
544
  source = drizzleOrmPatch.source;
539
545
  changed = drizzleOrmPatch.changed || changed;
@@ -191,6 +191,8 @@ const strictEffectPackageVersionPolicyExclusions = [
191
191
  ];
192
192
  const moduleFederationModernJsPatchPath = `patches/@module-federation__modern-js-v3@${MODULE_FEDERATION_VERSION}.patch`;
193
193
  const moduleFederationModernJsPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationModernJsPatchPath);
194
+ const moduleFederationBridgeReactPatchPath = `patches/@module-federation__bridge-react@${MODULE_FEDERATION_VERSION}.patch`;
195
+ const moduleFederationBridgeReactPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationBridgeReactPatchPath);
194
196
  const effectDeclarationPatchPath = 'patches/effect-schema-error-type-id.patch';
195
197
  const effectDeclarationPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', effectDeclarationPatchPath);
196
198
  const drizzleOrmDeclarationPatchPath = 'patches/drizzle-orm-ts7-strict-declarations.patch';
@@ -437,6 +439,7 @@ function workspaceUsesDependency(workspaceRoot, packageName) {
437
439
  function ensureGeneratedDeclarationPatches(workspaceRoot, options) {
438
440
  let changed = false;
439
441
  changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationModernJsPatchPath, moduleFederationModernJsPatchSourcePath) || changed;
442
+ changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationBridgeReactPatchPath, moduleFederationBridgeReactPatchSourcePath) || changed;
440
443
  changed = ensureGeneratedPatchFile(workspaceRoot, effectDeclarationPatchPath, effectDeclarationPatchSourcePath) || changed;
441
444
  changed = options.includeDrizzleOrmPatch ? ensureGeneratedPatchFile(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed : removeGeneratedPatchFileIfUnchanged(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed;
442
445
  return changed;
@@ -487,6 +490,9 @@ function updateGeneratedPnpmWorkspacePolicy(workspaceRoot) {
487
490
  const moduleFederationModernJsPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/modern-js-v3@${MODULE_FEDERATION_VERSION}`, moduleFederationModernJsPatchPath);
488
491
  source = moduleFederationModernJsPatch.source;
489
492
  changed = moduleFederationModernJsPatch.changed || changed;
493
+ const moduleFederationBridgeReactPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/bridge-react@${MODULE_FEDERATION_VERSION}`, moduleFederationBridgeReactPatchPath);
494
+ source = moduleFederationBridgeReactPatch.source;
495
+ changed = moduleFederationBridgeReactPatch.changed || changed;
490
496
  const drizzleOrmPatch = usesDrizzleOrm ? ensureYamlMapEntry(source, 'patchedDependencies', `drizzle-orm@${DRIZZLE_ORM_VERSION}`, drizzleOrmDeclarationPatchPath) : removeYamlMapEntry(source, `drizzle-orm@${DRIZZLE_ORM_VERSION}`);
491
497
  source = drizzleOrmPatch.source;
492
498
  changed = drizzleOrmPatch.changed || changed;
@@ -192,6 +192,8 @@ const strictEffectPackageVersionPolicyExclusions = [
192
192
  ];
193
193
  const moduleFederationModernJsPatchPath = `patches/@module-federation__modern-js-v3@${MODULE_FEDERATION_VERSION}.patch`;
194
194
  const moduleFederationModernJsPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationModernJsPatchPath);
195
+ const moduleFederationBridgeReactPatchPath = `patches/@module-federation__bridge-react@${MODULE_FEDERATION_VERSION}.patch`;
196
+ const moduleFederationBridgeReactPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', moduleFederationBridgeReactPatchPath);
195
197
  const effectDeclarationPatchPath = 'patches/effect-schema-error-type-id.patch';
196
198
  const effectDeclarationPatchSourcePath = node_path.join(createPackageRoot, 'template-workspace', effectDeclarationPatchPath);
197
199
  const drizzleOrmDeclarationPatchPath = 'patches/drizzle-orm-ts7-strict-declarations.patch';
@@ -438,6 +440,7 @@ function workspaceUsesDependency(workspaceRoot, packageName) {
438
440
  function ensureGeneratedDeclarationPatches(workspaceRoot, options) {
439
441
  let changed = false;
440
442
  changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationModernJsPatchPath, moduleFederationModernJsPatchSourcePath) || changed;
443
+ changed = ensureGeneratedPatchFile(workspaceRoot, moduleFederationBridgeReactPatchPath, moduleFederationBridgeReactPatchSourcePath) || changed;
441
444
  changed = ensureGeneratedPatchFile(workspaceRoot, effectDeclarationPatchPath, effectDeclarationPatchSourcePath) || changed;
442
445
  changed = options.includeDrizzleOrmPatch ? ensureGeneratedPatchFile(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed : removeGeneratedPatchFileIfUnchanged(workspaceRoot, drizzleOrmDeclarationPatchPath, drizzleOrmDeclarationPatchSourcePath) || changed;
443
446
  return changed;
@@ -488,6 +491,9 @@ function updateGeneratedPnpmWorkspacePolicy(workspaceRoot) {
488
491
  const moduleFederationModernJsPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/modern-js-v3@${MODULE_FEDERATION_VERSION}`, moduleFederationModernJsPatchPath);
489
492
  source = moduleFederationModernJsPatch.source;
490
493
  changed = moduleFederationModernJsPatch.changed || changed;
494
+ const moduleFederationBridgeReactPatch = ensureYamlMapEntry(source, 'patchedDependencies', `@module-federation/bridge-react@${MODULE_FEDERATION_VERSION}`, moduleFederationBridgeReactPatchPath);
495
+ source = moduleFederationBridgeReactPatch.source;
496
+ changed = moduleFederationBridgeReactPatch.changed || changed;
491
497
  const drizzleOrmPatch = usesDrizzleOrm ? ensureYamlMapEntry(source, 'patchedDependencies', `drizzle-orm@${DRIZZLE_ORM_VERSION}`, drizzleOrmDeclarationPatchPath) : removeYamlMapEntry(source, `drizzle-orm@${DRIZZLE_ORM_VERSION}`);
492
498
  source = drizzleOrmPatch.source;
493
499
  changed = drizzleOrmPatch.changed || changed;
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=20"
23
23
  },
24
- "version": "3.5.0-ultramodern.17",
24
+ "version": "3.5.0-ultramodern.19",
25
25
  "types": "./dist/types/index.d.ts",
26
26
  "main": "./dist/esm-node/index.js",
27
27
  "bin": {
@@ -77,7 +77,7 @@
77
77
  "@modern-js/codesmith": "2.6.9",
78
78
  "oxfmt": "0.56.0",
79
79
  "ultracite": "7.8.3",
80
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.5.0-ultramodern.17"
80
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.5.0-ultramodern.19"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@rslib/core": "0.23.1",
@@ -99,6 +99,6 @@
99
99
  "test": "rm -rf dist && rslib build -c rslibconfig.mts && rstest --passWithNoTests"
100
100
  },
101
101
  "ultramodern": {
102
- "frameworkVersion": "3.5.0-ultramodern.17"
102
+ "frameworkVersion": "3.5.0-ultramodern.19"
103
103
  }
104
104
  }
@@ -0,0 +1,140 @@
1
+ diff --git a/dist/lazy-load-component-plugin-BYI941I2.mjs b/dist/lazy-load-component-plugin-BYI941I2.mjs
2
+ index dfba15be1e9753e0f164b53cfb22feda13f39ea4..6be1b47903b9f6807bb0111df6c588f0d54ebf53 100644
3
+ --- a/dist/lazy-load-component-plugin-BYI941I2.mjs
4
+ +++ b/dist/lazy-load-component-plugin-BYI941I2.mjs
5
+ @@ -235,6 +235,41 @@ function getTargetModuleInfo(id, instance) {
6
+ remoteEntry
7
+ };
8
+ }
9
+ +function normalizeHref(href) {
10
+ + if (typeof document === "undefined") {
11
+ + return href;
12
+ + }
13
+ + try {
14
+ + return new URL(href, document.baseURI).href;
15
+ + } catch {
16
+ + return href;
17
+ + }
18
+ +}
19
+ +function isStylesheetLink(link) {
20
+ + return link.relList.contains("stylesheet") || link.rel.toLowerCase().split(/\s+/u).includes("stylesheet");
21
+ +}
22
+ +function hasStylesheetLinkInHead(href, ignoredLink) {
23
+ + if (typeof document === "undefined" || !document.head) {
24
+ + return false;
25
+ + }
26
+ + const normalizedHref = normalizeHref(href);
27
+ + return Array.from(
28
+ + document.head.querySelectorAll("link[href]")
29
+ + ).some(
30
+ + (link) => link !== ignoredLink && isStylesheetLink(link) && normalizeHref(link.href) === normalizedHref
31
+ + );
32
+ +}
33
+ +function StylesheetAsset({ href }) {
34
+ + const [shouldRender, setShouldRender] = useState(true);
35
+ + const linkRef = useRef(null);
36
+ + useEffect(() => {
37
+ + setShouldRender(!hasStylesheetLinkInHead(href, linkRef.current));
38
+ + }, [href]);
39
+ + if (!shouldRender) {
40
+ + return null;
41
+ + }
42
+ + return /* @__PURE__ */ React__default.createElement("link", { ref: linkRef, href, rel: "stylesheet", type: "text/css" });
43
+ +}
44
+ function collectSSRAssets(options) {
45
+ const {
46
+ id,
47
+ @@ -253,15 +288,19 @@ function collectSSRAssets(options) {
48
+ }
49
+ const { module: targetModule, publicPath, remoteEntry } = moduleAndPublicPath;
50
+ if (injectLink) {
51
+ + const stylesheetHrefs = /* @__PURE__ */ new Set();
52
+ [...targetModule.assets.css.sync, ...targetModule.assets.css.async].sort().forEach((file, index) => {
53
+ + const href = `${publicPath}${file}`;
54
+ + if (stylesheetHrefs.has(href)) {
55
+ + return;
56
+ + }
57
+ + stylesheetHrefs.add(href);
58
+ links.push(
59
+ /* @__PURE__ */ React__default.createElement(
60
+ - "link",
61
+ + StylesheetAsset,
62
+ {
63
+ key: `${file.split(".")[0]}_${index}`,
64
+ - href: `${publicPath}${file}`,
65
+ - rel: "stylesheet",
66
+ - type: "text/css"
67
+ + href
68
+ }
69
+ )
70
+ );
71
+ diff --git a/dist/lazy-load-component-plugin-DG4e3Tib.js b/dist/lazy-load-component-plugin-DG4e3Tib.js
72
+ index 321c9c3cd55bf9d62a6825c9186267dfe28e5e93..867e7237d5a2ea613130c7e1710cdd998924d9db 100644
73
+ --- a/dist/lazy-load-component-plugin-DG4e3Tib.js
74
+ +++ b/dist/lazy-load-component-plugin-DG4e3Tib.js
75
+ @@ -236,6 +236,41 @@ function getTargetModuleInfo(id, instance) {
76
+ remoteEntry
77
+ };
78
+ }
79
+ +function normalizeHref(href) {
80
+ + if (typeof document === "undefined") {
81
+ + return href;
82
+ + }
83
+ + try {
84
+ + return new URL(href, document.baseURI).href;
85
+ + } catch {
86
+ + return href;
87
+ + }
88
+ +}
89
+ +function isStylesheetLink(link) {
90
+ + return link.relList.contains("stylesheet") || link.rel.toLowerCase().split(/\s+/u).includes("stylesheet");
91
+ +}
92
+ +function hasStylesheetLinkInHead(href, ignoredLink) {
93
+ + if (typeof document === "undefined" || !document.head) {
94
+ + return false;
95
+ + }
96
+ + const normalizedHref = normalizeHref(href);
97
+ + return Array.from(
98
+ + document.head.querySelectorAll("link[href]")
99
+ + ).some(
100
+ + (link) => link !== ignoredLink && isStylesheetLink(link) && normalizeHref(link.href) === normalizedHref
101
+ + );
102
+ +}
103
+ +function StylesheetAsset({ href }) {
104
+ + const [shouldRender, setShouldRender] = React.useState(true);
105
+ + const linkRef = React.useRef(null);
106
+ + React.useEffect(() => {
107
+ + setShouldRender(!hasStylesheetLinkInHead(href, linkRef.current));
108
+ + }, [href]);
109
+ + if (!shouldRender) {
110
+ + return null;
111
+ + }
112
+ + return /* @__PURE__ */ React.createElement("link", { ref: linkRef, href, rel: "stylesheet", type: "text/css" });
113
+ +}
114
+ function collectSSRAssets(options) {
115
+ const {
116
+ id,
117
+ @@ -254,15 +289,19 @@ function collectSSRAssets(options) {
118
+ }
119
+ const { module: targetModule, publicPath, remoteEntry } = moduleAndPublicPath;
120
+ if (injectLink) {
121
+ + const stylesheetHrefs = /* @__PURE__ */ new Set();
122
+ [...targetModule.assets.css.sync, ...targetModule.assets.css.async].sort().forEach((file, index) => {
123
+ + const href = `${publicPath}${file}`;
124
+ + if (stylesheetHrefs.has(href)) {
125
+ + return;
126
+ + }
127
+ + stylesheetHrefs.add(href);
128
+ links.push(
129
+ /* @__PURE__ */ React.createElement(
130
+ - "link",
131
+ + StylesheetAsset,
132
+ {
133
+ key: `${file.split(".")[0]}_${index}`,
134
+ - href: `${publicPath}${file}`,
135
+ - rel: "stylesheet",
136
+ - type: "text/css"
137
+ + href
138
+ }
139
+ )
140
+ );
@@ -63,5 +63,6 @@ allowBuilds:
63
63
 
64
64
  patchedDependencies:
65
65
  '@module-federation/modern-js-v3@{{moduleFederationVersion}}': patches/@module-federation__modern-js-v3@{{moduleFederationVersion}}.patch
66
+ '@module-federation/bridge-react@{{moduleFederationVersion}}': patches/@module-federation__bridge-react@{{moduleFederationVersion}}.patch
66
67
  '@tanstack/router-core@{{tanstackRouterCoreVersion}}': patches/@tanstack__router-core@{{tanstackRouterCoreVersion}}.patch
67
68
  'effect@{{effectVersion}}': patches/effect-schema-error-type-id.patch
@@ -1504,6 +1504,7 @@ const requiredPaths = [
1504
1504
  'package.json',
1505
1505
  'pnpm-workspace.yaml',
1506
1506
  'patches/@module-federation__modern-js-v3@{{moduleFederationVersion}}.patch',
1507
+ 'patches/@module-federation__bridge-react@{{moduleFederationVersion}}.patch',
1507
1508
  'patches/effect-schema-error-type-id.patch',
1508
1509
  'tsconfig.json',
1509
1510
  'tsconfig.base.json',
@@ -1587,6 +1588,12 @@ assert(
1587
1588
  ),
1588
1589
  'pnpm-workspace.yaml must patch the generated Module Federation Modern.js integration cohort',
1589
1590
  );
1591
+ assert(
1592
+ pnpmWorkspace.includes(
1593
+ "'@module-federation/bridge-react@{{moduleFederationVersion}}': patches/@module-federation__bridge-react@{{moduleFederationVersion}}.patch",
1594
+ ),
1595
+ 'pnpm-workspace.yaml must patch the generated Module Federation React bridge cohort',
1596
+ );
1590
1597
  assert(
1591
1598
  pnpmWorkspace.includes(
1592
1599
  "'effect@{{effectVersion}}': patches/effect-schema-error-type-id.patch",