@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,22 +1,25 @@
1
- import { SitecoreConfig } from '../config';
2
- /**
3
- * Configuration object for generating sites.
4
- */
5
- export type GenerateSitesConfig = {
6
- /**
7
- * The Sitecore configuration used at build and run time.
8
- * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
9
- */
10
- scConfig?: SitecoreConfig;
11
- /**
12
- * Optional path where the generated sites will be saved.
13
- * If not provided, the default '.sitecore/sites.json' will be used.
14
- */
15
- destinationPath?: string;
16
- };
17
- /**
18
- * Generates site information and writes it to a specified destination path.
19
- * @param {GenerateSitesConfig} config - The configuration for generating site info.
20
- * @returns {Promise<Function>} - A promise that resolves to an asynchronous function that fetches site information and writes it to a file.
21
- */
22
- export declare const generateSites: ({ scConfig: deprecatedScConfig, destinationPath, }?: GenerateSitesConfig) => (() => Promise<void>);
1
+ import { SitecoreConfig } from '../config';
2
+ /**
3
+ * Configuration object for generating sites.
4
+ * @public
5
+ */
6
+ export type GenerateSitesConfig = {
7
+ /**
8
+ * The Sitecore configuration used at build and run time.
9
+ * @deprecated Pass `config` to the `defineCliConfig` function instead. This argument will be removed in the next major version.
10
+ */
11
+ scConfig?: SitecoreConfig;
12
+ /**
13
+ * Optional path where the generated sites will be saved.
14
+ * If not provided, the default '.sitecore/sites.json' will be used.
15
+ */
16
+ destinationPath?: string;
17
+ };
18
+ /**
19
+ * Generates site information and writes it to a specified destination path.
20
+ * @param {GenerateSitesConfig} config - The configuration for generating site info.
21
+ * @returns {Promise<Function>} - A promise that resolves to an asynchronous function that fetches site information and writes it to a file.
22
+ * @public
23
+ */
24
+ export declare const generateSites: ({ scConfig: deprecatedScConfig, destinationPath, }?: GenerateSitesConfig) => (() => Promise<void>);
25
+ //# sourceMappingURL=generateSites.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateSites.d.ts","sourceRoot":"","sources":["../../src/tools/generateSites.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAK3C;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,CAAC;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,qDAG3B,mBAAwB,KAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CA8CjD,CAAC"}
@@ -1,20 +1,22 @@
1
- export { generateSites, GenerateSitesConfig } from './generateSites';
2
- export { generateMetadata } from './generateMetadata';
3
- export { scaffoldComponent } from './scaffold';
4
- export { GenerateMapFunction, GenerateMapArgs } from './generate-map';
5
- export { extractFiles } from './codegen/extract-files';
6
- export { writeImportMap } from './codegen/import-map';
7
- export { getComponentSpec, getComponentSpecUrl } from './codegen/component-generation';
8
- export * from './templating';
9
- export * from './auth/models';
10
- import * as authModule from './auth';
11
- /**
12
- * Preserve "live binding" semantics similar to ES module imports: production
13
- * code always sees the current implementation; tests can swap it safely and
14
- * restore via `sandbox.restore()` with no hidden global state.
15
- *
16
- * Public surface consumed by the rest of the codebase.
17
- */
18
- export declare const auth: {
19
- readonly clientCredentialsFlow: typeof authModule.clientCredentialsFlow;
20
- };
1
+ export { generateSites, GenerateSitesConfig } from './generateSites';
2
+ export { generateMetadata } from './generateMetadata';
3
+ export { scaffoldComponent } from './scaffold';
4
+ export { GenerateMapFunction, GenerateMapArgs } from './generate-map';
5
+ export { extractFiles } from './codegen/extract-files';
6
+ export { writeImportMap, WriteImportMapArgs, WriteImportMapArgsInternal, defaultMapTemplate as defaultImportMapTemplate, ModuleExports, } from './codegen/import-map';
7
+ export { getComponentSpec, getComponentSpecUrl } from './codegen/component-generation';
8
+ export * from './templating';
9
+ export * from './auth/models';
10
+ import * as authModule from './auth';
11
+ /**
12
+ * Preserve "live binding" semantics similar to ES module imports: production
13
+ * code always sees the current implementation; tests can swap it safely and
14
+ * restore via `sandbox.restore()` with no hidden global state.
15
+ *
16
+ * Public surface consumed by the rest of the codebase.
17
+ * @public
18
+ */
19
+ export declare const auth: {
20
+ readonly clientCredentialsFlow: typeof authModule.clientCredentialsFlow;
21
+ };
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,0BAA0B,EAC1B,kBAAkB,IAAI,wBAAwB,EAC9C,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACvF,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,OAAO,KAAK,UAAU,MAAM,QAAQ,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,EAAE;IACjB,QAAQ,CAAC,qBAAqB,EAAE,OAAO,UAAU,CAAC,qBAAqB,CAAC;CAC7D,CAAC"}
@@ -1,25 +1,27 @@
1
- import { ScaffoldTemplate } from '../config';
2
- /**
3
- * Force to use `crlf` line endings, we are using `crlf` across the project.
4
- * Replace: `lf` (\n), `cr` (\r)
5
- * @param {string} content
6
- */
7
- export declare function editLineEndings(content: string): string;
8
- /**
9
- * Creates a file relative to the specified path if the file doesn't exist.
10
- * Creates directories as needed.
11
- * Does not overwrite existing files.
12
- * @param {string} filePath - the file path
13
- * @param {string} fileContent - the file content
14
- * @returns {string} the file path if the file was created, otherwise null
15
- */
16
- export declare function scaffoldFile(filePath: string, fileContent: string): string | null;
17
- /**
18
- * Scaffolds a new component based on the provided template.
19
- * @param {string} outputFolderPath - The file path where the component will be created.
20
- * @param {string} componentName - The name of the component to be created.
21
- * @param {string} templateName - The name of the template to use for scaffolding. If not provided, defaults to 'byoc' if `byoc` is true, otherwise 'default'.
22
- * @param {ScaffoldTemplate[]} templates - An array of template objects, each containing a name, a template function, and a getNextSteps function.
23
- * @throws Will throw an error if the specified template is not found.
24
- */
25
- export declare function scaffoldComponent(outputFolderPath: string, componentName: string, templateName: string, templates: ScaffoldTemplate[]): void;
1
+ import { ScaffoldTemplate } from '../config';
2
+ /**
3
+ * Force to use `crlf` line endings, we are using `crlf` across the project.
4
+ * Replace: `lf` (\n), `cr` (\r)
5
+ * @param {string} content
6
+ */
7
+ export declare function editLineEndings(content: string): string;
8
+ /**
9
+ * Creates a file relative to the specified path if the file doesn't exist.
10
+ * Creates directories as needed.
11
+ * Does not overwrite existing files.
12
+ * @param {string} filePath - the file path
13
+ * @param {string} fileContent - the file content
14
+ * @returns {string} the file path if the file was created, otherwise null
15
+ */
16
+ export declare function scaffoldFile(filePath: string, fileContent: string): string | null;
17
+ /**
18
+ * Scaffolds a new component based on the provided template.
19
+ * @param {string} outputFolderPath - The file path where the component will be created.
20
+ * @param {string} componentName - The name of the component to be created.
21
+ * @param {string} templateName - The name of the template to use for scaffolding. If not provided, defaults to 'byoc' if `byoc` is true, otherwise 'default'.
22
+ * @param {ScaffoldTemplate[]} templates - An array of template objects, each containing a name, a template function, and a getNextSteps function.
23
+ * @throws Will throw an error if the specified template is not found.
24
+ * @internal
25
+ */
26
+ export declare function scaffoldComponent(outputFolderPath: string, componentName: string, templateName: string, templates: ScaffoldTemplate[]): void;
27
+ //# sourceMappingURL=scaffold.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/tools/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,UAE9C;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAajF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,gBAAgB,EAAE,GAC5B,IAAI,CAwBN"}
@@ -1,103 +1,104 @@
1
- export declare let getComponentList: typeof _getComponentList;
2
- export declare const componentUnitMocks: {
3
- getComponentList: typeof _getComponentList;
4
- };
5
- export type ComponentType = 'server' | 'client' | 'universal';
6
- export type RouterType = 'app' | 'pages';
7
- export type ComponentMapTemplate = (components: (ComponentFile | ComponentFileWithType)[], componentImports?: ComponentImport[]) => string;
8
- export type EnhancedComponentMapTemplate = (components: (ComponentFile | ComponentFileWithType)[], componentImports: ComponentImport[] | undefined, ctx: {
9
- entries: ComponentMapEntry[];
10
- includeVariants: boolean;
11
- isClientMap: boolean;
12
- }) => string;
13
- export type ComponentMapEntry = {
14
- /** map entry key */
15
- key: string;
16
- /** namespace import lines needed for this entry */
17
- imports: string[];
18
- /** whether base is client (and we're in main map) */
19
- annotateClient: boolean;
20
- /** expression used as the map value */
21
- valueExpr: string;
22
- };
23
- /**
24
- * Definition for a component file
25
- */
26
- export interface ComponentFile {
27
- /** The original file path of the component */
28
- filePath: string;
29
- /** Normalized path that can be used for import statements */
30
- importPath: string;
31
- /** Normalized name that can be used as import */
32
- moduleName: string;
33
- /** Name of the code file */
34
- componentName: string;
35
- /** Detected component type (server, client, or universal) */
36
- componentType?: ComponentType;
37
- }
38
- export interface ComponentFileWithType extends ComponentFile {
39
- /** Detected component type (server, client, or universal) */
40
- componentType: ComponentType;
41
- }
42
- /**
43
- * Definition for custom components to be included in component map.
44
- * Use this to define components imported from modules/dependencies/packages
45
- */
46
- export interface ComponentImport {
47
- /** The name of the import (e.g., 'MyComponent')*/
48
- importName: string;
49
- /** Information about how to import the package */
50
- importInfo: {
51
- /** The path from which to import the component(s) */
52
- importFrom: string;
53
- /** The specific named components to import from the package. Leave empty to have whole package be imported as wildcard and allow SXA variants support for component. */
54
- namedImports?: string[];
55
- };
56
- }
57
- /**
58
- * Get list of components from @var path
59
- * Returns a list of components in the following format:
60
- * {
61
- * path: 'path/to/component',
62
- * componentName: 'ComponentName',
63
- * moduleName: 'ComponentName'
64
- * }
65
- * @param {string[]} paths paths to search
66
- * @param {string[]} [exclude] paths and glob patterns to exclude from final result
67
- * @param {boolean} [includeVariants] whether to include variant components
68
- */
69
- declare function _getComponentList(paths: string[], exclude?: string[], includeVariants?: boolean): ComponentFile[];
70
- /**
71
- * Detects the Next.js router type (App Router or Pages Router) based on directory structure.
72
- * @param {string} projectRoot - The project root directory. Defaults to current working directory.
73
- * @returns {RouterType} 'app' if App Router is detected, 'pages' otherwise
74
- */
75
- export declare function detectRouterType(projectRoot?: string): RouterType;
76
- /**
77
- * Detects the component type based on directives, imports, and router context.
78
- * - Checks for 'use client' directive
79
- * - Checks for explicit componentType export
80
- * - Checks for server-only imports (next/headers, etc.)
81
- * - Defaults to 'server' for App Router, 'universal' for Pages Router
82
- * @param {string} filePath - Path to the component file
83
- * @param {RouterType} [routerType] - Optional router type override. Auto-detected if not provided.
84
- * @returns {ComponentType} 'server', 'client', or 'universal'
85
- */
86
- export declare function detectComponentType(filePath: string, routerType?: RouterType): ComponentType;
87
- /**
88
- * Get list of components with detected types (server, client, or universal).
89
- * @param {string[]} paths - Paths to search for components
90
- * @param {string[]} [exclude] - Paths and glob patterns to exclude from final result
91
- * @param {boolean} includeVariants - Whether to include variant components
92
- * @param {RouterType} [routerType] - Optional router type override for type detection. Auto-detected if not provided.
93
- * @returns {ComponentFileWithType[]} Array of components with their detected types
94
- */
95
- export declare function getComponentListWithTypes(paths: string[], exclude?: string[], includeVariants?: boolean, routerType?: RouterType): ComponentFileWithType[];
96
- /**
97
- * Filters components by their detected type.
98
- * @param {ComponentFileWithType[]} components - Array of components with types
99
- * @param {ComponentType[]} allowedTypes - Array of allowed component types to filter by
100
- * @returns {ComponentFileWithType[]} Filtered array containing only components matching allowed types
101
- */
102
- export declare function filterComponentsByType(components: ComponentFileWithType[], allowedTypes: ComponentType[]): ComponentFileWithType[];
103
- export {};
1
+ /**
2
+ * @public
3
+ */
4
+ export declare let getComponentList: typeof _getComponentList;
5
+ export declare const componentUnitMocks: {
6
+ getComponentList: typeof _getComponentList;
7
+ };
8
+ /**
9
+ * @internal
10
+ */
11
+ export type ComponentType = 'server' | 'client' | 'universal';
12
+ /**
13
+ * @internal
14
+ */
15
+ export type RouterType = 'app' | 'pages';
16
+ /**
17
+ * @internal
18
+ */
19
+ export type ComponentMapTemplate = (components: (ComponentFile | ComponentFileWithType)[], componentImports?: ComponentImport[]) => string;
20
+ /**
21
+ * @internal
22
+ */
23
+ export type EnhancedComponentMapTemplate = (components: (ComponentFile | ComponentFileWithType)[], componentImports: ComponentImport[] | undefined, ctx: {
24
+ entries: ComponentMapEntry[];
25
+ includeVariants: boolean;
26
+ isClientMap: boolean;
27
+ }) => string;
28
+ /**
29
+ * An entry in the component map, including import lines and value expression.
30
+ * @internal
31
+ */
32
+ export type ComponentMapEntry = {
33
+ /** map entry key */
34
+ key: string;
35
+ /** namespace import lines needed for this entry */
36
+ imports: string[];
37
+ /** whether base is client (and we're in main map) */
38
+ annotateClient: boolean;
39
+ /** expression used as the map value */
40
+ valueExpr: string;
41
+ };
42
+ /**
43
+ * Definition for a component file
44
+ * @public
45
+ */
46
+ export interface ComponentFile {
47
+ /** The original file path of the component */
48
+ filePath: string;
49
+ /** Normalized path that can be used for import statements */
50
+ importPath: string;
51
+ /** Normalized name that can be used as import */
52
+ moduleName: string;
53
+ /** Name of the code file */
54
+ componentName: string;
55
+ /** Detected component type (server, client, or universal) */
56
+ componentType?: ComponentType;
57
+ }
58
+ /**
59
+ * Definition for a component file with guaranteed componentType
60
+ * @internal
61
+ */
62
+ export interface ComponentFileWithType extends ComponentFile {
63
+ /** Detected component type (server, client, or universal) */
64
+ componentType: ComponentType;
65
+ }
66
+ /**
67
+ * Definition for custom components to be included in component map.
68
+ * Use this to define components imported from modules/dependencies/packages
69
+ * @public
70
+ */
71
+ export interface ComponentImport {
72
+ /** The name of the import (e.g., 'MyComponent')*/
73
+ importName: string;
74
+ /** Information about how to import the package */
75
+ importInfo: {
76
+ /** The path from which to import the component(s) */
77
+ importFrom: string;
78
+ /** The specific named components to import from the package. Leave empty to have whole package be imported as wildcard and allow SXA variants support for component. */
79
+ namedImports?: string[];
80
+ };
81
+ }
82
+ /**
83
+ * Get list of components from @var path
84
+ * Returns a list of components in the following format:
85
+ * {
86
+ * path: 'path/to/component',
87
+ * componentName: 'ComponentName',
88
+ * moduleName: 'ComponentName'
89
+ * }
90
+ * @param {string[]} paths paths to search
91
+ * @param {string[]} [exclude] paths and glob patterns to exclude from final result
92
+ * @param {boolean} [includeVariants] whether to include variant components
93
+ */
94
+ declare function _getComponentList(paths: string[], exclude?: string[], includeVariants?: boolean): ComponentFile[];
95
+ /**
96
+ * Filters components by their detected type.
97
+ * @param {ComponentFileWithType[]} components - Array of components with types
98
+ * @param {ComponentType[]} allowedTypes - Array of allowed component types to filter by
99
+ * @returns {ComponentFileWithType[]} Filtered array containing only components matching allowed types
100
+ * @internal
101
+ */
102
+ export declare function filterComponentsByType(components: ComponentFileWithType[], allowedTypes: ComponentType[]): ComponentFileWithType[];
103
+ export {};
104
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/components.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,IAAI,gBAAgB,0BAAoB,CAAC;AAEhD,eAAO,MAAM,kBAAkB;;CAO9B,CAAC;AAMF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,OAAO,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CACjC,UAAU,EAAE,CAAC,aAAa,GAAG,qBAAqB,CAAC,EAAE,EACrD,gBAAgB,CAAC,EAAE,eAAe,EAAE,KACjC,MAAM,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,CACzC,UAAU,EAAE,CAAC,aAAa,GAAG,qBAAqB,CAAC,EAAE,EACrD,gBAAgB,EAAE,eAAe,EAAE,GAAG,SAAS,EAC/C,GAAG,EAAE;IACH,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB,KACE,MAAM,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,mDAAmD;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qDAAqD;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,uCAAuC;IACvC,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,6DAA6D;IAC7D,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,UAAU,EAAE;QACV,qDAAqD;QACrD,UAAU,EAAE,MAAM,CAAC;QACnB,wKAAwK;QACxK,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB,CAAC;CACH;AAED;;;;;;;;;;;GAWG;AACH,iBAAS,iBAAiB,CACxB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,eAAe,CAAC,EAAE,OAAO,GACxB,aAAa,EAAE,CAyBjB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,qBAAqB,EAAE,EACnC,YAAY,EAAE,aAAa,EAAE,GAC5B,qBAAqB,EAAE,CAEzB"}
@@ -1,3 +1,4 @@
1
- export { ComponentFile, ComponentImport, ComponentFileWithType, ComponentType, RouterType, getComponentList, detectRouterType, detectComponentType, getComponentListWithTypes, filterComponentsByType, ComponentMapEntry, ComponentMapTemplate, EnhancedComponentMapTemplate, } from './components';
2
- export { PluginDefinition, generatePlugins, ModuleType } from './plugins';
3
- export { matchPath } from './utils';
1
+ export { ComponentFile, ComponentImport, ComponentFileWithType, ComponentType, RouterType, getComponentList, filterComponentsByType, ComponentMapEntry, ComponentMapTemplate, EnhancedComponentMapTemplate, } from './components';
2
+ export { PluginDefinition, generatePlugins, ModuleType } from './plugins';
3
+ export { matchPath } from './utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,GAC7B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -1,67 +1,71 @@
1
- /**
2
- * Identifies the format of the module to be compiled
3
- */
4
- export declare enum ModuleType {
5
- CJS = 0,
6
- ESM = 1
7
- }
8
- /**
9
- * Type to specify plugin file details
10
- */
11
- export interface PluginFile {
12
- path: string;
13
- name: string;
14
- }
15
- /**
16
- * Definition to be used for plugin registration during bootstrap
17
- */
18
- export interface PluginDefinition {
19
- /**
20
- * destination path to compile plugins to
21
- */
22
- distPath: string;
23
- /**
24
- * source path for where the plugins are defined
25
- */
26
- rootPath: string;
27
- /**
28
- * CJS or ESM - which type to compile plugins to
29
- */
30
- moduleType: ModuleType;
31
- /**
32
- * whether to use relative or absolute paths in the generated file. By default, absolute paths are used.
33
- */
34
- relative?: boolean;
35
- /**
36
- * whether to suppress console output
37
- */
38
- silent?: boolean;
39
- }
40
- /**
41
- * Get list of plugins from @var path
42
- * Returns a list of plugins in the following format:
43
- * {
44
- * path: 'path/to/plugin/foo',
45
- * name: 'fooPlugin'
46
- * }
47
- * @example getPluginList('src/foo/plugins', 'Foo')
48
- * @param {object} definition plugin definition
49
- * @param {string} definition.path path to get plugin from
50
- * @param {string} definition.pluginName plugin name
51
- * @param {boolean} [definition.silent] whether to suppress console output
52
- */
53
- export declare function getPluginList({ path, pluginName, silent, }: {
54
- path: string;
55
- pluginName: string;
56
- silent?: boolean;
57
- }): PluginFile[];
58
- /**
59
- * Generates the plugins file and saves it to the filesystem.
60
- * By convention, we expect to find plugins under {pluginName}/plugins/** (subfolders are searched recursively).
61
- * generated file will be saved to @var {distPath} and will contain a list of plugins in the following format:
62
- * CJS: exports.fooPlugin = require('{pluginPath}');
63
- * ESM: export { fooPlugin } from '{pluginPath}';
64
- * @example generatePlugins({ distPath: 'src/temp/foo-plugins.js', rootPath: 'src/foo/plugins', moduleType: ModuleType.CJS })
65
- * @param {PluginDefinition} definition plugin definition
66
- */
67
- export declare function generatePlugins(definition: PluginDefinition): void;
1
+ /**
2
+ * Identifies the format of the module to be compiled
3
+ * @public
4
+ */
5
+ export declare enum ModuleType {
6
+ CJS = 0,
7
+ ESM = 1
8
+ }
9
+ /**
10
+ * Type to specify plugin file details
11
+ */
12
+ export interface PluginFile {
13
+ path: string;
14
+ name: string;
15
+ }
16
+ /**
17
+ * Definition to be used for plugin registration during bootstrap
18
+ * @public
19
+ */
20
+ export interface PluginDefinition {
21
+ /**
22
+ * destination path to compile plugins to
23
+ */
24
+ distPath: string;
25
+ /**
26
+ * source path for where the plugins are defined
27
+ */
28
+ rootPath: string;
29
+ /**
30
+ * CJS or ESM - which type to compile plugins to
31
+ */
32
+ moduleType: ModuleType;
33
+ /**
34
+ * whether to use relative or absolute paths in the generated file. By default, absolute paths are used.
35
+ */
36
+ relative?: boolean;
37
+ /**
38
+ * whether to suppress console output
39
+ */
40
+ silent?: boolean;
41
+ }
42
+ /**
43
+ * Get list of plugins from @var path
44
+ * Returns a list of plugins in the following format:
45
+ * {
46
+ * path: 'path/to/plugin/foo',
47
+ * name: 'fooPlugin'
48
+ * }
49
+ * @example getPluginList('src/foo/plugins', 'Foo')
50
+ * @param {object} definition plugin definition
51
+ * @param {string} definition.path path to get plugin from
52
+ * @param {string} definition.pluginName plugin name
53
+ * @param {boolean} [definition.silent] whether to suppress console output
54
+ */
55
+ export declare function getPluginList({ path, pluginName, silent, }: {
56
+ path: string;
57
+ pluginName: string;
58
+ silent?: boolean;
59
+ }): PluginFile[];
60
+ /**
61
+ * Generates the plugins file and saves it to the filesystem.
62
+ * By convention, we expect to find plugins under {pluginName}/plugins/** (subfolders are searched recursively).
63
+ * generated file will be saved to @var {distPath} and will contain a list of plugins in the following format:
64
+ * CJS: exports.fooPlugin = require('{pluginPath}');
65
+ * ESM: export { fooPlugin } from '{pluginPath}';
66
+ * @example generatePlugins({ distPath: 'src/temp/foo-plugins.js', rootPath: 'src/foo/plugins', moduleType: ModuleType.CJS })
67
+ * @param {PluginDefinition} definition plugin definition
68
+ * @public
69
+ */
70
+ export declare function generatePlugins(definition: PluginDefinition): void;
71
+ //# sourceMappingURL=plugins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/plugins.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,oBAAY,UAAU;IACpB,GAAG,IAAA;IACH,GAAG,IAAA;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,EAC5B,IAAI,EACJ,UAAU,EACV,MAAc,GACf,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,GAAG,UAAU,EAAE,CAWf;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,gBAAgB,QA8B3D"}
@@ -1,40 +1,42 @@
1
- /**
2
- * Settings for @var getItems function
3
- */
4
- export type GetItemsSettings<Item> = {
5
- /**
6
- * items path
7
- */
8
- path: string;
9
- /**
10
- * Resolve item in required data format
11
- */
12
- resolveItem: (path: string, name: string) => Item;
13
- /**
14
- * Will be called when new file is found
15
- */
16
- cb?: (name: string) => void;
17
- exclude?: string[];
18
- /**
19
- * Matches specific files format
20
- */
21
- fileFormat?: RegExp;
22
- /**
23
- * Wether to search recursively
24
- */
25
- recursive?: boolean;
26
- };
27
- /**
28
- * Compares two paths to determine if they match.
29
- * @param {string} itemPath base path to compare against, can be absolute or relative
30
- * @param {string} compare comparer, can be relate, absolute or regex string
31
- * @returns true if paths match, false otherwise
32
- */
33
- export declare const matchPath: (itemPath: string, compare: string) => boolean;
34
- /**
35
- * Using @var path find all files and generate output using @var resolveItem function for each file
36
- * Can be used to generate list of components, templates, etc.
37
- * @param {GetItemsSettings} settings
38
- * @returns {Item[]} list of items
39
- */
40
- export declare function getItems<Item>(settings: GetItemsSettings<Item>): Item[];
1
+ /**
2
+ * Settings for @var getItems function
3
+ */
4
+ export type GetItemsSettings<Item> = {
5
+ /**
6
+ * items path
7
+ */
8
+ path: string;
9
+ /**
10
+ * Resolve item in required data format
11
+ */
12
+ resolveItem: (path: string, name: string) => Item;
13
+ /**
14
+ * Will be called when new file is found
15
+ */
16
+ cb?: (name: string) => void;
17
+ exclude?: string[];
18
+ /**
19
+ * Matches specific files format
20
+ */
21
+ fileFormat?: RegExp;
22
+ /**
23
+ * Wether to search recursively
24
+ */
25
+ recursive?: boolean;
26
+ };
27
+ /**
28
+ * Compares two paths to determine if they match.
29
+ * @param {string} itemPath base path to compare against, can be absolute or relative
30
+ * @param {string} compare comparer, can be relate, absolute or regex string
31
+ * @returns true if paths match, false otherwise
32
+ * @public
33
+ */
34
+ export declare const matchPath: (itemPath: string, compare: string) => boolean;
35
+ /**
36
+ * Using @var path find all files and generate output using @var resolveItem function for each file
37
+ * Can be used to generate list of components, templates, etc.
38
+ * @param {GetItemsSettings} settings
39
+ * @returns {Item[]} list of items
40
+ */
41
+ export declare function getItems<Item>(settings: GetItemsSettings<Item>): Item[];
42
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/templating/utils.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,IAAI,IAAI;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD;;OAEG;IACH,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,KAAG,OAU7D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CA8CvE"}