@pradip1995/create-storefront-app 0.4.3 → 0.4.4

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/lib/versions.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** Published package semver ranges — bump when releasing framework/components. */
2
2
  export const COMMERCE_CORE_VERSION = "^4.0.2"
3
3
  export const FRAMEWORK_VERSION = "^0.2.1"
4
- export const FRAMEWORK_COMPILER_VERSION = "^0.3.3"
4
+ export const FRAMEWORK_COMPILER_VERSION = "^0.4.0"
5
5
  export const COMPONENTS_VERSION = ">=0.2.0 <0.4.0"
6
6
 
7
7
  export const FRAMEWORK_PACKAGES = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/create-storefront-app",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Scaffold a segment-based Medusa storefront using @pradip1995/framework packages",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -6,7 +6,7 @@ Medusa source is **generated** into `.generated-backend/` — same pattern as `s
6
6
 
7
7
  | File | Edit when |
8
8
  |------|-----------|
9
- | `plugins.config.json` | Add/remove plugins or change npm versions |
9
+ | `plugins.config.json` | Add/remove plugins, change versions, or override plugin options |
10
10
  | `backend.config.json` | Change preset (`full`/`minimal`) or default region |
11
11
  | `.env` | Database URL, secrets, optional integrations |
12
12
 
@@ -22,6 +22,69 @@ npm run backend:build # regenerate .generated-backend/ only
22
22
 
23
23
  **Do not edit** `.generated-backend/` — changes are overwritten on the next build.
24
24
 
25
+ ## Plugin configuration
26
+
27
+ There are three layers:
28
+
29
+ ### 1. Secrets and integrations → `backend/.env`
30
+
31
+ Credentials and environment-specific values are read at runtime via `process.env`:
32
+
33
+ | Variable | Used by |
34
+ |----------|---------|
35
+ | `JWT_SECRET`, `COOKIE_SECRET` | Auth, invoice, order-management |
36
+ | `SMTP_*` | SMTP notification module (when `@tsc_tech/medusa-plugin-smtp` is enabled) |
37
+ | `CASHFREE_*` | Cashfree payment (when credentials are set) |
38
+ | `SHIPROCKET_*` | Shiprocket fulfillment (when email/password are set) |
39
+ | `AWS_*` | S3 file storage (falls back to local files when unset) |
40
+ | `GOOGLE_CLIENT_*` | Google OAuth on customer auth |
41
+
42
+ After changing `.env`, restart the backend — no rebuild needed.
43
+
44
+ ### 2. Business / plugin options → `plugins.config.json` → `pluginOptions`
45
+
46
+ Override framework defaults per plugin. Values are merged into generated `medusa-config.ts` on `npm run backend:build`.
47
+
48
+ ```json
49
+ {
50
+ "plugins": {
51
+ "stock-monitoring": "^0.0.5",
52
+ "medusa-review-rating": "^0.0.38"
53
+ },
54
+ "pluginOptions": {
55
+ "stock-monitoring": {
56
+ "low_stock_threshold": 5,
57
+ "slow_moving_days_threshold": 60
58
+ },
59
+ "medusa-review-rating": {
60
+ "autoApprove": false,
61
+ "requireVerifiedPurchase": true
62
+ },
63
+ "customer-registration": {
64
+ "registration": { "require_verification": false }
65
+ }
66
+ }
67
+ }
68
+ ```
69
+
70
+ To reference an env var from generated config, use a string (same as framework defaults):
71
+
72
+ ```json
73
+ "medusa-shiprocket-fulfillment-sbl": {
74
+ "shiprocket": {
75
+ "pickupLocation": "process.env.SHIPROCKET_PICKUP_LOCATION || \"Warehouse A\""
76
+ }
77
+ }
78
+ ```
79
+
80
+ Run `npm run backend:build` (or `npm run dev`) after editing `pluginOptions`.
81
+
82
+ ### 3. Framework defaults
83
+
84
+ Sensible defaults for every supported plugin live in `@pradip1995/framework-compiler` (`plugin-definitions.cjs`). You only need `pluginOptions` when you want to change something from the default.
85
+
86
+ Unknown plugins must be added to the framework before they can be listed in `plugins.config.json`.
87
+
25
88
  ## Homepage admin schema
26
89
 
27
90
  Synced from storefront segments — see `storefront/pages.config.json` and run `npm run storefront:build` in the storefront folder.