@modern-js/runtime 3.1.2 → 3.1.3
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/document/Html.js +5 -3
- package/dist/cjs/router/cli/code/utils.js +6 -1
- package/dist/esm/document/Html.mjs +5 -3
- package/dist/esm/router/cli/code/utils.mjs +6 -1
- package/dist/esm-node/document/Html.mjs +5 -3
- package/dist/esm-node/router/cli/code/utils.mjs +6 -1
- package/package.json +11 -11
|
@@ -31,7 +31,9 @@ require("react");
|
|
|
31
31
|
const external_Body_js_namespaceObject = require("./Body.js");
|
|
32
32
|
const external_DocumentStructureContext_js_namespaceObject = require("./DocumentStructureContext.js");
|
|
33
33
|
const external_Head_js_namespaceObject = require("./Head.js");
|
|
34
|
+
const external_Links_js_namespaceObject = require("./Links.js");
|
|
34
35
|
const external_Root_js_namespaceObject = require("./Root.js");
|
|
36
|
+
const external_Scripts_js_namespaceObject = require("./Scripts.js");
|
|
35
37
|
function findTargetChildByName(tag, children) {
|
|
36
38
|
return children.find((item)=>getEleType(item) === tag);
|
|
37
39
|
}
|
|
@@ -62,9 +64,9 @@ function findTargetElement(tag, children) {
|
|
|
62
64
|
function Html(props) {
|
|
63
65
|
const { children, ...rest } = props;
|
|
64
66
|
const hasSetHead = Boolean(findTargetChildByComponent(external_Head_js_namespaceObject.Head, children) || findTargetChildByName('Head', children));
|
|
65
|
-
const hasSetScripts = Boolean(
|
|
66
|
-
const hasSetLinks = Boolean(
|
|
67
|
-
const hasSetBody = Boolean(
|
|
67
|
+
const hasSetScripts = Boolean(findTargetElementByComponent(external_Scripts_js_namespaceObject.Scripts, children) || findTargetChildByName('Scripts', children));
|
|
68
|
+
const hasSetLinks = Boolean(findTargetElementByComponent(external_Links_js_namespaceObject.Links, children) || findTargetChildByName('Links', children));
|
|
69
|
+
const hasSetBody = Boolean(findTargetElementByComponent(external_Body_js_namespaceObject.Body, children) || findTargetChildByName('Body', children));
|
|
68
70
|
const hasSetRoot = Boolean(findTargetElementByComponent(external_Root_js_namespaceObject.Root, children) || findTargetChildByName('Root', children));
|
|
69
71
|
const hasSetTitle = Boolean(findTargetElement('title', children));
|
|
70
72
|
const notMissMustChild = [
|
|
@@ -81,7 +81,12 @@ const parseModule = async ({ source, filename })=>{
|
|
|
81
81
|
if (utils_namespaceObject.JS_EXTENSIONS.some((ext)=>filename.endsWith(ext))) {
|
|
82
82
|
const result = await (0, external_esbuild_namespaceObject.transform)(content, {
|
|
83
83
|
loader: external_path_default().extname(filename).slice(1),
|
|
84
|
-
format: 'esm'
|
|
84
|
+
format: 'esm',
|
|
85
|
+
tsconfigRaw: {
|
|
86
|
+
compilerOptions: {
|
|
87
|
+
experimentalDecorators: true
|
|
88
|
+
}
|
|
89
|
+
}
|
|
85
90
|
});
|
|
86
91
|
content = result.code;
|
|
87
92
|
}
|
|
@@ -3,7 +3,9 @@ import "react";
|
|
|
3
3
|
import { Body } from "./Body.mjs";
|
|
4
4
|
import { DocumentStructureContext } from "./DocumentStructureContext.mjs";
|
|
5
5
|
import { Head } from "./Head.mjs";
|
|
6
|
+
import { Links } from "./Links.mjs";
|
|
6
7
|
import { Root } from "./Root.mjs";
|
|
8
|
+
import { Scripts } from "./Scripts.mjs";
|
|
7
9
|
function findTargetChildByName(tag, children) {
|
|
8
10
|
return children.find((item)=>getEleType(item) === tag);
|
|
9
11
|
}
|
|
@@ -34,9 +36,9 @@ function findTargetElement(tag, children) {
|
|
|
34
36
|
function Html(props) {
|
|
35
37
|
const { children, ...rest } = props;
|
|
36
38
|
const hasSetHead = Boolean(findTargetChildByComponent(Head, children) || findTargetChildByName('Head', children));
|
|
37
|
-
const hasSetScripts = Boolean(
|
|
38
|
-
const hasSetLinks = Boolean(
|
|
39
|
-
const hasSetBody = Boolean(
|
|
39
|
+
const hasSetScripts = Boolean(findTargetElementByComponent(Scripts, children) || findTargetChildByName('Scripts', children));
|
|
40
|
+
const hasSetLinks = Boolean(findTargetElementByComponent(Links, children) || findTargetChildByName('Links', children));
|
|
41
|
+
const hasSetBody = Boolean(findTargetElementByComponent(Body, children) || findTargetChildByName('Body', children));
|
|
40
42
|
const hasSetRoot = Boolean(findTargetElementByComponent(Root, children) || findTargetChildByName('Root', children));
|
|
41
43
|
const hasSetTitle = Boolean(findTargetElement('title', children));
|
|
42
44
|
const notMissMustChild = [
|
|
@@ -34,7 +34,12 @@ const parseModule = async ({ source, filename })=>{
|
|
|
34
34
|
if (JS_EXTENSIONS.some((ext)=>filename.endsWith(ext))) {
|
|
35
35
|
const result = await transform(content, {
|
|
36
36
|
loader: path.extname(filename).slice(1),
|
|
37
|
-
format: 'esm'
|
|
37
|
+
format: 'esm',
|
|
38
|
+
tsconfigRaw: {
|
|
39
|
+
compilerOptions: {
|
|
40
|
+
experimentalDecorators: true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
38
43
|
});
|
|
39
44
|
content = result.code;
|
|
40
45
|
}
|
|
@@ -4,7 +4,9 @@ import "react";
|
|
|
4
4
|
import { Body } from "./Body.mjs";
|
|
5
5
|
import { DocumentStructureContext } from "./DocumentStructureContext.mjs";
|
|
6
6
|
import { Head } from "./Head.mjs";
|
|
7
|
+
import { Links } from "./Links.mjs";
|
|
7
8
|
import { Root } from "./Root.mjs";
|
|
9
|
+
import { Scripts } from "./Scripts.mjs";
|
|
8
10
|
function findTargetChildByName(tag, children) {
|
|
9
11
|
return children.find((item)=>getEleType(item) === tag);
|
|
10
12
|
}
|
|
@@ -35,9 +37,9 @@ function findTargetElement(tag, children) {
|
|
|
35
37
|
function Html(props) {
|
|
36
38
|
const { children, ...rest } = props;
|
|
37
39
|
const hasSetHead = Boolean(findTargetChildByComponent(Head, children) || findTargetChildByName('Head', children));
|
|
38
|
-
const hasSetScripts = Boolean(
|
|
39
|
-
const hasSetLinks = Boolean(
|
|
40
|
-
const hasSetBody = Boolean(
|
|
40
|
+
const hasSetScripts = Boolean(findTargetElementByComponent(Scripts, children) || findTargetChildByName('Scripts', children));
|
|
41
|
+
const hasSetLinks = Boolean(findTargetElementByComponent(Links, children) || findTargetChildByName('Links', children));
|
|
42
|
+
const hasSetBody = Boolean(findTargetElementByComponent(Body, children) || findTargetChildByName('Body', children));
|
|
41
43
|
const hasSetRoot = Boolean(findTargetElementByComponent(Root, children) || findTargetChildByName('Root', children));
|
|
42
44
|
const hasSetTitle = Boolean(findTargetElement('title', children));
|
|
43
45
|
const notMissMustChild = [
|
|
@@ -35,7 +35,12 @@ const parseModule = async ({ source, filename })=>{
|
|
|
35
35
|
if (JS_EXTENSIONS.some((ext)=>filename.endsWith(ext))) {
|
|
36
36
|
const result = await transform(content, {
|
|
37
37
|
loader: path.extname(filename).slice(1),
|
|
38
|
-
format: 'esm'
|
|
38
|
+
format: 'esm',
|
|
39
|
+
tsconfigRaw: {
|
|
40
|
+
compilerOptions: {
|
|
41
|
+
experimentalDecorators: true
|
|
42
|
+
}
|
|
43
|
+
}
|
|
39
44
|
});
|
|
40
45
|
content = result.code;
|
|
41
46
|
}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "3.1.
|
|
18
|
+
"version": "3.1.3",
|
|
19
19
|
"engines": {
|
|
20
20
|
"node": ">=20"
|
|
21
21
|
},
|
|
@@ -215,12 +215,12 @@
|
|
|
215
215
|
"isbot": "3.8.0",
|
|
216
216
|
"react-helmet": "^6.1.0",
|
|
217
217
|
"react-is": "^18.3.1",
|
|
218
|
-
"@modern-js/plugin": "3.1.
|
|
219
|
-
"@modern-js/
|
|
220
|
-
"@modern-js/render": "3.1.
|
|
221
|
-
"@modern-js/
|
|
222
|
-
"@modern-js/
|
|
223
|
-
"@modern-js/
|
|
218
|
+
"@modern-js/plugin": "3.1.3",
|
|
219
|
+
"@modern-js/runtime-utils": "3.1.3",
|
|
220
|
+
"@modern-js/render": "3.1.3",
|
|
221
|
+
"@modern-js/plugin-data-loader": "3.1.3",
|
|
222
|
+
"@modern-js/utils": "3.1.3",
|
|
223
|
+
"@modern-js/types": "3.1.3"
|
|
224
224
|
},
|
|
225
225
|
"peerDependencies": {
|
|
226
226
|
"react": ">=17.0.2",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"devDependencies": {
|
|
230
230
|
"@remix-run/web-fetch": "^4.1.3",
|
|
231
231
|
"@rsbuild/core": "2.0.0-rc.0",
|
|
232
|
-
"@rslib/core": "0.
|
|
232
|
+
"@rslib/core": "0.21.0",
|
|
233
233
|
"@testing-library/dom": "^10.4.1",
|
|
234
234
|
"@testing-library/react": "^16.3.2",
|
|
235
235
|
"@types/cookie": "0.6.0",
|
|
@@ -240,9 +240,9 @@
|
|
|
240
240
|
"react-dom": "^19.2.4",
|
|
241
241
|
"ts-node": "^10.9.2",
|
|
242
242
|
"typescript": "^5",
|
|
243
|
-
"@modern-js/app-tools": "3.1.
|
|
244
|
-
"@
|
|
245
|
-
"@
|
|
243
|
+
"@modern-js/app-tools": "3.1.3",
|
|
244
|
+
"@modern-js/rslib": "2.68.10",
|
|
245
|
+
"@scripts/rstest-config": "2.66.0"
|
|
246
246
|
},
|
|
247
247
|
"sideEffects": false,
|
|
248
248
|
"publishConfig": {
|