@akinon/projectzero 2.0.0-beta.2 → 2.0.0-beta.20

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 (377) hide show
  1. package/CHANGELOG.md +147 -6
  2. package/app-template/.env.example +8 -0
  3. package/app-template/.github/instructions/account.instructions.md +749 -0
  4. package/app-template/.github/instructions/checkout.instructions.md +678 -0
  5. package/app-template/.github/instructions/default.instructions.md +279 -0
  6. package/app-template/.github/instructions/edge-cases.instructions.md +73 -0
  7. package/app-template/.github/instructions/routing.instructions.md +603 -0
  8. package/app-template/.github/instructions/settings.instructions.md +338 -0
  9. package/app-template/.gitignore +5 -0
  10. package/app-template/AGENTS.md +7 -0
  11. package/app-template/CHANGELOG.md +1645 -61
  12. package/app-template/Procfile +1 -1
  13. package/app-template/README.md +6 -0
  14. package/app-template/akinon.json +1 -4
  15. package/app-template/build.sh +10 -0
  16. package/app-template/config/prebuild-tests.json +5 -0
  17. package/app-template/docs/advanced-usage.md +111 -0
  18. package/app-template/docs/plugins.md +60 -25
  19. package/app-template/docs/sentry-usage.md +35 -0
  20. package/app-template/jest.config.ts +2 -2
  21. package/app-template/next-env.d.ts +1 -0
  22. package/app-template/next.config.mjs +8 -5
  23. package/app-template/package.json +60 -50
  24. package/app-template/postcss.config.mjs +5 -0
  25. package/app-template/public/amex.svg +12 -0
  26. package/app-template/public/apple-pay.svg +16 -0
  27. package/app-template/public/assets/images/product-placeholder-1.jpg +0 -0
  28. package/app-template/public/assets/images/product-placeholder-2.jpg +0 -0
  29. package/app-template/public/assets/images/product-placeholder-3.jpg +0 -0
  30. package/app-template/public/assets/images/product-placeholder-4.jpg +0 -0
  31. package/app-template/public/google-pay.svg +16 -0
  32. package/app-template/public/locales/en/account.json +13 -4
  33. package/app-template/public/locales/en/auth.json +6 -7
  34. package/app-template/public/locales/en/basket.json +6 -6
  35. package/app-template/public/locales/en/blog.json +7 -0
  36. package/app-template/public/locales/en/category.json +3 -1
  37. package/app-template/public/locales/en/checkout.json +17 -4
  38. package/app-template/public/locales/en/common.json +71 -3
  39. package/app-template/public/locales/en/forgot_password.json +6 -7
  40. package/app-template/public/locales/en/product.json +84 -4
  41. package/app-template/public/locales/tr/account.json +13 -4
  42. package/app-template/public/locales/tr/auth.json +16 -17
  43. package/app-template/public/locales/tr/basket.json +4 -4
  44. package/app-template/public/locales/tr/blog.json +7 -0
  45. package/app-template/public/locales/tr/category.json +3 -1
  46. package/app-template/public/locales/tr/checkout.json +48 -36
  47. package/app-template/public/locales/tr/common.json +70 -2
  48. package/app-template/public/locales/tr/forgot_password.json +12 -13
  49. package/app-template/public/locales/tr/product.json +82 -0
  50. package/app-template/public/logo.svg +3 -27
  51. package/app-template/public/mastercard.svg +14 -0
  52. package/app-template/public/masterpass-javascript-sdk-web.min.js +1 -0
  53. package/app-template/public/promotion-banner.jpg +0 -0
  54. package/app-template/public/shop-pay.svg +12 -0
  55. package/app-template/public/visa.svg +12 -0
  56. package/app-template/src/__tests__/middleware-matcher.test.ts +135 -0
  57. package/app-template/src/app/[commerce]/[locale]/[currency]/blog/[slug]/page.tsx +118 -0
  58. package/app-template/src/app/[commerce]/[locale]/[currency]/pages/[slug]/page.tsx +15 -0
  59. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/[...prettyurl]/page.tsx +9 -9
  60. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/layout.tsx +2 -2
  61. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/cancellation/page.tsx +105 -13
  62. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/page.tsx +136 -52
  63. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/profile/page.tsx +2 -2
  64. package/app-template/src/app/[pz]/category/[pk]/page.tsx +27 -0
  65. package/app-template/src/app/[pz]/error.tsx +17 -0
  66. package/app-template/src/app/[pz]/flat-page/[pk]/page.tsx +23 -0
  67. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/forms/[pk]/generate/page.tsx +1 -2
  68. package/app-template/src/app/[pz]/group-product/[pk]/page.tsx +93 -0
  69. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/page.tsx +2 -4
  70. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/layout.tsx +3 -10
  71. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/page.tsx +2 -4
  72. package/app-template/src/app/{[commerce]/[locale]/[currency]/pz-not-found/page.tsx → [pz]/not-found.tsx} +5 -7
  73. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/checkout/page.tsx +7 -4
  74. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/page.tsx +6 -4
  75. package/app-template/src/app/[pz]/product/[pk]/page.tsx +102 -0
  76. package/app-template/src/app/[pz]/special-page/[pk]/page.tsx +35 -0
  77. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/email-set-primary/[[...id]]/page.tsx +3 -4
  78. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/registration/account-confirm-email/[[...id]]/page.tsx +3 -3
  79. package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/reset/[[...id]]/page.tsx +41 -5
  80. package/app-template/src/app/[pz]/xml-sitemap/[node]/route.ts +73 -0
  81. package/app-template/src/app/api/auth/[...nextauth]/route.ts +3 -0
  82. package/app-template/src/app/api/barcode-search/route.ts +1 -0
  83. package/app-template/src/app/api/form/[...id]/route.ts +1 -7
  84. package/app-template/src/app/api/image-proxy/route.ts +1 -0
  85. package/app-template/src/app/api/product-categories/route.ts +1 -0
  86. package/app-template/src/app/api/similar-product-list/route.ts +1 -0
  87. package/app-template/src/app/api/similar-products/route.ts +1 -0
  88. package/app-template/src/app/api/theme-settings/route.ts +12 -0
  89. package/app-template/src/app/api/virtual-try-on/limited-categories/route.ts +1 -0
  90. package/app-template/src/app/api/virtual-try-on/route.ts +1 -0
  91. package/app-template/src/assets/fonts/pz-icon.css +211 -49
  92. package/app-template/src/assets/fonts/pz-icon.eot +0 -0
  93. package/app-template/src/assets/fonts/pz-icon.html +486 -0
  94. package/app-template/src/assets/fonts/pz-icon.scss +373 -49
  95. package/app-template/src/assets/fonts/pz-icon.svg +215 -53
  96. package/app-template/src/assets/fonts/pz-icon.ttf +0 -0
  97. package/app-template/src/assets/fonts/pz-icon.woff +0 -0
  98. package/app-template/src/assets/fonts/pz-icon.woff2 +0 -0
  99. package/app-template/src/assets/globals.scss +37 -34
  100. package/app-template/src/assets/icons/arrow-right.svg +3 -0
  101. package/app-template/src/assets/icons/cart.svg +4 -12
  102. package/app-template/src/assets/icons/check.svg +2 -18
  103. package/app-template/src/assets/icons/chevron-down.svg +2 -7
  104. package/app-template/src/assets/icons/delete.svg +3 -0
  105. package/app-template/src/assets/icons/facebook.svg +2 -8
  106. package/app-template/src/assets/icons/fav-off.svg +5 -0
  107. package/app-template/src/assets/icons/fav-on.svg +5 -0
  108. package/app-template/src/assets/icons/filter-and-sort.svg +3 -0
  109. package/app-template/src/assets/icons/heart.svg +3 -0
  110. package/app-template/src/assets/icons/instagram.svg +2 -13
  111. package/app-template/src/assets/icons/materials.svg +3 -0
  112. package/app-template/src/assets/icons/person.svg +4 -0
  113. package/app-template/src/assets/icons/pinterest.svg +5 -11
  114. package/app-template/src/assets/icons/ruler.svg +3 -0
  115. package/app-template/src/assets/icons/search.svg +8 -11
  116. package/app-template/src/assets/icons/share.svg +2 -9
  117. package/app-template/src/assets/icons/snapchat.svg +3 -0
  118. package/app-template/src/assets/icons/tiktok.svg +3 -0
  119. package/app-template/src/assets/icons/tumblr.svg +6 -0
  120. package/app-template/src/assets/icons/twitter.svg +2 -10
  121. package/app-template/src/assets/icons/vimeo.svg +3 -0
  122. package/app-template/src/assets/icons/youtube.svg +3 -0
  123. package/app-template/src/assets/icons/zoom.svg +8 -0
  124. package/app-template/src/auth.ts +3 -0
  125. package/app-template/src/components/__tests__/link.test.tsx +2 -0
  126. package/app-template/src/components/accordion.tsx +48 -23
  127. package/app-template/src/components/action-tooltip.tsx +160 -0
  128. package/app-template/src/components/button.tsx +50 -35
  129. package/app-template/src/components/carousel-core.tsx +4 -11
  130. package/app-template/src/components/checkbox.tsx +2 -1
  131. package/app-template/src/components/currency-select.tsx +150 -4
  132. package/app-template/src/components/file-input.tsx +64 -2
  133. package/app-template/src/components/generate-form-fields.tsx +49 -10
  134. package/app-template/src/components/icon.tsx +5 -6
  135. package/app-template/src/components/index.ts +4 -1
  136. package/app-template/src/components/input.tsx +8 -2
  137. package/app-template/src/components/language-select.tsx +88 -2
  138. package/app-template/src/components/modal.tsx +34 -16
  139. package/app-template/src/components/pagination.tsx +133 -20
  140. package/app-template/src/components/price.tsx +1 -1
  141. package/app-template/src/components/pwa-tags.tsx +1 -0
  142. package/app-template/src/components/quantity-input.tsx +63 -0
  143. package/app-template/src/components/quantity-selector.tsx +203 -0
  144. package/app-template/src/components/route-handler.tsx +50 -0
  145. package/app-template/src/components/select.tsx +86 -54
  146. package/app-template/src/components/tabs.tsx +2 -2
  147. package/app-template/src/components/types/index.ts +55 -2
  148. package/app-template/src/components/widget-content.tsx +323 -0
  149. package/app-template/src/data/server/theme.ts +70 -0
  150. package/app-template/src/hooks/use-fav-button.tsx +9 -10
  151. package/app-template/src/hooks/use-product-cart.ts +80 -0
  152. package/app-template/src/hooks/use-stock-alert.ts +74 -0
  153. package/app-template/src/hooks/use-theme-settings.ts +42 -0
  154. package/app-template/src/lib/fonts.ts +149 -0
  155. package/app-template/src/middleware.ts +1 -0
  156. package/app-template/src/plugins.js +13 -2
  157. package/app-template/src/redux/middlewares/category.ts +6 -5
  158. package/app-template/src/redux/reducers/category.ts +1 -1
  159. package/app-template/src/redux/store.ts +21 -1
  160. package/app-template/src/routes/index.ts +2 -1
  161. package/app-template/src/settings.js +5 -3
  162. package/app-template/src/types/hookform-resolvers-yup.d.ts +28 -0
  163. package/app-template/src/types/index.ts +74 -3
  164. package/app-template/src/types/next-auth.d.ts +2 -2
  165. package/app-template/src/types/widget.ts +169 -0
  166. package/app-template/src/utils/convert-facet-search-params.ts +1 -1
  167. package/app-template/src/utils/formatDate.ts +48 -0
  168. package/app-template/src/utils/styles.ts +71 -0
  169. package/app-template/src/utils/variant-validation.ts +41 -0
  170. package/app-template/src/views/account/address-form.tsx +8 -4
  171. package/app-template/src/views/account/contact-form.tsx +148 -136
  172. package/app-template/src/views/account/content-header.tsx +2 -2
  173. package/app-template/src/views/account/faq/faq-tabs.tsx +8 -2
  174. package/app-template/src/views/account/favorite-item.tsx +1 -1
  175. package/app-template/src/views/account/order.tsx +10 -8
  176. package/app-template/src/views/account/orders/order-cancellation-item.tsx +4 -3
  177. package/app-template/src/views/account/orders/order-detail-header.tsx +1 -1
  178. package/app-template/src/views/anonymous-tracking/order-detail/index.tsx +44 -37
  179. package/app-template/src/views/basket/basket-item.tsx +697 -107
  180. package/app-template/src/views/basket/basket-summary-context.tsx +560 -0
  181. package/app-template/src/views/basket/designer-context.tsx +617 -0
  182. package/app-template/src/views/basket/index.ts +2 -0
  183. package/app-template/src/views/basket/summary.tsx +497 -60
  184. package/app-template/src/views/breadcrumb/breadcrumb-client.tsx +190 -0
  185. package/app-template/src/views/breadcrumb/breadcrumb-registrar.tsx +286 -0
  186. package/app-template/src/views/breadcrumb/constants.ts +15 -0
  187. package/app-template/src/views/breadcrumb/index.tsx +127 -0
  188. package/app-template/src/views/breadcrumb.tsx +13 -38
  189. package/app-template/src/views/category/category-active-filters.tsx +1 -1
  190. package/app-template/src/views/category/category-banner.tsx +4 -23
  191. package/app-template/src/views/category/category-header.tsx +289 -60
  192. package/app-template/src/views/category/category-info.tsx +177 -27
  193. package/app-template/src/views/category/filters/filter-item.tsx +138 -42
  194. package/app-template/src/views/category/filters/index.tsx +209 -49
  195. package/app-template/src/views/category/layout.tsx +7 -4
  196. package/app-template/src/views/category/native-widget-context.tsx +257 -0
  197. package/app-template/src/views/category/product-list-registrar.tsx +665 -0
  198. package/app-template/src/views/checkout/auth.tsx +64 -40
  199. package/app-template/src/views/checkout/checkout-address-registrar.tsx +254 -0
  200. package/app-template/src/views/checkout/checkout-buttons-registrar.tsx +183 -0
  201. package/app-template/src/views/checkout/checkout-delivery-method-registrar.tsx +259 -0
  202. package/app-template/src/views/checkout/checkout-payment-options-registrar.tsx +253 -0
  203. package/app-template/src/views/checkout/checkout-summary-registrar.tsx +183 -0
  204. package/app-template/src/views/checkout/constants.ts +5 -0
  205. package/app-template/src/views/checkout/index.tsx +5 -0
  206. package/app-template/src/views/checkout/layout/header.tsx +9 -5
  207. package/app-template/src/views/checkout/steps/payment/index.tsx +5 -2
  208. package/app-template/src/views/checkout/steps/payment/options/credit-card/index.tsx +93 -6
  209. package/app-template/src/views/checkout/steps/payment/options/funds-transfer.tsx +25 -5
  210. package/app-template/src/views/checkout/steps/payment/options/loyalty.tsx +21 -2
  211. package/app-template/src/views/checkout/steps/payment/options/masterpass-rest.tsx +15 -0
  212. package/app-template/src/views/checkout/steps/payment/options/redirection.tsx +27 -5
  213. package/app-template/src/views/checkout/steps/payment/options/saved-card.tsx +18 -0
  214. package/app-template/src/views/checkout/steps/payment/options/store-credit.tsx +464 -0
  215. package/app-template/src/views/checkout/steps/payment/payment-option-buttons.tsx +171 -40
  216. package/app-template/src/views/checkout/steps/shipping/address-box.tsx +104 -29
  217. package/app-template/src/views/checkout/steps/shipping/addresses.tsx +129 -46
  218. package/app-template/src/views/checkout/steps/shipping/shipping-options.tsx +232 -27
  219. package/app-template/src/views/checkout/summary.tsx +310 -26
  220. package/app-template/src/views/find-in-store/index.tsx +2 -2
  221. package/app-template/src/views/footer/footer-app-banner-context.tsx +326 -0
  222. package/app-template/src/views/footer/footer-bottom-context.tsx +215 -0
  223. package/app-template/src/views/footer/footer-bottom-wrapper.tsx +74 -0
  224. package/app-template/src/views/footer/footer-layout-constants.ts +35 -0
  225. package/app-template/src/views/footer/footer-layout-registrar.tsx +342 -0
  226. package/app-template/src/views/footer/footer-layout-switcher.tsx +110 -0
  227. package/app-template/src/views/footer/footer-menu-context.tsx +211 -0
  228. package/app-template/src/views/footer/footer-native-widgets.tsx +60 -0
  229. package/app-template/src/views/footer/footer-social-context.tsx +254 -0
  230. package/app-template/src/views/footer/footer-subscription-context.tsx +210 -0
  231. package/app-template/src/views/footer/footer-utils.ts +43 -0
  232. package/app-template/src/views/footer/footer-value-props-context.tsx +326 -0
  233. package/app-template/src/views/footer/logo-settings.ts +183 -0
  234. package/app-template/src/views/footer/native-widget-config.ts +262 -0
  235. package/app-template/src/views/footer/subscription-settings.ts +122 -0
  236. package/app-template/src/views/footer/use-footer-logo.ts +162 -0
  237. package/app-template/src/views/footer.tsx +415 -13
  238. package/app-template/src/views/guest-login/index.tsx +62 -58
  239. package/app-template/src/views/header/action-menu.tsx +284 -49
  240. package/app-template/src/views/header/band.tsx +6 -21
  241. package/app-template/src/views/header/designer-context.tsx +261 -0
  242. package/app-template/src/views/header/header-announcement-registrar.tsx +267 -0
  243. package/app-template/src/views/header/header-client-wrapper.tsx +496 -0
  244. package/app-template/src/views/header/header-content.tsx +1026 -0
  245. package/app-template/src/views/header/header-currency-registrar.tsx +348 -0
  246. package/app-template/src/views/header/header-icons-context.tsx +262 -0
  247. package/app-template/src/views/header/header-language-registrar.tsx +348 -0
  248. package/app-template/src/views/header/header-layout-context.tsx +143 -0
  249. package/app-template/src/views/header/header-layout-registrar.tsx +658 -0
  250. package/app-template/src/views/header/header-logo-context.tsx +228 -0
  251. package/app-template/src/views/header/header-logo.tsx +118 -0
  252. package/app-template/src/views/header/header-mini-basket-context.tsx +524 -0
  253. package/app-template/src/views/header/header-search-registrar.tsx +511 -0
  254. package/app-template/src/views/header/header-text-slider-registrar.tsx +382 -0
  255. package/app-template/src/views/header/index.tsx +110 -48
  256. package/app-template/src/views/header/inline-search.tsx +262 -0
  257. package/app-template/src/views/header/mini-basket.tsx +832 -46
  258. package/app-template/src/views/header/mobile-hamburger-button.tsx +5 -8
  259. package/app-template/src/views/header/mobile-menu.tsx +12 -0
  260. package/app-template/src/views/header/navbar-menu-context.tsx +219 -0
  261. package/app-template/src/views/header/navbar.tsx +178 -111
  262. package/app-template/src/views/header/search/index.tsx +85 -24
  263. package/app-template/src/views/header/search/results.tsx +127 -65
  264. package/app-template/src/views/header/search/search-input.tsx +61 -0
  265. package/app-template/src/views/header/server-settings-parser.ts +1105 -0
  266. package/app-template/src/views/header/use-header-icons.ts +241 -0
  267. package/app-template/src/views/header/use-header-logo.ts +213 -0
  268. package/app-template/src/views/header/use-navbar-menu.ts +179 -0
  269. package/app-template/src/views/installment-options/index.tsx +1 -1
  270. package/app-template/src/views/login/index.tsx +89 -56
  271. package/app-template/src/views/otp-login/index.tsx +23 -20
  272. package/app-template/src/views/product/accordion-section.tsx +61 -0
  273. package/app-template/src/views/product/accordion-wrapper.tsx +135 -43
  274. package/app-template/src/views/product/custom-button-group.tsx +69 -0
  275. package/app-template/src/views/product/favorites-button-section.tsx +69 -0
  276. package/app-template/src/views/product/find-in-store-section.tsx +60 -0
  277. package/app-template/src/views/product/index.ts +1 -0
  278. package/app-template/src/views/product/layout.tsx +21 -6
  279. package/app-template/src/views/product/misc-buttons.tsx +339 -25
  280. package/app-template/src/views/product/price-wrapper.tsx +3 -24
  281. package/app-template/src/views/product/product-actions.tsx +294 -0
  282. package/app-template/src/views/product/product-info-section.tsx +140 -0
  283. package/app-template/src/views/product/product-info.tsx +130 -254
  284. package/app-template/src/views/product/product-share.tsx +61 -0
  285. package/app-template/src/views/product/product-variants.tsx +26 -0
  286. package/app-template/src/views/product/quantity-section.tsx +73 -0
  287. package/app-template/src/views/product/sale-tag.tsx +10 -0
  288. package/app-template/src/views/product/share-section.tsx +357 -0
  289. package/app-template/src/views/product/slider.tsx +135 -76
  290. package/app-template/src/views/product/variant.tsx +69 -41
  291. package/app-template/src/views/product/variants-section.tsx +126 -0
  292. package/app-template/src/views/product-detail/constants.ts +272 -0
  293. package/app-template/src/views/product-detail/index.ts +10 -0
  294. package/app-template/src/views/product-detail/product-detail-registrar.tsx +616 -0
  295. package/app-template/src/views/product-item/index.tsx +119 -46
  296. package/app-template/src/views/register/index.tsx +54 -44
  297. package/app-template/src/views/share/index.tsx +9 -6
  298. package/app-template/src/views/widgets/home-hero-slider-content.tsx +41 -39
  299. package/app-template/src/widgets/flatpages/about-us/index.tsx +78 -0
  300. package/app-template/src/widgets/flatpages/blog-list/index.tsx +129 -0
  301. package/app-template/src/widgets/footer-app-banner.tsx +444 -0
  302. package/app-template/src/widgets/footer-bottom.tsx +127 -0
  303. package/app-template/src/widgets/footer-menu-compact.tsx +238 -0
  304. package/app-template/src/widgets/footer-menu-two.tsx +298 -0
  305. package/app-template/src/widgets/footer-menu.tsx +6 -2
  306. package/app-template/src/widgets/footer-social-client.tsx +251 -0
  307. package/app-template/src/widgets/footer-social.tsx +47 -16
  308. package/app-template/src/widgets/footer-subscription/footer-subscription-form.tsx +17 -14
  309. package/app-template/src/widgets/footer-subscription/index.tsx +183 -17
  310. package/app-template/src/widgets/footer-value-props.tsx +201 -0
  311. package/app-template/src/widgets/home-stories-eng.tsx +42 -34
  312. package/app-template/src/widgets/index.ts +7 -0
  313. package/app-template/src/widgets/schemas/about-us.json +46 -0
  314. package/app-template/src/widgets/schemas/blog-list.json +37 -0
  315. package/app-template/src/widgets/schemas/blog.json +29 -0
  316. package/app-template/tailwind.config.js +19 -7
  317. package/app-template/tsconfig.json +29 -11
  318. package/codemods/migrate-segments/index.js +591 -0
  319. package/codemods/sentry-9/index.js +30 -0
  320. package/codemods/sentry-9/remove-sentry-configs.js +14 -0
  321. package/codemods/sentry-9/remove-sentry-dependency.js +25 -0
  322. package/codemods/sentry-9/replace-error-page.js +32 -0
  323. package/codemods/update-tailwind-config/index.js +30 -0
  324. package/codemods/update-tailwind-config/transform.js +102 -0
  325. package/commands/codemod.ts +17 -0
  326. package/commands/index.ts +3 -1
  327. package/commands/plugins.ts +115 -46
  328. package/dist/codemods/sentry-9/templates/error.js +14 -0
  329. package/dist/commands/codemod.js +15 -0
  330. package/dist/commands/index.js +3 -1
  331. package/dist/commands/plugins.js +85 -34
  332. package/package.json +3 -2
  333. package/app-template/postcss.config.js +0 -6
  334. package/app-template/sentry.client.config.ts +0 -16
  335. package/app-template/sentry.edge.config.ts +0 -3
  336. package/app-template/sentry.properties +0 -4
  337. package/app-template/sentry.server.config.ts +0 -3
  338. package/app-template/src/app/[commerce]/[locale]/[currency]/category/[pk]/page.tsx +0 -22
  339. package/app-template/src/app/[commerce]/[locale]/[currency]/error.tsx +0 -20
  340. package/app-template/src/app/[commerce]/[locale]/[currency]/flat-page/[pk]/page.tsx +0 -20
  341. package/app-template/src/app/[commerce]/[locale]/[currency]/group-product/[pk]/page.tsx +0 -74
  342. package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/loading.tsx +0 -67
  343. package/app-template/src/app/[commerce]/[locale]/[currency]/product/[pk]/page.tsx +0 -84
  344. package/app-template/src/app/[commerce]/[locale]/[currency]/special-page/[pk]/page.tsx +0 -27
  345. package/app-template/src/app/[commerce]/[locale]/[currency]/xml-sitemap/[node]/route.ts +0 -25
  346. package/app-template/src/pages/api/auth/[...nextauth].ts +0 -3
  347. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/address/page.tsx +0 -0
  348. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-email/page.tsx +0 -0
  349. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/change-password/page.tsx +0 -0
  350. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/contact/page.tsx +0 -0
  351. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/coupons/page.tsx +0 -0
  352. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/email-verification/page.tsx +0 -0
  353. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/faq/page.tsx +0 -0
  354. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/favourite-products/page.tsx +0 -0
  355. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/my-quotations/page.tsx +0 -0
  356. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/[id]/layout.tsx +0 -0
  357. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/orders/page.tsx +0 -0
  358. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/account/page.tsx +0 -0
  359. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/address/stores/page.tsx +0 -0
  360. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/anonymous-tracking/page.tsx +0 -0
  361. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/oauth-login/page.tsx +0 -0
  362. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/auth/page.tsx +0 -0
  363. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket/page.tsx +0 -0
  364. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/basket-b2b/page.tsx +0 -0
  365. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/category/[pk]/loading.tsx +0 -0
  366. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/client-root.tsx +0 -0
  367. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/contact-us/page.tsx +0 -0
  368. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/flat-page/[pk]/loading.tsx +0 -0
  369. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/group-product/[pk]/loading.tsx +0 -0
  370. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/landing-page/[pk]/loading.tsx +0 -0
  371. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/list/loading.tsx +0 -0
  372. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/orders/completed/[token]/layout.tsx +0 -0
  373. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/page.tsx +0 -0
  374. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/special-page/[pk]/loading.tsx +0 -0
  375. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/template.tsx +0 -0
  376. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/users/password/reset/page.tsx +0 -0
  377. /package/app-template/src/app/{[commerce]/[locale]/[currency] → [pz]}/xml-sitemap/route.ts +0 -0
@@ -0,0 +1,30 @@
1
+ const path = require('path');
2
+ const jscodeshift = require('jscodeshift/src/Runner');
3
+
4
+ const codemodScript = path.resolve(__dirname, 'transform.js');
5
+
6
+ const transform = () => {
7
+ const workingDir = path.resolve(process.cwd());
8
+
9
+ jscodeshift
10
+ .run(codemodScript, [workingDir], {
11
+ verbose: 0,
12
+ dry: false,
13
+ print: false,
14
+ extensions: 'js',
15
+ ignorePattern: '**/node_modules/**',
16
+ filter: '**/tailwind.config.js'
17
+ })
18
+ .then(
19
+ (stats) => {
20
+ console.log(`Codemod completed. Stats:`, stats);
21
+ },
22
+ (error) => {
23
+ console.error(`Error executing codemod: ${error.message}`);
24
+ }
25
+ );
26
+ };
27
+
28
+ module.exports = {
29
+ transform
30
+ };
@@ -0,0 +1,102 @@
1
+ function transform(fileInfo, api) {
2
+ const j = api.jscodeshift;
3
+ const root = j(fileInfo.source);
4
+
5
+ if (!fileInfo.path.includes('tailwind.config.js')) {
6
+ return fileInfo.source;
7
+ }
8
+
9
+ console.log(`Processing file: ${fileInfo.path}`);
10
+
11
+ const hasAkinonNextImport = root.find(j.VariableDeclarator, {
12
+ id: { name: 'getAkinonNextContent' }
13
+ });
14
+
15
+ if (hasAkinonNextImport.size() === 0) {
16
+ const requireStatement = j.variableDeclaration('const', [
17
+ j.variableDeclarator(
18
+ j.identifier('getAkinonNextContent'),
19
+ j.callExpression(j.identifier('require'), [
20
+ j.literal('@akinon/next/tailwind/content')
21
+ ])
22
+ )
23
+ ]);
24
+
25
+ root.get().node.program.body.unshift(requireStatement);
26
+
27
+ console.log(`Added getAkinonNextContent import to ${fileInfo.path}`);
28
+ }
29
+
30
+ const defaultConfig = root
31
+ .find(j.VariableDeclarator, {
32
+ id: { name: 'defaultConfig' },
33
+ init: { type: 'ObjectExpression' }
34
+ })
35
+ .paths()[0];
36
+
37
+ if (!defaultConfig) {
38
+ console.log(`No defaultConfig found in ${fileInfo.path}`);
39
+ return fileInfo.source;
40
+ }
41
+
42
+ const contentArray = defaultConfig.value.init.properties.find(
43
+ (prop) =>
44
+ prop.key.name === 'content' && prop.value.type === 'ArrayExpression'
45
+ );
46
+
47
+ if (!contentArray) {
48
+ console.log(`No content array found in defaultConfig`);
49
+ return fileInfo.source;
50
+ }
51
+
52
+ const pluginsVarName = root
53
+ .find(j.VariableDeclarator, {
54
+ id: { name: 'plugins' },
55
+ init: {
56
+ type: 'CallExpression',
57
+ callee: { name: 'require' }
58
+ }
59
+ })
60
+ .paths()[0]?.value.id.name;
61
+
62
+ if (!pluginsVarName) {
63
+ console.log(`No plugins variable found in ${fileInfo.path}`);
64
+ return fileInfo.source;
65
+ }
66
+
67
+ const contentElements = contentArray.value.elements;
68
+
69
+ const filteredElements = contentElements.filter((element) => {
70
+ if (element.type === 'SpreadElement') {
71
+ if (
72
+ element.argument.type === 'CallExpression' &&
73
+ element.argument.callee.object?.callee.object.name === 'plugins'
74
+ ) {
75
+ return false;
76
+ }
77
+
78
+ if (
79
+ element.argument.type === 'CallExpression' &&
80
+ element.argument.callee.name === 'getAkinonNextContent'
81
+ ) {
82
+ return false;
83
+ }
84
+ }
85
+ return true;
86
+ });
87
+
88
+ filteredElements.push(
89
+ j.spreadElement(
90
+ j.callExpression(j.identifier('getAkinonNextContent'), [
91
+ j.identifier(pluginsVarName)
92
+ ])
93
+ )
94
+ );
95
+
96
+ contentArray.value.elements = filteredElements;
97
+
98
+ console.log(`Successfully updated ${fileInfo.path}`);
99
+ return root.toSource();
100
+ }
101
+
102
+ module.exports = transform;
@@ -0,0 +1,17 @@
1
+ import path from 'path';
2
+
3
+ const yargs = require('yargs/yargs');
4
+ const { hideBin } = require('yargs/helpers');
5
+ const args = yargs(hideBin(process.argv)).argv;
6
+
7
+ export default () => {
8
+ const codemodName = args.codemod;
9
+ const codemodPath = path.resolve(
10
+ __dirname,
11
+ `../../codemods/${codemodName}/index.js`
12
+ );
13
+
14
+ const codemod = require(codemodPath);
15
+
16
+ codemod.transform();
17
+ };
package/commands/index.ts CHANGED
@@ -4,6 +4,7 @@ import addLanguage from './add-language';
4
4
  import removeLanguage from './remove-language';
5
5
  import defaultLanguage from './default-language';
6
6
  import plugins from './plugins';
7
+ import codemod from './codemod';
7
8
 
8
9
  export default {
9
10
  commerceUrl,
@@ -11,5 +12,6 @@ export default {
11
12
  addLanguage,
12
13
  removeLanguage,
13
14
  defaultLanguage,
14
- plugins
15
+ plugins,
16
+ codemod
15
17
  };
@@ -2,8 +2,7 @@ import * as fs from 'fs';
2
2
  import path from 'path';
3
3
  import { execSync } from 'child_process';
4
4
  import semver from 'semver';
5
-
6
- const Prompt = require('prompt-checkbox');
5
+ import { checkbox } from '@inquirer/prompts';
7
6
 
8
7
  const rootDir = path.resolve(process.cwd());
9
8
 
@@ -30,7 +29,14 @@ async function checkVersion(pkg: PackageJson) {
30
29
 
31
30
  if (!semver.satisfies(pkg.dependencies['@akinon/next'], latestVersion)) {
32
31
  console.warn(
33
- `\x1b[43mWarning: The "${packageName}" package is currently at version ${pkg.dependencies['@akinon/next']}. Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`,
32
+ `\x1b[43m Warning: The "${packageName}" package is currently at`,
33
+ `\x1b[41m version ${pkg.dependencies['@akinon/next']}`,
34
+ `\x1b[43m Please upgrade it to the latest version (${latestVersion}) to ensure plugin compatibility.`,
35
+ '\x1b[0m\n'
36
+ );
37
+ } else {
38
+ console.log(
39
+ `\x1b[42m Info: The package "${packageName}" is currently in the current version (${latestVersion}).`,
34
40
  '\x1b[0m\n'
35
41
  );
36
42
  }
@@ -55,7 +61,27 @@ export default async () => {
55
61
  }
56
62
  }
57
63
 
58
- const pkg: PackageJson = require(path.resolve(rootDir, './package.json'));
64
+ function findPackageJson(): PackageJson {
65
+ const packageJsonPaths = [
66
+ path.resolve(rootDir, './package.json'),
67
+ path.resolve(rootDir, './apps/projectzeronext/package.json')
68
+ ];
69
+
70
+ for (const packageJsonPath of packageJsonPaths) {
71
+ try {
72
+ const pkg = require(packageJsonPath);
73
+ if (pkg.dependencies['@akinon/next']) {
74
+ return pkg;
75
+ }
76
+ } catch (error) {
77
+ continue;
78
+ }
79
+ }
80
+
81
+ throw new Error('Could not find package.json with @akinon/next dependency');
82
+ }
83
+
84
+ const pkg = findPackageJson();
59
85
  await checkVersion(pkg);
60
86
 
61
87
  const pluginsFilePath = findPluginsFilePath();
@@ -70,82 +96,123 @@ export default async () => {
70
96
  }
71
97
 
72
98
  const definedPlugins = [
99
+ {
100
+ name: 'Akifast',
101
+ value: 'pz-akifast'
102
+ },
103
+ {
104
+ name: 'Apple Pay',
105
+ value: 'pz-apple-pay'
106
+ },
107
+ {
108
+ name: 'B2B',
109
+ value: 'pz-b2b'
110
+ },
73
111
  {
74
112
  name: 'Basket Gift Pack',
75
113
  value: 'pz-basket-gift-pack'
76
114
  },
77
115
  {
78
- name: 'Click & Collect',
79
- value: 'pz-click-collect'
116
+ name: 'BKM Express',
117
+ value: 'pz-bkm'
80
118
  },
81
119
  {
82
120
  name: 'Checkout Gift Pack',
83
121
  value: 'pz-checkout-gift-pack'
84
122
  },
85
123
  {
86
- name: 'One Click Checkout',
87
- value: 'pz-one-click-checkout'
124
+ name: 'Click & Collect',
125
+ value: 'pz-click-collect'
126
+ },
127
+ {
128
+ name: 'Credit Payment',
129
+ value: 'pz-credit-payment'
88
130
  },
89
131
  {
90
132
  name: 'Garanti Pay',
91
133
  value: 'pz-gpay'
92
134
  },
93
135
  {
94
- name: 'Pay On Delivery',
95
- value: 'pz-pay-on-delivery'
136
+ name: 'Masterpass',
137
+ value: 'pz-masterpass'
96
138
  },
97
139
  {
98
- name: 'Otp',
99
- value: 'pz-otp'
140
+ name: 'Multi Basket',
141
+ value: 'pz-multi-basket'
100
142
  },
101
143
  {
102
- name: 'BKM Express',
103
- value: 'pz-bkm'
144
+ name: 'One Click Checkout',
145
+ value: 'pz-one-click-checkout'
104
146
  },
105
147
  {
106
- name: 'Credit Payment',
107
- value: 'pz-credit-payment'
148
+ name: 'Otp',
149
+ value: 'pz-otp'
108
150
  },
109
151
  {
110
- name: 'Multi Basket',
111
- value: 'pz-multi-basket'
152
+ name: 'Pay On Delivery',
153
+ value: 'pz-pay-on-delivery'
154
+ },
155
+ {
156
+ name: 'Saved Card',
157
+ value: 'pz-saved-card'
112
158
  },
113
159
  {
114
160
  name: 'Tabby Payment Extension',
115
161
  value: 'pz-tabby-extension'
162
+ },
163
+ {
164
+ name: 'Tamara Payment Extension',
165
+ value: 'pz-tamara-extension'
166
+ },
167
+ {
168
+ name: 'Hepsipay',
169
+ value: 'pz-hepsipay'
170
+ },
171
+ {
172
+ name: 'Flow Payment',
173
+ value: 'pz-flow-payment'
174
+ },
175
+ {
176
+ name: 'Virtual Try-On',
177
+ value: 'pz-virtual-try-on'
178
+ },
179
+ {
180
+ name: 'Masterpass Rest',
181
+ value: 'pz-masterpass-rest'
182
+ },
183
+ {
184
+ name: 'Similar Products',
185
+ value: 'pz-similar-products'
186
+ },
187
+ {
188
+ name: 'Haso Payment Gateway',
189
+ value: 'pz-haso'
190
+ },
191
+ {
192
+ name: 'Google Pay',
193
+ value: 'pz-google-pay'
116
194
  }
117
195
  ];
118
196
 
119
- const prompt = new Prompt({
120
- name: 'plugins',
121
- message: 'Please check/uncheck plugins to install/uninstall.',
122
- type: 'checkbox',
123
- default: installedPlugins.map((p) =>
124
- definedPlugins.findIndex((dp) => dp.value === p)
125
- ),
126
- choices: definedPlugins.map((p, index) => `${index + 1}) ${p.name}`)
127
- });
128
-
129
- prompt.ask(async (answers: Array<string>) => {
130
- const formattedAnswers = answers.map((answer) =>
131
- answer.replace(/\d\)\s/, '')
132
- );
133
-
134
- const values = formattedAnswers.map(
135
- (answer) => definedPlugins.find((p) => p.name === answer)?.value
136
- );
137
-
138
- if (formattedAnswers.length) {
139
- console.log(`\nInstalling ${formattedAnswers.join(', ')}.`);
140
- } else {
141
- console.log(`\nUninstalling all plugins.`);
197
+ try {
198
+ const answers = await checkbox({
199
+ message: 'Please check/uncheck plugins to install/uninstall.',
200
+ choices: definedPlugins.map((plugin) => ({
201
+ name: plugin.name,
202
+ value: plugin.value,
203
+ checked: installedPlugins.includes(plugin.value)
204
+ }))
205
+ });
206
+
207
+ if (!answers.length) {
208
+ console.log('\x1b[33m%s\x1b[0m', `\nUninstalling all plugins.`);
142
209
  }
143
210
 
144
- console.log(`\nPlease wait...`);
211
+ console.log('\x1b[36m%s\x1b[0m', `\nPlease wait...`);
145
212
 
146
213
  fs.writeFileSync(
147
214
  pluginsFilePath,
148
- `module.exports = ${JSON.stringify(values)};\n`,
215
+ `module.exports = ${JSON.stringify(answers)};\n`,
149
216
  {
150
217
  encoding: 'utf-8'
151
218
  }
@@ -155,11 +222,13 @@ export default async () => {
155
222
 
156
223
  console.log(
157
224
  '\x1b[32m%s\x1b[0m',
158
- `\n ✓ ${
159
- formattedAnswers.length
225
+ `\n✓ ${
226
+ answers.length
160
227
  ? 'Installed selected plugins'
161
228
  : 'Uninstalled all plugins'
162
229
  }.\n`
163
230
  );
164
- });
231
+ } catch (error) {
232
+ process.exit(1);
233
+ }
165
234
  };
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ 'use client';
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const hooks_1 = require("@akinon/next/hooks");
8
+ const error_page_1 = __importDefault(require("@akinon/next/views/error-page"));
9
+ function ErrorPage({ error, reset }) {
10
+ // DO NOT REMOVE THIS LINE TO REPORT UNCAUGHT ERRORS TO SENTRY
11
+ (0, hooks_1.useSentryUncaughtErrors)(error);
12
+ return React.createElement(error_page_1.default, { error: error, reset: reset });
13
+ }
14
+ exports.default = ErrorPage;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const path_1 = __importDefault(require("path"));
7
+ const yargs = require('yargs/yargs');
8
+ const { hideBin } = require('yargs/helpers');
9
+ const args = yargs(hideBin(process.argv)).argv;
10
+ exports.default = () => {
11
+ const codemodName = args.codemod;
12
+ const codemodPath = path_1.default.resolve(__dirname, `../../codemods/${codemodName}/index.js`);
13
+ const codemod = require(codemodPath);
14
+ codemod.transform();
15
+ };
@@ -9,11 +9,13 @@ const add_language_1 = __importDefault(require("./add-language"));
9
9
  const remove_language_1 = __importDefault(require("./remove-language"));
10
10
  const default_language_1 = __importDefault(require("./default-language"));
11
11
  const plugins_1 = __importDefault(require("./plugins"));
12
+ const codemod_1 = __importDefault(require("./codemod"));
12
13
  exports.default = {
13
14
  commerceUrl: commerce_url_1.default,
14
15
  create: create_1.default,
15
16
  addLanguage: add_language_1.default,
16
17
  removeLanguage: remove_language_1.default,
17
18
  defaultLanguage: default_language_1.default,
18
- plugins: plugins_1.default
19
+ plugins: plugins_1.default,
20
+ codemod: codemod_1.default
19
21
  };
@@ -49,7 +49,7 @@ const fs = __importStar(require("fs"));
49
49
  const path_1 = __importDefault(require("path"));
50
50
  const child_process_1 = require("child_process");
51
51
  const semver_1 = __importDefault(require("semver"));
52
- const Prompt = require('prompt-checkbox');
52
+ const prompts_1 = require("@inquirer/prompts");
53
53
  const rootDir = path_1.default.resolve(process.cwd());
54
54
  function checkVersion(pkg) {
55
55
  return __awaiter(this, void 0, void 0, function* () {
@@ -94,74 +94,125 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
94
94
  process.exit(1);
95
95
  }
96
96
  const definedPlugins = [
97
+ {
98
+ name: 'Akifast',
99
+ value: 'pz-akifast'
100
+ },
101
+ {
102
+ name: 'Apple Pay',
103
+ value: 'pz-apple-pay'
104
+ },
105
+ {
106
+ name: 'B2B',
107
+ value: 'pz-b2b'
108
+ },
97
109
  {
98
110
  name: 'Basket Gift Pack',
99
111
  value: 'pz-basket-gift-pack'
100
112
  },
101
113
  {
102
- name: 'Click & Collect',
103
- value: 'pz-click-collect'
114
+ name: 'BKM Express',
115
+ value: 'pz-bkm'
104
116
  },
105
117
  {
106
118
  name: 'Checkout Gift Pack',
107
119
  value: 'pz-checkout-gift-pack'
108
120
  },
109
121
  {
110
- name: 'One Click Checkout',
111
- value: 'pz-one-click-checkout'
122
+ name: 'Click & Collect',
123
+ value: 'pz-click-collect'
124
+ },
125
+ {
126
+ name: 'Credit Payment',
127
+ value: 'pz-credit-payment'
112
128
  },
113
129
  {
114
130
  name: 'Garanti Pay',
115
131
  value: 'pz-gpay'
116
132
  },
117
133
  {
118
- name: 'Pay On Delivery',
119
- value: 'pz-pay-on-delivery'
134
+ name: 'Masterpass',
135
+ value: 'pz-masterpass'
120
136
  },
121
137
  {
122
- name: 'Otp',
123
- value: 'pz-otp'
138
+ name: 'Multi Basket',
139
+ value: 'pz-multi-basket'
124
140
  },
125
141
  {
126
- name: 'BKM Express',
127
- value: 'pz-bkm'
142
+ name: 'One Click Checkout',
143
+ value: 'pz-one-click-checkout'
128
144
  },
129
145
  {
130
- name: 'Credit Payment',
131
- value: 'pz-credit-payment'
146
+ name: 'Otp',
147
+ value: 'pz-otp'
132
148
  },
133
149
  {
134
- name: 'Multi Basket',
135
- value: 'pz-multi-basket'
150
+ name: 'Pay On Delivery',
151
+ value: 'pz-pay-on-delivery'
152
+ },
153
+ {
154
+ name: 'Saved Card',
155
+ value: 'pz-saved-card'
136
156
  },
137
157
  {
138
158
  name: 'Tabby Payment Extension',
139
159
  value: 'pz-tabby-extension'
160
+ },
161
+ {
162
+ name: 'Tamara Payment Extension',
163
+ value: 'pz-tamara-extension'
164
+ },
165
+ {
166
+ name: 'Hepsipay',
167
+ value: 'pz-hepsipay'
168
+ },
169
+ {
170
+ name: 'Flow Payment',
171
+ value: 'pz-flow-payment'
172
+ },
173
+ {
174
+ name: 'Virtual Try-On',
175
+ value: 'pz-virtual-try-on'
176
+ },
177
+ {
178
+ name: 'Masterpass Rest',
179
+ value: 'pz-masterpass-rest'
180
+ },
181
+ {
182
+ name: 'Similar Products',
183
+ value: 'pz-similar-products'
184
+ },
185
+ {
186
+ name: 'Haso Payment Gateway',
187
+ value: 'pz-haso'
188
+ },
189
+ {
190
+ name: 'Google Pay',
191
+ value: 'pz-google-pay'
140
192
  }
141
193
  ];
142
- const prompt = new Prompt({
143
- name: 'plugins',
144
- message: 'Please check/uncheck plugins to install/uninstall.',
145
- type: 'checkbox',
146
- default: installedPlugins.map((p) => definedPlugins.findIndex((dp) => dp.value === p)),
147
- choices: definedPlugins.map((p, index) => `${index + 1}) ${p.name}`)
148
- });
149
- prompt.ask((answers) => __awaiter(void 0, void 0, void 0, function* () {
150
- const formattedAnswers = answers.map((answer) => answer.replace(/\d\)\s/, ''));
151
- const values = formattedAnswers.map((answer) => { var _a; return (_a = definedPlugins.find((p) => p.name === answer)) === null || _a === void 0 ? void 0 : _a.value; });
152
- if (formattedAnswers.length) {
153
- console.log(`\nInstalling ${formattedAnswers.join(', ')}.`);
154
- }
155
- else {
156
- console.log(`\nUninstalling all plugins.`);
194
+ try {
195
+ const answers = yield (0, prompts_1.checkbox)({
196
+ message: 'Please check/uncheck plugins to install/uninstall.',
197
+ choices: definedPlugins.map((plugin) => ({
198
+ name: plugin.name,
199
+ value: plugin.value,
200
+ checked: installedPlugins.includes(plugin.value)
201
+ }))
202
+ });
203
+ if (!answers.length) {
204
+ console.log('\x1b[33m%s\x1b[0m', `\nUninstalling all plugins.`);
157
205
  }
158
- console.log(`\nPlease wait...`);
159
- fs.writeFileSync(pluginsFilePath, `module.exports = ${JSON.stringify(values)};\n`, {
206
+ console.log('\x1b[36m%s\x1b[0m', `\nPlease wait...`);
207
+ fs.writeFileSync(pluginsFilePath, `module.exports = ${JSON.stringify(answers)};\n`, {
160
208
  encoding: 'utf-8'
161
209
  });
162
210
  (0, child_process_1.execSync)('yarn install', { stdio: 'pipe' });
163
- console.log('\x1b[32m%s\x1b[0m', `\n ✓ ${formattedAnswers.length
211
+ console.log('\x1b[32m%s\x1b[0m', `\n✓ ${answers.length
164
212
  ? 'Installed selected plugins'
165
213
  : 'Uninstalled all plugins'}.\n`);
166
- }));
214
+ }
215
+ catch (error) {
216
+ process.exit(1);
217
+ }
167
218
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akinon/projectzero",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.0-beta.20",
4
4
  "private": false,
5
5
  "description": "CLI tool to manage your Project Zero Next project",
6
6
  "bin": {
@@ -19,8 +19,9 @@
19
19
  "@types/temp": "0.9.4"
20
20
  },
21
21
  "dependencies": {
22
+ "jscodeshift": "^0.15.1",
23
+ "@inquirer/prompts": "7.5.0",
22
24
  "loading-spinner": "1.2.1",
23
- "prompt-checkbox": "2.2.0",
24
25
  "semver": "7.6.2",
25
26
  "temp": "0.9.4",
26
27
  "yargs": "^17.6.0"
@@ -1,6 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- tailwindcss: {},
4
- autoprefixer: {}
5
- }
6
- };
@@ -1,16 +0,0 @@
1
- import { initSentry } from '@akinon/next/sentry';
2
-
3
- async function initializeSentry() {
4
- const response = await fetch('/api/sentry', { next: { revalidate: 0 } });
5
- const data = await response.json();
6
-
7
- const options = {
8
- dsn: data.dsn,
9
- integrations: [],
10
- tracesSampleRate: 1.0
11
- };
12
-
13
- initSentry('Client', options);
14
- }
15
-
16
- initializeSentry();
@@ -1,3 +0,0 @@
1
- import { initSentry } from '@akinon/next/sentry';
2
-
3
- initSentry('Edge');
@@ -1,4 +0,0 @@
1
- defaults.url=https://sentry.io/
2
- defaults.org=akinon
3
- defaults.project=console--zero-pwa
4
- cli.executable=node_modules/@sentry/cli/bin/sentry-cli
@@ -1,3 +0,0 @@
1
- import { initSentry } from '@akinon/next/sentry';
2
-
3
- initSentry('Server');