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.
Files changed (95) hide show
  1. package/.vscode/launch.json +21 -0
  2. package/config.ts +1 -0
  3. package/front.config.json +24 -0
  4. package/index.ts +6 -1
  5. package/lib/bin/bin.js +12 -0
  6. package/lib/config/config.d.ts +1 -0
  7. package/lib/config/config.js +1 -0
  8. package/lib/config/src/bin/config/userConfig.d.ts +14 -0
  9. package/lib/index.d.ts +6 -1
  10. package/lib/index.js +6 -7
  11. package/lib/src/front/server-state/DataProxy.d.ts +8 -0
  12. package/lib/src/front/server-state/DataProxy.js +104 -0
  13. package/lib/src/front/server-state/SSR.d.ts +4 -0
  14. package/lib/src/front/server-state/SSR.js +6 -0
  15. package/lib/src/front/server-state/real.d.ts +1 -0
  16. package/lib/src/front/server-state/real.js +36 -0
  17. package/lib/src/front/server-state/serverStates.d.ts +5 -0
  18. package/lib/src/front/server-state/serverStates.js +29 -0
  19. package/lib/src/front/server-state/useServerState.d.ts +10 -0
  20. package/lib/src/front/server-state/useServerState.js +28 -0
  21. package/lib/src/front/url/JinraiContext.d.ts +6 -0
  22. package/lib/src/front/url/JinraiContext.js +8 -0
  23. package/lib/src/front/url/adapter/def.d.ts +2 -0
  24. package/lib/src/front/url/adapter/def.js +9 -0
  25. package/lib/src/front/url/adapter/rrd6.d.ts +2 -0
  26. package/lib/src/front/url/adapter/rrd6.js +12 -0
  27. package/lib/src/front/url/adapter/rrd7.d.ts +2 -0
  28. package/lib/src/front/url/adapter/rrd7.js +11 -0
  29. package/lib/src/front/url/params/useParamsIndex.d.ts +1 -0
  30. package/lib/src/front/url/params/useParamsIndex.js +15 -0
  31. package/lib/src/front/url/search/useSearch.d.ts +1 -0
  32. package/lib/src/front/url/search/useSearch.js +15 -0
  33. package/lib/src/front/url/search/useSearchValue.d.ts +16 -0
  34. package/lib/src/front/url/search/useSearchValue.js +49 -0
  35. package/lib/src/front/wrapper/Custom.d.ts +8 -0
  36. package/lib/src/front/wrapper/Custom.js +9 -0
  37. package/lib/vite/plugin.js +1 -0
  38. package/package.json +42 -7
  39. package/readme.md +34 -8
  40. package/rollup.front.config.mjs +57 -0
  41. package/src/bin/bin.ts +10 -0
  42. package/src/bin/build/build.ts +69 -0
  43. package/src/{config → bin/config}/defaultIndexHtml.ts +2 -2
  44. package/src/{config → bin/config}/userConfig.ts +11 -3
  45. package/src/bin/content/normalizeContent.ts +7 -0
  46. package/src/bin/playwright/pageCollector.ts +11 -0
  47. package/src/{templates.ts → bin/playwright/templates.ts} +28 -21
  48. package/src/bin/routes/Parser.ts +148 -0
  49. package/src/{routes → bin/routes}/getRoutes.ts +9 -6
  50. package/src/bin/routes/replaceDevScripts.ts +16 -0
  51. package/src/bin/server/vitePreview.ts +13 -0
  52. package/src/front/server-state/DataProxy.ts +120 -0
  53. package/src/front/server-state/SSR.ts +4 -0
  54. package/src/front/server-state/real.ts +41 -0
  55. package/src/front/server-state/serverStates.ts +36 -0
  56. package/src/front/server-state/useServerState.ts +44 -0
  57. package/src/front/url/JinraiContext.tsx +10 -0
  58. package/src/front/url/adapter/def.tsx +10 -0
  59. package/src/front/url/adapter/rrd6.tsx +16 -0
  60. package/src/front/url/adapter/rrd7.tsx +15 -0
  61. package/src/front/url/params/useParamsIndex.ts +16 -0
  62. package/src/front/url/search/useSearch.ts +15 -0
  63. package/src/front/url/search/useSearchValue.ts +72 -0
  64. package/src/front/wrapper/Custom.tsx +14 -0
  65. package/tests/content/1.html +12 -0
  66. package/tests/content/1_result.json +54 -0
  67. package/tests/content/2.html +16 -0
  68. package/tests/content/2_result.json +28 -0
  69. package/tests/content/3.html +21 -0
  70. package/tests/content/3_result.json +39 -0
  71. package/tests/content/4.html +4 -0
  72. package/tests/content/4_result.json +9 -0
  73. package/tests/content/custom.html +5 -0
  74. package/tests/content/custom.json +5 -0
  75. package/tests/content/index.html +543 -0
  76. package/tests/content/index.json +49 -0
  77. package/tests/content/index_with_templates.json +31 -0
  78. package/tests/content/templates.json +13 -0
  79. package/tests/custom.test.ts +16 -0
  80. package/tests/parse.test.ts +52 -0
  81. package/tsconfig.json +2 -2
  82. package/vite/plugin.ts +83 -0
  83. package/vitest.config.ts +14 -0
  84. package/lib/bin.js +0 -3351
  85. package/lib/generate.js +0 -26
  86. package/lib/src/config/userConfig.d.ts +0 -7
  87. package/src/bin.ts +0 -46
  88. package/src/routes/parser.ts +0 -58
  89. package/src/routes/splitByTag.ts +0 -38
  90. package/test/fld.config.ts +0 -13
  91. package/test/jinrai.config.ts +0 -8
  92. /package/lib/{src → config/src/bin}/config/define.d.ts +0 -0
  93. /package/src/{config → bin/config}/define.ts +0 -0
  94. /package/src/{types → bin/types}/shims.d.ts +0 -0
  95. /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
+ ]
@@ -0,0 +1,4 @@
1
+ <section>
2
+ <loopwrapper>ArrayDataKey=categories|Hello </loopwrapper>
3
+ world
4
+ </section>
@@ -0,0 +1,9 @@
1
+ [
2
+ { "type": "html", "content": "<section>" },
3
+ {
4
+ "type": "array",
5
+ "data": [{ "type": "html", "content": "Hello " }],
6
+ "key": "categories"
7
+ },
8
+ { "type": "html", "content": " world </section>" }
9
+ ]
@@ -0,0 +1,5 @@
1
+ head
2
+ <div>
3
+ <custom>paginaion|{"pagination":"{{0#/Api/Serias/GetSerias@/pagination}}"}</custom>
4
+ </div>
5
+ footer
@@ -0,0 +1,5 @@
1
+ [
2
+ { "type": "html", "content": "head <div>" },
3
+ { "type": "custom", "name": "paginaion", "props": "{\"pagination\":\"{{0#/Api/Serias/GetSerias@/pagination}}\"}" },
4
+ { "type": "html", "content": "</div> footer" }
5
+ ]