@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
package/dist/index.js
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Re-export configuration types and helpers for library usage
|
|
3
|
+
export { defineConfig, } from "./config/types.js";
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { readFileSync } from "fs";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
import { dirname, join } from "path";
|
|
9
|
+
import { initCommand } from "./commands/init.js";
|
|
10
|
+
import { authLoginCommand, authLogoutCommand, getAuthStateSilent } from "./commands/auth.js";
|
|
11
|
+
import { authGithubCommand } from "./commands/auth-github.js";
|
|
12
|
+
import { authTokenCommand } from "./commands/auth-token.js";
|
|
13
|
+
import { devCommand } from "./commands/dev.js";
|
|
14
|
+
import { configPullCommand, configShowCommand } from "./commands/config.js";
|
|
15
|
+
import { updateCommand } from "./commands/update.js";
|
|
16
|
+
import { envListCommand, envAddCommand, envUseCommand, envGenerateCommand, envDeleteCommand, envSetCommand, } from "./commands/env.js";
|
|
17
|
+
import { verifyCommand } from "./commands/verify.js";
|
|
18
|
+
import { sdkVersionCommand } from "./commands/sdk.js";
|
|
19
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
20
|
+
import { checkCommand } from "./commands/check.js";
|
|
21
|
+
import { deployCommand, deployStatusCommand, deployRollbackCommand, deployLogsCommand, } from "./commands/deploy.js";
|
|
22
|
+
import { previewCommand, previewListCommand, previewStopCommand, previewLogsCommand, previewOpenCommand, } from "./commands/preview.js";
|
|
23
|
+
import { domainAddCommand, domainRemoveCommand, domainListCommand, } from "./commands/domain.js";
|
|
24
|
+
import { templateListCommand, templateInfoCommand, templateRegisterCommand, templateUpdateCommand, templatePublishCommand, templateVersionCommand, templateUnpublishCommand, templateVisibilityCommand, templateCreateCommand, templateValidateCommand, templateBuildCommand, templateUploadCommand, templateBundleInfoCommand, templateSetupBuildsCommand, } from "./commands/template.js";
|
|
25
|
+
import { inspectCommand } from "./commands/inspect.js";
|
|
26
|
+
import { proxyCommand } from "./commands/proxy.js";
|
|
27
|
+
import { migrateCheckCommand, migrateApplyCommand, migrateDiffCommand, } from "./commands/migrate.js";
|
|
28
|
+
import { upgradeCommand } from "./commands/upgrade.js";
|
|
29
|
+
import { whoamiCommand } from "./commands/whoami.js";
|
|
30
|
+
import { configureLogger } from "./lib/logger.js";
|
|
31
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
32
|
+
const __dirname = dirname(__filename);
|
|
33
|
+
// Read package.json for version
|
|
34
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
35
|
+
const program = new Command();
|
|
36
|
+
program
|
|
37
|
+
.name("doswiftly")
|
|
38
|
+
.description("DoSwiftly CLI - Scaffold and deploy e-commerce storefronts")
|
|
39
|
+
.version(packageJson.version, "-v, --version", "Output the current version")
|
|
40
|
+
.option("--verbose", "Enable verbose output")
|
|
41
|
+
.option("--quiet", "Suppress non-error output")
|
|
42
|
+
.hook("preAction", (thisCommand) => {
|
|
43
|
+
const opts = thisCommand.opts();
|
|
44
|
+
configureLogger({
|
|
45
|
+
verbose: opts.verbose || false,
|
|
46
|
+
quiet: opts.quiet || false,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
// ============================================
|
|
50
|
+
// TIER 1: Essential Commands
|
|
51
|
+
// ============================================
|
|
52
|
+
// doswiftly init
|
|
53
|
+
program
|
|
54
|
+
.command("init [name]")
|
|
55
|
+
.description("Initialize a new DoSwiftly project")
|
|
56
|
+
.option("-p, --project-id <id>", "DoSwiftly project ID")
|
|
57
|
+
.option("-t, --template <template>", "Project template")
|
|
58
|
+
.option("--pm <manager>", "Package manager to use (pnpm, npm, yarn, bun)")
|
|
59
|
+
.option("-l, --language <language>", "Language (TypeScript or JavaScript)")
|
|
60
|
+
.option("--styling <library>", "Styling library (Tailwind v4, Tailwind v3, CSS Modules, None)")
|
|
61
|
+
.option("--ui-library <library>", "UI library (shadcn/ui, Radix UI, Headless UI, None)")
|
|
62
|
+
.option("--dry-run", "Show what would be created without making changes")
|
|
63
|
+
.option("--no-remote", "Use only local templates (skip API)")
|
|
64
|
+
.option("--create-template", "Create a new template project for the registry (SaaS developer)")
|
|
65
|
+
.action(initCommand);
|
|
66
|
+
// doswiftly whoami
|
|
67
|
+
program
|
|
68
|
+
.command("whoami")
|
|
69
|
+
.description("Show current user, project, and environment info")
|
|
70
|
+
.action(whoamiCommand);
|
|
71
|
+
// doswiftly auth
|
|
72
|
+
const authCommand = program
|
|
73
|
+
.command("auth")
|
|
74
|
+
.description("Manage authentication");
|
|
75
|
+
authCommand
|
|
76
|
+
.command("login")
|
|
77
|
+
.description("Login to DoSwiftly (saves to active profile)")
|
|
78
|
+
.option("-p, --profile <name>", "Target profile (default: active profile)")
|
|
79
|
+
.action((options) => authLoginCommand(options.profile));
|
|
80
|
+
authCommand
|
|
81
|
+
.command("logout")
|
|
82
|
+
.description("Logout from DoSwiftly (clears active profile)")
|
|
83
|
+
.option("-p, --profile <name>", "Target profile (default: active profile)")
|
|
84
|
+
.action((options) => authLogoutCommand(options.profile));
|
|
85
|
+
authCommand
|
|
86
|
+
.command("github")
|
|
87
|
+
.description("Connect GitHub account via device flow")
|
|
88
|
+
.action(authGithubCommand);
|
|
89
|
+
authCommand
|
|
90
|
+
.command("token")
|
|
91
|
+
.description("Generate a deploy token for CI/CD")
|
|
92
|
+
.option("--deploy", "Generate a deploy-scoped token")
|
|
93
|
+
.action(authTokenCommand);
|
|
94
|
+
// Show examples and subcommands in main help
|
|
95
|
+
program.on("--help", () => {
|
|
96
|
+
console.log("");
|
|
97
|
+
console.log("Authentication Commands:");
|
|
98
|
+
console.log(" auth login Login to DoSwiftly");
|
|
99
|
+
console.log(" auth logout Logout from DoSwiftly");
|
|
100
|
+
console.log("");
|
|
101
|
+
console.log("Configuration Commands:");
|
|
102
|
+
console.log(" config pull Refresh configuration from API");
|
|
103
|
+
console.log(" config show Display current configuration");
|
|
104
|
+
console.log("");
|
|
105
|
+
console.log("Examples:");
|
|
106
|
+
console.log("");
|
|
107
|
+
console.log(" # Create a new storefront project");
|
|
108
|
+
console.log(" $ doswiftly init my-shop");
|
|
109
|
+
console.log("");
|
|
110
|
+
console.log(" # Create storefront with specific options");
|
|
111
|
+
console.log(" $ doswiftly init my-shop --language TypeScript --styling 'Tailwind CSS v4'");
|
|
112
|
+
console.log("");
|
|
113
|
+
console.log(" # Initialize with project ID");
|
|
114
|
+
console.log(" $ doswiftly init my-shop --project-id proj_abc123 --pm yarn");
|
|
115
|
+
console.log("");
|
|
116
|
+
console.log(" # Preview what would be created");
|
|
117
|
+
console.log(" $ doswiftly init my-shop --dry-run");
|
|
118
|
+
console.log("");
|
|
119
|
+
console.log(" # Start development server");
|
|
120
|
+
console.log(" $ doswiftly dev --port 4000");
|
|
121
|
+
console.log("");
|
|
122
|
+
console.log(" # Enable verbose output");
|
|
123
|
+
console.log(" $ doswiftly --verbose init my-shop");
|
|
124
|
+
console.log("");
|
|
125
|
+
console.log("Documentation: https://docs.doswiftly.pl/cli");
|
|
126
|
+
});
|
|
127
|
+
// doswiftly dev
|
|
128
|
+
program
|
|
129
|
+
.command("dev")
|
|
130
|
+
.description("Start development server")
|
|
131
|
+
.option("-p, --port <port>", "Port number", "3000")
|
|
132
|
+
.option("-H, --host <host>", "Hostname", "localhost")
|
|
133
|
+
.option("--no-open", "Do not open browser")
|
|
134
|
+
.action(devCommand);
|
|
135
|
+
// doswiftly config
|
|
136
|
+
const configCommand = program
|
|
137
|
+
.command("config")
|
|
138
|
+
.description("Manage configuration");
|
|
139
|
+
configCommand
|
|
140
|
+
.command("pull")
|
|
141
|
+
.description("Refresh configuration from API")
|
|
142
|
+
.action(configPullCommand);
|
|
143
|
+
configCommand
|
|
144
|
+
.command("show")
|
|
145
|
+
.description("Display current configuration")
|
|
146
|
+
.action(configShowCommand);
|
|
147
|
+
const domainCmd = configCommand
|
|
148
|
+
.command("domain")
|
|
149
|
+
.description("Manage custom domains");
|
|
150
|
+
domainCmd
|
|
151
|
+
.command("add <hostname>")
|
|
152
|
+
.description("Add a custom domain to the shop")
|
|
153
|
+
.action(domainAddCommand);
|
|
154
|
+
domainCmd
|
|
155
|
+
.command("remove <hostname>")
|
|
156
|
+
.description("Remove a custom domain from the shop")
|
|
157
|
+
.action(domainRemoveCommand);
|
|
158
|
+
domainCmd
|
|
159
|
+
.command("list")
|
|
160
|
+
.description("List all custom domains with status")
|
|
161
|
+
.action(domainListCommand);
|
|
162
|
+
// doswiftly update
|
|
163
|
+
program
|
|
164
|
+
.command("update")
|
|
165
|
+
.description("Check for CLI updates")
|
|
166
|
+
.action(updateCommand);
|
|
167
|
+
// doswiftly env
|
|
168
|
+
const envCommand = program
|
|
169
|
+
.command("env")
|
|
170
|
+
.description("Manage environment profiles");
|
|
171
|
+
envCommand
|
|
172
|
+
.command("list")
|
|
173
|
+
.description("List all environment profiles")
|
|
174
|
+
.action(envListCommand);
|
|
175
|
+
envCommand
|
|
176
|
+
.command("add [name]")
|
|
177
|
+
.description("Add a new environment profile")
|
|
178
|
+
.action(envAddCommand);
|
|
179
|
+
envCommand
|
|
180
|
+
.command("use [name]")
|
|
181
|
+
.description("Switch to a different environment profile")
|
|
182
|
+
.action(envUseCommand);
|
|
183
|
+
envCommand
|
|
184
|
+
.command("generate")
|
|
185
|
+
.description("Generate .env.local from active profile")
|
|
186
|
+
.action(envGenerateCommand);
|
|
187
|
+
envCommand
|
|
188
|
+
.command("delete [name]")
|
|
189
|
+
.description("Delete an environment profile")
|
|
190
|
+
.action(envDeleteCommand);
|
|
191
|
+
envCommand
|
|
192
|
+
.command("set <key> <value>")
|
|
193
|
+
.description("Set a custom environment variable on the active profile")
|
|
194
|
+
.action(envSetCommand);
|
|
195
|
+
// doswiftly verify
|
|
196
|
+
program
|
|
197
|
+
.command("verify")
|
|
198
|
+
.description("Verify API connectivity and configuration")
|
|
199
|
+
.action(verifyCommand);
|
|
200
|
+
// doswiftly sdk
|
|
201
|
+
const sdkCommand = program.command("sdk").description("Manage Commerce SDK");
|
|
202
|
+
sdkCommand
|
|
203
|
+
.command("version")
|
|
204
|
+
.description("Check Commerce SDK version")
|
|
205
|
+
.action(sdkVersionCommand);
|
|
206
|
+
// doswiftly doctor
|
|
207
|
+
program
|
|
208
|
+
.command("doctor")
|
|
209
|
+
.description("Check CLI and project health")
|
|
210
|
+
.action(doctorCommand);
|
|
211
|
+
// doswiftly check
|
|
212
|
+
program
|
|
213
|
+
.command("check")
|
|
214
|
+
.description("Run linting, type checking, and validation")
|
|
215
|
+
.action(checkCommand);
|
|
216
|
+
// doswiftly deploy
|
|
217
|
+
const deployCmd = program
|
|
218
|
+
.command("deploy")
|
|
219
|
+
.description("Deploy storefront to cloud provider");
|
|
220
|
+
deployCmd
|
|
221
|
+
.command("run", { isDefault: true })
|
|
222
|
+
.description("Deploy storefront to Cloudflare Workers")
|
|
223
|
+
.option("--type <type>", "Deployment type (PRODUCTION, PREVIEW, STAGING)", "PRODUCTION")
|
|
224
|
+
.option("--provider <provider>", "[DEPRECATED] Cloud provider")
|
|
225
|
+
.option("--branch <branch>", "Git branch to deploy")
|
|
226
|
+
.option("--message <message>", "Deployment message")
|
|
227
|
+
.action(deployCommand);
|
|
228
|
+
deployCmd
|
|
229
|
+
.command("status [deploymentId]")
|
|
230
|
+
.description("Check deployment status")
|
|
231
|
+
.action(deployStatusCommand);
|
|
232
|
+
deployCmd
|
|
233
|
+
.command("rollback [deploymentId]")
|
|
234
|
+
.description("Rollback to previous deployment")
|
|
235
|
+
.action(deployRollbackCommand);
|
|
236
|
+
deployCmd
|
|
237
|
+
.command("logs <deploymentId>")
|
|
238
|
+
.description("View deployment logs")
|
|
239
|
+
.action(deployLogsCommand);
|
|
240
|
+
// doswiftly preview
|
|
241
|
+
const previewCmd = program
|
|
242
|
+
.command("preview")
|
|
243
|
+
.description("Manage preview deployments");
|
|
244
|
+
previewCmd
|
|
245
|
+
.command("create", { isDefault: true })
|
|
246
|
+
.description("Create a preview deployment")
|
|
247
|
+
.option("--branch <branch>", "Git branch to preview")
|
|
248
|
+
.option("--ttl <hours>", "Time to live in hours (default: 168 / 7 days)", "168")
|
|
249
|
+
.action((options) => previewCommand({ ...options, ttl: parseInt(options.ttl, 10) }));
|
|
250
|
+
previewCmd
|
|
251
|
+
.command("list")
|
|
252
|
+
.description("List all preview deployments")
|
|
253
|
+
.action(previewListCommand);
|
|
254
|
+
previewCmd
|
|
255
|
+
.command("stop <previewId>")
|
|
256
|
+
.description("Stop a preview deployment")
|
|
257
|
+
.action(previewStopCommand);
|
|
258
|
+
previewCmd
|
|
259
|
+
.command("logs <previewId>")
|
|
260
|
+
.description("View preview build logs")
|
|
261
|
+
.action(previewLogsCommand);
|
|
262
|
+
previewCmd
|
|
263
|
+
.command("open <previewId>")
|
|
264
|
+
.description("Open preview URL in browser")
|
|
265
|
+
.action(previewOpenCommand);
|
|
266
|
+
// doswiftly template
|
|
267
|
+
const templateCmd = program
|
|
268
|
+
.command("template")
|
|
269
|
+
.description("Manage storefront templates");
|
|
270
|
+
templateCmd
|
|
271
|
+
.command("list")
|
|
272
|
+
.description("List available templates")
|
|
273
|
+
.action(templateListCommand);
|
|
274
|
+
templateCmd
|
|
275
|
+
.command("info <name>")
|
|
276
|
+
.description("Show template details")
|
|
277
|
+
.action(templateInfoCommand);
|
|
278
|
+
const { isSaasDeveloper } = getAuthStateSilent();
|
|
279
|
+
const saasDevHidden = !isSaasDeveloper ? { hidden: true } : {};
|
|
280
|
+
templateCmd
|
|
281
|
+
.command("register", saasDevHidden)
|
|
282
|
+
.description("Register a new template in the registry [saas dev]")
|
|
283
|
+
.option("--name <name>", "Template name (auto-detected from doswiftly-template.json)")
|
|
284
|
+
.option("--description <desc>", "Template description")
|
|
285
|
+
.option("--repo-url <url>", "Git repository URL (auto-detected from git remote)")
|
|
286
|
+
.option("--ui-library <lib>", "UI library (shadcn, chakra, etc.)")
|
|
287
|
+
.action(templateRegisterCommand);
|
|
288
|
+
templateCmd
|
|
289
|
+
.command("update <nameOrId>", saasDevHidden)
|
|
290
|
+
.description("Update template metadata [saas dev]")
|
|
291
|
+
.option("--description <desc>", "Template description")
|
|
292
|
+
.option("--repo-url <url>", "Git repository URL")
|
|
293
|
+
.option("--ui-library <lib>", "UI library")
|
|
294
|
+
.option("--preview-url <url>", "Preview URL")
|
|
295
|
+
.option("--visibility <vis>", "Visibility (PUBLIC, PRIVATE)")
|
|
296
|
+
.action(templateUpdateCommand);
|
|
297
|
+
templateCmd
|
|
298
|
+
.command("publish [nameOrId]", saasDevHidden)
|
|
299
|
+
.description("Publish template with version from package.json [saas dev]")
|
|
300
|
+
.action(templatePublishCommand);
|
|
301
|
+
// Deprecated alias for backward compatibility
|
|
302
|
+
templateCmd
|
|
303
|
+
.command("version <nameOrId> <version>", { hidden: true })
|
|
304
|
+
.description("[DEPRECATED] Use 'template publish' instead")
|
|
305
|
+
.action(templateVersionCommand);
|
|
306
|
+
templateCmd
|
|
307
|
+
.command("unpublish <name>", saasDevHidden)
|
|
308
|
+
.description("Unpublish/deprecate a template [saas dev]")
|
|
309
|
+
.action(templateUnpublishCommand);
|
|
310
|
+
templateCmd
|
|
311
|
+
.command("visibility <nameOrId> <visibility>", saasDevHidden)
|
|
312
|
+
.description("Set template visibility: PUBLIC or PRIVATE [saas dev]")
|
|
313
|
+
.action(templateVisibilityCommand);
|
|
314
|
+
templateCmd
|
|
315
|
+
.command("create", saasDevHidden)
|
|
316
|
+
.description("Create a new template with GitHub integration [saas dev]")
|
|
317
|
+
.option("--name <name>", "Template name")
|
|
318
|
+
.option("--description <desc>", "Template description")
|
|
319
|
+
.option("--base <template>", "Base template (storefront-minimal, storefront-nextjs-shadcn)")
|
|
320
|
+
.option("--skip-github", "Skip GitHub repository creation")
|
|
321
|
+
.action(templateCreateCommand);
|
|
322
|
+
templateCmd
|
|
323
|
+
.command("validate", saasDevHidden)
|
|
324
|
+
.description("Validate a template project before publishing [saas dev]")
|
|
325
|
+
.option("--build", "Run build test as part of validation")
|
|
326
|
+
.action(templateValidateCommand);
|
|
327
|
+
templateCmd
|
|
328
|
+
.command("build", saasDevHidden)
|
|
329
|
+
.description("Build template for Cloudflare Workers (OpenNext) [saas dev]")
|
|
330
|
+
.option("--skip-next-build", "Skip Next.js build step")
|
|
331
|
+
.action(templateBuildCommand);
|
|
332
|
+
templateCmd
|
|
333
|
+
.command("upload", saasDevHidden)
|
|
334
|
+
.description("Upload built worker bundle to R2 [saas dev]")
|
|
335
|
+
.option("--version <version>", "Version to publish (default: from package.json)")
|
|
336
|
+
.option("--worker-path <path>", "Path to worker.js (default: .open-next/worker.js)")
|
|
337
|
+
.action(templateUploadCommand);
|
|
338
|
+
templateCmd
|
|
339
|
+
.command("bundle-info [nameOrId]", saasDevHidden)
|
|
340
|
+
.description("Show bundle upload and deployment status [saas dev]")
|
|
341
|
+
.action(templateBundleInfoCommand);
|
|
342
|
+
templateCmd
|
|
343
|
+
.command("setup-builds [nameOrId]", saasDevHidden)
|
|
344
|
+
.description("Setup CF Workers Builds for auto-deploy on push [saas dev]")
|
|
345
|
+
.action(templateSetupBuildsCommand);
|
|
346
|
+
// doswiftly inspect
|
|
347
|
+
program
|
|
348
|
+
.command("inspect <endpoint>")
|
|
349
|
+
.description("Make a test request to an API endpoint")
|
|
350
|
+
.option("-X, --method <method>", "HTTP method", "GET")
|
|
351
|
+
.option("-H, --header <header...>", "Request headers (key:value format)")
|
|
352
|
+
.option("-d, --body <body>", "Request body (JSON)")
|
|
353
|
+
.option("-v, --verbose", "Show full request/response details")
|
|
354
|
+
.action((endpoint, options) => inspectCommand(endpoint, {
|
|
355
|
+
method: options.method,
|
|
356
|
+
headers: options.header,
|
|
357
|
+
body: options.body,
|
|
358
|
+
verbose: options.verbose,
|
|
359
|
+
}));
|
|
360
|
+
// doswiftly proxy
|
|
361
|
+
program
|
|
362
|
+
.command("proxy")
|
|
363
|
+
.description("Start a local proxy server for API debugging")
|
|
364
|
+
.option("-p, --port <port>", "Proxy server port", "3001")
|
|
365
|
+
.action(proxyCommand);
|
|
366
|
+
// doswiftly migrate
|
|
367
|
+
const migrateCmd = program
|
|
368
|
+
.command("migrate")
|
|
369
|
+
.description("Manage template migrations");
|
|
370
|
+
migrateCmd
|
|
371
|
+
.command("check", { isDefault: true })
|
|
372
|
+
.description("Check for template updates")
|
|
373
|
+
.action(migrateCheckCommand);
|
|
374
|
+
migrateCmd
|
|
375
|
+
.command("apply")
|
|
376
|
+
.description("Apply pending template updates")
|
|
377
|
+
.option("--dry-run", "Show what would be changed without applying")
|
|
378
|
+
.option("--force", "Continue on errors")
|
|
379
|
+
.action(migrateApplyCommand);
|
|
380
|
+
migrateCmd
|
|
381
|
+
.command("diff")
|
|
382
|
+
.description("Show differences between local project and template")
|
|
383
|
+
.action(migrateDiffCommand);
|
|
384
|
+
// doswiftly upgrade (user-friendly wrapper around migrate)
|
|
385
|
+
program
|
|
386
|
+
.command("upgrade")
|
|
387
|
+
.description("Check for and apply template updates")
|
|
388
|
+
.option("--check", "Only check for updates (do not apply)")
|
|
389
|
+
.option("--dry-run", "Show what would be changed without applying")
|
|
390
|
+
.option("--force", "Apply updates without confirmation, continue on errors")
|
|
391
|
+
.option("--diff", "Show differences between local project and template")
|
|
392
|
+
.action((options) => upgradeCommand({
|
|
393
|
+
checkOnly: options.check,
|
|
394
|
+
dryRun: options.dryRun,
|
|
395
|
+
force: options.force,
|
|
396
|
+
diff: options.diff,
|
|
397
|
+
}));
|
|
398
|
+
// Global error handler
|
|
399
|
+
process.on("uncaughtException", (error) => {
|
|
400
|
+
console.error(chalk.red("\n✖ Unexpected error:"));
|
|
401
|
+
console.error(chalk.red(error.message));
|
|
402
|
+
process.exit(1);
|
|
403
|
+
});
|
|
404
|
+
process.on("unhandledRejection", (reason) => {
|
|
405
|
+
console.error(chalk.red("\n✖ Unhandled promise rejection:"));
|
|
406
|
+
console.error(chalk.red(String(reason)));
|
|
407
|
+
process.exit(1);
|
|
408
|
+
});
|
|
409
|
+
// If no command provided, show help
|
|
410
|
+
if (!process.argv.slice(2).length) {
|
|
411
|
+
program.outputHelp();
|
|
412
|
+
process.exit(0);
|
|
413
|
+
}
|
|
414
|
+
// Parse arguments
|
|
415
|
+
program.parse(process.argv);
|
|
416
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,8DAA8D;AAC9D,OAAO,EACL,YAAY,GAQb,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;A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AAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,oCAAoC;AACpC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,kBAAkB;AAClB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified API URL resolution for all CLI commands.
|
|
3
|
+
*
|
|
4
|
+
* Priority:
|
|
5
|
+
* 1. DOSWIFTLY_API_URL env var (highest priority — CI/CD, testing)
|
|
6
|
+
* 2. Active profile apiUrl (from `doswiftly env add`)
|
|
7
|
+
* 3. Default: https://api.doswiftly.pl
|
|
8
|
+
*
|
|
9
|
+
* Local config (doswiftly.config.ts → api.url) is intentionally NOT checked here.
|
|
10
|
+
* It is only used as an additional override in createSharedApiClient() for
|
|
11
|
+
* project-scoped commands (deploy, config, etc.).
|
|
12
|
+
*/
|
|
13
|
+
export declare function getApiUrl(): string;
|
|
14
|
+
//# sourceMappingURL=api-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-url.d.ts","sourceRoot":"","sources":["../../src/lib/api-url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAWlC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getActiveProfile } from './env-storage.js';
|
|
2
|
+
/**
|
|
3
|
+
* Unified API URL resolution for all CLI commands.
|
|
4
|
+
*
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. DOSWIFTLY_API_URL env var (highest priority — CI/CD, testing)
|
|
7
|
+
* 2. Active profile apiUrl (from `doswiftly env add`)
|
|
8
|
+
* 3. Default: https://api.doswiftly.pl
|
|
9
|
+
*
|
|
10
|
+
* Local config (doswiftly.config.ts → api.url) is intentionally NOT checked here.
|
|
11
|
+
* It is only used as an additional override in createSharedApiClient() for
|
|
12
|
+
* project-scoped commands (deploy, config, etc.).
|
|
13
|
+
*/
|
|
14
|
+
export function getApiUrl() {
|
|
15
|
+
if (process.env.DOSWIFTLY_API_URL) {
|
|
16
|
+
return process.env.DOSWIFTLY_API_URL;
|
|
17
|
+
}
|
|
18
|
+
const profile = getActiveProfile();
|
|
19
|
+
if (profile?.apiUrl) {
|
|
20
|
+
return profile.apiUrl;
|
|
21
|
+
}
|
|
22
|
+
return 'https://api.doswiftly.pl';
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=api-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-url.js","sourceRoot":"","sources":["../../src/lib/api-url.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,SAAS;IACvB,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAClC,OAAO,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACvC,CAAC;IAED,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,MAAM,CAAC;IACxB,CAAC;IAED,OAAO,0BAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
export declare function createApiClient(token: string): AxiosInstance;
|
|
3
|
+
export interface CLIConfig {
|
|
4
|
+
project: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
subdomain: string;
|
|
8
|
+
team: {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
commerce: {
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
storeName: string;
|
|
16
|
+
currency: string;
|
|
17
|
+
locale: string;
|
|
18
|
+
};
|
|
19
|
+
features: {
|
|
20
|
+
cart: boolean;
|
|
21
|
+
checkout: boolean;
|
|
22
|
+
customerAuth: boolean;
|
|
23
|
+
guestCheckout: boolean;
|
|
24
|
+
wishlist: boolean;
|
|
25
|
+
productReviews: boolean;
|
|
26
|
+
returns: boolean;
|
|
27
|
+
multiCurrency: boolean;
|
|
28
|
+
};
|
|
29
|
+
shipping: {
|
|
30
|
+
providers: string[];
|
|
31
|
+
default: string;
|
|
32
|
+
freeThreshold?: number;
|
|
33
|
+
};
|
|
34
|
+
payments: {
|
|
35
|
+
providers: string[];
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
storefront: {
|
|
39
|
+
primaryColor?: string;
|
|
40
|
+
logo?: string;
|
|
41
|
+
customCss?: string;
|
|
42
|
+
metaTitle?: string;
|
|
43
|
+
metaDescription?: string;
|
|
44
|
+
};
|
|
45
|
+
business: {
|
|
46
|
+
taxEnabled: boolean;
|
|
47
|
+
taxRate: number;
|
|
48
|
+
taxId?: string;
|
|
49
|
+
};
|
|
50
|
+
returnPolicy: {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
daysToReturn: number;
|
|
53
|
+
instructions: string;
|
|
54
|
+
};
|
|
55
|
+
apiKey: {
|
|
56
|
+
public: string;
|
|
57
|
+
};
|
|
58
|
+
api?: {
|
|
59
|
+
url?: string;
|
|
60
|
+
};
|
|
61
|
+
dev?: {
|
|
62
|
+
port?: number;
|
|
63
|
+
openBrowser?: boolean;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export declare function fetchCLIConfig(token: string, projectId: string): Promise<CLIConfig>;
|
|
67
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sour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C1B,CAAC;IAEF,QAAQ,EAAE;QACR,UAAU,EAAE,OAAO,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,YAAY,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAEF,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IAEF,GAAG,CAAC,EAAE;QACJ,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,GAAG,CAAC,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAED,wBAAsB,cAAc,CAClC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,SAAS,CAAC,CAoBpB"}
|
package/dist/lib/api.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
const API_URL = process.env.DOSWIFTLY_API_URL || "https://api.doswiftly.pl";
|
|
3
|
+
let apiClient = null;
|
|
4
|
+
export function createApiClient(token) {
|
|
5
|
+
if (!apiClient) {
|
|
6
|
+
apiClient = axios.create({
|
|
7
|
+
baseURL: API_URL,
|
|
8
|
+
headers: {
|
|
9
|
+
"Content-Type": "application/json",
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
// Set authorization header
|
|
14
|
+
apiClient.defaults.headers.common["Authorization"] = `Bearer ${token}`;
|
|
15
|
+
return apiClient;
|
|
16
|
+
}
|
|
17
|
+
export async function fetchCLIConfig(token, projectId) {
|
|
18
|
+
const client = createApiClient(token);
|
|
19
|
+
try {
|
|
20
|
+
const response = await client.get(`/v1/projects/${projectId}/cli-config`);
|
|
21
|
+
return response.data;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
if (axios.isAxiosError(error)) {
|
|
25
|
+
if (error.response?.status === 401) {
|
|
26
|
+
throw new Error("Authentication failed. Please login again.");
|
|
27
|
+
}
|
|
28
|
+
if (error.response?.status === 404) {
|
|
29
|
+
throw new Error(`Project ${projectId} not found.`);
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`API error: ${error.response?.data?.message || error.message}`);
|
|
32
|
+
}
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAE7C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,0BAA0B,CAAC;AAE5E,IAAI,SAAS,GAAyB,IAAI,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAC;IACL,CAAC;IAED,2BAA2B;IAC3B,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,UAAU,KAAK,EAAE,CAAC;IAEvE,OAAO,SAAS,CAAC;AACnB,CAAC;AA4ED,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,KAAa,EACb,SAAiB;IAEjB,MAAM,MAAM,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,gBAAgB,SAAS,aAAa,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YACD,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC;gBACnC,MAAM,IAAI,KAAK,CAAC,WAAW,SAAS,aAAa,CAAC,CAAC;YACrD,CAAC;YACD,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,CAC/D,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CLIConfig } from "./api.js";
|
|
2
|
+
/**
|
|
3
|
+
* Local project configuration read from doswiftly.config.ts / .js
|
|
4
|
+
*/
|
|
5
|
+
export interface LocalConfig {
|
|
6
|
+
shop: {
|
|
7
|
+
slug: string;
|
|
8
|
+
};
|
|
9
|
+
project?: {
|
|
10
|
+
name?: string;
|
|
11
|
+
};
|
|
12
|
+
api?: {
|
|
13
|
+
url?: string;
|
|
14
|
+
};
|
|
15
|
+
dev?: {
|
|
16
|
+
port?: number;
|
|
17
|
+
openBrowser?: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read and parse the local doswiftly.config.ts/.js file.
|
|
22
|
+
*
|
|
23
|
+
* Supports both the new format (shop.slug) and legacy format (project.id).
|
|
24
|
+
* Uses regex parsing since we cannot dynamically import .ts files.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readLocalConfigSync(): LocalConfig | null;
|
|
27
|
+
/**
|
|
28
|
+
* Get shop slug from local doswiftly.config.ts.
|
|
29
|
+
* Returns null if no config file, no slug found, or slug is a template placeholder.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getLocalShopSlug(): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* Get API URL from local doswiftly.config.ts.
|
|
34
|
+
* Returns null if no config file, no api.url found, or URL is a template placeholder.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getLocalApiUrl(): string | null;
|
|
37
|
+
export declare function loadConfig(token: string): Promise<CLIConfig>;
|
|
38
|
+
export declare function clearCache(): void;
|
|
39
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAkB,MAAM,UAAU,CAAC;AAMrD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AAOD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,GAAG,IAAI,CA4DxD;AAWD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAKhD;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,GAAG,IAAI,CAK9C;AA4BD,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CA4ElE;AAED,wBAAgB,UAAU,IAAI,IAAI,CAIjC"}
|