jinrai 1.0.3 → 1.0.6
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/.vscode/launch.json +21 -0
- package/config.ts +1 -0
- package/front.config.json +24 -0
- package/index.ts +6 -1
- package/lib/bin/bin.js +12 -0
- package/lib/config/config.d.ts +1 -0
- package/lib/config/config.js +1 -0
- package/lib/config/src/bin/config/userConfig.d.ts +14 -0
- package/lib/index.d.ts +6 -1
- package/lib/index.js +6 -7
- package/lib/src/front/server-state/DataProxy.d.ts +8 -0
- package/lib/src/front/server-state/DataProxy.js +104 -0
- package/lib/src/front/server-state/SSR.d.ts +4 -0
- package/lib/src/front/server-state/SSR.js +6 -0
- package/lib/src/front/server-state/real.d.ts +1 -0
- package/lib/src/front/server-state/real.js +36 -0
- package/lib/src/front/server-state/serverStates.d.ts +5 -0
- package/lib/src/front/server-state/serverStates.js +29 -0
- package/lib/src/front/server-state/useServerState.d.ts +10 -0
- package/lib/src/front/server-state/useServerState.js +28 -0
- package/lib/src/front/url/JinraiContext.d.ts +6 -0
- package/lib/src/front/url/JinraiContext.js +8 -0
- package/lib/src/front/url/adapter/def.d.ts +2 -0
- package/lib/src/front/url/adapter/def.js +9 -0
- package/lib/src/front/url/adapter/rrd6.d.ts +2 -0
- package/lib/src/front/url/adapter/rrd6.js +12 -0
- package/lib/src/front/url/adapter/rrd7.d.ts +2 -0
- package/lib/src/front/url/adapter/rrd7.js +11 -0
- package/lib/src/front/url/params/useParamsIndex.d.ts +1 -0
- package/lib/src/front/url/params/useParamsIndex.js +15 -0
- package/lib/src/front/url/search/useSearch.d.ts +1 -0
- package/lib/src/front/url/search/useSearch.js +15 -0
- package/lib/src/front/url/search/useSearchValue.d.ts +16 -0
- package/lib/src/front/url/search/useSearchValue.js +49 -0
- package/lib/src/front/wrapper/Custom.d.ts +8 -0
- package/lib/src/front/wrapper/Custom.js +9 -0
- package/lib/vite/plugin.js +1 -0
- package/package.json +42 -7
- package/readme.md +34 -8
- package/rollup.front.config.mjs +57 -0
- package/src/bin/bin.ts +10 -0
- package/src/bin/build/build.ts +69 -0
- package/src/{config → bin/config}/defaultIndexHtml.ts +2 -2
- package/src/{config → bin/config}/userConfig.ts +11 -3
- package/src/bin/content/normalizeContent.ts +7 -0
- package/src/bin/playwright/pageCollector.ts +11 -0
- package/src/{templates.ts → bin/playwright/templates.ts} +28 -21
- package/src/bin/routes/Parser.ts +148 -0
- package/src/{routes → bin/routes}/getRoutes.ts +9 -6
- package/src/bin/routes/replaceDevScripts.ts +16 -0
- package/src/bin/server/vitePreview.ts +13 -0
- package/src/front/server-state/DataProxy.ts +120 -0
- package/src/front/server-state/SSR.ts +4 -0
- package/src/front/server-state/real.ts +41 -0
- package/src/front/server-state/serverStates.ts +36 -0
- package/src/front/server-state/useServerState.ts +44 -0
- package/src/front/url/JinraiContext.tsx +10 -0
- package/src/front/url/adapter/def.tsx +10 -0
- package/src/front/url/adapter/rrd6.tsx +16 -0
- package/src/front/url/adapter/rrd7.tsx +15 -0
- package/src/front/url/params/useParamsIndex.ts +16 -0
- package/src/front/url/search/useSearch.ts +15 -0
- package/src/front/url/search/useSearchValue.ts +72 -0
- package/src/front/wrapper/Custom.tsx +14 -0
- package/tests/content/1.html +12 -0
- package/tests/content/1_result.json +54 -0
- package/tests/content/2.html +16 -0
- package/tests/content/2_result.json +28 -0
- package/tests/content/3.html +21 -0
- package/tests/content/3_result.json +39 -0
- package/tests/content/4.html +4 -0
- package/tests/content/4_result.json +9 -0
- package/tests/content/custom.html +5 -0
- package/tests/content/custom.json +5 -0
- package/tests/content/index.html +543 -0
- package/tests/content/index.json +49 -0
- package/tests/content/index_with_templates.json +31 -0
- package/tests/content/templates.json +13 -0
- package/tests/custom.test.ts +16 -0
- package/tests/parse.test.ts +52 -0
- package/tsconfig.json +2 -2
- package/vite/plugin.ts +83 -0
- package/vitest.config.ts +14 -0
- package/lib/bin.js +0 -3351
- package/lib/generate.js +0 -26
- package/lib/src/config/userConfig.d.ts +0 -7
- package/src/bin.ts +0 -46
- package/src/routes/parser.ts +0 -58
- package/src/routes/splitByTag.ts +0 -38
- package/test/fld.config.ts +0 -13
- package/test/jinrai.config.ts +0 -8
- /package/lib/{src → config/src/bin}/config/define.d.ts +0 -0
- /package/src/{config → bin/config}/define.ts +0 -0
- /package/src/{types → bin/types}/shims.d.ts +0 -0
- /package/src/{ui → bin/ui}/task.tsx +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"type": "html",
|
|
4
|
+
"content": "header "
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"type": "value",
|
|
8
|
+
"key": "SUPERVALUE"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "html",
|
|
12
|
+
"content": " "
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"data": [
|
|
17
|
+
{
|
|
18
|
+
"type": "html",
|
|
19
|
+
"content": "FIRST_LOOP_CONTENT "
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "array",
|
|
23
|
+
"data": [
|
|
24
|
+
{
|
|
25
|
+
"type": "html",
|
|
26
|
+
"content": " <img src=\""
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "value",
|
|
30
|
+
"key": "0#/Api/Catalog/GetCatalog@/[ITEM=0]/preview"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"type": "html",
|
|
34
|
+
"content": "\" alt=\""
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "value",
|
|
38
|
+
"key": "0#/Api/Catalog/GetCatalog@/[ITEM=0]/title"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "html",
|
|
42
|
+
"content": "\" />"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"key": "SECOND_KEY"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"key": "FIRST_KEY"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "html",
|
|
52
|
+
"content": " footer"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<header>
|
|
2
|
+
{{SITE_NAME}}
|
|
3
|
+
<nav>
|
|
4
|
+
<loopwrapper
|
|
5
|
+
>ArrayDataKey=MenuKey|
|
|
6
|
+
<a href="{{0#/Api/Menu@/[ITEM=0]/link}}">
|
|
7
|
+
{{0#/Api/Menu@/[ITEM=0]/title}}
|
|
8
|
+
<loopwrapper
|
|
9
|
+
>ArrayDataKey=0#/Api/Menu@/[ITEM=0]/submenu|
|
|
10
|
+
<span>{{0#/Api/Menu@/[ITEM=0]/submenu/[ITEM=1]/name}}</span>
|
|
11
|
+
</loopwrapper>
|
|
12
|
+
</a>
|
|
13
|
+
</loopwrapper>
|
|
14
|
+
</nav>
|
|
15
|
+
</header>
|
|
16
|
+
{{HERO_BANNER}}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "type": "html", "content": "<header> " },
|
|
3
|
+
{ "type": "value", "key": "SITE_NAME" },
|
|
4
|
+
{ "type": "html", "content": " <nav>" },
|
|
5
|
+
{
|
|
6
|
+
"type": "array",
|
|
7
|
+
"data": [
|
|
8
|
+
{ "type": "html", "content": " <a href=\"" },
|
|
9
|
+
{ "type": "value", "key": "0#/Api/Menu@/[ITEM=0]/link" },
|
|
10
|
+
{ "type": "html", "content": "\"> " },
|
|
11
|
+
{ "type": "value", "key": "0#/Api/Menu@/[ITEM=0]/title" },
|
|
12
|
+
{ "type": "html", "content": " " },
|
|
13
|
+
{
|
|
14
|
+
"type": "array",
|
|
15
|
+
"data": [
|
|
16
|
+
{ "type": "html", "content": " <span>" },
|
|
17
|
+
{ "type": "value", "key": "0#/Api/Menu@/[ITEM=0]/submenu/[ITEM=1]/name" },
|
|
18
|
+
{ "type": "html", "content": "</span>" }
|
|
19
|
+
],
|
|
20
|
+
"key": "0#/Api/Menu@/[ITEM=0]/submenu"
|
|
21
|
+
},
|
|
22
|
+
{ "type": "html", "content": "</a>" }
|
|
23
|
+
],
|
|
24
|
+
"key": "MenuKey"
|
|
25
|
+
},
|
|
26
|
+
{ "type": "html", "content": "</nav></header> " },
|
|
27
|
+
{ "type": "value", "key": "HERO_BANNER" }
|
|
28
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<section class="{{SECTION_CLASS}}">
|
|
2
|
+
<loopwrapper
|
|
3
|
+
>ArrayDataKey=categories|
|
|
4
|
+
<div data-id="{{0#/Api/Categories@/[ITEM=0]/id}}">
|
|
5
|
+
<h3>{{0#/Api/Categories@/[ITEM=0]/title}}</h3>
|
|
6
|
+
<loopwrapper
|
|
7
|
+
>ArrayDataKey=0#/Api/Categories@/[ITEM=0]/products|
|
|
8
|
+
<article>
|
|
9
|
+
<img
|
|
10
|
+
src="{{0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/image}}"
|
|
11
|
+
alt="{{0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/name}}"
|
|
12
|
+
/>
|
|
13
|
+
<loopwrapper
|
|
14
|
+
>ArrayDataKey=0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/tags|
|
|
15
|
+
<span>{{0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/tags/[ITEM=2]}}</span>
|
|
16
|
+
</loopwrapper>
|
|
17
|
+
</article>
|
|
18
|
+
</loopwrapper>
|
|
19
|
+
</div>
|
|
20
|
+
</loopwrapper>
|
|
21
|
+
</section>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[
|
|
2
|
+
{ "type": "html", "content": "<section class=\"" },
|
|
3
|
+
{ "type": "value", "key": "SECTION_CLASS" },
|
|
4
|
+
{ "type": "html", "content": "\">" },
|
|
5
|
+
{
|
|
6
|
+
"type": "array",
|
|
7
|
+
"data": [
|
|
8
|
+
{ "type": "html", "content": " <div data-id=\"" },
|
|
9
|
+
{ "type": "value", "key": "0#/Api/Categories@/[ITEM=0]/id" },
|
|
10
|
+
{ "type": "html", "content": "\"><h3>" },
|
|
11
|
+
{ "type": "value", "key": "0#/Api/Categories@/[ITEM=0]/title" },
|
|
12
|
+
{ "type": "html", "content": "</h3>" },
|
|
13
|
+
{
|
|
14
|
+
"type": "array",
|
|
15
|
+
"data": [
|
|
16
|
+
{ "type": "html", "content": " <article><img src=\"" },
|
|
17
|
+
{ "type": "value", "key": "0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/image" },
|
|
18
|
+
{ "type": "html", "content": "\" alt=\"" },
|
|
19
|
+
{ "type": "value", "key": "0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/name" },
|
|
20
|
+
{ "type": "html", "content": "\" />" },
|
|
21
|
+
{
|
|
22
|
+
"type": "array",
|
|
23
|
+
"data": [
|
|
24
|
+
{ "type": "html", "content": " <span>" },
|
|
25
|
+
{ "type": "value", "key": "0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/tags/[ITEM=2]" },
|
|
26
|
+
{ "type": "html", "content": "</span>" }
|
|
27
|
+
],
|
|
28
|
+
"key": "0#/Api/Categories@/[ITEM=0]/products/[ITEM=1]/tags"
|
|
29
|
+
},
|
|
30
|
+
{ "type": "html", "content": "</article>" }
|
|
31
|
+
],
|
|
32
|
+
"key": "0#/Api/Categories@/[ITEM=0]/products"
|
|
33
|
+
},
|
|
34
|
+
{ "type": "html", "content": "</div>" }
|
|
35
|
+
],
|
|
36
|
+
"key": "categories"
|
|
37
|
+
},
|
|
38
|
+
{ "type": "html", "content": "</section>" }
|
|
39
|
+
]
|