@slicemachine/init 1.1.19 → 2.0.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 (1019) hide show
  1. package/README.md +88 -32
  2. package/bin/slicemachine-init.js +3 -0
  3. package/dist/SliceMachineInitProcess.cjs +749 -0
  4. package/dist/SliceMachineInitProcess.cjs.map +1 -0
  5. package/dist/SliceMachineInitProcess.d.ts +48 -0
  6. package/dist/SliceMachineInitProcess.js +731 -0
  7. package/dist/SliceMachineInitProcess.js.map +1 -0
  8. package/dist/_node_modules/@babel/code-frame/lib/index.cjs +144 -0
  9. package/dist/_node_modules/@babel/code-frame/lib/index.cjs.map +1 -0
  10. package/dist/_node_modules/@babel/code-frame/lib/index.js +143 -0
  11. package/dist/_node_modules/@babel/code-frame/lib/index.js.map +1 -0
  12. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs +82 -0
  13. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.cjs.map +1 -0
  14. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js +83 -0
  15. package/dist/_node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  16. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs +62 -0
  17. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.cjs.map +1 -0
  18. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js +61 -0
  19. package/dist/_node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  20. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs +35 -0
  21. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.cjs.map +1 -0
  22. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js +36 -0
  23. package/dist/_node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
  24. package/dist/_node_modules/@babel/highlight/lib/index.cjs +100 -0
  25. package/dist/_node_modules/@babel/highlight/lib/index.cjs.map +1 -0
  26. package/dist/_node_modules/@babel/highlight/lib/index.js +99 -0
  27. package/dist/_node_modules/@babel/highlight/lib/index.js.map +1 -0
  28. package/dist/_node_modules/@nodelib/fs.scandir/out/adapters/fs.cjs +24 -0
  29. package/dist/_node_modules/@nodelib/fs.scandir/out/adapters/fs.cjs.map +1 -0
  30. package/dist/_node_modules/@nodelib/fs.scandir/out/adapters/fs.js +23 -0
  31. package/dist/_node_modules/@nodelib/fs.scandir/out/adapters/fs.js.map +1 -0
  32. package/dist/_node_modules/@nodelib/fs.scandir/out/constants.cjs +17 -0
  33. package/dist/_node_modules/@nodelib/fs.scandir/out/constants.cjs.map +1 -0
  34. package/dist/_node_modules/@nodelib/fs.scandir/out/constants.js +18 -0
  35. package/dist/_node_modules/@nodelib/fs.scandir/out/constants.js.map +1 -0
  36. package/dist/_node_modules/@nodelib/fs.scandir/out/index.cjs +35 -0
  37. package/dist/_node_modules/@nodelib/fs.scandir/out/index.cjs.map +1 -0
  38. package/dist/_node_modules/@nodelib/fs.scandir/out/index.js +36 -0
  39. package/dist/_node_modules/@nodelib/fs.scandir/out/index.js.map +1 -0
  40. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.cjs +116 -0
  41. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.cjs.map +1 -0
  42. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.js +117 -0
  43. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/async.js.map +1 -0
  44. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/common.cjs +13 -0
  45. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/common.cjs.map +1 -0
  46. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/common.js +14 -0
  47. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/common.js.map +1 -0
  48. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.cjs +64 -0
  49. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.cjs.map +1 -0
  50. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.js +65 -0
  51. package/dist/_node_modules/@nodelib/fs.scandir/out/providers/sync.js.map +1 -0
  52. package/dist/_node_modules/@nodelib/fs.scandir/out/settings.cjs +31 -0
  53. package/dist/_node_modules/@nodelib/fs.scandir/out/settings.cjs.map +1 -0
  54. package/dist/_node_modules/@nodelib/fs.scandir/out/settings.js +30 -0
  55. package/dist/_node_modules/@nodelib/fs.scandir/out/settings.js.map +1 -0
  56. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/fs.cjs +22 -0
  57. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/fs.cjs.map +1 -0
  58. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/fs.js +23 -0
  59. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/fs.js.map +1 -0
  60. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.cjs +10 -0
  61. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.cjs.map +1 -0
  62. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.js +11 -0
  63. package/dist/_node_modules/@nodelib/fs.scandir/out/utils/index.js.map +1 -0
  64. package/dist/_node_modules/@nodelib/fs.stat/out/adapters/fs.cjs +22 -0
  65. package/dist/_node_modules/@nodelib/fs.stat/out/adapters/fs.cjs.map +1 -0
  66. package/dist/_node_modules/@nodelib/fs.stat/out/adapters/fs.js +21 -0
  67. package/dist/_node_modules/@nodelib/fs.stat/out/adapters/fs.js.map +1 -0
  68. package/dist/_node_modules/@nodelib/fs.stat/out/index.cjs +35 -0
  69. package/dist/_node_modules/@nodelib/fs.stat/out/index.cjs.map +1 -0
  70. package/dist/_node_modules/@nodelib/fs.stat/out/index.js +36 -0
  71. package/dist/_node_modules/@nodelib/fs.stat/out/index.js.map +1 -0
  72. package/dist/_node_modules/@nodelib/fs.stat/out/providers/async.cjs +39 -0
  73. package/dist/_node_modules/@nodelib/fs.stat/out/providers/async.cjs.map +1 -0
  74. package/dist/_node_modules/@nodelib/fs.stat/out/providers/async.js +40 -0
  75. package/dist/_node_modules/@nodelib/fs.stat/out/providers/async.js.map +1 -0
  76. package/dist/_node_modules/@nodelib/fs.stat/out/providers/sync.cjs +25 -0
  77. package/dist/_node_modules/@nodelib/fs.stat/out/providers/sync.cjs.map +1 -0
  78. package/dist/_node_modules/@nodelib/fs.stat/out/providers/sync.js +26 -0
  79. package/dist/_node_modules/@nodelib/fs.stat/out/providers/sync.js.map +1 -0
  80. package/dist/_node_modules/@nodelib/fs.stat/out/settings.cjs +20 -0
  81. package/dist/_node_modules/@nodelib/fs.stat/out/settings.cjs.map +1 -0
  82. package/dist/_node_modules/@nodelib/fs.stat/out/settings.js +19 -0
  83. package/dist/_node_modules/@nodelib/fs.stat/out/settings.js.map +1 -0
  84. package/dist/_node_modules/@nodelib/fs.walk/out/index.cjs +45 -0
  85. package/dist/_node_modules/@nodelib/fs.walk/out/index.cjs.map +1 -0
  86. package/dist/_node_modules/@nodelib/fs.walk/out/index.js +46 -0
  87. package/dist/_node_modules/@nodelib/fs.walk/out/index.js.map +1 -0
  88. package/dist/_node_modules/@nodelib/fs.walk/out/providers/async.cjs +34 -0
  89. package/dist/_node_modules/@nodelib/fs.walk/out/providers/async.cjs.map +1 -0
  90. package/dist/_node_modules/@nodelib/fs.walk/out/providers/async.js +33 -0
  91. package/dist/_node_modules/@nodelib/fs.walk/out/providers/async.js.map +1 -0
  92. package/dist/_node_modules/@nodelib/fs.walk/out/providers/stream.cjs +40 -0
  93. package/dist/_node_modules/@nodelib/fs.walk/out/providers/stream.cjs.map +1 -0
  94. package/dist/_node_modules/@nodelib/fs.walk/out/providers/stream.js +39 -0
  95. package/dist/_node_modules/@nodelib/fs.walk/out/providers/stream.js.map +1 -0
  96. package/dist/_node_modules/@nodelib/fs.walk/out/providers/sync.cjs +18 -0
  97. package/dist/_node_modules/@nodelib/fs.walk/out/providers/sync.cjs.map +1 -0
  98. package/dist/_node_modules/@nodelib/fs.walk/out/providers/sync.js +17 -0
  99. package/dist/_node_modules/@nodelib/fs.walk/out/providers/sync.js.map +1 -0
  100. package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.cjs +108 -0
  101. package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.cjs.map +1 -0
  102. package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.js +107 -0
  103. package/dist/_node_modules/@nodelib/fs.walk/out/readers/async.js.map +1 -0
  104. package/dist/_node_modules/@nodelib/fs.walk/out/readers/common.cjs +31 -0
  105. package/dist/_node_modules/@nodelib/fs.walk/out/readers/common.cjs.map +1 -0
  106. package/dist/_node_modules/@nodelib/fs.walk/out/readers/common.js +32 -0
  107. package/dist/_node_modules/@nodelib/fs.walk/out/readers/common.js.map +1 -0
  108. package/dist/_node_modules/@nodelib/fs.walk/out/readers/reader.cjs +15 -0
  109. package/dist/_node_modules/@nodelib/fs.walk/out/readers/reader.cjs.map +1 -0
  110. package/dist/_node_modules/@nodelib/fs.walk/out/readers/reader.js +14 -0
  111. package/dist/_node_modules/@nodelib/fs.walk/out/readers/reader.js.map +1 -0
  112. package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.cjs +66 -0
  113. package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.cjs.map +1 -0
  114. package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.js +65 -0
  115. package/dist/_node_modules/@nodelib/fs.walk/out/readers/sync.js.map +1 -0
  116. package/dist/_node_modules/@nodelib/fs.walk/out/settings.cjs +31 -0
  117. package/dist/_node_modules/@nodelib/fs.walk/out/settings.cjs.map +1 -0
  118. package/dist/_node_modules/@nodelib/fs.walk/out/settings.js +30 -0
  119. package/dist/_node_modules/@nodelib/fs.walk/out/settings.js.map +1 -0
  120. package/dist/_node_modules/arrify/index.cjs +9 -0
  121. package/dist/_node_modules/arrify/index.cjs.map +1 -0
  122. package/dist/_node_modules/arrify/index.js +10 -0
  123. package/dist/_node_modules/arrify/index.js.map +1 -0
  124. package/dist/_node_modules/braces/index.cjs +63 -0
  125. package/dist/_node_modules/braces/index.cjs.map +1 -0
  126. package/dist/_node_modules/braces/index.js +64 -0
  127. package/dist/_node_modules/braces/index.js.map +1 -0
  128. package/dist/_node_modules/braces/lib/compile.cjs +50 -0
  129. package/dist/_node_modules/braces/lib/compile.cjs.map +1 -0
  130. package/dist/_node_modules/braces/lib/compile.js +51 -0
  131. package/dist/_node_modules/braces/lib/compile.js.map +1 -0
  132. package/dist/_node_modules/braces/lib/constants.cjs +97 -0
  133. package/dist/_node_modules/braces/lib/constants.cjs.map +1 -0
  134. package/dist/_node_modules/braces/lib/constants.js +98 -0
  135. package/dist/_node_modules/braces/lib/constants.js.map +1 -0
  136. package/dist/_node_modules/braces/lib/expand.cjs +97 -0
  137. package/dist/_node_modules/braces/lib/expand.cjs.map +1 -0
  138. package/dist/_node_modules/braces/lib/expand.js +98 -0
  139. package/dist/_node_modules/braces/lib/expand.js.map +1 -0
  140. package/dist/_node_modules/braces/lib/parse.cjs +240 -0
  141. package/dist/_node_modules/braces/lib/parse.cjs.map +1 -0
  142. package/dist/_node_modules/braces/lib/parse.js +241 -0
  143. package/dist/_node_modules/braces/lib/parse.js.map +1 -0
  144. package/dist/_node_modules/braces/lib/stringify.cjs +29 -0
  145. package/dist/_node_modules/braces/lib/stringify.cjs.map +1 -0
  146. package/dist/_node_modules/braces/lib/stringify.js +30 -0
  147. package/dist/_node_modules/braces/lib/stringify.js.map +1 -0
  148. package/dist/_node_modules/braces/lib/utils.cjs +83 -0
  149. package/dist/_node_modules/braces/lib/utils.cjs.map +1 -0
  150. package/dist/_node_modules/braces/lib/utils.js +84 -0
  151. package/dist/_node_modules/braces/lib/utils.js.map +1 -0
  152. package/dist/_node_modules/camelcase-keys/_node_modules/camelcase/index.cjs +83 -0
  153. package/dist/_node_modules/camelcase-keys/_node_modules/camelcase/index.cjs.map +1 -0
  154. package/dist/_node_modules/camelcase-keys/_node_modules/camelcase/index.js +84 -0
  155. package/dist/_node_modules/camelcase-keys/_node_modules/camelcase/index.js.map +1 -0
  156. package/dist/_node_modules/camelcase-keys/index.cjs +56 -0
  157. package/dist/_node_modules/camelcase-keys/index.cjs.map +1 -0
  158. package/dist/_node_modules/camelcase-keys/index.js +57 -0
  159. package/dist/_node_modules/camelcase-keys/index.js.map +1 -0
  160. package/dist/_node_modules/decamelize/index.cjs +38 -0
  161. package/dist/_node_modules/decamelize/index.cjs.map +1 -0
  162. package/dist/_node_modules/decamelize/index.js +39 -0
  163. package/dist/_node_modules/decamelize/index.js.map +1 -0
  164. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.cjs +10 -0
  165. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.cjs.map +1 -0
  166. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.js +11 -0
  167. package/dist/_node_modules/decamelize-keys/_node_modules/decamelize/index.js.map +1 -0
  168. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.cjs +13 -0
  169. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.cjs.map +1 -0
  170. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.js +14 -0
  171. package/dist/_node_modules/decamelize-keys/_node_modules/map-obj/index.js.map +1 -0
  172. package/dist/_node_modules/decamelize-keys/index.cjs +20 -0
  173. package/dist/_node_modules/decamelize-keys/index.cjs.map +1 -0
  174. package/dist/_node_modules/decamelize-keys/index.js +21 -0
  175. package/dist/_node_modules/decamelize-keys/index.js.map +1 -0
  176. package/dist/_node_modules/dir-glob/index.cjs +63 -0
  177. package/dist/_node_modules/dir-glob/index.cjs.map +1 -0
  178. package/dist/_node_modules/dir-glob/index.js +64 -0
  179. package/dist/_node_modules/dir-glob/index.js.map +1 -0
  180. package/dist/_node_modules/error-ex/index.cjs +108 -0
  181. package/dist/_node_modules/error-ex/index.cjs.map +1 -0
  182. package/dist/_node_modules/error-ex/index.js +109 -0
  183. package/dist/_node_modules/error-ex/index.js.map +1 -0
  184. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.cjs +28 -0
  185. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.cjs.map +1 -0
  186. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.js +29 -0
  187. package/dist/_node_modules/fast-glob/_node_modules/glob-parent/index.js.map +1 -0
  188. package/dist/_node_modules/fast-glob/out/index.cjs +77 -0
  189. package/dist/_node_modules/fast-glob/out/index.cjs.map +1 -0
  190. package/dist/_node_modules/fast-glob/out/index.js +78 -0
  191. package/dist/_node_modules/fast-glob/out/index.js.map +1 -0
  192. package/dist/_node_modules/fast-glob/out/managers/patterns.cjs +15 -0
  193. package/dist/_node_modules/fast-glob/out/managers/patterns.cjs.map +1 -0
  194. package/dist/_node_modules/fast-glob/out/managers/patterns.js +16 -0
  195. package/dist/_node_modules/fast-glob/out/managers/patterns.js.map +1 -0
  196. package/dist/_node_modules/fast-glob/out/managers/tasks.cjs +83 -0
  197. package/dist/_node_modules/fast-glob/out/managers/tasks.cjs.map +1 -0
  198. package/dist/_node_modules/fast-glob/out/managers/tasks.js +84 -0
  199. package/dist/_node_modules/fast-glob/out/managers/tasks.js.map +1 -0
  200. package/dist/_node_modules/fast-glob/out/providers/async.cjs +29 -0
  201. package/dist/_node_modules/fast-glob/out/providers/async.cjs.map +1 -0
  202. package/dist/_node_modules/fast-glob/out/providers/async.js +28 -0
  203. package/dist/_node_modules/fast-glob/out/providers/async.js.map +1 -0
  204. package/dist/_node_modules/fast-glob/out/providers/filters/deep.cjs +65 -0
  205. package/dist/_node_modules/fast-glob/out/providers/filters/deep.cjs.map +1 -0
  206. package/dist/_node_modules/fast-glob/out/providers/filters/deep.js +64 -0
  207. package/dist/_node_modules/fast-glob/out/providers/filters/deep.js.map +1 -0
  208. package/dist/_node_modules/fast-glob/out/providers/filters/entry.cjs +65 -0
  209. package/dist/_node_modules/fast-glob/out/providers/filters/entry.cjs.map +1 -0
  210. package/dist/_node_modules/fast-glob/out/providers/filters/entry.js +64 -0
  211. package/dist/_node_modules/fast-glob/out/providers/filters/entry.js.map +1 -0
  212. package/dist/_node_modules/fast-glob/out/providers/filters/error.cjs +19 -0
  213. package/dist/_node_modules/fast-glob/out/providers/filters/error.cjs.map +1 -0
  214. package/dist/_node_modules/fast-glob/out/providers/filters/error.js +18 -0
  215. package/dist/_node_modules/fast-glob/out/providers/filters/error.js.map +1 -0
  216. package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.cjs +50 -0
  217. package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.cjs.map +1 -0
  218. package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.js +49 -0
  219. package/dist/_node_modules/fast-glob/out/providers/matchers/matcher.js.map +1 -0
  220. package/dist/_node_modules/fast-glob/out/providers/matchers/partial.cjs +35 -0
  221. package/dist/_node_modules/fast-glob/out/providers/matchers/partial.cjs.map +1 -0
  222. package/dist/_node_modules/fast-glob/out/providers/matchers/partial.js +34 -0
  223. package/dist/_node_modules/fast-glob/out/providers/matchers/partial.js.map +1 -0
  224. package/dist/_node_modules/fast-glob/out/providers/provider.cjs +59 -0
  225. package/dist/_node_modules/fast-glob/out/providers/provider.cjs.map +1 -0
  226. package/dist/_node_modules/fast-glob/out/providers/provider.js +58 -0
  227. package/dist/_node_modules/fast-glob/out/providers/provider.js.map +1 -0
  228. package/dist/_node_modules/fast-glob/out/providers/stream.cjs +35 -0
  229. package/dist/_node_modules/fast-glob/out/providers/stream.cjs.map +1 -0
  230. package/dist/_node_modules/fast-glob/out/providers/stream.js +34 -0
  231. package/dist/_node_modules/fast-glob/out/providers/stream.js.map +1 -0
  232. package/dist/_node_modules/fast-glob/out/providers/sync.cjs +29 -0
  233. package/dist/_node_modules/fast-glob/out/providers/sync.cjs.map +1 -0
  234. package/dist/_node_modules/fast-glob/out/providers/sync.js +28 -0
  235. package/dist/_node_modules/fast-glob/out/providers/sync.js.map +1 -0
  236. package/dist/_node_modules/fast-glob/out/providers/transformers/entry.cjs +30 -0
  237. package/dist/_node_modules/fast-glob/out/providers/transformers/entry.cjs.map +1 -0
  238. package/dist/_node_modules/fast-glob/out/providers/transformers/entry.js +29 -0
  239. package/dist/_node_modules/fast-glob/out/providers/transformers/entry.js.map +1 -0
  240. package/dist/_node_modules/fast-glob/out/readers/async.cjs +41 -0
  241. package/dist/_node_modules/fast-glob/out/readers/async.cjs.map +1 -0
  242. package/dist/_node_modules/fast-glob/out/readers/async.js +40 -0
  243. package/dist/_node_modules/fast-glob/out/readers/async.js.map +1 -0
  244. package/dist/_node_modules/fast-glob/out/readers/reader.cjs +40 -0
  245. package/dist/_node_modules/fast-glob/out/readers/reader.cjs.map +1 -0
  246. package/dist/_node_modules/fast-glob/out/readers/reader.js +39 -0
  247. package/dist/_node_modules/fast-glob/out/readers/reader.js.map +1 -0
  248. package/dist/_node_modules/fast-glob/out/readers/stream.cjs +60 -0
  249. package/dist/_node_modules/fast-glob/out/readers/stream.cjs.map +1 -0
  250. package/dist/_node_modules/fast-glob/out/readers/stream.js +59 -0
  251. package/dist/_node_modules/fast-glob/out/readers/stream.js.map +1 -0
  252. package/dist/_node_modules/fast-glob/out/readers/sync.cjs +50 -0
  253. package/dist/_node_modules/fast-glob/out/readers/sync.cjs.map +1 -0
  254. package/dist/_node_modules/fast-glob/out/readers/sync.js +49 -0
  255. package/dist/_node_modules/fast-glob/out/readers/sync.js.map +1 -0
  256. package/dist/_node_modules/fast-glob/out/settings.cjs +59 -0
  257. package/dist/_node_modules/fast-glob/out/settings.cjs.map +1 -0
  258. package/dist/_node_modules/fast-glob/out/settings.js +58 -0
  259. package/dist/_node_modules/fast-glob/out/settings.js.map +1 -0
  260. package/dist/_node_modules/fast-glob/out/utils/array.cjs +24 -0
  261. package/dist/_node_modules/fast-glob/out/utils/array.cjs.map +1 -0
  262. package/dist/_node_modules/fast-glob/out/utils/array.js +25 -0
  263. package/dist/_node_modules/fast-glob/out/utils/array.js.map +1 -0
  264. package/dist/_node_modules/fast-glob/out/utils/errno.cjs +10 -0
  265. package/dist/_node_modules/fast-glob/out/utils/errno.cjs.map +1 -0
  266. package/dist/_node_modules/fast-glob/out/utils/errno.js +11 -0
  267. package/dist/_node_modules/fast-glob/out/utils/errno.js.map +1 -0
  268. package/dist/_node_modules/fast-glob/out/utils/fs.cjs +22 -0
  269. package/dist/_node_modules/fast-glob/out/utils/fs.cjs.map +1 -0
  270. package/dist/_node_modules/fast-glob/out/utils/fs.js +23 -0
  271. package/dist/_node_modules/fast-glob/out/utils/fs.js.map +1 -0
  272. package/dist/_node_modules/fast-glob/out/utils/index.cjs +34 -0
  273. package/dist/_node_modules/fast-glob/out/utils/index.cjs.map +1 -0
  274. package/dist/_node_modules/fast-glob/out/utils/index.js +35 -0
  275. package/dist/_node_modules/fast-glob/out/utils/index.js.map +1 -0
  276. package/dist/_node_modules/fast-glob/out/utils/path.cjs +32 -0
  277. package/dist/_node_modules/fast-glob/out/utils/path.cjs.map +1 -0
  278. package/dist/_node_modules/fast-glob/out/utils/path.js +33 -0
  279. package/dist/_node_modules/fast-glob/out/utils/path.js.map +1 -0
  280. package/dist/_node_modules/fast-glob/out/utils/pattern.cjs +144 -0
  281. package/dist/_node_modules/fast-glob/out/utils/pattern.cjs.map +1 -0
  282. package/dist/_node_modules/fast-glob/out/utils/pattern.js +145 -0
  283. package/dist/_node_modules/fast-glob/out/utils/pattern.js.map +1 -0
  284. package/dist/_node_modules/fast-glob/out/utils/stream.cjs +21 -0
  285. package/dist/_node_modules/fast-glob/out/utils/stream.cjs.map +1 -0
  286. package/dist/_node_modules/fast-glob/out/utils/stream.js +22 -0
  287. package/dist/_node_modules/fast-glob/out/utils/stream.js.map +1 -0
  288. package/dist/_node_modules/fast-glob/out/utils/string.cjs +14 -0
  289. package/dist/_node_modules/fast-glob/out/utils/string.cjs.map +1 -0
  290. package/dist/_node_modules/fast-glob/out/utils/string.js +15 -0
  291. package/dist/_node_modules/fast-glob/out/utils/string.js.map +1 -0
  292. package/dist/_node_modules/fastq/queue.cjs +239 -0
  293. package/dist/_node_modules/fastq/queue.cjs.map +1 -0
  294. package/dist/_node_modules/fastq/queue.js +240 -0
  295. package/dist/_node_modules/fastq/queue.js.map +1 -0
  296. package/dist/_node_modules/fill-range/index.cjs +210 -0
  297. package/dist/_node_modules/fill-range/index.cjs.map +1 -0
  298. package/dist/_node_modules/fill-range/index.js +211 -0
  299. package/dist/_node_modules/fill-range/index.js.map +1 -0
  300. package/dist/_node_modules/function-bind/implementation.cjs +46 -0
  301. package/dist/_node_modules/function-bind/implementation.cjs.map +1 -0
  302. package/dist/_node_modules/function-bind/implementation.js +47 -0
  303. package/dist/_node_modules/function-bind/implementation.js.map +1 -0
  304. package/dist/_node_modules/function-bind/index.cjs +6 -0
  305. package/dist/_node_modules/function-bind/index.cjs.map +1 -0
  306. package/dist/_node_modules/function-bind/index.js +7 -0
  307. package/dist/_node_modules/function-bind/index.js.map +1 -0
  308. package/dist/_node_modules/hard-rejection/index.cjs +22 -0
  309. package/dist/_node_modules/hard-rejection/index.cjs.map +1 -0
  310. package/dist/_node_modules/hard-rejection/index.js +23 -0
  311. package/dist/_node_modules/hard-rejection/index.js.map +1 -0
  312. package/dist/_node_modules/has/src/index.cjs +6 -0
  313. package/dist/_node_modules/has/src/index.cjs.map +1 -0
  314. package/dist/_node_modules/has/src/index.js +7 -0
  315. package/dist/_node_modules/has/src/index.js.map +1 -0
  316. package/dist/_node_modules/ignore/index.cjs +370 -0
  317. package/dist/_node_modules/ignore/index.cjs.map +1 -0
  318. package/dist/_node_modules/ignore/index.js +371 -0
  319. package/dist/_node_modules/ignore/index.js.map +1 -0
  320. package/dist/_node_modules/is-arrayish/index.cjs +9 -0
  321. package/dist/_node_modules/is-arrayish/index.cjs.map +1 -0
  322. package/dist/_node_modules/is-arrayish/index.js +10 -0
  323. package/dist/_node_modules/is-arrayish/index.js.map +1 -0
  324. package/dist/_node_modules/is-core-module/core.json.cjs +487 -0
  325. package/dist/_node_modules/is-core-module/core.json.cjs.map +1 -0
  326. package/dist/_node_modules/is-core-module/core.json.js +487 -0
  327. package/dist/_node_modules/is-core-module/core.json.js.map +1 -0
  328. package/dist/_node_modules/is-core-module/index.cjs +61 -0
  329. package/dist/_node_modules/is-core-module/index.cjs.map +1 -0
  330. package/dist/_node_modules/is-core-module/index.js +62 -0
  331. package/dist/_node_modules/is-core-module/index.js.map +1 -0
  332. package/dist/_node_modules/is-extglob/index.cjs +21 -0
  333. package/dist/_node_modules/is-extglob/index.cjs.map +1 -0
  334. package/dist/_node_modules/is-extglob/index.js +22 -0
  335. package/dist/_node_modules/is-extglob/index.js.map +1 -0
  336. package/dist/_node_modules/is-glob/index.cjs +135 -0
  337. package/dist/_node_modules/is-glob/index.cjs.map +1 -0
  338. package/dist/_node_modules/is-glob/index.js +136 -0
  339. package/dist/_node_modules/is-glob/index.js.map +1 -0
  340. package/dist/_node_modules/is-number/index.cjs +18 -0
  341. package/dist/_node_modules/is-number/index.cjs.map +1 -0
  342. package/dist/_node_modules/is-number/index.js +19 -0
  343. package/dist/_node_modules/is-number/index.js.map +1 -0
  344. package/dist/_node_modules/js-tokens/index.cjs +27 -0
  345. package/dist/_node_modules/js-tokens/index.cjs.map +1 -0
  346. package/dist/_node_modules/js-tokens/index.js +26 -0
  347. package/dist/_node_modules/js-tokens/index.js.map +1 -0
  348. package/dist/_node_modules/json-parse-even-better-errors/index.cjs +89 -0
  349. package/dist/_node_modules/json-parse-even-better-errors/index.cjs.map +1 -0
  350. package/dist/_node_modules/json-parse-even-better-errors/index.js +90 -0
  351. package/dist/_node_modules/json-parse-even-better-errors/index.js.map +1 -0
  352. package/dist/_node_modules/kind-of/index.cjs +128 -0
  353. package/dist/_node_modules/kind-of/index.cjs.map +1 -0
  354. package/dist/_node_modules/kind-of/index.js +129 -0
  355. package/dist/_node_modules/kind-of/index.js.map +1 -0
  356. package/dist/_node_modules/lines-and-columns/build/index.cjs +67 -0
  357. package/dist/{__node_modules → _node_modules}/lines-and-columns/build/index.cjs.map +1 -1
  358. package/dist/_node_modules/lines-and-columns/build/index.js +66 -0
  359. package/dist/{__node_modules → _node_modules}/lines-and-columns/build/index.js.map +1 -1
  360. package/dist/_node_modules/map-obj/index.cjs +46 -0
  361. package/dist/_node_modules/map-obj/index.cjs.map +1 -0
  362. package/dist/_node_modules/map-obj/index.js +47 -0
  363. package/dist/_node_modules/map-obj/index.js.map +1 -0
  364. package/dist/_node_modules/meow/_node_modules/find-up/index.cjs +48 -0
  365. package/dist/_node_modules/meow/_node_modules/find-up/index.cjs.map +1 -0
  366. package/dist/_node_modules/meow/_node_modules/find-up/index.js +48 -0
  367. package/dist/_node_modules/meow/_node_modules/find-up/index.js.map +1 -0
  368. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.cjs +165 -0
  369. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.cjs.map +1 -0
  370. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.js +166 -0
  371. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host-info.js.map +1 -0
  372. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.cjs +90 -0
  373. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.cjs.map +1 -0
  374. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.js +91 -0
  375. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/git-host.js.map +1 -0
  376. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.cjs +124 -0
  377. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.cjs.map +1 -0
  378. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.js +123 -0
  379. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/index.js.map +1 -0
  380. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.cjs +50 -0
  381. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.cjs.map +1 -0
  382. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.js +51 -0
  383. package/dist/_node_modules/meow/_node_modules/hosted-git-info/lib/parse-url.js.map +1 -0
  384. package/dist/_node_modules/meow/_node_modules/indent-string/index.cjs +34 -0
  385. package/dist/_node_modules/meow/_node_modules/indent-string/index.cjs.map +1 -0
  386. package/dist/_node_modules/meow/_node_modules/indent-string/index.js +35 -0
  387. package/dist/_node_modules/meow/_node_modules/indent-string/index.js.map +1 -0
  388. package/dist/_node_modules/meow/_node_modules/locate-path/index.cjs +43 -0
  389. package/dist/_node_modules/meow/_node_modules/locate-path/index.cjs.map +1 -0
  390. package/dist/_node_modules/meow/_node_modules/locate-path/index.js +43 -0
  391. package/dist/_node_modules/meow/_node_modules/locate-path/index.js.map +1 -0
  392. package/dist/_node_modules/meow/_node_modules/lru-cache/index.cjs +1014 -0
  393. package/dist/_node_modules/meow/_node_modules/lru-cache/index.cjs.map +1 -0
  394. package/dist/_node_modules/meow/_node_modules/lru-cache/index.js +1015 -0
  395. package/dist/_node_modules/meow/_node_modules/lru-cache/index.js.map +1 -0
  396. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/extract_description.cjs +23 -0
  397. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
  398. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/extract_description.js +24 -0
  399. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
  400. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
  401. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
  402. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.js +439 -0
  403. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
  404. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/make_warning.cjs +25 -0
  405. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
  406. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
  407. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
  408. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/normalize.cjs +56 -0
  409. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
  410. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/normalize.js +57 -0
  411. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
  412. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
  413. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
  414. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
  415. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
  416. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
  417. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
  418. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
  419. package/dist/_node_modules/meow/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
  420. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs +158 -0
  421. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.cjs.map +1 -0
  422. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js +159 -0
  423. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host-info.js.map +1 -0
  424. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs +87 -0
  425. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.cjs.map +1 -0
  426. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js +88 -0
  427. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/git-host.js.map +1 -0
  428. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs +179 -0
  429. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.cjs.map +1 -0
  430. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js +178 -0
  431. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/hosted-git-info/index.js.map +1 -0
  432. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs +267 -0
  433. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/lru-cache/index.cjs.map +1 -0
  434. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/lru-cache/index.js +268 -0
  435. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/lru-cache/index.js.map +1 -0
  436. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs +19 -0
  437. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.cjs.map +1 -0
  438. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js +20 -0
  439. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/extract_description.js.map +1 -0
  440. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs +438 -0
  441. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.cjs.map +1 -0
  442. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js +439 -0
  443. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/fixer.js.map +1 -0
  444. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs +25 -0
  445. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.cjs.map +1 -0
  446. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js +26 -0
  447. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/make_warning.js.map +1 -0
  448. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs +56 -0
  449. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.cjs.map +1 -0
  450. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js +57 -0
  451. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/normalize.js.map +1 -0
  452. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs +41 -0
  453. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.cjs.map +1 -0
  454. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js +41 -0
  455. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/typos.json.js.map +1 -0
  456. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs +90 -0
  457. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.cjs.map +1 -0
  458. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js +90 -0
  459. package/dist/_node_modules/meow/_node_modules/read-pkg/_node_modules/normalize-package-data/lib/warning_messages.json.js.map +1 -0
  460. package/dist/_node_modules/meow/_node_modules/read-pkg/index.cjs +20 -0
  461. package/dist/_node_modules/meow/_node_modules/read-pkg/index.cjs.map +1 -0
  462. package/dist/_node_modules/meow/_node_modules/read-pkg/index.js +20 -0
  463. package/dist/_node_modules/meow/_node_modules/read-pkg/index.js.map +1 -0
  464. package/dist/_node_modules/meow/_node_modules/read-pkg-up/index.cjs +17 -0
  465. package/dist/_node_modules/meow/_node_modules/read-pkg-up/index.cjs.map +1 -0
  466. package/dist/_node_modules/meow/_node_modules/read-pkg-up/index.js +17 -0
  467. package/dist/_node_modules/meow/_node_modules/read-pkg-up/index.js.map +1 -0
  468. package/dist/_node_modules/meow/_node_modules/redent/index.cjs +8 -0
  469. package/dist/_node_modules/meow/_node_modules/redent/index.cjs.map +1 -0
  470. package/dist/_node_modules/meow/_node_modules/redent/index.js +9 -0
  471. package/dist/_node_modules/meow/_node_modules/redent/index.js.map +1 -0
  472. package/dist/_node_modules/meow/_node_modules/strip-indent/index.cjs +12 -0
  473. package/dist/_node_modules/meow/_node_modules/strip-indent/index.cjs.map +1 -0
  474. package/dist/_node_modules/meow/_node_modules/strip-indent/index.js +13 -0
  475. package/dist/_node_modules/meow/_node_modules/strip-indent/index.js.map +1 -0
  476. package/dist/_node_modules/meow/_node_modules/yallist/iterator.cjs +19 -0
  477. package/dist/_node_modules/meow/_node_modules/yallist/iterator.cjs.map +1 -0
  478. package/dist/_node_modules/meow/_node_modules/yallist/iterator.js +19 -0
  479. package/dist/_node_modules/meow/_node_modules/yallist/iterator.js.map +1 -0
  480. package/dist/_node_modules/meow/_node_modules/yallist/yallist.cjs +366 -0
  481. package/dist/_node_modules/meow/_node_modules/yallist/yallist.cjs.map +1 -0
  482. package/dist/_node_modules/meow/_node_modules/yallist/yallist.js +367 -0
  483. package/dist/_node_modules/meow/_node_modules/yallist/yallist.js.map +1 -0
  484. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/index.cjs.map +1 -1
  485. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/index.js.map +1 -1
  486. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/string-utils.cjs.map +1 -1
  487. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/string-utils.js.map +1 -1
  488. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/tokenize-arg-string.cjs.map +1 -1
  489. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/tokenize-arg-string.js.map +1 -1
  490. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser-types.cjs.map +1 -1
  491. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser-types.js.map +1 -1
  492. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser.cjs.map +1 -1
  493. package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser.js.map +1 -1
  494. package/dist/_node_modules/meow/index.cjs +202 -0
  495. package/dist/_node_modules/meow/index.cjs.map +1 -0
  496. package/dist/_node_modules/meow/index.js +203 -0
  497. package/dist/_node_modules/meow/index.js.map +1 -0
  498. package/dist/_node_modules/merge2/index.cjs +116 -0
  499. package/dist/_node_modules/merge2/index.cjs.map +1 -0
  500. package/dist/_node_modules/merge2/index.js +117 -0
  501. package/dist/_node_modules/merge2/index.js.map +1 -0
  502. package/dist/_node_modules/micromatch/index.cjs +164 -0
  503. package/dist/_node_modules/micromatch/index.cjs.map +1 -0
  504. package/dist/_node_modules/micromatch/index.js +165 -0
  505. package/dist/_node_modules/micromatch/index.js.map +1 -0
  506. package/dist/_node_modules/min-indent/index.cjs +10 -0
  507. package/dist/_node_modules/min-indent/index.cjs.map +1 -0
  508. package/dist/_node_modules/min-indent/index.js +11 -0
  509. package/dist/_node_modules/min-indent/index.js.map +1 -0
  510. package/dist/_node_modules/minimist-options/_node_modules/is-plain-obj/index.cjs +8 -0
  511. package/dist/_node_modules/minimist-options/_node_modules/is-plain-obj/index.cjs.map +1 -0
  512. package/dist/_node_modules/minimist-options/_node_modules/is-plain-obj/index.js +9 -0
  513. package/dist/_node_modules/minimist-options/_node_modules/is-plain-obj/index.js.map +1 -0
  514. package/dist/_node_modules/minimist-options/index.cjs +91 -0
  515. package/dist/_node_modules/minimist-options/index.cjs.map +1 -0
  516. package/dist/_node_modules/minimist-options/index.js +92 -0
  517. package/dist/_node_modules/minimist-options/index.js.map +1 -0
  518. package/dist/_node_modules/parse-json/index.cjs +52 -0
  519. package/dist/_node_modules/parse-json/index.cjs.map +1 -0
  520. package/dist/_node_modules/parse-json/index.js +53 -0
  521. package/dist/_node_modules/parse-json/index.js.map +1 -0
  522. package/dist/_node_modules/path-type/index.cjs +41 -0
  523. package/dist/_node_modules/path-type/index.cjs.map +1 -0
  524. package/dist/_node_modules/path-type/index.js +42 -0
  525. package/dist/_node_modules/path-type/index.js.map +1 -0
  526. package/dist/_node_modules/picomatch/index.cjs +7 -0
  527. package/dist/_node_modules/picomatch/index.cjs.map +1 -0
  528. package/dist/_node_modules/picomatch/index.js +6 -0
  529. package/dist/_node_modules/picomatch/index.js.map +1 -0
  530. package/dist/_node_modules/picomatch/lib/constants.cjs +194 -0
  531. package/dist/_node_modules/picomatch/lib/constants.cjs.map +1 -0
  532. package/dist/_node_modules/picomatch/lib/constants.js +195 -0
  533. package/dist/_node_modules/picomatch/lib/constants.js.map +1 -0
  534. package/dist/_node_modules/picomatch/lib/parse.cjs +780 -0
  535. package/dist/_node_modules/picomatch/lib/parse.cjs.map +1 -0
  536. package/dist/_node_modules/picomatch/lib/parse.js +781 -0
  537. package/dist/_node_modules/picomatch/lib/parse.js.map +1 -0
  538. package/dist/_node_modules/picomatch/lib/picomatch.cjs +146 -0
  539. package/dist/_node_modules/picomatch/lib/picomatch.cjs.map +1 -0
  540. package/dist/_node_modules/picomatch/lib/picomatch.js +147 -0
  541. package/dist/_node_modules/picomatch/lib/picomatch.js.map +1 -0
  542. package/dist/_node_modules/picomatch/lib/scan.cjs +332 -0
  543. package/dist/_node_modules/picomatch/lib/scan.cjs.map +1 -0
  544. package/dist/_node_modules/picomatch/lib/scan.js +333 -0
  545. package/dist/_node_modules/picomatch/lib/scan.js.map +1 -0
  546. package/dist/_node_modules/picomatch/lib/utils.cjs +64 -0
  547. package/dist/_node_modules/picomatch/lib/utils.cjs.map +1 -0
  548. package/dist/_node_modules/picomatch/lib/utils.js +65 -0
  549. package/dist/_node_modules/picomatch/lib/utils.js.map +1 -0
  550. package/dist/_node_modules/queue-microtask/index.cjs +9 -0
  551. package/dist/_node_modules/queue-microtask/index.cjs.map +1 -0
  552. package/dist/_node_modules/queue-microtask/index.js +10 -0
  553. package/dist/_node_modules/queue-microtask/index.js.map +1 -0
  554. package/dist/_node_modules/quick-lru/index.cjs +234 -0
  555. package/dist/_node_modules/quick-lru/index.cjs.map +1 -0
  556. package/dist/_node_modules/quick-lru/index.js +235 -0
  557. package/dist/_node_modules/quick-lru/index.js.map +1 -0
  558. package/dist/_node_modules/reusify/reusify.cjs +27 -0
  559. package/dist/_node_modules/reusify/reusify.cjs.map +1 -0
  560. package/dist/_node_modules/reusify/reusify.js +28 -0
  561. package/dist/_node_modules/reusify/reusify.js.map +1 -0
  562. package/dist/_node_modules/run-parallel/index.cjs +52 -0
  563. package/dist/_node_modules/run-parallel/index.cjs.map +1 -0
  564. package/dist/_node_modules/run-parallel/index.js +53 -0
  565. package/dist/_node_modules/run-parallel/index.js.map +1 -0
  566. package/dist/_node_modules/spdx-correct/index.cjs +333 -0
  567. package/dist/_node_modules/spdx-correct/index.cjs.map +1 -0
  568. package/dist/_node_modules/spdx-correct/index.js +334 -0
  569. package/dist/_node_modules/spdx-correct/index.js.map +1 -0
  570. package/dist/_node_modules/spdx-exceptions/index.json.cjs +43 -0
  571. package/dist/_node_modules/spdx-exceptions/index.json.cjs.map +1 -0
  572. package/dist/_node_modules/spdx-exceptions/index.json.js +44 -0
  573. package/dist/_node_modules/spdx-exceptions/index.json.js.map +1 -0
  574. package/dist/_node_modules/spdx-expression-parse/index.cjs +10 -0
  575. package/dist/_node_modules/spdx-expression-parse/index.cjs.map +1 -0
  576. package/dist/_node_modules/spdx-expression-parse/index.js +11 -0
  577. package/dist/_node_modules/spdx-expression-parse/index.js.map +1 -0
  578. package/dist/_node_modules/spdx-expression-parse/parse.cjs +110 -0
  579. package/dist/_node_modules/spdx-expression-parse/parse.cjs.map +1 -0
  580. package/dist/_node_modules/spdx-expression-parse/parse.js +111 -0
  581. package/dist/_node_modules/spdx-expression-parse/parse.js.map +1 -0
  582. package/dist/_node_modules/spdx-expression-parse/scan.cjs +103 -0
  583. package/dist/_node_modules/spdx-expression-parse/scan.cjs.map +1 -0
  584. package/dist/_node_modules/spdx-expression-parse/scan.js +104 -0
  585. package/dist/_node_modules/spdx-expression-parse/scan.js.map +1 -0
  586. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs +30 -0
  587. package/dist/_node_modules/spdx-license-ids/deprecated.json.cjs.map +1 -0
  588. package/dist/_node_modules/spdx-license-ids/deprecated.json.js +31 -0
  589. package/dist/_node_modules/spdx-license-ids/deprecated.json.js.map +1 -0
  590. package/dist/_node_modules/spdx-license-ids/index.json.cjs +510 -0
  591. package/dist/_node_modules/spdx-license-ids/index.json.cjs.map +1 -0
  592. package/dist/_node_modules/spdx-license-ids/index.json.js +511 -0
  593. package/dist/_node_modules/spdx-license-ids/index.json.js.map +1 -0
  594. package/dist/_node_modules/to-regex-range/index.cjs +215 -0
  595. package/dist/_node_modules/to-regex-range/index.cjs.map +1 -0
  596. package/dist/_node_modules/to-regex-range/index.js +216 -0
  597. package/dist/_node_modules/to-regex-range/index.js.map +1 -0
  598. package/dist/_node_modules/trim-newlines/index.cjs +29 -0
  599. package/dist/_node_modules/trim-newlines/index.cjs.map +1 -0
  600. package/dist/_node_modules/trim-newlines/index.js +30 -0
  601. package/dist/_node_modules/trim-newlines/index.js.map +1 -0
  602. package/dist/_node_modules/validate-npm-package-license/index.cjs +70 -0
  603. package/dist/_node_modules/validate-npm-package-license/index.cjs.map +1 -0
  604. package/dist/_node_modules/validate-npm-package-license/index.js +71 -0
  605. package/dist/_node_modules/validate-npm-package-license/index.js.map +1 -0
  606. package/dist/_virtual/_commonjsHelpers.cjs +5 -0
  607. package/dist/_virtual/_commonjsHelpers.cjs.map +1 -0
  608. package/dist/_virtual/_commonjsHelpers.js +5 -0
  609. package/dist/_virtual/_commonjsHelpers.js.map +1 -0
  610. package/dist/_virtual/array.cjs +5 -0
  611. package/dist/_virtual/array.cjs.map +1 -0
  612. package/dist/_virtual/array.js +5 -0
  613. package/dist/_virtual/array.js.map +1 -0
  614. package/dist/_virtual/async.cjs +5 -0
  615. package/dist/_virtual/async.cjs.map +1 -0
  616. package/dist/_virtual/async.js +5 -0
  617. package/dist/_virtual/async.js.map +1 -0
  618. package/dist/_virtual/async2.cjs +5 -0
  619. package/dist/_virtual/async2.cjs.map +1 -0
  620. package/dist/_virtual/async2.js +5 -0
  621. package/dist/_virtual/async2.js.map +1 -0
  622. package/dist/_virtual/async3.cjs +5 -0
  623. package/dist/_virtual/async3.cjs.map +1 -0
  624. package/dist/_virtual/async3.js +5 -0
  625. package/dist/_virtual/async3.js.map +1 -0
  626. package/dist/_virtual/async4.cjs +5 -0
  627. package/dist/_virtual/async4.cjs.map +1 -0
  628. package/dist/_virtual/async4.js +5 -0
  629. package/dist/_virtual/async4.js.map +1 -0
  630. package/dist/_virtual/async5.cjs +5 -0
  631. package/dist/_virtual/async5.cjs.map +1 -0
  632. package/dist/_virtual/async5.js +5 -0
  633. package/dist/_virtual/async5.js.map +1 -0
  634. package/dist/_virtual/async6.cjs +5 -0
  635. package/dist/_virtual/async6.cjs.map +1 -0
  636. package/dist/_virtual/async6.js +5 -0
  637. package/dist/_virtual/async6.js.map +1 -0
  638. package/dist/_virtual/common.cjs +5 -0
  639. package/dist/_virtual/common.cjs.map +1 -0
  640. package/dist/_virtual/common.js +5 -0
  641. package/dist/_virtual/common.js.map +1 -0
  642. package/dist/_virtual/common2.cjs +5 -0
  643. package/dist/_virtual/common2.cjs.map +1 -0
  644. package/dist/_virtual/common2.js +5 -0
  645. package/dist/_virtual/common2.js.map +1 -0
  646. package/dist/_virtual/constants.cjs +5 -0
  647. package/dist/_virtual/constants.cjs.map +1 -0
  648. package/dist/_virtual/constants.js +5 -0
  649. package/dist/_virtual/constants.js.map +1 -0
  650. package/dist/_virtual/deep.cjs +5 -0
  651. package/dist/_virtual/deep.cjs.map +1 -0
  652. package/dist/_virtual/deep.js +5 -0
  653. package/dist/_virtual/deep.js.map +1 -0
  654. package/dist/_virtual/entry.cjs +5 -0
  655. package/dist/_virtual/entry.cjs.map +1 -0
  656. package/dist/_virtual/entry.js +5 -0
  657. package/dist/_virtual/entry.js.map +1 -0
  658. package/dist/_virtual/entry2.cjs +5 -0
  659. package/dist/_virtual/entry2.cjs.map +1 -0
  660. package/dist/_virtual/entry2.js +5 -0
  661. package/dist/_virtual/entry2.js.map +1 -0
  662. package/dist/_virtual/errno.cjs +5 -0
  663. package/dist/_virtual/errno.cjs.map +1 -0
  664. package/dist/_virtual/errno.js +5 -0
  665. package/dist/_virtual/errno.js.map +1 -0
  666. package/dist/_virtual/error.cjs +5 -0
  667. package/dist/_virtual/error.cjs.map +1 -0
  668. package/dist/_virtual/error.js +5 -0
  669. package/dist/_virtual/error.js.map +1 -0
  670. package/dist/_virtual/fs.cjs +5 -0
  671. package/dist/_virtual/fs.cjs.map +1 -0
  672. package/dist/_virtual/fs.js +5 -0
  673. package/dist/_virtual/fs.js.map +1 -0
  674. package/dist/_virtual/fs2.cjs +5 -0
  675. package/dist/_virtual/fs2.cjs.map +1 -0
  676. package/dist/_virtual/fs2.js +5 -0
  677. package/dist/_virtual/fs2.js.map +1 -0
  678. package/dist/_virtual/fs3.cjs +5 -0
  679. package/dist/_virtual/fs3.cjs.map +1 -0
  680. package/dist/_virtual/fs3.js +5 -0
  681. package/dist/_virtual/fs3.js.map +1 -0
  682. package/dist/_virtual/fs4.cjs +5 -0
  683. package/dist/_virtual/fs4.cjs.map +1 -0
  684. package/dist/_virtual/fs4.js +5 -0
  685. package/dist/_virtual/fs4.js.map +1 -0
  686. package/dist/_virtual/identifier.cjs +5 -0
  687. package/dist/_virtual/identifier.cjs.map +1 -0
  688. package/dist/_virtual/identifier.js +5 -0
  689. package/dist/_virtual/identifier.js.map +1 -0
  690. package/dist/_virtual/index.cjs +13 -0
  691. package/dist/_virtual/index.cjs.map +1 -0
  692. package/dist/_virtual/index.js +14 -0
  693. package/dist/_virtual/index.js.map +1 -0
  694. package/dist/_virtual/index10.cjs +5 -0
  695. package/dist/_virtual/index10.cjs.map +1 -0
  696. package/dist/_virtual/index10.js +5 -0
  697. package/dist/_virtual/index10.js.map +1 -0
  698. package/dist/_virtual/index11.cjs +13 -0
  699. package/dist/_virtual/index11.cjs.map +1 -0
  700. package/dist/_virtual/index11.js +14 -0
  701. package/dist/_virtual/index11.js.map +1 -0
  702. package/dist/_virtual/index12.cjs +5 -0
  703. package/dist/_virtual/index12.cjs.map +1 -0
  704. package/dist/_virtual/index12.js +5 -0
  705. package/dist/_virtual/index12.js.map +1 -0
  706. package/dist/_virtual/index13.cjs +5 -0
  707. package/dist/_virtual/index13.cjs.map +1 -0
  708. package/dist/_virtual/index13.js +5 -0
  709. package/dist/_virtual/index13.js.map +1 -0
  710. package/dist/_virtual/index14.cjs +5 -0
  711. package/dist/_virtual/index14.cjs.map +1 -0
  712. package/dist/_virtual/index14.js +5 -0
  713. package/dist/_virtual/index14.js.map +1 -0
  714. package/dist/_virtual/index15.cjs +5 -0
  715. package/dist/_virtual/index15.cjs.map +1 -0
  716. package/dist/_virtual/index15.js +5 -0
  717. package/dist/_virtual/index15.js.map +1 -0
  718. package/dist/_virtual/index16.cjs +13 -0
  719. package/dist/_virtual/index16.cjs.map +1 -0
  720. package/dist/_virtual/index16.js +14 -0
  721. package/dist/_virtual/index16.js.map +1 -0
  722. package/dist/_virtual/index17.cjs +5 -0
  723. package/dist/_virtual/index17.cjs.map +1 -0
  724. package/dist/_virtual/index17.js +5 -0
  725. package/dist/_virtual/index17.js.map +1 -0
  726. package/dist/_virtual/index18.cjs +5 -0
  727. package/dist/_virtual/index18.cjs.map +1 -0
  728. package/dist/_virtual/index18.js +5 -0
  729. package/dist/_virtual/index18.js.map +1 -0
  730. package/dist/_virtual/index2.cjs +13 -0
  731. package/dist/_virtual/index2.cjs.map +1 -0
  732. package/dist/_virtual/index2.js +14 -0
  733. package/dist/_virtual/index2.js.map +1 -0
  734. package/dist/_virtual/index3.cjs +13 -0
  735. package/dist/_virtual/index3.cjs.map +1 -0
  736. package/dist/_virtual/index3.js +14 -0
  737. package/dist/_virtual/index3.js.map +1 -0
  738. package/dist/_virtual/index4.cjs +13 -0
  739. package/dist/_virtual/index4.cjs.map +1 -0
  740. package/dist/_virtual/index4.js +14 -0
  741. package/dist/_virtual/index4.js.map +1 -0
  742. package/dist/_virtual/index5.cjs +13 -0
  743. package/dist/_virtual/index5.cjs.map +1 -0
  744. package/dist/_virtual/index5.js +14 -0
  745. package/dist/_virtual/index5.js.map +1 -0
  746. package/dist/_virtual/index6.cjs +5 -0
  747. package/dist/_virtual/index6.cjs.map +1 -0
  748. package/dist/_virtual/index6.js +5 -0
  749. package/dist/_virtual/index6.js.map +1 -0
  750. package/dist/_virtual/index7.cjs +5 -0
  751. package/dist/_virtual/index7.cjs.map +1 -0
  752. package/dist/_virtual/index7.js +5 -0
  753. package/dist/_virtual/index7.js.map +1 -0
  754. package/dist/_virtual/index8.cjs +5 -0
  755. package/dist/_virtual/index8.cjs.map +1 -0
  756. package/dist/_virtual/index8.js +5 -0
  757. package/dist/_virtual/index8.js.map +1 -0
  758. package/dist/_virtual/index9.cjs +5 -0
  759. package/dist/_virtual/index9.cjs.map +1 -0
  760. package/dist/_virtual/index9.js +5 -0
  761. package/dist/_virtual/index9.js.map +1 -0
  762. package/dist/_virtual/keyword.cjs +5 -0
  763. package/dist/_virtual/keyword.cjs.map +1 -0
  764. package/dist/_virtual/keyword.js +5 -0
  765. package/dist/_virtual/keyword.js.map +1 -0
  766. package/dist/_virtual/matcher.cjs +5 -0
  767. package/dist/_virtual/matcher.cjs.map +1 -0
  768. package/dist/_virtual/matcher.js +5 -0
  769. package/dist/_virtual/matcher.js.map +1 -0
  770. package/dist/_virtual/partial.cjs +5 -0
  771. package/dist/_virtual/partial.cjs.map +1 -0
  772. package/dist/_virtual/partial.js +5 -0
  773. package/dist/_virtual/partial.js.map +1 -0
  774. package/dist/_virtual/path.cjs +5 -0
  775. package/dist/_virtual/path.cjs.map +1 -0
  776. package/dist/_virtual/path.js +5 -0
  777. package/dist/_virtual/path.js.map +1 -0
  778. package/dist/_virtual/pattern.cjs +5 -0
  779. package/dist/_virtual/pattern.cjs.map +1 -0
  780. package/dist/_virtual/pattern.js +5 -0
  781. package/dist/_virtual/pattern.js.map +1 -0
  782. package/dist/_virtual/patterns.cjs +5 -0
  783. package/dist/_virtual/patterns.cjs.map +1 -0
  784. package/dist/_virtual/patterns.js +5 -0
  785. package/dist/_virtual/patterns.js.map +1 -0
  786. package/dist/_virtual/provider.cjs +5 -0
  787. package/dist/_virtual/provider.cjs.map +1 -0
  788. package/dist/_virtual/provider.js +5 -0
  789. package/dist/_virtual/provider.js.map +1 -0
  790. package/dist/_virtual/queue.cjs +13 -0
  791. package/dist/_virtual/queue.cjs.map +1 -0
  792. package/dist/_virtual/queue.js +14 -0
  793. package/dist/_virtual/queue.js.map +1 -0
  794. package/dist/_virtual/reader.cjs +5 -0
  795. package/dist/_virtual/reader.cjs.map +1 -0
  796. package/dist/_virtual/reader.js +5 -0
  797. package/dist/_virtual/reader.js.map +1 -0
  798. package/dist/_virtual/reader2.cjs +5 -0
  799. package/dist/_virtual/reader2.cjs.map +1 -0
  800. package/dist/_virtual/reader2.js +5 -0
  801. package/dist/_virtual/reader2.js.map +1 -0
  802. package/dist/_virtual/settings.cjs +5 -0
  803. package/dist/_virtual/settings.cjs.map +1 -0
  804. package/dist/_virtual/settings.js +5 -0
  805. package/dist/_virtual/settings.js.map +1 -0
  806. package/dist/_virtual/settings2.cjs +5 -0
  807. package/dist/_virtual/settings2.cjs.map +1 -0
  808. package/dist/_virtual/settings2.js +5 -0
  809. package/dist/_virtual/settings2.js.map +1 -0
  810. package/dist/_virtual/settings3.cjs +5 -0
  811. package/dist/_virtual/settings3.cjs.map +1 -0
  812. package/dist/_virtual/settings3.js +5 -0
  813. package/dist/_virtual/settings3.js.map +1 -0
  814. package/dist/_virtual/settings4.cjs +5 -0
  815. package/dist/_virtual/settings4.cjs.map +1 -0
  816. package/dist/_virtual/settings4.js +5 -0
  817. package/dist/_virtual/settings4.js.map +1 -0
  818. package/dist/_virtual/stream.cjs +5 -0
  819. package/dist/_virtual/stream.cjs.map +1 -0
  820. package/dist/_virtual/stream.js +5 -0
  821. package/dist/_virtual/stream.js.map +1 -0
  822. package/dist/_virtual/stream2.cjs +5 -0
  823. package/dist/_virtual/stream2.cjs.map +1 -0
  824. package/dist/_virtual/stream2.js +5 -0
  825. package/dist/_virtual/stream2.js.map +1 -0
  826. package/dist/_virtual/stream3.cjs +5 -0
  827. package/dist/_virtual/stream3.cjs.map +1 -0
  828. package/dist/_virtual/stream3.js +5 -0
  829. package/dist/_virtual/stream3.js.map +1 -0
  830. package/dist/_virtual/stream4.cjs +5 -0
  831. package/dist/_virtual/stream4.cjs.map +1 -0
  832. package/dist/_virtual/stream4.js +5 -0
  833. package/dist/_virtual/stream4.js.map +1 -0
  834. package/dist/_virtual/string.cjs +5 -0
  835. package/dist/_virtual/string.cjs.map +1 -0
  836. package/dist/_virtual/string.js +5 -0
  837. package/dist/_virtual/string.js.map +1 -0
  838. package/dist/_virtual/sync.cjs +5 -0
  839. package/dist/_virtual/sync.cjs.map +1 -0
  840. package/dist/_virtual/sync.js +5 -0
  841. package/dist/_virtual/sync.js.map +1 -0
  842. package/dist/_virtual/sync2.cjs +5 -0
  843. package/dist/_virtual/sync2.cjs.map +1 -0
  844. package/dist/_virtual/sync2.js +5 -0
  845. package/dist/_virtual/sync2.js.map +1 -0
  846. package/dist/_virtual/sync3.cjs +5 -0
  847. package/dist/_virtual/sync3.cjs.map +1 -0
  848. package/dist/_virtual/sync3.js +5 -0
  849. package/dist/_virtual/sync3.js.map +1 -0
  850. package/dist/_virtual/sync4.cjs +5 -0
  851. package/dist/_virtual/sync4.cjs.map +1 -0
  852. package/dist/_virtual/sync4.js +5 -0
  853. package/dist/_virtual/sync4.js.map +1 -0
  854. package/dist/_virtual/sync5.cjs +5 -0
  855. package/dist/_virtual/sync5.cjs.map +1 -0
  856. package/dist/_virtual/sync5.js +5 -0
  857. package/dist/_virtual/sync5.js.map +1 -0
  858. package/dist/_virtual/sync6.cjs +5 -0
  859. package/dist/_virtual/sync6.cjs.map +1 -0
  860. package/dist/_virtual/sync6.js +5 -0
  861. package/dist/_virtual/sync6.js.map +1 -0
  862. package/dist/_virtual/tasks.cjs +5 -0
  863. package/dist/_virtual/tasks.cjs.map +1 -0
  864. package/dist/_virtual/tasks.js +5 -0
  865. package/dist/_virtual/tasks.js.map +1 -0
  866. package/dist/_virtual/utils.cjs +5 -0
  867. package/dist/_virtual/utils.cjs.map +1 -0
  868. package/dist/_virtual/utils.js +5 -0
  869. package/dist/_virtual/utils.js.map +1 -0
  870. package/dist/_virtual/utils2.cjs +5 -0
  871. package/dist/_virtual/utils2.cjs.map +1 -0
  872. package/dist/_virtual/utils2.js +5 -0
  873. package/dist/_virtual/utils2.js.map +1 -0
  874. package/dist/cli.cjs +78 -0
  875. package/dist/cli.cjs.map +1 -0
  876. package/dist/cli.d.ts +1 -0
  877. package/dist/cli.js +77 -0
  878. package/dist/cli.js.map +1 -0
  879. package/dist/constants.cjs +7 -0
  880. package/dist/constants.cjs.map +1 -0
  881. package/dist/constants.d.ts +2 -0
  882. package/dist/constants.js +7 -0
  883. package/dist/constants.js.map +1 -0
  884. package/dist/index.cjs +6 -0
  885. package/dist/index.cjs.map +1 -0
  886. package/dist/index.d.ts +2 -0
  887. package/dist/index.js +6 -0
  888. package/dist/index.js.map +1 -0
  889. package/dist/lib/assertExists.cjs +9 -0
  890. package/dist/lib/assertExists.cjs.map +1 -0
  891. package/dist/lib/assertExists.d.ts +1 -0
  892. package/dist/lib/assertExists.js +9 -0
  893. package/dist/lib/assertExists.js.map +1 -0
  894. package/dist/lib/framework.cjs +92 -0
  895. package/dist/lib/framework.cjs.map +1 -0
  896. package/dist/lib/framework.d.ts +45 -0
  897. package/dist/lib/framework.js +92 -0
  898. package/dist/lib/framework.js.map +1 -0
  899. package/dist/lib/getExecuteCommand.cjs +8 -0
  900. package/dist/lib/getExecuteCommand.cjs.map +1 -0
  901. package/dist/lib/getExecuteCommand.d.ts +5 -0
  902. package/dist/lib/getExecuteCommand.js +8 -0
  903. package/dist/lib/getExecuteCommand.js.map +1 -0
  904. package/dist/lib/getRunScriptCommand.cjs +8 -0
  905. package/dist/lib/getRunScriptCommand.cjs.map +1 -0
  906. package/dist/lib/getRunScriptCommand.d.ts +5 -0
  907. package/dist/lib/getRunScriptCommand.js +8 -0
  908. package/dist/lib/getRunScriptCommand.js.map +1 -0
  909. package/dist/lib/listr.cjs +13 -0
  910. package/dist/lib/listr.cjs.map +1 -0
  911. package/dist/lib/listr.d.ts +3 -0
  912. package/dist/lib/listr.js +13 -0
  913. package/dist/lib/listr.js.map +1 -0
  914. package/dist/lib/prompt.cjs +15 -0
  915. package/dist/lib/prompt.cjs.map +1 -0
  916. package/dist/lib/prompt.d.ts +10 -0
  917. package/dist/lib/prompt.js +15 -0
  918. package/dist/lib/prompt.js.map +1 -0
  919. package/dist/lib/repositoryDomain.cjs +130 -0
  920. package/dist/lib/repositoryDomain.cjs.map +1 -0
  921. package/dist/lib/repositoryDomain.d.ts +25 -0
  922. package/dist/lib/repositoryDomain.js +130 -0
  923. package/dist/lib/repositoryDomain.js.map +1 -0
  924. package/dist/packages/init/_node_modules/globby/ignore.cjs +62 -0
  925. package/dist/packages/init/_node_modules/globby/ignore.cjs.map +1 -0
  926. package/dist/packages/init/_node_modules/globby/ignore.js +62 -0
  927. package/dist/packages/init/_node_modules/globby/ignore.js.map +1 -0
  928. package/dist/packages/init/_node_modules/globby/index.cjs +137 -0
  929. package/dist/packages/init/_node_modules/globby/index.cjs.map +1 -0
  930. package/dist/packages/init/_node_modules/globby/index.js +137 -0
  931. package/dist/packages/init/_node_modules/globby/index.js.map +1 -0
  932. package/dist/packages/init/_node_modules/globby/utilities.cjs +9 -0
  933. package/dist/packages/init/_node_modules/globby/utilities.cjs.map +1 -0
  934. package/dist/packages/init/_node_modules/globby/utilities.js +9 -0
  935. package/dist/packages/init/_node_modules/globby/utilities.js.map +1 -0
  936. package/dist/packages/init/_node_modules/slash/index.cjs +11 -0
  937. package/dist/packages/init/_node_modules/slash/index.cjs.map +1 -0
  938. package/dist/packages/init/_node_modules/slash/index.js +12 -0
  939. package/dist/packages/init/_node_modules/slash/index.js.map +1 -0
  940. package/dist/packages/init/package.json.cjs +135 -0
  941. package/dist/packages/init/package.json.cjs.map +1 -0
  942. package/dist/packages/init/package.json.js +135 -0
  943. package/dist/packages/init/package.json.js.map +1 -0
  944. package/package.json +93 -69
  945. package/src/SliceMachineInitProcess.ts +1114 -0
  946. package/src/cli.ts +84 -0
  947. package/src/constants.ts +3 -0
  948. package/src/index.ts +5 -129
  949. package/src/lib/assertExists.ts +9 -0
  950. package/src/lib/framework.ts +155 -0
  951. package/src/lib/getExecuteCommand.ts +9 -0
  952. package/src/lib/getRunScriptCommand.ts +9 -0
  953. package/src/lib/listr.ts +15 -0
  954. package/src/lib/prompt.ts +27 -0
  955. package/src/lib/repositoryDomain.ts +219 -0
  956. package/.depcheckrc +0 -4
  957. package/.eslintignore +0 -3
  958. package/.eslintrc.js +0 -24
  959. package/build/index.js +0 -3388
  960. package/build/index.js.map +0 -1
  961. package/dist/__node_modules/lines-and-columns/build/index.cjs +0 -64
  962. package/dist/__node_modules/lines-and-columns/build/index.js +0 -63
  963. package/dist/packages/init/__node_modules/human-signals/build/src/core.cjs +0 -275
  964. package/dist/packages/init/__node_modules/human-signals/build/src/core.cjs.map +0 -1
  965. package/dist/packages/init/__node_modules/human-signals/build/src/core.js +0 -275
  966. package/dist/packages/init/__node_modules/human-signals/build/src/core.js.map +0 -1
  967. package/dist/packages/init/__node_modules/human-signals/build/src/main.cjs +0 -50
  968. package/dist/packages/init/__node_modules/human-signals/build/src/main.cjs.map +0 -1
  969. package/dist/packages/init/__node_modules/human-signals/build/src/main.js +0 -50
  970. package/dist/packages/init/__node_modules/human-signals/build/src/main.js.map +0 -1
  971. package/dist/packages/init/__node_modules/human-signals/build/src/realtime.cjs +0 -20
  972. package/dist/packages/init/__node_modules/human-signals/build/src/realtime.cjs.map +0 -1
  973. package/dist/packages/init/__node_modules/human-signals/build/src/realtime.js +0 -20
  974. package/dist/packages/init/__node_modules/human-signals/build/src/realtime.js.map +0 -1
  975. package/dist/packages/init/__node_modules/human-signals/build/src/signals.cjs +0 -27
  976. package/dist/packages/init/__node_modules/human-signals/build/src/signals.cjs.map +0 -1
  977. package/dist/packages/init/__node_modules/human-signals/build/src/signals.js +0 -27
  978. package/dist/packages/init/__node_modules/human-signals/build/src/signals.js.map +0 -1
  979. package/jest.config.js +0 -17
  980. package/siroc.config.js +0 -19
  981. package/src/steps/choose-or-create-a-repository.ts +0 -169
  982. package/src/steps/configure-project.ts +0 -72
  983. package/src/steps/detect-framework.ts +0 -94
  984. package/src/steps/display-final-message.ts +0 -31
  985. package/src/steps/index.ts +0 -10
  986. package/src/steps/install-lib.ts +0 -116
  987. package/src/steps/install-required-dependencies.ts +0 -106
  988. package/src/steps/loginOrBypass.ts +0 -25
  989. package/src/steps/sendStarterData.ts +0 -31
  990. package/src/steps/set-version.ts +0 -61
  991. package/src/steps/starters/custom-types.ts +0 -81
  992. package/src/steps/starters/documents.ts +0 -95
  993. package/src/steps/starters/prompts.ts +0 -29
  994. package/src/steps/starters/s3.ts +0 -70
  995. package/src/steps/starters/slices.ts +0 -75
  996. package/src/steps/validate-pkg.ts +0 -14
  997. package/src/utils/PackageManager.ts +0 -66
  998. package/src/utils/auth/helpers.ts +0 -168
  999. package/src/utils/auth/index.ts +0 -63
  1000. package/src/utils/client.ts +0 -89
  1001. package/src/utils/create-repo.ts +0 -37
  1002. package/src/utils/fs.ts +0 -18
  1003. package/src/utils/index.ts +0 -42
  1004. package/src/utils/logs.ts +0 -28
  1005. package/src/utils/noop.ts +0 -3
  1006. package/src/utils/tracker.ts +0 -153
  1007. package/src/utils/validateRepositoryName.ts +0 -44
  1008. package/src/utils/versionCheck.ts +0 -10
  1009. package/tsconfig.json +0 -26
  1010. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/index.cjs +0 -0
  1011. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/index.js +0 -0
  1012. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/string-utils.cjs +0 -0
  1013. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/string-utils.js +0 -0
  1014. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/tokenize-arg-string.cjs +0 -0
  1015. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/tokenize-arg-string.js +0 -0
  1016. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser-types.cjs +0 -0
  1017. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser-types.js +0 -0
  1018. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser.cjs +0 -0
  1019. /package/dist/{__node_modules/meow/__node_modules → _node_modules/meow/_node_modules}/yargs-parser/build/lib/yargs-parser.js +0 -0
package/build/index.js DELETED
@@ -1,3388 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- 'use strict';
4
-
5
- const client = require('@slicemachine/client');
6
- const Prismic = require('@slicemachine/core/build/prismic');
7
- const ServerAnalytics = require('analytics-node');
8
- const uuid = require('uuid');
9
- const path = require('path');
10
- const util = require('util');
11
- const child_process = require('child_process');
12
- const chalk = require('chalk');
13
- const ora = require('ora');
14
- const core = require('@slicemachine/core');
15
- const hapi = require('@hapi/hapi');
16
- const open = require('open');
17
- const t$5 = require('io-ts');
18
- const cookie = require('@slicemachine/core/build/utils/cookie');
19
- const fs = require('fs');
20
- const NodeUtils = require('@slicemachine/core/build/node-utils');
21
- const inquirer = require('inquirer');
22
- const Separator = require('inquirer/lib/objects/separator');
23
- const tmp = require('tmp');
24
- const AdmZip = require('adm-zip');
25
- const fsExtra = require('fs-extra');
26
- const axios = require('axios');
27
- const Either = require('fp-ts/Either');
28
- const models = require('@slicemachine/core/build/models');
29
- const Libraries = require('@slicemachine/core/build/libraries');
30
- const customtypes = require('@prismicio/types-internal/lib/customtypes');
31
- const Either$1 = require('fp-ts/lib/Either');
32
- const SharedConfig = require('@slicemachine/core/build/prismic/SharedConfig');
33
-
34
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
35
-
36
- function _interopNamespace(e) {
37
- if (e && e.__esModule) return e;
38
- const n = Object.create(null);
39
- if (e) {
40
- for (const k in e) {
41
- if (k !== 'default') {
42
- const d = Object.getOwnPropertyDescriptor(e, k);
43
- Object.defineProperty(n, k, d.get ? d : {
44
- enumerable: true,
45
- get: function () { return e[k]; }
46
- });
47
- }
48
- }
49
- }
50
- n["default"] = e;
51
- return Object.freeze(n);
52
- }
53
-
54
- const Prismic__namespace = /*#__PURE__*/_interopNamespace(Prismic);
55
- const Prismic__default = /*#__PURE__*/_interopDefaultLegacy(Prismic);
56
- const ServerAnalytics__default = /*#__PURE__*/_interopDefaultLegacy(ServerAnalytics);
57
- const path__default = /*#__PURE__*/_interopDefaultLegacy(path);
58
- const util__default = /*#__PURE__*/_interopDefaultLegacy(util);
59
- const chalk__default = /*#__PURE__*/_interopDefaultLegacy(chalk);
60
- const ora__default = /*#__PURE__*/_interopDefaultLegacy(ora);
61
- const hapi__namespace = /*#__PURE__*/_interopNamespace(hapi);
62
- const open__default = /*#__PURE__*/_interopDefaultLegacy(open);
63
- const t__namespace = /*#__PURE__*/_interopNamespace(t$5);
64
- const fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
65
- const NodeUtils__namespace = /*#__PURE__*/_interopNamespace(NodeUtils);
66
- const inquirer__namespace = /*#__PURE__*/_interopNamespace(inquirer);
67
- const inquirer__default = /*#__PURE__*/_interopDefaultLegacy(inquirer);
68
- const Separator__default = /*#__PURE__*/_interopDefaultLegacy(Separator);
69
- const tmp__default = /*#__PURE__*/_interopDefaultLegacy(tmp);
70
- const AdmZip__default = /*#__PURE__*/_interopDefaultLegacy(AdmZip);
71
- const fsExtra__default = /*#__PURE__*/_interopDefaultLegacy(fsExtra);
72
- const axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
73
- const Libraries__namespace = /*#__PURE__*/_interopNamespace(Libraries);
74
-
75
- const noop = () => void 0;
76
-
77
- var __accessCheck = (obj, member, msg) => {
78
- if (!member.has(obj))
79
- throw TypeError("Cannot " + msg);
80
- };
81
- var __privateGet = (obj, member, getter) => {
82
- __accessCheck(obj, member, "read from private field");
83
- return getter ? getter.call(obj) : member.get(obj);
84
- };
85
- var __privateAdd = (obj, member, value) => {
86
- if (member.has(obj))
87
- throw TypeError("Cannot add the same private member more than once");
88
- member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
89
- };
90
- var __privateSet = (obj, member, value, setter) => {
91
- __accessCheck(obj, member, "write to private field");
92
- setter ? setter.call(obj, value) : member.set(obj, value);
93
- return value;
94
- };
95
- var _client, _isTrackingActive, _anonymousId, _userId, _repository;
96
- var EventType;
97
- (function(EventType2) {
98
- EventType2["DownloadLibrary"] = "SliceMachine Download Library";
99
- EventType2["InitStart"] = "SliceMachine Init Start";
100
- EventType2["InitIdentify"] = "SliceMachine Init Identify";
101
- EventType2["InitEnd"] = "SliceMachine Init End";
102
- })(EventType || (EventType = {}));
103
- class InitTracker {
104
- constructor() {
105
- __privateAdd(this, _client, null);
106
- __privateAdd(this, _isTrackingActive, true);
107
- __privateAdd(this, _anonymousId, "");
108
- __privateAdd(this, _userId, null);
109
- __privateAdd(this, _repository, null);
110
- }
111
- initialize(segmentKey, isTrackingActive = true) {
112
- try {
113
- if (!!__privateGet(this, _client))
114
- return;
115
- __privateSet(this, _isTrackingActive, isTrackingActive);
116
- __privateSet(this, _anonymousId, uuid.v4());
117
- __privateSet(this, _client, new ServerAnalytics__default["default"](segmentKey, {
118
- flushAt: 1,
119
- errorHandler: noop
120
- }));
121
- } catch (error) {
122
- }
123
- }
124
- _trackEvent(eventType, attributes = {}) {
125
- return new Promise((resolve) => {
126
- if (!this._isTrackingPossible(__privateGet(this, _client))) {
127
- return resolve();
128
- }
129
- const identifier = this._createSegmentIdentifier();
130
- const payload = {
131
- event: eventType,
132
- ...identifier,
133
- properties: attributes,
134
- ...__privateGet(this, _repository) ? { context: { groupId: { Repository: __privateGet(this, _repository) } } } : {}
135
- };
136
- return __privateGet(this, _client).track(payload, () => {
137
- return resolve();
138
- });
139
- });
140
- }
141
- _identifyEvent(userId, intercomHash) {
142
- if (!this._isTrackingPossible(__privateGet(this, _client))) {
143
- return;
144
- }
145
- try {
146
- __privateGet(this, _client).identify({
147
- userId,
148
- anonymousId: __privateGet(this, _anonymousId),
149
- integrations: {
150
- Intercom: {
151
- user_hash: intercomHash
152
- }
153
- }
154
- });
155
- } catch (e) {
156
- }
157
- }
158
- _isTrackingPossible(client) {
159
- return !!client && __privateGet(this, _isTrackingActive);
160
- }
161
- _createSegmentIdentifier() {
162
- return !!__privateGet(this, _userId) ? { userId: __privateGet(this, _userId) } : { anonymousId: __privateGet(this, _anonymousId) };
163
- }
164
- setRepository(repository) {
165
- __privateSet(this, _repository, repository);
166
- }
167
- identifyUser(userId, intercomHash) {
168
- __privateSet(this, _userId, userId);
169
- return this._identifyEvent(userId, intercomHash);
170
- }
171
- trackDownloadLibrary(library) {
172
- return this._trackEvent(EventType.DownloadLibrary, { library });
173
- }
174
- trackInitIdentify() {
175
- return this._trackEvent(EventType.InitIdentify);
176
- }
177
- trackInitStart(repoDomain) {
178
- if (repoDomain)
179
- this.setRepository(repoDomain);
180
- return this._trackEvent(EventType.InitStart, { repo: repoDomain });
181
- }
182
- trackInitEndSuccess(framework) {
183
- return this._trackEvent(EventType.InitEnd, {
184
- framework,
185
- repo: __privateGet(this, _repository),
186
- result: "success"
187
- });
188
- }
189
- trackInitEndFail(framework, error) {
190
- return this._trackEvent(EventType.InitEnd, {
191
- framework,
192
- repo: __privateGet(this, _repository),
193
- result: "error",
194
- error
195
- });
196
- }
197
- }
198
- _client = new WeakMap();
199
- _isTrackingActive = new WeakMap();
200
- _anonymousId = new WeakMap();
201
- _userId = new WeakMap();
202
- _repository = new WeakMap();
203
- const Tracker = (() => {
204
- let smTrackerInstance;
205
- const init = () => new InitTracker();
206
- return {
207
- get() {
208
- if (!smTrackerInstance)
209
- smTrackerInstance = init();
210
- return smTrackerInstance;
211
- }
212
- };
213
- })();
214
-
215
- const purple = chalk__default["default"].hex("8c76fc");
216
- const error = chalk__default["default"].hex("FF6868");
217
- const warning = chalk__default["default"].hex("F3AD38");
218
- const underline$1 = chalk__default["default"].underline;
219
- const bold$1 = chalk__default["default"].bold;
220
- const dim = chalk__default["default"].dim;
221
- const cyan = chalk__default["default"].cyan;
222
- const yellow = chalk__default["default"].yellow;
223
- const white = chalk__default["default"].white;
224
- const spinner$1 = ora__default["default"];
225
- const writeError$1 = (msg, prefix = "Error!") => console.error(`${error(prefix)} ${msg}`);
226
- const writeWarning = (msg, prefix = "Warning!") => console.warn(`${warning(prefix)} ${msg}`);
227
- const writeCheck = (msg) => {
228
- ora__default["default"]().succeed(msg);
229
- };
230
- const writeInfo = (msg) => {
231
- console.log(`${yellow("\u2139")} ${dim(msg)}`);
232
- };
233
-
234
- const logs = /*#__PURE__*/Object.freeze({
235
- __proto__: null,
236
- purple: purple,
237
- error: error,
238
- warning: warning,
239
- underline: underline$1,
240
- bold: bold$1,
241
- dim: dim,
242
- cyan: cyan,
243
- yellow: yellow,
244
- white: white,
245
- spinner: spinner$1,
246
- writeError: writeError$1,
247
- writeWarning: writeWarning,
248
- writeCheck: writeCheck,
249
- writeInfo: writeInfo
250
- });
251
-
252
- const { Cookie } = core.Utils;
253
- const { DEFAULT_BASE, DEFAULT_SERVER_PORT } = core.CONSTS;
254
- const { bold, underline, spinner, writeError } = logs;
255
- const isHandlerData = (data) => {
256
- if (typeof data != "object")
257
- return false;
258
- const { email, cookies } = data;
259
- return Boolean(email && cookies) && Array.isArray(cookies) && !cookies.some((c) => typeof c !== "string");
260
- };
261
- const Routes = {
262
- authentication: (server) => (onSuccess, onFail) => ({
263
- method: "POST",
264
- path: "/",
265
- handler: authenticationHandler(server)(onSuccess, onFail)
266
- }),
267
- notFound: {
268
- method: ["GET", "POST"],
269
- path: "/{any*}",
270
- handler: (request, h) => {
271
- return h.response(`not found: [${request.method}]: ${request.url.toString()}`).code(404);
272
- }
273
- }
274
- };
275
- function validatePayload(payload) {
276
- if (Buffer.isBuffer(payload))
277
- return null;
278
- return isHandlerData(payload) ? payload : null;
279
- }
280
- const authenticationHandler = (server) => (onSuccess, onFail) => {
281
- return (request, h) => {
282
- try {
283
- const data = validatePayload(request.payload);
284
- if (!data) {
285
- onFail();
286
- h.response("Error with cookies").code(400);
287
- throw new Error("It seems the server didn't respond properly, please contact us.");
288
- }
289
- onSuccess(data);
290
- return h.response(data).code(200);
291
- } finally {
292
- void server.stop({ timeout: 1e4 });
293
- }
294
- };
295
- };
296
- function stripTrailingSlash(str) {
297
- return str.endsWith("/") ? str.slice(0, -1) : str;
298
- }
299
- function buildServer(base, port, host) {
300
- const server = hapi__namespace.server({
301
- port,
302
- host,
303
- routes: {
304
- cors: {
305
- origin: [stripTrailingSlash(base)],
306
- headers: ["Origin", "X-Requested-With", "Content-Type", "Accept"]
307
- }
308
- }
309
- });
310
- return server;
311
- }
312
- function askSingleChar(title) {
313
- return new Promise((resolve) => {
314
- process.stdout.write(title);
315
- const rawMode = process.stdin.isRaw;
316
- if (process.stdin.setRawMode)
317
- process.stdin.setRawMode(true);
318
- function handler(key) {
319
- const response = key.toString("utf-8");
320
- if (process.stdin.setRawMode)
321
- process.stdin.setRawMode(Boolean(rawMode));
322
- process.stdin.removeListener("data", handler);
323
- resolve(response);
324
- }
325
- process.stdin.on("data", handler);
326
- });
327
- }
328
- async function startServerAndOpenBrowser(url, action, base = DEFAULT_BASE, port = DEFAULT_SERVER_PORT) {
329
- const confirmation = await askSingleChar(`>> Press any key to open the browser to ${action} or q to exit:`);
330
- if (confirmation === "q" || confirmation === "")
331
- return process.exit(-1);
332
- const s = spinner("Waiting for the browser response");
333
- const onLoginFail = () => {
334
- s.stop();
335
- writeError(`We failed to log you into your Prismic account`);
336
- console.log(`Run ${bold("npx slicemachine init")} again!`);
337
- process.exit(-1);
338
- };
339
- function onSuccess(data) {
340
- s.succeed(`Logged in as ${bold(data.email)}`).stop();
341
- Prismic.PrismicSharedConfigManager.setProperties({
342
- cookies: Cookie.serializeCookies(data.cookies),
343
- base
344
- });
345
- }
346
- function onFail() {
347
- onLoginFail();
348
- }
349
- const server = buildServer(base, port, "localhost");
350
- server.route([
351
- Routes.authentication(server)(onSuccess, onFail),
352
- Routes.notFound
353
- ]);
354
- return server.start().then(() => {
355
- console.log("\nOpening browser to " + underline(url));
356
- s.start();
357
- void open__default["default"](url);
358
- return {
359
- onLoginFail
360
- };
361
- });
362
- }
363
-
364
- async function startAuth({
365
- client,
366
- url,
367
- action
368
- }) {
369
- const { onLoginFail } = await startServerAndOpenBrowser(url, action, client.apisEndpoints.Wroom);
370
- try {
371
- await core.Utils.Poll.startPolling(() => Auth.validateSession(client), (isSessionValid) => isSessionValid == true, 3e3, 60);
372
- return;
373
- } catch (e) {
374
- onLoginFail();
375
- }
376
- }
377
- const Auth = {
378
- login: async (client) => {
379
- const endpoints = Prismic.Endpoints.buildEndpoints(client.apisEndpoints.Wroom);
380
- return startAuth({
381
- client,
382
- url: endpoints.Dashboard.cliLogin,
383
- action: "login"
384
- });
385
- },
386
- validateSession: async (client) => {
387
- const authToken = Prismic.PrismicSharedConfigManager.getAuth();
388
- return client.updateAuthenticationToken(authToken).profile().then((userProfile) => {
389
- Prismic.PrismicSharedConfigManager.setProperties({
390
- shortId: userProfile.shortId,
391
- intercomHash: userProfile.intercomHash
392
- });
393
- return true;
394
- }).catch(() => false);
395
- }
396
- };
397
-
398
- class InitClient extends client.Client {
399
- async listRepositories() {
400
- return client.getAndValidateResponse(this._get(`${this.apisEndpoints.Users}repositories`), "repository list", t__namespace.array(core.Models.Repository));
401
- }
402
- async createRepository(domain, framework) {
403
- const data = {
404
- domain,
405
- framework,
406
- plan: "personal",
407
- isAnnual: "false",
408
- role: "developer"
409
- };
410
- return this._fetch({
411
- method: "post",
412
- url: `${this.apisEndpoints.Wroom}authentication/newrepository?app=slicemachine`,
413
- data,
414
- headers: {
415
- Cookie: Prismic.PrismicSharedConfigManager.get().cookies,
416
- "User-Agent": "prismic-cli/sm"
417
- }
418
- }).then(() => domain);
419
- }
420
- async deleteRepository(domain, password, cookies) {
421
- const repositoryDirectUrl = new URL(this.apisEndpoints.Wroom);
422
- repositoryDirectUrl.hostname = `${domain}.${repositoryDirectUrl.hostname}`;
423
- const token = cookie.parse(cookies).X_XSRF;
424
- return this._fetch({
425
- method: "post",
426
- url: `${repositoryDirectUrl.toString()}app/settings/delete?_=${token}`,
427
- data: { confirm: domain, password },
428
- headers: {
429
- Cookie: cookies,
430
- "User-Agent": "prismic-cli/0"
431
- }
432
- }).then(() => domain);
433
- }
434
- async domainExist(domain) {
435
- return client.getAndValidateResponse(this._get(`${this.apisEndpoints.Wroom}app/dashboard/repositories/${domain}/exists`), "repository exists", t__namespace.boolean);
436
- }
437
- async pushDocuments(signature, documents, cookies) {
438
- if (!this.repository)
439
- throw new Error("Repository undefined in the client");
440
- const repositoryDirectUrl = new URL(this.apisEndpoints.Wroom);
441
- repositoryDirectUrl.hostname = `${this.repository}.${repositoryDirectUrl.hostname}`;
442
- return this._fetch({
443
- method: "post",
444
- url: `${repositoryDirectUrl.toString()}starter/documents`,
445
- data: { signature, documents: JSON.stringify(documents) },
446
- headers: {
447
- Cookie: cookies,
448
- "User-Agent": "prismic-cli/0"
449
- }
450
- });
451
- }
452
- }
453
-
454
- async function lsdir(dir) {
455
- return fs__default["default"].promises.readdir(dir).then((dirs) => {
456
- return dirs.filter((name) => fs__default["default"].statSync(path__default["default"].join(dir, name)).isDirectory()).map((subdirectory) => path__default["default"].join(dir, subdirectory));
457
- });
458
- }
459
- async function lsfiles(dir) {
460
- return fs__default["default"].promises.readdir(dir).then((dirs) => {
461
- return dirs.filter((name) => fs__default["default"].statSync(path__default["default"].join(dir, name)).isFile()).map((file) => path__default["default"].join(dir, file));
462
- });
463
- }
464
-
465
- const debug$3 = (
466
- typeof process === 'object' &&
467
- process.env &&
468
- process.env.NODE_DEBUG &&
469
- /\bsemver\b/i.test(process.env.NODE_DEBUG)
470
- ) ? (...args) => console.error('SEMVER', ...args)
471
- : () => {};
472
-
473
- var debug_1 = debug$3;
474
-
475
- // Note: this is the semver.org version of the spec that it implements
476
- // Not necessarily the package version of this code.
477
- const SEMVER_SPEC_VERSION = '2.0.0';
478
-
479
- const MAX_LENGTH$2 = 256;
480
- const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
481
- /* istanbul ignore next */ 9007199254740991;
482
-
483
- // Max safe segment length for coercion.
484
- const MAX_SAFE_COMPONENT_LENGTH = 16;
485
-
486
- var constants = {
487
- SEMVER_SPEC_VERSION,
488
- MAX_LENGTH: MAX_LENGTH$2,
489
- MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
490
- MAX_SAFE_COMPONENT_LENGTH,
491
- };
492
-
493
- var re$5 = {exports: {}};
494
-
495
- (function (module, exports) {
496
- const { MAX_SAFE_COMPONENT_LENGTH } = constants;
497
- const debug = debug_1;
498
- exports = module.exports = {};
499
-
500
- // The actual regexps go on exports.re
501
- const re = exports.re = [];
502
- const src = exports.src = [];
503
- const t = exports.t = {};
504
- let R = 0;
505
-
506
- const createToken = (name, value, isGlobal) => {
507
- const index = R++;
508
- debug(name, index, value);
509
- t[name] = index;
510
- src[index] = value;
511
- re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
512
- };
513
-
514
- // The following Regular Expressions can be used for tokenizing,
515
- // validating, and parsing SemVer version strings.
516
-
517
- // ## Numeric Identifier
518
- // A single `0`, or a non-zero digit followed by zero or more digits.
519
-
520
- createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
521
- createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+');
522
-
523
- // ## Non-numeric Identifier
524
- // Zero or more digits, followed by a letter or hyphen, and then zero or
525
- // more letters, digits, or hyphens.
526
-
527
- createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*');
528
-
529
- // ## Main Version
530
- // Three dot-separated numeric identifiers.
531
-
532
- createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
533
- `(${src[t.NUMERICIDENTIFIER]})\\.` +
534
- `(${src[t.NUMERICIDENTIFIER]})`);
535
-
536
- createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
537
- `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
538
- `(${src[t.NUMERICIDENTIFIERLOOSE]})`);
539
-
540
- // ## Pre-release Version Identifier
541
- // A numeric identifier, or a non-numeric identifier.
542
-
543
- createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]
544
- }|${src[t.NONNUMERICIDENTIFIER]})`);
545
-
546
- createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]
547
- }|${src[t.NONNUMERICIDENTIFIER]})`);
548
-
549
- // ## Pre-release Version
550
- // Hyphen, followed by one or more dot-separated pre-release version
551
- // identifiers.
552
-
553
- createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
554
- }(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
555
-
556
- createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
557
- }(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
558
-
559
- // ## Build Metadata Identifier
560
- // Any combination of digits, letters, or hyphens.
561
-
562
- createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+');
563
-
564
- // ## Build Metadata
565
- // Plus sign, followed by one or more period-separated build metadata
566
- // identifiers.
567
-
568
- createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
569
- }(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
570
-
571
- // ## Full Version String
572
- // A main version, followed optionally by a pre-release version and
573
- // build metadata.
574
-
575
- // Note that the only major, minor, patch, and pre-release sections of
576
- // the version string are capturing groups. The build metadata is not a
577
- // capturing group, because it should not ever be used in version
578
- // comparison.
579
-
580
- createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
581
- }${src[t.PRERELEASE]}?${
582
- src[t.BUILD]}?`);
583
-
584
- createToken('FULL', `^${src[t.FULLPLAIN]}$`);
585
-
586
- // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
587
- // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
588
- // common in the npm registry.
589
- createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
590
- }${src[t.PRERELEASELOOSE]}?${
591
- src[t.BUILD]}?`);
592
-
593
- createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`);
594
-
595
- createToken('GTLT', '((?:<|>)?=?)');
596
-
597
- // Something like "2.*" or "1.2.x".
598
- // Note that "x.x" is a valid xRange identifer, meaning "any version"
599
- // Only the first item is strictly required.
600
- createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
601
- createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
602
-
603
- createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
604
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
605
- `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
606
- `(?:${src[t.PRERELEASE]})?${
607
- src[t.BUILD]}?` +
608
- `)?)?`);
609
-
610
- createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
611
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
612
- `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
613
- `(?:${src[t.PRERELEASELOOSE]})?${
614
- src[t.BUILD]}?` +
615
- `)?)?`);
616
-
617
- createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
618
- createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
619
-
620
- // Coercion.
621
- // Extract anything that could conceivably be a part of a valid semver
622
- createToken('COERCE', `${'(^|[^\\d])' +
623
- '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
624
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
625
- `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
626
- `(?:$|[^\\d])`);
627
- createToken('COERCERTL', src[t.COERCE], true);
628
-
629
- // Tilde ranges.
630
- // Meaning is "reasonably at or greater than"
631
- createToken('LONETILDE', '(?:~>?)');
632
-
633
- createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true);
634
- exports.tildeTrimReplace = '$1~';
635
-
636
- createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
637
- createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
638
-
639
- // Caret ranges.
640
- // Meaning is "at least and backwards compatible with"
641
- createToken('LONECARET', '(?:\\^)');
642
-
643
- createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true);
644
- exports.caretTrimReplace = '$1^';
645
-
646
- createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
647
- createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
648
-
649
- // A simple gt/lt/eq thing, or just "" to indicate "any version"
650
- createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
651
- createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
652
-
653
- // An expression to strip any whitespace between the gtlt and the thing
654
- // it modifies, so that `> 1.2.3` ==> `>1.2.3`
655
- createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
656
- }\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
657
- exports.comparatorTrimReplace = '$1$2$3';
658
-
659
- // Something like `1.2.3 - 1.2.4`
660
- // Note that these all use the loose form, because they'll be
661
- // checked against either the strict or loose comparator form
662
- // later.
663
- createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
664
- `\\s+-\\s+` +
665
- `(${src[t.XRANGEPLAIN]})` +
666
- `\\s*$`);
667
-
668
- createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
669
- `\\s+-\\s+` +
670
- `(${src[t.XRANGEPLAINLOOSE]})` +
671
- `\\s*$`);
672
-
673
- // Star ranges basically just allow anything at all.
674
- createToken('STAR', '(<|>)?=?\\s*\\*');
675
- // >=0.0.0 is like a star
676
- createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$');
677
- createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$');
678
- }(re$5, re$5.exports));
679
-
680
- // parse out just the options we care about so we always get a consistent
681
- // obj with keys in a consistent order.
682
- const opts = ['includePrerelease', 'loose', 'rtl'];
683
- const parseOptions$4 = options =>
684
- !options ? {}
685
- : typeof options !== 'object' ? { loose: true }
686
- : opts.filter(k => options[k]).reduce((o, k) => {
687
- o[k] = true;
688
- return o
689
- }, {});
690
- var parseOptions_1 = parseOptions$4;
691
-
692
- const numeric = /^[0-9]+$/;
693
- const compareIdentifiers$1 = (a, b) => {
694
- const anum = numeric.test(a);
695
- const bnum = numeric.test(b);
696
-
697
- if (anum && bnum) {
698
- a = +a;
699
- b = +b;
700
- }
701
-
702
- return a === b ? 0
703
- : (anum && !bnum) ? -1
704
- : (bnum && !anum) ? 1
705
- : a < b ? -1
706
- : 1
707
- };
708
-
709
- const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
710
-
711
- var identifiers = {
712
- compareIdentifiers: compareIdentifiers$1,
713
- rcompareIdentifiers,
714
- };
715
-
716
- const debug$2 = debug_1;
717
- const { MAX_LENGTH: MAX_LENGTH$1, MAX_SAFE_INTEGER } = constants;
718
- const { re: re$4, t: t$4 } = re$5.exports;
719
-
720
- const parseOptions$3 = parseOptions_1;
721
- const { compareIdentifiers } = identifiers;
722
- class SemVer$5 {
723
- constructor (version, options) {
724
- options = parseOptions$3(options);
725
-
726
- if (version instanceof SemVer$5) {
727
- if (version.loose === !!options.loose &&
728
- version.includePrerelease === !!options.includePrerelease) {
729
- return version
730
- } else {
731
- version = version.version;
732
- }
733
- } else if (typeof version !== 'string') {
734
- throw new TypeError(`Invalid Version: ${version}`)
735
- }
736
-
737
- if (version.length > MAX_LENGTH$1) {
738
- throw new TypeError(
739
- `version is longer than ${MAX_LENGTH$1} characters`
740
- )
741
- }
742
-
743
- debug$2('SemVer', version, options);
744
- this.options = options;
745
- this.loose = !!options.loose;
746
- // this isn't actually relevant for versions, but keep it so that we
747
- // don't run into trouble passing this.options around.
748
- this.includePrerelease = !!options.includePrerelease;
749
-
750
- const m = version.trim().match(options.loose ? re$4[t$4.LOOSE] : re$4[t$4.FULL]);
751
-
752
- if (!m) {
753
- throw new TypeError(`Invalid Version: ${version}`)
754
- }
755
-
756
- this.raw = version;
757
-
758
- // these are actually numbers
759
- this.major = +m[1];
760
- this.minor = +m[2];
761
- this.patch = +m[3];
762
-
763
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
764
- throw new TypeError('Invalid major version')
765
- }
766
-
767
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
768
- throw new TypeError('Invalid minor version')
769
- }
770
-
771
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
772
- throw new TypeError('Invalid patch version')
773
- }
774
-
775
- // numberify any prerelease numeric ids
776
- if (!m[4]) {
777
- this.prerelease = [];
778
- } else {
779
- this.prerelease = m[4].split('.').map((id) => {
780
- if (/^[0-9]+$/.test(id)) {
781
- const num = +id;
782
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
783
- return num
784
- }
785
- }
786
- return id
787
- });
788
- }
789
-
790
- this.build = m[5] ? m[5].split('.') : [];
791
- this.format();
792
- }
793
-
794
- format () {
795
- this.version = `${this.major}.${this.minor}.${this.patch}`;
796
- if (this.prerelease.length) {
797
- this.version += `-${this.prerelease.join('.')}`;
798
- }
799
- return this.version
800
- }
801
-
802
- toString () {
803
- return this.version
804
- }
805
-
806
- compare (other) {
807
- debug$2('SemVer.compare', this.version, this.options, other);
808
- if (!(other instanceof SemVer$5)) {
809
- if (typeof other === 'string' && other === this.version) {
810
- return 0
811
- }
812
- other = new SemVer$5(other, this.options);
813
- }
814
-
815
- if (other.version === this.version) {
816
- return 0
817
- }
818
-
819
- return this.compareMain(other) || this.comparePre(other)
820
- }
821
-
822
- compareMain (other) {
823
- if (!(other instanceof SemVer$5)) {
824
- other = new SemVer$5(other, this.options);
825
- }
826
-
827
- return (
828
- compareIdentifiers(this.major, other.major) ||
829
- compareIdentifiers(this.minor, other.minor) ||
830
- compareIdentifiers(this.patch, other.patch)
831
- )
832
- }
833
-
834
- comparePre (other) {
835
- if (!(other instanceof SemVer$5)) {
836
- other = new SemVer$5(other, this.options);
837
- }
838
-
839
- // NOT having a prerelease is > having one
840
- if (this.prerelease.length && !other.prerelease.length) {
841
- return -1
842
- } else if (!this.prerelease.length && other.prerelease.length) {
843
- return 1
844
- } else if (!this.prerelease.length && !other.prerelease.length) {
845
- return 0
846
- }
847
-
848
- let i = 0;
849
- do {
850
- const a = this.prerelease[i];
851
- const b = other.prerelease[i];
852
- debug$2('prerelease compare', i, a, b);
853
- if (a === undefined && b === undefined) {
854
- return 0
855
- } else if (b === undefined) {
856
- return 1
857
- } else if (a === undefined) {
858
- return -1
859
- } else if (a === b) {
860
- continue
861
- } else {
862
- return compareIdentifiers(a, b)
863
- }
864
- } while (++i)
865
- }
866
-
867
- compareBuild (other) {
868
- if (!(other instanceof SemVer$5)) {
869
- other = new SemVer$5(other, this.options);
870
- }
871
-
872
- let i = 0;
873
- do {
874
- const a = this.build[i];
875
- const b = other.build[i];
876
- debug$2('prerelease compare', i, a, b);
877
- if (a === undefined && b === undefined) {
878
- return 0
879
- } else if (b === undefined) {
880
- return 1
881
- } else if (a === undefined) {
882
- return -1
883
- } else if (a === b) {
884
- continue
885
- } else {
886
- return compareIdentifiers(a, b)
887
- }
888
- } while (++i)
889
- }
890
-
891
- // preminor will bump the version up to the next minor release, and immediately
892
- // down to pre-release. premajor and prepatch work the same way.
893
- inc (release, identifier) {
894
- switch (release) {
895
- case 'premajor':
896
- this.prerelease.length = 0;
897
- this.patch = 0;
898
- this.minor = 0;
899
- this.major++;
900
- this.inc('pre', identifier);
901
- break
902
- case 'preminor':
903
- this.prerelease.length = 0;
904
- this.patch = 0;
905
- this.minor++;
906
- this.inc('pre', identifier);
907
- break
908
- case 'prepatch':
909
- // If this is already a prerelease, it will bump to the next version
910
- // drop any prereleases that might already exist, since they are not
911
- // relevant at this point.
912
- this.prerelease.length = 0;
913
- this.inc('patch', identifier);
914
- this.inc('pre', identifier);
915
- break
916
- // If the input is a non-prerelease version, this acts the same as
917
- // prepatch.
918
- case 'prerelease':
919
- if (this.prerelease.length === 0) {
920
- this.inc('patch', identifier);
921
- }
922
- this.inc('pre', identifier);
923
- break
924
-
925
- case 'major':
926
- // If this is a pre-major version, bump up to the same major version.
927
- // Otherwise increment major.
928
- // 1.0.0-5 bumps to 1.0.0
929
- // 1.1.0 bumps to 2.0.0
930
- if (
931
- this.minor !== 0 ||
932
- this.patch !== 0 ||
933
- this.prerelease.length === 0
934
- ) {
935
- this.major++;
936
- }
937
- this.minor = 0;
938
- this.patch = 0;
939
- this.prerelease = [];
940
- break
941
- case 'minor':
942
- // If this is a pre-minor version, bump up to the same minor version.
943
- // Otherwise increment minor.
944
- // 1.2.0-5 bumps to 1.2.0
945
- // 1.2.1 bumps to 1.3.0
946
- if (this.patch !== 0 || this.prerelease.length === 0) {
947
- this.minor++;
948
- }
949
- this.patch = 0;
950
- this.prerelease = [];
951
- break
952
- case 'patch':
953
- // If this is not a pre-release version, it will increment the patch.
954
- // If it is a pre-release it will bump up to the same patch version.
955
- // 1.2.0-5 patches to 1.2.0
956
- // 1.2.0 patches to 1.2.1
957
- if (this.prerelease.length === 0) {
958
- this.patch++;
959
- }
960
- this.prerelease = [];
961
- break
962
- // This probably shouldn't be used publicly.
963
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
964
- case 'pre':
965
- if (this.prerelease.length === 0) {
966
- this.prerelease = [0];
967
- } else {
968
- let i = this.prerelease.length;
969
- while (--i >= 0) {
970
- if (typeof this.prerelease[i] === 'number') {
971
- this.prerelease[i]++;
972
- i = -2;
973
- }
974
- }
975
- if (i === -1) {
976
- // didn't increment anything
977
- this.prerelease.push(0);
978
- }
979
- }
980
- if (identifier) {
981
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
982
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
983
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
984
- if (isNaN(this.prerelease[1])) {
985
- this.prerelease = [identifier, 0];
986
- }
987
- } else {
988
- this.prerelease = [identifier, 0];
989
- }
990
- }
991
- break
992
-
993
- default:
994
- throw new Error(`invalid increment argument: ${release}`)
995
- }
996
- this.format();
997
- this.raw = this.version;
998
- return this
999
- }
1000
- }
1001
-
1002
- var semver = SemVer$5;
1003
-
1004
- const { MAX_LENGTH } = constants;
1005
- const { re: re$3, t: t$3 } = re$5.exports;
1006
- const SemVer$4 = semver;
1007
-
1008
- const parseOptions$2 = parseOptions_1;
1009
- const parse$1 = (version, options) => {
1010
- options = parseOptions$2(options);
1011
-
1012
- if (version instanceof SemVer$4) {
1013
- return version
1014
- }
1015
-
1016
- if (typeof version !== 'string') {
1017
- return null
1018
- }
1019
-
1020
- if (version.length > MAX_LENGTH) {
1021
- return null
1022
- }
1023
-
1024
- const r = options.loose ? re$3[t$3.LOOSE] : re$3[t$3.FULL];
1025
- if (!r.test(version)) {
1026
- return null
1027
- }
1028
-
1029
- try {
1030
- return new SemVer$4(version, options)
1031
- } catch (er) {
1032
- return null
1033
- }
1034
- };
1035
-
1036
- var parse_1 = parse$1;
1037
-
1038
- const SemVer$3 = semver;
1039
- const parse = parse_1;
1040
- const { re: re$2, t: t$2 } = re$5.exports;
1041
-
1042
- const coerce = (version, options) => {
1043
- if (version instanceof SemVer$3) {
1044
- return version
1045
- }
1046
-
1047
- if (typeof version === 'number') {
1048
- version = String(version);
1049
- }
1050
-
1051
- if (typeof version !== 'string') {
1052
- return null
1053
- }
1054
-
1055
- options = options || {};
1056
-
1057
- let match = null;
1058
- if (!options.rtl) {
1059
- match = version.match(re$2[t$2.COERCE]);
1060
- } else {
1061
- // Find the right-most coercible string that does not share
1062
- // a terminus with a more left-ward coercible string.
1063
- // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
1064
- //
1065
- // Walk through the string checking with a /g regexp
1066
- // Manually set the index so as to pick up overlapping matches.
1067
- // Stop when we get a match that ends at the string end, since no
1068
- // coercible string can be more right-ward without the same terminus.
1069
- let next;
1070
- while ((next = re$2[t$2.COERCERTL].exec(version)) &&
1071
- (!match || match.index + match[0].length !== version.length)
1072
- ) {
1073
- if (!match ||
1074
- next.index + next[0].length !== match.index + match[0].length) {
1075
- match = next;
1076
- }
1077
- re$2[t$2.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
1078
- }
1079
- // leave it in a clean state
1080
- re$2[t$2.COERCERTL].lastIndex = -1;
1081
- }
1082
-
1083
- if (match === null) {
1084
- return null
1085
- }
1086
-
1087
- return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
1088
- };
1089
- var coerce_1 = coerce;
1090
-
1091
- var iterator = function (Yallist) {
1092
- Yallist.prototype[Symbol.iterator] = function* () {
1093
- for (let walker = this.head; walker; walker = walker.next) {
1094
- yield walker.value;
1095
- }
1096
- };
1097
- };
1098
-
1099
- var yallist = Yallist$1;
1100
-
1101
- Yallist$1.Node = Node;
1102
- Yallist$1.create = Yallist$1;
1103
-
1104
- function Yallist$1 (list) {
1105
- var self = this;
1106
- if (!(self instanceof Yallist$1)) {
1107
- self = new Yallist$1();
1108
- }
1109
-
1110
- self.tail = null;
1111
- self.head = null;
1112
- self.length = 0;
1113
-
1114
- if (list && typeof list.forEach === 'function') {
1115
- list.forEach(function (item) {
1116
- self.push(item);
1117
- });
1118
- } else if (arguments.length > 0) {
1119
- for (var i = 0, l = arguments.length; i < l; i++) {
1120
- self.push(arguments[i]);
1121
- }
1122
- }
1123
-
1124
- return self
1125
- }
1126
-
1127
- Yallist$1.prototype.removeNode = function (node) {
1128
- if (node.list !== this) {
1129
- throw new Error('removing node which does not belong to this list')
1130
- }
1131
-
1132
- var next = node.next;
1133
- var prev = node.prev;
1134
-
1135
- if (next) {
1136
- next.prev = prev;
1137
- }
1138
-
1139
- if (prev) {
1140
- prev.next = next;
1141
- }
1142
-
1143
- if (node === this.head) {
1144
- this.head = next;
1145
- }
1146
- if (node === this.tail) {
1147
- this.tail = prev;
1148
- }
1149
-
1150
- node.list.length--;
1151
- node.next = null;
1152
- node.prev = null;
1153
- node.list = null;
1154
-
1155
- return next
1156
- };
1157
-
1158
- Yallist$1.prototype.unshiftNode = function (node) {
1159
- if (node === this.head) {
1160
- return
1161
- }
1162
-
1163
- if (node.list) {
1164
- node.list.removeNode(node);
1165
- }
1166
-
1167
- var head = this.head;
1168
- node.list = this;
1169
- node.next = head;
1170
- if (head) {
1171
- head.prev = node;
1172
- }
1173
-
1174
- this.head = node;
1175
- if (!this.tail) {
1176
- this.tail = node;
1177
- }
1178
- this.length++;
1179
- };
1180
-
1181
- Yallist$1.prototype.pushNode = function (node) {
1182
- if (node === this.tail) {
1183
- return
1184
- }
1185
-
1186
- if (node.list) {
1187
- node.list.removeNode(node);
1188
- }
1189
-
1190
- var tail = this.tail;
1191
- node.list = this;
1192
- node.prev = tail;
1193
- if (tail) {
1194
- tail.next = node;
1195
- }
1196
-
1197
- this.tail = node;
1198
- if (!this.head) {
1199
- this.head = node;
1200
- }
1201
- this.length++;
1202
- };
1203
-
1204
- Yallist$1.prototype.push = function () {
1205
- for (var i = 0, l = arguments.length; i < l; i++) {
1206
- push(this, arguments[i]);
1207
- }
1208
- return this.length
1209
- };
1210
-
1211
- Yallist$1.prototype.unshift = function () {
1212
- for (var i = 0, l = arguments.length; i < l; i++) {
1213
- unshift(this, arguments[i]);
1214
- }
1215
- return this.length
1216
- };
1217
-
1218
- Yallist$1.prototype.pop = function () {
1219
- if (!this.tail) {
1220
- return undefined
1221
- }
1222
-
1223
- var res = this.tail.value;
1224
- this.tail = this.tail.prev;
1225
- if (this.tail) {
1226
- this.tail.next = null;
1227
- } else {
1228
- this.head = null;
1229
- }
1230
- this.length--;
1231
- return res
1232
- };
1233
-
1234
- Yallist$1.prototype.shift = function () {
1235
- if (!this.head) {
1236
- return undefined
1237
- }
1238
-
1239
- var res = this.head.value;
1240
- this.head = this.head.next;
1241
- if (this.head) {
1242
- this.head.prev = null;
1243
- } else {
1244
- this.tail = null;
1245
- }
1246
- this.length--;
1247
- return res
1248
- };
1249
-
1250
- Yallist$1.prototype.forEach = function (fn, thisp) {
1251
- thisp = thisp || this;
1252
- for (var walker = this.head, i = 0; walker !== null; i++) {
1253
- fn.call(thisp, walker.value, i, this);
1254
- walker = walker.next;
1255
- }
1256
- };
1257
-
1258
- Yallist$1.prototype.forEachReverse = function (fn, thisp) {
1259
- thisp = thisp || this;
1260
- for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
1261
- fn.call(thisp, walker.value, i, this);
1262
- walker = walker.prev;
1263
- }
1264
- };
1265
-
1266
- Yallist$1.prototype.get = function (n) {
1267
- for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
1268
- // abort out of the list early if we hit a cycle
1269
- walker = walker.next;
1270
- }
1271
- if (i === n && walker !== null) {
1272
- return walker.value
1273
- }
1274
- };
1275
-
1276
- Yallist$1.prototype.getReverse = function (n) {
1277
- for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
1278
- // abort out of the list early if we hit a cycle
1279
- walker = walker.prev;
1280
- }
1281
- if (i === n && walker !== null) {
1282
- return walker.value
1283
- }
1284
- };
1285
-
1286
- Yallist$1.prototype.map = function (fn, thisp) {
1287
- thisp = thisp || this;
1288
- var res = new Yallist$1();
1289
- for (var walker = this.head; walker !== null;) {
1290
- res.push(fn.call(thisp, walker.value, this));
1291
- walker = walker.next;
1292
- }
1293
- return res
1294
- };
1295
-
1296
- Yallist$1.prototype.mapReverse = function (fn, thisp) {
1297
- thisp = thisp || this;
1298
- var res = new Yallist$1();
1299
- for (var walker = this.tail; walker !== null;) {
1300
- res.push(fn.call(thisp, walker.value, this));
1301
- walker = walker.prev;
1302
- }
1303
- return res
1304
- };
1305
-
1306
- Yallist$1.prototype.reduce = function (fn, initial) {
1307
- var acc;
1308
- var walker = this.head;
1309
- if (arguments.length > 1) {
1310
- acc = initial;
1311
- } else if (this.head) {
1312
- walker = this.head.next;
1313
- acc = this.head.value;
1314
- } else {
1315
- throw new TypeError('Reduce of empty list with no initial value')
1316
- }
1317
-
1318
- for (var i = 0; walker !== null; i++) {
1319
- acc = fn(acc, walker.value, i);
1320
- walker = walker.next;
1321
- }
1322
-
1323
- return acc
1324
- };
1325
-
1326
- Yallist$1.prototype.reduceReverse = function (fn, initial) {
1327
- var acc;
1328
- var walker = this.tail;
1329
- if (arguments.length > 1) {
1330
- acc = initial;
1331
- } else if (this.tail) {
1332
- walker = this.tail.prev;
1333
- acc = this.tail.value;
1334
- } else {
1335
- throw new TypeError('Reduce of empty list with no initial value')
1336
- }
1337
-
1338
- for (var i = this.length - 1; walker !== null; i--) {
1339
- acc = fn(acc, walker.value, i);
1340
- walker = walker.prev;
1341
- }
1342
-
1343
- return acc
1344
- };
1345
-
1346
- Yallist$1.prototype.toArray = function () {
1347
- var arr = new Array(this.length);
1348
- for (var i = 0, walker = this.head; walker !== null; i++) {
1349
- arr[i] = walker.value;
1350
- walker = walker.next;
1351
- }
1352
- return arr
1353
- };
1354
-
1355
- Yallist$1.prototype.toArrayReverse = function () {
1356
- var arr = new Array(this.length);
1357
- for (var i = 0, walker = this.tail; walker !== null; i++) {
1358
- arr[i] = walker.value;
1359
- walker = walker.prev;
1360
- }
1361
- return arr
1362
- };
1363
-
1364
- Yallist$1.prototype.slice = function (from, to) {
1365
- to = to || this.length;
1366
- if (to < 0) {
1367
- to += this.length;
1368
- }
1369
- from = from || 0;
1370
- if (from < 0) {
1371
- from += this.length;
1372
- }
1373
- var ret = new Yallist$1();
1374
- if (to < from || to < 0) {
1375
- return ret
1376
- }
1377
- if (from < 0) {
1378
- from = 0;
1379
- }
1380
- if (to > this.length) {
1381
- to = this.length;
1382
- }
1383
- for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
1384
- walker = walker.next;
1385
- }
1386
- for (; walker !== null && i < to; i++, walker = walker.next) {
1387
- ret.push(walker.value);
1388
- }
1389
- return ret
1390
- };
1391
-
1392
- Yallist$1.prototype.sliceReverse = function (from, to) {
1393
- to = to || this.length;
1394
- if (to < 0) {
1395
- to += this.length;
1396
- }
1397
- from = from || 0;
1398
- if (from < 0) {
1399
- from += this.length;
1400
- }
1401
- var ret = new Yallist$1();
1402
- if (to < from || to < 0) {
1403
- return ret
1404
- }
1405
- if (from < 0) {
1406
- from = 0;
1407
- }
1408
- if (to > this.length) {
1409
- to = this.length;
1410
- }
1411
- for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
1412
- walker = walker.prev;
1413
- }
1414
- for (; walker !== null && i > from; i--, walker = walker.prev) {
1415
- ret.push(walker.value);
1416
- }
1417
- return ret
1418
- };
1419
-
1420
- Yallist$1.prototype.splice = function (start, deleteCount, ...nodes) {
1421
- if (start > this.length) {
1422
- start = this.length - 1;
1423
- }
1424
- if (start < 0) {
1425
- start = this.length + start;
1426
- }
1427
-
1428
- for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
1429
- walker = walker.next;
1430
- }
1431
-
1432
- var ret = [];
1433
- for (var i = 0; walker && i < deleteCount; i++) {
1434
- ret.push(walker.value);
1435
- walker = this.removeNode(walker);
1436
- }
1437
- if (walker === null) {
1438
- walker = this.tail;
1439
- }
1440
-
1441
- if (walker !== this.head && walker !== this.tail) {
1442
- walker = walker.prev;
1443
- }
1444
-
1445
- for (var i = 0; i < nodes.length; i++) {
1446
- walker = insert(this, walker, nodes[i]);
1447
- }
1448
- return ret;
1449
- };
1450
-
1451
- Yallist$1.prototype.reverse = function () {
1452
- var head = this.head;
1453
- var tail = this.tail;
1454
- for (var walker = head; walker !== null; walker = walker.prev) {
1455
- var p = walker.prev;
1456
- walker.prev = walker.next;
1457
- walker.next = p;
1458
- }
1459
- this.head = tail;
1460
- this.tail = head;
1461
- return this
1462
- };
1463
-
1464
- function insert (self, node, value) {
1465
- var inserted = node === self.head ?
1466
- new Node(value, null, node, self) :
1467
- new Node(value, node, node.next, self);
1468
-
1469
- if (inserted.next === null) {
1470
- self.tail = inserted;
1471
- }
1472
- if (inserted.prev === null) {
1473
- self.head = inserted;
1474
- }
1475
-
1476
- self.length++;
1477
-
1478
- return inserted
1479
- }
1480
-
1481
- function push (self, item) {
1482
- self.tail = new Node(item, self.tail, null, self);
1483
- if (!self.head) {
1484
- self.head = self.tail;
1485
- }
1486
- self.length++;
1487
- }
1488
-
1489
- function unshift (self, item) {
1490
- self.head = new Node(item, null, self.head, self);
1491
- if (!self.tail) {
1492
- self.tail = self.head;
1493
- }
1494
- self.length++;
1495
- }
1496
-
1497
- function Node (value, prev, next, list) {
1498
- if (!(this instanceof Node)) {
1499
- return new Node(value, prev, next, list)
1500
- }
1501
-
1502
- this.list = list;
1503
- this.value = value;
1504
-
1505
- if (prev) {
1506
- prev.next = this;
1507
- this.prev = prev;
1508
- } else {
1509
- this.prev = null;
1510
- }
1511
-
1512
- if (next) {
1513
- next.prev = this;
1514
- this.next = next;
1515
- } else {
1516
- this.next = null;
1517
- }
1518
- }
1519
-
1520
- try {
1521
- // add if support for Symbol.iterator is present
1522
- iterator(Yallist$1);
1523
- } catch (er) {}
1524
-
1525
- // A linked list to keep track of recently-used-ness
1526
- const Yallist = yallist;
1527
-
1528
- const MAX = Symbol('max');
1529
- const LENGTH = Symbol('length');
1530
- const LENGTH_CALCULATOR = Symbol('lengthCalculator');
1531
- const ALLOW_STALE = Symbol('allowStale');
1532
- const MAX_AGE = Symbol('maxAge');
1533
- const DISPOSE = Symbol('dispose');
1534
- const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
1535
- const LRU_LIST = Symbol('lruList');
1536
- const CACHE = Symbol('cache');
1537
- const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
1538
-
1539
- const naiveLength = () => 1;
1540
-
1541
- // lruList is a yallist where the head is the youngest
1542
- // item, and the tail is the oldest. the list contains the Hit
1543
- // objects as the entries.
1544
- // Each Hit object has a reference to its Yallist.Node. This
1545
- // never changes.
1546
- //
1547
- // cache is a Map (or PseudoMap) that matches the keys to
1548
- // the Yallist.Node object.
1549
- class LRUCache {
1550
- constructor (options) {
1551
- if (typeof options === 'number')
1552
- options = { max: options };
1553
-
1554
- if (!options)
1555
- options = {};
1556
-
1557
- if (options.max && (typeof options.max !== 'number' || options.max < 0))
1558
- throw new TypeError('max must be a non-negative number')
1559
- // Kind of weird to have a default max of Infinity, but oh well.
1560
- this[MAX] = options.max || Infinity;
1561
-
1562
- const lc = options.length || naiveLength;
1563
- this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc;
1564
- this[ALLOW_STALE] = options.stale || false;
1565
- if (options.maxAge && typeof options.maxAge !== 'number')
1566
- throw new TypeError('maxAge must be a number')
1567
- this[MAX_AGE] = options.maxAge || 0;
1568
- this[DISPOSE] = options.dispose;
1569
- this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
1570
- this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
1571
- this.reset();
1572
- }
1573
-
1574
- // resize the cache when the max changes.
1575
- set max (mL) {
1576
- if (typeof mL !== 'number' || mL < 0)
1577
- throw new TypeError('max must be a non-negative number')
1578
-
1579
- this[MAX] = mL || Infinity;
1580
- trim(this);
1581
- }
1582
- get max () {
1583
- return this[MAX]
1584
- }
1585
-
1586
- set allowStale (allowStale) {
1587
- this[ALLOW_STALE] = !!allowStale;
1588
- }
1589
- get allowStale () {
1590
- return this[ALLOW_STALE]
1591
- }
1592
-
1593
- set maxAge (mA) {
1594
- if (typeof mA !== 'number')
1595
- throw new TypeError('maxAge must be a non-negative number')
1596
-
1597
- this[MAX_AGE] = mA;
1598
- trim(this);
1599
- }
1600
- get maxAge () {
1601
- return this[MAX_AGE]
1602
- }
1603
-
1604
- // resize the cache when the lengthCalculator changes.
1605
- set lengthCalculator (lC) {
1606
- if (typeof lC !== 'function')
1607
- lC = naiveLength;
1608
-
1609
- if (lC !== this[LENGTH_CALCULATOR]) {
1610
- this[LENGTH_CALCULATOR] = lC;
1611
- this[LENGTH] = 0;
1612
- this[LRU_LIST].forEach(hit => {
1613
- hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
1614
- this[LENGTH] += hit.length;
1615
- });
1616
- }
1617
- trim(this);
1618
- }
1619
- get lengthCalculator () { return this[LENGTH_CALCULATOR] }
1620
-
1621
- get length () { return this[LENGTH] }
1622
- get itemCount () { return this[LRU_LIST].length }
1623
-
1624
- rforEach (fn, thisp) {
1625
- thisp = thisp || this;
1626
- for (let walker = this[LRU_LIST].tail; walker !== null;) {
1627
- const prev = walker.prev;
1628
- forEachStep(this, fn, walker, thisp);
1629
- walker = prev;
1630
- }
1631
- }
1632
-
1633
- forEach (fn, thisp) {
1634
- thisp = thisp || this;
1635
- for (let walker = this[LRU_LIST].head; walker !== null;) {
1636
- const next = walker.next;
1637
- forEachStep(this, fn, walker, thisp);
1638
- walker = next;
1639
- }
1640
- }
1641
-
1642
- keys () {
1643
- return this[LRU_LIST].toArray().map(k => k.key)
1644
- }
1645
-
1646
- values () {
1647
- return this[LRU_LIST].toArray().map(k => k.value)
1648
- }
1649
-
1650
- reset () {
1651
- if (this[DISPOSE] &&
1652
- this[LRU_LIST] &&
1653
- this[LRU_LIST].length) {
1654
- this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
1655
- }
1656
-
1657
- this[CACHE] = new Map(); // hash of items by key
1658
- this[LRU_LIST] = new Yallist(); // list of items in order of use recency
1659
- this[LENGTH] = 0; // length of items in the list
1660
- }
1661
-
1662
- dump () {
1663
- return this[LRU_LIST].map(hit =>
1664
- isStale(this, hit) ? false : {
1665
- k: hit.key,
1666
- v: hit.value,
1667
- e: hit.now + (hit.maxAge || 0)
1668
- }).toArray().filter(h => h)
1669
- }
1670
-
1671
- dumpLru () {
1672
- return this[LRU_LIST]
1673
- }
1674
-
1675
- set (key, value, maxAge) {
1676
- maxAge = maxAge || this[MAX_AGE];
1677
-
1678
- if (maxAge && typeof maxAge !== 'number')
1679
- throw new TypeError('maxAge must be a number')
1680
-
1681
- const now = maxAge ? Date.now() : 0;
1682
- const len = this[LENGTH_CALCULATOR](value, key);
1683
-
1684
- if (this[CACHE].has(key)) {
1685
- if (len > this[MAX]) {
1686
- del(this, this[CACHE].get(key));
1687
- return false
1688
- }
1689
-
1690
- const node = this[CACHE].get(key);
1691
- const item = node.value;
1692
-
1693
- // dispose of the old one before overwriting
1694
- // split out into 2 ifs for better coverage tracking
1695
- if (this[DISPOSE]) {
1696
- if (!this[NO_DISPOSE_ON_SET])
1697
- this[DISPOSE](key, item.value);
1698
- }
1699
-
1700
- item.now = now;
1701
- item.maxAge = maxAge;
1702
- item.value = value;
1703
- this[LENGTH] += len - item.length;
1704
- item.length = len;
1705
- this.get(key);
1706
- trim(this);
1707
- return true
1708
- }
1709
-
1710
- const hit = new Entry(key, value, len, now, maxAge);
1711
-
1712
- // oversized objects fall out of cache automatically.
1713
- if (hit.length > this[MAX]) {
1714
- if (this[DISPOSE])
1715
- this[DISPOSE](key, value);
1716
-
1717
- return false
1718
- }
1719
-
1720
- this[LENGTH] += hit.length;
1721
- this[LRU_LIST].unshift(hit);
1722
- this[CACHE].set(key, this[LRU_LIST].head);
1723
- trim(this);
1724
- return true
1725
- }
1726
-
1727
- has (key) {
1728
- if (!this[CACHE].has(key)) return false
1729
- const hit = this[CACHE].get(key).value;
1730
- return !isStale(this, hit)
1731
- }
1732
-
1733
- get (key) {
1734
- return get(this, key, true)
1735
- }
1736
-
1737
- peek (key) {
1738
- return get(this, key, false)
1739
- }
1740
-
1741
- pop () {
1742
- const node = this[LRU_LIST].tail;
1743
- if (!node)
1744
- return null
1745
-
1746
- del(this, node);
1747
- return node.value
1748
- }
1749
-
1750
- del (key) {
1751
- del(this, this[CACHE].get(key));
1752
- }
1753
-
1754
- load (arr) {
1755
- // reset the cache
1756
- this.reset();
1757
-
1758
- const now = Date.now();
1759
- // A previous serialized cache has the most recent items first
1760
- for (let l = arr.length - 1; l >= 0; l--) {
1761
- const hit = arr[l];
1762
- const expiresAt = hit.e || 0;
1763
- if (expiresAt === 0)
1764
- // the item was created without expiration in a non aged cache
1765
- this.set(hit.k, hit.v);
1766
- else {
1767
- const maxAge = expiresAt - now;
1768
- // dont add already expired items
1769
- if (maxAge > 0) {
1770
- this.set(hit.k, hit.v, maxAge);
1771
- }
1772
- }
1773
- }
1774
- }
1775
-
1776
- prune () {
1777
- this[CACHE].forEach((value, key) => get(this, key, false));
1778
- }
1779
- }
1780
-
1781
- const get = (self, key, doUse) => {
1782
- const node = self[CACHE].get(key);
1783
- if (node) {
1784
- const hit = node.value;
1785
- if (isStale(self, hit)) {
1786
- del(self, node);
1787
- if (!self[ALLOW_STALE])
1788
- return undefined
1789
- } else {
1790
- if (doUse) {
1791
- if (self[UPDATE_AGE_ON_GET])
1792
- node.value.now = Date.now();
1793
- self[LRU_LIST].unshiftNode(node);
1794
- }
1795
- }
1796
- return hit.value
1797
- }
1798
- };
1799
-
1800
- const isStale = (self, hit) => {
1801
- if (!hit || (!hit.maxAge && !self[MAX_AGE]))
1802
- return false
1803
-
1804
- const diff = Date.now() - hit.now;
1805
- return hit.maxAge ? diff > hit.maxAge
1806
- : self[MAX_AGE] && (diff > self[MAX_AGE])
1807
- };
1808
-
1809
- const trim = self => {
1810
- if (self[LENGTH] > self[MAX]) {
1811
- for (let walker = self[LRU_LIST].tail;
1812
- self[LENGTH] > self[MAX] && walker !== null;) {
1813
- // We know that we're about to delete this one, and also
1814
- // what the next least recently used key will be, so just
1815
- // go ahead and set it now.
1816
- const prev = walker.prev;
1817
- del(self, walker);
1818
- walker = prev;
1819
- }
1820
- }
1821
- };
1822
-
1823
- const del = (self, node) => {
1824
- if (node) {
1825
- const hit = node.value;
1826
- if (self[DISPOSE])
1827
- self[DISPOSE](hit.key, hit.value);
1828
-
1829
- self[LENGTH] -= hit.length;
1830
- self[CACHE].delete(hit.key);
1831
- self[LRU_LIST].removeNode(node);
1832
- }
1833
- };
1834
-
1835
- class Entry {
1836
- constructor (key, value, length, now, maxAge) {
1837
- this.key = key;
1838
- this.value = value;
1839
- this.length = length;
1840
- this.now = now;
1841
- this.maxAge = maxAge || 0;
1842
- }
1843
- }
1844
-
1845
- const forEachStep = (self, fn, node, thisp) => {
1846
- let hit = node.value;
1847
- if (isStale(self, hit)) {
1848
- del(self, node);
1849
- if (!self[ALLOW_STALE])
1850
- hit = undefined;
1851
- }
1852
- if (hit)
1853
- fn.call(thisp, hit.value, hit.key, self);
1854
- };
1855
-
1856
- var lruCache = LRUCache;
1857
-
1858
- const SemVer$2 = semver;
1859
- const compare$6 = (a, b, loose) =>
1860
- new SemVer$2(a, loose).compare(new SemVer$2(b, loose));
1861
-
1862
- var compare_1 = compare$6;
1863
-
1864
- const compare$5 = compare_1;
1865
- const eq$1 = (a, b, loose) => compare$5(a, b, loose) === 0;
1866
- var eq_1 = eq$1;
1867
-
1868
- const compare$4 = compare_1;
1869
- const neq$1 = (a, b, loose) => compare$4(a, b, loose) !== 0;
1870
- var neq_1 = neq$1;
1871
-
1872
- const compare$3 = compare_1;
1873
- const gt$1 = (a, b, loose) => compare$3(a, b, loose) > 0;
1874
- var gt_1 = gt$1;
1875
-
1876
- const compare$2 = compare_1;
1877
- const gte$1 = (a, b, loose) => compare$2(a, b, loose) >= 0;
1878
- var gte_1 = gte$1;
1879
-
1880
- const compare$1 = compare_1;
1881
- const lt$1 = (a, b, loose) => compare$1(a, b, loose) < 0;
1882
- var lt_1 = lt$1;
1883
-
1884
- const compare = compare_1;
1885
- const lte$1 = (a, b, loose) => compare(a, b, loose) <= 0;
1886
- var lte_1 = lte$1;
1887
-
1888
- const eq = eq_1;
1889
- const neq = neq_1;
1890
- const gt = gt_1;
1891
- const gte = gte_1;
1892
- const lt = lt_1;
1893
- const lte = lte_1;
1894
-
1895
- const cmp$1 = (a, op, b, loose) => {
1896
- switch (op) {
1897
- case '===':
1898
- if (typeof a === 'object') {
1899
- a = a.version;
1900
- }
1901
- if (typeof b === 'object') {
1902
- b = b.version;
1903
- }
1904
- return a === b
1905
-
1906
- case '!==':
1907
- if (typeof a === 'object') {
1908
- a = a.version;
1909
- }
1910
- if (typeof b === 'object') {
1911
- b = b.version;
1912
- }
1913
- return a !== b
1914
-
1915
- case '':
1916
- case '=':
1917
- case '==':
1918
- return eq(a, b, loose)
1919
-
1920
- case '!=':
1921
- return neq(a, b, loose)
1922
-
1923
- case '>':
1924
- return gt(a, b, loose)
1925
-
1926
- case '>=':
1927
- return gte(a, b, loose)
1928
-
1929
- case '<':
1930
- return lt(a, b, loose)
1931
-
1932
- case '<=':
1933
- return lte(a, b, loose)
1934
-
1935
- default:
1936
- throw new TypeError(`Invalid operator: ${op}`)
1937
- }
1938
- };
1939
- var cmp_1 = cmp$1;
1940
-
1941
- const ANY = Symbol('SemVer ANY');
1942
- // hoisted class for cyclic dependency
1943
- class Comparator$1 {
1944
- static get ANY () {
1945
- return ANY
1946
- }
1947
-
1948
- constructor (comp, options) {
1949
- options = parseOptions$1(options);
1950
-
1951
- if (comp instanceof Comparator$1) {
1952
- if (comp.loose === !!options.loose) {
1953
- return comp
1954
- } else {
1955
- comp = comp.value;
1956
- }
1957
- }
1958
-
1959
- debug$1('comparator', comp, options);
1960
- this.options = options;
1961
- this.loose = !!options.loose;
1962
- this.parse(comp);
1963
-
1964
- if (this.semver === ANY) {
1965
- this.value = '';
1966
- } else {
1967
- this.value = this.operator + this.semver.version;
1968
- }
1969
-
1970
- debug$1('comp', this);
1971
- }
1972
-
1973
- parse (comp) {
1974
- const r = this.options.loose ? re$1[t$1.COMPARATORLOOSE] : re$1[t$1.COMPARATOR];
1975
- const m = comp.match(r);
1976
-
1977
- if (!m) {
1978
- throw new TypeError(`Invalid comparator: ${comp}`)
1979
- }
1980
-
1981
- this.operator = m[1] !== undefined ? m[1] : '';
1982
- if (this.operator === '=') {
1983
- this.operator = '';
1984
- }
1985
-
1986
- // if it literally is just '>' or '' then allow anything.
1987
- if (!m[2]) {
1988
- this.semver = ANY;
1989
- } else {
1990
- this.semver = new SemVer$1(m[2], this.options.loose);
1991
- }
1992
- }
1993
-
1994
- toString () {
1995
- return this.value
1996
- }
1997
-
1998
- test (version) {
1999
- debug$1('Comparator.test', version, this.options.loose);
2000
-
2001
- if (this.semver === ANY || version === ANY) {
2002
- return true
2003
- }
2004
-
2005
- if (typeof version === 'string') {
2006
- try {
2007
- version = new SemVer$1(version, this.options);
2008
- } catch (er) {
2009
- return false
2010
- }
2011
- }
2012
-
2013
- return cmp(version, this.operator, this.semver, this.options)
2014
- }
2015
-
2016
- intersects (comp, options) {
2017
- if (!(comp instanceof Comparator$1)) {
2018
- throw new TypeError('a Comparator is required')
2019
- }
2020
-
2021
- if (!options || typeof options !== 'object') {
2022
- options = {
2023
- loose: !!options,
2024
- includePrerelease: false,
2025
- };
2026
- }
2027
-
2028
- if (this.operator === '') {
2029
- if (this.value === '') {
2030
- return true
2031
- }
2032
- return new Range$2(comp.value, options).test(this.value)
2033
- } else if (comp.operator === '') {
2034
- if (comp.value === '') {
2035
- return true
2036
- }
2037
- return new Range$2(this.value, options).test(comp.semver)
2038
- }
2039
-
2040
- const sameDirectionIncreasing =
2041
- (this.operator === '>=' || this.operator === '>') &&
2042
- (comp.operator === '>=' || comp.operator === '>');
2043
- const sameDirectionDecreasing =
2044
- (this.operator === '<=' || this.operator === '<') &&
2045
- (comp.operator === '<=' || comp.operator === '<');
2046
- const sameSemVer = this.semver.version === comp.semver.version;
2047
- const differentDirectionsInclusive =
2048
- (this.operator === '>=' || this.operator === '<=') &&
2049
- (comp.operator === '>=' || comp.operator === '<=');
2050
- const oppositeDirectionsLessThan =
2051
- cmp(this.semver, '<', comp.semver, options) &&
2052
- (this.operator === '>=' || this.operator === '>') &&
2053
- (comp.operator === '<=' || comp.operator === '<');
2054
- const oppositeDirectionsGreaterThan =
2055
- cmp(this.semver, '>', comp.semver, options) &&
2056
- (this.operator === '<=' || this.operator === '<') &&
2057
- (comp.operator === '>=' || comp.operator === '>');
2058
-
2059
- return (
2060
- sameDirectionIncreasing ||
2061
- sameDirectionDecreasing ||
2062
- (sameSemVer && differentDirectionsInclusive) ||
2063
- oppositeDirectionsLessThan ||
2064
- oppositeDirectionsGreaterThan
2065
- )
2066
- }
2067
- }
2068
-
2069
- var comparator = Comparator$1;
2070
-
2071
- const parseOptions$1 = parseOptions_1;
2072
- const { re: re$1, t: t$1 } = re$5.exports;
2073
- const cmp = cmp_1;
2074
- const debug$1 = debug_1;
2075
- const SemVer$1 = semver;
2076
- const Range$2 = range;
2077
-
2078
- // hoisted class for cyclic dependency
2079
- class Range$1 {
2080
- constructor (range, options) {
2081
- options = parseOptions(options);
2082
-
2083
- if (range instanceof Range$1) {
2084
- if (
2085
- range.loose === !!options.loose &&
2086
- range.includePrerelease === !!options.includePrerelease
2087
- ) {
2088
- return range
2089
- } else {
2090
- return new Range$1(range.raw, options)
2091
- }
2092
- }
2093
-
2094
- if (range instanceof Comparator) {
2095
- // just put it in the set and return
2096
- this.raw = range.value;
2097
- this.set = [[range]];
2098
- this.format();
2099
- return this
2100
- }
2101
-
2102
- this.options = options;
2103
- this.loose = !!options.loose;
2104
- this.includePrerelease = !!options.includePrerelease;
2105
-
2106
- // First, split based on boolean or ||
2107
- this.raw = range;
2108
- this.set = range
2109
- .split('||')
2110
- // map the range to a 2d array of comparators
2111
- .map(r => this.parseRange(r.trim()))
2112
- // throw out any comparator lists that are empty
2113
- // this generally means that it was not a valid range, which is allowed
2114
- // in loose mode, but will still throw if the WHOLE range is invalid.
2115
- .filter(c => c.length);
2116
-
2117
- if (!this.set.length) {
2118
- throw new TypeError(`Invalid SemVer Range: ${range}`)
2119
- }
2120
-
2121
- // if we have any that are not the null set, throw out null sets.
2122
- if (this.set.length > 1) {
2123
- // keep the first one, in case they're all null sets
2124
- const first = this.set[0];
2125
- this.set = this.set.filter(c => !isNullSet(c[0]));
2126
- if (this.set.length === 0) {
2127
- this.set = [first];
2128
- } else if (this.set.length > 1) {
2129
- // if we have any that are *, then the range is just *
2130
- for (const c of this.set) {
2131
- if (c.length === 1 && isAny(c[0])) {
2132
- this.set = [c];
2133
- break
2134
- }
2135
- }
2136
- }
2137
- }
2138
-
2139
- this.format();
2140
- }
2141
-
2142
- format () {
2143
- this.range = this.set
2144
- .map((comps) => {
2145
- return comps.join(' ').trim()
2146
- })
2147
- .join('||')
2148
- .trim();
2149
- return this.range
2150
- }
2151
-
2152
- toString () {
2153
- return this.range
2154
- }
2155
-
2156
- parseRange (range) {
2157
- range = range.trim();
2158
-
2159
- // memoize range parsing for performance.
2160
- // this is a very hot path, and fully deterministic.
2161
- const memoOpts = Object.keys(this.options).join(',');
2162
- const memoKey = `parseRange:${memoOpts}:${range}`;
2163
- const cached = cache.get(memoKey);
2164
- if (cached) {
2165
- return cached
2166
- }
2167
-
2168
- const loose = this.options.loose;
2169
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
2170
- const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
2171
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
2172
- debug('hyphen replace', range);
2173
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
2174
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
2175
- debug('comparator trim', range);
2176
-
2177
- // `~ 1.2.3` => `~1.2.3`
2178
- range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
2179
-
2180
- // `^ 1.2.3` => `^1.2.3`
2181
- range = range.replace(re[t.CARETTRIM], caretTrimReplace);
2182
-
2183
- // normalize spaces
2184
- range = range.split(/\s+/).join(' ');
2185
-
2186
- // At this point, the range is completely trimmed and
2187
- // ready to be split into comparators.
2188
-
2189
- let rangeList = range
2190
- .split(' ')
2191
- .map(comp => parseComparator(comp, this.options))
2192
- .join(' ')
2193
- .split(/\s+/)
2194
- // >=0.0.0 is equivalent to *
2195
- .map(comp => replaceGTE0(comp, this.options));
2196
-
2197
- if (loose) {
2198
- // in loose mode, throw out any that are not valid comparators
2199
- rangeList = rangeList.filter(comp => {
2200
- debug('loose invalid filter', comp, this.options);
2201
- return !!comp.match(re[t.COMPARATORLOOSE])
2202
- });
2203
- }
2204
- debug('range list', rangeList);
2205
-
2206
- // if any comparators are the null set, then replace with JUST null set
2207
- // if more than one comparator, remove any * comparators
2208
- // also, don't include the same comparator more than once
2209
- const rangeMap = new Map();
2210
- const comparators = rangeList.map(comp => new Comparator(comp, this.options));
2211
- for (const comp of comparators) {
2212
- if (isNullSet(comp)) {
2213
- return [comp]
2214
- }
2215
- rangeMap.set(comp.value, comp);
2216
- }
2217
- if (rangeMap.size > 1 && rangeMap.has('')) {
2218
- rangeMap.delete('');
2219
- }
2220
-
2221
- const result = [...rangeMap.values()];
2222
- cache.set(memoKey, result);
2223
- return result
2224
- }
2225
-
2226
- intersects (range, options) {
2227
- if (!(range instanceof Range$1)) {
2228
- throw new TypeError('a Range is required')
2229
- }
2230
-
2231
- return this.set.some((thisComparators) => {
2232
- return (
2233
- isSatisfiable(thisComparators, options) &&
2234
- range.set.some((rangeComparators) => {
2235
- return (
2236
- isSatisfiable(rangeComparators, options) &&
2237
- thisComparators.every((thisComparator) => {
2238
- return rangeComparators.every((rangeComparator) => {
2239
- return thisComparator.intersects(rangeComparator, options)
2240
- })
2241
- })
2242
- )
2243
- })
2244
- )
2245
- })
2246
- }
2247
-
2248
- // if ANY of the sets match ALL of its comparators, then pass
2249
- test (version) {
2250
- if (!version) {
2251
- return false
2252
- }
2253
-
2254
- if (typeof version === 'string') {
2255
- try {
2256
- version = new SemVer(version, this.options);
2257
- } catch (er) {
2258
- return false
2259
- }
2260
- }
2261
-
2262
- for (let i = 0; i < this.set.length; i++) {
2263
- if (testSet(this.set[i], version, this.options)) {
2264
- return true
2265
- }
2266
- }
2267
- return false
2268
- }
2269
- }
2270
- var range = Range$1;
2271
-
2272
- const LRU = lruCache;
2273
- const cache = new LRU({ max: 1000 });
2274
-
2275
- const parseOptions = parseOptions_1;
2276
- const Comparator = comparator;
2277
- const debug = debug_1;
2278
- const SemVer = semver;
2279
- const {
2280
- re,
2281
- t,
2282
- comparatorTrimReplace,
2283
- tildeTrimReplace,
2284
- caretTrimReplace,
2285
- } = re$5.exports;
2286
-
2287
- const isNullSet = c => c.value === '<0.0.0-0';
2288
- const isAny = c => c.value === '';
2289
-
2290
- // take a set of comparators and determine whether there
2291
- // exists a version which can satisfy it
2292
- const isSatisfiable = (comparators, options) => {
2293
- let result = true;
2294
- const remainingComparators = comparators.slice();
2295
- let testComparator = remainingComparators.pop();
2296
-
2297
- while (result && remainingComparators.length) {
2298
- result = remainingComparators.every((otherComparator) => {
2299
- return testComparator.intersects(otherComparator, options)
2300
- });
2301
-
2302
- testComparator = remainingComparators.pop();
2303
- }
2304
-
2305
- return result
2306
- };
2307
-
2308
- // comprised of xranges, tildes, stars, and gtlt's at this point.
2309
- // already replaced the hyphen ranges
2310
- // turn into a set of JUST comparators.
2311
- const parseComparator = (comp, options) => {
2312
- debug('comp', comp, options);
2313
- comp = replaceCarets(comp, options);
2314
- debug('caret', comp);
2315
- comp = replaceTildes(comp, options);
2316
- debug('tildes', comp);
2317
- comp = replaceXRanges(comp, options);
2318
- debug('xrange', comp);
2319
- comp = replaceStars(comp, options);
2320
- debug('stars', comp);
2321
- return comp
2322
- };
2323
-
2324
- const isX = id => !id || id.toLowerCase() === 'x' || id === '*';
2325
-
2326
- // ~, ~> --> * (any, kinda silly)
2327
- // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
2328
- // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
2329
- // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
2330
- // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
2331
- // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
2332
- // ~0.0.1 --> >=0.0.1 <0.1.0-0
2333
- const replaceTildes = (comp, options) =>
2334
- comp.trim().split(/\s+/).map((c) => {
2335
- return replaceTilde(c, options)
2336
- }).join(' ');
2337
-
2338
- const replaceTilde = (comp, options) => {
2339
- const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
2340
- return comp.replace(r, (_, M, m, p, pr) => {
2341
- debug('tilde', comp, _, M, m, p, pr);
2342
- let ret;
2343
-
2344
- if (isX(M)) {
2345
- ret = '';
2346
- } else if (isX(m)) {
2347
- ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
2348
- } else if (isX(p)) {
2349
- // ~1.2 == >=1.2.0 <1.3.0-0
2350
- ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
2351
- } else if (pr) {
2352
- debug('replaceTilde pr', pr);
2353
- ret = `>=${M}.${m}.${p}-${pr
2354
- } <${M}.${+m + 1}.0-0`;
2355
- } else {
2356
- // ~1.2.3 == >=1.2.3 <1.3.0-0
2357
- ret = `>=${M}.${m}.${p
2358
- } <${M}.${+m + 1}.0-0`;
2359
- }
2360
-
2361
- debug('tilde return', ret);
2362
- return ret
2363
- })
2364
- };
2365
-
2366
- // ^ --> * (any, kinda silly)
2367
- // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
2368
- // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
2369
- // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
2370
- // ^1.2.3 --> >=1.2.3 <2.0.0-0
2371
- // ^1.2.0 --> >=1.2.0 <2.0.0-0
2372
- // ^0.0.1 --> >=0.0.1 <0.0.2-0
2373
- // ^0.1.0 --> >=0.1.0 <0.2.0-0
2374
- const replaceCarets = (comp, options) =>
2375
- comp.trim().split(/\s+/).map((c) => {
2376
- return replaceCaret(c, options)
2377
- }).join(' ');
2378
-
2379
- const replaceCaret = (comp, options) => {
2380
- debug('caret', comp, options);
2381
- const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
2382
- const z = options.includePrerelease ? '-0' : '';
2383
- return comp.replace(r, (_, M, m, p, pr) => {
2384
- debug('caret', comp, _, M, m, p, pr);
2385
- let ret;
2386
-
2387
- if (isX(M)) {
2388
- ret = '';
2389
- } else if (isX(m)) {
2390
- ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
2391
- } else if (isX(p)) {
2392
- if (M === '0') {
2393
- ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
2394
- } else {
2395
- ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
2396
- }
2397
- } else if (pr) {
2398
- debug('replaceCaret pr', pr);
2399
- if (M === '0') {
2400
- if (m === '0') {
2401
- ret = `>=${M}.${m}.${p}-${pr
2402
- } <${M}.${m}.${+p + 1}-0`;
2403
- } else {
2404
- ret = `>=${M}.${m}.${p}-${pr
2405
- } <${M}.${+m + 1}.0-0`;
2406
- }
2407
- } else {
2408
- ret = `>=${M}.${m}.${p}-${pr
2409
- } <${+M + 1}.0.0-0`;
2410
- }
2411
- } else {
2412
- debug('no pr');
2413
- if (M === '0') {
2414
- if (m === '0') {
2415
- ret = `>=${M}.${m}.${p
2416
- }${z} <${M}.${m}.${+p + 1}-0`;
2417
- } else {
2418
- ret = `>=${M}.${m}.${p
2419
- }${z} <${M}.${+m + 1}.0-0`;
2420
- }
2421
- } else {
2422
- ret = `>=${M}.${m}.${p
2423
- } <${+M + 1}.0.0-0`;
2424
- }
2425
- }
2426
-
2427
- debug('caret return', ret);
2428
- return ret
2429
- })
2430
- };
2431
-
2432
- const replaceXRanges = (comp, options) => {
2433
- debug('replaceXRanges', comp, options);
2434
- return comp.split(/\s+/).map((c) => {
2435
- return replaceXRange(c, options)
2436
- }).join(' ')
2437
- };
2438
-
2439
- const replaceXRange = (comp, options) => {
2440
- comp = comp.trim();
2441
- const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2442
- return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2443
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
2444
- const xM = isX(M);
2445
- const xm = xM || isX(m);
2446
- const xp = xm || isX(p);
2447
- const anyX = xp;
2448
-
2449
- if (gtlt === '=' && anyX) {
2450
- gtlt = '';
2451
- }
2452
-
2453
- // if we're including prereleases in the match, then we need
2454
- // to fix this to -0, the lowest possible prerelease value
2455
- pr = options.includePrerelease ? '-0' : '';
2456
-
2457
- if (xM) {
2458
- if (gtlt === '>' || gtlt === '<') {
2459
- // nothing is allowed
2460
- ret = '<0.0.0-0';
2461
- } else {
2462
- // nothing is forbidden
2463
- ret = '*';
2464
- }
2465
- } else if (gtlt && anyX) {
2466
- // we know patch is an x, because we have any x at all.
2467
- // replace X with 0
2468
- if (xm) {
2469
- m = 0;
2470
- }
2471
- p = 0;
2472
-
2473
- if (gtlt === '>') {
2474
- // >1 => >=2.0.0
2475
- // >1.2 => >=1.3.0
2476
- gtlt = '>=';
2477
- if (xm) {
2478
- M = +M + 1;
2479
- m = 0;
2480
- p = 0;
2481
- } else {
2482
- m = +m + 1;
2483
- p = 0;
2484
- }
2485
- } else if (gtlt === '<=') {
2486
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
2487
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
2488
- gtlt = '<';
2489
- if (xm) {
2490
- M = +M + 1;
2491
- } else {
2492
- m = +m + 1;
2493
- }
2494
- }
2495
-
2496
- if (gtlt === '<') {
2497
- pr = '-0';
2498
- }
2499
-
2500
- ret = `${gtlt + M}.${m}.${p}${pr}`;
2501
- } else if (xm) {
2502
- ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
2503
- } else if (xp) {
2504
- ret = `>=${M}.${m}.0${pr
2505
- } <${M}.${+m + 1}.0-0`;
2506
- }
2507
-
2508
- debug('xRange return', ret);
2509
-
2510
- return ret
2511
- })
2512
- };
2513
-
2514
- // Because * is AND-ed with everything else in the comparator,
2515
- // and '' means "any version", just remove the *s entirely.
2516
- const replaceStars = (comp, options) => {
2517
- debug('replaceStars', comp, options);
2518
- // Looseness is ignored here. star is always as loose as it gets!
2519
- return comp.trim().replace(re[t.STAR], '')
2520
- };
2521
-
2522
- const replaceGTE0 = (comp, options) => {
2523
- debug('replaceGTE0', comp, options);
2524
- return comp.trim()
2525
- .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
2526
- };
2527
-
2528
- // This function is passed to string.replace(re[t.HYPHENRANGE])
2529
- // M, m, patch, prerelease, build
2530
- // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
2531
- // 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
2532
- // 1.2 - 3.4 => >=1.2.0 <3.5.0-0
2533
- const hyphenReplace = incPr => ($0,
2534
- from, fM, fm, fp, fpr, fb,
2535
- to, tM, tm, tp, tpr, tb) => {
2536
- if (isX(fM)) {
2537
- from = '';
2538
- } else if (isX(fm)) {
2539
- from = `>=${fM}.0.0${incPr ? '-0' : ''}`;
2540
- } else if (isX(fp)) {
2541
- from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`;
2542
- } else if (fpr) {
2543
- from = `>=${from}`;
2544
- } else {
2545
- from = `>=${from}${incPr ? '-0' : ''}`;
2546
- }
2547
-
2548
- if (isX(tM)) {
2549
- to = '';
2550
- } else if (isX(tm)) {
2551
- to = `<${+tM + 1}.0.0-0`;
2552
- } else if (isX(tp)) {
2553
- to = `<${tM}.${+tm + 1}.0-0`;
2554
- } else if (tpr) {
2555
- to = `<=${tM}.${tm}.${tp}-${tpr}`;
2556
- } else if (incPr) {
2557
- to = `<${tM}.${tm}.${+tp + 1}-0`;
2558
- } else {
2559
- to = `<=${to}`;
2560
- }
2561
-
2562
- return (`${from} ${to}`).trim()
2563
- };
2564
-
2565
- const testSet = (set, version, options) => {
2566
- for (let i = 0; i < set.length; i++) {
2567
- if (!set[i].test(version)) {
2568
- return false
2569
- }
2570
- }
2571
-
2572
- if (version.prerelease.length && !options.includePrerelease) {
2573
- // Find the set of versions that are allowed to have prereleases
2574
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
2575
- // That should allow `1.2.3-pr.2` to pass.
2576
- // However, `1.2.4-alpha.notready` should NOT be allowed,
2577
- // even though it's within the range set by the comparators.
2578
- for (let i = 0; i < set.length; i++) {
2579
- debug(set[i].semver);
2580
- if (set[i].semver === Comparator.ANY) {
2581
- continue
2582
- }
2583
-
2584
- if (set[i].semver.prerelease.length > 0) {
2585
- const allowed = set[i].semver;
2586
- if (allowed.major === version.major &&
2587
- allowed.minor === version.minor &&
2588
- allowed.patch === version.patch) {
2589
- return true
2590
- }
2591
- }
2592
- }
2593
-
2594
- // Version has a -pre, but it's not one of the ones we like.
2595
- return false
2596
- }
2597
-
2598
- return true
2599
- };
2600
-
2601
- const Range = range;
2602
- const satisfies = (version, range, options) => {
2603
- try {
2604
- range = new Range(range, options);
2605
- } catch (er) {
2606
- return false
2607
- }
2608
- return range.test(version)
2609
- };
2610
- var satisfies_1 = satisfies;
2611
-
2612
- function checkVersion(threshold, version) {
2613
- if (!version)
2614
- return false;
2615
- const parsedVersion = coerce_1(version);
2616
- if (parsedVersion === null)
2617
- return false;
2618
- return satisfies_1(parsedVersion, threshold);
2619
- }
2620
-
2621
- function findArgument(args, name) {
2622
- const flagIndex = args.indexOf(`--${name}`);
2623
- if (flagIndex === -1)
2624
- return;
2625
- if (args.length < flagIndex + 2)
2626
- return;
2627
- const flagValue = args[flagIndex + 1];
2628
- if (flagValue.startsWith("--"))
2629
- return;
2630
- return flagValue;
2631
- }
2632
- function findFlag(args, name) {
2633
- const toFind = `--${name}`;
2634
- return args.includes(toFind);
2635
- }
2636
- const execCommand = util__default["default"].promisify(child_process.exec);
2637
- function getApplicationMode(argumentValue) {
2638
- switch (argumentValue) {
2639
- case client.ApplicationMode.PROD:
2640
- case client.ApplicationMode.STAGE:
2641
- case client.ApplicationMode.DEV:
2642
- return argumentValue;
2643
- default:
2644
- return null;
2645
- }
2646
- }
2647
-
2648
- const {
2649
- PRISMIC_CLIENT,
2650
- PRISMIC_DOM_PACKAGE_NAME,
2651
- PRISMIC_REACT_PACKAGE_NAME,
2652
- PRISMIC_NEXT,
2653
- SM_PACKAGE_NAME,
2654
- NUXT_PRISMIC,
2655
- PRISMIC_VUE,
2656
- SLICE_SIMULATOR_REACT,
2657
- SLICE_SIMULATOR_VUE,
2658
- PRISMIC_HELPERS,
2659
- PRISMIC_TYPES
2660
- } = core.CONSTS;
2661
- function nextDeps(version) {
2662
- if (checkVersion(">=13.0.0", version)) {
2663
- return PRISMIC_NEXT;
2664
- }
2665
- return "";
2666
- }
2667
- function depsForFramework(framework, version) {
2668
- switch (framework) {
2669
- case core.Models.Frameworks.react:
2670
- return `${PRISMIC_REACT_PACKAGE_NAME} ${PRISMIC_CLIENT} ${PRISMIC_HELPERS}`;
2671
- case core.Models.Frameworks.next:
2672
- return `${PRISMIC_REACT_PACKAGE_NAME} ${nextDeps(version)} ${PRISMIC_CLIENT} ${SLICE_SIMULATOR_REACT} ${PRISMIC_HELPERS}`;
2673
- case core.Models.Frameworks.svelte:
2674
- return `${PRISMIC_DOM_PACKAGE_NAME} ${PRISMIC_CLIENT}`;
2675
- case core.Models.Frameworks.nuxt:
2676
- return `${NUXT_PRISMIC} ${SLICE_SIMULATOR_VUE}`;
2677
- case core.Models.Frameworks.vue:
2678
- return `${PRISMIC_VUE} ${PRISMIC_CLIENT} ${PRISMIC_DOM_PACKAGE_NAME}`;
2679
- default:
2680
- return "";
2681
- }
2682
- }
2683
- async function addAndInstallDeps(framework, version, useYarn = false) {
2684
- const installDevDependencyCommand = useYarn ? "yarn add -D" : "npm install --save-dev";
2685
- const installDependencyCommand = useYarn ? "yarn add" : "npm install --save";
2686
- const { stderr } = await execCommand(`${installDevDependencyCommand} ${SM_PACKAGE_NAME} ${PRISMIC_TYPES}`);
2687
- const deps = depsForFramework(framework, version);
2688
- if (deps)
2689
- await execCommand(`${installDependencyCommand} ${deps}`);
2690
- return stderr;
2691
- }
2692
- async function installDeps(useYarn = false) {
2693
- const installCommand = useYarn ? "yarn" : "npm install";
2694
- const { stderr } = await execCommand(installCommand);
2695
- return stderr;
2696
- }
2697
- async function installRequiredDependencies(cwd, framework, skipDependencies, version) {
2698
- const yarnLock = NodeUtils__namespace.Files.exists(NodeUtils__namespace.YarnLockPath(cwd));
2699
- const spinner = spinner$1("Installing Slice Machine");
2700
- spinner.start();
2701
- const stderr = await (skipDependencies ? installDeps(yarnLock) : addAndInstallDeps(framework, version, yarnLock));
2702
- const pathToPkg = path__default["default"].join(NodeUtils__namespace.PackagePaths(cwd).value(), SM_PACKAGE_NAME);
2703
- const isPackageInstalled = NodeUtils__namespace.Files.exists(pathToPkg);
2704
- if (isPackageInstalled || !stderr.length) {
2705
- spinner.succeed("Slice Machine was installed successfully");
2706
- return;
2707
- }
2708
- spinner.fail();
2709
- writeWarning(`could not install ${SM_PACKAGE_NAME}. Please do it manually!`);
2710
- }
2711
-
2712
- function validatePkg(cwd) {
2713
- const jsonPackage = NodeUtils__namespace.retrieveJsonPackage(cwd);
2714
- if (!jsonPackage.exists) {
2715
- writeError$1(`package.json not found. Are you in the right folder?`);
2716
- return process.exit(-1);
2717
- }
2718
- if (!jsonPackage.content) {
2719
- writeError$1(`could not parse package.json.`);
2720
- return process.exit(-1);
2721
- }
2722
- }
2723
-
2724
- function createRepository(client, domain, framework) {
2725
- const spinner = spinner$1("Creating Prismic Repository");
2726
- spinner.start();
2727
- return client.createRepository(domain, framework).then((domain2) => {
2728
- const addressUrl = new URL(client.apisEndpoints.Wroom);
2729
- addressUrl.hostname = `${domain2}.${addressUrl.hostname}`;
2730
- const address = addressUrl.toString();
2731
- spinner.succeed(`We created your new repository ${address}`);
2732
- return domain2;
2733
- }).catch(async (error) => {
2734
- spinner.fail(`Error creating repository ${domain}`);
2735
- await Tracker.get().trackInitEndFail(framework, "Failed to create repository");
2736
- if (error.message) {
2737
- writeError$1(error.message);
2738
- }
2739
- writeError$1(`We failed to create you new prismic repository`);
2740
- console.log(`Run ${bold$1("npx @slicemachine/init")} again!`);
2741
- process.exit(-1);
2742
- });
2743
- }
2744
-
2745
- async function validateRepositoryName(client, name) {
2746
- const domain = name.trim();
2747
- const errors = [];
2748
- const startsWithLetter = /^[a-zA-Z]/.test(domain);
2749
- if (!startsWithLetter)
2750
- errors.push("Must start with a letter.");
2751
- const acceptedChars = /^[a-z0-9-]+$/.test(domain);
2752
- if (!acceptedChars)
2753
- errors.push("Must contain only lowercase letters, numbers and hyphens.");
2754
- const fourCharactersOrMore = domain.length >= 4;
2755
- if (!fourCharactersOrMore)
2756
- errors.push("Must have four or more alphanumeric characters and/or hyphens.");
2757
- const endsWithALetterOrNumber = /[a-z0-9]$/.test(domain);
2758
- if (!endsWithALetterOrNumber)
2759
- errors.push("Must end in a letter or a number.");
2760
- const thirtyCharacterOrLess = domain.length <= 30;
2761
- if (!thirtyCharacterOrLess)
2762
- errors.push("Must be 30 characters or less");
2763
- if (errors.length > 0) {
2764
- const errorString = errors.map((d, i) => `(${i + 1}: ${d}`).join(" ");
2765
- const msg = `Validation errors: ${errorString}`;
2766
- return Promise.reject(new Error(msg));
2767
- }
2768
- return client.domainExist(domain).then((isAvailable) => isAvailable ? true : Promise.reject(new Error(`${name} is already in use`))).catch(() => Promise.reject(new Error(`${name} is already in use`)));
2769
- }
2770
-
2771
- const CREATE_REPO = "$_CREATE_REPO";
2772
- function prettyRepoName(address, domain) {
2773
- return `${cyan.dim(`${address.protocol}//`)}${cyan(domain)}${cyan.dim(`.${address.hostname}`)}`;
2774
- }
2775
- async function promptForRepoDomain(client, defaultValue) {
2776
- const address = new URL(client.apisEndpoints.Wroom);
2777
- writeInfo("The name acts as a domain/endpoint for your content repo and should be completely unique.");
2778
- return inquirer__namespace.prompt([
2779
- {
2780
- name: "repoDomain",
2781
- message: "Name your Prismic repository",
2782
- type: "input",
2783
- required: true,
2784
- default: defaultValue,
2785
- transformer: (value) => prettyRepoName(address, value || defaultValue || "repository"),
2786
- validate: (name) => validateRepositoryName(client, name)
2787
- }
2788
- ]).then((res) => res.repoDomain);
2789
- }
2790
- function makeReposPretty(base) {
2791
- return function({ name, domain, role }) {
2792
- const address = new URL(base);
2793
- address.hostname = `${domain}.${address.hostname}`;
2794
- if (core.Models.canUpdateCustomTypes(role) === false) {
2795
- return {
2796
- name: `${purple.dim("Use")} ${bold$1.dim(name)} ${purple.dim(`"${address.hostname}"`)}`,
2797
- value: domain,
2798
- disabled: "Unauthorized"
2799
- };
2800
- }
2801
- return {
2802
- name: `${purple("Use")} ${bold$1(name)} ${purple(`"${address.hostname}"`)}`,
2803
- value: domain
2804
- };
2805
- };
2806
- }
2807
- function orderPrompts(maybeName) {
2808
- return (a, b) => {
2809
- if (a instanceof Separator__default["default"] || b instanceof Separator__default["default"])
2810
- return 0;
2811
- if (maybeName && (a.value === maybeName || b.value === maybeName))
2812
- return 0;
2813
- if (a.value === CREATE_REPO || b.value === CREATE_REPO)
2814
- return 0;
2815
- if (a.disabled && !b.disabled)
2816
- return 1;
2817
- if (!a.disabled && b.disabled)
2818
- return -1;
2819
- return 0;
2820
- };
2821
- }
2822
- function maybeStickTheRepoToTheTopOfTheList(repoName) {
2823
- return (acc, curr) => {
2824
- if (repoName && curr.value === repoName) {
2825
- return [curr, ...acc];
2826
- }
2827
- return [...acc, curr];
2828
- };
2829
- }
2830
- function sortReposForPrompt(repos, base, cwd) {
2831
- const createNew = {
2832
- name: `${purple("Create a")} ${bold$1("new")} ${purple("Repository")}`,
2833
- value: CREATE_REPO
2834
- };
2835
- const maybeConfiguredRepoName = NodeUtils__namespace.maybeRepoNameFromSMFile(cwd, base);
2836
- return repos.reverse().map(makeReposPretty(base)).reduce(maybeStickTheRepoToTheTopOfTheList(maybeConfiguredRepoName), [
2837
- createNew
2838
- ]).sort(orderPrompts(maybeConfiguredRepoName));
2839
- }
2840
- async function chooseOrCreateARepository(client, cwd, framework, preSelectedRepository) {
2841
- const repositories = await client.listRepositories();
2842
- const isPreSelectedValid = preSelectedRepository && repositories.find((repository) => repository.domain === preSelectedRepository);
2843
- if (isPreSelectedValid)
2844
- return preSelectedRepository;
2845
- if (repositories.length === 0) {
2846
- const domainName = await promptForRepoDomain(client, preSelectedRepository);
2847
- await createRepository(client, domainName, framework);
2848
- return domainName;
2849
- }
2850
- const choices = sortReposForPrompt(repositories, client.apisEndpoints.Wroom, cwd);
2851
- const numberOfDisabledRepos = choices.filter((repo) => {
2852
- if (repo instanceof Separator__default["default"])
2853
- return false;
2854
- return repo.disabled;
2855
- }).length;
2856
- const promptResult = await inquirer__namespace.prompt([
2857
- {
2858
- type: "list",
2859
- name: "chosenRepository",
2860
- default: 0,
2861
- required: true,
2862
- message: "Connect a Prismic Repository or create a new one",
2863
- choices,
2864
- pageSize: numberOfDisabledRepos + 2 <= 7 ? 7 : numberOfDisabledRepos + 2
2865
- }
2866
- ]);
2867
- if (promptResult.chosenRepository === CREATE_REPO) {
2868
- const domainName = await promptForRepoDomain(client, preSelectedRepository);
2869
- await createRepository(client, domainName, framework);
2870
- return domainName;
2871
- }
2872
- return promptResult.chosenRepository;
2873
- }
2874
-
2875
- async function promptForFramework() {
2876
- const choices = core.Models.SupportedFrameworks.map((framework) => {
2877
- return {
2878
- name: NodeUtils__namespace.Framework.fancyName(framework),
2879
- value: framework
2880
- };
2881
- });
2882
- return inquirer__namespace.prompt([
2883
- {
2884
- name: "framework",
2885
- type: "list",
2886
- message: "Select a framework to use",
2887
- required: true,
2888
- choices
2889
- }
2890
- ]).then((res) => {
2891
- return {
2892
- value: res.framework,
2893
- manuallyAdded: true,
2894
- version: void 0
2895
- };
2896
- });
2897
- }
2898
- async function detectFramework(cwd) {
2899
- const failMessage = `Please run ${bold$1("npx @slicemachine/init")} in a Nuxt or Next.js project`;
2900
- const spinner = spinner$1("Detecting framework to install correct dependencies");
2901
- spinner.start();
2902
- try {
2903
- const { framework, version } = NodeUtils__namespace.Framework.defineFrameworkWithVersion({
2904
- cwd,
2905
- supportedFrameworks: Object.values(core.Models.Frameworks)
2906
- });
2907
- spinner.stop();
2908
- if (!framework || framework === core.Models.Frameworks.vanillajs) {
2909
- writeError$1("Framework not detected");
2910
- return await promptForFramework();
2911
- }
2912
- const nameToPrint = NodeUtils__namespace.Framework.fancyName(framework);
2913
- if (!NodeUtils__namespace.Framework.isFrameworkSupported(framework)) {
2914
- writeError$1(`${nameToPrint} is currently not supported`);
2915
- console.log(failMessage);
2916
- process.exit(1);
2917
- }
2918
- writeCheck(`${nameToPrint} detected`);
2919
- return {
2920
- value: framework,
2921
- manuallyAdded: false,
2922
- version
2923
- };
2924
- } catch (error) {
2925
- spinner.fail("package.json not found");
2926
- if (error instanceof Error && error.message) {
2927
- writeError$1(error.message);
2928
- } else {
2929
- console.log(failMessage);
2930
- }
2931
- await Tracker.get().trackInitEndFail(core.Models.Frameworks.none, "Framework not detected");
2932
- process.exit(1);
2933
- }
2934
- }
2935
-
2936
- async function loginOrBypass(client) {
2937
- const user = await client.profile().catch(() => null);
2938
- if (user) {
2939
- const email = user.email;
2940
- writeCheck(`Logged in as ${bold$1(email)}`);
2941
- return user;
2942
- }
2943
- await Auth.login(client);
2944
- client.updateAuthenticationToken(Prismic.PrismicSharedConfigManager.getAuth());
2945
- const userAfterLogin = await client.profile();
2946
- return userAfterLogin;
2947
- }
2948
-
2949
- async function configureProject(client, cwd, repositoryDomainName, framework, sliceLibPath = [], tracking = true) {
2950
- const frameworkName = NodeUtils__namespace.Framework.fancyName(framework.value);
2951
- const spinner = spinner$1(`Configuring your ${frameworkName} and Prismic project...`);
2952
- spinner.start();
2953
- try {
2954
- const manifest = NodeUtils__namespace.retrieveManifest(cwd);
2955
- const manifestAlreadyExistWithContent = manifest.exists && manifest.content;
2956
- const libs = manifest.content && manifest.content.libraries && manifest.content.libraries.length > 0 ? manifest.content.libraries : ["@/slices"];
2957
- const manifestUpdated = {
2958
- ...manifestAlreadyExistWithContent ? manifest.content : {},
2959
- apiEndpoint: Prismic__namespace.Endpoints.buildRepositoryEndpoint(client.apisEndpoints.Wroom, repositoryDomainName),
2960
- libraries: [...libs, ...sliceLibPath],
2961
- ...framework.manuallyAdded ? { framework: framework.value } : {},
2962
- ...!tracking ? { tracking } : {}
2963
- };
2964
- if (!manifest.exists)
2965
- NodeUtils__namespace.createManifest(cwd, manifestUpdated);
2966
- else
2967
- NodeUtils__namespace.patchManifest(cwd, manifestUpdated);
2968
- const pathToSlicesFolder = NodeUtils__namespace.CustomPaths(cwd).library("slices").value();
2969
- if (!NodeUtils__namespace.Files.exists(pathToSlicesFolder) && libs.includes("@/slices")) {
2970
- NodeUtils__namespace.Files.mkdir(pathToSlicesFolder, { recursive: true });
2971
- }
2972
- NodeUtils__namespace.addJsonPackageSmScript(cwd);
2973
- await Tracker.get().trackInitEndSuccess(framework.value);
2974
- spinner.succeed("Project configured! Ready to start");
2975
- } catch (error) {
2976
- await Tracker.get().trackInitEndFail(framework.value, "Failed to configure Slice Machine");
2977
- spinner.fail("Failed to configure Slice Machine");
2978
- process.exit(-1);
2979
- }
2980
- }
2981
-
2982
- function displayFinalMessage(cwd, wasStarter, reponame, base) {
2983
- const yarnLock = NodeUtils__namespace.Files.exists(NodeUtils__namespace.YarnLockPath(cwd));
2984
- const command = `${yarnLock ? "yarn" : "npm"} run ${core.CONSTS.SCRIPT_NAME}`;
2985
- console.log();
2986
- if (wasStarter) {
2987
- const repoUrl = new URL(base);
2988
- repoUrl.hostname = `${reponame}.${repoUrl.hostname}`;
2989
- const urlAsString = repoUrl.toString();
2990
- const message = `${white("\u25A0")} Start editing your content in Prismic ${purple(urlAsString)}`;
2991
- console.log(message);
2992
- } else {
2993
- console.log(`${white("\u25A0")} Run ${purple(command)} to launch Slice Machine and create your first Custom Type`);
2994
- }
2995
- }
2996
-
2997
- const Dependencies = {
2998
- fromPkgFormat(pkgDeps) {
2999
- if (!pkgDeps)
3000
- return;
3001
- return Object.entries(pkgDeps).map(([name, version]) => ({
3002
- name,
3003
- version
3004
- }));
3005
- }
3006
- };
3007
- function formatDeps(dependencies) {
3008
- return dependencies.map((dep) => {
3009
- if (typeof dep === "string")
3010
- return dep;
3011
- return `${dep.name}@${dep.version}`;
3012
- }).join(" ");
3013
- }
3014
- const PackageManager = {
3015
- get(cwd) {
3016
- if (NodeUtils__namespace.Files.exists(NodeUtils__namespace.YarnLockPath(cwd))) {
3017
- return Yarn;
3018
- }
3019
- return Npm;
3020
- }
3021
- };
3022
- const Yarn = {
3023
- install(dependencies) {
3024
- return execCommand(`yarn add ${formatDeps(dependencies)}`);
3025
- },
3026
- installDev(dependencies) {
3027
- return execCommand(`yarn add --dev ${formatDeps(dependencies)}`);
3028
- }
3029
- };
3030
- const Npm = {
3031
- install(dependencies) {
3032
- return execCommand(`npm i --save ${formatDeps(dependencies)}`);
3033
- },
3034
- installDev(dependencies) {
3035
- return execCommand(`npm i --save-dev ${formatDeps(dependencies)}`);
3036
- }
3037
- };
3038
-
3039
- const { PackageJsonHelper } = NodeUtils__namespace;
3040
- const downloadFile = async (reqUrl) => {
3041
- const res = await axios__default["default"].get(reqUrl, { responseType: "arraybuffer" });
3042
- return new Promise((resolve, reject) => {
3043
- if (res.status == 200) {
3044
- const tmpZipFile = tmp__default["default"].tmpNameSync();
3045
- const zip = new AdmZip__default["default"](res.data);
3046
- zip.extractAllTo(tmpZipFile);
3047
- resolve(tmpZipFile);
3048
- } else {
3049
- reject();
3050
- }
3051
- });
3052
- };
3053
- function toGithubSource(githubPath, branch) {
3054
- return `https://codeload.github.com/${githubPath}/zip/${branch}`;
3055
- }
3056
- async function installLib(cwd, libGithubPath, branch = "HEAD") {
3057
- const spinner = spinner$1(`Installing the ${libGithubPath} lib in your project...`);
3058
- try {
3059
- spinner.start();
3060
- const [githubUserName, githubProjectName] = libGithubPath.split("/");
3061
- const source = toGithubSource(libGithubPath, branch);
3062
- const zipFilePath = await downloadFile(source);
3063
- const outputFolder = `${githubProjectName}-${branch}`;
3064
- const projectPath = path__default["default"].join(zipFilePath, outputFolder);
3065
- const name = `${githubUserName}-${githubProjectName}`;
3066
- const libDestinationFolder = path__default["default"].join(cwd, name);
3067
- if (fs__default["default"].existsSync(libDestinationFolder)) {
3068
- spinner.succeed(`Lib "${libGithubPath}" was already installed (skipped)`);
3069
- return;
3070
- }
3071
- fsExtra__default["default"].moveSync(path__default["default"].join(projectPath, "src"), libDestinationFolder);
3072
- const pkgManager = PackageManager.get(cwd);
3073
- const pkgJson = PackageJsonHelper.fromPath(path__default["default"].join(projectPath, "package.json"));
3074
- if (pkgJson instanceof Error)
3075
- throw pkgJson;
3076
- const dependencies = Dependencies.fromPkgFormat(pkgJson.dependencies);
3077
- if (dependencies)
3078
- await pkgManager.install(dependencies);
3079
- NodeUtils__namespace.Files.write(path__default["default"].join(libDestinationFolder, "meta.json"), {
3080
- name: pkgJson.name
3081
- });
3082
- const manifest = NodeUtils__namespace.Files.readEntity(path__default["default"].join(projectPath, "sm.json"), (payload) => {
3083
- return Either.getOrElseW(() => new Error(`Unable to parse sm.json from lib ${libGithubPath}`))(core.Models.Manifest.decode(payload));
3084
- });
3085
- if (manifest instanceof Error)
3086
- throw manifest;
3087
- const localLibs = core.Models.ManifestHelper.localLibraries(manifest).map(({ path: path2 }) => {
3088
- return `~/${name}/${path2.replace("src/", "")}`;
3089
- });
3090
- spinner.succeed(`Slice library "${libGithubPath}" was installed successfully`);
3091
- void Tracker.get().trackDownloadLibrary(libGithubPath);
3092
- return localLibs;
3093
- } catch (error) {
3094
- spinner.fail(`Error installing ${libGithubPath} lib!`);
3095
- if (error instanceof Error) {
3096
- console.error(error.message);
3097
- }
3098
- await Tracker.get().trackInitEndFail(core.Models.Frameworks.none, "Failed to install ${libGithubPath} library");
3099
- process.exit(-1);
3100
- }
3101
- }
3102
-
3103
- async function promptToPushSlices() {
3104
- return inquirer__default["default"].prompt([
3105
- {
3106
- type: "confirm",
3107
- name: "pushSlices",
3108
- default: false,
3109
- message: "Your repository already contains Slices. Do you want to continue pushing your local Slices?"
3110
- }
3111
- ]).then((res) => res.pushSlices);
3112
- }
3113
- async function promptToPushCustomTypes() {
3114
- return inquirer__default["default"].prompt([
3115
- {
3116
- type: "confirm",
3117
- name: "pushCustomTypes",
3118
- default: false,
3119
- message: "Your repository already contains Custom Types. Do you want to continue pushing your local Custom Types?"
3120
- }
3121
- ]).then((res) => res.pushCustomTypes);
3122
- }
3123
-
3124
- async function updateVariationWithScreenshot(client, acl, screenshots, sliceId, variation) {
3125
- const screenshot = screenshots[variation.id];
3126
- if (!screenshot || !screenshot.path)
3127
- return Promise.resolve(variation);
3128
- return client.uploadScreenshot({
3129
- acl,
3130
- sliceId,
3131
- variationId: variation.id,
3132
- filePath: screenshot.path
3133
- }).then((screenshotUrl) => {
3134
- return {
3135
- ...variation,
3136
- imageUrl: screenshotUrl
3137
- };
3138
- }).catch((error) => {
3139
- writeError$1(`Couldn't upload screenshot slice: ${sliceId} - variation: ${variation.id}`);
3140
- writeError$1(error.message, "Full error:");
3141
- return variation;
3142
- });
3143
- }
3144
- async function updateSlicesWithScreenshots(client, acl, components) {
3145
- return Promise.all(components.map(async (component) => {
3146
- const { screenshots, model } = component;
3147
- const variationsUpdated = await Promise.all(model.variations.map(async (variation) => updateVariationWithScreenshot(client, acl, screenshots, model.id, variation)));
3148
- return {
3149
- ...model,
3150
- variations: variationsUpdated
3151
- };
3152
- }));
3153
- }
3154
-
3155
- async function sendSlices(client, cwd, manifest) {
3156
- if (!manifest.libraries)
3157
- return Promise.resolve(false);
3158
- const libraries = Libraries__namespace.libraries(cwd, manifest.libraries);
3159
- const components = libraries.reduce((acc, lib) => {
3160
- return [...acc, ...lib.components];
3161
- }, []);
3162
- if (components.length === 0)
3163
- return Promise.resolve(false);
3164
- const remoteSlicesIds = await client.getSlices().then((slices) => slices.map((slice) => slice.id));
3165
- if (remoteSlicesIds.length) {
3166
- const pushAnyway = await promptToPushSlices();
3167
- if (pushAnyway === false)
3168
- return Promise.resolve(true);
3169
- }
3170
- const spinner = spinner$1("Pushing existing Slice models to your repository");
3171
- spinner.start();
3172
- const acl = await client.createAcl().catch((error) => {
3173
- writeError$1("Uploading screenshots for your slices failed, please contact us.");
3174
- writeError$1(error.message, "Full error:");
3175
- return null;
3176
- });
3177
- const models$1 = acl ? await updateSlicesWithScreenshots(client, acl, components) : components.map((component) => component.model);
3178
- await Promise.all(models$1.map(async (model) => {
3179
- const slice = models.Slices.fromSM(model);
3180
- const promise = remoteSlicesIds.includes(slice.id) ? client.updateSlice(slice) : client.insertSlice(slice);
3181
- return promise.catch((error) => {
3182
- writeError$1(`Sending slice ${model.id} - ${error.message}`);
3183
- throw error;
3184
- });
3185
- })).catch(() => {
3186
- process.exit(1);
3187
- });
3188
- spinner.succeed();
3189
- return Promise.resolve(true);
3190
- }
3191
-
3192
- function readLocalCustomTypes(cwd) {
3193
- const customTypePaths = NodeUtils.CustomTypesPaths(cwd);
3194
- const dir = customTypePaths.value();
3195
- if (NodeUtils.Files.isDirectory(dir) === false)
3196
- return [];
3197
- const fileNames = NodeUtils.Files.readDirectory(dir);
3198
- const files = fileNames.reduce((acc, fileName) => {
3199
- const filePath = customTypePaths.customType(fileName).model();
3200
- const json = NodeUtils.Files.safeReadJson(filePath);
3201
- if (!json)
3202
- return acc;
3203
- const file = customtypes.CustomType.decode(json);
3204
- if (file instanceof Error) {
3205
- writeError$1(`reading ${filePath}: ${file.message}`);
3206
- return acc;
3207
- }
3208
- if (Either$1.isLeft(file)) {
3209
- writeError$1(`validating ${filePath}: ${JSON.stringify(file.left)}`);
3210
- return acc;
3211
- }
3212
- return [...acc, file.right];
3213
- }, []);
3214
- return files;
3215
- }
3216
- async function sendCustomTypes(client, cwd) {
3217
- const localCustomTypes = readLocalCustomTypes(cwd);
3218
- if (localCustomTypes.length === 0)
3219
- return Promise.resolve(false);
3220
- const remoteCustomTypeIds = await client.getCustomTypes().then((customTypes) => customTypes.map((customType) => customType.id));
3221
- if (remoteCustomTypeIds.length) {
3222
- const shouldPush = await promptToPushCustomTypes();
3223
- if (shouldPush === false)
3224
- return Promise.resolve(false);
3225
- }
3226
- const spinner = spinner$1("Pushing existing custom types to your repository");
3227
- spinner.start();
3228
- await Promise.all(localCustomTypes.map(async (customType) => {
3229
- const promise = remoteCustomTypeIds.includes(customType.id) ? client.updateCustomType(customType) : client.insertCustomType(customType);
3230
- return promise.catch((error) => {
3231
- writeError$1(`Sending custom type ${customType.id} - ${error.message}`);
3232
- throw error;
3233
- });
3234
- })).catch(() => {
3235
- process.exit(1);
3236
- });
3237
- spinner.succeed();
3238
- return Promise.resolve(true);
3239
- }
3240
-
3241
- const SignatureFileReader = t__namespace.type({
3242
- signature: t__namespace.string
3243
- });
3244
- async function readSignatureFile(cwd) {
3245
- const pathToFile = path__default["default"].join(cwd, "documents", "index.json");
3246
- return fs__default["default"].promises.readFile(pathToFile, "utf-8").then((res) => {
3247
- const data = JSON.parse(res);
3248
- return Either.getOrElseW(() => {
3249
- throw new Error("Unable to read document signature file");
3250
- })(SignatureFileReader.decode(data));
3251
- });
3252
- }
3253
- async function readDocuments(cwd) {
3254
- const documentDir = path__default["default"].join(cwd, "documents");
3255
- const dirs = await lsdir(documentDir);
3256
- const files = (await Promise.all(dirs.map((dir) => lsfiles(dir)))).flat();
3257
- const documentObj = files.reduce((acc, file) => {
3258
- const filename = path__default["default"].parse(file).name;
3259
- const fileContent = fs__default["default"].readFileSync(file, "utf-8");
3260
- const json = JSON.parse(fileContent);
3261
- return { ...acc, [filename]: json };
3262
- }, {});
3263
- return documentObj;
3264
- }
3265
- async function sendDocuments(client, cwd) {
3266
- const pathToDocuments = path__default["default"].join(cwd, "documents");
3267
- const pathToSignatureFile = path__default["default"].join(pathToDocuments, "index.json");
3268
- if (!fs__default["default"].existsSync(pathToSignatureFile))
3269
- return Promise.resolve(false);
3270
- const signatureObj = await readSignatureFile(cwd);
3271
- const documents = await readDocuments(cwd);
3272
- if (Object.keys(documents).length === 0)
3273
- return Promise.resolve(false);
3274
- const spinner = spinner$1("Pushing existing documents to your repository");
3275
- spinner.start();
3276
- return client.pushDocuments(signatureObj.signature, documents, SharedConfig.PrismicSharedConfigManager.get().cookies).then(() => {
3277
- spinner.succeed();
3278
- fs__default["default"].rmSync(pathToDocuments, { recursive: true, force: true });
3279
- return true;
3280
- }).catch(async (e) => {
3281
- var _a;
3282
- spinner.fail();
3283
- if (((_a = e.response) == null ? void 0 : _a.data) === "Repository should not contain documents") {
3284
- writeError$1("The selected repository is not empty, documents cannot be uploaded. Please choose an empty repository or delete the documents contained in your repository.");
3285
- } else {
3286
- writeError$1("Sending documents failed, please try again. If the problem persists, contact us.");
3287
- writeError$1(`Full error: ${e.code || 500} - ${e.message}`);
3288
- }
3289
- await Tracker.get().trackInitEndFail(core.Models.Frameworks.none, "Failed to push documents");
3290
- process.exit(1);
3291
- });
3292
- }
3293
-
3294
- async function sendStarterData(client, cwd, pushDocuments = true) {
3295
- const manifest = NodeUtils.retrieveManifest(cwd);
3296
- const documentsPath = path__default["default"].join(cwd, "documents");
3297
- const hasDocuments = NodeUtils.Files.exists(documentsPath);
3298
- if (manifest.exists === false || hasDocuments === false)
3299
- return Promise.resolve(false);
3300
- if (manifest.content)
3301
- await sendSlices(client, cwd, manifest.content);
3302
- await sendCustomTypes(client, cwd);
3303
- if (!pushDocuments) {
3304
- fs__default["default"].rmSync(documentsPath, { recursive: true, force: true });
3305
- return Promise.resolve(true);
3306
- }
3307
- return sendDocuments(client, cwd);
3308
- }
3309
-
3310
- const defaultSliceMachineVersion = "0.0.41";
3311
- const getTheSliceMachineVersionInstalled = (packageJson) => {
3312
- var _a;
3313
- const sliceMachinePackageInstalled = Object.entries(((_a = packageJson.content) == null ? void 0 : _a.devDependencies) || {}).find((devDependency) => {
3314
- if (devDependency[0] === core.CONSTS.SM_PACKAGE_NAME) {
3315
- return devDependency;
3316
- }
3317
- });
3318
- if (!sliceMachinePackageInstalled) {
3319
- return defaultSliceMachineVersion;
3320
- }
3321
- const extractedVersion = extractVersionNumberFromSemver(sliceMachinePackageInstalled[1]);
3322
- if (!extractedVersion) {
3323
- return defaultSliceMachineVersion;
3324
- }
3325
- return extractedVersion;
3326
- };
3327
- const extractVersionNumberFromSemver = (semver) => {
3328
- const versionFound = semver.match(/\d+\.\d+\.\d+/);
3329
- if (versionFound && versionFound.length > 0) {
3330
- return versionFound[0];
3331
- }
3332
- return null;
3333
- };
3334
- function setVersion(cwd) {
3335
- var _a;
3336
- try {
3337
- const manifest = NodeUtils__namespace.retrieveManifest(cwd);
3338
- if ((_a = manifest.content) == null ? void 0 : _a._latest) {
3339
- return;
3340
- }
3341
- const packageJson = NodeUtils__namespace.retrieveJsonPackage(cwd);
3342
- const sliceMachineVersionInstalled = getTheSliceMachineVersionInstalled(packageJson);
3343
- NodeUtils__namespace.patchManifest(cwd, { _latest: sliceMachineVersionInstalled });
3344
- } catch (e) {
3345
- warning("Could not set _latest to installed slice-machine-ui version in sm.json");
3346
- }
3347
- }
3348
-
3349
- async function init() {
3350
- const cwd = findArgument(process.argv, "cwd") || process.cwd();
3351
- const mode = getApplicationMode(findArgument(process.argv, "mode")) || client.ApplicationMode.PROD;
3352
- const lib = findArgument(process.argv, "library");
3353
- const branch = findArgument(process.argv, "branch");
3354
- const isTrackingAvailable = findArgument(process.argv, "tracking") !== "false";
3355
- const preSelectedRepository = findArgument(process.argv, "repository");
3356
- const pushDocuments = !findFlag(process.argv, "no-docs");
3357
- Tracker.get().initialize("ED3O1FVsa8DteNyRmAuDyMcPoftJ6VdP" , isTrackingAvailable);
3358
- void Tracker.get().trackInitStart(preSelectedRepository);
3359
- const client$1 = new InitClient(mode, null, Prismic__default["default"].PrismicSharedConfigManager.getAuth());
3360
- console.log(purple("You're about to configure Slicemachine... Press ctrl + C to cancel"));
3361
- validatePkg(cwd);
3362
- const user = await loginOrBypass(client$1);
3363
- Tracker.get().identifyUser(user.shortId, user.intercomHash);
3364
- void Tracker.get().trackInitIdentify();
3365
- const frameworkResult = await detectFramework(cwd);
3366
- const repository = await chooseOrCreateARepository(client$1, cwd, frameworkResult.value, preSelectedRepository);
3367
- Tracker.get().setRepository(repository);
3368
- client$1.updateRepository(repository);
3369
- const sliceLibPath = lib ? await installLib(cwd, lib, branch) : void 0;
3370
- const wasStarter = await sendStarterData(client$1, cwd, pushDocuments);
3371
- await configureProject(client$1, cwd, repository, frameworkResult, sliceLibPath, isTrackingAvailable);
3372
- await installRequiredDependencies(cwd, frameworkResult.value, wasStarter, frameworkResult.version);
3373
- setVersion(cwd);
3374
- if (isTrackingAvailable) {
3375
- writeInfo("We use tracking tools to improve user experience. Learn more: https://prismic.io/docs/slice-machine#tracking");
3376
- }
3377
- displayFinalMessage(cwd, wasStarter, repository, client$1.apisEndpoints.Wroom);
3378
- }
3379
- init().then(() => {
3380
- process.exit(0);
3381
- }).catch(async (error) => {
3382
- if (error instanceof Error)
3383
- writeError$1(error.message);
3384
- else
3385
- console.error(error);
3386
- await Tracker.get().trackInitEndFail(core.Models.Frameworks.none, "Failed to initialise Slice Machine.");
3387
- });
3388
- //# sourceMappingURL=index.js.map