@doswiftly/cli 0.1.17 → 0.1.19
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 +23 -323
- package/dist/commands/check.js +1 -1
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +43 -20
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.js +4 -4
- package/dist/commands/sdk.js +5 -5
- package/dist/commands/sdk.js.map +1 -1
- package/dist/commands/template.js +4 -4
- package/dist/commands/template.js.map +1 -1
- package/dist/commands/types.js +5 -5
- package/dist/commands/types.js.map +1 -1
- package/dist/commands/verify.js +2 -2
- package/dist/commands/verify.js.map +1 -1
- package/dist/lib/package-manager.d.ts +1 -1
- package/dist/lib/package-manager.js +1 -1
- package/package.json +1 -1
- package/templates/storefront-minimal/wrangler.toml +4 -0
- package/templates/storefront-nextjs/README.md +16 -12
- package/templates/storefront-nextjs/app/account/orders/page.tsx +2 -2
- package/templates/storefront-nextjs/app/account/page.tsx +2 -2
- package/templates/storefront-nextjs/app/auth/login/page.tsx +1 -1
- package/templates/storefront-nextjs/app/auth/register/page.tsx +1 -1
- package/templates/storefront-nextjs/app/cart/page.tsx +1 -1
- package/templates/storefront-nextjs/app/categories/[slug]/page.tsx +2 -2
- package/templates/storefront-nextjs/app/categories/page.tsx +1 -1
- package/templates/storefront-nextjs/app/collections/[slug]/page.tsx +1 -1
- package/templates/storefront-nextjs/app/collections/page.tsx +1 -1
- package/templates/storefront-nextjs/app/page.tsx +1 -1
- package/templates/storefront-nextjs/app/products/[slug]/page.tsx +1 -1
- package/templates/storefront-nextjs/app/products/page.tsx +2 -2
- package/templates/storefront-nextjs/app/search/page.tsx +1 -1
- package/templates/storefront-nextjs/components/auth/auth-guard.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/add-to-cart-button.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/cart-icon.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/currency-selector.tsx +2 -2
- package/templates/storefront-nextjs/components/commerce/product-filters.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/product-price.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/search-input.tsx +1 -1
- package/templates/storefront-nextjs/components/commerce/sort-select.tsx +1 -1
- package/templates/storefront-nextjs/components/providers.tsx +1 -1
- package/templates/storefront-nextjs/lib/currency.tsx +3 -3
- package/templates/storefront-nextjs/lib/format.ts +1 -1
- package/templates/storefront-nextjs/lib/graphql-queries.ts +3 -3
- package/templates/storefront-nextjs/package.dev.json +1 -1
- package/templates/storefront-nextjs/package.json +1 -1
- package/templates/storefront-nextjs/package.json.template +1 -1
- package/templates/storefront-nextjs/wrangler.toml +4 -0
- package/templates/storefront-nextjs-shadcn/.github/workflows/deploy.yml +47 -0
- package/templates/storefront-nextjs-shadcn/.github/workflows/preview.yml +47 -0
- package/templates/storefront-nextjs-shadcn/CLAUDE.md +148 -35
- package/templates/storefront-nextjs-shadcn/README.md +29 -162
- package/templates/storefront-nextjs-shadcn/app/account/addresses/page.tsx +98 -91
- package/templates/storefront-nextjs-shadcn/app/account/error.tsx +43 -0
- package/templates/storefront-nextjs-shadcn/app/account/loading.tsx +19 -0
- package/templates/storefront-nextjs-shadcn/app/account/loyalty/page.tsx +53 -162
- package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/loading.tsx +60 -0
- package/templates/storefront-nextjs-shadcn/app/account/orders/[id]/page.tsx +36 -47
- package/templates/storefront-nextjs-shadcn/app/account/orders/page.tsx +46 -29
- package/templates/storefront-nextjs-shadcn/app/account/page.tsx +8 -5
- package/templates/storefront-nextjs-shadcn/app/account/settings/page.tsx +108 -71
- package/templates/storefront-nextjs-shadcn/app/api/auth/clear-token/route.ts +2 -86
- package/templates/storefront-nextjs-shadcn/app/api/auth/set-token/route.ts +2 -124
- package/templates/storefront-nextjs-shadcn/app/auth/forgot-password/page.tsx +10 -5
- package/templates/storefront-nextjs-shadcn/app/blog/[slug]/loading.tsx +17 -0
- package/templates/storefront-nextjs-shadcn/app/blog/[slug]/page.tsx +43 -2
- package/templates/storefront-nextjs-shadcn/app/blog/loading.tsx +19 -0
- package/templates/storefront-nextjs-shadcn/app/brands/page.tsx +2 -1
- package/templates/storefront-nextjs-shadcn/app/cart/loading.tsx +26 -0
- package/templates/storefront-nextjs-shadcn/app/cart/page.tsx +6 -3
- package/templates/storefront-nextjs-shadcn/app/categories/[slug]/category-products-client.tsx +56 -0
- package/templates/storefront-nextjs-shadcn/app/categories/[slug]/loading.tsx +32 -0
- package/templates/storefront-nextjs-shadcn/app/categories/[slug]/page.tsx +76 -59
- package/templates/storefront-nextjs-shadcn/app/categories/page.tsx +8 -4
- package/templates/storefront-nextjs-shadcn/app/checkout/error.tsx +43 -0
- package/templates/storefront-nextjs-shadcn/app/checkout/loading.tsx +31 -0
- package/templates/storefront-nextjs-shadcn/app/checkout/page.tsx +116 -79
- package/templates/storefront-nextjs-shadcn/app/collections/[handle]/loading.tsx +19 -0
- package/templates/storefront-nextjs-shadcn/app/collections/[handle]/page.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/app/collections/loading.tsx +18 -0
- package/templates/storefront-nextjs-shadcn/app/collections/page.tsx +7 -4
- package/templates/storefront-nextjs-shadcn/app/global-error.tsx +117 -0
- package/templates/storefront-nextjs-shadcn/app/globals.css +8 -0
- package/templates/storefront-nextjs-shadcn/app/layout.tsx +46 -11
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/error.tsx +43 -0
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/loading.tsx +29 -0
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/page.tsx +6 -6
- package/templates/storefront-nextjs-shadcn/app/products/[slug]/product-client.tsx +15 -61
- package/templates/storefront-nextjs-shadcn/app/products/loading.tsx +32 -0
- package/templates/storefront-nextjs-shadcn/app/products/products-client.tsx +405 -151
- package/templates/storefront-nextjs-shadcn/app/search/loading.tsx +18 -0
- package/templates/storefront-nextjs-shadcn/app/wishlist/page.tsx +8 -5
- package/templates/storefront-nextjs-shadcn/codegen.ts +48 -31
- package/templates/storefront-nextjs-shadcn/components/account/customer-info.fragment.graphql +36 -0
- package/templates/storefront-nextjs-shadcn/components/account/order-details.tsx +3 -1
- package/templates/storefront-nextjs-shadcn/components/account/order-history.tsx +26 -24
- package/templates/storefront-nextjs-shadcn/components/account/order-summary.fragment.graphql +36 -0
- package/templates/storefront-nextjs-shadcn/components/auth/account-menu.tsx +9 -9
- package/templates/storefront-nextjs-shadcn/components/auth/login-form.tsx +11 -37
- package/templates/storefront-nextjs-shadcn/components/auth/register-form.tsx +37 -23
- package/templates/storefront-nextjs-shadcn/components/cart/cart-drawer.tsx +4 -3
- package/templates/storefront-nextjs-shadcn/components/cart/cart-icon.tsx +8 -5
- package/templates/storefront-nextjs-shadcn/components/cart/cart-item.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/cart/cart-line.fragment.graphql +53 -0
- package/templates/storefront-nextjs-shadcn/components/cart/cart-summary.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/cart/shipping-estimator.tsx +22 -7
- package/templates/storefront-nextjs-shadcn/components/commerce/currency-selector.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/commerce/product-actions.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/commerce/search-input.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/common/price-display.tsx +35 -11
- package/templates/storefront-nextjs-shadcn/components/discount/discount-breakdown.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/discount/discount-code-input.tsx +3 -3
- package/templates/storefront-nextjs-shadcn/components/filters/range-slider-filter.tsx +5 -5
- package/templates/storefront-nextjs-shadcn/components/gift-card/gift-card-input.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/home/category-grid.tsx +2 -1
- package/templates/storefront-nextjs-shadcn/components/home/collection-card.fragment.graphql +21 -0
- package/templates/storefront-nextjs-shadcn/components/home/featured-collections.tsx +2 -12
- package/templates/storefront-nextjs-shadcn/components/home/index.ts +0 -1
- package/templates/storefront-nextjs-shadcn/components/hydrated.tsx +24 -0
- package/templates/storefront-nextjs-shadcn/components/layout/breadcrumbs.tsx +4 -4
- package/templates/storefront-nextjs-shadcn/components/layout/category-node.fragment.graphql +22 -0
- package/templates/storefront-nextjs-shadcn/components/layout/currency-selector.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/layout/header.tsx +33 -23
- package/templates/storefront-nextjs-shadcn/components/loyalty/points-balance.tsx +2 -11
- package/templates/storefront-nextjs-shadcn/components/loyalty/points-history.tsx +8 -25
- package/templates/storefront-nextjs-shadcn/components/loyalty/referral-section.tsx +10 -19
- package/templates/storefront-nextjs-shadcn/components/loyalty/rewards-catalog.tsx +17 -41
- package/templates/storefront-nextjs-shadcn/components/loyalty/tier-progress.tsx +2 -29
- package/templates/storefront-nextjs-shadcn/components/order/index.ts +6 -1
- package/templates/storefront-nextjs-shadcn/components/product/b2b-price-display.tsx +3 -1
- package/templates/storefront-nextjs-shadcn/components/product/filter-active-pills.tsx +69 -0
- package/templates/storefront-nextjs-shadcn/components/product/filter-mobile-sheet.tsx +84 -0
- package/templates/storefront-nextjs-shadcn/components/product/filter-price-range.tsx +138 -0
- package/templates/storefront-nextjs-shadcn/components/product/index.ts +9 -2
- package/templates/storefront-nextjs-shadcn/components/product/product-card.fragment.graphql +49 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-card.tsx +3 -31
- package/templates/storefront-nextjs-shadcn/components/product/product-detail.fragment.graphql +52 -0
- package/templates/storefront-nextjs-shadcn/components/product/product-filters.tsx +176 -123
- package/templates/storefront-nextjs-shadcn/components/product/product-grid.tsx +3 -5
- package/templates/storefront-nextjs-shadcn/components/product/product-image.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/product/product-price.tsx +2 -2
- package/templates/storefront-nextjs-shadcn/components/product/product-reviews.tsx +5 -4
- package/templates/storefront-nextjs-shadcn/components/product/product-sort.tsx +19 -7
- package/templates/storefront-nextjs-shadcn/components/product/product-variant-selector.tsx +8 -23
- package/templates/storefront-nextjs-shadcn/components/product/product-variant.fragment.graphql +51 -0
- package/templates/storefront-nextjs-shadcn/components/product/review-card.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/product/review-form.tsx +1 -7
- package/templates/storefront-nextjs-shadcn/components/product/savings-display.tsx +17 -2
- package/templates/storefront-nextjs-shadcn/components/product/similar-products.tsx +3 -2
- package/templates/storefront-nextjs-shadcn/components/providers/index.ts +1 -1
- package/templates/storefront-nextjs-shadcn/components/providers/stores-provider.tsx +30 -0
- package/templates/storefront-nextjs-shadcn/components/providers/theme-provider.tsx +1 -1
- package/templates/storefront-nextjs-shadcn/components/returns/index.ts +2 -2
- package/templates/storefront-nextjs-shadcn/components/returns/return-request-form.tsx +3 -2
- package/templates/storefront-nextjs-shadcn/components/search/search-results.tsx +3 -2
- package/templates/storefront-nextjs-shadcn/components/ui/form.tsx +174 -0
- package/templates/storefront-nextjs-shadcn/components/ui/index.ts +30 -2
- package/templates/storefront-nextjs-shadcn/components/ui/progress.tsx +40 -0
- package/templates/storefront-nextjs-shadcn/components/ui/sheet.tsx +107 -0
- package/templates/storefront-nextjs-shadcn/components/ui/slider.tsx +33 -0
- package/templates/storefront-nextjs-shadcn/components/ui/textarea.tsx +24 -0
- package/templates/storefront-nextjs-shadcn/components/wishlist/wishlist-icon.tsx +3 -1
- package/templates/storefront-nextjs-shadcn/generated/graphql.ts +12779 -0
- package/templates/storefront-nextjs-shadcn/graphql/custom.example.graphql +159 -0
- package/templates/storefront-nextjs-shadcn/hooks/index.ts +2 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-auth-sync.ts +42 -0
- package/templates/storefront-nextjs-shadcn/hooks/use-auth.ts +17 -295
- package/templates/storefront-nextjs-shadcn/hooks/use-cart-actions.ts +51 -19
- package/templates/storefront-nextjs-shadcn/hooks/use-cart-sync.ts +13 -9
- package/templates/storefront-nextjs-shadcn/lib/auth/routes.ts +4 -17
- package/templates/storefront-nextjs-shadcn/lib/graphql/client.ts +22 -99
- package/templates/storefront-nextjs-shadcn/lib/graphql/config.ts +32 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/fragments.ts +34 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/hooks.ts +687 -632
- package/templates/storefront-nextjs-shadcn/lib/graphql/query-keys.ts +86 -0
- package/templates/storefront-nextjs-shadcn/lib/graphql/server.ts +131 -182
- package/templates/storefront-nextjs-shadcn/lib/graphql/types.ts +62 -0
- package/templates/storefront-nextjs-shadcn/lib/theme/theme-config.ts +0 -17
- package/templates/storefront-nextjs-shadcn/next-env.d.ts +6 -0
- package/templates/storefront-nextjs-shadcn/package.dev.json +1 -3
- package/templates/storefront-nextjs-shadcn/package.json +12 -13
- package/templates/storefront-nextjs-shadcn/package.json.template +6 -7
- package/templates/storefront-nextjs-shadcn/proxy.ts +3 -4
- package/templates/storefront-nextjs-shadcn/stores/cart-store.ts +41 -39
- package/templates/storefront-nextjs-shadcn/stores/checkout-store.ts +64 -75
- package/templates/storefront-nextjs-shadcn/stores/wishlist-store.ts +178 -177
- package/templates/storefront-nextjs-shadcn/tsconfig.json +23 -5
- package/templates/storefront-nextjs-shadcn/wrangler.toml +4 -0
- package/templates/storefront-nextjs-shadcn/CART_INTEGRATION.md +0 -282
- package/templates/storefront-nextjs-shadcn/GRAPHQL_DOCUMENT_NAMES.md +0 -190
- package/templates/storefront-nextjs-shadcn/GRAPHQL_ERROR_HANDLING.md +0 -263
- package/templates/storefront-nextjs-shadcn/GRAPHQL_FIXES_SUMMARY.md +0 -135
- package/templates/storefront-nextjs-shadcn/GRAPHQL_INTEGRATION_COMPLETE.md +0 -142
- package/templates/storefront-nextjs-shadcn/INTEGRATION_CHECKLIST.md +0 -448
- package/templates/storefront-nextjs-shadcn/PRODUCT_DETAIL_PAGE_IMPLEMENTATION.md +0 -307
- package/templates/storefront-nextjs-shadcn/THEME_CUSTOMIZATION.md +0 -245
- package/templates/storefront-nextjs-shadcn/components/providers/currency-provider.tsx +0 -103
- package/templates/storefront-nextjs-shadcn/graphql/collections.example.ts +0 -168
- package/templates/storefront-nextjs-shadcn/graphql/products.example.ts +0 -160
- package/templates/storefront-nextjs-shadcn/lib/auth/cookies.ts +0 -220
- package/templates/storefront-nextjs-shadcn/lib/config.ts +0 -46
- package/templates/storefront-nextjs-shadcn/lib/currency/IMPLEMENTATION_SUMMARY.md +0 -254
- package/templates/storefront-nextjs-shadcn/lib/currency/README.md +0 -464
- package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.test.ts +0 -328
- package/templates/storefront-nextjs-shadcn/lib/currency/cookie-manager.ts +0 -295
- package/templates/storefront-nextjs-shadcn/lib/currency/index.ts +0 -27
- package/templates/storefront-nextjs-shadcn/lib/format.ts +0 -226
- package/templates/storefront-nextjs-shadcn/lib/hooks.ts +0 -30
- package/templates/storefront-nextjs-shadcn/stores/auth-store.ts +0 -66
- package/templates/storefront-nextjs-shadcn/stores/currency-store.ts +0 -103
package/README.md
CHANGED
|
@@ -4,354 +4,54 @@ Official CLI for building e-commerce storefronts powered by DoSwiftly Commerce A
|
|
|
4
4
|
|
|
5
5
|
## Who is this for?
|
|
6
6
|
|
|
7
|
-
This CLI is designed for **storefront developers**
|
|
7
|
+
This CLI is designed for **storefront developers** — developers building custom Next.js e-commerce applications using the DoSwiftly Commerce platform. If you're a merchant or business owner, you'll work with a developer who uses this tool.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
# Install globally
|
|
13
12
|
npm install -g @doswiftly/cli
|
|
14
|
-
|
|
15
|
-
# Or use with npx (no installation needed)
|
|
16
|
-
npx @doswiftly/cli init my-shop
|
|
17
13
|
```
|
|
18
14
|
|
|
19
15
|
## Quick Start
|
|
20
16
|
|
|
21
17
|
```bash
|
|
22
|
-
#
|
|
23
|
-
doswiftly init my-shop
|
|
24
|
-
|
|
25
|
-
# 2. Navigate to project
|
|
18
|
+
doswiftly init my-shop # Create a new storefront project
|
|
26
19
|
cd my-shop
|
|
27
|
-
|
|
28
|
-
#
|
|
29
|
-
doswiftly env add
|
|
30
|
-
|
|
31
|
-
# 4. Login to DoSwiftly
|
|
32
|
-
doswiftly auth login
|
|
33
|
-
|
|
34
|
-
# 5. Verify connection to DoSwiftly Commerce API
|
|
35
|
-
doswiftly verify
|
|
36
|
-
|
|
37
|
-
# 6. Start development server
|
|
38
|
-
doswiftly dev
|
|
20
|
+
doswiftly auth login # Login to DoSwiftly
|
|
21
|
+
doswiftly dev # Start development server
|
|
39
22
|
```
|
|
40
23
|
|
|
41
|
-
Your storefront will be running at `http://localhost:3000
|
|
42
|
-
|
|
43
|
-
## Commands
|
|
44
|
-
|
|
45
|
-
### Essential Commands
|
|
24
|
+
Your storefront will be running at `http://localhost:3000`.
|
|
46
25
|
|
|
47
|
-
|
|
48
|
-
| ----------------------- | -------------------------------------- |
|
|
49
|
-
| `doswiftly init [name]` | Create a new storefront project |
|
|
50
|
-
| `doswiftly dev` | Start development server |
|
|
51
|
-
| `doswiftly whoami` | Show current user, project, and env |
|
|
52
|
-
| `doswiftly doctor` | Check project health and configuration |
|
|
53
|
-
| `doswiftly check` | Run linting and type checking |
|
|
54
|
-
| `doswiftly update` | Check for CLI updates |
|
|
26
|
+
## Commands Overview
|
|
55
27
|
|
|
56
|
-
|
|
28
|
+
| Command | Description |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `doswiftly init [name]` | Create a new storefront project |
|
|
31
|
+
| `doswiftly dev` | Start development server |
|
|
32
|
+
| `doswiftly auth login` | Login to DoSwiftly (OAuth) |
|
|
33
|
+
| `doswiftly deploy run` | Deploy storefront to production |
|
|
34
|
+
| `doswiftly preview create` | Create a preview environment |
|
|
35
|
+
| `doswiftly env add` | Add environment profile (dev/staging/prod) |
|
|
36
|
+
| `doswiftly doctor` | Check project health |
|
|
37
|
+
| `doswiftly whoami` | Show current user and project info |
|
|
57
38
|
|
|
58
|
-
|
|
59
|
-
| ----------------------- | ---------------------------------------- |
|
|
60
|
-
| `doswiftly auth login` | Login to DoSwiftly (OAuth in browser) |
|
|
61
|
-
| `doswiftly auth logout` | Logout from DoSwiftly |
|
|
62
|
-
| `doswiftly auth github` | Connect GitHub account via device flow |
|
|
63
|
-
| `doswiftly auth token` | Generate a deploy token for CI/CD |
|
|
39
|
+
Run `doswiftly --help` for the full list of commands.
|
|
64
40
|
|
|
65
|
-
|
|
41
|
+
## Documentation
|
|
66
42
|
|
|
67
|
-
|
|
68
|
-
| -------------------------------- | ---------------------------------------------- |
|
|
69
|
-
| `doswiftly env list` | List all environment profiles |
|
|
70
|
-
| `doswiftly env add [name]` | Add new environment profile (dev/staging/prod) |
|
|
71
|
-
| `doswiftly env use [name]` | Switch active environment profile |
|
|
72
|
-
| `doswiftly env generate` | Generate .env.local from active profile |
|
|
73
|
-
| `doswiftly env set <key> <value>`| Set a custom variable on active profile |
|
|
74
|
-
| `doswiftly env delete [name]` | Delete environment profile |
|
|
75
|
-
| `doswiftly verify` | Verify API connectivity and credentials |
|
|
43
|
+
Full documentation, including detailed command reference, environment management, deployment pipeline, and SDK integration:
|
|
76
44
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
| ------------------------------------- | ---------------------------------- |
|
|
81
|
-
| `doswiftly config pull` | Refresh configuration from API |
|
|
82
|
-
| `doswiftly config show` | Display current configuration |
|
|
83
|
-
| `doswiftly config domain add <host>` | Add a custom domain to the shop |
|
|
84
|
-
| `doswiftly config domain remove <host>`| Remove a custom domain |
|
|
85
|
-
| `doswiftly config domain list` | List all custom domains |
|
|
86
|
-
|
|
87
|
-
### Commerce SDK
|
|
88
|
-
|
|
89
|
-
| Command | Description |
|
|
90
|
-
| ----------------------- | -------------------------------------- |
|
|
91
|
-
| `doswiftly sdk version` | Check Commerce SDK version and updates |
|
|
92
|
-
|
|
93
|
-
The `@doswiftly/commerce-sdk` package is published on npm with all types included:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# Install SDK
|
|
97
|
-
pnpm add @doswiftly/commerce-sdk
|
|
98
|
-
|
|
99
|
-
# Update to latest
|
|
100
|
-
pnpm update @doswiftly/commerce-sdk@latest
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Deployment
|
|
104
|
-
|
|
105
|
-
| Command | Description |
|
|
106
|
-
| -------------------------------- | ----------------------------- |
|
|
107
|
-
| `doswiftly deploy run` | Deploy storefront (default) |
|
|
108
|
-
| `doswiftly deploy status [id]` | Check deployment status |
|
|
109
|
-
| `doswiftly deploy rollback [id]` | Rollback to previous version |
|
|
110
|
-
| `doswiftly deploy logs <id>` | View deployment logs |
|
|
111
|
-
|
|
112
|
-
Deploy flags:
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
# Deploy to production (default)
|
|
116
|
-
doswiftly deploy run
|
|
117
|
-
|
|
118
|
-
# Deploy as staging
|
|
119
|
-
doswiftly deploy run --type STAGING
|
|
120
|
-
|
|
121
|
-
# Deploy specific branch
|
|
122
|
-
doswiftly deploy run --branch feature/new-checkout
|
|
123
|
-
|
|
124
|
-
# Deploy with message
|
|
125
|
-
doswiftly deploy run --message "Release v2.0"
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Preview Environments
|
|
129
|
-
|
|
130
|
-
| Command | Description |
|
|
131
|
-
| ----------------------------- | ----------------------------------- |
|
|
132
|
-
| `doswiftly preview create` | Create preview deployment (default) |
|
|
133
|
-
| `doswiftly preview list` | List all preview deployments |
|
|
134
|
-
| `doswiftly preview stop <id>` | Stop preview deployment |
|
|
135
|
-
| `doswiftly preview logs <id>` | View preview build logs |
|
|
136
|
-
| `doswiftly preview open <id>` | Open preview URL in browser |
|
|
137
|
-
|
|
138
|
-
Preview flags:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# Create preview from current branch
|
|
142
|
-
doswiftly preview create
|
|
143
|
-
|
|
144
|
-
# Specific branch with custom TTL (default: 168h / 7 days)
|
|
145
|
-
doswiftly preview create --branch feature/checkout --ttl 48
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Debugging & Development
|
|
149
|
-
|
|
150
|
-
| Command | Description |
|
|
151
|
-
| ------------------------------ | ----------------------------------------------- |
|
|
152
|
-
| `doswiftly inspect <endpoint>` | Test API endpoint (like curl for DoSwiftly API) |
|
|
153
|
-
| `doswiftly proxy` | Start local proxy with request/response logging |
|
|
154
|
-
|
|
155
|
-
### Template Updates
|
|
156
|
-
|
|
157
|
-
| Command | Description |
|
|
158
|
-
| ------------------------- | ------------------------------------------- |
|
|
159
|
-
| `doswiftly upgrade` | Check for and apply template updates |
|
|
160
|
-
| `doswiftly migrate check` | Check for template updates |
|
|
161
|
-
| `doswiftly migrate apply` | Apply pending template migrations |
|
|
162
|
-
| `doswiftly migrate diff` | Show differences between local and template |
|
|
163
|
-
|
|
164
|
-
## Global Options
|
|
165
|
-
|
|
166
|
-
```bash
|
|
167
|
-
--verbose # Detailed logging
|
|
168
|
-
--quiet # Errors only
|
|
169
|
-
--version # Show CLI version
|
|
170
|
-
--help # Show help
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
## Usage Examples
|
|
174
|
-
|
|
175
|
-
### Creating a New Storefront
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
# Basic usage
|
|
179
|
-
doswiftly init my-shop
|
|
180
|
-
|
|
181
|
-
# With specific package manager
|
|
182
|
-
doswiftly init my-shop --pm yarn
|
|
183
|
-
|
|
184
|
-
# With UI library selection
|
|
185
|
-
doswiftly init my-shop --ui-library shadcn
|
|
186
|
-
|
|
187
|
-
# Dry run (preview without changes)
|
|
188
|
-
doswiftly init my-shop --dry-run
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Working with Commerce SDK
|
|
192
|
-
|
|
193
|
-
The Commerce SDK provides a **GraphQL-based** storefront API and admin REST API:
|
|
194
|
-
|
|
195
|
-
```typescript
|
|
196
|
-
// Storefront API (GraphQL) — for public-facing storefronts
|
|
197
|
-
import { createStorefrontClient } from "@doswiftly/commerce-sdk";
|
|
198
|
-
|
|
199
|
-
const client = createStorefrontClient({
|
|
200
|
-
storefrontUrl: `${process.env.NEXT_PUBLIC_API_URL}/storefront/graphql`,
|
|
201
|
-
storefrontAccessToken: "public-token",
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// Use auto-generated GraphQL documents
|
|
205
|
-
import { GetProductByHandleDocument } from "@doswiftly/commerce-sdk/graphql";
|
|
206
|
-
|
|
207
|
-
const { data } = await client.query(GetProductByHandleDocument, {
|
|
208
|
-
variables: { handle: "awesome-product" },
|
|
209
|
-
});
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### Testing API Endpoints
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
# GET request
|
|
216
|
-
doswiftly inspect /v1/commerce/products
|
|
217
|
-
|
|
218
|
-
# POST with body
|
|
219
|
-
doswiftly inspect /v1/commerce/cart -X POST -d '{"productId":"123"}'
|
|
220
|
-
|
|
221
|
-
# With custom headers
|
|
222
|
-
doswiftly inspect /v1/commerce/orders -H "Authorization:Bearer token"
|
|
223
|
-
|
|
224
|
-
# Verbose mode (full request/response)
|
|
225
|
-
doswiftly inspect /v1/commerce/products -v
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Local Development with Proxy
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Start proxy on default port 3001
|
|
232
|
-
doswiftly proxy
|
|
233
|
-
|
|
234
|
-
# Custom port
|
|
235
|
-
doswiftly proxy -p 4000
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The proxy logs all requests/responses, useful for debugging API interactions.
|
|
239
|
-
|
|
240
|
-
---
|
|
45
|
+
- [CLI Overview](https://docs.doswiftly.pl/storefront-developer/cli) — installation, configuration, environments, deployment
|
|
46
|
+
- [CLI Commands Reference](https://docs.doswiftly.pl/storefront-developer/cli-commands) — all commands with options and examples
|
|
47
|
+
- [SDK Overview](https://docs.doswiftly.pl/storefront-developer/sdk/overview) — Commerce SDK hooks, stores, and architecture
|
|
241
48
|
|
|
242
49
|
## Requirements
|
|
243
50
|
|
|
244
51
|
- Node.js >= 18
|
|
245
|
-
- Package manager: pnpm, npm, yarn, or bun
|
|
52
|
+
- Package manager: pnpm (recommended), npm, yarn, or bun
|
|
246
53
|
- DoSwiftly Commerce account
|
|
247
54
|
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## Project Configuration
|
|
251
|
-
|
|
252
|
-
### doswiftly.config.ts
|
|
253
|
-
|
|
254
|
-
```typescript
|
|
255
|
-
import { defineConfig } from "@doswiftly/cli";
|
|
256
|
-
|
|
257
|
-
export default defineConfig({
|
|
258
|
-
shop: {
|
|
259
|
-
slug: "my-shop",
|
|
260
|
-
},
|
|
261
|
-
project: {
|
|
262
|
-
name: "My Storefront",
|
|
263
|
-
},
|
|
264
|
-
api: {
|
|
265
|
-
url: "https://api.doswiftly.pl",
|
|
266
|
-
},
|
|
267
|
-
dev: {
|
|
268
|
-
port: 3000,
|
|
269
|
-
openBrowser: true,
|
|
270
|
-
},
|
|
271
|
-
});
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Environment Variables (.env.local)
|
|
275
|
-
|
|
276
|
-
```env
|
|
277
|
-
# Required (auto-generated by `doswiftly env generate`)
|
|
278
|
-
NEXT_PUBLIC_API_URL=https://api.doswiftly.pl
|
|
279
|
-
NEXT_PUBLIC_SHOP_SLUG=my-shop
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## How It Works
|
|
285
|
-
|
|
286
|
-
1. **DoSwiftly Commerce API** - Backend SaaS platform hosting your product catalog, orders, customers, etc.
|
|
287
|
-
2. **@doswiftly/commerce-sdk** - TypeScript SDK with GraphQL storefront API and full type safety
|
|
288
|
-
3. **Your Storefront** - Next.js app you build, using the Commerce SDK to fetch data
|
|
289
|
-
4. **This CLI** - Tools to scaffold, develop, and deploy your storefront
|
|
290
|
-
|
|
291
|
-
```
|
|
292
|
-
┌─────────────────────┐
|
|
293
|
-
│ Your Storefront │
|
|
294
|
-
│ (Next.js + SDK) │ ← You build this
|
|
295
|
-
└──────────┬──────────┘
|
|
296
|
-
│ uses @doswiftly/commerce-sdk (GraphQL)
|
|
297
|
-
↓
|
|
298
|
-
┌─────────────────────┐
|
|
299
|
-
│ DoSwiftly Commerce │
|
|
300
|
-
│ API │ ← Managed by DoSwiftly
|
|
301
|
-
└─────────────────────┘
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## Troubleshooting
|
|
307
|
-
|
|
308
|
-
### "No active environment profile"
|
|
309
|
-
|
|
310
|
-
You need to configure an environment first:
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
doswiftly env add
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
### "Not in a DoSwiftly project directory"
|
|
317
|
-
|
|
318
|
-
Make sure you're in a directory with `doswiftly.config.ts`:
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
# Create new project first
|
|
322
|
-
doswiftly init my-shop
|
|
323
|
-
cd my-shop
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### "API error: 401 Unauthorized"
|
|
327
|
-
|
|
328
|
-
Check your credentials:
|
|
329
|
-
|
|
330
|
-
```bash
|
|
331
|
-
doswiftly auth login # Re-authenticate
|
|
332
|
-
doswiftly verify # Test connection
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Build or type errors
|
|
336
|
-
|
|
337
|
-
Run diagnostics:
|
|
338
|
-
|
|
339
|
-
```bash
|
|
340
|
-
doswiftly doctor # Full health check
|
|
341
|
-
doswiftly check # Linting + type checking
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### Commerce SDK version mismatch
|
|
345
|
-
|
|
346
|
-
Update to latest SDK:
|
|
347
|
-
|
|
348
|
-
```bash
|
|
349
|
-
doswiftly sdk version # Check version
|
|
350
|
-
pnpm update @doswiftly/commerce-sdk@latest
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
55
|
## License
|
|
356
56
|
|
|
357
57
|
MIT
|
package/dist/commands/check.js
CHANGED
|
@@ -127,7 +127,7 @@ async function checkDependencies() {
|
|
|
127
127
|
name: 'Dependencies',
|
|
128
128
|
status: 'warn',
|
|
129
129
|
message: 'No @doswiftly packages found',
|
|
130
|
-
details: 'Run "pnpm add @doswiftly/
|
|
130
|
+
details: 'Run "pnpm add @doswiftly/storefront-sdk"',
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
// Check if node_modules exists
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAS9C;;GAEG;AACH,SAAS,UAAU,CAAC,OAAe,EAAE,IAAc;IACjD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE;YAChC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;QAEH,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,I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M,CAAC;CACnB;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/commands/deploy.ts"],"names":[],"mappings":"AAyEA,KAAK,cAAc,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAG3D,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA+cD;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CAAC,OAAO,GAAE,aAAkB,iBA2Y9D;AAGD;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,kBA4B1C;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,YAAY,CAAC,EAAE,MAAM,iBAkD9D;AAwDD;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,YAAY,CAAC,EAAE,MAAM,iBAuDhE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,MAAM,iBA4E3D"}
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import ora from 'ora';
|
|
3
3
|
import { existsSync, readFileSync, writeFileSync, copyFileSync, readdirSync, statSync, rmSync } from 'fs';
|
|
4
|
-
import { join, relative } from 'path';
|
|
4
|
+
import { join, relative, dirname } from 'path';
|
|
5
5
|
import { createHash, randomUUID } from 'crypto';
|
|
6
6
|
import { createGzip } from 'zlib';
|
|
7
7
|
import { execSync } from 'child_process';
|
|
@@ -119,8 +119,8 @@ function checkDeployReadiness(framework) {
|
|
|
119
119
|
issues.push('No build script in package.json');
|
|
120
120
|
}
|
|
121
121
|
const deps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
122
|
-
if (!('@doswiftly/
|
|
123
|
-
issues.push('@doswiftly/
|
|
122
|
+
if (!('@doswiftly/storefront-sdk' in deps) && !('@doswiftly/storefront-operations' in deps)) {
|
|
123
|
+
issues.push('@doswiftly/storefront-sdk or @doswiftly/storefront-operations not installed');
|
|
124
124
|
}
|
|
125
125
|
const envCheck = validateEnvironment(framework);
|
|
126
126
|
if (!envCheck.valid) {
|
|
@@ -224,8 +224,18 @@ function generateStaticAssetsManifest(dir, excludePatterns = []) {
|
|
|
224
224
|
return;
|
|
225
225
|
const entries = readdirSync(currentDir);
|
|
226
226
|
for (const entry of entries) {
|
|
227
|
+
// Skip node_modules — bundled into worker.js, not needed in deployment
|
|
228
|
+
if (entry === 'node_modules')
|
|
229
|
+
continue;
|
|
227
230
|
const fullPath = join(currentDir, entry);
|
|
228
|
-
|
|
231
|
+
let stat;
|
|
232
|
+
try {
|
|
233
|
+
stat = statSync(fullPath);
|
|
234
|
+
}
|
|
235
|
+
catch {
|
|
236
|
+
// Broken symlink or inaccessible file — skip silently
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
229
239
|
if (stat.isDirectory()) {
|
|
230
240
|
walk(fullPath);
|
|
231
241
|
}
|
|
@@ -327,8 +337,18 @@ function generateManifest(dir) {
|
|
|
327
337
|
function walk(currentDir) {
|
|
328
338
|
const entries = readdirSync(currentDir);
|
|
329
339
|
for (const entry of entries) {
|
|
340
|
+
// Skip node_modules — bundled into worker.js, not needed in deployment
|
|
341
|
+
if (entry === 'node_modules')
|
|
342
|
+
continue;
|
|
330
343
|
const fullPath = join(currentDir, entry);
|
|
331
|
-
|
|
344
|
+
let stat;
|
|
345
|
+
try {
|
|
346
|
+
stat = statSync(fullPath);
|
|
347
|
+
}
|
|
348
|
+
catch {
|
|
349
|
+
// Broken symlink or inaccessible file — skip silently
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
332
352
|
if (stat.isDirectory()) {
|
|
333
353
|
walk(fullPath);
|
|
334
354
|
}
|
|
@@ -355,6 +375,11 @@ async function createTarGzFromDirectory(dir) {
|
|
|
355
375
|
gzip: false,
|
|
356
376
|
cwd: process.cwd(),
|
|
357
377
|
portable: true,
|
|
378
|
+
filter: (path) => {
|
|
379
|
+
// Exclude node_modules — bundled into worker.js, not needed in deployment
|
|
380
|
+
const segments = path.split(/[/\\]/);
|
|
381
|
+
return !segments.includes('node_modules');
|
|
382
|
+
},
|
|
358
383
|
}, [dir]);
|
|
359
384
|
return new Promise((resolve, reject) => {
|
|
360
385
|
tarStream.pipe(gzip);
|
|
@@ -500,6 +525,10 @@ export async function deployCommand(options = {}) {
|
|
|
500
525
|
`directory = ".open-next/assets"`,
|
|
501
526
|
`binding = "ASSETS"`,
|
|
502
527
|
``,
|
|
528
|
+
`# Cloudflare Images binding for Next.js /_next/image optimization`,
|
|
529
|
+
`[images]`,
|
|
530
|
+
`binding = "IMAGES"`,
|
|
531
|
+
``,
|
|
503
532
|
].join('\n');
|
|
504
533
|
writeFileSync('wrangler.toml', wranglerContent, 'utf-8');
|
|
505
534
|
console.log(chalk.cyan(' Generated wrangler.toml for build'));
|
|
@@ -578,23 +607,17 @@ export async function deployCommand(options = {}) {
|
|
|
578
607
|
timeout: 120_000,
|
|
579
608
|
env: { ...process.env, FORCE_COLOR: '1' },
|
|
580
609
|
});
|
|
581
|
-
// Copy bundled worker.js
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
610
|
+
// Copy ALL bundled files back to build dir (worker.js + companion .wasm/.js modules)
|
|
611
|
+
const bundledFiles = readdirSync(bundledDir);
|
|
612
|
+
const workerFile = bundledFiles.find(f => f === 'worker.js') || bundledFiles.find(f => f.endsWith('.js'));
|
|
613
|
+
if (!workerFile) {
|
|
614
|
+
throw new Error('No bundled worker output found in wrangler --outdir');
|
|
586
615
|
}
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
if (jsFiles.length > 0) {
|
|
591
|
-
copyFileSync(join(bundledDir, jsFiles[0]), workerJsPath);
|
|
592
|
-
console.log(chalk.green(` Worker re-bundled successfully (${jsFiles[0]})!\n`));
|
|
593
|
-
}
|
|
594
|
-
else {
|
|
595
|
-
throw new Error('No bundled worker output found in wrangler --outdir');
|
|
596
|
-
}
|
|
616
|
+
const workerDestDir = dirname(workerJsPath);
|
|
617
|
+
for (const file of bundledFiles) {
|
|
618
|
+
copyFileSync(join(bundledDir, file), join(workerDestDir, file));
|
|
597
619
|
}
|
|
620
|
+
console.log(chalk.green(` Worker re-bundled successfully! (${bundledFiles.length} files: ${bundledFiles.join(', ')})\n`));
|
|
598
621
|
}
|
|
599
622
|
catch (bundleError) {
|
|
600
623
|
console.log(chalk.red(`\n Wrangler re-bundle failed: ${bundleError.message}`));
|