@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,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,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAQ3C,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,UAAsB,EAAE;IACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEzD,gCAAgC;IAChC,IACE,CAAC,UAAU,CAAC,qBAAqB,CAAC;QAClC,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAClC,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC,CAAC;QACjE,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CACR,g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CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,EAClD;YACE,KAAK,EAAE,SAAS;YAChB,GAAG,EAAE;gBACH,GAAG,OAAO,CAAC,GAAG;gBACd,mBAAmB,EAAE,MAAM;gBAC3B,qBAAqB,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI;aAC7C;SACF,CACF,CAAC;QAEF,6BAA6B;QAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;YAC1D,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QAEH,MAAM,UAAU,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAE,KAAe,CAAC,OAAO,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -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,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB;IACvB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAChC,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3D,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;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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,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AO,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
|