@sitecore-content-sdk/core 1.3.0-canary.9 → 1.4.0-canary.2

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 (342) hide show
  1. package/README.md +7 -7
  2. package/dist/cjs/cache-client.js +55 -54
  3. package/dist/cjs/client/constants.js +7 -7
  4. package/dist/cjs/client/edge-proxy.js +24 -22
  5. package/dist/cjs/client/index.js +15 -15
  6. package/dist/cjs/client/models.js +2 -2
  7. package/dist/cjs/client/sitecore-client.js +421 -419
  8. package/dist/cjs/client/utils.js +47 -46
  9. package/dist/cjs/config/define-config.js +194 -193
  10. package/dist/cjs/config/index.js +7 -7
  11. package/dist/cjs/config/models.js +12 -11
  12. package/dist/cjs/config-cli/define-cli-config.js +23 -22
  13. package/dist/cjs/config-cli/index.js +7 -7
  14. package/dist/cjs/config-cli/models.js +8 -7
  15. package/dist/cjs/constants.js +49 -17
  16. package/dist/cjs/debug.js +48 -46
  17. package/dist/cjs/editing/codegen/index.js +14 -9
  18. package/dist/cjs/editing/codegen/preview.js +277 -193
  19. package/dist/cjs/editing/component-layout-service.js +62 -61
  20. package/dist/cjs/editing/design-library.js +183 -126
  21. package/dist/cjs/editing/editing-service.js +75 -74
  22. package/dist/cjs/editing/index.js +33 -27
  23. package/dist/cjs/editing/metadata.js +42 -42
  24. package/dist/cjs/editing/models.js +44 -38
  25. package/dist/cjs/editing/utils.js +108 -90
  26. package/dist/cjs/form/form.js +81 -78
  27. package/dist/cjs/form/index.js +7 -7
  28. package/dist/cjs/graphql-request-client.js +108 -107
  29. package/dist/cjs/i18n/dictionary-service.js +122 -121
  30. package/dist/cjs/i18n/index.js +7 -7
  31. package/dist/cjs/i18n/utils.js +16 -15
  32. package/dist/cjs/index.js +60 -60
  33. package/dist/cjs/layout/content-styles.js +72 -71
  34. package/dist/cjs/layout/index.js +24 -24
  35. package/dist/cjs/layout/layout-service.js +62 -57
  36. package/dist/cjs/layout/models.js +39 -34
  37. package/dist/cjs/layout/themes.js +76 -75
  38. package/dist/cjs/layout/utils.js +117 -110
  39. package/dist/cjs/media/index.js +38 -38
  40. package/dist/cjs/media/media-api.js +100 -96
  41. package/dist/cjs/models.js +2 -2
  42. package/dist/cjs/native-fetcher.js +194 -179
  43. package/dist/cjs/personalize/index.js +15 -15
  44. package/dist/cjs/personalize/layout-personalizer.js +98 -97
  45. package/dist/cjs/personalize/personalize-service.js +98 -94
  46. package/dist/cjs/personalize/utils.js +143 -136
  47. package/dist/cjs/retries.js +43 -42
  48. package/dist/cjs/site/error-pages-service.js +65 -64
  49. package/dist/cjs/site/index.js +26 -26
  50. package/dist/cjs/site/models.js +2 -2
  51. package/dist/cjs/site/redirects-service.js +94 -81
  52. package/dist/cjs/site/robots-service.js +66 -65
  53. package/dist/cjs/site/site-resolver.js +73 -72
  54. package/dist/cjs/site/siteinfo-service.js +84 -80
  55. package/dist/cjs/site/sitemap-xml-service.js +84 -83
  56. package/dist/cjs/site/sitepath-service.js +165 -164
  57. package/dist/cjs/site/utils.js +55 -47
  58. package/dist/cjs/sitecore-service-base.js +36 -36
  59. package/dist/cjs/tools/auth/flow.js +65 -64
  60. package/dist/cjs/tools/auth/index.js +5 -5
  61. package/dist/cjs/tools/auth/models.js +2 -2
  62. package/dist/cjs/tools/auth/tenant-store.js +38 -38
  63. package/dist/cjs/tools/codegen/component-generation.js +52 -50
  64. package/dist/cjs/tools/codegen/extract-files.js +105 -107
  65. package/dist/cjs/tools/codegen/import-map.js +401 -349
  66. package/dist/cjs/tools/codegen/utils.js +418 -418
  67. package/dist/cjs/tools/generate-map.js +2 -2
  68. package/dist/cjs/tools/generateMetadata.js +36 -35
  69. package/dist/cjs/tools/generateSites.js +59 -58
  70. package/dist/cjs/tools/index.js +75 -73
  71. package/dist/cjs/tools/scaffold.js +60 -59
  72. package/dist/cjs/tools/templating/components.js +96 -266
  73. package/dist/cjs/tools/templating/index.js +11 -14
  74. package/dist/cjs/tools/templating/plugins.js +80 -78
  75. package/dist/cjs/tools/templating/utils.js +67 -66
  76. package/dist/cjs/utils/ensurePath.js +20 -20
  77. package/dist/cjs/utils/env.js +28 -27
  78. package/dist/cjs/utils/globalCache.js +55 -0
  79. package/dist/cjs/utils/index.js +26 -21
  80. package/dist/cjs/utils/is-server.js +11 -10
  81. package/dist/cjs/utils/normalize-url.js +5 -5
  82. package/dist/cjs/utils/timeout-promise.js +31 -31
  83. package/dist/cjs/utils/utils.js +254 -229
  84. package/dist/esm/cache-client.js +51 -50
  85. package/dist/esm/client/constants.js +4 -4
  86. package/dist/esm/client/edge-proxy.js +19 -17
  87. package/dist/esm/client/index.js +5 -5
  88. package/dist/esm/client/models.js +1 -1
  89. package/dist/esm/client/sitecore-client.js +414 -412
  90. package/dist/esm/client/utils.js +43 -42
  91. package/dist/esm/config/define-config.js +188 -187
  92. package/dist/esm/config/index.js +2 -2
  93. package/dist/esm/config/models.js +9 -8
  94. package/dist/esm/config-cli/define-cli-config.js +19 -18
  95. package/dist/esm/config-cli/index.js +2 -2
  96. package/dist/esm/config-cli/models.js +5 -4
  97. package/dist/esm/constants.js +46 -14
  98. package/dist/esm/debug.js +41 -39
  99. package/dist/esm/editing/codegen/index.js +1 -1
  100. package/dist/esm/editing/codegen/preview.js +263 -185
  101. package/dist/esm/editing/component-layout-service.js +55 -54
  102. package/dist/esm/editing/design-library.js +171 -117
  103. package/dist/esm/editing/editing-service.js +68 -67
  104. package/dist/esm/editing/index.js +6 -5
  105. package/dist/esm/editing/metadata.js +39 -39
  106. package/dist/esm/editing/models.js +41 -35
  107. package/dist/esm/editing/utils.js +98 -80
  108. package/dist/esm/form/form.js +72 -69
  109. package/dist/esm/form/index.js +1 -1
  110. package/dist/esm/graphql-request-client.js +101 -100
  111. package/dist/esm/i18n/dictionary-service.js +115 -114
  112. package/dist/esm/i18n/index.js +2 -2
  113. package/dist/esm/i18n/utils.js +13 -12
  114. package/dist/esm/index.js +13 -13
  115. package/dist/esm/layout/content-styles.js +64 -63
  116. package/dist/esm/layout/index.js +6 -6
  117. package/dist/esm/layout/layout-service.js +55 -50
  118. package/dist/esm/layout/models.js +36 -31
  119. package/dist/esm/layout/themes.js +71 -70
  120. package/dist/esm/layout/utils.js +109 -102
  121. package/dist/esm/media/index.js +2 -2
  122. package/dist/esm/media/media-api.js +90 -86
  123. package/dist/esm/models.js +1 -1
  124. package/dist/esm/native-fetcher.js +187 -172
  125. package/dist/esm/personalize/index.js +3 -3
  126. package/dist/esm/personalize/layout-personalizer.js +93 -92
  127. package/dist/esm/personalize/personalize-service.js +91 -87
  128. package/dist/esm/personalize/utils.js +135 -128
  129. package/dist/esm/retries.js +39 -38
  130. package/dist/esm/site/error-pages-service.js +58 -57
  131. package/dist/esm/site/index.js +8 -8
  132. package/dist/esm/site/models.js +1 -1
  133. package/dist/esm/site/redirects-service.js +87 -74
  134. package/dist/esm/site/robots-service.js +59 -58
  135. package/dist/esm/site/site-resolver.js +69 -68
  136. package/dist/esm/site/siteinfo-service.js +77 -73
  137. package/dist/esm/site/sitemap-xml-service.js +77 -76
  138. package/dist/esm/site/sitepath-service.js +157 -156
  139. package/dist/esm/site/utils.js +49 -41
  140. package/dist/esm/sitecore-service-base.js +29 -29
  141. package/dist/esm/tools/auth/flow.js +62 -61
  142. package/dist/esm/tools/auth/index.js +1 -1
  143. package/dist/esm/tools/auth/models.js +1 -1
  144. package/dist/esm/tools/auth/tenant-store.js +35 -35
  145. package/dist/esm/tools/codegen/component-generation.js +44 -42
  146. package/dist/esm/tools/codegen/extract-files.js +99 -101
  147. package/dist/esm/tools/codegen/import-map.js +358 -306
  148. package/dist/esm/tools/codegen/utils.js +373 -373
  149. package/dist/esm/tools/generate-map.js +1 -1
  150. package/dist/esm/tools/generateMetadata.js +29 -28
  151. package/dist/esm/tools/generateSites.js +52 -51
  152. package/dist/esm/tools/index.js +28 -27
  153. package/dist/esm/tools/scaffold.js +52 -51
  154. package/dist/esm/tools/templating/components.js +59 -223
  155. package/dist/esm/tools/templating/index.js +3 -3
  156. package/dist/esm/tools/templating/plugins.js +72 -70
  157. package/dist/esm/tools/templating/utils.js +59 -58
  158. package/dist/esm/utils/ensurePath.js +13 -13
  159. package/dist/esm/utils/env.js +24 -23
  160. package/dist/esm/utils/globalCache.js +49 -0
  161. package/dist/esm/utils/index.js +4 -3
  162. package/dist/esm/utils/is-server.js +9 -8
  163. package/dist/esm/utils/normalize-url.js +1 -1
  164. package/dist/esm/utils/timeout-promise.js +28 -28
  165. package/dist/esm/utils/utils.js +238 -213
  166. package/package.json +73 -5
  167. package/types/cache-client.d.ts +68 -64
  168. package/types/cache-client.d.ts.map +1 -0
  169. package/types/client/constants.d.ts +5 -4
  170. package/types/client/constants.d.ts.map +1 -0
  171. package/types/client/edge-proxy.d.ts +18 -15
  172. package/types/client/edge-proxy.d.ts.map +1 -0
  173. package/types/client/index.d.ts +8 -7
  174. package/types/client/index.d.ts.map +1 -0
  175. package/types/client/models.d.ts +21 -19
  176. package/types/client/models.d.ts.map +1 -0
  177. package/types/client/sitecore-client.d.ts +338 -327
  178. package/types/client/sitecore-client.d.ts.map +1 -0
  179. package/types/client/utils.d.ts +15 -9
  180. package/types/client/utils.d.ts.map +1 -0
  181. package/types/config/define-config.d.ts +20 -18
  182. package/types/config/define-config.d.ts.map +1 -0
  183. package/types/config/index.d.ts +3 -2
  184. package/types/config/index.d.ts.map +1 -0
  185. package/types/config/models.d.ts +287 -268
  186. package/types/config/models.d.ts.map +1 -0
  187. package/types/config-cli/define-cli-config.d.ts +9 -7
  188. package/types/config-cli/define-cli-config.d.ts.map +1 -0
  189. package/types/config-cli/index.d.ts +3 -2
  190. package/types/config-cli/index.d.ts.map +1 -0
  191. package/types/config-cli/models.d.ts +6 -4
  192. package/types/config-cli/models.d.ts.map +1 -0
  193. package/types/constants.d.ts +44 -11
  194. package/types/constants.d.ts.map +1 -0
  195. package/types/debug.d.ts +35 -28
  196. package/types/debug.d.ts.map +1 -0
  197. package/types/editing/codegen/index.d.ts +2 -1
  198. package/types/editing/codegen/index.d.ts.map +1 -0
  199. package/types/editing/codegen/preview.d.ts +256 -195
  200. package/types/editing/codegen/preview.d.ts.map +1 -0
  201. package/types/editing/component-layout-service.d.ts +84 -80
  202. package/types/editing/component-layout-service.d.ts.map +1 -0
  203. package/types/editing/design-library.d.ts +111 -63
  204. package/types/editing/design-library.d.ts.map +1 -0
  205. package/types/editing/editing-service.d.ts +72 -62
  206. package/types/editing/editing-service.d.ts.map +1 -0
  207. package/types/editing/index.d.ts +7 -6
  208. package/types/editing/index.d.ts.map +1 -0
  209. package/types/editing/metadata.d.ts +8 -7
  210. package/types/editing/metadata.d.ts.map +1 -0
  211. package/types/editing/models.d.ts +103 -92
  212. package/types/editing/models.d.ts.map +1 -0
  213. package/types/editing/utils.d.ts +91 -74
  214. package/types/editing/utils.d.ts.map +1 -0
  215. package/types/form/form.d.ts +25 -21
  216. package/types/form/form.d.ts.map +1 -0
  217. package/types/form/index.d.ts +2 -1
  218. package/types/form/index.d.ts.map +1 -0
  219. package/types/graphql-request-client.d.ts +112 -105
  220. package/types/graphql-request-client.d.ts.map +1 -0
  221. package/types/i18n/dictionary-service.d.ts +135 -131
  222. package/types/i18n/dictionary-service.d.ts.map +1 -0
  223. package/types/i18n/index.d.ts +3 -2
  224. package/types/i18n/index.d.ts.map +1 -0
  225. package/types/i18n/utils.d.ts +9 -7
  226. package/types/i18n/utils.d.ts.map +1 -0
  227. package/types/index.d.ts +13 -12
  228. package/types/index.d.ts.map +1 -0
  229. package/types/layout/content-styles.d.ts +20 -18
  230. package/types/layout/content-styles.d.ts.map +1 -0
  231. package/types/layout/index.d.ts +6 -5
  232. package/types/layout/index.d.ts.map +1 -0
  233. package/types/layout/layout-service.d.ts +45 -35
  234. package/types/layout/layout-service.d.ts.map +1 -0
  235. package/types/layout/models.d.ts +174 -151
  236. package/types/layout/models.d.ts.map +1 -0
  237. package/types/layout/themes.d.ts +13 -11
  238. package/types/layout/themes.d.ts.map +1 -0
  239. package/types/layout/utils.d.ts +56 -41
  240. package/types/layout/utils.d.ts.map +1 -0
  241. package/types/media/index.d.ts +3 -2
  242. package/types/media/index.d.ts.map +1 -0
  243. package/types/media/media-api.d.ts +60 -55
  244. package/types/media/media-api.d.ts.map +1 -0
  245. package/types/models.d.ts +94 -84
  246. package/types/models.d.ts.map +1 -0
  247. package/types/native-fetcher.d.ts +124 -114
  248. package/types/native-fetcher.d.ts.map +1 -0
  249. package/types/personalize/index.d.ts +4 -3
  250. package/types/personalize/index.d.ts.map +1 -0
  251. package/types/personalize/layout-personalizer.d.ts +29 -27
  252. package/types/personalize/layout-personalizer.d.ts.map +1 -0
  253. package/types/personalize/personalize-service.d.ts +90 -80
  254. package/types/personalize/personalize-service.d.ts.map +1 -0
  255. package/types/personalize/utils.d.ts +78 -69
  256. package/types/personalize/utils.d.ts.map +1 -0
  257. package/types/retries.d.ts +26 -24
  258. package/types/retries.d.ts.map +1 -0
  259. package/types/site/error-pages-service.d.ts +64 -57
  260. package/types/site/error-pages-service.d.ts.map +1 -0
  261. package/types/site/index.d.ts +10 -9
  262. package/types/site/index.d.ts.map +1 -0
  263. package/types/site/models.d.ts +23 -18
  264. package/types/site/models.d.ts.map +1 -0
  265. package/types/site/redirects-service.d.ts +92 -69
  266. package/types/site/redirects-service.d.ts.map +1 -0
  267. package/types/site/robots-service.d.ts +57 -50
  268. package/types/site/robots-service.d.ts.map +1 -0
  269. package/types/site/site-resolver.d.ts +28 -26
  270. package/types/site/site-resolver.d.ts.map +1 -0
  271. package/types/site/siteinfo-service.d.ts +65 -52
  272. package/types/site/siteinfo-service.d.ts.map +1 -0
  273. package/types/site/sitemap-xml-service.d.ts +63 -56
  274. package/types/site/sitemap-xml-service.d.ts.map +1 -0
  275. package/types/site/sitepath-service.d.ts +137 -134
  276. package/types/site/sitepath-service.d.ts.map +1 -0
  277. package/types/site/utils.d.ts +41 -28
  278. package/types/site/utils.d.ts.map +1 -0
  279. package/types/sitecore-service-base.d.ts +31 -30
  280. package/types/sitecore-service-base.d.ts.map +1 -0
  281. package/types/tools/auth/flow.d.ts +29 -27
  282. package/types/tools/auth/flow.d.ts.map +1 -0
  283. package/types/tools/auth/index.d.ts +2 -1
  284. package/types/tools/auth/index.d.ts.map +1 -0
  285. package/types/tools/auth/models.d.ts +35 -33
  286. package/types/tools/auth/models.d.ts.map +1 -0
  287. package/types/tools/auth/tenant-store.d.ts +12 -11
  288. package/types/tools/auth/tenant-store.d.ts.map +1 -0
  289. package/types/tools/codegen/component-generation.d.ts +50 -47
  290. package/types/tools/codegen/component-generation.d.ts.map +1 -0
  291. package/types/tools/codegen/extract-files.d.ts +24 -22
  292. package/types/tools/codegen/extract-files.d.ts.map +1 -0
  293. package/types/tools/codegen/import-map.d.ts +103 -70
  294. package/types/tools/codegen/import-map.d.ts.map +1 -0
  295. package/types/tools/codegen/utils.d.ts +76 -75
  296. package/types/tools/codegen/utils.d.ts.map +1 -0
  297. package/types/tools/generate-map.d.ts +36 -26
  298. package/types/tools/generate-map.d.ts.map +1 -0
  299. package/types/tools/generateMetadata.d.ts +24 -22
  300. package/types/tools/generateMetadata.d.ts.map +1 -0
  301. package/types/tools/generateSites.d.ts +25 -22
  302. package/types/tools/generateSites.d.ts.map +1 -0
  303. package/types/tools/index.d.ts +22 -20
  304. package/types/tools/index.d.ts.map +1 -0
  305. package/types/tools/scaffold.d.ts +27 -25
  306. package/types/tools/scaffold.d.ts.map +1 -0
  307. package/types/tools/templating/components.d.ts +104 -103
  308. package/types/tools/templating/components.d.ts.map +1 -0
  309. package/types/tools/templating/index.d.ts +4 -3
  310. package/types/tools/templating/index.d.ts.map +1 -0
  311. package/types/tools/templating/plugins.d.ts +71 -67
  312. package/types/tools/templating/plugins.d.ts.map +1 -0
  313. package/types/tools/templating/utils.d.ts +42 -40
  314. package/types/tools/templating/utils.d.ts.map +1 -0
  315. package/types/utils/ensurePath.d.ts +7 -6
  316. package/types/utils/ensurePath.d.ts.map +1 -0
  317. package/types/utils/env.d.ts +9 -7
  318. package/types/utils/env.d.ts.map +1 -0
  319. package/types/utils/globalCache.d.ts +37 -0
  320. package/types/utils/globalCache.d.ts.map +1 -0
  321. package/types/utils/index.d.ts +5 -3
  322. package/types/utils/index.d.ts.map +1 -0
  323. package/types/utils/is-server.d.ts +8 -6
  324. package/types/utils/is-server.d.ts.map +1 -0
  325. package/types/utils/normalize-url.d.ts +2 -1
  326. package/types/utils/normalize-url.d.ts.map +1 -0
  327. package/types/utils/timeout-promise.d.ts +18 -17
  328. package/types/utils/timeout-promise.d.ts.map +1 -0
  329. package/types/utils/utils.d.ts +104 -79
  330. package/types/utils/utils.d.ts.map +1 -0
  331. package/client.js +0 -1
  332. package/codegen.js +0 -1
  333. package/config-cli.js +0 -1
  334. package/config.js +0 -1
  335. package/editing.js +0 -1
  336. package/i18n.js +0 -1
  337. package/layout.js +0 -1
  338. package/media.js +0 -1
  339. package/personalize.js +0 -1
  340. package/site.js +0 -1
  341. package/tools.js +0 -1
  342. package/utils.js +0 -1
@@ -1,47 +1,50 @@
1
- /**
2
- * The parameters for fetching the component spec.
3
- */
4
- type GetComponentSpecParams = {
5
- /**
6
- * The Edge URL.
7
- * @default
8
- */
9
- edgeUrl?: string;
10
- /**
11
- * The component target path.
12
- * @example './components/promo-block/PromoBlock.ts'
13
- */
14
- targetPath?: string;
15
- /**
16
- * The component id.
17
- */
18
- componentId: string;
19
- /**
20
- * The authentication token.
21
- */
22
- token: string;
23
- };
24
- /**
25
- * The component spec.
26
- */
27
- export interface ComponentSpec {
28
- title: string;
29
- meta: {
30
- 'contentsdk-component-type': string;
31
- 'contentsdk-component-name': string;
32
- 'contentsdk-component-variant-name': string;
33
- };
34
- }
35
- /**
36
- * Gets the component spec url.
37
- * @param {GetComponentSpecParams} params - The parameters for getting the component spec url.
38
- * @returns {string} The component spec url.
39
- */
40
- export declare const getComponentSpecUrl: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => string;
41
- /**
42
- * Fetches the component spec.
43
- * @param {GetComponentSpecParams} params - The parameters for fetching the component spec.
44
- * @returns {Promise<ComponentSpec>} The component spec.
45
- */
46
- export declare const getComponentSpec: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => Promise<ComponentSpec>;
47
- export {};
1
+ /**
2
+ * The parameters for fetching the component spec.
3
+ */
4
+ type GetComponentSpecParams = {
5
+ /**
6
+ * The Edge URL.
7
+ * @default
8
+ */
9
+ edgeUrl?: string;
10
+ /**
11
+ * The component target path.
12
+ * @example './components/promo-block/PromoBlock.ts'
13
+ */
14
+ targetPath?: string;
15
+ /**
16
+ * The component id.
17
+ */
18
+ componentId: string;
19
+ /**
20
+ * The authentication token.
21
+ */
22
+ token: string;
23
+ };
24
+ /**
25
+ * The component spec.
26
+ */
27
+ export interface ComponentSpec {
28
+ title: string;
29
+ meta: {
30
+ 'contentsdk-component-type': string;
31
+ 'contentsdk-component-name': string;
32
+ 'contentsdk-component-variant-name': string;
33
+ };
34
+ }
35
+ /**
36
+ * Gets the component spec url.
37
+ * @param {GetComponentSpecParams} params - The parameters for getting the component spec url.
38
+ * @returns {string} The component spec url.
39
+ * @internal
40
+ */
41
+ export declare const getComponentSpecUrl: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => string;
42
+ /**
43
+ * Fetches the component spec.
44
+ * @param {GetComponentSpecParams} params - The parameters for fetching the component spec.
45
+ * @returns {Promise<ComponentSpec>} The component spec.
46
+ * @internal
47
+ */
48
+ export declare const getComponentSpec: ({ componentId, edgeUrl, targetPath, token, }: GetComponentSpecParams) => Promise<ComponentSpec>;
49
+ export {};
50
+ //# sourceMappingURL=component-generation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-generation.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/component-generation.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,KAAK,sBAAsB,GAAG;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QACJ,2BAA2B,EAAE,MAAM,CAAC;QACpC,2BAA2B,EAAE,MAAM,CAAC;QACpC,mCAAmC,EAAE,MAAM,CAAC;KAC7C,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,8CAKjC,sBAAsB,WAQxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAU,8CAKpC,sBAAsB,2BA8BxB,CAAC"}
@@ -1,22 +1,24 @@
1
- import { SitecoreConfig } from './../../config';
2
- export type ExtractFilesConfig = {
3
- /**
4
- * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
5
- */
6
- scConfig?: SitecoreConfig;
7
- componentMapPath?: string;
8
- clientComponentMapPath?: string;
9
- customValidateDeployContext?: () => boolean;
10
- };
11
- /**
12
- * Extracts components from the app folder and sends them to XMCloud.
13
- * @param {ExtractFilesConfig} args - Config for components extraction
14
- */
15
- export declare let extractFiles: typeof _extractFiles;
16
- export declare const unitMocks: {
17
- extractFiles: typeof _extractFiles;
18
- };
19
- declare function _extractFiles(args?: ExtractFilesConfig): ({ scConfig }?: {
20
- scConfig?: SitecoreConfig;
21
- }) => Promise<void>;
22
- export {};
1
+ import { SitecoreConfig } from './../../config';
2
+ export type ExtractFilesConfig = {
3
+ /**
4
+ * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
5
+ */
6
+ scConfig?: SitecoreConfig;
7
+ componentMapPath?: string;
8
+ clientComponentMapPath?: string;
9
+ customValidateDeployContext?: () => boolean;
10
+ };
11
+ /**
12
+ * Extracts components from the app folder and sends them to XMCloud.
13
+ * @param {ExtractFilesConfig} args - Config for components extraction
14
+ * @public
15
+ */
16
+ export declare let extractFiles: typeof _extractFiles;
17
+ export declare const unitMocks: {
18
+ extractFiles: typeof _extractFiles;
19
+ };
20
+ declare function _extractFiles(args?: ExtractFilesConfig): ({ scConfig }?: {
21
+ scConfig?: SitecoreConfig;
22
+ }) => Promise<void>;
23
+ export {};
24
+ //# sourceMappingURL=extract-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-files.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/extract-files.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,2BAA2B,CAAC,EAAE,MAAM,OAAO,CAAC;CAC7C,CAAC;AAEF;;;;GAIG;AACH,eAAO,IAAI,YAAY,sBAAgB,CAAC;AAKxC,eAAO,MAAM,SAAS;;CAOrB,CAAC;AAEF,iBAAS,aAAa,CAAC,IAAI,GAAE,kBAAuB,IASpC,eAAc;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAO,mBAiG/D"}
@@ -1,70 +1,103 @@
1
- import * as ts from 'typescript';
2
- import { getComponentList } from './../templating';
3
- import { SitecoreConfig } from './../../config';
4
- export declare const unitMocks: ({ getComponentListStub, }: {
5
- getComponentListStub?: typeof getComponentList;
6
- }) => void;
7
- /**
8
- * Gets a Map object with import modules and their respective exports present throughout the paths specified
9
- * @param {string} paths paths to files to be processed for import-map
10
- * @returns {Map<string, ImportModule>} collection of keys and values, where keys refer to modules being processed and values are collections of exports for each module
11
- */
12
- export declare let getImportMap: typeof _getImportMap;
13
- /**
14
- * Builds file contents for component map based on the default template
15
- * @param {Map<string, ImportModule>} indexedImportMap map to be processed into final component-map.ts file
16
- * @returns {string} file code for component-map.ts
17
- */
18
- export declare let nextJsMapTemplate: typeof _nextJsMapTemplate;
19
- export declare const importUnitMocks: {
20
- getImportMap: typeof _getImportMap;
21
- nextJsMapTemplate: (indexedImportMap: Map<string, ModuleExports>) => string;
22
- };
23
- /**
24
- * Args for import map generation
25
- * Specifies paths to include and exclude when generating imports
26
- */
27
- export type WriteImportMapArgs = {
28
- paths: string[];
29
- /**
30
- * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
31
- */
32
- scConfig?: SitecoreConfig;
33
- exclude?: string[];
34
- };
35
- /**
36
- * Import names definition
37
- * @typedef ImportName
38
- * @property {string} name - the original name of the import
39
- * @property {boolean} [isWildcard] - if import is a wildcard import (import * as name from 'module')
40
- */
41
- export type ImportNames = {
42
- named: string[];
43
- namespace: string | null;
44
- default: string | null;
45
- };
46
- /**
47
- * Import module definition, specifying all the imports for a given import path
48
- */
49
- export type ModuleExports = {
50
- namedExports: Map<string, string>;
51
- defaultExport: string | null;
52
- namespaceExport: string | null;
53
- };
54
- /**
55
- * Parses and AST import node and extracts all imported values from it
56
- * @param {ts.ImportDeclaration} importNode import node to be parsed
57
- * @returns {ImportNames | null} object with named, default and namespace imported values, or null if import node is not valid
58
- */
59
- export declare const getImportedValues: (importNode: ts.ImportDeclaration) => ImportNames | null;
60
- export declare const getImportValueAlias: (importValue: string, moduleName: string, importType: "named" | "default" | "namespace") => string;
61
- declare function _getImportMap(paths: string[]): Map<string, ModuleExports>;
62
- /**
63
- * Entry point function for generating import-map. Parses provided paths and outputs the modules and imports from those files into .sitecore/import-map.ts
64
- * @param {WriteImportMapArgs} args include/exclude paths settings to be processed for import-map, and the Sitecore configuration
65
- */
66
- export declare const writeImportMap: (args: WriteImportMapArgs) => ({ scConfig }?: {
67
- scConfig?: SitecoreConfig;
68
- }) => Promise<void>;
69
- declare function _nextJsMapTemplate(indexedImportMap: Map<string, ModuleExports>): string;
70
- export {};
1
+ import * as ts from 'typescript';
2
+ import { getComponentList } from './../templating';
3
+ import { SitecoreConfig } from './../../config';
4
+ export declare const unitMocks: ({ getComponentListStub, }: {
5
+ getComponentListStub?: typeof getComponentList;
6
+ }) => void;
7
+ /**
8
+ * Gets a Map object with import modules and their respective exports present throughout the paths specified
9
+ * @param {string} paths paths to files to be processed for import-map
10
+ * @returns {Map<string, ImportModule>} collection of keys and values, where keys refer to modules being processed and values are collections of exports for each module
11
+ */
12
+ export declare let getImportMap: typeof _getImportMap;
13
+ /**
14
+ * Builds file contents for component map based on the default template
15
+ * @param {Map<string, ImportModule>} indexedImportMap map to be processed into final component-map.ts file
16
+ * @returns {string} file code for component-map.ts
17
+ * @internal
18
+ */
19
+ export declare let defaultMapTemplate: typeof _defaultMapTemplate;
20
+ export declare const importUnitMocks: {
21
+ getImportMap: typeof _getImportMap;
22
+ defaultMapTemplate: (indexedImportMap: Map<string, ModuleExports>) => string;
23
+ };
24
+ /**
25
+ * Args for import map generation
26
+ * Specifies paths to include and exclude when generating imports
27
+ * @public
28
+ */
29
+ export type WriteImportMapArgs = {
30
+ paths: string[];
31
+ /**
32
+ * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
33
+ */
34
+ scConfig?: SitecoreConfig;
35
+ exclude?: string[];
36
+ };
37
+ /**
38
+ * Internal args for import map generation
39
+ * Extends WriteImportMapArgs with additional settings for templates and server/client maps applied within Content SDK
40
+ * @internal
41
+ */
42
+ export type WriteImportMapArgsInternal = WriteImportMapArgs & {
43
+ /**
44
+ * generate separate import map for server/client components
45
+ * when true, generates import-map.server.ts and import-map.client.ts
46
+ * @internal
47
+ */
48
+ separateServerClientMaps?: boolean;
49
+ /**
50
+ * Function to return custom template for server import map file.
51
+ * Will be used as default template if separateServerClientMaps is false.
52
+ * @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.ts or import-map.server.ts file
53
+ * @returns {string} contents for resulting import map file
54
+ * @internal
55
+ */
56
+ serverTemplate?: (indexedImportMap: Map<string, ModuleExports>) => string;
57
+ /**
58
+ * Function to return custom template for client import map file when separateServerClientMaps is true.
59
+ * @param {Map<string, ModuleExports>} indexedImportMap import map to be processed into final import-map.client.ts file
60
+ * @returns {string} contents for resulting import map file
61
+ * @internal
62
+ */
63
+ clientTemplate?: (indexedImportMap: Map<string, ModuleExports>) => string;
64
+ };
65
+ /**
66
+ * Import names definition
67
+ * @typedef ImportName
68
+ * @property {string} name - the original name of the import
69
+ * @property {boolean} [isWildcard] - if import is a wildcard import (import * as name from 'module')
70
+ */
71
+ export type ImportNames = {
72
+ named: string[];
73
+ namespace: string | null;
74
+ default: string | null;
75
+ };
76
+ /**
77
+ * Import module definition, specifying all the imports for a given import path
78
+ * @internal
79
+ */
80
+ export type ModuleExports = {
81
+ namedExports: Map<string, string>;
82
+ defaultExport: string | null;
83
+ namespaceExport: string | null;
84
+ };
85
+ /**
86
+ * Parses and AST import node and extracts all imported values from it
87
+ * @param {ts.ImportDeclaration} importNode import node to be parsed
88
+ * @returns {ImportNames | null} object with named, default and namespace imported values, or null if import node is not valid
89
+ */
90
+ export declare const getImportedValues: (importNode: ts.ImportDeclaration) => ImportNames | null;
91
+ export declare const getImportValueAlias: (importValue: string, moduleName: string, importType: "named" | "default" | "namespace") => string;
92
+ declare function _getImportMap(paths: string[]): Map<string, ModuleExports>;
93
+ /**
94
+ * Entry point function for generating import-map. Parses provided paths and outputs the modules and imports from those files into .sitecore/import-map.ts
95
+ * @param {WriteImportMapArgsInternal} args include/exclude paths settings to be processed for import-map, and the Sitecore configuration.
96
+ * @public
97
+ */
98
+ export declare const writeImportMap: (args: WriteImportMapArgsInternal) => ({ scConfig }?: {
99
+ scConfig?: SitecoreConfig;
100
+ }) => Promise<void>;
101
+ declare function _defaultMapTemplate(indexedImportMap: Map<string, ModuleExports>, framework?: string): string;
102
+ export {};
103
+ //# sourceMappingURL=import-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import-map.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/import-map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAQhD,eAAO,MAAM,SAAS,GAAI,2BAEvB;IACD,oBAAoB,CAAC,EAAE,OAAO,gBAAgB,CAAC;CAChD,SAEA,CAAC;AAEF;;;;GAIG;AACH,eAAO,IAAI,YAAY,sBAAgB,CAAC;AAExC;;;;;GAKG;AACH,eAAO,IAAI,kBAAkB,4BAAsB,CAAC;AAEpD,eAAO,MAAM,eAAe;;wBASJ,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM;CAO/E,CAAC;AAmBF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,0BAA0B,GAAG,kBAAkB,GAAG;IAC5D;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC;IAC1E;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,KAAK,MAAM,CAAC;CAC3E,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAE1B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,YAAY,EAAE,CAAC,iBAAiB,KAAG,WAAW,GAAG,IA4BlF,CAAC;AAIF,eAAO,MAAM,mBAAmB,GAC9B,aAAa,MAAM,EACnB,YAAY,MAAM,EAClB,YAAY,OAAO,GAAG,SAAS,GAAG,WAAW,WAQ9C,CAAC;AAGF,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,8BAkKrC;AAyCD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,0BAA0B,MAC/C,eAAc;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAA;CAAO,kBA0C/D,CAAC;AAGF,iBAAS,mBAAmB,CAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,SAAS,SAAS,UAsF5F"}
@@ -1,75 +1,76 @@
1
- /**
2
- * Parse the generated component-map file and return all referenced modules
3
- * per map entry (handles both single identifiers and spread objects).
4
- * @param {string} appRoot path to the JSS app root
5
- * @param {string} componentMapPath path to the component map file
6
- * @returns map of component names and their respective import strings
7
- */
8
- export declare let resolveComponentImportFiles: typeof _resolveComponentImportFiles;
9
- /**
10
- * Reads the named exports from a TypeScript file.
11
- * @param {ExtractedFile} filePath absolute path to a .ts/.tsx file
12
- * @returns {string[]} list of named exports found in the file
13
- */
14
- export declare let readNamedExports: typeof _readNamedExports;
15
- /**
16
- * Sends the extracted code to the specified target URL.
17
- * @param {object} params - The parameters object.
18
- * @param {ExtractedFile} params.file - The file to be sent.
19
- * @param {string} params.token - The access token for authentication.
20
- * @param {string} params.targetUrl - The target URL to send the file to.
21
- * @param {Record<string, unknown>} [params.extraLabels] - Additional labels to include in the payload.
22
- * @returns {Promise<string | null>} - The path of the sent file or null if sending failed.
23
- */
24
- export declare let sendCode: typeof _sendCode;
25
- export declare const utilsUnitMocks: {
26
- xmCloudDeploy: () => boolean;
27
- resolveComponentImportFiles: typeof _resolveComponentImportFiles;
28
- readNamedExports: typeof _readNamedExports;
29
- sendCode: typeof _sendCode;
30
- };
31
- /**
32
- * Description properties for the files sent to the mesh endpoint
33
- */
34
- export type ExtractedFile = {
35
- name: string;
36
- path: string;
37
- type: ExtractedFileType;
38
- labels?: Record<string, unknown>;
39
- };
40
- /**
41
- * Type of file to be sent to the mesh endpoint
42
- */
43
- export declare enum ExtractedFileType {
44
- Component = "component",
45
- Variant = "variant",
46
- Json = "json",
47
- PackageJson = "package.json"
48
- }
49
- export type ResolvedImport = {
50
- componentKey: string;
51
- filePath: string;
52
- fileType: ExtractedFileType;
53
- };
54
- export declare const utils: {
55
- xmCloudDeploy: () => boolean;
56
- };
57
- export declare const _xmCloudDeploy: () => boolean;
58
- /**
59
- * Validates if the current operation is done in Vercel, Netlify or XMCloud
60
- * deploy context
61
- * @returns {boolean} - true if in deploy context, false otherwise
62
- */
63
- export declare function validateDeployContext(): boolean;
64
- declare function _resolveComponentImportFiles(appRoot: string, componentMapPath?: string): ResolvedImport[];
65
- declare function _readNamedExports(filePath: string): string[];
66
- declare function _sendCode({ file, token, targetUrl, }: {
67
- file: ExtractedFile;
68
- token: string;
69
- targetUrl: string;
70
- }): Promise<string | null>;
71
- export declare function toPosixPath(p: string): string;
72
- export declare const stripExtension: (p: string) => string;
73
- export declare const getRelativeImportPath: (absFile: string, appPath: string) => string;
74
- export declare const isNodeModuleImport: (name: string) => boolean;
75
- export {};
1
+ /**
2
+ * Parse the generated component-map file and return all referenced modules
3
+ * per map entry (handles both single identifiers and spread objects).
4
+ * @param {string} appRoot path to the JSS app root
5
+ * @param {string} componentMapPath path to the component map file
6
+ * @returns map of component names and their respective import strings
7
+ */
8
+ export declare let resolveComponentImportFiles: typeof _resolveComponentImportFiles;
9
+ /**
10
+ * Reads the named exports from a TypeScript file.
11
+ * @param {ExtractedFile} filePath absolute path to a .ts/.tsx file
12
+ * @returns {string[]} list of named exports found in the file
13
+ */
14
+ export declare let readNamedExports: typeof _readNamedExports;
15
+ /**
16
+ * Sends the extracted code to the specified target URL.
17
+ * @param {object} params - The parameters object.
18
+ * @param {ExtractedFile} params.file - The file to be sent.
19
+ * @param {string} params.token - The access token for authentication.
20
+ * @param {string} params.targetUrl - The target URL to send the file to.
21
+ * @param {Record<string, unknown>} [params.extraLabels] - Additional labels to include in the payload.
22
+ * @returns {Promise<string | null>} - The path of the sent file or null if sending failed.
23
+ */
24
+ export declare let sendCode: typeof _sendCode;
25
+ export declare const utilsUnitMocks: {
26
+ xmCloudDeploy: () => boolean;
27
+ resolveComponentImportFiles: typeof _resolveComponentImportFiles;
28
+ readNamedExports: typeof _readNamedExports;
29
+ sendCode: typeof _sendCode;
30
+ };
31
+ /**
32
+ * Description properties for the files sent to the mesh endpoint
33
+ */
34
+ export type ExtractedFile = {
35
+ name: string;
36
+ path: string;
37
+ type: ExtractedFileType;
38
+ labels?: Record<string, unknown>;
39
+ };
40
+ /**
41
+ * Type of file to be sent to the mesh endpoint
42
+ */
43
+ export declare enum ExtractedFileType {
44
+ Component = "component",
45
+ Variant = "variant",
46
+ Json = "json",
47
+ PackageJson = "package.json"
48
+ }
49
+ export type ResolvedImport = {
50
+ componentKey: string;
51
+ filePath: string;
52
+ fileType: ExtractedFileType;
53
+ };
54
+ export declare const utils: {
55
+ xmCloudDeploy: () => boolean;
56
+ };
57
+ export declare const _xmCloudDeploy: () => boolean;
58
+ /**
59
+ * Validates if the current operation is done in Vercel, Netlify or XMCloud
60
+ * deploy context
61
+ * @returns {boolean} - true if in deploy context, false otherwise
62
+ */
63
+ export declare function validateDeployContext(): boolean;
64
+ declare function _resolveComponentImportFiles(appRoot: string, componentMapPath?: string): ResolvedImport[];
65
+ declare function _readNamedExports(filePath: string): string[];
66
+ declare function _sendCode({ file, token, targetUrl, }: {
67
+ file: ExtractedFile;
68
+ token: string;
69
+ targetUrl: string;
70
+ }): Promise<string | null>;
71
+ export declare function toPosixPath(p: string): string;
72
+ export declare const stripExtension: (p: string) => string;
73
+ export declare const getRelativeImportPath: (absFile: string, appPath: string) => string;
74
+ export declare const isNodeModuleImport: (name: string) => boolean;
75
+ export {};
76
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/codegen/utils.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,eAAO,IAAI,2BAA2B,qCAA+B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,IAAI,gBAAgB,0BAAoB,CAAC;AAEhD;;;;;;;;GAQG;AACH,eAAO,IAAI,QAAQ,kBAAY,CAAC;AAEhC,eAAO,MAAM,cAAc;mBACG,MAAM,OAAO;;;;CAwB1C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,iBAAiB,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,WAAW,iBAAiB;CAC7B;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,iBAAiB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE;IAClB,aAAa,EAAE,MAAM,OAAO,CAAC;CAG9B,CAAC;AAEF,eAAO,MAAM,cAAc,eAA+D,CAAC;AAM3F;;;;GAIG;AACH,wBAAgB,qBAAqB,YAEpC;AAwDD,iBAAS,4BAA4B,CACnC,OAAO,EAAE,MAAM,EACf,gBAAgB,GAAE,MAAuC,GACxD,cAAc,EAAE,CA+KlB;AAED,iBAAS,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAqCrD;AAED,iBAAe,SAAS,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,SAAS,GACV,EAAE;IACD,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,0BAqDA;AAiBD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,UAGpC;AAED,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,WAA4C,CAAC;AAGrF,eAAO,MAAM,qBAAqB,GAAI,SAAS,MAAM,EAAE,SAAS,MAAM,WAGrE,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,YAC6B,CAAC"}
@@ -1,26 +1,36 @@
1
- import { ComponentImport, ComponentMapTemplate, EnhancedComponentMapTemplate } from './templating';
2
- export type GenerateMapFunction = (args: GenerateMapArgs) => void;
3
- /**
4
- * Arguments for the generateMap function.
5
- * @typedef GenerateMapArgs
6
- * @property {string[]} paths - Array of component paths to include in component map.
7
- * @property {string} [destination='src/.sitecore'] - Destination folder path for the generated map.
8
- * @property {ComponentImport[]} [componentImports] - Optional array of package definitions for component imports to include in the map.
9
- * @property {string[]} [exclude] - Optional array of glob paths to exclude from the map.
10
- * @property {ComponentMapTemplate | EnhancedComponentMapTemplate} [mapTemplate] - Optional custom template function to generate the main component map content.
11
- * @property {ComponentMapTemplate | EnhancedComponentMapTemplate} [clientMapTemplate] - Optional custom template function to generate the client component map content (only used when clientComponentMap is true).
12
- * @property {boolean} [clientComponentMap] - Optional flag to generate separate client and server component maps. When true,
13
- * generates both component-map.ts (all components) and component-map.client.ts (client + universal only).
14
- * When false or undefined, generates single component-map.ts (traditional behavior).
15
- * @property {boolean} [ includeVariants] - Optional flag to include component's variants path in the component map.
16
- */
17
- export type GenerateMapArgs = {
18
- paths: string[];
19
- destination?: string;
20
- componentImports?: ComponentImport[];
21
- exclude?: string[];
22
- mapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
23
- clientMapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
24
- clientComponentMap?: boolean;
25
- includeVariants?: boolean;
26
- };
1
+ import { ComponentImport, ComponentMapTemplate, EnhancedComponentMapTemplate } from './templating';
2
+ /**
3
+ * @public
4
+ */
5
+ export type GenerateMapFunction = (args: GenerateMapArgs) => void;
6
+ /**
7
+ * Arguments for the generateMap function.
8
+ * This type defines all configuration options for generating Sitecore component maps.
9
+ * Component maps can be generated as a single file or split into server/client variants.
10
+ * @public
11
+ */
12
+ export type GenerateMapArgs = {
13
+ /** Array of component paths to include in component map. */
14
+ paths: string[];
15
+ /** Destination folder path for the generated map. @defaultValue 'src/.sitecore' */
16
+ destination?: string;
17
+ /** Optional array of package definitions for component imports to include in the map. */
18
+ componentImports?: ComponentImport[];
19
+ /** Optional array of glob paths to exclude from the map. */
20
+ exclude?: string[];
21
+ /** Optional custom template function to generate the main component map content. */
22
+ mapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
23
+ /**
24
+ * Optional custom template function to generate the client component map content (only used when clientComponentMap is true).
25
+ */
26
+ clientMapTemplate?: ComponentMapTemplate | EnhancedComponentMapTemplate;
27
+ /**
28
+ * Optional flag to generate separate client and server component maps. When true,
29
+ * generates both component-map.ts (all components) and component-map.client.ts (client + universal only).
30
+ * When false or undefined, generates single component-map.ts (traditional behavior).
31
+ */
32
+ clientComponentMap?: boolean;
33
+ /** Optional flag to include component's variants path in the component map. */
34
+ includeVariants?: boolean;
35
+ };
36
+ //# sourceMappingURL=generate-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-map.d.ts","sourceRoot":"","sources":["../../src/tools/generate-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,4DAA4D;IAC5D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,mFAAmF;IACnF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IACrC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,oFAAoF;IACpF,WAAW,CAAC,EAAE,oBAAoB,GAAG,4BAA4B,CAAC;IAClE;;OAEG;IACH,iBAAiB,CAAC,EAAE,oBAAoB,GAAG,4BAA4B,CAAC;IACxE;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+EAA+E;IAC/E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC"}
@@ -1,22 +1,24 @@
1
- /**
2
- * Configuration options for generating metadata.
3
- */
4
- export type GenerateMetadataConfig = {
5
- /**
6
- * Optional path where the generated metadata will be saved.
7
- * If not provided, the default '.sitecore/metadata.json' will be used.
8
- */
9
- destinationPath?: string;
10
- /**
11
- * Optional flag to allow npm workspaces in the metadata generation. Should be kept as false for non-npm monorepos.
12
- * If not provided, the default is false.
13
- */
14
- allowWorkspaces?: boolean;
15
- };
16
- /**
17
- * Generate application metadata
18
- * @param {GenerateMetadataConfig} config - Optional configuration for generating metadata.
19
- * If not provided, the default '.sitecore/metadata.json' will be used and allowWorkspaces will be set to false.
20
- * @returns {Promise<void>} A promise that resolves when the metadata generation is complete.
21
- */
22
- export declare const generateMetadata: (config?: GenerateMetadataConfig) => (() => Promise<void>);
1
+ /**
2
+ * Configuration options for generating metadata.
3
+ */
4
+ export type GenerateMetadataConfig = {
5
+ /**
6
+ * Optional path where the generated metadata will be saved.
7
+ * If not provided, the default '.sitecore/metadata.json' will be used.
8
+ */
9
+ destinationPath?: string;
10
+ /**
11
+ * Optional flag to allow npm workspaces in the metadata generation. Should be kept as false for non-npm monorepos.
12
+ * If not provided, the default is false.
13
+ */
14
+ allowWorkspaces?: boolean;
15
+ };
16
+ /**
17
+ * Generate application metadata
18
+ * @param {GenerateMetadataConfig} config - Optional configuration for generating metadata.
19
+ * If not provided, the default '.sitecore/metadata.json' will be used and allowWorkspaces will be set to false.
20
+ * @returns {Promise<void>} A promise that resolves when the metadata generation is complete.
21
+ * @public
22
+ */
23
+ export declare const generateMetadata: (config?: GenerateMetadataConfig) => (() => Promise<void>);
24
+ //# sourceMappingURL=generateMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateMetadata.d.ts","sourceRoot":"","sources":["../../src/tools/generateMetadata.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,sBAAsB,KAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAKtF,CAAC"}