@slicemachine/adapter-next 0.0.11 → 0.0.13-dev-plugins-validation.1

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 (263) hide show
  1. package/LICENSE +1 -1
  2. package/dist/{node_modules → _node_modules}/data-uri-to-buffer/dist/index.cjs +1 -1
  3. package/dist/_node_modules/data-uri-to-buffer/dist/index.cjs.map +1 -0
  4. package/dist/{node_modules → _node_modules}/data-uri-to-buffer/dist/index.js +1 -1
  5. package/dist/_node_modules/data-uri-to-buffer/dist/index.js.map +1 -0
  6. package/dist/_node_modules/fetch-blob/file.cjs.map +1 -0
  7. package/dist/_node_modules/fetch-blob/file.js.map +1 -0
  8. package/dist/_node_modules/fetch-blob/index.cjs.map +1 -0
  9. package/dist/_node_modules/fetch-blob/index.js.map +1 -0
  10. package/dist/_node_modules/fetch-blob/streams.cjs.map +1 -0
  11. package/dist/_node_modules/fetch-blob/streams.js.map +1 -0
  12. package/dist/_node_modules/formdata-polyfill/esm.min.cjs.map +1 -0
  13. package/dist/_node_modules/formdata-polyfill/esm.min.js.map +1 -0
  14. package/dist/_node_modules/node-domexception/index.cjs.map +1 -0
  15. package/dist/_node_modules/node-domexception/index.js.map +1 -0
  16. package/dist/_node_modules/node-fetch/src/body.cjs.map +1 -0
  17. package/dist/_node_modules/node-fetch/src/body.js.map +1 -0
  18. package/dist/_node_modules/node-fetch/src/errors/abort-error.cjs.map +1 -0
  19. package/dist/_node_modules/node-fetch/src/errors/abort-error.js.map +1 -0
  20. package/dist/_node_modules/node-fetch/src/errors/base.cjs.map +1 -0
  21. package/dist/_node_modules/node-fetch/src/errors/base.js.map +1 -0
  22. package/dist/_node_modules/node-fetch/src/errors/fetch-error.cjs.map +1 -0
  23. package/dist/_node_modules/node-fetch/src/errors/fetch-error.js.map +1 -0
  24. package/dist/_node_modules/node-fetch/src/headers.cjs.map +1 -0
  25. package/dist/_node_modules/node-fetch/src/headers.js.map +1 -0
  26. package/dist/_node_modules/node-fetch/src/index.cjs.map +1 -0
  27. package/dist/_node_modules/node-fetch/src/index.js.map +1 -0
  28. package/dist/_node_modules/node-fetch/src/request.cjs.map +1 -0
  29. package/dist/_node_modules/node-fetch/src/request.js.map +1 -0
  30. package/dist/_node_modules/node-fetch/src/response.cjs.map +1 -0
  31. package/dist/_node_modules/node-fetch/src/response.js.map +1 -0
  32. package/dist/_node_modules/node-fetch/src/utils/get-search.cjs.map +1 -0
  33. package/dist/_node_modules/node-fetch/src/utils/get-search.js.map +1 -0
  34. package/dist/_node_modules/node-fetch/src/utils/is-redirect.cjs.map +1 -0
  35. package/dist/_node_modules/node-fetch/src/utils/is-redirect.js.map +1 -0
  36. package/dist/_node_modules/node-fetch/src/utils/is.cjs.map +1 -0
  37. package/dist/_node_modules/node-fetch/src/utils/is.js.map +1 -0
  38. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.cjs.map +1 -0
  39. package/dist/_node_modules/node-fetch/src/utils/multipart-parser.js.map +1 -0
  40. package/dist/_node_modules/node-fetch/src/utils/referrer.cjs.map +1 -0
  41. package/dist/_node_modules/node-fetch/src/utils/referrer.js.map +1 -0
  42. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +1 -0
  43. package/dist/_node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +1 -0
  44. package/dist/hooks/customType-asset-delete.cjs +6 -1
  45. package/dist/hooks/customType-asset-delete.cjs.map +1 -1
  46. package/dist/hooks/customType-asset-delete.js +6 -1
  47. package/dist/hooks/customType-asset-delete.js.map +1 -1
  48. package/dist/hooks/customType-asset-read.cjs +6 -1
  49. package/dist/hooks/customType-asset-read.cjs.map +1 -1
  50. package/dist/hooks/customType-asset-read.js +6 -1
  51. package/dist/hooks/customType-asset-read.js.map +1 -1
  52. package/dist/hooks/customType-asset-update.cjs +6 -1
  53. package/dist/hooks/customType-asset-update.cjs.map +1 -1
  54. package/dist/hooks/customType-asset-update.js +6 -1
  55. package/dist/hooks/customType-asset-update.js.map +1 -1
  56. package/dist/hooks/customType-create.cjs +5 -1
  57. package/dist/hooks/customType-create.cjs.map +1 -1
  58. package/dist/hooks/customType-create.js +5 -1
  59. package/dist/hooks/customType-create.js.map +1 -1
  60. package/dist/hooks/customType-delete.cjs +5 -1
  61. package/dist/hooks/customType-delete.cjs.map +1 -1
  62. package/dist/hooks/customType-delete.js +5 -1
  63. package/dist/hooks/customType-delete.js.map +1 -1
  64. package/dist/hooks/customType-read.cjs +20 -1
  65. package/dist/hooks/customType-read.cjs.map +1 -1
  66. package/dist/hooks/customType-read.js +3 -1
  67. package/dist/hooks/customType-read.js.map +1 -1
  68. package/dist/hooks/customTypeLibrary-read.cjs +2 -1
  69. package/dist/hooks/customTypeLibrary-read.cjs.map +1 -1
  70. package/dist/hooks/customTypeLibrary-read.js +2 -1
  71. package/dist/hooks/customTypeLibrary-read.js.map +1 -1
  72. package/dist/hooks/{command-init.cjs → project-init.cjs} +5 -3
  73. package/dist/hooks/project-init.cjs.map +1 -0
  74. package/dist/hooks/project-init.d.ts +3 -0
  75. package/dist/hooks/{command-init.js → project-init.js} +5 -3
  76. package/dist/hooks/project-init.js.map +1 -0
  77. package/dist/hooks/slice-asset-delete.cjs +8 -2
  78. package/dist/hooks/slice-asset-delete.cjs.map +1 -1
  79. package/dist/hooks/slice-asset-delete.js +8 -2
  80. package/dist/hooks/slice-asset-delete.js.map +1 -1
  81. package/dist/hooks/slice-asset-read.cjs +8 -2
  82. package/dist/hooks/slice-asset-read.cjs.map +1 -1
  83. package/dist/hooks/slice-asset-read.js +8 -2
  84. package/dist/hooks/slice-asset-read.js.map +1 -1
  85. package/dist/hooks/slice-asset-update.cjs +8 -2
  86. package/dist/hooks/slice-asset-update.cjs.map +1 -1
  87. package/dist/hooks/slice-asset-update.js +8 -2
  88. package/dist/hooks/slice-asset-update.js.map +1 -1
  89. package/dist/hooks/slice-create.cjs +12 -10
  90. package/dist/hooks/slice-create.cjs.map +1 -1
  91. package/dist/hooks/slice-create.js +12 -10
  92. package/dist/hooks/slice-create.js.map +1 -1
  93. package/dist/hooks/slice-delete.cjs +6 -2
  94. package/dist/hooks/slice-delete.cjs.map +1 -1
  95. package/dist/hooks/slice-delete.js +6 -2
  96. package/dist/hooks/slice-delete.js.map +1 -1
  97. package/dist/hooks/slice-read.cjs +5 -1
  98. package/dist/hooks/slice-read.cjs.map +1 -1
  99. package/dist/hooks/slice-read.js +5 -1
  100. package/dist/hooks/slice-read.js.map +1 -1
  101. package/dist/hooks/slice-rename.cjs +10 -2
  102. package/dist/hooks/slice-rename.cjs.map +1 -1
  103. package/dist/hooks/slice-rename.js +10 -2
  104. package/dist/hooks/slice-rename.js.map +1 -1
  105. package/dist/hooks/sliceLibrary-read.cjs +5 -1
  106. package/dist/hooks/sliceLibrary-read.cjs.map +1 -1
  107. package/dist/hooks/sliceLibrary-read.js +5 -1
  108. package/dist/hooks/sliceLibrary-read.js.map +1 -1
  109. package/dist/hooks/sliceSimulator-setup-read.cjs +1 -1
  110. package/dist/hooks/sliceSimulator-setup-read.js +1 -1
  111. package/dist/lib/buildCustomTypeAssetPath.cjs +29 -0
  112. package/dist/lib/buildCustomTypeAssetPath.cjs.map +1 -0
  113. package/dist/lib/buildCustomTypeAssetPath.d.ts +9 -0
  114. package/dist/lib/buildCustomTypeAssetPath.js +12 -0
  115. package/dist/lib/buildCustomTypeAssetPath.js.map +1 -0
  116. package/dist/lib/buildCustomTypeDirectoryPath.cjs +26 -0
  117. package/dist/lib/buildCustomTypeDirectoryPath.cjs.map +1 -0
  118. package/dist/lib/buildCustomTypeDirectoryPath.d.ts +8 -0
  119. package/dist/lib/buildCustomTypeDirectoryPath.js +9 -0
  120. package/dist/lib/buildCustomTypeDirectoryPath.js.map +1 -0
  121. package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs +7 -0
  122. package/dist/lib/buildCustomTypeLibraryDirectoryPath.cjs.map +1 -0
  123. package/dist/lib/buildCustomTypeLibraryDirectoryPath.d.ts +7 -0
  124. package/dist/lib/buildCustomTypeLibraryDirectoryPath.js +7 -0
  125. package/dist/lib/buildCustomTypeLibraryDirectoryPath.js.map +1 -0
  126. package/dist/lib/buildSliceAssetPath.cjs +34 -0
  127. package/dist/lib/buildSliceAssetPath.cjs.map +1 -0
  128. package/dist/lib/buildSliceAssetPath.d.ts +11 -0
  129. package/dist/lib/buildSliceAssetPath.js +17 -0
  130. package/dist/lib/buildSliceAssetPath.js.map +1 -0
  131. package/dist/lib/buildSliceDirectoryPath.cjs +30 -0
  132. package/dist/lib/buildSliceDirectoryPath.cjs.map +1 -0
  133. package/dist/lib/buildSliceDirectoryPath.d.ts +10 -0
  134. package/dist/lib/buildSliceDirectoryPath.js +13 -0
  135. package/dist/lib/buildSliceDirectoryPath.js.map +1 -0
  136. package/dist/lib/buildSliceLibraryDirectoryPath.cjs +7 -0
  137. package/dist/lib/buildSliceLibraryDirectoryPath.cjs.map +1 -0
  138. package/dist/lib/buildSliceLibraryDirectoryPath.d.ts +8 -0
  139. package/dist/lib/buildSliceLibraryDirectoryPath.js +7 -0
  140. package/dist/lib/buildSliceLibraryDirectoryPath.js.map +1 -0
  141. package/dist/lib/updateSliceModelFile.cjs +4 -2
  142. package/dist/lib/updateSliceModelFile.cjs.map +1 -1
  143. package/dist/lib/updateSliceModelFile.js +3 -2
  144. package/dist/lib/updateSliceModelFile.js.map +1 -1
  145. package/dist/lib/upsertSliceLibraryIndexFile.cjs +7 -1
  146. package/dist/lib/upsertSliceLibraryIndexFile.cjs.map +1 -1
  147. package/dist/lib/upsertSliceLibraryIndexFile.js +6 -1
  148. package/dist/lib/upsertSliceLibraryIndexFile.js.map +1 -1
  149. package/dist/plugin.cjs +3 -3
  150. package/dist/plugin.cjs.map +1 -1
  151. package/dist/plugin.js +3 -3
  152. package/dist/plugin.js.map +1 -1
  153. package/package.json +18 -14
  154. package/src/hooks/customType-asset-delete.ts +7 -5
  155. package/src/hooks/customType-asset-read.ts +7 -5
  156. package/src/hooks/customType-asset-update.ts +7 -5
  157. package/src/hooks/customType-create.ts +5 -1
  158. package/src/hooks/customType-delete.ts +5 -1
  159. package/src/hooks/customType-read.ts +4 -3
  160. package/src/hooks/customTypeLibrary-read.ts +2 -1
  161. package/src/hooks/{command-init.ts → project-init.ts} +6 -4
  162. package/src/hooks/slice-asset-delete.ts +8 -6
  163. package/src/hooks/slice-asset-read.ts +8 -6
  164. package/src/hooks/slice-asset-update.ts +8 -6
  165. package/src/hooks/slice-create.ts +12 -17
  166. package/src/hooks/slice-delete.ts +6 -5
  167. package/src/hooks/slice-read.ts +5 -1
  168. package/src/hooks/slice-rename.ts +11 -9
  169. package/src/hooks/sliceLibrary-read.ts +5 -1
  170. package/src/lib/buildCustomTypeAssetPath.ts +24 -0
  171. package/src/lib/buildCustomTypeDirectoryPath.ts +20 -0
  172. package/src/lib/buildCustomTypeLibraryDirectoryPath.ts +13 -0
  173. package/src/lib/buildSliceAssetPath.ts +32 -0
  174. package/src/lib/buildSliceDirectoryPath.ts +26 -0
  175. package/src/lib/buildSliceLibraryDirectoryPath.ts +14 -0
  176. package/src/lib/updateSliceModelFile.ts +5 -4
  177. package/src/lib/upsertSliceLibraryIndexFile.ts +7 -2
  178. package/src/plugin.ts +2 -2
  179. package/dist/hooks/command-init.cjs.map +0 -1
  180. package/dist/hooks/command-init.d.ts +0 -3
  181. package/dist/hooks/command-init.js.map +0 -1
  182. package/dist/node_modules/data-uri-to-buffer/dist/index.cjs.map +0 -1
  183. package/dist/node_modules/data-uri-to-buffer/dist/index.js.map +0 -1
  184. package/dist/node_modules/fetch-blob/file.cjs.map +0 -1
  185. package/dist/node_modules/fetch-blob/file.js.map +0 -1
  186. package/dist/node_modules/fetch-blob/index.cjs.map +0 -1
  187. package/dist/node_modules/fetch-blob/index.js.map +0 -1
  188. package/dist/node_modules/fetch-blob/streams.cjs.map +0 -1
  189. package/dist/node_modules/fetch-blob/streams.js.map +0 -1
  190. package/dist/node_modules/formdata-polyfill/esm.min.cjs.map +0 -1
  191. package/dist/node_modules/formdata-polyfill/esm.min.js.map +0 -1
  192. package/dist/node_modules/node-domexception/index.cjs.map +0 -1
  193. package/dist/node_modules/node-domexception/index.js.map +0 -1
  194. package/dist/node_modules/node-fetch/src/body.cjs.map +0 -1
  195. package/dist/node_modules/node-fetch/src/body.js.map +0 -1
  196. package/dist/node_modules/node-fetch/src/errors/abort-error.cjs.map +0 -1
  197. package/dist/node_modules/node-fetch/src/errors/abort-error.js.map +0 -1
  198. package/dist/node_modules/node-fetch/src/errors/base.cjs.map +0 -1
  199. package/dist/node_modules/node-fetch/src/errors/base.js.map +0 -1
  200. package/dist/node_modules/node-fetch/src/errors/fetch-error.cjs.map +0 -1
  201. package/dist/node_modules/node-fetch/src/errors/fetch-error.js.map +0 -1
  202. package/dist/node_modules/node-fetch/src/headers.cjs.map +0 -1
  203. package/dist/node_modules/node-fetch/src/headers.js.map +0 -1
  204. package/dist/node_modules/node-fetch/src/index.cjs.map +0 -1
  205. package/dist/node_modules/node-fetch/src/index.js.map +0 -1
  206. package/dist/node_modules/node-fetch/src/request.cjs.map +0 -1
  207. package/dist/node_modules/node-fetch/src/request.js.map +0 -1
  208. package/dist/node_modules/node-fetch/src/response.cjs.map +0 -1
  209. package/dist/node_modules/node-fetch/src/response.js.map +0 -1
  210. package/dist/node_modules/node-fetch/src/utils/get-search.cjs.map +0 -1
  211. package/dist/node_modules/node-fetch/src/utils/get-search.js.map +0 -1
  212. package/dist/node_modules/node-fetch/src/utils/is-redirect.cjs.map +0 -1
  213. package/dist/node_modules/node-fetch/src/utils/is-redirect.js.map +0 -1
  214. package/dist/node_modules/node-fetch/src/utils/is.cjs.map +0 -1
  215. package/dist/node_modules/node-fetch/src/utils/is.js.map +0 -1
  216. package/dist/node_modules/node-fetch/src/utils/multipart-parser.cjs.map +0 -1
  217. package/dist/node_modules/node-fetch/src/utils/multipart-parser.js.map +0 -1
  218. package/dist/node_modules/node-fetch/src/utils/referrer.cjs.map +0 -1
  219. package/dist/node_modules/node-fetch/src/utils/referrer.js.map +0 -1
  220. package/dist/node_modules/web-streams-polyfill/dist/ponyfill.es2018.cjs.map +0 -1
  221. package/dist/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js.map +0 -1
  222. /package/dist/{node_modules → _node_modules}/fetch-blob/file.cjs +0 -0
  223. /package/dist/{node_modules → _node_modules}/fetch-blob/file.js +0 -0
  224. /package/dist/{node_modules → _node_modules}/fetch-blob/index.cjs +0 -0
  225. /package/dist/{node_modules → _node_modules}/fetch-blob/index.js +0 -0
  226. /package/dist/{node_modules → _node_modules}/fetch-blob/streams.cjs +0 -0
  227. /package/dist/{node_modules → _node_modules}/fetch-blob/streams.js +0 -0
  228. /package/dist/{node_modules → _node_modules}/formdata-polyfill/esm.min.cjs +0 -0
  229. /package/dist/{node_modules → _node_modules}/formdata-polyfill/esm.min.js +0 -0
  230. /package/dist/{node_modules → _node_modules}/node-domexception/index.cjs +0 -0
  231. /package/dist/{node_modules → _node_modules}/node-domexception/index.js +0 -0
  232. /package/dist/{node_modules → _node_modules}/node-fetch/src/body.cjs +0 -0
  233. /package/dist/{node_modules → _node_modules}/node-fetch/src/body.js +0 -0
  234. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/abort-error.cjs +0 -0
  235. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/abort-error.js +0 -0
  236. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/base.cjs +0 -0
  237. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/base.js +0 -0
  238. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/fetch-error.cjs +0 -0
  239. /package/dist/{node_modules → _node_modules}/node-fetch/src/errors/fetch-error.js +0 -0
  240. /package/dist/{node_modules → _node_modules}/node-fetch/src/headers.cjs +0 -0
  241. /package/dist/{node_modules → _node_modules}/node-fetch/src/headers.js +0 -0
  242. /package/dist/{node_modules → _node_modules}/node-fetch/src/index.cjs +0 -0
  243. /package/dist/{node_modules → _node_modules}/node-fetch/src/index.js +0 -0
  244. /package/dist/{node_modules → _node_modules}/node-fetch/src/request.cjs +0 -0
  245. /package/dist/{node_modules → _node_modules}/node-fetch/src/request.js +0 -0
  246. /package/dist/{node_modules → _node_modules}/node-fetch/src/response.cjs +0 -0
  247. /package/dist/{node_modules → _node_modules}/node-fetch/src/response.js +0 -0
  248. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/get-search.cjs +0 -0
  249. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/get-search.js +0 -0
  250. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/is-redirect.cjs +0 -0
  251. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/is-redirect.js +0 -0
  252. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/is.cjs +0 -0
  253. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/is.js +0 -0
  254. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/multipart-parser.cjs +0 -0
  255. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/multipart-parser.js +0 -0
  256. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/referrer.cjs +0 -0
  257. /package/dist/{node_modules → _node_modules}/node-fetch/src/utils/referrer.js +0 -0
  258. /package/dist/{node_modules → _node_modules}/web-streams-polyfill/dist/ponyfill.es2018.cjs +0 -0
  259. /package/dist/{node_modules → _node_modules}/web-streams-polyfill/dist/ponyfill.es2018.js +0 -0
  260. /package/dist/{package.json.cjs → packages/adapter-next/package.json.cjs} +0 -0
  261. /package/dist/{package.json.cjs.map → packages/adapter-next/package.json.cjs.map} +0 -0
  262. /package/dist/{package.json.js → packages/adapter-next/package.json.js} +0 -0
  263. /package/dist/{package.json.js.map → packages/adapter-next/package.json.js.map} +0 -0
@@ -0,0 +1,12 @@
1
+ import * as path from "node:path";
2
+ import { buildCustomTypeDirectoryPath } from "./buildCustomTypeDirectoryPath.js";
3
+ const buildCustomTypeAssetPath = (args) => {
4
+ return path.join(buildCustomTypeDirectoryPath({
5
+ customTypeID: args.customTypeID,
6
+ helpers: args.helpers
7
+ }), args.assetID);
8
+ };
9
+ export {
10
+ buildCustomTypeAssetPath
11
+ };
12
+ //# sourceMappingURL=buildCustomTypeAssetPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCustomTypeAssetPath.js","sources":["../../../src/lib/buildCustomTypeAssetPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeDirectoryPath } from \"./buildCustomTypeDirectoryPath\";\n\ntype BuildCustomTypeAssetPathArgs = {\n\tcustomTypeID: string;\n\tassetID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeAssetPath = (\n\targs: BuildCustomTypeAssetPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeDirectoryPath({\n\t\t\tcustomTypeID: args.customTypeID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\targs.assetID,\n\t);\n};\n"],"names":[],"mappings":";;AAaa,MAAA,2BAA2B,CACvC,SACW;AACJ,SAAA,KAAK,KACX,6BAA6B;AAAA,IAC5B,cAAc,KAAK;AAAA,IACnB,SAAS,KAAK;AAAA,EAAA,CACd,GACD,KAAK,OAAO;AAEd;"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const path = require("node:path");
4
+ const buildCustomTypeLibraryDirectoryPath = require("./buildCustomTypeLibraryDirectoryPath.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 path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
22
+ const buildCustomTypeDirectoryPath = (args) => {
23
+ return path__namespace.join(buildCustomTypeLibraryDirectoryPath.buildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }), args.customTypeID);
24
+ };
25
+ exports.buildCustomTypeDirectoryPath = buildCustomTypeDirectoryPath;
26
+ //# sourceMappingURL=buildCustomTypeDirectoryPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCustomTypeDirectoryPath.cjs","sources":["../../../src/lib/buildCustomTypeDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"./buildCustomTypeLibraryDirectoryPath\";\n\ntype BuildCustomTypeDirectoryPathArgs = {\n\tcustomTypeID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeDirectoryPath = (\n\targs: BuildCustomTypeDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }),\n\t\targs.customTypeID,\n\t);\n};\n"],"names":["path","buildCustomTypeLibraryDirectoryPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYa,MAAA,+BAA+B,CAC3C,SACW;AACJ,SAAAA,gBAAK,KACXC,oCAAA,oCAAoC,EAAE,SAAS,KAAK,SAAS,GAC7D,KAAK,YAAY;AAEnB;;"}
@@ -0,0 +1,8 @@
1
+ import { SliceMachineContext } from "@slicemachine/plugin-kit";
2
+ import { PluginOptions } from "../types";
3
+ type BuildCustomTypeDirectoryPathArgs = {
4
+ customTypeID: string;
5
+ helpers: SliceMachineContext<PluginOptions>["helpers"];
6
+ };
7
+ export declare const buildCustomTypeDirectoryPath: (args: BuildCustomTypeDirectoryPathArgs) => string;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as path from "node:path";
2
+ import { buildCustomTypeLibraryDirectoryPath } from "./buildCustomTypeLibraryDirectoryPath.js";
3
+ const buildCustomTypeDirectoryPath = (args) => {
4
+ return path.join(buildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }), args.customTypeID);
5
+ };
6
+ export {
7
+ buildCustomTypeDirectoryPath
8
+ };
9
+ //# sourceMappingURL=buildCustomTypeDirectoryPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCustomTypeDirectoryPath.js","sources":["../../../src/lib/buildCustomTypeDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildCustomTypeLibraryDirectoryPath } from \"./buildCustomTypeLibraryDirectoryPath\";\n\ntype BuildCustomTypeDirectoryPathArgs = {\n\tcustomTypeID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeDirectoryPath = (\n\targs: BuildCustomTypeDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildCustomTypeLibraryDirectoryPath({ helpers: args.helpers }),\n\t\targs.customTypeID,\n\t);\n};\n"],"names":[],"mappings":";;AAYa,MAAA,+BAA+B,CAC3C,SACW;AACJ,SAAA,KAAK,KACX,oCAAoC,EAAE,SAAS,KAAK,SAAS,GAC7D,KAAK,YAAY;AAEnB;"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildCustomTypeLibraryDirectoryPath = (args) => {
4
+ return args.helpers.joinPathFromRoot("customtypes");
5
+ };
6
+ exports.buildCustomTypeLibraryDirectoryPath = buildCustomTypeLibraryDirectoryPath;
7
+ //# sourceMappingURL=buildCustomTypeLibraryDirectoryPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCustomTypeLibraryDirectoryPath.cjs","sources":["../../../src/lib/buildCustomTypeLibraryDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\ntype BuildCustomTypeLibraryDirectoryPathArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeLibraryDirectoryPath = (\n\targs: BuildCustomTypeLibraryDirectoryPathArgs,\n): string => {\n\treturn args.helpers.joinPathFromRoot(\"customtypes\");\n};\n"],"names":[],"mappings":";;AAQa,MAAA,sCAAsC,CAClD,SACW;AACJ,SAAA,KAAK,QAAQ,iBAAiB,aAAa;AACnD;;"}
@@ -0,0 +1,7 @@
1
+ import { SliceMachineContext } from "@slicemachine/plugin-kit";
2
+ import { PluginOptions } from "../types";
3
+ type BuildCustomTypeLibraryDirectoryPathArgs = {
4
+ helpers: SliceMachineContext<PluginOptions>["helpers"];
5
+ };
6
+ export declare const buildCustomTypeLibraryDirectoryPath: (args: BuildCustomTypeLibraryDirectoryPathArgs) => string;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ const buildCustomTypeLibraryDirectoryPath = (args) => {
2
+ return args.helpers.joinPathFromRoot("customtypes");
3
+ };
4
+ export {
5
+ buildCustomTypeLibraryDirectoryPath
6
+ };
7
+ //# sourceMappingURL=buildCustomTypeLibraryDirectoryPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildCustomTypeLibraryDirectoryPath.js","sources":["../../../src/lib/buildCustomTypeLibraryDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\ntype BuildCustomTypeLibraryDirectoryPathArgs = {\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildCustomTypeLibraryDirectoryPath = (\n\targs: BuildCustomTypeLibraryDirectoryPathArgs,\n): string => {\n\treturn args.helpers.joinPathFromRoot(\"customtypes\");\n};\n"],"names":[],"mappings":"AAQa,MAAA,sCAAsC,CAClD,SACW;AACJ,SAAA,KAAK,QAAQ,iBAAiB,aAAa;AACnD;"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const path = require("node:path");
4
+ const buildSliceDirectoryPath = require("./buildSliceDirectoryPath.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 path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
22
+ const buildSliceAssetPath = async (args) => {
23
+ const { model } = await args.actions.readSliceModel({
24
+ libraryID: args.libraryID,
25
+ sliceID: args.sliceID
26
+ });
27
+ return path__namespace.join(buildSliceDirectoryPath.buildSliceDirectoryPath({
28
+ libraryID: args.libraryID,
29
+ model,
30
+ helpers: args.helpers
31
+ }), args.assetID);
32
+ };
33
+ exports.buildSliceAssetPath = buildSliceAssetPath;
34
+ //# sourceMappingURL=buildSliceAssetPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceAssetPath.cjs","sources":["../../../src/lib/buildSliceAssetPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype BuildSliceAssetPathArgs = {\n\tlibraryID: string;\n\tsliceID: string;\n\tassetID: string;\n\tactions: SliceMachineContext<PluginOptions>[\"actions\"];\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceAssetPath = async (\n\targs: BuildSliceAssetPathArgs,\n): Promise<string> => {\n\tconst { model } = await args.actions.readSliceModel({\n\t\tlibraryID: args.libraryID,\n\t\tsliceID: args.sliceID,\n\t});\n\n\treturn path.join(\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\tmodel,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\targs.assetID,\n\t);\n};\n"],"names":["path","buildSliceDirectoryPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAea,MAAA,sBAAsB,OAClC,SACoB;AACpB,QAAM,EAAE,MAAK,IAAK,MAAM,KAAK,QAAQ,eAAe;AAAA,IACnD,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EAAA,CACd;AAEM,SAAAA,gBAAK,KACXC,gDAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB;AAAA,IACA,SAAS,KAAK;AAAA,EAAA,CACd,GACD,KAAK,OAAO;AAEd;;"}
@@ -0,0 +1,11 @@
1
+ import { SliceMachineContext } from "@slicemachine/plugin-kit";
2
+ import { PluginOptions } from "../types";
3
+ type BuildSliceAssetPathArgs = {
4
+ libraryID: string;
5
+ sliceID: string;
6
+ assetID: string;
7
+ actions: SliceMachineContext<PluginOptions>["actions"];
8
+ helpers: SliceMachineContext<PluginOptions>["helpers"];
9
+ };
10
+ export declare const buildSliceAssetPath: (args: BuildSliceAssetPathArgs) => Promise<string>;
11
+ export {};
@@ -0,0 +1,17 @@
1
+ import * as path from "node:path";
2
+ import { buildSliceDirectoryPath } from "./buildSliceDirectoryPath.js";
3
+ const buildSliceAssetPath = async (args) => {
4
+ const { model } = await args.actions.readSliceModel({
5
+ libraryID: args.libraryID,
6
+ sliceID: args.sliceID
7
+ });
8
+ return path.join(buildSliceDirectoryPath({
9
+ libraryID: args.libraryID,
10
+ model,
11
+ helpers: args.helpers
12
+ }), args.assetID);
13
+ };
14
+ export {
15
+ buildSliceAssetPath
16
+ };
17
+ //# sourceMappingURL=buildSliceAssetPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceAssetPath.js","sources":["../../../src/lib/buildSliceAssetPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype BuildSliceAssetPathArgs = {\n\tlibraryID: string;\n\tsliceID: string;\n\tassetID: string;\n\tactions: SliceMachineContext<PluginOptions>[\"actions\"];\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceAssetPath = async (\n\targs: BuildSliceAssetPathArgs,\n): Promise<string> => {\n\tconst { model } = await args.actions.readSliceModel({\n\t\tlibraryID: args.libraryID,\n\t\tsliceID: args.sliceID,\n\t});\n\n\treturn path.join(\n\t\tbuildSliceDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\tmodel,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\targs.assetID,\n\t);\n};\n"],"names":[],"mappings":";;AAea,MAAA,sBAAsB,OAClC,SACoB;AACpB,QAAM,EAAE,MAAK,IAAK,MAAM,KAAK,QAAQ,eAAe;AAAA,IACnD,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EAAA,CACd;AAEM,SAAA,KAAK,KACX,wBAAwB;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB;AAAA,IACA,SAAS,KAAK;AAAA,EAAA,CACd,GACD,KAAK,OAAO;AAEd;"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const path = require("node:path");
4
+ const buildSliceLibraryDirectoryPath = require("./buildSliceLibraryDirectoryPath.cjs");
5
+ const pascalCase = require("./pascalCase.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 buildSliceDirectoryPath = (args) => {
24
+ return path__namespace.join(buildSliceLibraryDirectoryPath.buildSliceLibraryDirectoryPath({
25
+ libraryID: args.libraryID,
26
+ helpers: args.helpers
27
+ }), pascalCase.pascalCase(args.model.name));
28
+ };
29
+ exports.buildSliceDirectoryPath = buildSliceDirectoryPath;
30
+ //# sourceMappingURL=buildSliceDirectoryPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceDirectoryPath.cjs","sources":["../../../src/lib/buildSliceDirectoryPath.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildSliceLibraryDirectoryPath } from \"./buildSliceLibraryDirectoryPath\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype BuildSliceDirectoryPathArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceDirectoryPath = (\n\targs: BuildSliceDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildSliceLibraryDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\tpascalCase(args.model.name),\n\t);\n};\n"],"names":["path","buildSliceLibraryDirectoryPath","pascalCase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAea,MAAA,0BAA0B,CACtC,SACW;AACJ,SAAAA,gBAAK,KACXC,8DAA+B;AAAA,IAC9B,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EACd,CAAA,GACDC,WAAAA,WAAW,KAAK,MAAM,IAAI,CAAC;AAE7B;;"}
@@ -0,0 +1,10 @@
1
+ import { SharedSliceModel } from "@prismicio/types";
2
+ import { SliceMachineContext } from "@slicemachine/plugin-kit";
3
+ import { PluginOptions } from "../types";
4
+ type BuildSliceDirectoryPathArgs = {
5
+ libraryID: string;
6
+ model: SharedSliceModel;
7
+ helpers: SliceMachineContext<PluginOptions>["helpers"];
8
+ };
9
+ export declare const buildSliceDirectoryPath: (args: BuildSliceDirectoryPathArgs) => string;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ import * as path from "node:path";
2
+ import { buildSliceLibraryDirectoryPath } from "./buildSliceLibraryDirectoryPath.js";
3
+ import { pascalCase } from "./pascalCase.js";
4
+ const buildSliceDirectoryPath = (args) => {
5
+ return path.join(buildSliceLibraryDirectoryPath({
6
+ libraryID: args.libraryID,
7
+ helpers: args.helpers
8
+ }), pascalCase(args.model.name));
9
+ };
10
+ export {
11
+ buildSliceDirectoryPath
12
+ };
13
+ //# sourceMappingURL=buildSliceDirectoryPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceDirectoryPath.js","sources":["../../../src/lib/buildSliceDirectoryPath.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as path from \"node:path\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { buildSliceLibraryDirectoryPath } from \"./buildSliceLibraryDirectoryPath\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype BuildSliceDirectoryPathArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceDirectoryPath = (\n\targs: BuildSliceDirectoryPathArgs,\n): string => {\n\treturn path.join(\n\t\tbuildSliceLibraryDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\tpascalCase(args.model.name),\n\t);\n};\n"],"names":[],"mappings":";;;AAea,MAAA,0BAA0B,CACtC,SACW;AACJ,SAAA,KAAK,KACX,+BAA+B;AAAA,IAC9B,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EACd,CAAA,GACD,WAAW,KAAK,MAAM,IAAI,CAAC;AAE7B;"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const buildSliceLibraryDirectoryPath = (args) => {
4
+ return args.helpers.joinPathFromRoot(args.libraryID);
5
+ };
6
+ exports.buildSliceLibraryDirectoryPath = buildSliceLibraryDirectoryPath;
7
+ //# sourceMappingURL=buildSliceLibraryDirectoryPath.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceLibraryDirectoryPath.cjs","sources":["../../../src/lib/buildSliceLibraryDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\ntype BuildSliceLibraryDirectoryPathArgs = {\n\tlibraryID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceLibraryDirectoryPath = (\n\targs: BuildSliceLibraryDirectoryPathArgs,\n): string => {\n\treturn args.helpers.joinPathFromRoot(args.libraryID);\n};\n"],"names":[],"mappings":";;AASa,MAAA,iCAAiC,CAC7C,SACW;AACX,SAAO,KAAK,QAAQ,iBAAiB,KAAK,SAAS;AACpD;;"}
@@ -0,0 +1,8 @@
1
+ import { SliceMachineContext } from "@slicemachine/plugin-kit";
2
+ import { PluginOptions } from "../types";
3
+ type BuildSliceLibraryDirectoryPathArgs = {
4
+ libraryID: string;
5
+ helpers: SliceMachineContext<PluginOptions>["helpers"];
6
+ };
7
+ export declare const buildSliceLibraryDirectoryPath: (args: BuildSliceLibraryDirectoryPathArgs) => string;
8
+ export {};
@@ -0,0 +1,7 @@
1
+ const buildSliceLibraryDirectoryPath = (args) => {
2
+ return args.helpers.joinPathFromRoot(args.libraryID);
3
+ };
4
+ export {
5
+ buildSliceLibraryDirectoryPath
6
+ };
7
+ //# sourceMappingURL=buildSliceLibraryDirectoryPath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSliceLibraryDirectoryPath.js","sources":["../../../src/lib/buildSliceLibraryDirectoryPath.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\n\nimport { PluginOptions } from \"../types\";\n\ntype BuildSliceLibraryDirectoryPathArgs = {\n\tlibraryID: string;\n\thelpers: SliceMachineContext<PluginOptions>[\"helpers\"];\n};\n\nexport const buildSliceLibraryDirectoryPath = (\n\targs: BuildSliceLibraryDirectoryPathArgs,\n): string => {\n\treturn args.helpers.joinPathFromRoot(args.libraryID);\n};\n"],"names":[],"mappings":"AASa,MAAA,iCAAiC,CAC7C,SACW;AACX,SAAO,KAAK,QAAQ,iBAAiB,KAAK,SAAS;AACpD;"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const fs = require("node:fs/promises");
4
- const pascalCase = require("./pascalCase.cjs");
4
+ const path = require("node:path");
5
+ const buildSliceDirectoryPath = require("./buildSliceDirectoryPath.cjs");
5
6
  function _interopNamespaceDefault(e) {
6
7
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
7
8
  if (e) {
@@ -19,8 +20,9 @@ function _interopNamespaceDefault(e) {
19
20
  return Object.freeze(n);
20
21
  }
21
22
  const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
23
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
22
24
  const updateSliceModelFile = async ({ libraryID, model, helpers, options }) => {
23
- const filePath = helpers.joinPathFromRoot(libraryID, pascalCase.pascalCase(model.name), "model.json");
25
+ const filePath = path__namespace.join(buildSliceDirectoryPath.buildSliceDirectoryPath({ libraryID, model, helpers }), "model.json");
24
26
  let contents = JSON.stringify(model);
25
27
  if (options.format) {
26
28
  contents = await helpers.format(contents, filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"updateSliceModelFile.cjs","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport type { PluginOptions } from \"../types\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = helpers.joinPathFromRoot(\n\t\tlibraryID,\n\t\tpascalCase(model.name),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(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"],"names":["pascalCase","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAYO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAW,QAAQ,iBACxB,WACAA,sBAAW,MAAM,IAAI,GACrB,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
1
+ {"version":3,"file":"updateSliceModelFile.cjs","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = path.join(\n\t\tbuildSliceDirectoryPath({ libraryID, model, helpers }),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(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"],"names":["path","buildSliceDirectoryPath","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAWA,gBAAK,KACrBC,gDAAwB,EAAE,WAAW,OAAO,QAAA,CAAS,GACrD,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
@@ -1,7 +1,8 @@
1
1
  import * as fs from "node:fs/promises";
2
- import { pascalCase } from "./pascalCase.js";
2
+ import * as path from "node:path";
3
+ import { buildSliceDirectoryPath } from "./buildSliceDirectoryPath.js";
3
4
  const updateSliceModelFile = async ({ libraryID, model, helpers, options }) => {
4
- const filePath = helpers.joinPathFromRoot(libraryID, pascalCase(model.name), "model.json");
5
+ const filePath = path.join(buildSliceDirectoryPath({ libraryID, model, helpers }), "model.json");
5
6
  let contents = JSON.stringify(model);
6
7
  if (options.format) {
7
8
  contents = await helpers.format(contents, filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"updateSliceModelFile.js","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\n\nimport type { PluginOptions } from \"../types\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = helpers.joinPathFromRoot(\n\t\tlibraryID,\n\t\tpascalCase(model.name),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(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"],"names":[],"mappings":";;AAYO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAW,QAAQ,iBACxB,WACA,WAAW,MAAM,IAAI,GACrB,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;"}
1
+ {"version":3,"file":"updateSliceModelFile.js","sources":["../../../src/lib/updateSliceModelFile.ts"],"sourcesContent":["import { SharedSliceModel } from \"@prismicio/types\";\nimport { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\n\nimport type { PluginOptions } from \"../types\";\n\nimport { buildSliceDirectoryPath } from \"./buildSliceDirectoryPath\";\n\ntype UpdateSliceModelFileArgs = {\n\tlibraryID: string;\n\tmodel: SharedSliceModel;\n} & SliceMachineContext<PluginOptions>;\n\nexport const updateSliceModelFile = async ({\n\tlibraryID,\n\tmodel,\n\thelpers,\n\toptions,\n}: UpdateSliceModelFileArgs): Promise<void> => {\n\tconst filePath = path.join(\n\t\tbuildSliceDirectoryPath({ libraryID, model, helpers }),\n\t\t\"model.json\",\n\t);\n\n\tlet contents = JSON.stringify(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"],"names":[],"mappings":";;;AAcO,MAAM,uBAAuB,OAAO,EAC1C,WACA,OACA,SACA,cAC6C;AACvC,QAAA,WAAW,KAAK,KACrB,wBAAwB,EAAE,WAAW,OAAO,QAAA,CAAS,GACrD,YAAY;AAGT,MAAA,WAAW,KAAK,UAAU,KAAK;AAEnC,MAAI,QAAQ,QAAQ;AACnB,eAAW,MAAM,QAAQ,OAAO,UAAU,QAAQ;AAAA,EAClD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;"}
@@ -2,9 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const commonTags = require("common-tags");
4
4
  const fs = require("node:fs/promises");
5
+ const path = require("node:path");
5
6
  const constants = require("../constants.cjs");
6
7
  const checkIsTypeScriptProject = require("./checkIsTypeScriptProject.cjs");
7
8
  const pascalCase = require("./pascalCase.cjs");
9
+ const buildSliceLibraryDirectoryPath = require("./buildSliceLibraryDirectoryPath.cjs");
8
10
  function _interopNamespaceDefault(e) {
9
11
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
10
12
  if (e) {
@@ -22,12 +24,16 @@ function _interopNamespaceDefault(e) {
22
24
  return Object.freeze(n);
23
25
  }
24
26
  const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
27
+ const path__namespace = /* @__PURE__ */ _interopNamespaceDefault(path);
25
28
  const upsertSliceLibraryIndexFile = async (args) => {
26
29
  const isTypeScriptProject = await checkIsTypeScriptProject.checkIsTypeScriptProject({
27
30
  helpers: args.helpers,
28
31
  options: args.options
29
32
  });
30
- const filePath = args.helpers.joinPathFromRoot(args.libraryID, isTypeScriptProject ? "index.ts" : "index.js");
33
+ const filePath = path__namespace.join(buildSliceLibraryDirectoryPath.buildSliceLibraryDirectoryPath({
34
+ libraryID: args.libraryID,
35
+ helpers: args.helpers
36
+ }), isTypeScriptProject ? "index.ts" : "index.js");
31
37
  const slices = await args.actions.readAllSliceModelsForLibrary({
32
38
  libraryID: args.libraryID
33
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"upsertSliceLibraryIndexFile.cjs","sources":["../../../src/lib/upsertSliceLibraryIndexFile.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport * as fs from \"node:fs/promises\";\nimport { NON_EDITABLE_FILE_BANNER } from \"../constants\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype UpsertSliceLibraryIndexFileArgs = {\n\tlibraryID: string;\n} & SliceMachineContext<PluginOptions>;\n\nexport const upsertSliceLibraryIndexFile = async (\n\targs: UpsertSliceLibraryIndexFileArgs,\n): Promise<void> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers: args.helpers,\n\t\toptions: args.options,\n\t});\n\n\tconst filePath = args.helpers.joinPathFromRoot(\n\t\targs.libraryID,\n\t\tisTypeScriptProject ? \"index.ts\" : \"index.js\",\n\t);\n\n\tconst slices = await args.actions.readAllSliceModelsForLibrary({\n\t\tlibraryID: args.libraryID,\n\t});\n\n\tlet contents: string;\n\n\tif (args.options.lazyLoadSlices) {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\timport dynamic from 'next/dynamic'\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: dynamic(() => import('./${dirName}'))`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\",\\n\")}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\t${slices\n\t\t\t\t.map((slice) => {\n\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\treturn `import ${componentName} from \"./${dirName}\";`;\n\t\t\t\t})\n\t\t\t\t.join(\"\\n\")}\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: ${componentName},`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\n\t\t\t}\n\t\t`;\n\t}\n\n\tif (args.options.format) {\n\t\tcontents = await args.helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":["checkIsTypeScriptProject","stripIndent","NON_EDITABLE_FILE_BANNER","pascalCase","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAca,MAAA,8BAA8B,OAC1C,SACkB;AACZ,QAAA,sBAAsB,MAAMA,kDAAyB;AAAA,IAC1D,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,EAAA,CACd;AAEK,QAAA,WAAW,KAAK,QAAQ,iBAC7B,KAAK,WACL,sBAAsB,aAAa,UAAU;AAG9C,QAAM,SAAS,MAAM,KAAK,QAAQ,6BAA6B;AAAA,IAC9D,WAAW,KAAK;AAAA,EAAA,CAChB;AAEG,MAAA;AAEA,MAAA,KAAK,QAAQ,gBAAgB;AACrB,eAAAC,WAAAA;AAAAA,KACRC;;;;;MAKC,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,UAAUC,WAAA,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,GAAG,+BAA+B;AAAA,IAAA,CACzC,EACA,KAAK,KAAK;AAAA;AAAA;AAAA,EAAA,OAGR;AACK,eAAAF,WAAAA;AAAAA,KACRC;;KAEA,OACA,IAAI,CAAC,UAAS;AACd,YAAM,gBAAgBC,WAAA,WAAW,MAAM,MAAM,IAAI;AACjD,YAAM,UAAUA,WAAA,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,UAAU,yBAAyB;AAAA,IAAA,CAC1C,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,MAGR,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,gBAAgBA,WAAA,WAAW,MAAM,MAAM,IAAI;AAEjD,aAAO,GAAG,OAAO;AAAA,IAAA,CACjB,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,EAGb;AAEG,MAAA,KAAK,QAAQ,QAAQ;AACxB,eAAW,MAAM,KAAK,QAAQ,OAAO,UAAU,QAAQ;AAAA,EACvD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
1
+ {"version":3,"file":"upsertSliceLibraryIndexFile.cjs","sources":["../../../src/lib/upsertSliceLibraryIndexFile.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { NON_EDITABLE_FILE_BANNER } from \"../constants\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\nimport { pascalCase } from \"./pascalCase\";\nimport { buildSliceLibraryDirectoryPath } from \"./buildSliceLibraryDirectoryPath\";\n\ntype UpsertSliceLibraryIndexFileArgs = {\n\tlibraryID: string;\n} & SliceMachineContext<PluginOptions>;\n\nexport const upsertSliceLibraryIndexFile = async (\n\targs: UpsertSliceLibraryIndexFileArgs,\n): Promise<void> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers: args.helpers,\n\t\toptions: args.options,\n\t});\n\n\tconst filePath = path.join(\n\t\tbuildSliceLibraryDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\tisTypeScriptProject ? \"index.ts\" : \"index.js\",\n\t);\n\n\tconst slices = await args.actions.readAllSliceModelsForLibrary({\n\t\tlibraryID: args.libraryID,\n\t});\n\n\tlet contents: string;\n\n\tif (args.options.lazyLoadSlices) {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\timport dynamic from 'next/dynamic'\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: dynamic(() => import('./${dirName}'))`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\",\\n\")}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\t${slices\n\t\t\t\t.map((slice) => {\n\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\treturn `import ${componentName} from \"./${dirName}\";`;\n\t\t\t\t})\n\t\t\t\t.join(\"\\n\")}\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: ${componentName},`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\n\t\t\t}\n\t\t`;\n\t}\n\n\tif (args.options.format) {\n\t\tcontents = await args.helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":["checkIsTypeScriptProject","path","buildSliceLibraryDirectoryPath","stripIndent","NON_EDITABLE_FILE_BANNER","pascalCase","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBa,MAAA,8BAA8B,OAC1C,SACkB;AACZ,QAAA,sBAAsB,MAAMA,kDAAyB;AAAA,IAC1D,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,EAAA,CACd;AAEK,QAAA,WAAWC,gBAAK,KACrBC,8DAA+B;AAAA,IAC9B,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EACd,CAAA,GACD,sBAAsB,aAAa,UAAU;AAG9C,QAAM,SAAS,MAAM,KAAK,QAAQ,6BAA6B;AAAA,IAC9D,WAAW,KAAK;AAAA,EAAA,CAChB;AAEG,MAAA;AAEA,MAAA,KAAK,QAAQ,gBAAgB;AACrB,eAAAC,WAAAA;AAAAA,KACRC;;;;;MAKC,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,UAAUC,WAAA,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,GAAG,+BAA+B;AAAA,IAAA,CACzC,EACA,KAAK,KAAK;AAAA;AAAA;AAAA,EAAA,OAGR;AACK,eAAAF,WAAAA;AAAAA,KACRC;;KAEA,OACA,IAAI,CAAC,UAAS;AACd,YAAM,gBAAgBC,WAAA,WAAW,MAAM,MAAM,IAAI;AACjD,YAAM,UAAUA,WAAA,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,UAAU,yBAAyB;AAAA,IAAA,CAC1C,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,MAGR,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,gBAAgBA,WAAA,WAAW,MAAM,MAAM,IAAI;AAEjD,aAAO,GAAG,OAAO;AAAA,IAAA,CACjB,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,EAGb;AAEG,MAAA,KAAK,QAAQ,QAAQ;AACxB,eAAW,MAAM,KAAK,QAAQ,OAAO,UAAU,QAAQ;AAAA,EACvD;AAEK,QAAAC,cAAG,UAAU,UAAU,QAAQ;AACtC;;"}
@@ -1,14 +1,19 @@
1
1
  import { stripIndent } from "common-tags";
2
2
  import * as fs from "node:fs/promises";
3
+ import * as path from "node:path";
3
4
  import { NON_EDITABLE_FILE_BANNER } from "../constants.js";
4
5
  import { checkIsTypeScriptProject } from "./checkIsTypeScriptProject.js";
5
6
  import { pascalCase } from "./pascalCase.js";
7
+ import { buildSliceLibraryDirectoryPath } from "./buildSliceLibraryDirectoryPath.js";
6
8
  const upsertSliceLibraryIndexFile = async (args) => {
7
9
  const isTypeScriptProject = await checkIsTypeScriptProject({
8
10
  helpers: args.helpers,
9
11
  options: args.options
10
12
  });
11
- const filePath = args.helpers.joinPathFromRoot(args.libraryID, isTypeScriptProject ? "index.ts" : "index.js");
13
+ const filePath = path.join(buildSliceLibraryDirectoryPath({
14
+ libraryID: args.libraryID,
15
+ helpers: args.helpers
16
+ }), isTypeScriptProject ? "index.ts" : "index.js");
12
17
  const slices = await args.actions.readAllSliceModelsForLibrary({
13
18
  libraryID: args.libraryID
14
19
  });
@@ -1 +1 @@
1
- {"version":3,"file":"upsertSliceLibraryIndexFile.js","sources":["../../../src/lib/upsertSliceLibraryIndexFile.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport * as fs from \"node:fs/promises\";\nimport { NON_EDITABLE_FILE_BANNER } from \"../constants\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\nimport { pascalCase } from \"./pascalCase\";\n\ntype UpsertSliceLibraryIndexFileArgs = {\n\tlibraryID: string;\n} & SliceMachineContext<PluginOptions>;\n\nexport const upsertSliceLibraryIndexFile = async (\n\targs: UpsertSliceLibraryIndexFileArgs,\n): Promise<void> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers: args.helpers,\n\t\toptions: args.options,\n\t});\n\n\tconst filePath = args.helpers.joinPathFromRoot(\n\t\targs.libraryID,\n\t\tisTypeScriptProject ? \"index.ts\" : \"index.js\",\n\t);\n\n\tconst slices = await args.actions.readAllSliceModelsForLibrary({\n\t\tlibraryID: args.libraryID,\n\t});\n\n\tlet contents: string;\n\n\tif (args.options.lazyLoadSlices) {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\timport dynamic from 'next/dynamic'\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: dynamic(() => import('./${dirName}'))`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\",\\n\")}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\t${slices\n\t\t\t\t.map((slice) => {\n\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\treturn `import ${componentName} from \"./${dirName}\";`;\n\t\t\t\t})\n\t\t\t\t.join(\"\\n\")}\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: ${componentName},`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\n\t\t\t}\n\t\t`;\n\t}\n\n\tif (args.options.format) {\n\t\tcontents = await args.helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":[],"mappings":";;;;;AAca,MAAA,8BAA8B,OAC1C,SACkB;AACZ,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,EAAA,CACd;AAEK,QAAA,WAAW,KAAK,QAAQ,iBAC7B,KAAK,WACL,sBAAsB,aAAa,UAAU;AAG9C,QAAM,SAAS,MAAM,KAAK,QAAQ,6BAA6B;AAAA,IAC9D,WAAW,KAAK;AAAA,EAAA,CAChB;AAEG,MAAA;AAEA,MAAA,KAAK,QAAQ,gBAAgB;AACrB,eAAA;AAAA,KACR;AAAA;AAAA;AAAA;AAAA;AAAA,MAKC,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,UAAU,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,GAAG,+BAA+B;AAAA,IAAA,CACzC,EACA,KAAK,KAAK;AAAA;AAAA;AAAA,EAAA,OAGR;AACK,eAAA;AAAA,KACR;AAAA;AAAA,KAEA,OACA,IAAI,CAAC,UAAS;AACd,YAAM,gBAAgB,WAAW,MAAM,MAAM,IAAI;AACjD,YAAM,UAAU,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,UAAU,yBAAyB;AAAA,IAAA,CAC1C,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,MAGR,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,gBAAgB,WAAW,MAAM,MAAM,IAAI;AAEjD,aAAO,GAAG,OAAO;AAAA,IAAA,CACjB,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,EAGb;AAEG,MAAA,KAAK,QAAQ,QAAQ;AACxB,eAAW,MAAM,KAAK,QAAQ,OAAO,UAAU,QAAQ;AAAA,EACvD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;"}
1
+ {"version":3,"file":"upsertSliceLibraryIndexFile.js","sources":["../../../src/lib/upsertSliceLibraryIndexFile.ts"],"sourcesContent":["import { SliceMachineContext } from \"@slicemachine/plugin-kit\";\nimport { stripIndent } from \"common-tags\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport { NON_EDITABLE_FILE_BANNER } from \"../constants\";\n\nimport { PluginOptions } from \"../types\";\n\nimport { checkIsTypeScriptProject } from \"./checkIsTypeScriptProject\";\nimport { pascalCase } from \"./pascalCase\";\nimport { buildSliceLibraryDirectoryPath } from \"./buildSliceLibraryDirectoryPath\";\n\ntype UpsertSliceLibraryIndexFileArgs = {\n\tlibraryID: string;\n} & SliceMachineContext<PluginOptions>;\n\nexport const upsertSliceLibraryIndexFile = async (\n\targs: UpsertSliceLibraryIndexFileArgs,\n): Promise<void> => {\n\tconst isTypeScriptProject = await checkIsTypeScriptProject({\n\t\thelpers: args.helpers,\n\t\toptions: args.options,\n\t});\n\n\tconst filePath = path.join(\n\t\tbuildSliceLibraryDirectoryPath({\n\t\t\tlibraryID: args.libraryID,\n\t\t\thelpers: args.helpers,\n\t\t}),\n\t\tisTypeScriptProject ? \"index.ts\" : \"index.js\",\n\t);\n\n\tconst slices = await args.actions.readAllSliceModelsForLibrary({\n\t\tlibraryID: args.libraryID,\n\t});\n\n\tlet contents: string;\n\n\tif (args.options.lazyLoadSlices) {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\timport dynamic from 'next/dynamic'\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: dynamic(() => import('./${dirName}'))`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\",\\n\")}\n\t\t\t}\n\t\t`;\n\t} else {\n\t\tcontents = stripIndent`\n\t\t\t${NON_EDITABLE_FILE_BANNER}\n\n\t\t\t${slices\n\t\t\t\t.map((slice) => {\n\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\t\t\t\t\tconst dirName = pascalCase(slice.model.name);\n\n\t\t\t\t\treturn `import ${componentName} from \"./${dirName}\";`;\n\t\t\t\t})\n\t\t\t\t.join(\"\\n\")}\n\n\t\t\texport const components = {\n\t\t\t\t${slices\n\t\t\t\t\t.map((slice) => {\n\t\t\t\t\t\tconst id = slice.model.id;\n\t\t\t\t\t\tconst componentName = pascalCase(slice.model.name);\n\n\t\t\t\t\t\treturn `${id}: ${componentName},`;\n\t\t\t\t\t})\n\t\t\t\t\t.join(\"\\n\")}\n\t\t\t}\n\t\t`;\n\t}\n\n\tif (args.options.format) {\n\t\tcontents = await args.helpers.format(contents, filePath);\n\t}\n\n\tawait fs.writeFile(filePath, contents);\n};\n"],"names":[],"mappings":";;;;;;;AAgBa,MAAA,8BAA8B,OAC1C,SACkB;AACZ,QAAA,sBAAsB,MAAM,yBAAyB;AAAA,IAC1D,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,EAAA,CACd;AAEK,QAAA,WAAW,KAAK,KACrB,+BAA+B;AAAA,IAC9B,WAAW,KAAK;AAAA,IAChB,SAAS,KAAK;AAAA,EACd,CAAA,GACD,sBAAsB,aAAa,UAAU;AAG9C,QAAM,SAAS,MAAM,KAAK,QAAQ,6BAA6B;AAAA,IAC9D,WAAW,KAAK;AAAA,EAAA,CAChB;AAEG,MAAA;AAEA,MAAA,KAAK,QAAQ,gBAAgB;AACrB,eAAA;AAAA,KACR;AAAA;AAAA;AAAA;AAAA;AAAA,MAKC,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,UAAU,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,GAAG,+BAA+B;AAAA,IAAA,CACzC,EACA,KAAK,KAAK;AAAA;AAAA;AAAA,EAAA,OAGR;AACK,eAAA;AAAA,KACR;AAAA;AAAA,KAEA,OACA,IAAI,CAAC,UAAS;AACd,YAAM,gBAAgB,WAAW,MAAM,MAAM,IAAI;AACjD,YAAM,UAAU,WAAW,MAAM,MAAM,IAAI;AAE3C,aAAO,UAAU,yBAAyB;AAAA,IAAA,CAC1C,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,MAGR,OACA,IAAI,CAAC,UAAS;AACR,YAAA,KAAK,MAAM,MAAM;AACvB,YAAM,gBAAgB,WAAW,MAAM,MAAM,IAAI;AAEjD,aAAO,GAAG,OAAO;AAAA,IAAA,CACjB,EACA,KAAK,IAAI;AAAA;AAAA;AAAA,EAGb;AAEG,MAAA,KAAK,QAAQ,QAAQ;AACxB,eAAW,MAAM,KAAK,QAAQ,OAAO,UAAU,QAAQ;AAAA,EACvD;AAEK,QAAA,GAAG,UAAU,UAAU,QAAQ;AACtC;"}
package/dist/plugin.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const pluginKit = require("@slicemachine/plugin-kit");
4
- const _package = require("./package.json.cjs");
5
- const commandInit = require("./hooks/command-init.cjs");
4
+ const _package = require("./packages/adapter-next/package.json.cjs");
5
+ const projectInit = require("./hooks/project-init.cjs");
6
6
  const customTypeAssetDelete = require("./hooks/customType-asset-delete.cjs");
7
7
  const customTypeAssetRead = require("./hooks/customType-asset-read.cjs");
8
8
  const customTypeAssetUpdate = require("./hooks/customType-asset-update.cjs");
@@ -32,7 +32,7 @@ const plugin = pluginKit.defineSliceMachinePlugin({
32
32
  lazyLoadSlices: true
33
33
  },
34
34
  setup({ hook }) {
35
- hook("command:init", commandInit.commandInit);
35
+ hook("project:init", projectInit.projectInit);
36
36
  hook("slice:create", sliceCreate.sliceCreate);
37
37
  hook("slice:update", sliceUpdate.sliceUpdate);
38
38
  hook("slice:rename", sliceRename.sliceRename);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs","sources":["../../src/plugin.ts"],"sourcesContent":["import { defineSliceMachinePlugin } from \"@slicemachine/plugin-kit\";\n\nimport { name as pkgName } from \"../package.json\";\nimport { PluginOptions } from \"./types\";\n\nimport { commandInit } from \"./hooks/command-init\";\nimport { customTypeAssetDelete } from \"./hooks/customType-asset-delete\";\nimport { customTypeAssetRead } from \"./hooks/customType-asset-read\";\nimport { customTypeAssetUpdate } from \"./hooks/customType-asset-update\";\nimport { customTypeCreate } from \"./hooks/customType-create\";\nimport { customTypeDelete } from \"./hooks/customType-delete\";\nimport { customTypeLibraryRead } from \"./hooks/customTypeLibrary-read\";\nimport { customTypeRead } from \"./hooks/customType-read\";\nimport { customTypeRename } from \"./hooks/customType-rename\";\nimport { customTypeUpdate } from \"./hooks/customType-update\";\nimport { sliceAssetDelete } from \"./hooks/slice-asset-delete\";\nimport { sliceAssetRead } from \"./hooks/slice-asset-read\";\nimport { sliceAssetUpdate } from \"./hooks/slice-asset-update\";\nimport { sliceCreate } from \"./hooks/slice-create\";\nimport { sliceDelete } from \"./hooks/slice-delete\";\nimport { sliceLibraryRead } from \"./hooks/sliceLibrary-read\";\nimport { sliceRead } from \"./hooks/slice-read\";\nimport { sliceRename } from \"./hooks/slice-rename\";\nimport { sliceSimulatorSetupRead } from \"./hooks/sliceSimulator-setup-read\";\nimport { sliceUpdate } from \"./hooks/slice-update\";\nimport { snippetRead } from \"./hooks/snippet-read\";\n\nexport const plugin = defineSliceMachinePlugin<PluginOptions>({\n\tmeta: {\n\t\tname: pkgName,\n\t},\n\tdefaultOptions: {\n\t\tformat: true,\n\t\tlazyLoadSlices: true,\n\t},\n\tsetup({ hook }) {\n\t\thook(\"command:init\", commandInit);\n\n\t\thook(\"slice:create\", sliceCreate);\n\t\thook(\"slice:update\", sliceUpdate);\n\t\thook(\"slice:rename\", sliceRename);\n\t\thook(\"slice:delete\", sliceDelete);\n\t\thook(\"slice:read\", sliceRead);\n\t\thook(\"slice:asset:update\", sliceAssetUpdate);\n\t\thook(\"slice:asset:delete\", sliceAssetDelete);\n\t\thook(\"slice:asset:read\", sliceAssetRead);\n\t\thook(\"slice-library:read\", sliceLibraryRead);\n\n\t\thook(\"custom-type:create\", customTypeCreate);\n\t\thook(\"custom-type:update\", customTypeUpdate);\n\t\thook(\"custom-type:rename\", customTypeRename);\n\t\thook(\"custom-type:delete\", customTypeDelete);\n\t\thook(\"custom-type:read\", customTypeRead);\n\t\thook(\"custom-type:asset:update\", customTypeAssetUpdate);\n\t\thook(\"custom-type:asset:delete\", customTypeAssetDelete);\n\t\thook(\"custom-type:asset:read\", customTypeAssetRead);\n\t\thook(\"custom-type-library:read\", customTypeLibraryRead);\n\n\t\thook(\"snippet:read\", snippetRead);\n\n\t\thook(\"slice-simulator:setup:read\", sliceSimulatorSetupRead);\n\t},\n});\n"],"names":["defineSliceMachinePlugin","pkgName","commandInit","sliceCreate","sliceUpdate","sliceRename","sliceDelete","sliceRead","sliceAssetUpdate","sliceAssetDelete","sliceAssetRead","sliceLibraryRead","customTypeCreate","customTypeUpdate","customTypeRename","customTypeDelete","customTypeRead","customTypeAssetUpdate","customTypeAssetDelete","customTypeAssetRead","customTypeLibraryRead","snippetRead","sliceSimulatorSetupRead"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,SAASA,UAAAA,yBAAwC;AAAA,EAC7D,MAAM;AAAA,IACL,MAAMC,SAAA;AAAA,EACN;AAAA,EACD,gBAAgB;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAChB;AAAA,EACD,MAAM,EAAE,QAAM;AACb,SAAK,gBAAgBC,YAAAA,WAAW;AAEhC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,cAAcC,UAAAA,SAAS;AAC5B,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,oBAAoBC,eAAAA,cAAc;AACvC,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAE3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,oBAAoBC,eAAAA,cAAc;AACvC,SAAK,4BAA4BC,sBAAAA,qBAAqB;AACtD,SAAK,4BAA4BC,sBAAAA,qBAAqB;AACtD,SAAK,0BAA0BC,oBAAAA,mBAAmB;AAClD,SAAK,4BAA4BC,sBAAAA,qBAAqB;AAEtD,SAAK,gBAAgBC,YAAAA,WAAW;AAEhC,SAAK,8BAA8BC,wBAAAA,uBAAuB;AAAA,EAC3D;AACA,CAAA;;"}
1
+ {"version":3,"file":"plugin.cjs","sources":["../../src/plugin.ts"],"sourcesContent":["import { defineSliceMachinePlugin } from \"@slicemachine/plugin-kit\";\n\nimport { name as pkgName } from \"../package.json\";\nimport { PluginOptions } from \"./types\";\n\nimport { projectInit } from \"./hooks/project-init\";\nimport { customTypeAssetDelete } from \"./hooks/customType-asset-delete\";\nimport { customTypeAssetRead } from \"./hooks/customType-asset-read\";\nimport { customTypeAssetUpdate } from \"./hooks/customType-asset-update\";\nimport { customTypeCreate } from \"./hooks/customType-create\";\nimport { customTypeDelete } from \"./hooks/customType-delete\";\nimport { customTypeLibraryRead } from \"./hooks/customTypeLibrary-read\";\nimport { customTypeRead } from \"./hooks/customType-read\";\nimport { customTypeRename } from \"./hooks/customType-rename\";\nimport { customTypeUpdate } from \"./hooks/customType-update\";\nimport { sliceAssetDelete } from \"./hooks/slice-asset-delete\";\nimport { sliceAssetRead } from \"./hooks/slice-asset-read\";\nimport { sliceAssetUpdate } from \"./hooks/slice-asset-update\";\nimport { sliceCreate } from \"./hooks/slice-create\";\nimport { sliceDelete } from \"./hooks/slice-delete\";\nimport { sliceLibraryRead } from \"./hooks/sliceLibrary-read\";\nimport { sliceRead } from \"./hooks/slice-read\";\nimport { sliceRename } from \"./hooks/slice-rename\";\nimport { sliceSimulatorSetupRead } from \"./hooks/sliceSimulator-setup-read\";\nimport { sliceUpdate } from \"./hooks/slice-update\";\nimport { snippetRead } from \"./hooks/snippet-read\";\n\nexport const plugin = defineSliceMachinePlugin<PluginOptions>({\n\tmeta: {\n\t\tname: pkgName,\n\t},\n\tdefaultOptions: {\n\t\tformat: true,\n\t\tlazyLoadSlices: true,\n\t},\n\tsetup({ hook }) {\n\t\thook(\"project:init\", projectInit);\n\n\t\thook(\"slice:create\", sliceCreate);\n\t\thook(\"slice:update\", sliceUpdate);\n\t\thook(\"slice:rename\", sliceRename);\n\t\thook(\"slice:delete\", sliceDelete);\n\t\thook(\"slice:read\", sliceRead);\n\t\thook(\"slice:asset:update\", sliceAssetUpdate);\n\t\thook(\"slice:asset:delete\", sliceAssetDelete);\n\t\thook(\"slice:asset:read\", sliceAssetRead);\n\t\thook(\"slice-library:read\", sliceLibraryRead);\n\n\t\thook(\"custom-type:create\", customTypeCreate);\n\t\thook(\"custom-type:update\", customTypeUpdate);\n\t\thook(\"custom-type:rename\", customTypeRename);\n\t\thook(\"custom-type:delete\", customTypeDelete);\n\t\thook(\"custom-type:read\", customTypeRead);\n\t\thook(\"custom-type:asset:update\", customTypeAssetUpdate);\n\t\thook(\"custom-type:asset:delete\", customTypeAssetDelete);\n\t\thook(\"custom-type:asset:read\", customTypeAssetRead);\n\t\thook(\"custom-type-library:read\", customTypeLibraryRead);\n\n\t\thook(\"snippet:read\", snippetRead);\n\n\t\thook(\"slice-simulator:setup:read\", sliceSimulatorSetupRead);\n\t},\n});\n"],"names":["defineSliceMachinePlugin","pkgName","projectInit","sliceCreate","sliceUpdate","sliceRename","sliceDelete","sliceRead","sliceAssetUpdate","sliceAssetDelete","sliceAssetRead","sliceLibraryRead","customTypeCreate","customTypeUpdate","customTypeRename","customTypeDelete","customTypeRead","customTypeAssetUpdate","customTypeAssetDelete","customTypeAssetRead","customTypeLibraryRead","snippetRead","sliceSimulatorSetupRead"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,SAASA,UAAAA,yBAAwC;AAAA,EAC7D,MAAM;AAAA,IACL,MAAMC,SAAA;AAAA,EACN;AAAA,EACD,gBAAgB;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAChB;AAAA,EACD,MAAM,EAAE,QAAM;AACb,SAAK,gBAAgBC,YAAAA,WAAW;AAEhC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,gBAAgBC,YAAAA,WAAW;AAChC,SAAK,cAAcC,UAAAA,SAAS;AAC5B,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,oBAAoBC,eAAAA,cAAc;AACvC,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAE3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,sBAAsBC,iBAAAA,gBAAgB;AAC3C,SAAK,oBAAoBC,eAAAA,cAAc;AACvC,SAAK,4BAA4BC,sBAAAA,qBAAqB;AACtD,SAAK,4BAA4BC,sBAAAA,qBAAqB;AACtD,SAAK,0BAA0BC,oBAAAA,mBAAmB;AAClD,SAAK,4BAA4BC,sBAAAA,qBAAqB;AAEtD,SAAK,gBAAgBC,YAAAA,WAAW;AAEhC,SAAK,8BAA8BC,wBAAAA,uBAAuB;AAAA,EAC3D;AACA,CAAA;;"}
package/dist/plugin.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineSliceMachinePlugin } from "@slicemachine/plugin-kit";
2
- import { name } from "./package.json.js";
3
- import { commandInit } from "./hooks/command-init.js";
2
+ import { name } from "./packages/adapter-next/package.json.js";
3
+ import { projectInit } from "./hooks/project-init.js";
4
4
  import { customTypeAssetDelete } from "./hooks/customType-asset-delete.js";
5
5
  import { customTypeAssetRead } from "./hooks/customType-asset-read.js";
6
6
  import { customTypeAssetUpdate } from "./hooks/customType-asset-update.js";
@@ -30,7 +30,7 @@ const plugin = defineSliceMachinePlugin({
30
30
  lazyLoadSlices: true
31
31
  },
32
32
  setup({ hook }) {
33
- hook("command:init", commandInit);
33
+ hook("project:init", projectInit);
34
34
  hook("slice:create", sliceCreate);
35
35
  hook("slice:update", sliceUpdate);
36
36
  hook("slice:rename", sliceRename);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["../../src/plugin.ts"],"sourcesContent":["import { defineSliceMachinePlugin } from \"@slicemachine/plugin-kit\";\n\nimport { name as pkgName } from \"../package.json\";\nimport { PluginOptions } from \"./types\";\n\nimport { commandInit } from \"./hooks/command-init\";\nimport { customTypeAssetDelete } from \"./hooks/customType-asset-delete\";\nimport { customTypeAssetRead } from \"./hooks/customType-asset-read\";\nimport { customTypeAssetUpdate } from \"./hooks/customType-asset-update\";\nimport { customTypeCreate } from \"./hooks/customType-create\";\nimport { customTypeDelete } from \"./hooks/customType-delete\";\nimport { customTypeLibraryRead } from \"./hooks/customTypeLibrary-read\";\nimport { customTypeRead } from \"./hooks/customType-read\";\nimport { customTypeRename } from \"./hooks/customType-rename\";\nimport { customTypeUpdate } from \"./hooks/customType-update\";\nimport { sliceAssetDelete } from \"./hooks/slice-asset-delete\";\nimport { sliceAssetRead } from \"./hooks/slice-asset-read\";\nimport { sliceAssetUpdate } from \"./hooks/slice-asset-update\";\nimport { sliceCreate } from \"./hooks/slice-create\";\nimport { sliceDelete } from \"./hooks/slice-delete\";\nimport { sliceLibraryRead } from \"./hooks/sliceLibrary-read\";\nimport { sliceRead } from \"./hooks/slice-read\";\nimport { sliceRename } from \"./hooks/slice-rename\";\nimport { sliceSimulatorSetupRead } from \"./hooks/sliceSimulator-setup-read\";\nimport { sliceUpdate } from \"./hooks/slice-update\";\nimport { snippetRead } from \"./hooks/snippet-read\";\n\nexport const plugin = defineSliceMachinePlugin<PluginOptions>({\n\tmeta: {\n\t\tname: pkgName,\n\t},\n\tdefaultOptions: {\n\t\tformat: true,\n\t\tlazyLoadSlices: true,\n\t},\n\tsetup({ hook }) {\n\t\thook(\"command:init\", commandInit);\n\n\t\thook(\"slice:create\", sliceCreate);\n\t\thook(\"slice:update\", sliceUpdate);\n\t\thook(\"slice:rename\", sliceRename);\n\t\thook(\"slice:delete\", sliceDelete);\n\t\thook(\"slice:read\", sliceRead);\n\t\thook(\"slice:asset:update\", sliceAssetUpdate);\n\t\thook(\"slice:asset:delete\", sliceAssetDelete);\n\t\thook(\"slice:asset:read\", sliceAssetRead);\n\t\thook(\"slice-library:read\", sliceLibraryRead);\n\n\t\thook(\"custom-type:create\", customTypeCreate);\n\t\thook(\"custom-type:update\", customTypeUpdate);\n\t\thook(\"custom-type:rename\", customTypeRename);\n\t\thook(\"custom-type:delete\", customTypeDelete);\n\t\thook(\"custom-type:read\", customTypeRead);\n\t\thook(\"custom-type:asset:update\", customTypeAssetUpdate);\n\t\thook(\"custom-type:asset:delete\", customTypeAssetDelete);\n\t\thook(\"custom-type:asset:read\", customTypeAssetRead);\n\t\thook(\"custom-type-library:read\", customTypeLibraryRead);\n\n\t\thook(\"snippet:read\", snippetRead);\n\n\t\thook(\"slice-simulator:setup:read\", sliceSimulatorSetupRead);\n\t},\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,SAAS,yBAAwC;AAAA,EAC7D,MAAM;AAAA,IACL;AAAA,EACA;AAAA,EACD,gBAAgB;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAChB;AAAA,EACD,MAAM,EAAE,QAAM;AACb,SAAK,gBAAgB,WAAW;AAEhC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,cAAc,SAAS;AAC5B,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,oBAAoB,cAAc;AACvC,SAAK,sBAAsB,gBAAgB;AAE3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,oBAAoB,cAAc;AACvC,SAAK,4BAA4B,qBAAqB;AACtD,SAAK,4BAA4B,qBAAqB;AACtD,SAAK,0BAA0B,mBAAmB;AAClD,SAAK,4BAA4B,qBAAqB;AAEtD,SAAK,gBAAgB,WAAW;AAEhC,SAAK,8BAA8B,uBAAuB;AAAA,EAC3D;AACA,CAAA;"}
1
+ {"version":3,"file":"plugin.js","sources":["../../src/plugin.ts"],"sourcesContent":["import { defineSliceMachinePlugin } from \"@slicemachine/plugin-kit\";\n\nimport { name as pkgName } from \"../package.json\";\nimport { PluginOptions } from \"./types\";\n\nimport { projectInit } from \"./hooks/project-init\";\nimport { customTypeAssetDelete } from \"./hooks/customType-asset-delete\";\nimport { customTypeAssetRead } from \"./hooks/customType-asset-read\";\nimport { customTypeAssetUpdate } from \"./hooks/customType-asset-update\";\nimport { customTypeCreate } from \"./hooks/customType-create\";\nimport { customTypeDelete } from \"./hooks/customType-delete\";\nimport { customTypeLibraryRead } from \"./hooks/customTypeLibrary-read\";\nimport { customTypeRead } from \"./hooks/customType-read\";\nimport { customTypeRename } from \"./hooks/customType-rename\";\nimport { customTypeUpdate } from \"./hooks/customType-update\";\nimport { sliceAssetDelete } from \"./hooks/slice-asset-delete\";\nimport { sliceAssetRead } from \"./hooks/slice-asset-read\";\nimport { sliceAssetUpdate } from \"./hooks/slice-asset-update\";\nimport { sliceCreate } from \"./hooks/slice-create\";\nimport { sliceDelete } from \"./hooks/slice-delete\";\nimport { sliceLibraryRead } from \"./hooks/sliceLibrary-read\";\nimport { sliceRead } from \"./hooks/slice-read\";\nimport { sliceRename } from \"./hooks/slice-rename\";\nimport { sliceSimulatorSetupRead } from \"./hooks/sliceSimulator-setup-read\";\nimport { sliceUpdate } from \"./hooks/slice-update\";\nimport { snippetRead } from \"./hooks/snippet-read\";\n\nexport const plugin = defineSliceMachinePlugin<PluginOptions>({\n\tmeta: {\n\t\tname: pkgName,\n\t},\n\tdefaultOptions: {\n\t\tformat: true,\n\t\tlazyLoadSlices: true,\n\t},\n\tsetup({ hook }) {\n\t\thook(\"project:init\", projectInit);\n\n\t\thook(\"slice:create\", sliceCreate);\n\t\thook(\"slice:update\", sliceUpdate);\n\t\thook(\"slice:rename\", sliceRename);\n\t\thook(\"slice:delete\", sliceDelete);\n\t\thook(\"slice:read\", sliceRead);\n\t\thook(\"slice:asset:update\", sliceAssetUpdate);\n\t\thook(\"slice:asset:delete\", sliceAssetDelete);\n\t\thook(\"slice:asset:read\", sliceAssetRead);\n\t\thook(\"slice-library:read\", sliceLibraryRead);\n\n\t\thook(\"custom-type:create\", customTypeCreate);\n\t\thook(\"custom-type:update\", customTypeUpdate);\n\t\thook(\"custom-type:rename\", customTypeRename);\n\t\thook(\"custom-type:delete\", customTypeDelete);\n\t\thook(\"custom-type:read\", customTypeRead);\n\t\thook(\"custom-type:asset:update\", customTypeAssetUpdate);\n\t\thook(\"custom-type:asset:delete\", customTypeAssetDelete);\n\t\thook(\"custom-type:asset:read\", customTypeAssetRead);\n\t\thook(\"custom-type-library:read\", customTypeLibraryRead);\n\n\t\thook(\"snippet:read\", snippetRead);\n\n\t\thook(\"slice-simulator:setup:read\", sliceSimulatorSetupRead);\n\t},\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA2BO,MAAM,SAAS,yBAAwC;AAAA,EAC7D,MAAM;AAAA,IACL;AAAA,EACA;AAAA,EACD,gBAAgB;AAAA,IACf,QAAQ;AAAA,IACR,gBAAgB;AAAA,EAChB;AAAA,EACD,MAAM,EAAE,QAAM;AACb,SAAK,gBAAgB,WAAW;AAEhC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,gBAAgB,WAAW;AAChC,SAAK,cAAc,SAAS;AAC5B,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,oBAAoB,cAAc;AACvC,SAAK,sBAAsB,gBAAgB;AAE3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,sBAAsB,gBAAgB;AAC3C,SAAK,oBAAoB,cAAc;AACvC,SAAK,4BAA4B,qBAAqB;AACtD,SAAK,4BAA4B,qBAAqB;AACtD,SAAK,0BAA0B,mBAAmB;AAClD,SAAK,4BAA4B,qBAAqB;AAEtD,SAAK,gBAAgB,WAAW;AAEhC,SAAK,8BAA8B,uBAAuB;AAAA,EAC3D;AACA,CAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slicemachine/adapter-next",
3
- "version": "0.0.11",
3
+ "version": "0.0.13-dev-plugins-validation.1",
4
4
  "description": "Slice Machine adapter for Next.js.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -52,17 +52,20 @@
52
52
  "release:alpha:dry": "standard-version --release-as major --prerelease alpha --dry-run",
53
53
  "release:dry": "standard-version --dry-run",
54
54
  "size": "size-limit",
55
- "test": "npm run lint && npm run unit && npm run build && npm run size",
55
+ "test": "npm run lint && npm run types && npm run unit && npm run build && npm run size",
56
+ "types": "tsc --noEmit",
56
57
  "unit": "vitest run --coverage",
57
- "unit:watch": "vitest watch"
58
+ "unit:watch": "vitest watch",
59
+ "depcheck": "depcheck --config=.depcheckrc",
60
+ "audit": "better-npm-audit audit -l high -p"
58
61
  },
59
62
  "dependencies": {
60
63
  "@prismicio/slice-simulator-core": "^0.2.7",
61
64
  "@prismicio/types": "^0.2.7",
62
- "@slicemachine/plugin-kit": "0.1.8-dev-plugins.12",
65
+ "@slicemachine/plugin-kit": "0.1.8-dev-plugins-validation.1",
63
66
  "common-tags": "^1.8.2",
64
67
  "fs-extra": "^11.1.0",
65
- "node-fetch": "^3.3.0",
68
+ "node-fetch": "^3.3.1",
66
69
  "pascal-case": "^3.1.2",
67
70
  "prismic-ts-codegen": "^0.1.5"
68
71
  },
@@ -74,15 +77,15 @@
74
77
  "@types/prettier": "^2.7.2",
75
78
  "@types/react": "^18.0.28",
76
79
  "@types/semver": "^7.3.13",
77
- "@typescript-eslint/eslint-plugin": "^5.54.0",
78
- "@typescript-eslint/parser": "^5.54.0",
80
+ "@typescript-eslint/eslint-plugin": "^5.55.0",
81
+ "@typescript-eslint/parser": "^5.55.0",
79
82
  "@vitejs/plugin-react": "^3.1.0",
80
- "@vitest/coverage-c8": "^0.29.1",
81
- "eslint": "^8.35.0",
82
- "eslint-config-prettier": "^8.6.0",
83
+ "@vitest/coverage-c8": "^0.27.3",
84
+ "better-npm-audit": "^3.7.3",
85
+ "eslint": "^8.36.0",
86
+ "eslint-config-prettier": "^8.7.0",
83
87
  "eslint-plugin-prettier": "^4.2.1",
84
88
  "eslint-plugin-tsdoc": "^0.2.17",
85
- "npm-run-all": "^4.1.5",
86
89
  "prettier": "^2.8.4",
87
90
  "prettier-plugin-jsdoc": "^0.4.2",
88
91
  "react": "^18.2.0",
@@ -91,8 +94,8 @@
91
94
  "ts-morph": "^17.0.1",
92
95
  "typescript": "^4.9.5",
93
96
  "vite": "^4.1.4",
94
- "vite-plugin-sdk": "^0.1.0",
95
- "vitest": "^0.29.1"
97
+ "vite-plugin-sdk": "^0.1.1",
98
+ "vitest": "^0.27.3"
96
99
  },
97
100
  "peerDependencies": {
98
101
  "next": "^11 || ^12 || ^13",
@@ -103,5 +106,6 @@
103
106
  },
104
107
  "publishConfig": {
105
108
  "access": "public"
106
- }
109
+ },
110
+ "gitHead": "be509347c1cfaed23c9b9f714051a38436d4d9de"
107
111
  }