@doswiftly/cli 0.1.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 (453) hide show
  1. package/README.md +357 -0
  2. package/bin/doswiftly.js +2 -0
  3. package/dist/commands/auth-github.d.ts +6 -0
  4. package/dist/commands/auth-github.d.ts.map +1 -0
  5. package/dist/commands/auth-github.js +89 -0
  6. package/dist/commands/auth-github.js.map +1 -0
  7. package/dist/commands/auth-token.d.ts +12 -0
  8. package/dist/commands/auth-token.d.ts.map +1 -0
  9. package/dist/commands/auth-token.js +43 -0
  10. package/dist/commands/auth-token.js.map +1 -0
  11. package/dist/commands/auth.d.ts +22 -0
  12. package/dist/commands/auth.d.ts.map +1 -0
  13. package/dist/commands/auth.js +348 -0
  14. package/dist/commands/auth.js.map +1 -0
  15. package/dist/commands/check.d.ts +5 -0
  16. package/dist/commands/check.d.ts.map +1 -0
  17. package/dist/commands/check.js +234 -0
  18. package/dist/commands/check.js.map +1 -0
  19. package/dist/commands/config.d.ts +3 -0
  20. package/dist/commands/config.d.ts.map +1 -0
  21. package/dist/commands/config.js +104 -0
  22. package/dist/commands/config.js.map +1 -0
  23. package/dist/commands/deploy.d.ts +37 -0
  24. package/dist/commands/deploy.d.ts.map +1 -0
  25. package/dist/commands/deploy.js +580 -0
  26. package/dist/commands/deploy.js.map +1 -0
  27. package/dist/commands/dev.d.ts +8 -0
  28. package/dist/commands/dev.d.ts.map +1 -0
  29. package/dist/commands/dev.js +83 -0
  30. package/dist/commands/dev.js.map +1 -0
  31. package/dist/commands/doctor.d.ts +5 -0
  32. package/dist/commands/doctor.d.ts.map +1 -0
  33. package/dist/commands/doctor.js +363 -0
  34. package/dist/commands/doctor.js.map +1 -0
  35. package/dist/commands/domain.d.ts +13 -0
  36. package/dist/commands/domain.d.ts.map +1 -0
  37. package/dist/commands/domain.js +128 -0
  38. package/dist/commands/domain.js.map +1 -0
  39. package/dist/commands/env.d.ts +25 -0
  40. package/dist/commands/env.d.ts.map +1 -0
  41. package/dist/commands/env.js +228 -0
  42. package/dist/commands/env.js.map +1 -0
  43. package/dist/commands/init.d.ts +11 -0
  44. package/dist/commands/init.d.ts.map +1 -0
  45. package/dist/commands/init.js +1028 -0
  46. package/dist/commands/init.js.map +1 -0
  47. package/dist/commands/inspect.d.ts +12 -0
  48. package/dist/commands/inspect.d.ts.map +1 -0
  49. package/dist/commands/inspect.js +162 -0
  50. package/dist/commands/inspect.js.map +1 -0
  51. package/dist/commands/migrate.d.ts +18 -0
  52. package/dist/commands/migrate.d.ts.map +1 -0
  53. package/dist/commands/migrate.js +355 -0
  54. package/dist/commands/migrate.js.map +1 -0
  55. package/dist/commands/preview.d.ts +29 -0
  56. package/dist/commands/preview.d.ts.map +1 -0
  57. package/dist/commands/preview.js +199 -0
  58. package/dist/commands/preview.js.map +1 -0
  59. package/dist/commands/proxy.d.ts +9 -0
  60. package/dist/commands/proxy.d.ts.map +1 -0
  61. package/dist/commands/proxy.js +37 -0
  62. package/dist/commands/proxy.js.map +1 -0
  63. package/dist/commands/sdk.d.ts +5 -0
  64. package/dist/commands/sdk.d.ts.map +1 -0
  65. package/dist/commands/sdk.js +82 -0
  66. package/dist/commands/sdk.js.map +1 -0
  67. package/dist/commands/template.d.ts +107 -0
  68. package/dist/commands/template.d.ts.map +1 -0
  69. package/dist/commands/template.js +1309 -0
  70. package/dist/commands/template.js.map +1 -0
  71. package/dist/commands/types.d.ts +5 -0
  72. package/dist/commands/types.d.ts.map +1 -0
  73. package/dist/commands/types.js +82 -0
  74. package/dist/commands/types.js.map +1 -0
  75. package/dist/commands/update.d.ts +2 -0
  76. package/dist/commands/update.d.ts.map +1 -0
  77. package/dist/commands/update.js +103 -0
  78. package/dist/commands/update.js.map +1 -0
  79. package/dist/commands/upgrade.d.ts +18 -0
  80. package/dist/commands/upgrade.d.ts.map +1 -0
  81. package/dist/commands/upgrade.js +55 -0
  82. package/dist/commands/upgrade.js.map +1 -0
  83. package/dist/commands/verify.d.ts +5 -0
  84. package/dist/commands/verify.d.ts.map +1 -0
  85. package/dist/commands/verify.js +232 -0
  86. package/dist/commands/verify.js.map +1 -0
  87. package/dist/commands/whoami.d.ts +5 -0
  88. package/dist/commands/whoami.d.ts.map +1 -0
  89. package/dist/commands/whoami.js +60 -0
  90. package/dist/commands/whoami.js.map +1 -0
  91. package/dist/config/types.d.ts +173 -0
  92. package/dist/config/types.d.ts.map +1 -0
  93. package/dist/config/types.js +48 -0
  94. package/dist/config/types.js.map +1 -0
  95. package/dist/index.d.ts +3 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +416 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/lib/api-url.d.ts +14 -0
  100. package/dist/lib/api-url.d.ts.map +1 -0
  101. package/dist/lib/api-url.js +24 -0
  102. package/dist/lib/api-url.js.map +1 -0
  103. package/dist/lib/api.d.ts +67 -0
  104. package/dist/lib/api.d.ts.map +1 -0
  105. package/dist/lib/api.js +36 -0
  106. package/dist/lib/api.js.map +1 -0
  107. package/dist/lib/config.d.ts +39 -0
  108. package/dist/lib/config.d.ts.map +1 -0
  109. package/dist/lib/config.js +195 -0
  110. package/dist/lib/config.js.map +1 -0
  111. package/dist/lib/env-storage.d.ts +140 -0
  112. package/dist/lib/env-storage.d.ts.map +1 -0
  113. package/dist/lib/env-storage.js +464 -0
  114. package/dist/lib/env-storage.js.map +1 -0
  115. package/dist/lib/errors.d.ts +61 -0
  116. package/dist/lib/errors.d.ts.map +1 -0
  117. package/dist/lib/errors.js +204 -0
  118. package/dist/lib/errors.js.map +1 -0
  119. package/dist/lib/i18n.d.ts +99 -0
  120. package/dist/lib/i18n.d.ts.map +1 -0
  121. package/dist/lib/i18n.js +184 -0
  122. package/dist/lib/i18n.js.map +1 -0
  123. package/dist/lib/logger.d.ts +95 -0
  124. package/dist/lib/logger.d.ts.map +1 -0
  125. package/dist/lib/logger.js +168 -0
  126. package/dist/lib/logger.js.map +1 -0
  127. package/dist/lib/package-manager.d.ts +91 -0
  128. package/dist/lib/package-manager.d.ts.map +1 -0
  129. package/dist/lib/package-manager.js +205 -0
  130. package/dist/lib/package-manager.js.map +1 -0
  131. package/dist/lib/proxy-server.d.ts +24 -0
  132. package/dist/lib/proxy-server.d.ts.map +1 -0
  133. package/dist/lib/proxy-server.js +173 -0
  134. package/dist/lib/proxy-server.js.map +1 -0
  135. package/dist/lib/select-with-back.d.ts +34 -0
  136. package/dist/lib/select-with-back.d.ts.map +1 -0
  137. package/dist/lib/select-with-back.js +94 -0
  138. package/dist/lib/select-with-back.js.map +1 -0
  139. package/dist/lib/shared-api-client.d.ts +40 -0
  140. package/dist/lib/shared-api-client.d.ts.map +1 -0
  141. package/dist/lib/shared-api-client.js +92 -0
  142. package/dist/lib/shared-api-client.js.map +1 -0
  143. package/dist/lib/wizard-engine.d.ts +128 -0
  144. package/dist/lib/wizard-engine.d.ts.map +1 -0
  145. package/dist/lib/wizard-engine.js +168 -0
  146. package/dist/lib/wizard-engine.js.map +1 -0
  147. package/package.json +85 -0
  148. package/templates/storefront-minimal/.env.example +10 -0
  149. package/templates/storefront-minimal/.github/workflows/build-template.yml +109 -0
  150. package/templates/storefront-minimal/app/globals.css +18 -0
  151. package/templates/storefront-minimal/app/layout.tsx +26 -0
  152. package/templates/storefront-minimal/app/page.tsx +93 -0
  153. package/templates/storefront-minimal/lib/graphql-client.ts +23 -0
  154. package/templates/storefront-minimal/next.config.ts +15 -0
  155. package/templates/storefront-minimal/open-next.config.ts +3 -0
  156. package/templates/storefront-minimal/package.json +30 -0
  157. package/templates/storefront-minimal/postcss.config.mjs +5 -0
  158. package/templates/storefront-minimal/tailwind.config.ts +14 -0
  159. package/templates/storefront-minimal/tsconfig.json +27 -0
  160. package/templates/storefront-minimal/wrangler.toml +9 -0
  161. package/templates/storefront-nextjs/.env.example +68 -0
  162. package/templates/storefront-nextjs/.github/workflows/build-template.yml +109 -0
  163. package/templates/storefront-nextjs/.github/workflows/deploy.yml +25 -0
  164. package/templates/storefront-nextjs/.github/workflows/preview.yml +22 -0
  165. package/templates/storefront-nextjs/README.md +520 -0
  166. package/templates/storefront-nextjs/app/account/orders/page.tsx +216 -0
  167. package/templates/storefront-nextjs/app/account/page.tsx +167 -0
  168. package/templates/storefront-nextjs/app/auth/login/page.tsx +135 -0
  169. package/templates/storefront-nextjs/app/auth/register/page.tsx +228 -0
  170. package/templates/storefront-nextjs/app/cart/page.tsx +263 -0
  171. package/templates/storefront-nextjs/app/categories/[slug]/page.tsx +200 -0
  172. package/templates/storefront-nextjs/app/categories/page.tsx +58 -0
  173. package/templates/storefront-nextjs/app/checkout/page.tsx +351 -0
  174. package/templates/storefront-nextjs/app/collections/[slug]/page.tsx +158 -0
  175. package/templates/storefront-nextjs/app/collections/page.tsx +61 -0
  176. package/templates/storefront-nextjs/app/globals.css +98 -0
  177. package/templates/storefront-nextjs/app/layout.tsx +39 -0
  178. package/templates/storefront-nextjs/app/page.tsx +136 -0
  179. package/templates/storefront-nextjs/app/products/[slug]/page.tsx +119 -0
  180. package/templates/storefront-nextjs/app/products/page.tsx +107 -0
  181. package/templates/storefront-nextjs/app/search/page.tsx +127 -0
  182. package/templates/storefront-nextjs/components/auth/auth-guard.tsx +94 -0
  183. package/templates/storefront-nextjs/components/commerce/add-to-cart-button.tsx +77 -0
  184. package/templates/storefront-nextjs/components/commerce/cart-icon.tsx +29 -0
  185. package/templates/storefront-nextjs/components/commerce/currency-selector.tsx +217 -0
  186. package/templates/storefront-nextjs/components/commerce/pagination.tsx +62 -0
  187. package/templates/storefront-nextjs/components/commerce/product-actions.tsx +135 -0
  188. package/templates/storefront-nextjs/components/commerce/product-filters.tsx +109 -0
  189. package/templates/storefront-nextjs/components/commerce/product-price.tsx +375 -0
  190. package/templates/storefront-nextjs/components/commerce/search-input.tsx +178 -0
  191. package/templates/storefront-nextjs/components/commerce/sort-select.tsx +64 -0
  192. package/templates/storefront-nextjs/components/commerce/variant-selector.tsx +210 -0
  193. package/templates/storefront-nextjs/components/layout/footer.tsx +107 -0
  194. package/templates/storefront-nextjs/components/layout/header.tsx +104 -0
  195. package/templates/storefront-nextjs/components/providers.tsx +62 -0
  196. package/templates/storefront-nextjs/lib/auth/routes.ts +52 -0
  197. package/templates/storefront-nextjs/lib/currency.tsx +140 -0
  198. package/templates/storefront-nextjs/lib/format.ts +159 -0
  199. package/templates/storefront-nextjs/lib/graphql-queries.ts +629 -0
  200. package/templates/storefront-nextjs/lib/hooks.ts +30 -0
  201. package/templates/storefront-nextjs/middleware.ts +80 -0
  202. package/templates/storefront-nextjs/next.config.ts +37 -0
  203. package/templates/storefront-nextjs/open-next.config.ts +3 -0
  204. package/templates/storefront-nextjs/package.dev.json +30 -0
  205. package/templates/storefront-nextjs/package.json +32 -0
  206. package/templates/storefront-nextjs/package.json.template +32 -0
  207. package/templates/storefront-nextjs/postcss.config.mjs +8 -0
  208. package/templates/storefront-nextjs/tailwind.config.ts +111 -0
  209. package/templates/storefront-nextjs/tsconfig.json +27 -0
  210. package/templates/storefront-nextjs/wrangler.toml +9 -0
  211. package/templates/storefront-nextjs-shadcn/.env.example +68 -0
  212. package/templates/storefront-nextjs-shadcn/.github/workflows/build-template.yml +109 -0
  213. package/templates/storefront-nextjs-shadcn/.github/workflows/deploy.yml +25 -0
  214. package/templates/storefront-nextjs-shadcn/.github/workflows/preview.yml +22 -0
  215. package/templates/storefront-nextjs-shadcn/CART_INTEGRATION.md +282 -0
  216. package/templates/storefront-nextjs-shadcn/CLAUDE.md +96 -0
  217. package/templates/storefront-nextjs-shadcn/GRAPHQL_DOCUMENT_NAMES.md +190 -0
  218. package/templates/storefront-nextjs-shadcn/GRAPHQL_ERROR_HANDLING.md +263 -0
  219. package/templates/storefront-nextjs-shadcn/GRAPHQL_FIXES_SUMMARY.md +135 -0
  220. package/templates/storefront-nextjs-shadcn/GRAPHQL_INTEGRATION_COMPLETE.md +142 -0
  221. package/templates/storefront-nextjs-shadcn/INTEGRATION_CHECKLIST.md +448 -0
  222. package/templates/storefront-nextjs-shadcn/PRODUCT_DETAIL_PAGE_IMPLEMENTATION.md +307 -0
  223. package/templates/storefront-nextjs-shadcn/README.md +195 -0
  224. package/templates/storefront-nextjs-shadcn/THEME_CUSTOMIZATION.md +245 -0
  225. package/templates/storefront-nextjs-shadcn/app/about/page.tsx +34 -0
  226. package/templates/storefront-nextjs-shadcn/app/account/addresses/page.tsx +215 -0
  227. package/templates/storefront-nextjs-shadcn/app/account/loyalty/page.tsx +484 -0
  228. package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/page.tsx +128 -0
  229. package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/tracking/page.tsx +206 -0
  230. package/templates/storefront-nextjs-shadcn/app/account/orders/page.tsx +80 -0
  231. package/templates/storefront-nextjs-shadcn/app/account/page.tsx +107 -0
  232. package/templates/storefront-nextjs-shadcn/app/account/settings/page.tsx +195 -0
  233. package/templates/storefront-nextjs-shadcn/app/api/auth/clear-token/route.ts +87 -0
  234. package/templates/storefront-nextjs-shadcn/app/api/auth/set-token/route.ts +125 -0
  235. package/templates/storefront-nextjs-shadcn/app/auth/forgot-password/page.tsx +131 -0
  236. package/templates/storefront-nextjs-shadcn/app/auth/login/page.tsx +24 -0
  237. package/templates/storefront-nextjs-shadcn/app/auth/register/page.tsx +20 -0
  238. package/templates/storefront-nextjs-shadcn/app/blog/[slug]/page.tsx +323 -0
  239. package/templates/storefront-nextjs-shadcn/app/blog/page.tsx +159 -0
  240. package/templates/storefront-nextjs-shadcn/app/brands/[slug]/page.tsx +170 -0
  241. package/templates/storefront-nextjs-shadcn/app/brands/page.tsx +73 -0
  242. package/templates/storefront-nextjs-shadcn/app/cart/page.tsx +165 -0
  243. package/templates/storefront-nextjs-shadcn/app/categories/[slug]/page.tsx +78 -0
  244. package/templates/storefront-nextjs-shadcn/app/categories/page.tsx +75 -0
  245. package/templates/storefront-nextjs-shadcn/app/checkout/page.tsx +1752 -0
  246. package/templates/storefront-nextjs-shadcn/app/checkout/success/[orderId]/page.tsx +256 -0
  247. package/templates/storefront-nextjs-shadcn/app/collections/[handle]/page.tsx +74 -0
  248. package/templates/storefront-nextjs-shadcn/app/collections/page.tsx +75 -0
  249. package/templates/storefront-nextjs-shadcn/app/contact/page.tsx +114 -0
  250. package/templates/storefront-nextjs-shadcn/app/error.tsx +90 -0
  251. package/templates/storefront-nextjs-shadcn/app/globals.css +125 -0
  252. package/templates/storefront-nextjs-shadcn/app/layout.tsx +57 -0
  253. package/templates/storefront-nextjs-shadcn/app/not-found.tsx +68 -0
  254. package/templates/storefront-nextjs-shadcn/app/page.tsx +21 -0
  255. package/templates/storefront-nextjs-shadcn/app/products/[slug]/page.tsx +246 -0
  256. package/templates/storefront-nextjs-shadcn/app/products/[slug]/product-client.tsx +343 -0
  257. package/templates/storefront-nextjs-shadcn/app/products/page.tsx +25 -0
  258. package/templates/storefront-nextjs-shadcn/app/products/products-client.tsx +192 -0
  259. package/templates/storefront-nextjs-shadcn/app/returns/page.tsx +77 -0
  260. package/templates/storefront-nextjs-shadcn/app/robots.ts +53 -0
  261. package/templates/storefront-nextjs-shadcn/app/search/page.tsx +16 -0
  262. package/templates/storefront-nextjs-shadcn/app/search/search-client.tsx +47 -0
  263. package/templates/storefront-nextjs-shadcn/app/shipping/page.tsx +62 -0
  264. package/templates/storefront-nextjs-shadcn/app/sitemap.ts +144 -0
  265. package/templates/storefront-nextjs-shadcn/app/wishlist/page.tsx +179 -0
  266. package/templates/storefront-nextjs-shadcn/codegen.ts +51 -0
  267. package/templates/storefront-nextjs-shadcn/components/account/address-form.tsx +348 -0
  268. package/templates/storefront-nextjs-shadcn/components/account/address-list.tsx +144 -0
  269. package/templates/storefront-nextjs-shadcn/components/account/order-details.tsx +258 -0
  270. package/templates/storefront-nextjs-shadcn/components/account/order-history.tsx +107 -0
  271. package/templates/storefront-nextjs-shadcn/components/auth/account-menu.tsx +132 -0
  272. package/templates/storefront-nextjs-shadcn/components/auth/login-form.tsx +188 -0
  273. package/templates/storefront-nextjs-shadcn/components/auth/register-form.tsx +305 -0
  274. package/templates/storefront-nextjs-shadcn/components/blog/blog-card.tsx +240 -0
  275. package/templates/storefront-nextjs-shadcn/components/blog/blog-sidebar.tsx +177 -0
  276. package/templates/storefront-nextjs-shadcn/components/blog/index.ts +8 -0
  277. package/templates/storefront-nextjs-shadcn/components/brand/brand-card.tsx +119 -0
  278. package/templates/storefront-nextjs-shadcn/components/brand/brand-grid.tsx +64 -0
  279. package/templates/storefront-nextjs-shadcn/components/cart/cart-drawer.tsx +140 -0
  280. package/templates/storefront-nextjs-shadcn/components/cart/cart-icon.tsx +48 -0
  281. package/templates/storefront-nextjs-shadcn/components/cart/cart-item.tsx +112 -0
  282. package/templates/storefront-nextjs-shadcn/components/cart/cart-summary.tsx +84 -0
  283. package/templates/storefront-nextjs-shadcn/components/cart/index.ts +17 -0
  284. package/templates/storefront-nextjs-shadcn/components/cart/promo-code-input.tsx +121 -0
  285. package/templates/storefront-nextjs-shadcn/components/cart/shipping-estimator.tsx +162 -0
  286. package/templates/storefront-nextjs-shadcn/components/checkout/index.ts +25 -0
  287. package/templates/storefront-nextjs-shadcn/components/checkout/payment-method-card.tsx +187 -0
  288. package/templates/storefront-nextjs-shadcn/components/checkout/payment-step.tsx +160 -0
  289. package/templates/storefront-nextjs-shadcn/components/checkout/tax-breakdown.tsx +154 -0
  290. package/templates/storefront-nextjs-shadcn/components/commerce/currency-selector.tsx +225 -0
  291. package/templates/storefront-nextjs-shadcn/components/commerce/pagination.tsx +62 -0
  292. package/templates/storefront-nextjs-shadcn/components/commerce/product-actions.tsx +158 -0
  293. package/templates/storefront-nextjs-shadcn/components/commerce/search-input.tsx +174 -0
  294. package/templates/storefront-nextjs-shadcn/components/commerce/variant-selector.tsx +210 -0
  295. package/templates/storefront-nextjs-shadcn/components/common/category-card.tsx +97 -0
  296. package/templates/storefront-nextjs-shadcn/components/common/collection-card.tsx +187 -0
  297. package/templates/storefront-nextjs-shadcn/components/common/price-display.tsx +151 -0
  298. package/templates/storefront-nextjs-shadcn/components/common/social-share.tsx +166 -0
  299. package/templates/storefront-nextjs-shadcn/components/discount/discount-breakdown.tsx +245 -0
  300. package/templates/storefront-nextjs-shadcn/components/discount/discount-code-input.tsx +246 -0
  301. package/templates/storefront-nextjs-shadcn/components/discount/index.ts +19 -0
  302. package/templates/storefront-nextjs-shadcn/components/error/error-boundary.tsx +113 -0
  303. package/templates/storefront-nextjs-shadcn/components/error/index.ts +7 -0
  304. package/templates/storefront-nextjs-shadcn/components/filters/attribute-filter.tsx +153 -0
  305. package/templates/storefront-nextjs-shadcn/components/filters/checkbox-group-filter.tsx +167 -0
  306. package/templates/storefront-nextjs-shadcn/components/filters/color-swatch-filter.tsx +176 -0
  307. package/templates/storefront-nextjs-shadcn/components/filters/dynamic-attribute-filters.tsx +220 -0
  308. package/templates/storefront-nextjs-shadcn/components/filters/index.ts +36 -0
  309. package/templates/storefront-nextjs-shadcn/components/filters/range-slider-filter.tsx +193 -0
  310. package/templates/storefront-nextjs-shadcn/components/filters/toggle-filter.tsx +132 -0
  311. package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-balance.tsx +321 -0
  312. package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-input.tsx +309 -0
  313. package/templates/storefront-nextjs-shadcn/components/gift-card/index.ts +24 -0
  314. package/templates/storefront-nextjs-shadcn/components/home/category-grid.tsx +72 -0
  315. package/templates/storefront-nextjs-shadcn/components/home/featured-collections.tsx +107 -0
  316. package/templates/storefront-nextjs-shadcn/components/home/featured-products.tsx +85 -0
  317. package/templates/storefront-nextjs-shadcn/components/home/hero-section.tsx +34 -0
  318. package/templates/storefront-nextjs-shadcn/components/home/index.ts +8 -0
  319. package/templates/storefront-nextjs-shadcn/components/home/newsletter-signup.tsx +108 -0
  320. package/templates/storefront-nextjs-shadcn/components/layout/breadcrumbs.tsx +133 -0
  321. package/templates/storefront-nextjs-shadcn/components/layout/currency-selector.tsx +341 -0
  322. package/templates/storefront-nextjs-shadcn/components/layout/footer.tsx +128 -0
  323. package/templates/storefront-nextjs-shadcn/components/layout/header.tsx +147 -0
  324. package/templates/storefront-nextjs-shadcn/components/layout/index.ts +9 -0
  325. package/templates/storefront-nextjs-shadcn/components/layout/mobile-menu.tsx +211 -0
  326. package/templates/storefront-nextjs-shadcn/components/layout/navigation.tsx +95 -0
  327. package/templates/storefront-nextjs-shadcn/components/layout/theme-switcher.tsx +192 -0
  328. package/templates/storefront-nextjs-shadcn/components/loyalty/index.ts +11 -0
  329. package/templates/storefront-nextjs-shadcn/components/loyalty/points-balance.tsx +93 -0
  330. package/templates/storefront-nextjs-shadcn/components/loyalty/points-history.tsx +177 -0
  331. package/templates/storefront-nextjs-shadcn/components/loyalty/referral-section.tsx +250 -0
  332. package/templates/storefront-nextjs-shadcn/components/loyalty/rewards-catalog.tsx +217 -0
  333. package/templates/storefront-nextjs-shadcn/components/loyalty/tier-badge.tsx +106 -0
  334. package/templates/storefront-nextjs-shadcn/components/loyalty/tier-progress.tsx +131 -0
  335. package/templates/storefront-nextjs-shadcn/components/order/delivery-estimate.tsx +196 -0
  336. package/templates/storefront-nextjs-shadcn/components/order/index.ts +11 -0
  337. package/templates/storefront-nextjs-shadcn/components/order/order-tracking.tsx +200 -0
  338. package/templates/storefront-nextjs-shadcn/components/order/shipment-card.tsx +407 -0
  339. package/templates/storefront-nextjs-shadcn/components/order/tracking-status.tsx +222 -0
  340. package/templates/storefront-nextjs-shadcn/components/order/tracking-timeline.tsx +205 -0
  341. package/templates/storefront-nextjs-shadcn/components/product/add-to-cart-button.tsx +161 -0
  342. package/templates/storefront-nextjs-shadcn/components/product/b2b-price-display.tsx +250 -0
  343. package/templates/storefront-nextjs-shadcn/components/product/discount-badge.tsx +196 -0
  344. package/templates/storefront-nextjs-shadcn/components/product/index.ts +41 -0
  345. package/templates/storefront-nextjs-shadcn/components/product/product-card.tsx +147 -0
  346. package/templates/storefront-nextjs-shadcn/components/product/product-filters.tsx +217 -0
  347. package/templates/storefront-nextjs-shadcn/components/product/product-gallery.tsx +143 -0
  348. package/templates/storefront-nextjs-shadcn/components/product/product-grid.tsx +83 -0
  349. package/templates/storefront-nextjs-shadcn/components/product/product-image.tsx +155 -0
  350. package/templates/storefront-nextjs-shadcn/components/product/product-price.tsx +158 -0
  351. package/templates/storefront-nextjs-shadcn/components/product/product-quantity-selector.tsx +111 -0
  352. package/templates/storefront-nextjs-shadcn/components/product/product-reviews.tsx +238 -0
  353. package/templates/storefront-nextjs-shadcn/components/product/product-sort.tsx +58 -0
  354. package/templates/storefront-nextjs-shadcn/components/product/product-variant-selector.tsx +169 -0
  355. package/templates/storefront-nextjs-shadcn/components/product/review-card.tsx +220 -0
  356. package/templates/storefront-nextjs-shadcn/components/product/review-form.tsx +338 -0
  357. package/templates/storefront-nextjs-shadcn/components/product/review-summary.tsx +143 -0
  358. package/templates/storefront-nextjs-shadcn/components/product/sale-countdown.tsx +166 -0
  359. package/templates/storefront-nextjs-shadcn/components/product/savings-display.tsx +213 -0
  360. package/templates/storefront-nextjs-shadcn/components/product/similar-products.tsx +57 -0
  361. package/templates/storefront-nextjs-shadcn/components/product/stock-indicator.tsx +91 -0
  362. package/templates/storefront-nextjs-shadcn/components/providers/currency-provider.tsx +103 -0
  363. package/templates/storefront-nextjs-shadcn/components/providers/index.ts +8 -0
  364. package/templates/storefront-nextjs-shadcn/components/providers/query-provider.tsx +260 -0
  365. package/templates/storefront-nextjs-shadcn/components/providers/theme-provider.tsx +13 -0
  366. package/templates/storefront-nextjs-shadcn/components/returns/index.ts +26 -0
  367. package/templates/storefront-nextjs-shadcn/components/returns/return-request-form.tsx +608 -0
  368. package/templates/storefront-nextjs-shadcn/components/returns/return-status-card.tsx +554 -0
  369. package/templates/storefront-nextjs-shadcn/components/search/index.ts +8 -0
  370. package/templates/storefront-nextjs-shadcn/components/search/search-bar.tsx +140 -0
  371. package/templates/storefront-nextjs-shadcn/components/search/search-results.tsx +58 -0
  372. package/templates/storefront-nextjs-shadcn/components/search/search-suggestions.tsx +43 -0
  373. package/templates/storefront-nextjs-shadcn/components/seo/index.ts +12 -0
  374. package/templates/storefront-nextjs-shadcn/components/seo/json-ld.tsx +56 -0
  375. package/templates/storefront-nextjs-shadcn/components/seo/product-json-ld.ts +167 -0
  376. package/templates/storefront-nextjs-shadcn/components/shipping/index.ts +16 -0
  377. package/templates/storefront-nextjs-shadcn/components/shipping/shipping-method-selector.tsx +337 -0
  378. package/templates/storefront-nextjs-shadcn/components/ui/accordion.tsx +153 -0
  379. package/templates/storefront-nextjs-shadcn/components/ui/alert.tsx +59 -0
  380. package/templates/storefront-nextjs-shadcn/components/ui/badge.tsx +34 -0
  381. package/templates/storefront-nextjs-shadcn/components/ui/button.tsx +51 -0
  382. package/templates/storefront-nextjs-shadcn/components/ui/card.tsx +77 -0
  383. package/templates/storefront-nextjs-shadcn/components/ui/checkbox.tsx +30 -0
  384. package/templates/storefront-nextjs-shadcn/components/ui/dialog.tsx +137 -0
  385. package/templates/storefront-nextjs-shadcn/components/ui/empty-state.tsx +207 -0
  386. package/templates/storefront-nextjs-shadcn/components/ui/index.ts +67 -0
  387. package/templates/storefront-nextjs-shadcn/components/ui/input.tsx +65 -0
  388. package/templates/storefront-nextjs-shadcn/components/ui/label.tsx +26 -0
  389. package/templates/storefront-nextjs-shadcn/components/ui/pagination.tsx +205 -0
  390. package/templates/storefront-nextjs-shadcn/components/ui/radio-group.tsx +44 -0
  391. package/templates/storefront-nextjs-shadcn/components/ui/select.tsx +160 -0
  392. package/templates/storefront-nextjs-shadcn/components/ui/separator.tsx +28 -0
  393. package/templates/storefront-nextjs-shadcn/components/ui/skeleton.tsx +20 -0
  394. package/templates/storefront-nextjs-shadcn/components/ui/spinner.tsx +82 -0
  395. package/templates/storefront-nextjs-shadcn/components/ui/tabs.tsx +119 -0
  396. package/templates/storefront-nextjs-shadcn/components/ui/toast.tsx +96 -0
  397. package/templates/storefront-nextjs-shadcn/components/wishlist/index.ts +9 -0
  398. package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-button.tsx +148 -0
  399. package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-icon.tsx +47 -0
  400. package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-item.tsx +165 -0
  401. package/templates/storefront-nextjs-shadcn/components.json +19 -0
  402. package/templates/storefront-nextjs-shadcn/generated/.gitkeep +2 -0
  403. package/templates/storefront-nextjs-shadcn/graphql/.gitkeep +31 -0
  404. package/templates/storefront-nextjs-shadcn/graphql/collections.example.ts +168 -0
  405. package/templates/storefront-nextjs-shadcn/graphql/products.example.ts +160 -0
  406. package/templates/storefront-nextjs-shadcn/hooks/index.ts +9 -0
  407. package/templates/storefront-nextjs-shadcn/hooks/use-auth.ts +310 -0
  408. package/templates/storefront-nextjs-shadcn/hooks/use-cart-actions.ts +286 -0
  409. package/templates/storefront-nextjs-shadcn/hooks/use-cart-sync.ts +110 -0
  410. package/templates/storefront-nextjs-shadcn/hooks/use-filter-params.test.ts +173 -0
  411. package/templates/storefront-nextjs-shadcn/hooks/use-filter-params.ts +298 -0
  412. package/templates/storefront-nextjs-shadcn/lib/auth/cookies.ts +220 -0
  413. package/templates/storefront-nextjs-shadcn/lib/auth/routes.ts +57 -0
  414. package/templates/storefront-nextjs-shadcn/lib/config.ts +46 -0
  415. package/templates/storefront-nextjs-shadcn/lib/currency/IMPLEMENTATION_SUMMARY.md +254 -0
  416. package/templates/storefront-nextjs-shadcn/lib/currency/README.md +464 -0
  417. package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.test.ts +328 -0
  418. package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.ts +295 -0
  419. package/templates/storefront-nextjs-shadcn/lib/currency/index.ts +27 -0
  420. package/templates/storefront-nextjs-shadcn/lib/format.test.ts +397 -0
  421. package/templates/storefront-nextjs-shadcn/lib/format.ts +226 -0
  422. package/templates/storefront-nextjs-shadcn/lib/graphql/client.ts +109 -0
  423. package/templates/storefront-nextjs-shadcn/lib/graphql/hooks.ts +1183 -0
  424. package/templates/storefront-nextjs-shadcn/lib/graphql/server.ts +267 -0
  425. package/templates/storefront-nextjs-shadcn/lib/hooks.ts +30 -0
  426. package/templates/storefront-nextjs-shadcn/lib/theme/theme-config.ts +89 -0
  427. package/templates/storefront-nextjs-shadcn/lib/utils.ts +6 -0
  428. package/templates/storefront-nextjs-shadcn/next.config.ts +47 -0
  429. package/templates/storefront-nextjs-shadcn/open-next.config.ts +3 -0
  430. package/templates/storefront-nextjs-shadcn/package.dev.json +30 -0
  431. package/templates/storefront-nextjs-shadcn/package.json +60 -0
  432. package/templates/storefront-nextjs-shadcn/package.json.template +46 -0
  433. package/templates/storefront-nextjs-shadcn/postcss.config.mjs +8 -0
  434. package/templates/storefront-nextjs-shadcn/proxy.ts +80 -0
  435. package/templates/storefront-nextjs-shadcn/public/icons/payment/apple-pay.svg +8 -0
  436. package/templates/storefront-nextjs-shadcn/public/icons/payment/bank-transfer.svg +10 -0
  437. package/templates/storefront-nextjs-shadcn/public/icons/payment/blik.svg +6 -0
  438. package/templates/storefront-nextjs-shadcn/public/icons/payment/cash-on-delivery.svg +11 -0
  439. package/templates/storefront-nextjs-shadcn/public/icons/payment/google-pay.svg +11 -0
  440. package/templates/storefront-nextjs-shadcn/public/icons/payment/mastercard.svg +7 -0
  441. package/templates/storefront-nextjs-shadcn/public/icons/payment/paypal.svg +7 -0
  442. package/templates/storefront-nextjs-shadcn/public/icons/payment/payu.svg +7 -0
  443. package/templates/storefront-nextjs-shadcn/public/icons/payment/przelewy24.svg +7 -0
  444. package/templates/storefront-nextjs-shadcn/public/icons/payment/stripe.svg +4 -0
  445. package/templates/storefront-nextjs-shadcn/public/icons/payment/visa.svg +5 -0
  446. package/templates/storefront-nextjs-shadcn/stores/auth-store.ts +66 -0
  447. package/templates/storefront-nextjs-shadcn/stores/cart-store.ts +56 -0
  448. package/templates/storefront-nextjs-shadcn/stores/checkout-store.ts +184 -0
  449. package/templates/storefront-nextjs-shadcn/stores/currency-store.ts +103 -0
  450. package/templates/storefront-nextjs-shadcn/stores/wishlist-store.ts +291 -0
  451. package/templates/storefront-nextjs-shadcn/tailwind.config.ts +111 -0
  452. package/templates/storefront-nextjs-shadcn/tsconfig.json +27 -0
  453. package/templates/storefront-nextjs-shadcn/wrangler.toml +9 -0
@@ -0,0 +1,83 @@
1
+ import chalk from "chalk";
2
+ import ora from "ora";
3
+ import { execa } from "execa";
4
+ import { existsSync } from "fs";
5
+ import { loadConfig } from "../lib/config.js";
6
+ import { readLocalConfigSync } from "../lib/config.js";
7
+ import { getActiveProfile } from "../lib/env-storage.js";
8
+ import { getStoredToken } from "./auth.js";
9
+ export async function devCommand(options = {}) {
10
+ console.log(chalk.bold.blue("\nDoSwiftly Dev Server\n"));
11
+ // Check if in project directory
12
+ if (!existsSync("doswiftly.config.ts") &&
13
+ !existsSync("doswiftly.config.js")) {
14
+ console.error(chalk.red("Not in a DoSwiftly project directory"));
15
+ console.log(chalk.gray("\nRun this command from your project root (where doswiftly.config.ts exists)\n"));
16
+ process.exit(1);
17
+ }
18
+ // Read local config
19
+ const localConfig = readLocalConfigSync();
20
+ if (!localConfig) {
21
+ console.error(chalk.red("Failed to read doswiftly.config.ts"));
22
+ process.exit(1);
23
+ }
24
+ // Check authentication
25
+ const token = getStoredToken();
26
+ if (!token) {
27
+ console.error(chalk.red("Not authenticated"));
28
+ console.log(chalk.gray("\nPlease login first:"));
29
+ console.log(chalk.cyan(" doswiftly auth login\n"));
30
+ process.exit(1);
31
+ }
32
+ const spinner = ora("Loading configuration...").start();
33
+ try {
34
+ // Try loading full config from API (with graceful fallback)
35
+ const config = await loadConfig(token);
36
+ spinner.text = "Configuration loaded";
37
+ spinner.succeed();
38
+ // Display config summary
39
+ console.log(chalk.bold("\nProject Configuration:\n"));
40
+ console.log(chalk.gray(` Shop: ${chalk.cyan(localConfig.shop.slug)}`));
41
+ if (localConfig.project?.name) {
42
+ console.log(chalk.gray(` Name: ${chalk.cyan(localConfig.project.name)}`));
43
+ }
44
+ if (config.commerce?.enabled) {
45
+ console.log(chalk.gray(` Store: ${chalk.cyan(config.commerce.storeName)}`));
46
+ console.log(chalk.gray(` Currency: ${config.commerce.currency}`));
47
+ console.log(chalk.gray(` Locale: ${config.commerce.locale}`));
48
+ }
49
+ console.log();
50
+ // Start Next.js dev server
51
+ const port = options.port || localConfig.dev?.port || config.dev?.port || 3000;
52
+ const host = options.host || "localhost";
53
+ // Resolve API URL: env → local config → profile → default
54
+ const profile = getActiveProfile();
55
+ const apiUrl = process.env.NEXT_PUBLIC_API_URL ||
56
+ localConfig.api?.url ||
57
+ config.api?.url ||
58
+ profile?.apiUrl ||
59
+ "https://api.doswiftly.pl";
60
+ console.log(chalk.bold("Starting Next.js dev server...\n"));
61
+ const devProcess = execa("pnpm", ["next", "dev", "-p", port.toString(), "-H", host], {
62
+ stdio: "inherit",
63
+ env: {
64
+ ...process.env,
65
+ NEXT_PUBLIC_API_URL: apiUrl,
66
+ NEXT_PUBLIC_SHOP_SLUG: localConfig.shop.slug,
67
+ },
68
+ });
69
+ // Handle process termination
70
+ process.on("SIGINT", () => {
71
+ console.log(chalk.yellow("\n\nStopping dev server...\n"));
72
+ devProcess.kill("SIGINT");
73
+ process.exit(0);
74
+ });
75
+ await devProcess;
76
+ }
77
+ catch (error) {
78
+ spinner.fail(chalk.red("Failed to start dev server"));
79
+ console.error(chalk.red(error.message));
80
+ process.exit(1);
81
+ }
82
+ }
83
+ //# sourceMappingURL=dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.js","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,O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CAAE,KAAe,CAAC,OAAO,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Doctor command - health check for CLI and project
3
+ */
4
+ export declare function doctorCommand(): Promise<void>;
5
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AA+UA;;GAEG;AACH,wBAAsB,aAAa,kBAwElC"}
@@ -0,0 +1,363 @@
1
+ import chalk from 'chalk';
2
+ import ora from 'ora';
3
+ import { execSync } from 'child_process';
4
+ import { existsSync, readFileSync } from 'fs';
5
+ import https from 'https';
6
+ import http from 'http';
7
+ import { getActiveProfile } from '../lib/env-storage.js';
8
+ /**
9
+ * Get command output or null if failed
10
+ */
11
+ function getCommandOutput(command) {
12
+ try {
13
+ return execSync(command, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'] }).trim();
14
+ }
15
+ catch {
16
+ return null;
17
+ }
18
+ }
19
+ /**
20
+ * Check Node.js version
21
+ */
22
+ function checkNodeVersion() {
23
+ const version = process.version;
24
+ const major = parseInt(version.slice(1).split('.')[0], 10);
25
+ if (major >= 18) {
26
+ return {
27
+ name: 'Node.js',
28
+ status: 'pass',
29
+ message: `${version} (recommended: >=18)`,
30
+ };
31
+ }
32
+ else if (major >= 16) {
33
+ return {
34
+ name: 'Node.js',
35
+ status: 'warn',
36
+ message: `${version} (recommended: >=18)`,
37
+ details: 'Consider upgrading to Node.js 18 or later',
38
+ };
39
+ }
40
+ else {
41
+ return {
42
+ name: 'Node.js',
43
+ status: 'fail',
44
+ message: `${version} (minimum: 16)`,
45
+ details: 'Please upgrade to Node.js 16 or later',
46
+ };
47
+ }
48
+ }
49
+ /**
50
+ * Check package manager
51
+ */
52
+ function checkPackageManager() {
53
+ // Check for pnpm first (preferred)
54
+ const pnpmVersion = getCommandOutput('pnpm --version');
55
+ if (pnpmVersion) {
56
+ return {
57
+ name: 'Package Manager',
58
+ status: 'pass',
59
+ message: `pnpm ${pnpmVersion}`,
60
+ };
61
+ }
62
+ // Check for npm
63
+ const npmVersion = getCommandOutput('npm --version');
64
+ if (npmVersion) {
65
+ return {
66
+ name: 'Package Manager',
67
+ status: 'pass',
68
+ message: `npm ${npmVersion}`,
69
+ details: 'Consider using pnpm for better performance',
70
+ };
71
+ }
72
+ // Check for yarn
73
+ const yarnVersion = getCommandOutput('yarn --version');
74
+ if (yarnVersion) {
75
+ return {
76
+ name: 'Package Manager',
77
+ status: 'pass',
78
+ message: `yarn ${yarnVersion}`,
79
+ };
80
+ }
81
+ return {
82
+ name: 'Package Manager',
83
+ status: 'fail',
84
+ message: 'No package manager found',
85
+ details: 'Install pnpm: npm install -g pnpm',
86
+ };
87
+ }
88
+ /**
89
+ * Check if in a DoSwiftly project
90
+ */
91
+ function checkProject() {
92
+ if (existsSync('doswiftly.config.ts') || existsSync('doswiftly.config.js')) {
93
+ return {
94
+ name: 'DoSwiftly Project',
95
+ status: 'pass',
96
+ message: 'Configuration file found',
97
+ };
98
+ }
99
+ if (existsSync('package.json')) {
100
+ const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
101
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
102
+ if ('@doswiftly/commerce-sdk' in deps) {
103
+ return {
104
+ name: 'DoSwiftly Project',
105
+ status: 'warn',
106
+ message: 'SDK found but no config file',
107
+ details: 'Run "doswiftly init" to create configuration',
108
+ };
109
+ }
110
+ }
111
+ return {
112
+ name: 'DoSwiftly Project',
113
+ status: 'warn',
114
+ message: 'Not in a DoSwiftly project',
115
+ details: 'Run "doswiftly init" to create a new project',
116
+ };
117
+ }
118
+ /**
119
+ * Check dependencies
120
+ */
121
+ function checkDependencies() {
122
+ if (!existsSync('package.json')) {
123
+ return {
124
+ name: 'Dependencies',
125
+ status: 'warn',
126
+ message: 'No package.json found',
127
+ };
128
+ }
129
+ const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
130
+ const deps = { ...pkg.dependencies, ...pkg.devDependencies };
131
+ const required = ['@doswiftly/commerce-sdk'];
132
+ const missing = required.filter((dep) => !(dep in deps));
133
+ if (missing.length === 0) {
134
+ // Check if node_modules exists
135
+ if (!existsSync('node_modules')) {
136
+ return {
137
+ name: 'Dependencies',
138
+ status: 'warn',
139
+ message: 'Dependencies not installed',
140
+ details: 'Run "pnpm install" to install dependencies',
141
+ };
142
+ }
143
+ return {
144
+ name: 'Dependencies',
145
+ status: 'pass',
146
+ message: 'All required packages present',
147
+ };
148
+ }
149
+ return {
150
+ name: 'Dependencies',
151
+ status: 'fail',
152
+ message: `Missing: ${missing.join(', ')}`,
153
+ details: 'Run "pnpm add @doswiftly/commerce-sdk"',
154
+ };
155
+ }
156
+ /**
157
+ * Read shop slug from doswiftly.config.ts (primary) or .env.local (fallback).
158
+ */
159
+ function readShopSlug() {
160
+ // Try doswiftly.config.ts first
161
+ const configPath = existsSync('doswiftly.config.ts')
162
+ ? 'doswiftly.config.ts'
163
+ : existsSync('doswiftly.config.js')
164
+ ? 'doswiftly.config.js'
165
+ : null;
166
+ if (configPath) {
167
+ try {
168
+ const content = readFileSync(configPath, 'utf-8');
169
+ const slugMatch = content.match(/slug:\s*['"]([^'"]+)['"]/);
170
+ if (slugMatch)
171
+ return slugMatch[1];
172
+ // Legacy fallback: project.id
173
+ const idMatch = content.match(/id:\s*['"]([^'"]+)['"]/);
174
+ if (idMatch)
175
+ return idMatch[1];
176
+ }
177
+ catch {
178
+ // Ignore parse errors
179
+ }
180
+ }
181
+ // Fallback to .env.local
182
+ if (existsSync('.env.local')) {
183
+ try {
184
+ const content = readFileSync('.env.local', 'utf-8');
185
+ const match = content.match(/NEXT_PUBLIC_SHOP_SLUG=(.+)/);
186
+ if (match)
187
+ return match[1].trim();
188
+ }
189
+ catch {
190
+ // Ignore
191
+ }
192
+ }
193
+ return null;
194
+ }
195
+ /**
196
+ * Check environment profile
197
+ */
198
+ function checkEnvironment() {
199
+ const profile = getActiveProfile();
200
+ const shopSlug = readShopSlug();
201
+ if (profile) {
202
+ const details = [];
203
+ details.push(`API: ${profile.apiUrl}`);
204
+ if (shopSlug) {
205
+ details.push(`Shop: ${shopSlug}`);
206
+ }
207
+ if (profile.account && Date.now() < profile.account.expiresAt) {
208
+ details.push(`Account: ${profile.account.email}`);
209
+ }
210
+ return {
211
+ name: 'Environment',
212
+ status: 'pass',
213
+ message: `Active profile: ${profile.name}`,
214
+ details: details.join(' | '),
215
+ };
216
+ }
217
+ // No active profile, but check if .env.local is configured
218
+ if (existsSync('.env.local')) {
219
+ const content = readFileSync('.env.local', 'utf-8');
220
+ const apiMatch = content.match(/NEXT_PUBLIC_API_URL=(.+)/);
221
+ const hasShopSlug = shopSlug !== null;
222
+ if (apiMatch || hasShopSlug) {
223
+ const details = [];
224
+ if (apiMatch)
225
+ details.push(`API: ${apiMatch[1].trim()}`);
226
+ if (hasShopSlug)
227
+ details.push(`Shop: ${shopSlug}`);
228
+ return {
229
+ name: 'Environment',
230
+ status: 'pass',
231
+ message: '.env.local configured',
232
+ details: details.join(' | ') || undefined,
233
+ };
234
+ }
235
+ }
236
+ return {
237
+ name: 'Environment',
238
+ status: 'warn',
239
+ message: 'No environment configured',
240
+ details: 'Run "doswiftly env:add" to create a profile',
241
+ };
242
+ }
243
+ /**
244
+ * Check API connectivity
245
+ */
246
+ async function checkApiConnectivity() {
247
+ const profile = getActiveProfile();
248
+ let apiUrl = profile?.apiUrl;
249
+ if (!apiUrl && existsSync('.env.local')) {
250
+ const content = readFileSync('.env.local', 'utf-8');
251
+ const match = content.match(/NEXT_PUBLIC_API_URL=(.+)/);
252
+ if (match) {
253
+ apiUrl = match[1].trim();
254
+ }
255
+ }
256
+ if (!apiUrl) {
257
+ return {
258
+ name: 'API Connectivity',
259
+ status: 'warn',
260
+ message: 'No API URL configured',
261
+ };
262
+ }
263
+ return new Promise((resolve) => {
264
+ const url = `${apiUrl}/health-check`;
265
+ const parsedUrl = new URL(url);
266
+ const client = parsedUrl.protocol === 'https:' ? https : http;
267
+ const req = client.get(url, { timeout: 5000 }, (res) => {
268
+ if (res.statusCode === 200) {
269
+ resolve({
270
+ name: 'API Connectivity',
271
+ status: 'pass',
272
+ message: 'API is reachable',
273
+ details: apiUrl,
274
+ });
275
+ }
276
+ else {
277
+ resolve({
278
+ name: 'API Connectivity',
279
+ status: 'fail',
280
+ message: `HTTP ${res.statusCode}`,
281
+ details: url,
282
+ });
283
+ }
284
+ });
285
+ req.on('error', (e) => {
286
+ resolve({
287
+ name: 'API Connectivity',
288
+ status: 'fail',
289
+ message: e.message,
290
+ details: url,
291
+ });
292
+ });
293
+ req.on('timeout', () => {
294
+ req.destroy();
295
+ resolve({
296
+ name: 'API Connectivity',
297
+ status: 'fail',
298
+ message: 'Connection timeout',
299
+ details: url,
300
+ });
301
+ });
302
+ });
303
+ }
304
+ /**
305
+ * Doctor command - health check for CLI and project
306
+ */
307
+ export async function doctorCommand() {
308
+ console.log(chalk.bold.blue('\n🩺 DoSwiftly CLI - Doctor\n'));
309
+ const spinner = ora('Running health checks...').start();
310
+ const results = [];
311
+ // Synchronous checks
312
+ spinner.text = 'Checking Node.js...';
313
+ results.push(checkNodeVersion());
314
+ spinner.text = 'Checking package manager...';
315
+ results.push(checkPackageManager());
316
+ spinner.text = 'Checking project...';
317
+ results.push(checkProject());
318
+ spinner.text = 'Checking dependencies...';
319
+ results.push(checkDependencies());
320
+ spinner.text = 'Checking environment...';
321
+ results.push(checkEnvironment());
322
+ // Async checks
323
+ spinner.text = 'Checking API connectivity...';
324
+ results.push(await checkApiConnectivity());
325
+ spinner.stop();
326
+ // Display results
327
+ console.log(chalk.bold('Health Check Results:\n'));
328
+ for (const result of results) {
329
+ const icon = result.status === 'pass'
330
+ ? chalk.green('✔')
331
+ : result.status === 'fail'
332
+ ? chalk.red('✖')
333
+ : chalk.yellow('⚠');
334
+ const statusColor = result.status === 'pass'
335
+ ? chalk.green
336
+ : result.status === 'fail'
337
+ ? chalk.red
338
+ : chalk.yellow;
339
+ console.log(` ${icon} ${chalk.bold(result.name)}`);
340
+ console.log(` ${statusColor(result.message)}`);
341
+ if (result.details) {
342
+ console.log(chalk.gray(` ${result.details}`));
343
+ }
344
+ console.log('');
345
+ }
346
+ // Summary
347
+ const passed = results.filter((r) => r.status === 'pass').length;
348
+ const failed = results.filter((r) => r.status === 'fail').length;
349
+ const warned = results.filter((r) => r.status === 'warn').length;
350
+ console.log(chalk.bold('Summary:'));
351
+ console.log(` ${chalk.green(`${passed} passed`)}, ${chalk.yellow(`${warned} warnings`)}, ${chalk.red(`${failed} failed`)}\n`);
352
+ if (failed > 0) {
353
+ console.log(chalk.red('Some checks failed. Please fix the issues above.\n'));
354
+ process.exit(1);
355
+ }
356
+ else if (warned > 0) {
357
+ console.log(chalk.yellow('Some checks have warnings. Consider addressing them.\n'));
358
+ }
359
+ else {
360
+ console.log(chalk.green('All checks passed! Your environment looks good.\n'));
361
+ }
362
+ }
363
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AASzD;;GAEG;AACH,SAAS,gBAAgB,CAAC,OAAe;IACvC,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,MAAM,E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7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;SAAM,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAC,CAAC;IACtF,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Add a custom domain to the current shop.
3
+ */
4
+ export declare function domainAddCommand(hostname: string): Promise<void>;
5
+ /**
6
+ * Remove a custom domain from the current shop.
7
+ */
8
+ export declare function domainRemoveCommand(hostname: string): Promise<void>;
9
+ /**
10
+ * List all custom domains for the current shop.
11
+ */
12
+ export declare function domainListCommand(): Promise<void>;
13
+ //# sourceMappingURL=domain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../src/commands/domain.ts"],"names":[],"mappings":"AA8CA;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,iBAoCtD;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,iBA+BzD;AAED;;GAEG;AACH,wBAAsB,iBAAiB,kBA2CtC"}
@@ -0,0 +1,128 @@
1
+ import chalk from 'chalk';
2
+ import ora from 'ora';
3
+ import { createSharedApiClient } from '../lib/shared-api-client.js';
4
+ import { logger } from '../lib/logger.js';
5
+ async function apiRequest(endpoint, options = {}) {
6
+ const client = createSharedApiClient();
7
+ logger.debug(`API Request: ${options.method || 'GET'} ${endpoint}`);
8
+ const response = await client.request({
9
+ url: endpoint,
10
+ method: (options.method || 'GET'),
11
+ data: options.body ? JSON.parse(options.body) : undefined,
12
+ });
13
+ return response.data;
14
+ }
15
+ function getStatusColor(status) {
16
+ switch (status) {
17
+ case 'ACTIVE':
18
+ return chalk.green;
19
+ case 'PENDING':
20
+ return chalk.yellow;
21
+ case 'FAILED':
22
+ return chalk.red;
23
+ default:
24
+ return chalk.gray;
25
+ }
26
+ }
27
+ /**
28
+ * Add a custom domain to the current shop.
29
+ */
30
+ export async function domainAddCommand(hostname) {
31
+ console.log(chalk.bold.blue('\nDoSwiftly CLI - Add Domain\n'));
32
+ if (!hostname) {
33
+ console.log(chalk.red(' Error: Hostname required\n'));
34
+ console.log(chalk.gray(' Usage: doswiftly config domain add <hostname>\n'));
35
+ process.exit(1);
36
+ }
37
+ const spinner = ora(`Adding domain ${hostname}...`).start();
38
+ try {
39
+ const result = await apiRequest('/cli/domains', {
40
+ method: 'POST',
41
+ body: JSON.stringify({ hostname }),
42
+ });
43
+ spinner.succeed(`Domain ${hostname} added`);
44
+ console.log(chalk.bold('\nDNS Configuration Required:\n'));
45
+ if (result.dnsInstructions) {
46
+ console.log(chalk.bold(' Add the following DNS record to your domain provider:\n'));
47
+ console.log(` ${chalk.bold('Type:')} ${result.dnsInstructions.type}`);
48
+ console.log(` ${chalk.bold('Name:')} ${result.dnsInstructions.name}`);
49
+ console.log(` ${chalk.bold('Target:')} ${chalk.cyan(result.dnsInstructions.target)}`);
50
+ }
51
+ console.log(chalk.bold(`\n Status: ${chalk.yellow('PENDING')}`));
52
+ console.log(chalk.gray('\n Domain will be verified automatically once DNS is configured.'));
53
+ console.log(chalk.gray(' Run "doswiftly config domain list" to check status.\n'));
54
+ }
55
+ catch (error) {
56
+ spinner.fail('Failed to add domain');
57
+ console.log(chalk.red(`\n${error.message}\n`));
58
+ process.exit(1);
59
+ }
60
+ }
61
+ /**
62
+ * Remove a custom domain from the current shop.
63
+ */
64
+ export async function domainRemoveCommand(hostname) {
65
+ console.log(chalk.bold.blue('\nDoSwiftly CLI - Remove Domain\n'));
66
+ if (!hostname) {
67
+ console.log(chalk.red(' Error: Hostname required\n'));
68
+ console.log(chalk.gray(' Usage: doswiftly config domain remove <hostname>\n'));
69
+ process.exit(1);
70
+ }
71
+ const spinner = ora(`Removing domain ${hostname}...`).start();
72
+ try {
73
+ // First, list domains to find the ID by hostname
74
+ const domains = await apiRequest('/cli/domains');
75
+ const domain = domains.find(d => d.hostname === hostname);
76
+ if (!domain) {
77
+ spinner.fail(`Domain ${hostname} not found`);
78
+ process.exit(1);
79
+ }
80
+ await apiRequest(`/cli/domains/${domain.id}`, { method: 'DELETE' });
81
+ spinner.succeed(`Domain ${hostname} removed`);
82
+ console.log(chalk.green('\nDomain has been removed.\n'));
83
+ console.log(chalk.gray(' DNS records should be cleaned up at your domain provider.\n'));
84
+ }
85
+ catch (error) {
86
+ spinner.fail('Failed to remove domain');
87
+ console.log(chalk.red(`\n${error.message}\n`));
88
+ process.exit(1);
89
+ }
90
+ }
91
+ /**
92
+ * List all custom domains for the current shop.
93
+ */
94
+ export async function domainListCommand() {
95
+ console.log(chalk.bold.blue('\nDoSwiftly CLI - Custom Domains\n'));
96
+ const spinner = ora('Fetching domains...').start();
97
+ try {
98
+ const domains = await apiRequest('/cli/domains');
99
+ spinner.stop();
100
+ if (!domains || domains.length === 0) {
101
+ console.log(chalk.yellow(' No custom domains configured.\n'));
102
+ console.log(chalk.gray(' Run "doswiftly config domain add <hostname>" to add one.\n'));
103
+ return;
104
+ }
105
+ console.log(chalk.gray('─'.repeat(70)));
106
+ console.log(chalk.bold(' Hostname'.padEnd(35)) +
107
+ chalk.bold('Status'.padEnd(12)) +
108
+ chalk.bold('SSL'.padEnd(15)) +
109
+ chalk.bold('Primary'));
110
+ console.log(chalk.gray('─'.repeat(70)));
111
+ for (const domain of domains) {
112
+ const statusColor = getStatusColor(domain.status);
113
+ const sslColor = domain.sslStatus === 'ACTIVE' ? chalk.green : chalk.yellow;
114
+ console.log(` ${chalk.cyan(domain.hostname.padEnd(35))}` +
115
+ `${statusColor(domain.status.padEnd(12))}` +
116
+ `${sslColor(domain.sslStatus.padEnd(15))}` +
117
+ `${domain.isPrimary ? chalk.green('Yes') : chalk.gray('No')}`);
118
+ }
119
+ console.log(chalk.gray('─'.repeat(70)));
120
+ console.log('');
121
+ }
122
+ catch (error) {
123
+ spinner.fail('Failed to fetch domains');
124
+ console.log(chalk.red(`\n${error.message}\n`));
125
+ process.exit(1);
126
+ }
127
+ }
128
+ //# sourceMappingURL=domain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domain.js","sourceRoot":"","sources":["../../src/commands/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAgB1C,KAAK,UAAU,UAAU,CACvB,QAAgB,EAChB,UAA8C,EAAE;IAEhD,MAAM,MAAM,GAAG,qBAAqB,EAAE,CAAC;IACvC,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,CAAC,MAAM,IAAI,KAAK,IAAI,QAAQ,EAAE,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAI;QACvC,GAAG,EAAE,QAAQ;QACb,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK,CAAQ;QACxC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;KAC1D,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,KAAK,CAAC;QACrB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,GAAG,CAAC;QACnB;YACE,OAAO,KAAK,CAAC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AM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;gBAC1C,GAAG,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;gBAC1C,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC9D,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAM,KAAe,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * List all environment profiles
3
+ */
4
+ export declare function envListCommand(): Promise<void>;
5
+ /**
6
+ * Add a new environment profile
7
+ */
8
+ export declare function envAddCommand(name?: string): Promise<void>;
9
+ /**
10
+ * Switch to a different environment profile
11
+ */
12
+ export declare function envUseCommand(name?: string): Promise<void>;
13
+ /**
14
+ * Generate .env.local from active profile
15
+ */
16
+ export declare function envGenerateCommand(): Promise<void>;
17
+ /**
18
+ * Set a custom variable on the active environment profile
19
+ */
20
+ export declare function envSetCommand(key?: string, value?: string): Promise<void>;
21
+ /**
22
+ * Delete an environment profile
23
+ */
24
+ export declare function envDeleteCommand(name?: string): Promise<void>;
25
+ //# sourceMappingURL=env.d.ts.map