@slicemachine/adapter-nuxt 0.0.2-dev-plugins-m3.0

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 (343) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +98 -0
  3. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs +41 -0
  4. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
  5. package/dist/_node_modules/data-uri-to-buffer/dist/index.js +41 -0
  6. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
  7. package/dist/_node_modules/fetch-blob/file.cjs +61 -0
  8. package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
  9. package/dist/_node_modules/fetch-blob/file.js +61 -0
  10. package/dist/_node_modules/fetch-blob/file.js.map +1 -0
  11. package/dist/_node_modules/fetch-blob/index.cjs +223 -0
  12. package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
  13. package/dist/_node_modules/fetch-blob/index.js +223 -0
  14. package/dist/_node_modules/fetch-blob/index.js.map +1 -0
  15. package/dist/_node_modules/fetch-blob/streams.cjs +43 -0
  16. package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
  17. package/dist/_node_modules/fetch-blob/streams.js +42 -0
  18. package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
  19. package/dist/_node_modules/formdata-polyfill/esm.min.cjs +116 -0
  20. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
  21. package/dist/_node_modules/formdata-polyfill/esm.min.js +116 -0
  22. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
  23. package/dist/_node_modules/node-domexception/index.cjs +11 -0
  24. package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
  25. package/dist/_node_modules/node-domexception/index.js +10 -0
  26. package/dist/_node_modules/node-domexception/index.js.map +1 -0
  27. package/dist/_node_modules/node-fetch/src/body.cjs +262 -0
  28. package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
  29. package/dist/_node_modules/node-fetch/src/body.js +262 -0
  30. package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
  31. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs +10 -0
  32. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
  33. package/dist/_node_modules/node-fetch/src/errors/abort-error.js +10 -0
  34. package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
  35. package/dist/_node_modules/node-fetch/src/errors/base.cjs +17 -0
  36. package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
  37. package/dist/_node_modules/node-fetch/src/errors/base.js +17 -0
  38. package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
  39. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs +19 -0
  40. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
  41. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js +19 -0
  42. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
  43. package/dist/_node_modules/node-fetch/src/headers.cjs +190 -0
  44. package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
  45. package/dist/_node_modules/node-fetch/src/headers.js +190 -0
  46. package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
  47. package/dist/_node_modules/node-fetch/src/index.cjs +292 -0
  48. package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
  49. package/dist/_node_modules/node-fetch/src/index.js +292 -0
  50. package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
  51. package/dist/_node_modules/node-fetch/src/request.cjs +206 -0
  52. package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
  53. package/dist/_node_modules/node-fetch/src/request.js +206 -0
  54. package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
  55. package/dist/_node_modules/node-fetch/src/response.cjs +122 -0
  56. package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
  57. package/dist/_node_modules/node-fetch/src/response.js +123 -0
  58. package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
  59. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs +12 -0
  60. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
  61. package/dist/_node_modules/node-fetch/src/utils/get-search.js +12 -0
  62. package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
  63. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs +8 -0
  64. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
  65. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js +8 -0
  66. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
  67. package/dist/_node_modules/node-fetch/src/utils/is.cjs +28 -0
  68. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
  69. package/dist/_node_modules/node-fetch/src/utils/is.js +28 -0
  70. package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
  71. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs +356 -0
  72. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
  73. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js +356 -0
  74. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
  75. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs +149 -0
  76. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
  77. package/dist/_node_modules/node-fetch/src/utils/referrer.js +149 -0
  78. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
  79. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs +3822 -0
  80. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
  81. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js +3822 -0
  82. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
  83. package/dist/_virtual/_commonjsHelpers.cjs +5 -0
  84. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  85. package/dist/_virtual/_commonjsHelpers.js +5 -0
  86. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  87. package/dist/_virtual/ponyfill.es2018.cjs +13 -0
  88. package/dist/_virtual/ponyfill.es2018.cjs.map +1 -0
  89. package/dist/_virtual/ponyfill.es2018.js +14 -0
  90. package/dist/_virtual/ponyfill.es2018.js.map +1 -0
  91. package/dist/constants.cjs +5 -0
  92. package/dist/constants.cjs.map +1 -0
  93. package/dist/constants.d.ts +4 -0
  94. package/dist/constants.js +5 -0
  95. package/dist/constants.js.map +1 -0
  96. package/dist/hooks/customType-asset-delete.cjs +31 -0
  97. package/dist/hooks/customType-asset-delete.cjs.map +1 -0
  98. package/dist/hooks/customType-asset-delete.d.ts +3 -0
  99. package/dist/hooks/customType-asset-delete.js +14 -0
  100. package/dist/hooks/customType-asset-delete.js.map +1 -0
  101. package/dist/hooks/customType-asset-read.cjs +34 -0
  102. package/dist/hooks/customType-asset-read.cjs.map +1 -0
  103. package/dist/hooks/customType-asset-read.d.ts +3 -0
  104. package/dist/hooks/customType-asset-read.js +17 -0
  105. package/dist/hooks/customType-asset-read.js.map +1 -0
  106. package/dist/hooks/customType-asset-update.cjs +34 -0
  107. package/dist/hooks/customType-asset-update.cjs.map +1 -0
  108. package/dist/hooks/customType-asset-update.d.ts +3 -0
  109. package/dist/hooks/customType-asset-update.js +16 -0
  110. package/dist/hooks/customType-asset-update.js.map +1 -0
  111. package/dist/hooks/customType-create.cjs +43 -0
  112. package/dist/hooks/customType-create.cjs.map +1 -0
  113. package/dist/hooks/customType-create.d.ts +3 -0
  114. package/dist/hooks/customType-create.js +25 -0
  115. package/dist/hooks/customType-create.js.map +1 -0
  116. package/dist/hooks/customType-delete.cjs +32 -0
  117. package/dist/hooks/customType-delete.cjs.map +1 -0
  118. package/dist/hooks/customType-delete.d.ts +3 -0
  119. package/dist/hooks/customType-delete.js +15 -0
  120. package/dist/hooks/customType-delete.js.map +1 -0
  121. package/dist/hooks/customType-read.cjs +31 -0
  122. package/dist/hooks/customType-read.cjs.map +1 -0
  123. package/dist/hooks/customType-read.d.ts +3 -0
  124. package/dist/hooks/customType-read.js +14 -0
  125. package/dist/hooks/customType-read.js.map +1 -0
  126. package/dist/hooks/customType-rename.cjs +6 -0
  127. package/dist/hooks/customType-rename.cjs.map +1 -0
  128. package/dist/hooks/customType-rename.d.ts +1 -0
  129. package/dist/hooks/customType-rename.js +6 -0
  130. package/dist/hooks/customType-rename.js.map +1 -0
  131. package/dist/hooks/customType-update.cjs +6 -0
  132. package/dist/hooks/customType-update.cjs.map +1 -0
  133. package/dist/hooks/customType-update.d.ts +1 -0
  134. package/dist/hooks/customType-update.js +6 -0
  135. package/dist/hooks/customType-update.js.map +1 -0
  136. package/dist/hooks/customTypeLibrary-read.cjs +53 -0
  137. package/dist/hooks/customTypeLibrary-read.cjs.map +1 -0
  138. package/dist/hooks/customTypeLibrary-read.d.ts +3 -0
  139. package/dist/hooks/customTypeLibrary-read.js +35 -0
  140. package/dist/hooks/customTypeLibrary-read.js.map +1 -0
  141. package/dist/hooks/project-init.cjs +112 -0
  142. package/dist/hooks/project-init.cjs.map +1 -0
  143. package/dist/hooks/project-init.d.ts +3 -0
  144. package/dist/hooks/project-init.js +94 -0
  145. package/dist/hooks/project-init.js.map +1 -0
  146. package/dist/hooks/slice-asset-delete.cjs +33 -0
  147. package/dist/hooks/slice-asset-delete.cjs.map +1 -0
  148. package/dist/hooks/slice-asset-delete.d.ts +3 -0
  149. package/dist/hooks/slice-asset-delete.js +16 -0
  150. package/dist/hooks/slice-asset-delete.js.map +1 -0
  151. package/dist/hooks/slice-asset-read.cjs +36 -0
  152. package/dist/hooks/slice-asset-read.cjs.map +1 -0
  153. package/dist/hooks/slice-asset-read.d.ts +3 -0
  154. package/dist/hooks/slice-asset-read.js +19 -0
  155. package/dist/hooks/slice-asset-read.js.map +1 -0
  156. package/dist/hooks/slice-asset-update.cjs +36 -0
  157. package/dist/hooks/slice-asset-update.cjs.map +1 -0
  158. package/dist/hooks/slice-asset-update.d.ts +3 -0
  159. package/dist/hooks/slice-asset-update.js +18 -0
  160. package/dist/hooks/slice-asset-update.js.map +1 -0
  161. package/dist/hooks/slice-create.cjs +77 -0
  162. package/dist/hooks/slice-create.cjs.map +1 -0
  163. package/dist/hooks/slice-create.d.ts +3 -0
  164. package/dist/hooks/slice-create.js +59 -0
  165. package/dist/hooks/slice-create.js.map +1 -0
  166. package/dist/hooks/slice-delete.cjs +41 -0
  167. package/dist/hooks/slice-delete.cjs.map +1 -0
  168. package/dist/hooks/slice-delete.d.ts +3 -0
  169. package/dist/hooks/slice-delete.js +24 -0
  170. package/dist/hooks/slice-delete.js.map +1 -0
  171. package/dist/hooks/slice-read.cjs +62 -0
  172. package/dist/hooks/slice-read.cjs.map +1 -0
  173. package/dist/hooks/slice-read.d.ts +3 -0
  174. package/dist/hooks/slice-read.js +44 -0
  175. package/dist/hooks/slice-read.js.map +1 -0
  176. package/dist/hooks/slice-rename.cjs +51 -0
  177. package/dist/hooks/slice-rename.cjs.map +1 -0
  178. package/dist/hooks/slice-rename.d.ts +3 -0
  179. package/dist/hooks/slice-rename.js +34 -0
  180. package/dist/hooks/slice-rename.js.map +1 -0
  181. package/dist/hooks/slice-update.cjs +14 -0
  182. package/dist/hooks/slice-update.cjs.map +1 -0
  183. package/dist/hooks/slice-update.d.ts +3 -0
  184. package/dist/hooks/slice-update.js +14 -0
  185. package/dist/hooks/slice-update.js.map +1 -0
  186. package/dist/hooks/sliceLibrary-read.cjs +52 -0
  187. package/dist/hooks/sliceLibrary-read.cjs.map +1 -0
  188. package/dist/hooks/sliceLibrary-read.d.ts +3 -0
  189. package/dist/hooks/sliceLibrary-read.js +34 -0
  190. package/dist/hooks/sliceLibrary-read.js.map +1 -0
  191. package/dist/hooks/sliceSimulator-setup-read.cjs +150 -0
  192. package/dist/hooks/sliceSimulator-setup-read.cjs.map +1 -0
  193. package/dist/hooks/sliceSimulator-setup-read.d.ts +3 -0
  194. package/dist/hooks/sliceSimulator-setup-read.js +150 -0
  195. package/dist/hooks/sliceSimulator-setup-read.js.map +1 -0
  196. package/dist/hooks/snippet-read.cjs +101 -0
  197. package/dist/hooks/snippet-read.cjs.map +1 -0
  198. package/dist/hooks/snippet-read.d.ts +3 -0
  199. package/dist/hooks/snippet-read.js +101 -0
  200. package/dist/hooks/snippet-read.js.map +1 -0
  201. package/dist/index.cjs +4 -0
  202. package/dist/index.cjs.map +1 -0
  203. package/dist/index.d.ts +3 -0
  204. package/dist/index.js +5 -0
  205. package/dist/index.js.map +1 -0
  206. package/dist/lib/buildCustomTypeAssetPath.cjs +29 -0
  207. package/dist/lib/buildCustomTypeAssetPath.cjs.map +1 -0
  208. package/dist/lib/buildCustomTypeAssetPath.d.ts +9 -0
  209. package/dist/lib/buildCustomTypeAssetPath.js +12 -0
  210. package/dist/lib/buildCustomTypeAssetPath.js.map +1 -0
  211. package/dist/lib/buildCustomTypeDirectoryPath.cjs +26 -0
  212. package/dist/lib/buildCustomTypeDirectoryPath.cjs.map +1 -0
  213. package/dist/lib/buildCustomTypeDirectoryPath.d.ts +8 -0
  214. package/dist/lib/buildCustomTypeDirectoryPath.js +9 -0
  215. package/dist/lib/buildCustomTypeDirectoryPath.js.map +1 -0
  216. package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs +7 -0
  217. package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs.map +1 -0
  218. package/dist/lib/buildCustomTypeLibraryDirectoryPath.d.ts +7 -0
  219. package/dist/lib/buildCustomTypeLibraryDirectoryPath.js +7 -0
  220. package/dist/lib/buildCustomTypeLibraryDirectoryPath.js.map +1 -0
  221. package/dist/lib/buildSliceAssetPath.cjs +34 -0
  222. package/dist/lib/buildSliceAssetPath.cjs.map +1 -0
  223. package/dist/lib/buildSliceAssetPath.d.ts +11 -0
  224. package/dist/lib/buildSliceAssetPath.js +17 -0
  225. package/dist/lib/buildSliceAssetPath.js.map +1 -0
  226. package/dist/lib/buildSliceDirectoryPath.cjs +30 -0
  227. package/dist/lib/buildSliceDirectoryPath.cjs.map +1 -0
  228. package/dist/lib/buildSliceDirectoryPath.d.ts +10 -0
  229. package/dist/lib/buildSliceDirectoryPath.js +13 -0
  230. package/dist/lib/buildSliceDirectoryPath.js.map +1 -0
  231. package/dist/lib/buildSliceLibraryDirectoryPath.cjs +7 -0
  232. package/dist/lib/buildSliceLibraryDirectoryPath.cjs.map +1 -0
  233. package/dist/lib/buildSliceLibraryDirectoryPath.d.ts +8 -0
  234. package/dist/lib/buildSliceLibraryDirectoryPath.js +7 -0
  235. package/dist/lib/buildSliceLibraryDirectoryPath.js.map +1 -0
  236. package/dist/lib/checkIsTypeScriptProject.cjs +9 -0
  237. package/dist/lib/checkIsTypeScriptProject.cjs.map +1 -0
  238. package/dist/lib/checkIsTypeScriptProject.d.ts +8 -0
  239. package/dist/lib/checkIsTypeScriptProject.js +9 -0
  240. package/dist/lib/checkIsTypeScriptProject.js.map +1 -0
  241. package/dist/lib/checkPathExists.cjs +30 -0
  242. package/dist/lib/checkPathExists.cjs.map +1 -0
  243. package/dist/lib/checkPathExists.d.ts +2 -0
  244. package/dist/lib/checkPathExists.js +13 -0
  245. package/dist/lib/checkPathExists.js.map +1 -0
  246. package/dist/lib/isSharedSliceModel.cjs +7 -0
  247. package/dist/lib/isSharedSliceModel.cjs.map +1 -0
  248. package/dist/lib/isSharedSliceModel.d.ts +335 -0
  249. package/dist/lib/isSharedSliceModel.js +7 -0
  250. package/dist/lib/isSharedSliceModel.js.map +1 -0
  251. package/dist/lib/pascalCase.cjs +8 -0
  252. package/dist/lib/pascalCase.cjs.map +1 -0
  253. package/dist/lib/pascalCase.d.ts +8 -0
  254. package/dist/lib/pascalCase.js +8 -0
  255. package/dist/lib/pascalCase.js.map +1 -0
  256. package/dist/lib/readJSONFile.cjs +26 -0
  257. package/dist/lib/readJSONFile.cjs.map +1 -0
  258. package/dist/lib/readJSONFile.d.ts +1 -0
  259. package/dist/lib/readJSONFile.js +9 -0
  260. package/dist/lib/readJSONFile.js.map +1 -0
  261. package/dist/lib/rejectIfNecessary.cjs +10 -0
  262. package/dist/lib/rejectIfNecessary.cjs.map +1 -0
  263. package/dist/lib/rejectIfNecessary.d.ts +1 -0
  264. package/dist/lib/rejectIfNecessary.js +10 -0
  265. package/dist/lib/rejectIfNecessary.js.map +1 -0
  266. package/dist/lib/updateSliceModelFile.cjs +33 -0
  267. package/dist/lib/updateSliceModelFile.cjs.map +1 -0
  268. package/dist/lib/updateSliceModelFile.d.ts +9 -0
  269. package/dist/lib/updateSliceModelFile.js +15 -0
  270. package/dist/lib/updateSliceModelFile.js.map +1 -0
  271. package/dist/lib/upsertGlobalContentTypes.cjs +55 -0
  272. package/dist/lib/upsertGlobalContentTypes.cjs.map +1 -0
  273. package/dist/lib/upsertGlobalContentTypes.d.ts +12 -0
  274. package/dist/lib/upsertGlobalContentTypes.js +37 -0
  275. package/dist/lib/upsertGlobalContentTypes.js.map +1 -0
  276. package/dist/lib/upsertSliceLibraryIndexFile.cjs +83 -0
  277. package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -0
  278. package/dist/lib/upsertSliceLibraryIndexFile.d.ts +7 -0
  279. package/dist/lib/upsertSliceLibraryIndexFile.js +65 -0
  280. package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -0
  281. package/dist/packages/adapter-nuxt/package.json.cjs +5 -0
  282. package/dist/packages/adapter-nuxt/package.json.cjs.map +1 -0
  283. package/dist/packages/adapter-nuxt/package.json.js +5 -0
  284. package/dist/packages/adapter-nuxt/package.json.js.map +1 -0
  285. package/dist/plugin.cjs +59 -0
  286. package/dist/plugin.cjs.map +1 -0
  287. package/dist/plugin.d.ts +2 -0
  288. package/dist/plugin.js +59 -0
  289. package/dist/plugin.js.map +1 -0
  290. package/dist/simulator/SliceSimulator.cjs +79 -0
  291. package/dist/simulator/SliceSimulator.cjs.map +1 -0
  292. package/dist/simulator/SliceSimulator.d.ts +34 -0
  293. package/dist/simulator/SliceSimulator.js +79 -0
  294. package/dist/simulator/SliceSimulator.js.map +1 -0
  295. package/dist/simulator/index.d.ts +2 -0
  296. package/dist/simulator.cjs +5 -0
  297. package/dist/simulator.cjs.map +1 -0
  298. package/dist/simulator.js +5 -0
  299. package/dist/simulator.js.map +1 -0
  300. package/dist/types.d.ts +5 -0
  301. package/package.json +107 -0
  302. package/src/constants.ts +5 -0
  303. package/src/hooks/customType-asset-delete.ts +18 -0
  304. package/src/hooks/customType-asset-read.ts +22 -0
  305. package/src/hooks/customType-asset-update.ts +20 -0
  306. package/src/hooks/customType-create.ts +45 -0
  307. package/src/hooks/customType-delete.ts +21 -0
  308. package/src/hooks/customType-read.ts +24 -0
  309. package/src/hooks/customType-rename.ts +3 -0
  310. package/src/hooks/customType-update.ts +3 -0
  311. package/src/hooks/customTypeLibrary-read.ts +53 -0
  312. package/src/hooks/project-init.ts +163 -0
  313. package/src/hooks/slice-asset-delete.ts +21 -0
  314. package/src/hooks/slice-asset-read.ts +25 -0
  315. package/src/hooks/slice-asset-update.ts +23 -0
  316. package/src/hooks/slice-create.ts +115 -0
  317. package/src/hooks/slice-delete.ts +41 -0
  318. package/src/hooks/slice-read.ts +69 -0
  319. package/src/hooks/slice-rename.ts +46 -0
  320. package/src/hooks/slice-update.ts +19 -0
  321. package/src/hooks/sliceLibrary-read.ts +48 -0
  322. package/src/hooks/sliceSimulator-setup-read.ts +209 -0
  323. package/src/hooks/snippet-read.ts +145 -0
  324. package/src/index.ts +4 -0
  325. package/src/lib/buildCustomTypeAssetPath.ts +24 -0
  326. package/src/lib/buildCustomTypeDirectoryPath.ts +20 -0
  327. package/src/lib/buildCustomTypeLibraryDirectoryPath.ts +13 -0
  328. package/src/lib/buildSliceAssetPath.ts +32 -0
  329. package/src/lib/buildSliceDirectoryPath.ts +26 -0
  330. package/src/lib/buildSliceLibraryDirectoryPath.ts +14 -0
  331. package/src/lib/checkIsTypeScriptProject.ts +17 -0
  332. package/src/lib/checkPathExists.ts +12 -0
  333. package/src/lib/isSharedSliceModel.ts +14 -0
  334. package/src/lib/pascalCase.ts +12 -0
  335. package/src/lib/readJSONFile.ts +7 -0
  336. package/src/lib/rejectIfNecessary.ts +16 -0
  337. package/src/lib/updateSliceModelFile.ts +33 -0
  338. package/src/lib/upsertGlobalContentTypes.ts +62 -0
  339. package/src/lib/upsertSliceLibraryIndexFile.ts +90 -0
  340. package/src/plugin.ts +63 -0
  341. package/src/simulator/SliceSimulator.ts +157 -0
  342. package/src/simulator/index.ts +2 -0
  343. package/src/types.ts +5 -0
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
4
+ exports.commonjsGlobal = commonjsGlobal;
5
+ //# sourceMappingURL=_commonjsHelpers.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,5 @@
1
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
2
+ export {
3
+ commonjsGlobal
4
+ };
5
+ //# sourceMappingURL=_commonjsHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ exports.exports = {};
4
+ var ponyfill_es2018 = {
5
+ get exports() {
6
+ return exports.exports;
7
+ },
8
+ set exports(v) {
9
+ exports.exports = v;
10
+ }
11
+ };
12
+ exports.__module = ponyfill_es2018;
13
+ //# sourceMappingURL=ponyfill.es2018.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ponyfill.es2018.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1,14 @@
1
+ var ponyfill_es2018Exports = {};
2
+ var ponyfill_es2018 = {
3
+ get exports() {
4
+ return ponyfill_es2018Exports;
5
+ },
6
+ set exports(v) {
7
+ ponyfill_es2018Exports = v;
8
+ }
9
+ };
10
+ export {
11
+ ponyfill_es2018 as __module,
12
+ ponyfill_es2018Exports as exports
13
+ };
14
+ //# sourceMappingURL=ponyfill.es2018.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ponyfill.es2018.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const NON_EDITABLE_FILE_BANNER = "// Code generated by Slice Machine. DO NOT EDIT.";
4
+ exports.NON_EDITABLE_FILE_BANNER = NON_EDITABLE_FILE_BANNER;
5
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n"],"names":[],"mappings":";;AAGO,MAAM,2BACZ;;"}
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Banner text added to files that should not be edited by users.
3
+ */
4
+ export declare const NON_EDITABLE_FILE_BANNER = "// Code generated by Slice Machine. DO NOT EDIT.";
@@ -0,0 +1,5 @@
1
+ const NON_EDITABLE_FILE_BANNER = "// Code generated by Slice Machine. DO NOT EDIT.";
2
+ export {
3
+ NON_EDITABLE_FILE_BANNER
4
+ };
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["/**\n * Banner text added to files that should not be edited by users.\n */\nexport const NON_EDITABLE_FILE_BANNER =\n\t\"// Code generated by Slice Machine. DO NOT EDIT.\";\n"],"names":[],"mappings":"AAGO,MAAM,2BACZ;"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const buildCustomTypeAssetPath = require("../lib/buildCustomTypeAssetPath.cjs");
5
+ function _interopNamespaceDefault(e) {
6
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
+ if (e) {
8
+ for (const k in e) {
9
+ if (k !== "default") {
10
+ const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: () => e[k]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
22
+ const customTypeAssetDelete = async (data, context) => {
23
+ const filePath = buildCustomTypeAssetPath.buildCustomTypeAssetPath({
24
+ customTypeID: data.customTypeID,
25
+ assetID: data.assetID,
26
+ helpers: context.helpers
27
+ });
28
+ await fs__namespace.rm(filePath);
29
+ };
30
+ exports.customTypeAssetDelete = customTypeAssetDelete;
31
+ //# sourceMappingURL=customType-asset-delete.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-delete.cjs","sources":["../../../src/hooks/customType-asset-delete.ts"],"sourcesContent":["import type { CustomTypeAssetDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetDelete: CustomTypeAssetDeleteHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.rm(filePath);\n};\n"],"names":["buildCustomTypeAssetPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOa,MAAA,wBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAWA,yBAAAA,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAAC,cAAG,GAAG,QAAQ;AACrB;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeAssetDeleteHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeAssetDelete: CustomTypeAssetDeleteHook<PluginOptions>;
@@ -0,0 +1,14 @@
1
+ import * as fs from "node:fs/promises";
2
+ import { buildCustomTypeAssetPath } from "../lib/buildCustomTypeAssetPath.js";
3
+ const customTypeAssetDelete = async (data, context) => {
4
+ const filePath = buildCustomTypeAssetPath({
5
+ customTypeID: data.customTypeID,
6
+ assetID: data.assetID,
7
+ helpers: context.helpers
8
+ });
9
+ await fs.rm(filePath);
10
+ };
11
+ export {
12
+ customTypeAssetDelete
13
+ };
14
+ //# sourceMappingURL=customType-asset-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-delete.js","sources":["../../../src/hooks/customType-asset-delete.ts"],"sourcesContent":["import type { CustomTypeAssetDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetDelete: CustomTypeAssetDeleteHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.rm(filePath);\n};\n"],"names":[],"mappings":";;AAOa,MAAA,wBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAW,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAA,GAAG,GAAG,QAAQ;AACrB;"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const buildCustomTypeAssetPath = require("../lib/buildCustomTypeAssetPath.cjs");
5
+ function _interopNamespaceDefault(e) {
6
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
+ if (e) {
8
+ for (const k in e) {
9
+ if (k !== "default") {
10
+ const d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: () => e[k]
14
+ });
15
+ }
16
+ }
17
+ }
18
+ n.default = e;
19
+ return Object.freeze(n);
20
+ }
21
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
22
+ const customTypeAssetRead = async (data, context) => {
23
+ const filePath = buildCustomTypeAssetPath.buildCustomTypeAssetPath({
24
+ customTypeID: data.customTypeID,
25
+ assetID: data.assetID,
26
+ helpers: context.helpers
27
+ });
28
+ const assetData = await fs__namespace.readFile(filePath);
29
+ return {
30
+ data: assetData
31
+ };
32
+ };
33
+ exports.customTypeAssetRead = customTypeAssetRead;
34
+ //# sourceMappingURL=customType-asset-read.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-read.cjs","sources":["../../../src/hooks/customType-asset-read.ts"],"sourcesContent":["import type { CustomTypeAssetReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetRead: CustomTypeAssetReadHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t});\n\n\tconst assetData = await fs.readFile(filePath);\n\n\treturn {\n\t\tdata: assetData,\n\t};\n};\n"],"names":["buildCustomTypeAssetPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOa,MAAA,sBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAWA,yBAAAA,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,YAAY,MAAMC,cAAG,SAAS,QAAQ;AAErC,SAAA;AAAA,IACN,MAAM;AAAA,EAAA;AAER;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeAssetReadHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeAssetRead: CustomTypeAssetReadHook<PluginOptions>;
@@ -0,0 +1,17 @@
1
+ import * as fs from "node:fs/promises";
2
+ import { buildCustomTypeAssetPath } from "../lib/buildCustomTypeAssetPath.js";
3
+ const customTypeAssetRead = async (data, context) => {
4
+ const filePath = buildCustomTypeAssetPath({
5
+ customTypeID: data.customTypeID,
6
+ assetID: data.assetID,
7
+ helpers: context.helpers
8
+ });
9
+ const assetData = await fs.readFile(filePath);
10
+ return {
11
+ data: assetData
12
+ };
13
+ };
14
+ export {
15
+ customTypeAssetRead
16
+ };
17
+ //# sourceMappingURL=customType-asset-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-read.js","sources":["../../../src/hooks/customType-asset-read.ts"],"sourcesContent":["import type { CustomTypeAssetReadHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetRead: CustomTypeAssetReadHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.assetID,\n\t\thelpers: context.helpers,\n\t});\n\n\tconst assetData = await fs.readFile(filePath);\n\n\treturn {\n\t\tdata: assetData,\n\t};\n};\n"],"names":[],"mappings":";;AAOa,MAAA,sBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAW,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,IACd,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,YAAY,MAAM,GAAG,SAAS,QAAQ;AAErC,SAAA;AAAA,IACN,MAAM;AAAA,EAAA;AAER;"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const path = require("node:path");
5
+ const buildCustomTypeAssetPath = require("../lib/buildCustomTypeAssetPath.cjs");
6
+ function _interopNamespaceDefault(e) {
7
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
+ if (e) {
9
+ for (const k in e) {
10
+ if (k !== "default") {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: () => e[k]
15
+ });
16
+ }
17
+ }
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
23
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
24
+ const customTypeAssetUpdate = async (data, context) => {
25
+ const filePath = buildCustomTypeAssetPath.buildCustomTypeAssetPath({
26
+ customTypeID: data.customTypeID,
27
+ assetID: data.asset.id,
28
+ helpers: context.helpers
29
+ });
30
+ await fs__namespace.mkdir(path__namespace.dirname(filePath), { recursive: true });
31
+ await fs__namespace.writeFile(filePath, data.asset.data);
32
+ };
33
+ exports.customTypeAssetUpdate = customTypeAssetUpdate;
34
+ //# sourceMappingURL=customType-asset-update.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-update.cjs","sources":["../../../src/hooks/customType-asset-update.ts"],"sourcesContent":["import type { CustomTypeAssetUpdateHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetUpdate: CustomTypeAssetUpdateHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.asset.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\tawait fs.writeFile(filePath, data.asset.data);\n};\n"],"names":["buildCustomTypeAssetPath","fs","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQa,MAAA,wBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAWA,yBAAAA,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK,MAAM;AAAA,IACpB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAAC,cAAG,MAAMC,gBAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAC1D,QAAMD,cAAG,UAAU,UAAU,KAAK,MAAM,IAAI;AAC7C;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeAssetUpdateHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeAssetUpdate: CustomTypeAssetUpdateHook<PluginOptions>;
@@ -0,0 +1,16 @@
1
+ import * as fs from "node:fs/promises";
2
+ import * as path from "node:path";
3
+ import { buildCustomTypeAssetPath } from "../lib/buildCustomTypeAssetPath.js";
4
+ const customTypeAssetUpdate = async (data, context) => {
5
+ const filePath = buildCustomTypeAssetPath({
6
+ customTypeID: data.customTypeID,
7
+ assetID: data.asset.id,
8
+ helpers: context.helpers
9
+ });
10
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
11
+ await fs.writeFile(filePath, data.asset.data);
12
+ };
13
+ export {
14
+ customTypeAssetUpdate
15
+ };
16
+ //# sourceMappingURL=customType-asset-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-asset-update.js","sources":["../../../src/hooks/customType-asset-update.ts"],"sourcesContent":["import type { CustomTypeAssetUpdateHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeAssetPath } from \"../lib/buildCustomTypeAssetPath\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeAssetUpdate: CustomTypeAssetUpdateHook<\n\tPluginOptions\n> = async (data, context) => {\n\tconst filePath = buildCustomTypeAssetPath({\n\t\tcustomTypeID: data.customTypeID,\n\t\tassetID: data.asset.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\tawait fs.writeFile(filePath, data.asset.data);\n};\n"],"names":[],"mappings":";;;AAQa,MAAA,wBAET,OAAO,MAAM,YAAW;AAC3B,QAAM,WAAW,yBAAyB;AAAA,IACzC,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK,MAAM;AAAA,IACpB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAEK,QAAA,GAAG,MAAM,KAAK,QAAQ,QAAQ,GAAG,EAAE,WAAW,KAAA,CAAM;AAC1D,QAAM,GAAG,UAAU,UAAU,KAAK,MAAM,IAAI;AAC7C;"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const path = require("node:path");
5
+ const buildCustomTypeDirectoryPath = require("../lib/buildCustomTypeDirectoryPath.cjs");
6
+ const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
7
+ function _interopNamespaceDefault(e) {
8
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
9
+ if (e) {
10
+ for (const k in e) {
11
+ if (k !== "default") {
12
+ const d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: () => e[k]
16
+ });
17
+ }
18
+ }
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
24
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
25
+ const createModelFile = async ({ dir, data, helpers, options }) => {
26
+ const filePath = path__namespace.join(dir, "index.json");
27
+ let contents = JSON.stringify(data.model);
28
+ if (options.format) {
29
+ contents = await helpers.format(contents, filePath);
30
+ }
31
+ await fs__namespace.writeFile(filePath, contents);
32
+ };
33
+ const customTypeCreate = async (data, context) => {
34
+ const dir = buildCustomTypeDirectoryPath.buildCustomTypeDirectoryPath({
35
+ customTypeID: data.model.id,
36
+ helpers: context.helpers
37
+ });
38
+ await fs__namespace.mkdir(dir, { recursive: true });
39
+ await createModelFile({ dir, data, ...context });
40
+ await upsertGlobalContentTypes.upsertGlobalContentTypes(context);
41
+ };
42
+ exports.customTypeCreate = customTypeCreate;
43
+ //# sourceMappingURL=customType-create.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-create.cjs","sources":["../../../src/hooks/customType-create.ts"],"sourcesContent":["import type {\n\tCustomTypeCreateHook,\n\tCustomTypeCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype Args = {\n\tdir: string;\n\tdata: CustomTypeCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createModelFile = async ({ dir, data, helpers, options }: Args) => {\n\tconst filePath = path.join(dir, \"index.json\");\n\n\tlet contents = JSON.stringify(data.model);\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n\nexport const customTypeCreate: CustomTypeCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst dir = buildCustomTypeDirectoryPath({\n\t\tcustomTypeID: data.model.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.mkdir(dir, { recursive: true });\n\n\tawait createModelFile({ dir, data, ...context });\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":["path","fs","buildCustomTypeDirectoryPath","upsertGlobalContentTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,kBAAkB,OAAO,EAAE,KAAK,MAAM,SAAS,cAAmB;AACvE,QAAM,WAAWA,gBAAK,KAAK,KAAK,YAAY;AAE5C,MAAI,WAAW,KAAK,UAAU,KAAK,KAAK;AAExC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;AAEa,MAAA,mBAAwD,OACpE,MACA,YACG;AACH,QAAM,MAAMC,6BAAAA,6BAA6B;AAAA,IACxC,cAAc,KAAK,MAAM;AAAA,IACzB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAMD,cAAG,MAAM,KAAK,EAAE,WAAW,MAAM;AAEvC,QAAM,gBAAgB,EAAE,KAAK,MAAM,GAAG,QAAS,CAAA;AAE/C,QAAME,yBAAAA,yBAAyB,OAAO;AACvC;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeCreateHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeCreate: CustomTypeCreateHook<PluginOptions>;
@@ -0,0 +1,25 @@
1
+ import * as fs from "node:fs/promises";
2
+ import * as path from "node:path";
3
+ import { buildCustomTypeDirectoryPath } from "../lib/buildCustomTypeDirectoryPath.js";
4
+ import { upsertGlobalContentTypes } from "../lib/upsertGlobalContentTypes.js";
5
+ const createModelFile = async ({ dir, data, helpers, options }) => {
6
+ const filePath = path.join(dir, "index.json");
7
+ let contents = JSON.stringify(data.model);
8
+ if (options.format) {
9
+ contents = await helpers.format(contents, filePath);
10
+ }
11
+ await fs.writeFile(filePath, contents);
12
+ };
13
+ const customTypeCreate = async (data, context) => {
14
+ const dir = buildCustomTypeDirectoryPath({
15
+ customTypeID: data.model.id,
16
+ helpers: context.helpers
17
+ });
18
+ await fs.mkdir(dir, { recursive: true });
19
+ await createModelFile({ dir, data, ...context });
20
+ await upsertGlobalContentTypes(context);
21
+ };
22
+ export {
23
+ customTypeCreate
24
+ };
25
+ //# sourceMappingURL=customType-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-create.js","sources":["../../../src/hooks/customType-create.ts"],"sourcesContent":["import type {\n\tCustomTypeCreateHook,\n\tCustomTypeCreateHookData,\n\tSliceMachineContext,\n} from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\ntype Args = {\n\tdir: string;\n\tdata: CustomTypeCreateHookData;\n} & SliceMachineContext<PluginOptions>;\n\nconst createModelFile = async ({ dir, data, helpers, options }: Args) => {\n\tconst filePath = path.join(dir, \"index.json\");\n\n\tlet contents = JSON.stringify(data.model);\n\n\tif (options.format) {\n\t\tcontents = await helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n\nexport const customTypeCreate: CustomTypeCreateHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst dir = buildCustomTypeDirectoryPath({\n\t\tcustomTypeID: data.model.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.mkdir(dir, { recursive: true });\n\n\tawait createModelFile({ dir, data, ...context });\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":[],"mappings":";;;;AAkBA,MAAM,kBAAkB,OAAO,EAAE,KAAK,MAAM,SAAS,cAAmB;AACvE,QAAM,WAAW,KAAK,KAAK,KAAK,YAAY;AAE5C,MAAI,WAAW,KAAK,UAAU,KAAK,KAAK;AAExC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;AAEa,MAAA,mBAAwD,OACpE,MACA,YACG;AACH,QAAM,MAAM,6BAA6B;AAAA,IACxC,cAAc,KAAK,MAAM;AAAA,IACzB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,GAAG,MAAM,KAAK,EAAE,WAAW,MAAM;AAEvC,QAAM,gBAAgB,EAAE,KAAK,MAAM,GAAG,QAAS,CAAA;AAE/C,QAAM,yBAAyB,OAAO;AACvC;"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const buildCustomTypeDirectoryPath = require("../lib/buildCustomTypeDirectoryPath.cjs");
5
+ const upsertGlobalContentTypes = require("../lib/upsertGlobalContentTypes.cjs");
6
+ function _interopNamespaceDefault(e) {
7
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
+ if (e) {
9
+ for (const k in e) {
10
+ if (k !== "default") {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: () => e[k]
15
+ });
16
+ }
17
+ }
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
23
+ const customTypeDelete = async (data, context) => {
24
+ const dir = buildCustomTypeDirectoryPath.buildCustomTypeDirectoryPath({
25
+ customTypeID: data.model.id,
26
+ helpers: context.helpers
27
+ });
28
+ await fs__namespace.rm(dir, { recursive: true });
29
+ await upsertGlobalContentTypes.upsertGlobalContentTypes(context);
30
+ };
31
+ exports.customTypeDelete = customTypeDelete;
32
+ //# sourceMappingURL=customType-delete.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-delete.cjs","sources":["../../../src/hooks/customType-delete.ts"],"sourcesContent":["import type { CustomTypeDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeDelete: CustomTypeDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst dir = buildCustomTypeDirectoryPath({\n\t\tcustomTypeID: data.model.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.rm(dir, { recursive: true });\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":["buildCustomTypeDirectoryPath","fs","upsertGlobalContentTypes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQa,MAAA,mBAAwD,OACpE,MACA,YACG;AACH,QAAM,MAAMA,6BAAAA,6BAA6B;AAAA,IACxC,cAAc,KAAK,MAAM;AAAA,IACzB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAMC,cAAG,GAAG,KAAK,EAAE,WAAW,MAAM;AAEpC,QAAMC,yBAAAA,yBAAyB,OAAO;AACvC;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeDeleteHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeDelete: CustomTypeDeleteHook<PluginOptions>;
@@ -0,0 +1,15 @@
1
+ import * as fs from "node:fs/promises";
2
+ import { buildCustomTypeDirectoryPath } from "../lib/buildCustomTypeDirectoryPath.js";
3
+ import { upsertGlobalContentTypes } from "../lib/upsertGlobalContentTypes.js";
4
+ const customTypeDelete = async (data, context) => {
5
+ const dir = buildCustomTypeDirectoryPath({
6
+ customTypeID: data.model.id,
7
+ helpers: context.helpers
8
+ });
9
+ await fs.rm(dir, { recursive: true });
10
+ await upsertGlobalContentTypes(context);
11
+ };
12
+ export {
13
+ customTypeDelete
14
+ };
15
+ //# sourceMappingURL=customType-delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-delete.js","sources":["../../../src/hooks/customType-delete.ts"],"sourcesContent":["import type { CustomTypeDeleteHook } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { upsertGlobalContentTypes } from \"../lib/upsertGlobalContentTypes\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeDelete: CustomTypeDeleteHook<PluginOptions> = async (\n\tdata,\n\tcontext,\n) => {\n\tconst dir = buildCustomTypeDirectoryPath({\n\t\tcustomTypeID: data.model.id,\n\t\thelpers: context.helpers,\n\t});\n\n\tawait fs.rm(dir, { recursive: true });\n\n\tawait upsertGlobalContentTypes(context);\n};\n"],"names":[],"mappings":";;;AAQa,MAAA,mBAAwD,OACpE,MACA,YACG;AACH,QAAM,MAAM,6BAA6B;AAAA,IACxC,cAAc,KAAK,MAAM;AAAA,IACzB,SAAS,QAAQ;AAAA,EAAA,CACjB;AAED,QAAM,GAAG,GAAG,KAAK,EAAE,WAAW,MAAM;AAEpC,QAAM,yBAAyB,OAAO;AACvC;"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const path = require("node:path");
4
+ const buildCustomTypeDirectoryPath = require("../lib/buildCustomTypeDirectoryPath.cjs");
5
+ const readJSONFile = require("../lib/readJSONFile.cjs");
6
+ function _interopNamespaceDefault(e) {
7
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
8
+ if (e) {
9
+ for (const k in e) {
10
+ if (k !== "default") {
11
+ const d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: () => e[k]
15
+ });
16
+ }
17
+ }
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
23
+ const customTypeRead = async (data, { helpers }) => {
24
+ const filePath = path__namespace.join(buildCustomTypeDirectoryPath.buildCustomTypeDirectoryPath({ customTypeID: data.id, helpers }), "index.json");
25
+ const model = await readJSONFile.readJSONFile(filePath);
26
+ return {
27
+ model
28
+ };
29
+ };
30
+ exports.customTypeRead = customTypeRead;
31
+ //# sourceMappingURL=customType-read.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-read.cjs","sources":["../../../src/hooks/customType-read.ts"],"sourcesContent":["import type { CustomTypeReadHook } from \"@slicemachine/plugin-kit\";\nimport type { CustomType } from \"@prismicio/types-internal/lib/customtypes\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeRead: CustomTypeReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst filePath = path.join(\n\t\tbuildCustomTypeDirectoryPath({ customTypeID: data.id, helpers }),\n\t\t\"index.json\",\n\t);\n\n\tconst model = await readJSONFile<CustomType>(filePath);\n\n\treturn {\n\t\tmodel,\n\t};\n};\n"],"names":["path","buildCustomTypeDirectoryPath","readJSONFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AASO,MAAM,iBAAoD,OAChE,MACA,EAAE,cACC;AACG,QAAA,WAAWA,gBAAK,KACrBC,6BAA6B,6BAAA,EAAE,cAAc,KAAK,IAAI,SAAS,GAC/D,YAAY;AAGP,QAAA,QAAQ,MAAMC,0BAAyB,QAAQ;AAE9C,SAAA;AAAA,IACN;AAAA,EAAA;AAEF;;"}
@@ -0,0 +1,3 @@
1
+ import type { CustomTypeReadHook } from "@slicemachine/plugin-kit";
2
+ import type { PluginOptions } from "../types";
3
+ export declare const customTypeRead: CustomTypeReadHook<PluginOptions>;
@@ -0,0 +1,14 @@
1
+ import * as path from "node:path";
2
+ import { buildCustomTypeDirectoryPath } from "../lib/buildCustomTypeDirectoryPath.js";
3
+ import { readJSONFile } from "../lib/readJSONFile.js";
4
+ const customTypeRead = async (data, { helpers }) => {
5
+ const filePath = path.join(buildCustomTypeDirectoryPath({ customTypeID: data.id, helpers }), "index.json");
6
+ const model = await readJSONFile(filePath);
7
+ return {
8
+ model
9
+ };
10
+ };
11
+ export {
12
+ customTypeRead
13
+ };
14
+ //# sourceMappingURL=customType-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-read.js","sources":["../../../src/hooks/customType-read.ts"],"sourcesContent":["import type { CustomTypeReadHook } from \"@slicemachine/plugin-kit\";\nimport type { CustomType } from \"@prismicio/types-internal/lib/customtypes\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeDirectoryPath } from \"../lib/buildCustomTypeDirectoryPath\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nexport const customTypeRead: CustomTypeReadHook<PluginOptions> = async (\n\tdata,\n\t{ helpers },\n) => {\n\tconst filePath = path.join(\n\t\tbuildCustomTypeDirectoryPath({ customTypeID: data.id, helpers }),\n\t\t\"index.json\",\n\t);\n\n\tconst model = await readJSONFile<CustomType>(filePath);\n\n\treturn {\n\t\tmodel,\n\t};\n};\n"],"names":[],"mappings":";;;AASO,MAAM,iBAAoD,OAChE,MACA,EAAE,cACC;AACG,QAAA,WAAW,KAAK,KACrB,6BAA6B,EAAE,cAAc,KAAK,IAAI,SAAS,GAC/D,YAAY;AAGP,QAAA,QAAQ,MAAM,aAAyB,QAAQ;AAE9C,SAAA;AAAA,IACN;AAAA,EAAA;AAEF;"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const customTypeCreate = require("./customType-create.cjs");
4
+ const customTypeRename = customTypeCreate.customTypeCreate;
5
+ exports.customTypeRename = customTypeRename;
6
+ //# sourceMappingURL=customType-rename.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-rename.cjs","sources":["../../../src/hooks/customType-rename.ts"],"sourcesContent":["import { customTypeCreate } from \"./customType-create\";\n\nexport const customTypeRename = customTypeCreate;\n"],"names":["customTypeCreate"],"mappings":";;;AAEO,MAAM,mBAAmBA,iBAAAA;;"}
@@ -0,0 +1 @@
1
+ export declare const customTypeRename: import("@slicemachine/plugin-kit").CustomTypeCreateHook<import("..").PluginOptions>;
@@ -0,0 +1,6 @@
1
+ import { customTypeCreate } from "./customType-create.js";
2
+ const customTypeRename = customTypeCreate;
3
+ export {
4
+ customTypeRename
5
+ };
6
+ //# sourceMappingURL=customType-rename.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-rename.js","sources":["../../../src/hooks/customType-rename.ts"],"sourcesContent":["import { customTypeCreate } from \"./customType-create\";\n\nexport const customTypeRename = customTypeCreate;\n"],"names":[],"mappings":";AAEO,MAAM,mBAAmB;"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const customTypeCreate = require("./customType-create.cjs");
4
+ const customTypeUpdate = customTypeCreate.customTypeCreate;
5
+ exports.customTypeUpdate = customTypeUpdate;
6
+ //# sourceMappingURL=customType-update.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-update.cjs","sources":["../../../src/hooks/customType-update.ts"],"sourcesContent":["import { customTypeCreate } from \"./customType-create\";\n\nexport const customTypeUpdate = customTypeCreate;\n"],"names":["customTypeCreate"],"mappings":";;;AAEO,MAAM,mBAAmBA,iBAAAA;;"}
@@ -0,0 +1 @@
1
+ export declare const customTypeUpdate: import("@slicemachine/plugin-kit").CustomTypeCreateHook<import("..").PluginOptions>;
@@ -0,0 +1,6 @@
1
+ import { customTypeCreate } from "./customType-create.js";
2
+ const customTypeUpdate = customTypeCreate;
3
+ export {
4
+ customTypeUpdate
5
+ };
6
+ //# sourceMappingURL=customType-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customType-update.js","sources":["../../../src/hooks/customType-update.ts"],"sourcesContent":["import { customTypeCreate } from \"./customType-create\";\n\nexport const customTypeUpdate = customTypeCreate;\n"],"names":[],"mappings":";AAEO,MAAM,mBAAmB;"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const fs = require("node:fs/promises");
4
+ const path = require("node:path");
5
+ const buildCustomTypeLibraryDirectoryPath = require("../lib/buildCustomTypeLibraryDirectoryPath.cjs");
6
+ const readJSONFile = require("../lib/readJSONFile.cjs");
7
+ function _interopNamespaceDefault(e) {
8
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
9
+ if (e) {
10
+ for (const k in e) {
11
+ if (k !== "default") {
12
+ const d = Object.getOwnPropertyDescriptor(e, k);
13
+ Object.defineProperty(n, k, d.get ? d : {
14
+ enumerable: true,
15
+ get: () => e[k]
16
+ });
17
+ }
18
+ }
19
+ }
20
+ n.default = e;
21
+ return Object.freeze(n);
22
+ }
23
+ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
24
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
25
+ const isCustomTypeModel = (input) => {
26
+ return typeof input === "object" && input !== null && "json" in input;
27
+ };
28
+ const customTypeLibraryRead = async (_data, { helpers }) => {
29
+ const dirPath = buildCustomTypeLibraryDirectoryPath.buildCustomTypeLibraryDirectoryPath({ helpers });
30
+ await fs__namespace.mkdir(dirPath, { recursive: true });
31
+ const childDirs = await fs__namespace.readdir(dirPath);
32
+ const ids = [];
33
+ await Promise.all(childDirs.map(async (childDir) => {
34
+ const childDirContents = await fs__namespace.readdir(path__namespace.join(dirPath, childDir), {
35
+ withFileTypes: true
36
+ });
37
+ const isCustomTypeDir = childDirContents.some((entry) => {
38
+ return entry.isFile() && entry.name === "index.json";
39
+ });
40
+ if (isCustomTypeDir) {
41
+ const modelPath = path__namespace.join(dirPath, childDir, "index.json");
42
+ const modelContents = await readJSONFile.readJSONFile(modelPath);
43
+ if (isCustomTypeModel(modelContents)) {
44
+ ids.push(modelContents.id);
45
+ }
46
+ }
47
+ }));
48
+ return {
49
+ ids: ids.sort()
50
+ };
51
+ };
52
+ exports.customTypeLibraryRead = customTypeLibraryRead;
53
+ //# sourceMappingURL=customTypeLibrary-read.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customTypeLibrary-read.cjs","sources":["../../../src/hooks/customTypeLibrary-read.ts"],"sourcesContent":["import type { CustomTypeLibraryReadHook } from \"@slicemachine/plugin-kit\";\nimport type { CustomType } from \"@prismicio/types-internal/lib/customtypes\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"../lib/buildCustomTypeLibraryDirectoryPath\";\nimport { readJSONFile } from \"../lib/readJSONFile\";\n\nimport type { PluginOptions } from \"../types\";\n\nconst isCustomTypeModel = (\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tinput: any,\n): input is CustomType => {\n\treturn typeof input === \"object\" && input !== null && \"json\" in input;\n};\n\nexport const customTypeLibraryRead: CustomTypeLibraryReadHook<\n\tPluginOptions\n> = async (_data, { helpers }) => {\n\tconst dirPath = buildCustomTypeLibraryDirectoryPath({ helpers });\n\n\t// Ensure the directory exists.\n\tawait fs.mkdir(dirPath, { recursive: true });\n\n\tconst childDirs = await fs.readdir(dirPath);\n\n\tconst ids: string[] = [];\n\tawait Promise.all(\n\t\tchildDirs.map(async (childDir) => {\n\t\t\tconst childDirContents = await fs.readdir(path.join(dirPath, childDir), {\n\t\t\t\twithFileTypes: true,\n\t\t\t});\n\t\t\tconst isCustomTypeDir = childDirContents.some((entry) => {\n\t\t\t\treturn entry.isFile() && entry.name === \"index.json\";\n\t\t\t});\n\n\t\t\tif (isCustomTypeDir) {\n\t\t\t\tconst modelPath = path.join(dirPath, childDir, \"index.json\");\n\n\t\t\t\tconst modelContents = await readJSONFile(modelPath);\n\n\t\t\t\tif (isCustomTypeModel(modelContents)) {\n\t\t\t\t\tids.push(modelContents.id);\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t);\n\n\treturn {\n\t\tids: ids.sort(),\n\t};\n};\n"],"names":["buildCustomTypeLibraryDirectoryPath","fs","path","readJSONFile"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,MAAM,oBAAoB,CAEzB,UACwB;AACxB,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;AAEO,MAAM,wBAET,OAAO,OAAO,EAAE,cAAa;AAChC,QAAM,UAAUA,oCAAAA,oCAAoC,EAAE,QAAS,CAAA;AAG/D,QAAMC,cAAG,MAAM,SAAS,EAAE,WAAW,MAAM;AAE3C,QAAM,YAAY,MAAMA,cAAG,QAAQ,OAAO;AAE1C,QAAM,MAAgB,CAAA;AACtB,QAAM,QAAQ,IACb,UAAU,IAAI,OAAO,aAAY;AAC1B,UAAA,mBAAmB,MAAMA,cAAG,QAAQC,gBAAK,KAAK,SAAS,QAAQ,GAAG;AAAA,MACvE,eAAe;AAAA,IAAA,CACf;AACD,UAAM,kBAAkB,iBAAiB,KAAK,CAAC,UAAS;AACvD,aAAO,MAAM,OAAA,KAAY,MAAM,SAAS;AAAA,IAAA,CACxC;AAED,QAAI,iBAAiB;AACpB,YAAM,YAAYA,gBAAK,KAAK,SAAS,UAAU,YAAY;AAErD,YAAA,gBAAgB,MAAMC,0BAAa,SAAS;AAE9C,UAAA,kBAAkB,aAAa,GAAG;AACjC,YAAA,KAAK,cAAc,EAAE;AAAA,MACzB;AAAA,IACD;AAAA,EACD,CAAA,CAAC;AAGI,SAAA;AAAA,IACN,KAAK,IAAI,KAAM;AAAA,EAAA;AAEjB;;"}