crelte 0.5.8 → 0.5.10

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 (175) hide show
  1. package/dist/blocks/Blocks.d.ts +41 -4
  2. package/dist/blocks/Blocks.d.ts.map +1 -1
  3. package/dist/blocks/Blocks.js +47 -2
  4. package/dist/blocks/Blocks.svelte +2 -16
  5. package/dist/blocks/Blocks.svelte.d.ts +20 -37
  6. package/dist/blocks/Blocks.svelte.d.ts.map +1 -1
  7. package/dist/blocks/index.d.ts +2 -2
  8. package/dist/blocks/index.d.ts.map +1 -1
  9. package/dist/blocks/index.js +2 -2
  10. package/dist/cookies/ServerCookies.d.ts +1 -1
  11. package/dist/cookies/ServerCookies.js +1 -1
  12. package/dist/cookies/index.d.ts +1 -1
  13. package/dist/crelte.d.ts +21 -10
  14. package/dist/crelte.d.ts.map +1 -1
  15. package/dist/index.d.ts +19 -14
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +17 -13
  18. package/dist/init/client.d.ts +2 -2
  19. package/dist/init/client.d.ts.map +1 -1
  20. package/dist/init/client.js +3 -2
  21. package/dist/init/server.d.ts +7 -6
  22. package/dist/init/server.d.ts.map +1 -1
  23. package/dist/init/server.js +6 -6
  24. package/dist/loadData/Globals.d.ts +3 -3
  25. package/dist/loadData/Globals.js +3 -3
  26. package/dist/loadData/loadData.d.ts +8 -18
  27. package/dist/loadData/loadData.d.ts.map +1 -1
  28. package/dist/loadData/loadData.js +2 -2
  29. package/dist/node/index.d.ts +5 -0
  30. package/dist/node/index.d.ts.map +1 -1
  31. package/dist/node/index.js +84 -35
  32. package/dist/plugins/Events.d.ts +4 -4
  33. package/dist/plugins/Plugins.d.ts +2 -2
  34. package/dist/plugins/index.d.ts +2 -3
  35. package/dist/plugins/index.d.ts.map +1 -1
  36. package/dist/plugins/index.js +2 -1
  37. package/dist/queries/Queries.d.ts +9 -0
  38. package/dist/queries/Queries.d.ts.map +1 -1
  39. package/dist/queries/Queries.js +29 -17
  40. package/dist/queries/QueryError.d.ts +2 -0
  41. package/dist/queries/QueryError.d.ts.map +1 -1
  42. package/dist/queries/QueryError.js +6 -1
  43. package/dist/queries/gql.d.ts +2 -2
  44. package/dist/queries/gql.js +2 -2
  45. package/dist/queries/index.d.ts +7 -5
  46. package/dist/queries/index.d.ts.map +1 -1
  47. package/dist/queries/vars.d.ts +7 -7
  48. package/dist/queries/vars.d.ts.map +1 -1
  49. package/dist/queries/vars.js +10 -8
  50. package/dist/routing/LoadRunner.d.ts +1 -1
  51. package/dist/routing/LoadRunner.js +1 -1
  52. package/dist/routing/index.d.ts +4 -4
  53. package/dist/routing/index.d.ts.map +1 -1
  54. package/dist/routing/route/BaseRoute.d.ts +25 -25
  55. package/dist/routing/route/BaseRoute.js +24 -24
  56. package/dist/routing/route/Request.d.ts +4 -4
  57. package/dist/routing/route/Request.js +4 -4
  58. package/dist/routing/route/Route.d.ts +2 -2
  59. package/dist/routing/route/Route.js +2 -2
  60. package/dist/routing/router/BaseRouter.d.ts +4 -4
  61. package/dist/routing/router/BaseRouter.js +3 -3
  62. package/dist/routing/router/ClientRouter.d.ts +1 -1
  63. package/dist/routing/router/ClientRouter.js +1 -1
  64. package/dist/routing/router/Router.d.ts +27 -25
  65. package/dist/routing/router/Router.d.ts.map +1 -1
  66. package/dist/routing/router/Router.js +24 -21
  67. package/dist/routing/router/ServerRouter.d.ts +1 -1
  68. package/dist/routing/router/ServerRouter.js +1 -1
  69. package/dist/server/CrelteServer.d.ts +5 -5
  70. package/dist/server/CrelteServer.d.ts.map +1 -1
  71. package/dist/server/CrelteServer.js +4 -4
  72. package/dist/server/Request.d.ts +7 -1
  73. package/dist/server/Request.d.ts.map +1 -1
  74. package/dist/server/Request.js +7 -1
  75. package/dist/server/ServerRouter.d.ts +1 -1
  76. package/dist/server/ServerRouter.d.ts.map +1 -1
  77. package/dist/server/index.d.ts +4 -4
  78. package/dist/server/index.d.ts.map +1 -1
  79. package/dist/server/index.js +1 -1
  80. package/dist/server/shared.d.ts +7 -13
  81. package/dist/server/shared.d.ts.map +1 -1
  82. package/dist/server/shared.js +14 -16
  83. package/dist/ssr/SsrCache.d.ts +56 -4
  84. package/dist/ssr/SsrCache.d.ts.map +1 -1
  85. package/dist/ssr/SsrCache.js +94 -20
  86. package/dist/std/index.d.ts +13 -0
  87. package/dist/std/index.d.ts.map +1 -1
  88. package/dist/std/index.js +13 -0
  89. package/dist/std/rand/index.d.ts +34 -0
  90. package/dist/std/rand/index.d.ts.map +1 -0
  91. package/dist/std/rand/index.js +45 -0
  92. package/dist/std/rand/internal.d.ts +8 -0
  93. package/dist/std/rand/internal.d.ts.map +1 -0
  94. package/dist/std/rand/internal.js +15 -0
  95. package/dist/std/stores/Writable.d.ts +1 -1
  96. package/dist/std/stores/Writable.js +1 -1
  97. package/dist/translations/index.d.ts +28 -0
  98. package/dist/translations/index.d.ts.map +1 -0
  99. package/dist/translations/index.js +31 -0
  100. package/dist/translations/loadTranslations.d.ts +23 -0
  101. package/dist/translations/loadTranslations.d.ts.map +1 -0
  102. package/dist/translations/loadTranslations.js +26 -0
  103. package/dist/translations/loader/GlobalLoader.d.ts +34 -0
  104. package/dist/translations/loader/GlobalLoader.d.ts.map +1 -0
  105. package/dist/translations/loader/GlobalLoader.js +45 -0
  106. package/dist/translations/loader/fileLoader/ClientFileLoader.d.ts +10 -0
  107. package/dist/translations/loader/fileLoader/ClientFileLoader.d.ts.map +1 -0
  108. package/dist/translations/loader/fileLoader/ClientFileLoader.js +24 -0
  109. package/dist/translations/loader/fileLoader/NodeFileLoader.d.ts +9 -0
  110. package/dist/translations/loader/fileLoader/NodeFileLoader.d.ts.map +1 -0
  111. package/dist/translations/loader/fileLoader/NodeFileLoader.js +21 -0
  112. package/dist/translations/loader/fileLoader/fileLoader.d.ts +5 -0
  113. package/dist/translations/loader/fileLoader/fileLoader.d.ts.map +1 -0
  114. package/dist/translations/loader/fileLoader/fileLoader.js +16 -0
  115. package/dist/translations/loader/index.d.ts +7 -0
  116. package/dist/translations/loader/index.d.ts.map +1 -0
  117. package/dist/translations/loader/index.js +1 -0
  118. package/dist/translations/translationsPlugin.d.ts +64 -0
  119. package/dist/translations/translationsPlugin.d.ts.map +1 -0
  120. package/dist/translations/translationsPlugin.js +110 -0
  121. package/dist/translations/utils.d.ts +8 -0
  122. package/dist/translations/utils.d.ts.map +1 -0
  123. package/dist/translations/utils.js +15 -0
  124. package/dist/vite/index.d.ts.map +1 -1
  125. package/dist/vite/index.js +30 -38
  126. package/package.json +9 -1
  127. package/src/blocks/Blocks.svelte +3 -78
  128. package/src/blocks/Blocks.ts +63 -6
  129. package/src/blocks/index.ts +2 -2
  130. package/src/cookies/ServerCookies.ts +1 -1
  131. package/src/cookies/index.ts +1 -1
  132. package/src/crelte.ts +21 -10
  133. package/src/index.ts +19 -14
  134. package/src/init/client.ts +3 -2
  135. package/src/init/server.ts +14 -8
  136. package/src/loadData/Globals.ts +3 -3
  137. package/src/loadData/loadData.ts +8 -18
  138. package/src/node/index.ts +100 -39
  139. package/src/plugins/Events.ts +4 -4
  140. package/src/plugins/Plugins.ts +2 -2
  141. package/src/plugins/index.ts +2 -3
  142. package/src/queries/Queries.ts +35 -18
  143. package/src/queries/QueryError.ts +10 -1
  144. package/src/queries/gql.ts +2 -2
  145. package/src/queries/index.ts +7 -4
  146. package/src/queries/vars.ts +12 -8
  147. package/src/routing/LoadRunner.ts +1 -1
  148. package/src/routing/index.ts +13 -3
  149. package/src/routing/route/BaseRoute.ts +25 -25
  150. package/src/routing/route/Request.ts +4 -4
  151. package/src/routing/route/Route.ts +2 -2
  152. package/src/routing/router/BaseRouter.ts +4 -4
  153. package/src/routing/router/ClientRouter.ts +1 -1
  154. package/src/routing/router/Router.ts +28 -25
  155. package/src/routing/router/ServerRouter.ts +1 -1
  156. package/src/server/CrelteServer.ts +5 -5
  157. package/src/server/Request.ts +7 -1
  158. package/src/server/ServerRouter.ts +1 -2
  159. package/src/server/index.ts +17 -3
  160. package/src/server/shared.ts +28 -33
  161. package/src/ssr/SsrCache.ts +104 -22
  162. package/src/std/index.ts +14 -0
  163. package/src/std/rand/index.ts +55 -0
  164. package/src/std/rand/internal.ts +17 -0
  165. package/src/std/stores/Writable.ts +1 -1
  166. package/src/translations/index.ts +56 -0
  167. package/src/translations/loadTranslations.ts +33 -0
  168. package/src/translations/loader/GlobalLoader.ts +62 -0
  169. package/src/translations/loader/fileLoader/ClientFileLoader.ts +40 -0
  170. package/src/translations/loader/fileLoader/NodeFileLoader.ts +32 -0
  171. package/src/translations/loader/fileLoader/fileLoader.ts +19 -0
  172. package/src/translations/loader/index.ts +8 -0
  173. package/src/translations/translationsPlugin.ts +145 -0
  174. package/src/translations/utils.ts +17 -0
  175. package/src/vite/index.ts +43 -39
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ function innerGetCrelte() {
5
5
  /**
6
6
  * Get Crelte from the current context
7
7
  *
8
- * ## Note
8
+ * #### Note
9
9
  * This only works during component initialisation.
10
10
  */
11
11
  export function getCrelte() {
@@ -24,7 +24,7 @@ export function getCrelte() {
24
24
  /**
25
25
  * Get the router from the current context
26
26
  *
27
- * ## Note
27
+ * #### Note
28
28
  * This only works during component initialisation.
29
29
  */
30
30
  export function getRouter() {
@@ -33,7 +33,7 @@ export function getRouter() {
33
33
  /**
34
34
  * Get the SSR cache from the current context
35
35
  *
36
- * ## Note
36
+ * #### Note
37
37
  * This only works during component initialisation.
38
38
  */
39
39
  export function getSsrCache() {
@@ -42,7 +42,7 @@ export function getSsrCache() {
42
42
  /**
43
43
  * Get the Queries from the current context
44
44
  *
45
- * ## Note
45
+ * #### Note
46
46
  * This only works during component initialisation.
47
47
  */
48
48
  export function getQueries() {
@@ -51,7 +51,7 @@ export function getQueries() {
51
51
  /**
52
52
  * Get a store with the current route
53
53
  *
54
- * ## Note
54
+ * #### Note
55
55
  * This only works during component initialisation.
56
56
  */
57
57
  export function getRoute() {
@@ -60,7 +60,7 @@ export function getRoute() {
60
60
  /**
61
61
  * Get a store with the current site
62
62
  *
63
- * ## Note
63
+ * #### Note
64
64
  * This only works during component initialisation.
65
65
  */
66
66
  export function getSite() {
@@ -69,7 +69,7 @@ export function getSite() {
69
69
  /**
70
70
  * Get a store with the current entry
71
71
  *
72
- * ## Note
72
+ * #### Note
73
73
  * This only works during component initialisation.
74
74
  */
75
75
  export function getEntry() {
@@ -81,7 +81,7 @@ export function getEnv(name) {
81
81
  /**
82
82
  * returns a store which indicates if the a page is loading
83
83
  *
84
- * ## Note
84
+ * #### Note
85
85
  * This only works during component initialisation.
86
86
  */
87
87
  export function getLoading() {
@@ -90,7 +90,7 @@ export function getLoading() {
90
90
  /**
91
91
  * returns a store which indicates the loading progress between 0 and 1
92
92
  *
93
- * ## Note
93
+ * #### Note
94
94
  * This only works during component initialisation.
95
95
  */
96
96
  export function getLoadingProgress() {
@@ -99,7 +99,7 @@ export function getLoadingProgress() {
99
99
  /**
100
100
  * returns a store which contains a globalSet
101
101
  *
102
- * ## Note
102
+ * #### Note
103
103
  * This only works during component initialisation.
104
104
  */
105
105
  export function getGlobal(name) {
@@ -108,7 +108,7 @@ export function getGlobal(name) {
108
108
  /**
109
109
  * returns the cookies instance
110
110
  *
111
- * ## Note
111
+ * #### Note
112
112
  * This only works during component initialisation.
113
113
  */
114
114
  export function getCookies() {
@@ -117,7 +117,9 @@ export function getCookies() {
117
117
  /**
118
118
  * Listen for route changes
119
119
  *
120
- * ## Note
120
+ * route: {@link Route}
121
+ *
122
+ * #### Note
121
123
  * This only works during component initialisation.
122
124
  */
123
125
  export function onRoute(fn) {
@@ -127,7 +129,9 @@ export function onRoute(fn) {
127
129
  /**
128
130
  * Listen for requests
129
131
  *
130
- * ## Note
132
+ * cr: {@link CrelteRequest}
133
+ *
134
+ * #### Note
131
135
  * This only works during component initialisation.
132
136
  */
133
137
  export function onRequest(fn) {
@@ -10,8 +10,8 @@ export type MainData = {
10
10
  /**
11
11
  * The main function to start the client side rendering
12
12
  *
13
- * ## Example
14
- * ```
13
+ * #### Example
14
+ * ```js
15
15
  * import * as app from './App.svelte';
16
16
  * import * as errorPage from './Error.svelte';
17
17
  * import entryQuery from './queries/entry.graphql';
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/init/client.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,8BAA8B;IAC9B,SAAS,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,iBA4JxC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/init/client.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IACT,8BAA8B;IAC9B,SAAS,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,iBA6JxC"}
@@ -14,8 +14,8 @@ import { Writable } from '../std/stores/index.js';
14
14
  /**
15
15
  * The main function to start the client side rendering
16
16
  *
17
- * ## Example
18
- * ```
17
+ * #### Example
18
+ * ```js
19
19
  * import * as app from './App.svelte';
20
20
  * import * as errorPage from './Error.svelte';
21
21
  * import entryQuery from './queries/entry.graphql';
@@ -35,6 +35,7 @@ export async function main(data) {
35
35
  // they should be added to App.svelte and removed from here
36
36
  const config = configWithDefaults(data.app.config ?? {});
37
37
  const ssrCache = new SsrCache();
38
+ ssrCache.z_importFromHead();
38
39
  // since cors could cause an issue we wan't to override the FRONTEND_URL
39
40
  // env variable, since the server will be reachable on any domain
40
41
  // which the frontend also gets served from
@@ -1,4 +1,5 @@
1
- import { RenderRequest, RenderResponse } from '../server/shared.js';
1
+ import { RenderErrorRequest, RenderRequest, RenderResponse } from '../server/shared.js';
2
+ export { type RenderRequest, type RenderResponse } from '../server/shared.js';
2
3
  export type ServerData = RenderRequest;
3
4
  /**
4
5
  * The main function to start the server side rendering
@@ -12,8 +13,8 @@ export type MainData = {
12
13
  /**
13
14
  * The main function to start the server side rendering
14
15
  *
15
- * ## Example
16
- * ```
16
+ * #### Example
17
+ * ```js
17
18
  * import * as app from './App.svelte';
18
19
  * import entryQuery from './queries/entry.graphql';
19
20
  * import globalQuery from './queries/global.graphql';
@@ -37,14 +38,14 @@ export type Error = {
37
38
  export type MainErrorData = {
38
39
  error: Error;
39
40
  errorPage: any;
40
- serverData: ServerData;
41
+ serverData: RenderErrorRequest;
41
42
  };
42
43
  /**
43
44
  * The main function to start the server side rendering
44
45
  * if there was an error
45
46
  *
46
- * ## Example
47
- * ```
47
+ * #### Example
48
+ * ```js
48
49
  * import * as errorPage from './Error.svelte';
49
50
  *
50
51
  * export function renderError(error, serverData) {
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/init/server.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IAET,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAiHlE;AAED,MAAM,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAE3B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,GAAG,CAAC;IAEf,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAC9B,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgC5C"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/init/server.ts"],"names":[],"mappings":"AAoBA,OAAO,EACN,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE9E,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACtB,4BAA4B;IAC5B,GAAG,EAAE,GAAG,CAAC;IAET,0CAA0C;IAC1C,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAiHlE;AAED,MAAM,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAE3B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,GAAG,CAAC;IAEf,UAAU,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAC9B,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAgC5C"}
@@ -14,8 +14,8 @@ import { Writable } from '../std/stores/index.js';
14
14
  /**
15
15
  * The main function to start the server side rendering
16
16
  *
17
- * ## Example
18
- * ```
17
+ * #### Example
18
+ * ```js
19
19
  * import * as app from './App.svelte';
20
20
  * import entryQuery from './queries/entry.graphql';
21
21
  * import globalQuery from './queries/global.graphql';
@@ -95,7 +95,7 @@ export async function main(data) {
95
95
  context,
96
96
  });
97
97
  head += ssrComponents.toHead(data.serverData.ssrManifest);
98
- head += crelte.ssrCache.exportToHead();
98
+ head += crelte.ssrCache.z_exportToHead();
99
99
  let htmlTemplate = data.serverData.htmlTemplate;
100
100
  htmlTemplate = htmlTemplate.replace('<!--page-lang-->', route.site.language);
101
101
  const finalHtml = htmlTemplate
@@ -117,8 +117,8 @@ export async function main(data) {
117
117
  * The main function to start the server side rendering
118
118
  * if there was an error
119
119
  *
120
- * ## Example
121
- * ```
120
+ * #### Example
121
+ * ```js
122
122
  * import * as errorPage from './Error.svelte';
123
123
  *
124
124
  * export function renderError(error, serverData) {
@@ -144,7 +144,7 @@ export async function mainError(data) {
144
144
  context,
145
145
  });
146
146
  head += ssrComponents.toHead(data.serverData.ssrManifest);
147
- head += ssrCache.exportToHead();
147
+ head += ssrCache.z_exportToHead();
148
148
  let htmlTemplate = data.serverData.htmlTemplate;
149
149
  htmlTemplate = htmlTemplate.replace('<!--page-lang-->', 'de');
150
150
  const finalHtml = htmlTemplate
@@ -18,7 +18,7 @@ export default class Globals {
18
18
  /**
19
19
  * returns a globalValue
20
20
  *
21
- * ## Note
21
+ * #### Note
22
22
  * This only works in loadData, in loadGlobalData this will
23
23
  * throw an error. In that context you should use `.getAsync`
24
24
  */
@@ -26,7 +26,7 @@ export default class Globals {
26
26
  /**
27
27
  * returns a store which contains a globalSet
28
28
  *
29
- * ## Note
29
+ * #### Note
30
30
  * This only works in loadData, in loadGlobalData this will
31
31
  * always return null. In that context you should use
32
32
  * `.getAsync`
@@ -35,7 +35,7 @@ export default class Globals {
35
35
  /**
36
36
  * Get a store which contains a globalSet and wait until it is loaded
37
37
  *
38
- * ## Note
38
+ * #### Note
39
39
  * This is only useful in loadGlobalData in all other cases
40
40
  * you can use `.get` which does not return a Promise
41
41
  */
@@ -35,7 +35,7 @@ export default class Globals {
35
35
  /**
36
36
  * returns a globalValue
37
37
  *
38
- * ## Note
38
+ * #### Note
39
39
  * This only works in loadData, in loadGlobalData this will
40
40
  * throw an error. In that context you should use `.getAsync`
41
41
  */
@@ -49,7 +49,7 @@ export default class Globals {
49
49
  /**
50
50
  * returns a store which contains a globalSet
51
51
  *
52
- * ## Note
52
+ * #### Note
53
53
  * This only works in loadData, in loadGlobalData this will
54
54
  * always return null. In that context you should use
55
55
  * `.getAsync`
@@ -60,7 +60,7 @@ export default class Globals {
60
60
  /**
61
61
  * Get a store which contains a globalSet and wait until it is loaded
62
62
  *
63
- * ## Note
63
+ * #### Note
64
64
  * This is only useful in loadGlobalData in all other cases
65
65
  * you can use `.get` which does not return a Promise
66
66
  */
@@ -13,11 +13,11 @@ export interface LoadDataArray<A1 = any> extends Array<LoadData<A1>> {
13
13
  *
14
14
  * There are three main ways `loadData` can be defined:
15
15
  *
16
- * ## Object
16
+ * #### Object
17
17
  * This is the most common way loadData will be used.
18
18
  * Each property should be a loadData type, each one is called in parallel.
19
19
  * And will be available to your component with the same name.
20
- * ```
20
+ * ```js
21
21
  * import entriesQuery from '@/queries/entries.graphql';
22
22
  * import { loadData as headerLoadData } from '@/layout/header.svelte';
23
23
  *
@@ -27,30 +27,20 @@ export interface LoadDataArray<A1 = any> extends Array<LoadData<A1>> {
27
27
  * };
28
28
  * ```
29
29
  *
30
- * ## GraphQl
30
+ * #### GraphQl
31
31
  * You can just export a graphql query as a loadData type.
32
32
  * This will export all queries from the graphql file as properties.
33
- * ```
33
+ * ```js
34
34
  * import blogsQuery from '@/queries/blogs.graphql';
35
35
  *
36
36
  * export const loadData = blogsQuery;
37
- *
38
- * // or another option
39
- * import { gql } from '@craft-svelte/core/graphql';
40
- *
41
- * export const loadData = gql`query {
42
- * blogs: entries(section: "blogs") {
43
- * title
44
- * url
45
- * }
46
- * }`;
47
37
  * ```
48
38
  *
49
- * ## Function
39
+ * #### Function
50
40
  * Using a function gives you the most flexibility but also is the
51
41
  * most cumbersome.
52
42
  *
53
- * ```
43
+ * ```js
54
44
  * import articlesQuery from '@/queries/articles.graphql';
55
45
  *
56
46
  * export async function loadData(cr, entry) {
@@ -79,8 +69,8 @@ export declare function callLoadData<A1 = any>(ld: LoadData<A1>, cr: CrelteReque
79
69
  *
80
70
  * Prefer to use the array syntax.
81
71
  *
82
- * ## Example
83
- * ```
72
+ * #### Example
73
+ * ```js
84
74
  * export const loadData = mergeLoadData(
85
75
  * {
86
76
  * filter: (cr) => cr.route.search.get('filter'),
@@ -1 +1 @@
1
- {"version":3,"file":"loadData.d.ts","sourceRoot":"","sources":["../../src/loadData/loadData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAW,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,UAAU,CAAC,EAAE,GAAG,GAAG;IACnC,CAAC,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;CAC1E;AAED,MAAM,WAAW,WAAW,CAAC,EAAE,GAAG,GAAG;IACpC,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;CAC5B;AAGD,MAAM,WAAW,aAAa,CAAC,EAAE,GAAG,GAAG,CAAE,SAAQ,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;CAAG;AAKvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,MAAM,QAAQ,CAAC,EAAE,GAAG,GAAG,IAC1B,UAAU,CAAC,EAAE,CAAC,GACd,KAAK,GACL,WAAW,CAAC,EAAE,CA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L,WAAW,CAAC,EAAE,CAAC,GACf,aAAa,CAAC,EAAE,CAAC,GACjB,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAOb,wBAAsB,YAAY,CAAC,EAAE,GAAG,GAAG,EAC1C,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,EAAE,EACR,GAAG,IAAI,EAAE,GAAG,EAAE,GACZ,OAAO,CAAC,GAAG,CAAC,CA6Bd;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,EAAE,GAAG,GAAG,EACrC,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,EAAE,GACpB,UAAU,CAAC,EAAE,CAAC,CAUhB"}
@@ -29,8 +29,8 @@ export async function callLoadData(ld, cr, arg1, ...args) {
29
29
  *
30
30
  * Prefer to use the array syntax.
31
31
  *
32
- * ## Example
33
- * ```
32
+ * #### Example
33
+ * ```js
34
34
  * export const loadData = mergeLoadData(
35
35
  * {
36
36
  * filter: (cr) => cr.route.search.get('filter'),
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Create and start the server
3
+ *
4
+ * Generally this call should automatically happen via the vite build step.
5
+ */
1
6
  export default function createServer(serverMod: any, buildTime: string): Promise<void>;
2
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAiCA,wBAA8B,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,iBAkF3E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAiEA;;;;GAIG;AACH,wBAA8B,YAAY,CAAC,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,iBAmG3E"}
@@ -2,11 +2,12 @@ import http from 'node:http';
2
2
  import path, { join } from 'node:path';
3
3
  import fs from 'node:fs/promises';
4
4
  import { createReadStream } from 'node:fs';
5
- import { initEnvData, modRender, modRenderError, } from '../server/shared.js';
5
+ import { initEnvData, initSites, modRender, modRenderError, } from '../server/shared.js';
6
6
  import ServerRouter from '../server/ServerRouter.js';
7
7
  import { fileURLToPath } from 'node:url';
8
8
  import { initQueryRoutes } from '../server/queries/queries.js';
9
9
  import { PLATFORM, readFile, requestToWebRequest, webResponseToResponse, writeFile, } from './utils.js';
10
+ import { timeout } from '../std/index.js';
10
11
  function localDir(...args) {
11
12
  return join(path.dirname(fileURLToPath(import.meta.url)), ...args);
12
13
  }
@@ -16,64 +17,112 @@ async function readSitesCache() {
16
17
  async function writeSitesCache(data) {
17
18
  return await writeFile(localDir('sites.json'), JSON.stringify(data));
18
19
  }
19
- export default async function createServer(serverMod, buildTime) {
20
- const env = await initEnvData(PLATFORM, {
20
+ async function initRouter(serverMod, env) {
21
+ const sites = await initSites(env, {
21
22
  enabled: process.env.NODE_ENV === 'production',
22
23
  writeSitesCache,
23
24
  readSitesCache,
24
25
  });
25
- const template = await readFile(localDir('index.html'));
26
- const globalEtag = '"' + buildTime + '"';
27
- const ssrManifest = JSON.parse(await readFile(localDir('ssr-manifest.json')));
28
- const router = new ServerRouter(env.endpointUrl, env.frontendUrl, env.env, env.sites, {
26
+ const router = new ServerRouter(env.endpointUrl, env.frontendUrl, env.env, sites, {
29
27
  endpointToken: env.endpointToken,
30
28
  });
31
29
  await initQueryRoutes(PLATFORM, serverMod, router);
32
30
  if (typeof serverMod.routes === 'function') {
33
31
  await serverMod.routes(router);
34
32
  }
33
+ return [sites, router];
34
+ }
35
+ /**
36
+ * Create and start the server
37
+ *
38
+ * Generally this call should automatically happen via the vite build step.
39
+ */
40
+ export default async function createServer(serverMod, buildTime) {
41
+ const env = await initEnvData(PLATFORM);
42
+ const template = await readFile(localDir('index.html'));
43
+ const globalEtag = '"' + buildTime + '"';
44
+ const ssrManifest = JSON.parse(await readFile(localDir('ssr-manifest.json')));
45
+ let sites = null;
46
+ let router = null;
47
+ let routesError = null;
48
+ // let's try to init the router
49
+ // if it fails we start a retry loop
50
+ // this way the server can start even if the endpoint is not yet available
51
+ try {
52
+ [sites, router] = await initRouter(serverMod, env);
53
+ }
54
+ catch (e) {
55
+ routesError = e;
56
+ console.error('Failed to setup router:', e);
57
+ // retry loop
58
+ (async () => {
59
+ while (!router) {
60
+ await timeout(1000);
61
+ try {
62
+ [sites, router] = await initRouter(serverMod, env);
63
+ routesError = null;
64
+ }
65
+ catch (e) {
66
+ routesError = e;
67
+ console.error('Failed to setup router:', e);
68
+ }
69
+ }
70
+ })();
71
+ }
35
72
  const publicDir = localDir('public');
36
- http.createServer(async (nReq, res) => {
37
- if (await servePublic(nReq, res, publicDir, globalEtag))
73
+ const handle = async (req, res) => {
74
+ // if router is not set, just render the error page
75
+ if (routesError || !router || !sites) {
76
+ throw routesError ?? new Error('Router not initialized');
77
+ }
78
+ const routeResp = await router.z_handle(req);
79
+ if (routeResp) {
80
+ await webResponseToResponse(routeResp, res);
81
+ return;
82
+ }
83
+ if (await basicAuthCheck(req, res, env))
38
84
  return;
39
- // todo this is not safe if we are not in a trusted environment
40
- const baseUrl = (nReq.headers['x-forwarded-proto'] ?? 'http') +
41
- '://' +
42
- nReq.headers['host'];
43
- const req = requestToWebRequest(baseUrl, nReq);
44
- let thrownError = null;
85
+ const response = await modRender(env, sites, serverMod, template, req, {
86
+ ssrManifest,
87
+ });
88
+ await webResponseToResponse(response, res);
89
+ };
90
+ http.createServer(async (nodeReq, res) => {
91
+ let req = null;
92
+ let err;
45
93
  try {
46
- const routeResp = await router.z_handle(req);
47
- if (routeResp) {
48
- await webResponseToResponse(routeResp, res);
49
- return;
50
- }
51
- if (await basicAuthCheck(nReq, res, env))
94
+ if (await servePublic(nodeReq, res, publicDir, globalEtag))
52
95
  return;
53
- const response = await modRender(env, serverMod, template, req, {
54
- ssrManifest,
55
- });
56
- await webResponseToResponse(response, res);
96
+ // todo this is not safe if we are not in a trusted environment
97
+ const baseUrl = (nodeReq.headers['x-forwarded-proto'] ?? 'http') +
98
+ '://' +
99
+ nodeReq.headers['host'];
100
+ req = requestToWebRequest(baseUrl, nodeReq);
101
+ await handle(req, res);
57
102
  return;
58
103
  }
59
104
  catch (e) {
60
- if (typeof serverMod.renderError !== 'function') {
61
- console.log('error', e);
62
- throw e;
63
- }
64
- thrownError = e;
105
+ err = e;
106
+ }
107
+ if (typeof serverMod.renderError !== 'function' || !req) {
108
+ basicError(res, err);
109
+ return;
65
110
  }
66
111
  try {
67
- const response = await modRenderError(env, serverMod, thrownError, template, req, { ssrManifest });
112
+ const response = await modRenderError(env, serverMod, err, template, req, { ssrManifest });
68
113
  await webResponseToResponse(response, res);
69
- return;
70
114
  }
71
115
  catch (e) {
72
- console.log('error', e);
73
- throw e;
116
+ basicError(res, e);
74
117
  }
75
118
  }).listen(8080);
76
119
  }
120
+ function basicError(res, err) {
121
+ console.error('Internal Server Error:', err);
122
+ res.statusCode = 500;
123
+ res.end('Internal Server Error: ' + err?.message);
124
+ return;
125
+ }
77
126
  const MIME_TYPES = {
78
127
  '.html': 'text/html',
79
128
  '.css': 'text/css',
@@ -150,7 +199,7 @@ async function basicAuthCheck(req, res, { env }) {
150
199
  // ignore if one information is missing
151
200
  if (!user || !password)
152
201
  return false;
153
- const authHeader = req.headers['authorization'];
202
+ const authHeader = req.headers.get('authorization');
154
203
  if (!authHeader || !authHeader.startsWith('Basic ')) {
155
204
  res.statusCode = 401;
156
205
  res.setHeader('WWW-Authenticate', 'Basic realm="Restricted"');
@@ -7,23 +7,23 @@ export default class Events {
7
7
  /**
8
8
  * Listens for an event.
9
9
  *
10
- * ## beforeRequest
10
+ * #### beforeRequest
11
11
  * Please prefer to return not return a promise only if you need to wait
12
12
  * for something. This allows a push request to be done without a microtask.
13
13
  * Allowing for a better DX.
14
14
  *
15
- * ## loadEntry
15
+ * #### loadEntry
16
16
  * This will execute all listeners in sequence and stop on the first one
17
17
  * which returns an entry.
18
18
  * Will be executed in preload as well.
19
19
  *
20
- * ## beforeQueryEntry
20
+ * #### beforeQueryEntry
21
21
  * This allows to modify the entry query variables before the entry query
22
22
  * is executed.
23
23
  * Will be executed in preload as well.
24
24
  *
25
25
  *
26
- * ## afterLoadEntry
26
+ * #### afterLoadEntry
27
27
  * Will be executed in preload as well.
28
28
  *
29
29
  * @returns a function to remove the listener
@@ -13,8 +13,8 @@ export interface Plugin {
13
13
  * a configurePluginname function which will be called by youre user and should
14
14
  * return a createPlugin function.
15
15
  *
16
- * ## Example App.svelte in module="context"
17
- * ```
16
+ * #### Example App.svelte in module="context"
17
+ * ```js
18
18
  * import { createPlugin, configurePlugin } from 'some-plugin';
19
19
  *
20
20
  * export plugins = [createPlugin, configurePlugin({ enableFeature: true })];
@@ -1,5 +1,4 @@
1
1
  import Events from './Events.js';
2
- import { Plugin, PluginCreator } from './Plugins.js';
3
- export type { Plugin, PluginCreator };
4
- export { Events };
2
+ import Plugins, { type Plugin, type PluginCreator } from './Plugins.js';
3
+ export { Plugins, Events, Plugin, PluginCreator };
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAErD,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,EAAE,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC"}
@@ -1,2 +1,3 @@
1
1
  import Events from './Events.js';
2
- export { Events };
2
+ import Plugins from './Plugins.js';
3
+ export { Plugins, Events };
@@ -65,6 +65,15 @@ export default class Queries {
65
65
  private route;
66
66
  private request;
67
67
  private constructor();
68
+ /**
69
+ * Create a new Queries instance
70
+ *
71
+ * @param endpoint the craft GraphQl endpoint
72
+ * @param frontend the frontend url where the server queries are reachable
73
+ * @param ssrCache the ssrCache to use for caching
74
+ * @param opts options
75
+ * @returns
76
+ */
68
77
  static new(endpoint: string, frontend: string, ssrCache: SsrCache, opts?: QueriesOptions): Queries;
69
78
  /**
70
79
  * Run a GraphQl Query
@@ -1 +1 @@
1
- {"version":3,"file":"Queries.d.ts","sourceRoot":"","sources":["../../src/queries/Queries.ts"],"names":[],"mappings":"AAAA,OAAO,QAAwC,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAa,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,KAAK,GACd;IACA,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACb,GACD;IACA,SAAS,EAAE,MAAM,CAAC;CACjB,CAAC;AAEL,0DAA0D;AAC1D,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,KAAK,CAI9C;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,C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