@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.
- package/README.md +357 -0
- package/bin/doswiftly.js +2 -0
- package/dist/commands/auth-github.d.ts +6 -0
- package/dist/commands/auth-github.d.ts.map +1 -0
- package/dist/commands/auth-github.js +89 -0
- package/dist/commands/auth-github.js.map +1 -0
- package/dist/commands/auth-token.d.ts +12 -0
- package/dist/commands/auth-token.d.ts.map +1 -0
- package/dist/commands/auth-token.js +43 -0
- package/dist/commands/auth-token.js.map +1 -0
- package/dist/commands/auth.d.ts +22 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +348 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/check.d.ts +5 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +234 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/config.d.ts +3 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +104 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/deploy.d.ts +37 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +580 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts +8 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +83 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +363 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/domain.d.ts +13 -0
- package/dist/commands/domain.d.ts.map +1 -0
- package/dist/commands/domain.js +128 -0
- package/dist/commands/domain.js.map +1 -0
- package/dist/commands/env.d.ts +25 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/env.js +228 -0
- package/dist/commands/env.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +1028 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/inspect.d.ts +12 -0
- package/dist/commands/inspect.d.ts.map +1 -0
- package/dist/commands/inspect.js +162 -0
- package/dist/commands/inspect.js.map +1 -0
- package/dist/commands/migrate.d.ts +18 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +355 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/preview.d.ts +29 -0
- package/dist/commands/preview.d.ts.map +1 -0
- package/dist/commands/preview.js +199 -0
- package/dist/commands/preview.js.map +1 -0
- package/dist/commands/proxy.d.ts +9 -0
- package/dist/commands/proxy.d.ts.map +1 -0
- package/dist/commands/proxy.js +37 -0
- package/dist/commands/proxy.js.map +1 -0
- package/dist/commands/sdk.d.ts +5 -0
- package/dist/commands/sdk.d.ts.map +1 -0
- package/dist/commands/sdk.js +82 -0
- package/dist/commands/sdk.js.map +1 -0
- package/dist/commands/template.d.ts +107 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +1309 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/types.d.ts +5 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +82 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +103 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/upgrade.d.ts +18 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +55 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/commands/verify.d.ts +5 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +232 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/whoami.d.ts +5 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +60 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/config/types.d.ts +173 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +48 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +416 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-url.d.ts +14 -0
- package/dist/lib/api-url.d.ts.map +1 -0
- package/dist/lib/api-url.js +24 -0
- package/dist/lib/api-url.js.map +1 -0
- package/dist/lib/api.d.ts +67 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +36 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/config.d.ts +39 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +195 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/env-storage.d.ts +140 -0
- package/dist/lib/env-storage.d.ts.map +1 -0
- package/dist/lib/env-storage.js +464 -0
- package/dist/lib/env-storage.js.map +1 -0
- package/dist/lib/errors.d.ts +61 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +204 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/i18n.d.ts +99 -0
- package/dist/lib/i18n.d.ts.map +1 -0
- package/dist/lib/i18n.js +184 -0
- package/dist/lib/i18n.js.map +1 -0
- package/dist/lib/logger.d.ts +95 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +168 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/package-manager.d.ts +91 -0
- package/dist/lib/package-manager.d.ts.map +1 -0
- package/dist/lib/package-manager.js +205 -0
- package/dist/lib/package-manager.js.map +1 -0
- package/dist/lib/proxy-server.d.ts +24 -0
- package/dist/lib/proxy-server.d.ts.map +1 -0
- package/dist/lib/proxy-server.js +173 -0
- package/dist/lib/proxy-server.js.map +1 -0
- package/dist/lib/select-with-back.d.ts +34 -0
- package/dist/lib/select-with-back.d.ts.map +1 -0
- package/dist/lib/select-with-back.js +94 -0
- package/dist/lib/select-with-back.js.map +1 -0
- package/dist/lib/shared-api-client.d.ts +40 -0
- package/dist/lib/shared-api-client.d.ts.map +1 -0
- package/dist/lib/shared-api-client.js +92 -0
- package/dist/lib/shared-api-client.js.map +1 -0
- package/dist/lib/wizard-engine.d.ts +128 -0
- package/dist/lib/wizard-engine.d.ts.map +1 -0
- package/dist/lib/wizard-engine.js +168 -0
- package/dist/lib/wizard-engine.js.map +1 -0
- package/package.json +85 -0
- package/templates/storefront-minimal/.env.example +10 -0
- package/templates/storefront-minimal/.github/workflows/build-template.yml +109 -0
- package/templates/storefront-minimal/app/globals.css +18 -0
- package/templates/storefront-minimal/app/layout.tsx +26 -0
- package/templates/storefront-minimal/app/page.tsx +93 -0
- package/templates/storefront-minimal/lib/graphql-client.ts +23 -0
- package/templates/storefront-minimal/next.config.ts +15 -0
- package/templates/storefront-minimal/open-next.config.ts +3 -0
- package/templates/storefront-minimal/package.json +30 -0
- package/templates/storefront-minimal/postcss.config.mjs +5 -0
- package/templates/storefront-minimal/tailwind.config.ts +14 -0
- package/templates/storefront-minimal/tsconfig.json +27 -0
- package/templates/storefront-minimal/wrangler.toml +9 -0
- package/templates/storefront-nextjs/.env.example +68 -0
- package/templates/storefront-nextjs/.github/workflows/build-template.yml +109 -0
- package/templates/storefront-nextjs/.github/workflows/deploy.yml +25 -0
- package/templates/storefront-nextjs/.github/workflows/preview.yml +22 -0
- package/templates/storefront-nextjs/README.md +520 -0
- package/templates/storefront-nextjs/app/account/orders/page.tsx +216 -0
- package/templates/storefront-nextjs/app/account/page.tsx +167 -0
- package/templates/storefront-nextjs/app/auth/login/page.tsx +135 -0
- package/templates/storefront-nextjs/app/auth/register/page.tsx +228 -0
- package/templates/storefront-nextjs/app/cart/page.tsx +263 -0
- package/templates/storefront-nextjs/app/categories/[slug]/page.tsx +200 -0
- package/templates/storefront-nextjs/app/categories/page.tsx +58 -0
- package/templates/storefront-nextjs/app/checkout/page.tsx +351 -0
- package/templates/storefront-nextjs/app/collections/[slug]/page.tsx +158 -0
- package/templates/storefront-nextjs/app/collections/page.tsx +61 -0
- package/templates/storefront-nextjs/app/globals.css +98 -0
- package/templates/storefront-nextjs/app/layout.tsx +39 -0
- package/templates/storefront-nextjs/app/page.tsx +136 -0
- package/templates/storefront-nextjs/app/products/[slug]/page.tsx +119 -0
- package/templates/storefront-nextjs/app/products/page.tsx +107 -0
- package/templates/storefront-nextjs/app/search/page.tsx +127 -0
- package/templates/storefront-nextjs/components/auth/auth-guard.tsx +94 -0
- package/templates/storefront-nextjs/components/commerce/add-to-cart-button.tsx +77 -0
- package/templates/storefront-nextjs/components/commerce/cart-icon.tsx +29 -0
- package/templates/storefront-nextjs/components/commerce/currency-selector.tsx +217 -0
- package/templates/storefront-nextjs/components/commerce/pagination.tsx +62 -0
- package/templates/storefront-nextjs/components/commerce/product-actions.tsx +135 -0
- package/templates/storefront-nextjs/components/commerce/product-filters.tsx +109 -0
- package/templates/storefront-nextjs/components/commerce/product-price.tsx +375 -0
- package/templates/storefront-nextjs/components/commerce/search-input.tsx +178 -0
- package/templates/storefront-nextjs/components/commerce/sort-select.tsx +64 -0
- package/templates/storefront-nextjs/components/commerce/variant-selector.tsx +210 -0
- package/templates/storefront-nextjs/components/layout/footer.tsx +107 -0
- package/templates/storefront-nextjs/components/layout/header.tsx +104 -0
- package/templates/storefront-nextjs/components/providers.tsx +62 -0
- package/templates/storefront-nextjs/lib/auth/routes.ts +52 -0
- package/templates/storefront-nextjs/lib/currency.tsx +140 -0
- package/templates/storefront-nextjs/lib/format.ts +159 -0
- package/templates/storefront-nextjs/lib/graphql-queries.ts +629 -0
- package/templates/storefront-nextjs/lib/hooks.ts +30 -0
- package/templates/storefront-nextjs/middleware.ts +80 -0
- package/templates/storefront-nextjs/next.config.ts +37 -0
- package/templates/storefront-nextjs/open-next.config.ts +3 -0
- package/templates/storefront-nextjs/package.dev.json +30 -0
- package/templates/storefront-nextjs/package.json +32 -0
- package/templates/storefront-nextjs/package.json.template +32 -0
- package/templates/storefront-nextjs/postcss.config.mjs +8 -0
- package/templates/storefront-nextjs/tailwind.config.ts +111 -0
- package/templates/storefront-nextjs/tsconfig.json +27 -0
- package/templates/storefront-nextjs/wrangler.toml +9 -0
- package/templates/storefront-nextjs-shadcn/.env.example +68 -0
- package/templates/storefront-nextjs-shadcn/.github/workflows/build-template.yml +109 -0
- package/templates/storefront-nextjs-shadcn/.github/workflows/deploy.yml +25 -0
- package/templates/storefront-nextjs-shadcn/.github/workflows/preview.yml +22 -0
- package/templates/storefront-nextjs-shadcn/CART_INTEGRATION.md +282 -0
- package/templates/storefront-nextjs-shadcn/CLAUDE.md +96 -0
- package/templates/storefront-nextjs-shadcn/GRAPHQL_DOCUMENT_NAMES.md +190 -0
- package/templates/storefront-nextjs-shadcn/GRAPHQL_ERROR_HANDLING.md +263 -0
- package/templates/storefront-nextjs-shadcn/GRAPHQL_FIXES_SUMMARY.md +135 -0
- package/templates/storefront-nextjs-shadcn/GRAPHQL_INTEGRATION_COMPLETE.md +142 -0
- package/templates/storefront-nextjs-shadcn/INTEGRATION_CHECKLIST.md +448 -0
- package/templates/storefront-nextjs-shadcn/PRODUCT_DETAIL_PAGE_IMPLEMENTATION.md +307 -0
- package/templates/storefront-nextjs-shadcn/README.md +195 -0
- package/templates/storefront-nextjs-shadcn/THEME_CUSTOMIZATION.md +245 -0
- package/templates/storefront-nextjs-shadcn/app/about/page.tsx +34 -0
- package/templates/storefront-nextjs-shadcn/app/account/addresses/page.tsx +215 -0
- package/templates/storefront-nextjs-shadcn/app/account/loyalty/page.tsx +484 -0
- package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/page.tsx +128 -0
- package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/tracking/page.tsx +206 -0
- package/templates/storefront-nextjs-shadcn/app/account/orders/page.tsx +80 -0
- package/templates/storefront-nextjs-shadcn/app/account/page.tsx +107 -0
- package/templates/storefront-nextjs-shadcn/app/account/settings/page.tsx +195 -0
- package/templates/storefront-nextjs-shadcn/app/api/auth/clear-token/route.ts +87 -0
- package/templates/storefront-nextjs-shadcn/app/api/auth/set-token/route.ts +125 -0
- package/templates/storefront-nextjs-shadcn/app/auth/forgot-password/page.tsx +131 -0
- package/templates/storefront-nextjs-shadcn/app/auth/login/page.tsx +24 -0
- package/templates/storefront-nextjs-shadcn/app/auth/register/page.tsx +20 -0
- package/templates/storefront-nextjs-shadcn/app/blog/[slug]/page.tsx +323 -0
- package/templates/storefront-nextjs-shadcn/app/blog/page.tsx +159 -0
- package/templates/storefront-nextjs-shadcn/app/brands/[slug]/page.tsx +170 -0
- package/templates/storefront-nextjs-shadcn/app/brands/page.tsx +73 -0
- package/templates/storefront-nextjs-shadcn/app/cart/page.tsx +165 -0
- package/templates/storefront-nextjs-shadcn/app/categories/[slug]/page.tsx +78 -0
- package/templates/storefront-nextjs-shadcn/app/categories/page.tsx +75 -0
- package/templates/storefront-nextjs-shadcn/app/checkout/page.tsx +1752 -0
- package/templates/storefront-nextjs-shadcn/app/checkout/success/[orderId]/page.tsx +256 -0
- package/templates/storefront-nextjs-shadcn/app/collections/[handle]/page.tsx +74 -0
- package/templates/storefront-nextjs-shadcn/app/collections/page.tsx +75 -0
- package/templates/storefront-nextjs-shadcn/app/contact/page.tsx +114 -0
- package/templates/storefront-nextjs-shadcn/app/error.tsx +90 -0
- package/templates/storefront-nextjs-shadcn/app/globals.css +125 -0
- package/templates/storefront-nextjs-shadcn/app/layout.tsx +57 -0
- package/templates/storefront-nextjs-shadcn/app/not-found.tsx +68 -0
- package/templates/storefront-nextjs-shadcn/app/page.tsx +21 -0
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/page.tsx +246 -0
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/product-client.tsx +343 -0
- package/templates/storefront-nextjs-shadcn/app/products/page.tsx +25 -0
- package/templates/storefront-nextjs-shadcn/app/products/products-client.tsx +192 -0
- package/templates/storefront-nextjs-shadcn/app/returns/page.tsx +77 -0
- package/templates/storefront-nextjs-shadcn/app/robots.ts +53 -0
- package/templates/storefront-nextjs-shadcn/app/search/page.tsx +16 -0
- package/templates/storefront-nextjs-shadcn/app/search/search-client.tsx +47 -0
- package/templates/storefront-nextjs-shadcn/app/shipping/page.tsx +62 -0
- package/templates/storefront-nextjs-shadcn/app/sitemap.ts +144 -0
- package/templates/storefront-nextjs-shadcn/app/wishlist/page.tsx +179 -0
- package/templates/storefront-nextjs-shadcn/codegen.ts +51 -0
- package/templates/storefront-nextjs-shadcn/components/account/address-form.tsx +348 -0
- package/templates/storefront-nextjs-shadcn/components/account/address-list.tsx +144 -0
- package/templates/storefront-nextjs-shadcn/components/account/order-details.tsx +258 -0
- package/templates/storefront-nextjs-shadcn/components/account/order-history.tsx +107 -0
- package/templates/storefront-nextjs-shadcn/components/auth/account-menu.tsx +132 -0
- package/templates/storefront-nextjs-shadcn/components/auth/login-form.tsx +188 -0
- package/templates/storefront-nextjs-shadcn/components/auth/register-form.tsx +305 -0
- package/templates/storefront-nextjs-shadcn/components/blog/blog-card.tsx +240 -0
- package/templates/storefront-nextjs-shadcn/components/blog/blog-sidebar.tsx +177 -0
- package/templates/storefront-nextjs-shadcn/components/blog/index.ts +8 -0
- package/templates/storefront-nextjs-shadcn/components/brand/brand-card.tsx +119 -0
- package/templates/storefront-nextjs-shadcn/components/brand/brand-grid.tsx +64 -0
- package/templates/storefront-nextjs-shadcn/components/cart/cart-drawer.tsx +140 -0
- package/templates/storefront-nextjs-shadcn/components/cart/cart-icon.tsx +48 -0
- package/templates/storefront-nextjs-shadcn/components/cart/cart-item.tsx +112 -0
- package/templates/storefront-nextjs-shadcn/components/cart/cart-summary.tsx +84 -0
- package/templates/storefront-nextjs-shadcn/components/cart/index.ts +17 -0
- package/templates/storefront-nextjs-shadcn/components/cart/promo-code-input.tsx +121 -0
- package/templates/storefront-nextjs-shadcn/components/cart/shipping-estimator.tsx +162 -0
- package/templates/storefront-nextjs-shadcn/components/checkout/index.ts +25 -0
- package/templates/storefront-nextjs-shadcn/components/checkout/payment-method-card.tsx +187 -0
- package/templates/storefront-nextjs-shadcn/components/checkout/payment-step.tsx +160 -0
- package/templates/storefront-nextjs-shadcn/components/checkout/tax-breakdown.tsx +154 -0
- package/templates/storefront-nextjs-shadcn/components/commerce/currency-selector.tsx +225 -0
- package/templates/storefront-nextjs-shadcn/components/commerce/pagination.tsx +62 -0
- package/templates/storefront-nextjs-shadcn/components/commerce/product-actions.tsx +158 -0
- package/templates/storefront-nextjs-shadcn/components/commerce/search-input.tsx +174 -0
- package/templates/storefront-nextjs-shadcn/components/commerce/variant-selector.tsx +210 -0
- package/templates/storefront-nextjs-shadcn/components/common/category-card.tsx +97 -0
- package/templates/storefront-nextjs-shadcn/components/common/collection-card.tsx +187 -0
- package/templates/storefront-nextjs-shadcn/components/common/price-display.tsx +151 -0
- package/templates/storefront-nextjs-shadcn/components/common/social-share.tsx +166 -0
- package/templates/storefront-nextjs-shadcn/components/discount/discount-breakdown.tsx +245 -0
- package/templates/storefront-nextjs-shadcn/components/discount/discount-code-input.tsx +246 -0
- package/templates/storefront-nextjs-shadcn/components/discount/index.ts +19 -0
- package/templates/storefront-nextjs-shadcn/components/error/error-boundary.tsx +113 -0
- package/templates/storefront-nextjs-shadcn/components/error/index.ts +7 -0
- package/templates/storefront-nextjs-shadcn/components/filters/attribute-filter.tsx +153 -0
- package/templates/storefront-nextjs-shadcn/components/filters/checkbox-group-filter.tsx +167 -0
- package/templates/storefront-nextjs-shadcn/components/filters/color-swatch-filter.tsx +176 -0
- package/templates/storefront-nextjs-shadcn/components/filters/dynamic-attribute-filters.tsx +220 -0
- package/templates/storefront-nextjs-shadcn/components/filters/index.ts +36 -0
- package/templates/storefront-nextjs-shadcn/components/filters/range-slider-filter.tsx +193 -0
- package/templates/storefront-nextjs-shadcn/components/filters/toggle-filter.tsx +132 -0
- package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-balance.tsx +321 -0
- package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-input.tsx +309 -0
- package/templates/storefront-nextjs-shadcn/components/gift-card/index.ts +24 -0
- package/templates/storefront-nextjs-shadcn/components/home/category-grid.tsx +72 -0
- package/templates/storefront-nextjs-shadcn/components/home/featured-collections.tsx +107 -0
- package/templates/storefront-nextjs-shadcn/components/home/featured-products.tsx +85 -0
- package/templates/storefront-nextjs-shadcn/components/home/hero-section.tsx +34 -0
- package/templates/storefront-nextjs-shadcn/components/home/index.ts +8 -0
- package/templates/storefront-nextjs-shadcn/components/home/newsletter-signup.tsx +108 -0
- package/templates/storefront-nextjs-shadcn/components/layout/breadcrumbs.tsx +133 -0
- package/templates/storefront-nextjs-shadcn/components/layout/currency-selector.tsx +341 -0
- package/templates/storefront-nextjs-shadcn/components/layout/footer.tsx +128 -0
- package/templates/storefront-nextjs-shadcn/components/layout/header.tsx +147 -0
- package/templates/storefront-nextjs-shadcn/components/layout/index.ts +9 -0
- package/templates/storefront-nextjs-shadcn/components/layout/mobile-menu.tsx +211 -0
- package/templates/storefront-nextjs-shadcn/components/layout/navigation.tsx +95 -0
- package/templates/storefront-nextjs-shadcn/components/layout/theme-switcher.tsx +192 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/index.ts +11 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/points-balance.tsx +93 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/points-history.tsx +177 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/referral-section.tsx +250 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/rewards-catalog.tsx +217 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/tier-badge.tsx +106 -0
- package/templates/storefront-nextjs-shadcn/components/loyalty/tier-progress.tsx +131 -0
- package/templates/storefront-nextjs-shadcn/components/order/delivery-estimate.tsx +196 -0
- package/templates/storefront-nextjs-shadcn/components/order/index.ts +11 -0
- package/templates/storefront-nextjs-shadcn/components/order/order-tracking.tsx +200 -0
- package/templates/storefront-nextjs-shadcn/components/order/shipment-card.tsx +407 -0
- package/templates/storefront-nextjs-shadcn/components/order/tracking-status.tsx +222 -0
- package/templates/storefront-nextjs-shadcn/components/order/tracking-timeline.tsx +205 -0
- package/templates/storefront-nextjs-shadcn/components/product/add-to-cart-button.tsx +161 -0
- package/templates/storefront-nextjs-shadcn/components/product/b2b-price-display.tsx +250 -0
- package/templates/storefront-nextjs-shadcn/components/product/discount-badge.tsx +196 -0
- package/templates/storefront-nextjs-shadcn/components/product/index.ts +41 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-card.tsx +147 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-filters.tsx +217 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-gallery.tsx +143 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-grid.tsx +83 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-image.tsx +155 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-price.tsx +158 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-quantity-selector.tsx +111 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-reviews.tsx +238 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-sort.tsx +58 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-variant-selector.tsx +169 -0
- package/templates/storefront-nextjs-shadcn/components/product/review-card.tsx +220 -0
- package/templates/storefront-nextjs-shadcn/components/product/review-form.tsx +338 -0
- package/templates/storefront-nextjs-shadcn/components/product/review-summary.tsx +143 -0
- package/templates/storefront-nextjs-shadcn/components/product/sale-countdown.tsx +166 -0
- package/templates/storefront-nextjs-shadcn/components/product/savings-display.tsx +213 -0
- package/templates/storefront-nextjs-shadcn/components/product/similar-products.tsx +57 -0
- package/templates/storefront-nextjs-shadcn/components/product/stock-indicator.tsx +91 -0
- package/templates/storefront-nextjs-shadcn/components/providers/currency-provider.tsx +103 -0
- package/templates/storefront-nextjs-shadcn/components/providers/index.ts +8 -0
- package/templates/storefront-nextjs-shadcn/components/providers/query-provider.tsx +260 -0
- package/templates/storefront-nextjs-shadcn/components/providers/theme-provider.tsx +13 -0
- package/templates/storefront-nextjs-shadcn/components/returns/index.ts +26 -0
- package/templates/storefront-nextjs-shadcn/components/returns/return-request-form.tsx +608 -0
- package/templates/storefront-nextjs-shadcn/components/returns/return-status-card.tsx +554 -0
- package/templates/storefront-nextjs-shadcn/components/search/index.ts +8 -0
- package/templates/storefront-nextjs-shadcn/components/search/search-bar.tsx +140 -0
- package/templates/storefront-nextjs-shadcn/components/search/search-results.tsx +58 -0
- package/templates/storefront-nextjs-shadcn/components/search/search-suggestions.tsx +43 -0
- package/templates/storefront-nextjs-shadcn/components/seo/index.ts +12 -0
- package/templates/storefront-nextjs-shadcn/components/seo/json-ld.tsx +56 -0
- package/templates/storefront-nextjs-shadcn/components/seo/product-json-ld.ts +167 -0
- package/templates/storefront-nextjs-shadcn/components/shipping/index.ts +16 -0
- package/templates/storefront-nextjs-shadcn/components/shipping/shipping-method-selector.tsx +337 -0
- package/templates/storefront-nextjs-shadcn/components/ui/accordion.tsx +153 -0
- package/templates/storefront-nextjs-shadcn/components/ui/alert.tsx +59 -0
- package/templates/storefront-nextjs-shadcn/components/ui/badge.tsx +34 -0
- package/templates/storefront-nextjs-shadcn/components/ui/button.tsx +51 -0
- package/templates/storefront-nextjs-shadcn/components/ui/card.tsx +77 -0
- package/templates/storefront-nextjs-shadcn/components/ui/checkbox.tsx +30 -0
- package/templates/storefront-nextjs-shadcn/components/ui/dialog.tsx +137 -0
- package/templates/storefront-nextjs-shadcn/components/ui/empty-state.tsx +207 -0
- package/templates/storefront-nextjs-shadcn/components/ui/index.ts +67 -0
- package/templates/storefront-nextjs-shadcn/components/ui/input.tsx +65 -0
- package/templates/storefront-nextjs-shadcn/components/ui/label.tsx +26 -0
- package/templates/storefront-nextjs-shadcn/components/ui/pagination.tsx +205 -0
- package/templates/storefront-nextjs-shadcn/components/ui/radio-group.tsx +44 -0
- package/templates/storefront-nextjs-shadcn/components/ui/select.tsx +160 -0
- package/templates/storefront-nextjs-shadcn/components/ui/separator.tsx +28 -0
- package/templates/storefront-nextjs-shadcn/components/ui/skeleton.tsx +20 -0
- package/templates/storefront-nextjs-shadcn/components/ui/spinner.tsx +82 -0
- package/templates/storefront-nextjs-shadcn/components/ui/tabs.tsx +119 -0
- package/templates/storefront-nextjs-shadcn/components/ui/toast.tsx +96 -0
- package/templates/storefront-nextjs-shadcn/components/wishlist/index.ts +9 -0
- package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-button.tsx +148 -0
- package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-icon.tsx +47 -0
- package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-item.tsx +165 -0
- package/templates/storefront-nextjs-shadcn/components.json +19 -0
- package/templates/storefront-nextjs-shadcn/generated/.gitkeep +2 -0
- package/templates/storefront-nextjs-shadcn/graphql/.gitkeep +31 -0
- package/templates/storefront-nextjs-shadcn/graphql/collections.example.ts +168 -0
- package/templates/storefront-nextjs-shadcn/graphql/products.example.ts +160 -0
- package/templates/storefront-nextjs-shadcn/hooks/index.ts +9 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-auth.ts +310 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-cart-actions.ts +286 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-cart-sync.ts +110 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-filter-params.test.ts +173 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-filter-params.ts +298 -0
- package/templates/storefront-nextjs-shadcn/lib/auth/cookies.ts +220 -0
- package/templates/storefront-nextjs-shadcn/lib/auth/routes.ts +57 -0
- package/templates/storefront-nextjs-shadcn/lib/config.ts +46 -0
- package/templates/storefront-nextjs-shadcn/lib/currency/IMPLEMENTATION_SUMMARY.md +254 -0
- package/templates/storefront-nextjs-shadcn/lib/currency/README.md +464 -0
- package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.test.ts +328 -0
- package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.ts +295 -0
- package/templates/storefront-nextjs-shadcn/lib/currency/index.ts +27 -0
- package/templates/storefront-nextjs-shadcn/lib/format.test.ts +397 -0
- package/templates/storefront-nextjs-shadcn/lib/format.ts +226 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/client.ts +109 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/hooks.ts +1183 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/server.ts +267 -0
- package/templates/storefront-nextjs-shadcn/lib/hooks.ts +30 -0
- package/templates/storefront-nextjs-shadcn/lib/theme/theme-config.ts +89 -0
- package/templates/storefront-nextjs-shadcn/lib/utils.ts +6 -0
- package/templates/storefront-nextjs-shadcn/next.config.ts +47 -0
- package/templates/storefront-nextjs-shadcn/open-next.config.ts +3 -0
- package/templates/storefront-nextjs-shadcn/package.dev.json +30 -0
- package/templates/storefront-nextjs-shadcn/package.json +60 -0
- package/templates/storefront-nextjs-shadcn/package.json.template +46 -0
- package/templates/storefront-nextjs-shadcn/postcss.config.mjs +8 -0
- package/templates/storefront-nextjs-shadcn/proxy.ts +80 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/apple-pay.svg +8 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/bank-transfer.svg +10 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/blik.svg +6 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/cash-on-delivery.svg +11 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/google-pay.svg +11 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/mastercard.svg +7 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/paypal.svg +7 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/payu.svg +7 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/przelewy24.svg +7 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/stripe.svg +4 -0
- package/templates/storefront-nextjs-shadcn/public/icons/payment/visa.svg +5 -0
- package/templates/storefront-nextjs-shadcn/stores/auth-store.ts +66 -0
- package/templates/storefront-nextjs-shadcn/stores/cart-store.ts +56 -0
- package/templates/storefront-nextjs-shadcn/stores/checkout-store.ts +184 -0
- package/templates/storefront-nextjs-shadcn/stores/currency-store.ts +103 -0
- package/templates/storefront-nextjs-shadcn/stores/wishlist-store.ts +291 -0
- package/templates/storefront-nextjs-shadcn/tailwind.config.ts +111 -0
- package/templates/storefront-nextjs-shadcn/tsconfig.json +27 -0
- package/templates/storefront-nextjs-shadcn/wrangler.toml +9 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import { createServer } from "http";
|
|
4
|
+
import { randomUUID } from "crypto";
|
|
5
|
+
import open from "open";
|
|
6
|
+
import { getApiUrl } from "../lib/api-url.js";
|
|
7
|
+
import { getActiveProfile, getProfile, setActiveProfileAccount, setProfileAccount, clearActiveProfileAccount, clearProfileAccount, getActiveProfileAccount, getActiveProfileAuthState, hasProfiles, addProfile, } from "../lib/env-storage.js";
|
|
8
|
+
/**
|
|
9
|
+
* Decode JWT payload without verification (for extracting role).
|
|
10
|
+
*/
|
|
11
|
+
function decodeJwtPayload(token) {
|
|
12
|
+
try {
|
|
13
|
+
const parts = token.split('.');
|
|
14
|
+
if (parts.length !== 3)
|
|
15
|
+
return {};
|
|
16
|
+
return JSON.parse(Buffer.from(parts[1], 'base64url').toString());
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export async function authLoginCommand(profileName) {
|
|
23
|
+
console.log(chalk.bold.blue("\nš DoSwiftly CLI - Login\n"));
|
|
24
|
+
// Determine target profile
|
|
25
|
+
let targetProfile = profileName ? getProfile(profileName) : getActiveProfile();
|
|
26
|
+
// If no profiles exist, create a default one
|
|
27
|
+
if (!targetProfile && !hasProfiles()) {
|
|
28
|
+
console.log(chalk.gray(" No profiles found. Creating default profile...\n"));
|
|
29
|
+
targetProfile = addProfile({
|
|
30
|
+
name: 'default',
|
|
31
|
+
apiUrl: 'https://api.doswiftly.pl',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (!targetProfile) {
|
|
35
|
+
if (profileName) {
|
|
36
|
+
console.log(chalk.red(` Profile "${profileName}" not found.`));
|
|
37
|
+
console.log(chalk.gray(' Run "doswiftly env list" to see available profiles.\n'));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.log(chalk.red(' No active profile.'));
|
|
41
|
+
console.log(chalk.gray(' Run "doswiftly env add <name>" to create one.\n'));
|
|
42
|
+
}
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
// Check if already logged in to this profile
|
|
46
|
+
const existingAccount = targetProfile.account;
|
|
47
|
+
if (existingAccount && Date.now() < existingAccount.expiresAt) {
|
|
48
|
+
console.log(chalk.yellow(`ā ļø Profile "${targetProfile.name}" is already logged in!\n`));
|
|
49
|
+
console.log(chalk.gray(`Email: ${chalk.cyan(existingAccount.email)}`));
|
|
50
|
+
console.log(chalk.gray(`Token expires: ${new Date(existingAccount.expiresAt).toLocaleString()}\n`));
|
|
51
|
+
console.log(chalk.gray(`Run 'doswiftly auth logout${profileName ? ` --profile=${profileName}` : ''}' to logout first.\n`));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const spinner = ora("Starting authentication...").start();
|
|
55
|
+
try {
|
|
56
|
+
// Start local callback server
|
|
57
|
+
const callbackPort = 8477;
|
|
58
|
+
const callbackUrl = `http://localhost:${callbackPort}/callback`;
|
|
59
|
+
let authData = null;
|
|
60
|
+
const stateNonce = randomUUID();
|
|
61
|
+
const server = createServer((req, res) => {
|
|
62
|
+
if (req.url?.startsWith("/callback")) {
|
|
63
|
+
const url = new URL(req.url, `http://localhost:${callbackPort}`);
|
|
64
|
+
// CSRF protection: verify state parameter
|
|
65
|
+
const receivedState = url.searchParams.get("state");
|
|
66
|
+
if (receivedState !== stateNonce) {
|
|
67
|
+
res.writeHead(400, { "Content-Type": "text/plain" });
|
|
68
|
+
res.end("Invalid or missing state parameter - possible CSRF attack. Please retry authentication.");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const token = url.searchParams.get("token");
|
|
72
|
+
const expiresAt = url.searchParams.get("expiresAt");
|
|
73
|
+
const userId = url.searchParams.get("userId");
|
|
74
|
+
const email = url.searchParams.get("email");
|
|
75
|
+
if (token && expiresAt && userId && email) {
|
|
76
|
+
const role = url.searchParams.get("role");
|
|
77
|
+
const decoded = !role ? decodeJwtPayload(token) : {};
|
|
78
|
+
authData = {
|
|
79
|
+
accessToken: token,
|
|
80
|
+
expiresAt: parseInt(expiresAt),
|
|
81
|
+
userId,
|
|
82
|
+
email,
|
|
83
|
+
role: role || decoded.role || 'user',
|
|
84
|
+
};
|
|
85
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
86
|
+
res.end(`<!DOCTYPE html>
|
|
87
|
+
<html>
|
|
88
|
+
<head>
|
|
89
|
+
<meta charset="utf-8" />
|
|
90
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
91
|
+
<title>DoSwiftly CLI - Logowanie</title>
|
|
92
|
+
<style>
|
|
93
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
94
|
+
body {
|
|
95
|
+
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: center;
|
|
100
|
+
min-height: 100vh;
|
|
101
|
+
gap: 1.5rem;
|
|
102
|
+
padding: 1.5rem;
|
|
103
|
+
background: #f4f4f5;
|
|
104
|
+
color: #09090b;
|
|
105
|
+
}
|
|
106
|
+
.logo {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
gap: 0.5rem;
|
|
110
|
+
font-weight: 500;
|
|
111
|
+
font-size: 0.875rem;
|
|
112
|
+
text-decoration: none;
|
|
113
|
+
color: inherit;
|
|
114
|
+
}
|
|
115
|
+
.logo-icon {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
width: 1.5rem;
|
|
120
|
+
height: 1.5rem;
|
|
121
|
+
border-radius: 0.375rem;
|
|
122
|
+
background: #18181b;
|
|
123
|
+
color: #fafafa;
|
|
124
|
+
}
|
|
125
|
+
.logo-icon svg { width: 1rem; height: 1rem; }
|
|
126
|
+
.card {
|
|
127
|
+
width: 100%;
|
|
128
|
+
max-width: 24rem;
|
|
129
|
+
background: white;
|
|
130
|
+
border: 1px solid #e4e4e7;
|
|
131
|
+
border-radius: 0.75rem;
|
|
132
|
+
box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
|
|
133
|
+
}
|
|
134
|
+
.card-content {
|
|
135
|
+
padding: 1.5rem;
|
|
136
|
+
padding-top: 1.5rem;
|
|
137
|
+
}
|
|
138
|
+
.inner {
|
|
139
|
+
display: flex;
|
|
140
|
+
flex-direction: column;
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: 1rem;
|
|
143
|
+
padding: 2rem 0;
|
|
144
|
+
}
|
|
145
|
+
.icon-badge {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
width: 3rem;
|
|
150
|
+
height: 3rem;
|
|
151
|
+
border-radius: 9999px;
|
|
152
|
+
background: rgba(22, 163, 74, 0.1);
|
|
153
|
+
}
|
|
154
|
+
.icon-badge svg {
|
|
155
|
+
width: 1.5rem;
|
|
156
|
+
height: 1.5rem;
|
|
157
|
+
color: #16a34a;
|
|
158
|
+
}
|
|
159
|
+
.text-center { text-align: center; }
|
|
160
|
+
.title {
|
|
161
|
+
font-weight: 500;
|
|
162
|
+
font-size: 0.875rem;
|
|
163
|
+
color: #09090b;
|
|
164
|
+
}
|
|
165
|
+
.subtitle {
|
|
166
|
+
font-size: 0.875rem;
|
|
167
|
+
color: #71717a;
|
|
168
|
+
margin-top: 0.25rem;
|
|
169
|
+
}
|
|
170
|
+
.details {
|
|
171
|
+
font-size: 0.75rem;
|
|
172
|
+
color: #a1a1aa;
|
|
173
|
+
margin-top: 0.75rem;
|
|
174
|
+
}
|
|
175
|
+
</style>
|
|
176
|
+
</head>
|
|
177
|
+
<body>
|
|
178
|
+
<div class="logo">
|
|
179
|
+
<div class="logo-icon">
|
|
180
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 2h10"/><path d="M5 6h14"/><rect x="3" y="10" width="18" height="12" rx="2"/></svg>
|
|
181
|
+
</div>
|
|
182
|
+
doswiftly
|
|
183
|
+
</div>
|
|
184
|
+
<div class="card">
|
|
185
|
+
<div class="card-content">
|
|
186
|
+
<div class="inner">
|
|
187
|
+
<div class="icon-badge">
|
|
188
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><polyline points="22 4 12 14.01 9 11.01"/></svg>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="text-center">
|
|
191
|
+
<p class="title">Zalogowano pomyÅlnie!</p>
|
|
192
|
+
<p class="subtitle">Możesz zamknÄ
Ä to okno i wróciÄ do terminala.</p>
|
|
193
|
+
<p class="details">Zalogowano jako <strong>${email}</strong> · Profil: ${targetProfile.name}</p>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</body>
|
|
199
|
+
</html>`);
|
|
200
|
+
// Close server after response is sent
|
|
201
|
+
setTimeout(() => {
|
|
202
|
+
server.close();
|
|
203
|
+
}, 1000);
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
res.writeHead(400, { "Content-Type": "text/plain" });
|
|
207
|
+
res.end("Authentication failed");
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
212
|
+
res.end("Not found");
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
await new Promise((resolve) => {
|
|
216
|
+
server.listen(callbackPort, () => resolve());
|
|
217
|
+
});
|
|
218
|
+
spinner.text = "Opening browser...";
|
|
219
|
+
// Open browser with OAuth flow - use the profile's API URL
|
|
220
|
+
const apiUrl = targetProfile.apiUrl || getApiUrl();
|
|
221
|
+
const authUrl = `${apiUrl}/auth/cli/login?callbackUrl=${encodeURIComponent(callbackUrl)}&state=${encodeURIComponent(stateNonce)}`;
|
|
222
|
+
console.log(chalk.gray(`\n API: ${apiUrl}`));
|
|
223
|
+
console.log(chalk.gray(` Profile: ${targetProfile.name}`));
|
|
224
|
+
await open(authUrl);
|
|
225
|
+
spinner.text = "Waiting for authentication...";
|
|
226
|
+
// Wait for callback
|
|
227
|
+
await new Promise((resolve, reject) => {
|
|
228
|
+
const checkInterval = setInterval(() => {
|
|
229
|
+
if (authData) {
|
|
230
|
+
clearInterval(checkInterval);
|
|
231
|
+
resolve();
|
|
232
|
+
}
|
|
233
|
+
}, 500);
|
|
234
|
+
// Timeout after 5 minutes
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
clearInterval(checkInterval);
|
|
237
|
+
server.close();
|
|
238
|
+
if (!authData) {
|
|
239
|
+
reject(new Error("Authentication timeout"));
|
|
240
|
+
}
|
|
241
|
+
}, 5 * 60 * 1000);
|
|
242
|
+
});
|
|
243
|
+
if (!authData) {
|
|
244
|
+
throw new Error("Authentication failed");
|
|
245
|
+
}
|
|
246
|
+
// TypeScript narrowing helper
|
|
247
|
+
const authenticatedData = authData;
|
|
248
|
+
// Save account to profile
|
|
249
|
+
if (profileName) {
|
|
250
|
+
setProfileAccount(profileName, authenticatedData);
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
setActiveProfileAccount(authenticatedData);
|
|
254
|
+
}
|
|
255
|
+
spinner.succeed(chalk.green("Authentication successful!"));
|
|
256
|
+
console.log(chalk.bold.green("\n⨠Success!\n"));
|
|
257
|
+
console.log(chalk.gray(`Profile: ${chalk.cyan(targetProfile.name)}`));
|
|
258
|
+
console.log(chalk.gray(`Logged in as: ${chalk.cyan(authenticatedData.email)}`));
|
|
259
|
+
console.log(chalk.gray(`User ID: ${authenticatedData.userId}`));
|
|
260
|
+
console.log(chalk.gray(`Token expires: ${new Date(authenticatedData.expiresAt).toLocaleString()}\n`));
|
|
261
|
+
// Close server and exit process
|
|
262
|
+
server.close(() => {
|
|
263
|
+
process.exit(0);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
spinner.fail(chalk.red("Authentication failed"));
|
|
268
|
+
console.error(chalk.red(error.message));
|
|
269
|
+
process.exit(1);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
export async function authLogoutCommand(profileName) {
|
|
273
|
+
console.log(chalk.bold.blue("\nš DoSwiftly CLI - Logout\n"));
|
|
274
|
+
// Determine target profile
|
|
275
|
+
const targetProfile = profileName ? getProfile(profileName) : getActiveProfile();
|
|
276
|
+
if (!targetProfile) {
|
|
277
|
+
if (profileName) {
|
|
278
|
+
console.log(chalk.red(` Profile "${profileName}" not found.`));
|
|
279
|
+
console.log(chalk.gray(' Run "doswiftly env list" to see available profiles.\n'));
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
console.log(chalk.yellow(" No active profile."));
|
|
283
|
+
console.log(chalk.gray(' Run "doswiftly env add <name>" to create one.\n'));
|
|
284
|
+
}
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
// Check if logged in
|
|
288
|
+
if (!targetProfile.account || Date.now() > targetProfile.account.expiresAt) {
|
|
289
|
+
console.log(chalk.yellow(` Profile "${targetProfile.name}" is not logged in.\n`));
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const email = targetProfile.account.email;
|
|
293
|
+
const spinner = ora("Logging out...").start();
|
|
294
|
+
try {
|
|
295
|
+
// Clear account from profile
|
|
296
|
+
if (profileName) {
|
|
297
|
+
clearProfileAccount(profileName);
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
clearActiveProfileAccount();
|
|
301
|
+
}
|
|
302
|
+
spinner.succeed(chalk.green("Logged out successfully!"));
|
|
303
|
+
console.log(chalk.gray(`\nProfile "${targetProfile.name}" logged out.`));
|
|
304
|
+
console.log(chalk.gray(`Email: ${email}\n`));
|
|
305
|
+
console.log(chalk.dim("Note: Token will expire in 30 days if not used.\n"));
|
|
306
|
+
}
|
|
307
|
+
catch (error) {
|
|
308
|
+
spinner.fail(chalk.red("Logout failed"));
|
|
309
|
+
console.error(chalk.red(error.message));
|
|
310
|
+
process.exit(1);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Get the stored token from the active profile.
|
|
315
|
+
* Returns null if not logged in or token expired.
|
|
316
|
+
* Shows warning if token is expired.
|
|
317
|
+
*/
|
|
318
|
+
export function getStoredToken() {
|
|
319
|
+
const account = getActiveProfileAccount();
|
|
320
|
+
if (!account) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
// Check if token expired
|
|
324
|
+
if (Date.now() > account.expiresAt) {
|
|
325
|
+
console.log(chalk.yellow("\nā ļø Your session has expired. Please login again.\n"));
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
return account.accessToken;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Get the stored user role from the active profile.
|
|
332
|
+
* Returns null if not logged in or role is not stored.
|
|
333
|
+
*/
|
|
334
|
+
export function getStoredRole() {
|
|
335
|
+
const account = getActiveProfileAccount();
|
|
336
|
+
if (!account) {
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
return account.role || null;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Check auth state without side effects (no warnings printed).
|
|
343
|
+
* Used for command visibility decisions (e.g. hiding SaaS-dev commands).
|
|
344
|
+
*/
|
|
345
|
+
export function getAuthStateSilent() {
|
|
346
|
+
return getActiveProfileAuthState();
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EACvB,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,uBAAuB,EAEvB,yBAAyB,EACzB,WAAW,EACX,UAAU,GAEX,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,SAAS,gBAAgB,CAAC,KAAa;IACrC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,WAAoB;IACzD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAAC,CA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CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,yBAAyB;IACzB,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;QACnC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CAAC,uDAAuD,CAAC,CACtE,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC,WAAW,CAAC;AAC7B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,yBAAyB,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AA4NA;;GAEG;AACH,wBAAsB,YAAY,kBAiEjC"}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import ora from 'ora';
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { existsSync, readFileSync } from 'fs';
|
|
5
|
+
/**
|
|
6
|
+
* Run a command and return success status
|
|
7
|
+
*/
|
|
8
|
+
function runCommand(command, args) {
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
const proc = spawn(command, args, {
|
|
11
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
12
|
+
});
|
|
13
|
+
let output = '';
|
|
14
|
+
proc.stdout?.on('data', (data) => (output += data.toString()));
|
|
15
|
+
proc.stderr?.on('data', (data) => (output += data.toString()));
|
|
16
|
+
proc.on('close', (code) => {
|
|
17
|
+
resolve({ success: code === 0, output: output.trim() });
|
|
18
|
+
});
|
|
19
|
+
proc.on('error', () => {
|
|
20
|
+
resolve({ success: false, output: 'Command not found' });
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Check TypeScript types
|
|
26
|
+
*/
|
|
27
|
+
async function checkTypes() {
|
|
28
|
+
if (!existsSync('tsconfig.json')) {
|
|
29
|
+
return {
|
|
30
|
+
name: 'TypeScript',
|
|
31
|
+
status: 'warn',
|
|
32
|
+
message: 'No tsconfig.json found',
|
|
33
|
+
details: 'TypeScript checking skipped',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const result = await runCommand('npx', ['tsc', '--noEmit']);
|
|
37
|
+
if (result.success) {
|
|
38
|
+
return {
|
|
39
|
+
name: 'TypeScript',
|
|
40
|
+
status: 'pass',
|
|
41
|
+
message: 'No type errors',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
// Count errors
|
|
45
|
+
const errorCount = (result.output.match(/error TS\d+/g) || []).length;
|
|
46
|
+
return {
|
|
47
|
+
name: 'TypeScript',
|
|
48
|
+
status: 'fail',
|
|
49
|
+
message: `${errorCount} type error${errorCount !== 1 ? 's' : ''} found`,
|
|
50
|
+
details: 'Run "npx tsc --noEmit" to see details',
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check ESLint
|
|
55
|
+
*/
|
|
56
|
+
async function checkLint() {
|
|
57
|
+
// Check if ESLint is configured
|
|
58
|
+
const eslintConfigs = [
|
|
59
|
+
'.eslintrc',
|
|
60
|
+
'.eslintrc.js',
|
|
61
|
+
'.eslintrc.json',
|
|
62
|
+
'.eslintrc.yml',
|
|
63
|
+
'eslint.config.js',
|
|
64
|
+
'eslint.config.mjs',
|
|
65
|
+
];
|
|
66
|
+
const hasEslint = eslintConfigs.some((config) => existsSync(config));
|
|
67
|
+
if (!hasEslint) {
|
|
68
|
+
// Check package.json for eslintConfig
|
|
69
|
+
if (existsSync('package.json')) {
|
|
70
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
|
71
|
+
if (!pkg.eslintConfig) {
|
|
72
|
+
return {
|
|
73
|
+
name: 'ESLint',
|
|
74
|
+
status: 'warn',
|
|
75
|
+
message: 'No ESLint configuration found',
|
|
76
|
+
details: 'Linting skipped',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const result = await runCommand('npx', ['eslint', '.', '--max-warnings=0']);
|
|
82
|
+
if (result.success) {
|
|
83
|
+
return {
|
|
84
|
+
name: 'ESLint',
|
|
85
|
+
status: 'pass',
|
|
86
|
+
message: 'No linting errors',
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// Count errors and warnings
|
|
90
|
+
const errorMatch = result.output.match(/(\d+) error/);
|
|
91
|
+
const warnMatch = result.output.match(/(\d+) warning/);
|
|
92
|
+
const errors = errorMatch ? parseInt(errorMatch[1], 10) : 0;
|
|
93
|
+
const warnings = warnMatch ? parseInt(warnMatch[1], 10) : 0;
|
|
94
|
+
if (errors > 0) {
|
|
95
|
+
return {
|
|
96
|
+
name: 'ESLint',
|
|
97
|
+
status: 'fail',
|
|
98
|
+
message: `${errors} error${errors !== 1 ? 's' : ''}, ${warnings} warning${warnings !== 1 ? 's' : ''}`,
|
|
99
|
+
details: 'Run "npx eslint . --fix" to auto-fix some issues',
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
name: 'ESLint',
|
|
104
|
+
status: 'warn',
|
|
105
|
+
message: `${warnings} warning${warnings !== 1 ? 's' : ''}`,
|
|
106
|
+
details: 'Run "npx eslint ." to see details',
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Check dependencies for issues
|
|
111
|
+
*/
|
|
112
|
+
async function checkDependencies() {
|
|
113
|
+
if (!existsSync('package.json')) {
|
|
114
|
+
return {
|
|
115
|
+
name: 'Dependencies',
|
|
116
|
+
status: 'warn',
|
|
117
|
+
message: 'No package.json found',
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
// Check for outdated dependencies
|
|
121
|
+
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
|
122
|
+
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
123
|
+
// Check for DoSwiftly packages
|
|
124
|
+
const doswiftlyPkgs = Object.keys(deps).filter((d) => d.startsWith('@doswiftly/'));
|
|
125
|
+
if (doswiftlyPkgs.length === 0) {
|
|
126
|
+
return {
|
|
127
|
+
name: 'Dependencies',
|
|
128
|
+
status: 'warn',
|
|
129
|
+
message: 'No @doswiftly packages found',
|
|
130
|
+
details: 'Run "pnpm add @doswiftly/commerce-sdk"',
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
// Check if node_modules exists
|
|
134
|
+
if (!existsSync('node_modules')) {
|
|
135
|
+
return {
|
|
136
|
+
name: 'Dependencies',
|
|
137
|
+
status: 'fail',
|
|
138
|
+
message: 'node_modules not found',
|
|
139
|
+
details: 'Run "pnpm install" to install dependencies',
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
name: 'Dependencies',
|
|
144
|
+
status: 'pass',
|
|
145
|
+
message: `${doswiftlyPkgs.length} @doswiftly package${doswiftlyPkgs.length !== 1 ? 's' : ''} installed`,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Check environment configuration
|
|
150
|
+
*/
|
|
151
|
+
function checkEnvironment() {
|
|
152
|
+
if (!existsSync('.env.local') && !existsSync('.env')) {
|
|
153
|
+
return {
|
|
154
|
+
name: 'Environment',
|
|
155
|
+
status: 'warn',
|
|
156
|
+
message: 'No .env.local file found',
|
|
157
|
+
details: 'Run "doswiftly env:generate" to create one',
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const envFile = existsSync('.env.local') ? '.env.local' : '.env';
|
|
161
|
+
const content = readFileSync(envFile, 'utf-8');
|
|
162
|
+
const required = ['NEXT_PUBLIC_API_URL', 'NEXT_PUBLIC_SHOP_SLUG'];
|
|
163
|
+
const missing = required.filter((key) => !content.includes(`${key}=`) ||
|
|
164
|
+
content.includes(`${key}=\n`) ||
|
|
165
|
+
content.includes(`${key}=$`));
|
|
166
|
+
if (missing.length > 0) {
|
|
167
|
+
return {
|
|
168
|
+
name: 'Environment',
|
|
169
|
+
status: 'fail',
|
|
170
|
+
message: `Missing: ${missing.join(', ')}`,
|
|
171
|
+
details: 'Run "doswiftly env:generate" to configure',
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
name: 'Environment',
|
|
176
|
+
status: 'pass',
|
|
177
|
+
message: 'All required variables set',
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Check command - run linting, type checking, and validation
|
|
182
|
+
*/
|
|
183
|
+
export async function checkCommand() {
|
|
184
|
+
console.log(chalk.bold.blue('\nš DoSwiftly CLI - Check Project\n'));
|
|
185
|
+
const spinner = ora('Running checks...').start();
|
|
186
|
+
const results = [];
|
|
187
|
+
// Run checks
|
|
188
|
+
spinner.text = 'Checking TypeScript...';
|
|
189
|
+
results.push(await checkTypes());
|
|
190
|
+
spinner.text = 'Checking ESLint...';
|
|
191
|
+
results.push(await checkLint());
|
|
192
|
+
spinner.text = 'Checking dependencies...';
|
|
193
|
+
results.push(await checkDependencies());
|
|
194
|
+
spinner.text = 'Checking environment...';
|
|
195
|
+
results.push(checkEnvironment());
|
|
196
|
+
spinner.stop();
|
|
197
|
+
// Display results
|
|
198
|
+
console.log(chalk.bold('Check Results:\n'));
|
|
199
|
+
for (const result of results) {
|
|
200
|
+
const icon = result.status === 'pass'
|
|
201
|
+
? chalk.green('ā')
|
|
202
|
+
: result.status === 'fail'
|
|
203
|
+
? chalk.red('ā')
|
|
204
|
+
: chalk.yellow('ā ');
|
|
205
|
+
const statusColor = result.status === 'pass'
|
|
206
|
+
? chalk.green
|
|
207
|
+
: result.status === 'fail'
|
|
208
|
+
? chalk.red
|
|
209
|
+
: chalk.yellow;
|
|
210
|
+
console.log(` ${icon} ${chalk.bold(result.name)}`);
|
|
211
|
+
console.log(` ${statusColor(result.message)}`);
|
|
212
|
+
if (result.details) {
|
|
213
|
+
console.log(chalk.gray(` ${result.details}`));
|
|
214
|
+
}
|
|
215
|
+
console.log('');
|
|
216
|
+
}
|
|
217
|
+
// Summary
|
|
218
|
+
const passed = results.filter((r) => r.status === 'pass').length;
|
|
219
|
+
const failed = results.filter((r) => r.status === 'fail').length;
|
|
220
|
+
const warned = results.filter((r) => r.status === 'warn').length;
|
|
221
|
+
console.log(chalk.bold('Summary:'));
|
|
222
|
+
console.log(` ${chalk.green(`${passed} passed`)}, ${chalk.yellow(`${warned} warnings`)}, ${chalk.red(`${failed} failed`)}\n`);
|
|
223
|
+
if (failed > 0) {
|
|
224
|
+
console.log(chalk.red('Some checks failed. Please fix the issues above.\n'));
|
|
225
|
+
process.exit(1);
|
|
226
|
+
}
|
|
227
|
+
else if (warned > 0) {
|
|
228
|
+
console.log(chalk.yellow('All critical checks passed with warnings.\n'));
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
console.log(chalk.green('All checks passed!\n'));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,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