@mohasinac/appkit 2.8.10 → 3.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 (339) hide show
  1. package/dist/_internal/client/features/layout/SidebarCollapseToggle.js +1 -5
  2. package/dist/_internal/server/features/auctions/actions.js +0 -1
  3. package/dist/_internal/server/features/auctions/og.js +0 -1
  4. package/dist/_internal/server/features/auctions/service.js +0 -4
  5. package/dist/_internal/server/features/auth/capabilities.js +0 -1
  6. package/dist/_internal/server/features/blog/actions.js +0 -2
  7. package/dist/_internal/server/features/brands/actions.js +0 -2
  8. package/dist/_internal/server/features/cart/actions.js +0 -3
  9. package/dist/_internal/server/features/checkout/actions.js +11 -20
  10. package/dist/_internal/server/features/events/actions.js +0 -3
  11. package/dist/_internal/server/features/events/og.js +0 -1
  12. package/dist/_internal/server/features/events/service.js +0 -2
  13. package/dist/_internal/server/features/grouped/data.js +0 -2
  14. package/dist/_internal/server/features/orders/actions.js +0 -4
  15. package/dist/_internal/server/features/pre-orders/actions.js +0 -1
  16. package/dist/_internal/server/features/pre-orders/og.js +0 -1
  17. package/dist/_internal/server/features/pre-orders/service.js +0 -1
  18. package/dist/_internal/server/features/products/actions.js +0 -6
  19. package/dist/_internal/server/features/products/service.js +0 -1
  20. package/dist/_internal/server/features/promotions/actions.js +0 -3
  21. package/dist/_internal/server/features/reviews/actions.js +0 -3
  22. package/dist/_internal/server/functions/https.js +0 -6
  23. package/dist/_internal/server/functions/manifest.js +0 -1
  24. package/dist/_internal/server/jobs/core/cleanupRtdbEvents.js +1 -1
  25. package/dist/_internal/server/jobs/core/wrapJobHandler.js +0 -1
  26. package/dist/_internal/shared/listing-types/action-tracker.js +1 -1
  27. package/dist/_internal/shared/serialization/index.js +0 -4
  28. package/dist/_internal/shared/styles/themed.js +0 -3
  29. package/dist/client/api/ApiError.js +1 -4
  30. package/dist/client/api/surface-error.js +0 -1
  31. package/dist/client/api/useApiQuery.js +0 -1
  32. package/dist/configs/next.js +0 -1
  33. package/dist/configs/tailwind.js +0 -1
  34. package/dist/contracts/field-ops.js +0 -2
  35. package/dist/core/EventBus.js +0 -2
  36. package/dist/core/Logger.js +0 -6
  37. package/dist/core/Queue.js +0 -2
  38. package/dist/core/hooks/useSyncManager.js +4 -4
  39. package/dist/core/mutation-events.js +0 -1
  40. package/dist/core/newsletter.repository.js +2 -6
  41. package/dist/errors/api-error.js +0 -1
  42. package/dist/errors/authentication-error.js +0 -1
  43. package/dist/errors/authorization-error.js +0 -1
  44. package/dist/errors/base-error.js +1 -3
  45. package/dist/errors/database-error.js +0 -1
  46. package/dist/errors/error-handler.js +1 -5
  47. package/dist/errors/error-mapping.js +1 -6
  48. package/dist/errors/normalize.js +0 -4
  49. package/dist/errors/not-found-error.js +0 -1
  50. package/dist/errors/razorpay-unreachable.js +0 -1
  51. package/dist/errors/validation-error.js +0 -1
  52. package/dist/features/about/components/FAQPageView.js +1 -3
  53. package/dist/features/about/components/FeesView.js +1 -3
  54. package/dist/features/about/components/HelpPageView.js +1 -3
  55. package/dist/features/about/components/PublicProfileView.js +4 -4
  56. package/dist/features/account/components/AddressBook.js +1 -3
  57. package/dist/features/account/components/AddressForm.js +0 -1
  58. package/dist/features/account/components/AddressesIndexListing.js +0 -1
  59. package/dist/features/account/components/MessagesView.js +1 -3
  60. package/dist/features/account/components/NotificationBell.js +3 -14
  61. package/dist/features/account/components/NotificationPreferencesPanel.js +1 -1
  62. package/dist/features/account/components/UserOffersPanel.js +0 -2
  63. package/dist/features/account/components/UserSidebar.js +1 -3
  64. package/dist/features/admin/components/AdminBlogEditorView.js +0 -1
  65. package/dist/features/admin/components/AdminBundleEditorView.js +0 -1
  66. package/dist/features/admin/components/AdminBundlesView.js +0 -1
  67. package/dist/features/admin/components/AdminCarouselEditorView.js +1 -5
  68. package/dist/features/admin/components/AdminCarouselView.js +1 -4
  69. package/dist/features/admin/components/AdminCartsView.js +0 -1
  70. package/dist/features/admin/components/AdminMediaView.js +1 -3
  71. package/dist/features/admin/components/AdminPayoutsView.js +0 -1
  72. package/dist/features/admin/components/AdminProductsView.js +1 -3
  73. package/dist/features/admin/components/AdminSidebar.js +1 -3
  74. package/dist/features/admin/components/AdminSiteSettingsView.js +1 -5
  75. package/dist/features/admin/components/AdminSupportTicketDetailView.js +7 -13
  76. package/dist/features/admin/components/DashboardStats.js +1 -7
  77. package/dist/features/admin/components/DataListingView.js +1 -5
  78. package/dist/features/admin/components/DataTable.js +1 -3
  79. package/dist/features/admin/components/analytics/AdminAnalyticsCharts.js +1 -3
  80. package/dist/features/admin/components/analytics/AdminStatCard.js +1 -7
  81. package/dist/features/admin/components/analytics/AdminTopProductsTable.js +1 -3
  82. package/dist/features/admin/components/sections/adminSectionsBuildParse.js +0 -5
  83. package/dist/features/admin/hooks/useAdminListingData.js +0 -5
  84. package/dist/features/admin/hooks/useChat.js +0 -3
  85. package/dist/features/admin/repository/chat.repository.js +0 -1
  86. package/dist/features/admin/repository/notification.repository.js +1 -4
  87. package/dist/features/auctions/components/AuctionBidsTable.js +1 -7
  88. package/dist/features/auctions/components/AuctionDetailPageView.js +1 -6
  89. package/dist/features/auctions/components/MarketplaceAuctionCard.js +3 -15
  90. package/dist/features/auctions/components/PlaceBidFormClient.js +0 -3
  91. package/dist/features/auctions/repository/bid.repository.js +0 -1
  92. package/dist/features/auth/components/ForgotPasswordView.js +0 -1
  93. package/dist/features/auth/components/LoginForm.js +0 -1
  94. package/dist/features/auth/components/RegisterForm.js +0 -1
  95. package/dist/features/auth/components/ResetPasswordView.js +0 -1
  96. package/dist/features/auth/hooks/useAuth.js +0 -1
  97. package/dist/features/auth/repository/session.repository.js +0 -1
  98. package/dist/features/auth/repository/token.repository.js +0 -2
  99. package/dist/features/auth/repository/user.repository.js +0 -1
  100. package/dist/features/blog/api/[slug]/route.js +1 -1
  101. package/dist/features/blog/components/BlogFeaturedCard.js +1 -5
  102. package/dist/features/blog/components/BlogIndexListing.js +0 -1
  103. package/dist/features/blog/components/BlogListView.js +1 -5
  104. package/dist/features/blog/components/BlogPostView.js +1 -3
  105. package/dist/features/cart/components/CartDrawer.js +2 -6
  106. package/dist/features/cart/repository/cart.repository.js +0 -1
  107. package/dist/features/categories/api/route.js +0 -1
  108. package/dist/features/categories/components/BrandDetailPageView.js +1 -13
  109. package/dist/features/categories/components/BundleDetailView.js +1 -5
  110. package/dist/features/categories/components/BundleItemsPicker.js +1 -5
  111. package/dist/features/categories/components/CategoriesIndexListing.js +0 -1
  112. package/dist/features/categories/components/CategoriesIndexPageView.js +0 -1
  113. package/dist/features/categories/components/CategoryBundlesListing.js +1 -3
  114. package/dist/features/categories/components/CategoryDetailPageView.js +1 -16
  115. package/dist/features/categories/components/CategoryGrid.js +1 -5
  116. package/dist/features/categories/components/CategorySelectorCreate.js +0 -1
  117. package/dist/features/categories/components/CategoryTableColumns.js +2 -6
  118. package/dist/features/categories/components/CategoryTree.js +1 -3
  119. package/dist/features/categories/components/ConcernCard.js +1 -3
  120. package/dist/features/collections/components/CollectionCard.js +1 -5
  121. package/dist/features/contact/email.js +0 -1
  122. package/dist/features/events/actions/event-actions.js +0 -1
  123. package/dist/features/events/api/[id]/route.js +0 -1
  124. package/dist/features/events/components/AdminEventEditorView.js +1 -2
  125. package/dist/features/events/components/EventCard.js +2 -8
  126. package/dist/features/events/components/EventRaffleEntryForm.js +1 -3
  127. package/dist/features/events/components/EventRaffleWinnerView.js +1 -3
  128. package/dist/features/events/components/EventRafflesSection.js +0 -1
  129. package/dist/features/events/components/EventsIndexListing.js +0 -1
  130. package/dist/features/events/hooks/useBulkEvent.js +0 -1
  131. package/dist/features/events/repository/event-entry.repository.js +0 -1
  132. package/dist/features/faq/components/ContactCTA.js +1 -3
  133. package/dist/features/faq/components/FAQAccordion.js +1 -3
  134. package/dist/features/faq/components/FAQCategorySidebar.js +1 -3
  135. package/dist/features/faq/components/RelatedFAQs.js +1 -5
  136. package/dist/features/filters/AsyncFacetSection.js +1 -3
  137. package/dist/features/filters/FilterFacetSection.js +4 -14
  138. package/dist/features/forms/Checkbox.js +1 -3
  139. package/dist/features/forms/Slider.js +1 -3
  140. package/dist/features/history/hooks/useHistory.js +0 -1
  141. package/dist/features/history/repository/user-history.repository.js +0 -2
  142. package/dist/features/homepage/actions/carousel-actions.js +0 -1
  143. package/dist/features/homepage/actions/homepage-section-actions.js +1 -3
  144. package/dist/features/homepage/api/carousel/route.js +0 -1
  145. package/dist/features/homepage/api/route.js +0 -1
  146. package/dist/features/homepage/components/AdSlot.js +3 -9
  147. package/dist/features/homepage/components/AdvertisementBanner.js +2 -12
  148. package/dist/features/homepage/components/BeforeAfterCard.js +1 -5
  149. package/dist/features/homepage/components/CharacterHotspotForm.js +2 -10
  150. package/dist/features/homepage/components/CollectionCardsSection.js +1 -3
  151. package/dist/features/homepage/components/CustomCardsSection.js +1 -5
  152. package/dist/features/homepage/components/FeaturedResultsSection.js +1 -3
  153. package/dist/features/homepage/components/GoogleReviewsSection.js +1 -3
  154. package/dist/features/homepage/components/HeroCarousel.js +5 -26
  155. package/dist/features/homepage/components/HeroSection.js +2 -6
  156. package/dist/features/homepage/components/HowItWorksSection.js +2 -8
  157. package/dist/features/homepage/components/MarketplaceHomepageView.js +0 -8
  158. package/dist/features/homepage/components/NewsletterBanner.js +2 -10
  159. package/dist/features/homepage/components/PromoGrid.js +1 -3
  160. package/dist/features/homepage/components/SecurityHighlightsSection.js +2 -6
  161. package/dist/features/homepage/components/ShopByCategorySection.js +2 -6
  162. package/dist/features/homepage/components/SocialPostCard.js +1 -3
  163. package/dist/features/homepage/components/StatsCounterSection.js +1 -5
  164. package/dist/features/homepage/components/TrustBadges.js +1 -3
  165. package/dist/features/homepage/components/TrustFeaturesSection.js +1 -3
  166. package/dist/features/homepage/components/WelcomeSection.js +2 -16
  167. package/dist/features/homepage/components/WhatsAppCommunitySection.js +1 -5
  168. package/dist/features/homepage/lib/social-feed-fetcher.js +0 -8
  169. package/dist/features/layout/AppLayoutShell.js +1 -3
  170. package/dist/features/layout/BottomNavbar.js +1 -11
  171. package/dist/features/media/MediaAudio.js +2 -6
  172. package/dist/features/media/MediaImage.js +0 -1
  173. package/dist/features/media/MediaLightbox.js +3 -9
  174. package/dist/features/media/MediaVideo.js +2 -8
  175. package/dist/features/media/upload/MediaUploadField.js +1 -3
  176. package/dist/features/messages/hooks/useConversation.js +0 -2
  177. package/dist/features/messages/hooks/useConversations.js +0 -1
  178. package/dist/features/messages/repository/conversations.repository.js +0 -1
  179. package/dist/features/orders/api/track/[trackingId]/route.js +0 -1
  180. package/dist/features/orders/components/OrdersList.js +1 -3
  181. package/dist/features/orders/components/RefundHistoryTable.js +1 -3
  182. package/dist/features/orders/repository/orders.repository.js +0 -2
  183. package/dist/features/payments/repository/payout.repository.js +0 -1
  184. package/dist/features/pre-orders/components/MarketplacePreorderCard.js +2 -6
  185. package/dist/features/pre-orders/components/PreOrderActionsClient.js +0 -1
  186. package/dist/features/pre-orders/components/PreOrderBadge.js +1 -3
  187. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +1 -5
  188. package/dist/features/products/api/route.js +1 -3
  189. package/dist/features/products/components/CompareOverlay.js +1 -6
  190. package/dist/features/products/components/FeatureBadge.js +1 -3
  191. package/dist/features/products/components/MakeOfferButton.js +0 -2
  192. package/dist/features/products/components/MarketplaceBundleCard.js +1 -3
  193. package/dist/features/products/components/MarketplacePrizeDrawCard.js +1 -3
  194. package/dist/features/products/components/PrizeDrawDetailPageView.js +0 -2
  195. package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -3
  196. package/dist/features/products/components/PrizeDrawsSection.js +1 -3
  197. package/dist/features/products/components/ProductDetailPageView.js +0 -6
  198. package/dist/features/products/components/ProductFeatureBadges.js +1 -3
  199. package/dist/features/products/components/ProductFeaturesSelector.js +0 -1
  200. package/dist/features/products/components/ProductGrid.js +5 -15
  201. package/dist/features/products/components/ShareButton.js +1 -1
  202. package/dist/features/products/components/ShowGroupSection.js +3 -7
  203. package/dist/features/products/components/SublistingCarouselSection.js +2 -4
  204. package/dist/features/products/repository/product-features.repository.js +0 -1
  205. package/dist/features/products/repository/products.repository.js +0 -1
  206. package/dist/features/promotions/components/CouponCard.js +2 -5
  207. package/dist/features/promotions/repository/coupons.repository.js +0 -1
  208. package/dist/features/reviews/api/route.js +0 -1
  209. package/dist/features/reviews/components/ReviewDetailShell.js +3 -13
  210. package/dist/features/reviews/components/ReviewModal.js +1 -5
  211. package/dist/features/reviews/components/ReviewSummary.js +2 -6
  212. package/dist/features/reviews/components/ReviewsIndexListing.js +0 -1
  213. package/dist/features/reviews/components/ReviewsList.js +1 -7
  214. package/dist/features/reviews/repository/reviews.repository.js +0 -3
  215. package/dist/features/scams/actions/scam-actions.js +1 -1
  216. package/dist/features/scams/components/ScamProfileView.js +1 -3
  217. package/dist/features/search/components/Search.js +2 -8
  218. package/dist/features/search/components/SearchFiltersRow.js +1 -3
  219. package/dist/features/seller/components/PhysicalLocationModal.js +1 -5
  220. package/dist/features/seller/components/SellerAddressesView.js +1 -6
  221. package/dist/features/seller/components/SellerAnalyticsAlertsView.js +1 -4
  222. package/dist/features/seller/components/SellerBidsView.js +1 -3
  223. package/dist/features/seller/components/SellerBundlesView.js +0 -1
  224. package/dist/features/seller/components/SellerCouponEditorView.js +1 -3
  225. package/dist/features/seller/components/SellerFeaturesView.js +0 -1
  226. package/dist/features/seller/components/SellerGoogleReviewsView.js +1 -1
  227. package/dist/features/seller/components/SellerLiveView.js +1 -3
  228. package/dist/features/seller/components/SellerOffersPanel.js +0 -2
  229. package/dist/features/seller/components/SellerOrdersView.js +1 -6
  230. package/dist/features/seller/components/SellerPayoutMethodsView.js +0 -1
  231. package/dist/features/seller/components/SellerPayoutRequestView.js +1 -1
  232. package/dist/features/seller/components/SellerPayoutSettingsView.js +1 -1
  233. package/dist/features/seller/components/SellerProductShell.js +2 -4
  234. package/dist/features/seller/components/SellerProductsCards.js +1 -3
  235. package/dist/features/seller/components/SellerProductsView.js +1 -7
  236. package/dist/features/seller/components/SellerReviewsView.js +1 -4
  237. package/dist/features/seller/components/SellerShippingConfigsView.js +1 -4
  238. package/dist/features/seller/components/SellerShippingView.js +1 -1
  239. package/dist/features/seller/components/SellerSidebar.js +4 -12
  240. package/dist/features/seller/components/SellerStoreCategoriesView.js +0 -2
  241. package/dist/features/seller/components/SellerTemplatesView.js +0 -1
  242. package/dist/features/seller/components/analytics/SellerRevenueChart.js +1 -3
  243. package/dist/features/seller/components/analytics/SellerTopProducts.js +1 -3
  244. package/dist/features/seller/hooks/useSellerListingData.js +0 -5
  245. package/dist/features/seller/repository/offer.repository.js +0 -1
  246. package/dist/features/server-errors/repository/server-errors.repository.js +0 -2
  247. package/dist/features/shell/FormShell.js +2 -15
  248. package/dist/features/shell/QuickFormDrawer.js +1 -5
  249. package/dist/features/site-settings/components/NavPermissionsManager.js +1 -3
  250. package/dist/features/site-settings/components/ThemeManagerView.js +0 -1
  251. package/dist/features/stores/api/[storeSlug]/reviews/route.js +0 -1
  252. package/dist/features/stores/components/StoreGuideHubView.js +1 -1
  253. package/dist/features/stores/components/StoreHeader.js +1 -7
  254. package/dist/features/stores/components/StoreReviewsListing.js +0 -1
  255. package/dist/features/stores/components/StoresIndexListing.js +0 -1
  256. package/dist/features/stores/repository/store.repository.js +0 -2
  257. package/dist/features/support/repository/support.repository.js +0 -1
  258. package/dist/features/wishlist/components/WishlistPage.js +1 -3
  259. package/dist/features/wishlist/hooks/useWishlistCount.js +1 -1
  260. package/dist/features/wishlist/repository/user-wishlist.repository.js +0 -2
  261. package/dist/http/ApiClient.js +4 -12
  262. package/dist/index.js +0 -1
  263. package/dist/monitoring/client-logger.js +7 -22
  264. package/dist/monitoring/error-tracking.js +0 -1
  265. package/dist/monitoring/performance.js +0 -1
  266. package/dist/monitoring/server-logger.js +11 -33
  267. package/dist/next/api/api-response.js +1 -4
  268. package/dist/next/api/apiHandler.js +1 -5
  269. package/dist/next/api/errorHandler.js +0 -3
  270. package/dist/next/api/parseJsonBody.js +0 -1
  271. package/dist/next/api/routeHandler.js +1 -8
  272. package/dist/next/cache-middleware.js +1 -3
  273. package/dist/next/middleware/chain.js +0 -1
  274. package/dist/next/middleware/pii-scrubber.js +0 -2
  275. package/dist/providers/auth-firebase/provider.js +0 -1
  276. package/dist/providers/db-firebase/admin.js +0 -1
  277. package/dist/providers/db-firebase/base.js +0 -4
  278. package/dist/providers/db-firebase/base.repository.js +0 -3
  279. package/dist/providers/db-firebase/field-ops.js +0 -2
  280. package/dist/providers/db-firebase/helpers.js +0 -4
  281. package/dist/providers/db-firebase/realtime.js +3 -15
  282. package/dist/providers/db-firebase/sieve.js +2 -8
  283. package/dist/providers/payment-razorpay/index.js +0 -3
  284. package/dist/providers/shipping-shiprocket/index.js +0 -1
  285. package/dist/providers/storage-firebase/client.js +0 -4
  286. package/dist/react/contexts/SessionContext.js +0 -1
  287. package/dist/react/hooks/useCountdown.js +0 -1
  288. package/dist/security/authorization.js +0 -1
  289. package/dist/security/pii-encrypt.js +0 -4
  290. package/dist/security/pii-redact.js +0 -3
  291. package/dist/seed/manifest.js +1 -6
  292. package/dist/seed/runner.js +0 -2
  293. package/dist/styles.css +1 -1
  294. package/dist/tailwind-utilities.css +1 -1
  295. package/dist/ui/DataTable.js +2 -6
  296. package/dist/ui/components/Anchor.js +0 -1
  297. package/dist/ui/components/AvatarDisplay.js +1 -3
  298. package/dist/ui/components/BackgroundRenderer.js +2 -6
  299. package/dist/ui/components/BaseListingCard.js +0 -1
  300. package/dist/ui/components/Button.js +0 -4
  301. package/dist/ui/components/Card.js +2 -6
  302. package/dist/ui/components/Details.js +2 -8
  303. package/dist/ui/components/Dialog.js +0 -1
  304. package/dist/ui/components/FallbackShell.js +5 -17
  305. package/dist/ui/components/Fieldset.js +2 -6
  306. package/dist/ui/components/HorizontalRule.js +0 -1
  307. package/dist/ui/components/HotspotMarker.js +1 -3
  308. package/dist/ui/components/IconBox.js +0 -1
  309. package/dist/ui/components/Iframe.js +0 -1
  310. package/dist/ui/components/ImageGallery.js +1 -3
  311. package/dist/ui/components/ImageLightbox.js +1 -5
  312. package/dist/ui/components/Kbd.js +0 -1
  313. package/dist/ui/components/Motion.js +1 -3
  314. package/dist/ui/components/NavbarChevron.js +0 -1
  315. package/dist/ui/components/PasswordStrengthIndicator.js +1 -3
  316. package/dist/ui/components/Progress.js +2 -6
  317. package/dist/ui/components/Quote.js +1 -4
  318. package/dist/ui/components/Responsive.js +0 -4
  319. package/dist/ui/components/RowActionMenu.js +1 -3
  320. package/dist/ui/components/Scrim.js +0 -1
  321. package/dist/ui/components/SiteLogo.js +1 -9
  322. package/dist/ui/components/Skeleton.js +1 -3
  323. package/dist/ui/components/Slider.js +1 -3
  324. package/dist/ui/components/StickyToolbar.js +0 -1
  325. package/dist/ui/components/TabStrip.js +1 -3
  326. package/dist/ui/components/Toast.js +1 -3
  327. package/dist/ui/components/Tooltip.js +1 -4
  328. package/dist/ui/components/UnsavedChangesModal.js +1 -3
  329. package/dist/ui/rich-text/RichText.js +1 -1
  330. package/dist/utils/action-response.js +0 -1
  331. package/dist/utils/date.formatter.js +0 -1
  332. package/dist/utils/object.helper.js +0 -2
  333. package/dist/utils/schema-ui.js +1 -3
  334. package/dist/validation/input.validator.js +0 -1
  335. package/dist/validation/schemas.js +1 -3
  336. package/package.json +5 -2
  337. package/scripts/bundle-css.mjs +47 -0
  338. package/scripts/copy-assets.mjs +34 -0
  339. package/scripts/dedupe-peer-deps.mjs +81 -0
@@ -112,9 +112,7 @@ const DEFAULT_OMIT = ["id", "createdAt", "updatedAt", "deletedAt"];
112
112
  * @param options Optional config: `omit`, `include`.
113
113
  * @returns Array of `DerivedField` descriptors, one per schema property.
114
114
  */
115
- export function deriveFormFields(
116
- // audit-unknown-ok: Zod schema UI introspection — schema is caller-defined
117
- schema, options = {}) {
115
+ export function deriveFormFields(schema, options = {}) {
118
116
  const zodLike = schema;
119
117
  // Unwrap ZodEffects to reach the ZodObject
120
118
  const unwrapped = unwrapZodType(zodLike);
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * General Input Validation Utilities
3
3
  */
4
- // audit-unknown-ok: type-narrowing entry point — accepts any value, narrows by typeof/Array.isArray
5
4
  export function isRequired(value) {
6
5
  if (value === null || value === undefined)
7
6
  return false;
@@ -185,9 +185,7 @@ export const trimDataSchema = z
185
185
  // ============================================
186
186
  // REQUEST VALIDATION HELPERS
187
187
  // ============================================
188
- export function validateRequestBody(schema,
189
- // audit-unknown-ok: callback entry point — accepts arbitrary payload value
190
- body) {
188
+ export function validateRequestBody(schema, body) {
191
189
  const result = schema.safeParse(body);
192
190
  if (result.success) {
193
191
  return { success: true, data: result.data };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.8.10",
3
+ "version": "3.0.1",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -124,7 +124,10 @@
124
124
  "scripts/init-config.mjs",
125
125
  "scripts/labels-extract.mjs",
126
126
  "scripts/seed-cli.mjs",
127
- "scripts/seed-cli-loader.mjs"
127
+ "scripts/seed-cli-loader.mjs",
128
+ "scripts/dedupe-peer-deps.mjs",
129
+ "scripts/copy-assets.mjs",
130
+ "scripts/bundle-css.mjs"
128
131
  ],
129
132
  "bin": {
130
133
  "appkit-sieve-audit": "./scripts/sieve-audit.mjs",
@@ -0,0 +1,47 @@
1
+ /**
2
+ * bundle-css.mjs — Flatten all @import chains in dist/styles.css into a single
3
+ * concatenated file. Turbopack (Next.js 16+) does not reliably resolve nested
4
+ * CSS @import chains from node_modules, so shipping a flat file is the safest
5
+ * approach for both webpack and Turbopack consumers.
6
+ *
7
+ * Runs after copy-assets.mjs + tailwindcss build, so dist/ already has every
8
+ * individual .style.css and tokens.css file.
9
+ */
10
+ import { readFileSync, writeFileSync } from "fs";
11
+ import { join, dirname, resolve } from "path";
12
+
13
+ const DIST = new URL("../dist", import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1");
14
+ const ENTRY = join(DIST, "styles.css");
15
+
16
+ const seen = new Set();
17
+
18
+ function stripComments(css) {
19
+ return css.replace(/\/\*[\s\S]*?\*\//g, match => " ".repeat(match.length));
20
+ }
21
+
22
+ function inlineImports(filePath) {
23
+ if (seen.has(filePath)) return "";
24
+ seen.add(filePath);
25
+
26
+ const css = readFileSync(filePath, "utf8");
27
+ const dir = dirname(filePath);
28
+ const stripped = stripComments(css);
29
+
30
+ return css.replace(/@import\s+["']([^"']+)["']\s*;/g, (_match, relPath, offset) => {
31
+ if (stripped.substring(offset, offset + _match.length).trim() === "") return _match;
32
+ const resolved = resolve(dir, relPath);
33
+ try {
34
+ return inlineImports(resolved);
35
+ } catch (err) {
36
+ console.error(`[bundle-css] WARNING: could not resolve @import "${relPath}" from ${filePath}`);
37
+ return _match;
38
+ }
39
+ });
40
+ }
41
+
42
+ const bundled = inlineImports(ENTRY);
43
+ writeFileSync(ENTRY, bundled, "utf8");
44
+
45
+ const lines = bundled.split("\n").length;
46
+ const bytes = Buffer.byteLength(bundled, "utf8");
47
+ console.log(`[bundle-css] Bundled ${seen.size} CSS files into dist/styles.css (${lines} lines, ${(bytes / 1024).toFixed(1)} KB)`);
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Post-build: copy non-TypeScript assets (CSS, etc.) from src/ to dist/
3
+ * preserving the directory structure.
4
+ */
5
+ import { readdir, copyFile, mkdir, stat } from "fs/promises";
6
+ import { join, relative, dirname, extname } from "path";
7
+
8
+ const ASSET_EXTENSIONS = new Set([".css", ".json", ".svg", ".png"]);
9
+ const SRC = new URL("../src", import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1");
10
+ const DIST = new URL("../dist", import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, "$1");
11
+
12
+ async function walk(dir) {
13
+ const entries = await readdir(dir, { withFileTypes: true });
14
+ const files = [];
15
+ for (const entry of entries) {
16
+ const full = join(dir, entry.name);
17
+ if (entry.isDirectory()) {
18
+ files.push(...(await walk(full)));
19
+ } else if (ASSET_EXTENSIONS.has(extname(entry.name))) {
20
+ files.push(full);
21
+ }
22
+ }
23
+ return files;
24
+ }
25
+
26
+ const assets = await walk(SRC);
27
+ for (const src of assets) {
28
+ const rel = relative(SRC, src);
29
+ const dst = join(DIST, rel);
30
+ await mkdir(dirname(dst), { recursive: true });
31
+ await copyFile(src, dst);
32
+ }
33
+
34
+ console.log(`Copied ${assets.length} asset file(s) to dist/`);
@@ -0,0 +1,81 @@
1
+ #!/usr/bin/env node
2
+ /*
3
+ * dedupe-peer-deps.mjs — postinstall hook
4
+ *
5
+ * Prevents the Turbopack "dual-instance" SSR crash that bit prod on 2026-06-10
6
+ * (appkit 2.8.8 → "No QueryClient set" on every server-rendered route).
7
+ *
8
+ * Root cause: when appkit is used as a local-file/submodule dependency
9
+ * (consumer's `package.json` uses `"@mohasinac/appkit": "file:./appkit"`),
10
+ * running `cd appkit && npm install` populates `appkit/node_modules/` with
11
+ * the same peerDependencies that the consumer already has at its root
12
+ * `node_modules/`. Turbopack 16 then resolves appkit-internal imports of those
13
+ * packages to the *appkit-local* copy while the consumer's imports resolve to
14
+ * the root copy — producing two separate `QueryClientContext` instances (and
15
+ * two of every other React context the peer deps use). useContext mismatches
16
+ * crash SSR.
17
+ *
18
+ * Fix: after any `npm install` inside appkit, delete the peer-dep duplicates.
19
+ * Node's module resolution walks up to the consumer's `node_modules/`, so all
20
+ * imports — both from appkit's own tsc and from Turbopack — land on the single
21
+ * consumer copy.
22
+ *
23
+ * This is idempotent and silent when there's nothing to delete (e.g. when
24
+ * appkit is consumed from npm where peerDeps were never installed).
25
+ */
26
+ import { readFileSync, readdirSync, rmSync, existsSync } from "node:fs";
27
+ import { fileURLToPath } from "node:url";
28
+ import { dirname, resolve } from "node:path";
29
+
30
+ const here = dirname(fileURLToPath(import.meta.url));
31
+ const pkgPath = resolve(here, "..", "package.json");
32
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
33
+ const peers = Object.keys(pkg.peerDependencies || {});
34
+
35
+ // Packages to remove:
36
+ // 1. Every entry in peerDependencies.
37
+ // 2. Transitive runtime deps of peers that ship their own React context (or any
38
+ // other top-level singleton). Pruning the peer alone is not enough — the
39
+ // transitive carries the duplicate context. List them explicitly so we
40
+ // never accidentally prune type-only packages.
41
+ const TRANSITIVE_RUNTIME_DUPS = [
42
+ // @tanstack/react-query (peer) → bundles @tanstack/query-core, which owns
43
+ // QueryClientContext. Without this prune, Turbopack picks up the appkit-local
44
+ // query-core and a parallel QueryClientContext instance ships in the SSR
45
+ // bundle, producing the "No QueryClient set" crash on every page (2026-06-11).
46
+ "@tanstack/query-core",
47
+ ];
48
+
49
+ const removed = [];
50
+
51
+ function removeIfPresent(absPath, label) {
52
+ if (existsSync(absPath)) {
53
+ rmSync(absPath, { recursive: true, force: true });
54
+ removed.push(label);
55
+ }
56
+ }
57
+
58
+ for (const dep of [...peers, ...TRANSITIVE_RUNTIME_DUPS]) {
59
+ removeIfPresent(resolve(here, "..", "node_modules", dep), dep);
60
+ }
61
+
62
+ // Clean up now-empty scope dirs (e.g. @tanstack/) so subsequent `npm install`
63
+ // doesn't trip on a phantom entry.
64
+ const scopesTouched = new Set();
65
+ for (const dep of [...peers, ...TRANSITIVE_RUNTIME_DUPS]) {
66
+ if (dep.startsWith("@")) scopesTouched.add(dep.split("/")[0]);
67
+ }
68
+ for (const scope of scopesTouched) {
69
+ const scopeDir = resolve(here, "..", "node_modules", scope);
70
+ try {
71
+ if (existsSync(scopeDir) && readdirSync(scopeDir).length === 0) {
72
+ rmSync(scopeDir, { recursive: true, force: true });
73
+ }
74
+ } catch {}
75
+ }
76
+
77
+ if (removed.length > 0) {
78
+ console.log(
79
+ `[appkit/postinstall] removed ${removed.length} peer-dep duplicate(s) from appkit/node_modules: ${removed.join(", ")}`,
80
+ );
81
+ }