saafe-redirection-flow 2.0.0

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.
Files changed (225) hide show
  1. package/.github/workflows/build-and-deploy.yml +41 -0
  2. package/.gitlab-ci.yml +108 -0
  3. package/.releaserc.json +18 -0
  4. package/.storybook/main.ts +28 -0
  5. package/.storybook/preview.ts +16 -0
  6. package/.storybook/vitest.setup.ts +9 -0
  7. package/.vite/deps/@radix-ui_react-avatar.js +230 -0
  8. package/.vite/deps/@radix-ui_react-avatar.js.map +7 -0
  9. package/.vite/deps/@radix-ui_react-slot.js +12 -0
  10. package/.vite/deps/@radix-ui_react-slot.js.map +7 -0
  11. package/.vite/deps/_metadata.json +79 -0
  12. package/.vite/deps/chunk-5VGQBUCU.js +597 -0
  13. package/.vite/deps/chunk-5VGQBUCU.js.map +7 -0
  14. package/.vite/deps/chunk-DC5AMYBS.js +38 -0
  15. package/.vite/deps/chunk-DC5AMYBS.js.map +7 -0
  16. package/.vite/deps/chunk-HUIEPYH7.js +11265 -0
  17. package/.vite/deps/chunk-HUIEPYH7.js.map +7 -0
  18. package/.vite/deps/chunk-TKHB4QMX.js +281 -0
  19. package/.vite/deps/chunk-TKHB4QMX.js.map +7 -0
  20. package/.vite/deps/chunk-YLDSBLSF.js +1139 -0
  21. package/.vite/deps/chunk-YLDSBLSF.js.map +7 -0
  22. package/.vite/deps/class-variance-authority.js +63 -0
  23. package/.vite/deps/class-variance-authority.js.map +7 -0
  24. package/.vite/deps/lucide-react.js +36984 -0
  25. package/.vite/deps/lucide-react.js.map +7 -0
  26. package/.vite/deps/package.json +3 -0
  27. package/.vite/deps/react-dom_client.js +17917 -0
  28. package/.vite/deps/react-dom_client.js.map +7 -0
  29. package/.vite/deps/react-router-dom.js +452 -0
  30. package/.vite/deps/react-router-dom.js.map +7 -0
  31. package/.vite/deps/react-router.js +234 -0
  32. package/.vite/deps/react-router.js.map +7 -0
  33. package/.vite/deps/react.js +5 -0
  34. package/.vite/deps/react.js.map +7 -0
  35. package/.vite/deps/react_jsx-dev-runtime.js +470 -0
  36. package/.vite/deps/react_jsx-dev-runtime.js.map +7 -0
  37. package/CHANGELOG.md +420 -0
  38. package/LICENSE +21 -0
  39. package/README.md +129 -0
  40. package/RELEASE_CHEATSHEET.md +93 -0
  41. package/RELEASE_NOTES.md +120 -0
  42. package/components.json +21 -0
  43. package/docs/DEPLOYMENT_WORKFLOW.md +262 -0
  44. package/docs/RELEASE_GUIDE.md +591 -0
  45. package/docs/architecture.md +432 -0
  46. package/docs/components.md +199 -0
  47. package/docs/index.md +69 -0
  48. package/docs/local-release-workflow.md +234 -0
  49. package/docs/routes.md +118 -0
  50. package/docs/sdk-integration.md +325 -0
  51. package/docs/semantic-release.md +124 -0
  52. package/docs/user-flow.md +206 -0
  53. package/eslint.config.js +28 -0
  54. package/index.html +19 -0
  55. package/install.sh +198 -0
  56. package/package.json +115 -0
  57. package/public/images/bank-logo.png +0 -0
  58. package/public/saafe-icon.svg +9 -0
  59. package/src/App.tsx +171 -0
  60. package/src/__tests__/url-parameters.test.ts +82 -0
  61. package/src/assets/brand/applestore.svg +13 -0
  62. package/src/assets/brand/playstore.svg +23 -0
  63. package/src/assets/brand/saafe-color-white-logo.svg +14 -0
  64. package/src/assets/brand/saafe-icon.svg +9 -0
  65. package/src/assets/brand/saafe-logo.svg +18 -0
  66. package/src/assets/icons/check-icon-dark.svg +27 -0
  67. package/src/assets/icons/check-icon.svg +23 -0
  68. package/src/components/ErrorBoundary.tsx +132 -0
  69. package/src/components/alert/alert.tsx +27 -0
  70. package/src/components/auth/AuthGuard.tsx +76 -0
  71. package/src/components/cards/BankCard.stories.tsx +69 -0
  72. package/src/components/cards/BankCard.tsx +227 -0
  73. package/src/components/cards/OuterCard.tsx +109 -0
  74. package/src/components/cards/WrapperCard.tsx +64 -0
  75. package/src/components/documents/PrivacyContent.tsx +1 -0
  76. package/src/components/dummyFooter.tsx +29 -0
  77. package/src/components/icons/github.tsx +12 -0
  78. package/src/components/language/LanguageSwitcher.tsx +44 -0
  79. package/src/components/layouts/FrostedLayout.stories.tsx +42 -0
  80. package/src/components/layouts/FrostedLayout.tsx +333 -0
  81. package/src/components/layouts/MobileLayout.tsx +403 -0
  82. package/src/components/mobile-background.tsx +136 -0
  83. package/src/components/mobileAppDownload.tsx +30 -0
  84. package/src/components/modal/ModalComp.tsx +27 -0
  85. package/src/components/mode-toggle.tsx +36 -0
  86. package/src/components/page-header.tsx +50 -0
  87. package/src/components/session/SessionTimeoutScreen.tsx +134 -0
  88. package/src/components/session/SessionTimer.tsx +173 -0
  89. package/src/components/step-navigation.tsx +87 -0
  90. package/src/components/title/AppBar.stories.tsx +50 -0
  91. package/src/components/title/AppBar.tsx +150 -0
  92. package/src/components/title/SectionTitle.tsx +31 -0
  93. package/src/components/ui/AnimatedButton.module.css +13 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/animatedButton.tsx +111 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +36 -0
  98. package/src/components/ui/bottom-sheet.tsx +122 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +86 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/checkbox.stories.tsx +49 -0
  103. package/src/components/ui/checkbox.tsx +67 -0
  104. package/src/components/ui/collapsible.tsx +45 -0
  105. package/src/components/ui/dialog.tsx +134 -0
  106. package/src/components/ui/document-link.tsx +26 -0
  107. package/src/components/ui/dot-stepper.tsx +57 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/frosted-panel.stories.tsx +86 -0
  111. package/src/components/ui/frosted-panel.tsx +276 -0
  112. package/src/components/ui/input.tsx +39 -0
  113. package/src/components/ui/label.stories.tsx +67 -0
  114. package/src/components/ui/label.tsx +23 -0
  115. package/src/components/ui/mobile-footer.tsx +54 -0
  116. package/src/components/ui/modal.tsx +90 -0
  117. package/src/components/ui/otp-input.stories.tsx +62 -0
  118. package/src/components/ui/otp-input.tsx +221 -0
  119. package/src/components/ui/platform-specific-behavior.tsx +28 -0
  120. package/src/components/ui/popover.tsx +46 -0
  121. package/src/components/ui/progress.tsx +103 -0
  122. package/src/components/ui/radio-group.tsx +45 -0
  123. package/src/components/ui/scroll-area.tsx +56 -0
  124. package/src/components/ui/sdk-params-docs.tsx +53 -0
  125. package/src/components/ui/select.tsx +159 -0
  126. package/src/components/ui/separator.tsx +28 -0
  127. package/src/components/ui/sheet.tsx +137 -0
  128. package/src/components/ui/sidebar.tsx +724 -0
  129. package/src/components/ui/skeleton.stories.tsx +50 -0
  130. package/src/components/ui/skeleton.tsx +15 -0
  131. package/src/components/ui/sonner.tsx +23 -0
  132. package/src/components/ui/step.stories.tsx +132 -0
  133. package/src/components/ui/step.tsx +234 -0
  134. package/src/components/ui/stepper-progress.tsx +136 -0
  135. package/src/components/ui/stepper.tsx +259 -0
  136. package/src/components/ui/tabs.tsx +55 -0
  137. package/src/components/ui/tooltip.tsx +61 -0
  138. package/src/components/ui/url-decode-loader.tsx +36 -0
  139. package/src/components/ui/version-display.tsx +104 -0
  140. package/src/components/ui/web-footer.tsx +36 -0
  141. package/src/config/environments.ts +99 -0
  142. package/src/config/urls.ts +53 -0
  143. package/src/const/fiTypeCategoryMap.ts +19 -0
  144. package/src/contexts/LanguageContext.tsx +41 -0
  145. package/src/contexts/RTLContext.tsx +42 -0
  146. package/src/contexts/ThemeContext.tsx +93 -0
  147. package/src/hooks/use-account-discovery.ts +205 -0
  148. package/src/hooks/use-auth-query.ts +141 -0
  149. package/src/hooks/use-fip-query.ts +72 -0
  150. package/src/hooks/use-media-query.ts +32 -0
  151. package/src/hooks/use-mobile.ts +24 -0
  152. package/src/hooks/use-page-title.tsx +48 -0
  153. package/src/hooks/use-platform.ts +52 -0
  154. package/src/hooks/use-trusted-count.ts +21 -0
  155. package/src/hooks/use-url-decode.ts +90 -0
  156. package/src/hooks/useStep.ts +170 -0
  157. package/src/index.css +154 -0
  158. package/src/interfaces/app.interfaces.ts +39 -0
  159. package/src/interfaces/services.interfaces.ts +65 -0
  160. package/src/lib/i18n.ts +68 -0
  161. package/src/lib/utils.ts +6 -0
  162. package/src/locales/en/common.json +167 -0
  163. package/src/locales/hi/common.json +137 -0
  164. package/src/locales/kn/common.json +137 -0
  165. package/src/locales/ml/common.json +137 -0
  166. package/src/locales/ta/common.json +137 -0
  167. package/src/locales/te/common.json +137 -0
  168. package/src/locales/ur/common.json +138 -0
  169. package/src/main.tsx +46 -0
  170. package/src/pages/Login.tsx +363 -0
  171. package/src/pages/accounts/AccountsToProceed.tsx +396 -0
  172. package/src/pages/accounts/Discover.tsx +76 -0
  173. package/src/pages/accounts/DiscoverAccount.tsx +751 -0
  174. package/src/pages/accounts/LinkSelectedAccounts.tsx +638 -0
  175. package/src/pages/accounts/OldUser.tsx +329 -0
  176. package/src/pages/accounts/link-accounts.tsx +913 -0
  177. package/src/pages/consent/ReviewConsent.tsx +836 -0
  178. package/src/pages/consent/rejected.tsx +253 -0
  179. package/src/pages/consent/success.tsx +220 -0
  180. package/src/providers/query-provider.tsx +24 -0
  181. package/src/providers/toast-provider.tsx +26 -0
  182. package/src/services/api/account.service.ts +296 -0
  183. package/src/services/api/auth.service.ts +206 -0
  184. package/src/services/api/axios.ts +138 -0
  185. package/src/services/api/consent.service.ts +142 -0
  186. package/src/services/api/decode.service.ts +53 -0
  187. package/src/services/api/feedback.service.ts +34 -0
  188. package/src/services/api/fip.service.ts +187 -0
  189. package/src/services/api/index.ts +9 -0
  190. package/src/services/api/public.service.ts +18 -0
  191. package/src/services/api.ts +2 -0
  192. package/src/services/postMessage.service.ts +179 -0
  193. package/src/store/NavigationBlockContext.tsx +34 -0
  194. package/src/store/auth.store.ts +79 -0
  195. package/src/store/fip.store.ts +396 -0
  196. package/src/store/mandatoryConsent.store.ts +24 -0
  197. package/src/store/redirect.store.ts +73 -0
  198. package/src/store/step.store.ts +124 -0
  199. package/src/stories/Button.stories.ts +53 -0
  200. package/src/stories/Button.tsx +37 -0
  201. package/src/stories/Configure.mdx +364 -0
  202. package/src/stories/Header.stories.ts +33 -0
  203. package/src/stories/Header.tsx +56 -0
  204. package/src/stories/Page.stories.ts +32 -0
  205. package/src/stories/Page.tsx +73 -0
  206. package/src/stories/button.css +30 -0
  207. package/src/stories/header.css +32 -0
  208. package/src/stories/page.css +68 -0
  209. package/src/styles/rtl-utils.css +90 -0
  210. package/src/styles/rtl.css +105 -0
  211. package/src/utils/api-error.ts +26 -0
  212. package/src/utils/cn.ts +10 -0
  213. package/src/utils/error-callback.ts +116 -0
  214. package/src/utils/formatAccountNumber.ts +9 -0
  215. package/src/utils/handleIdentifiers.ts +90 -0
  216. package/src/utils/posthog.ts +67 -0
  217. package/src/utils/toast-helpers.ts +61 -0
  218. package/src/vite-env.d.ts +1 -0
  219. package/stage-aa-2506251021.zip +0 -0
  220. package/tsconfig.app.json +33 -0
  221. package/tsconfig.json +13 -0
  222. package/tsconfig.node.json +24 -0
  223. package/vite.config.ts +45 -0
  224. package/vitest.shims.d.ts +1 -0
  225. package/vitest.workspace.ts +46 -0
@@ -0,0 +1,591 @@
1
+ # 🚀 Saafe Redirection Flow - Complete Release Guide
2
+
3
+ > **Version**: 1.0.0-stage.2
4
+ > **Last Updated**: June 23, 2025
5
+ > **Project**: Saafe Redirection Flow
6
+
7
+ ## 📋 Table of Contents
8
+
9
+ 1. [Overview](#overview)
10
+ 2. [Quick Start](#quick-start)
11
+ 3. [Environment Configuration](#environment-configuration)
12
+ 4. [Release Process](#release-process)
13
+ 5. [Versioning Strategy](#versioning-strategy)
14
+ 6. [Branch Strategy](#branch-strategy)
15
+ 7. [Commit Conventions](#commit-conventions)
16
+ 8. [Commands Reference](#commands-reference)
17
+ 9. [Troubleshooting](#troubleshooting)
18
+ 10. [Examples](#examples)
19
+
20
+ ---
21
+
22
+ ## 🎯 Overview
23
+
24
+ This project uses **Semantic Release** for automated version management, changelog generation, and deployment across multiple environments. The system automatically:
25
+
26
+ - ✅ Analyzes commit messages using conventional commits
27
+ - ✅ Determines semantic version bumps (patch/minor/major)
28
+ - ✅ Generates changelogs automatically
29
+ - ✅ Creates git tags for releases
30
+ - ✅ Updates package.json versions
31
+ - ✅ Manages environment-specific builds
32
+ - ✅ Handles multi-environment deployment strategy
33
+
34
+ ### 🏗️ Architecture
35
+
36
+ ```
37
+ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
38
+ │ Sandbox │───▶│ Staging │───▶│ Production │
39
+ │ (sandbox) │ │ (stage) │ │ (prod) │
40
+ │ v1.0.0-sandbox.1│ │ v1.0.0-stage.1 │ │ v1.0.1 │
41
+ └─────────────────┘ └─────────────────┘ └─────────────────┘
42
+ ```
43
+
44
+ ---
45
+
46
+ ## ⚡ Quick Start
47
+
48
+ ### 🎬 Creating Your First Release
49
+
50
+ ```bash
51
+ # 1. Make sure you're on the right branch
52
+ git checkout stage # or sandbox, main
53
+
54
+ # 2. Create a release
55
+ npm run release:real
56
+
57
+ # 3. Build for deployment
58
+ npm run build:stage # or build:production, build:sandbox
59
+ ```
60
+
61
+ ### 🔄 Daily Workflow
62
+
63
+ ```bash
64
+ # 1. Make changes using conventional commits
65
+ git add .
66
+ git commit -m "feat: add new authentication flow"
67
+
68
+ # 2. Create release
69
+ npm run release:real
70
+
71
+ # 3. Deploy
72
+ npm run build:stage
73
+ ```
74
+
75
+ ---
76
+
77
+ ## 🌍 Environment Configuration
78
+
79
+ ### 📁 Environment Files
80
+
81
+ | File | Environment | API URL | Debug | Analytics |
82
+ |------|-------------|---------|-------|-----------|
83
+ | `.env.production` | Production | `https://api.saafe.in` | ❌ | ✅ |
84
+ | `.env.stage` | Stage | `https://stage-api.saafe.in` | ✅ | ✅ |
85
+ | `.env.sandbox` | Sandbox | `https://sandbox-api.saafe.in` | ✅ | ❌ |
86
+ | `.env.development` | Development | `http://localhost:3000` | ✅ | ❌ |
87
+
88
+ ### 🔧 Environment Variables
89
+
90
+ Each environment file contains:
91
+
92
+ ```bash
93
+ # Environment identifier
94
+ VITE_ENVIRONMENT=production
95
+
96
+ # API Configuration
97
+ VITE_API_BASE_URL=https://api.saafe.in
98
+
99
+ # Application Settings
100
+ VITE_DEBUG=false
101
+ VITE_ANALYTICS_ENABLED=true
102
+
103
+ # Build Configuration
104
+ VITE_BASE_URL=/
105
+
106
+ # Feature Flags
107
+ VITE_FEATURE_DEBUG_PANEL=false
108
+ VITE_FEATURE_TEST_MODE=false
109
+ VITE_FEATURE_MOCK_DATA=false
110
+
111
+ # Session Configuration
112
+ VITE_SESSION_TIMEOUT=900000
113
+
114
+ # PostHog Configuration
115
+ VITE_PUBLIC_POSTHOG_HOST=
116
+ VITE_PUBLIC_POSTHOG_KEY=
117
+ ```
118
+
119
+ ### 🎛️ Environment Detection
120
+
121
+ The application automatically detects the environment through:
122
+
123
+ 1. **VITE_ENVIRONMENT** variable
124
+ 2. **Vite MODE** setting
125
+ 3. **Browser hostname** pattern matching
126
+ 4. **Defaults to production** if detection fails
127
+
128
+ ---
129
+
130
+ ## 🔄 Release Process
131
+
132
+ ### 🌟 Standard Release Flow
133
+
134
+ #### **1. Sandbox Release**
135
+ ```bash
136
+ git checkout sandbox
137
+ # Make your changes with conventional commits
138
+ git add .
139
+ git commit -m "feat: add user authentication"
140
+ npm run release:real
141
+ npm run build:sandbox
142
+ # Creates: v1.0.0-sandbox.X
143
+ ```
144
+
145
+ #### **2. Stage Release**
146
+ ```bash
147
+ git checkout stage
148
+ git merge sandbox
149
+ npm run release:real
150
+ npm run build:stage
151
+ # Creates: v1.0.0-stage.X
152
+ ```
153
+
154
+ #### **3. Production Release**
155
+ ```bash
156
+ git checkout prod
157
+ git merge stage
158
+ npm run release:real
159
+ npm run build:production
160
+ # Creates: v1.0.1 (production version bump!)
161
+ ```
162
+
163
+ ### 🎯 Release Types
164
+
165
+ | Release Type | Triggers | Version Change | Example |
166
+ |-------------|----------|----------------|---------|
167
+ | **Patch** | `fix:` commits | `1.0.0` → `1.0.1` | Bug fixes |
168
+ | **Minor** | `feat:` commits | `1.0.0` → `1.1.0` | New features |
169
+ | **Major** | `BREAKING CHANGE:` | `1.0.0` → `2.0.0` | Breaking changes |
170
+
171
+ ---
172
+
173
+ ## 📊 Versioning Strategy
174
+
175
+ ### 🏷️ Version Format
176
+
177
+ #### **Production Releases (main branch)**
178
+ ```
179
+ v1.0.0 # First release
180
+ v1.0.1 # Patch release
181
+ v1.1.0 # Minor release
182
+ v2.0.0 # Major release
183
+ ```
184
+
185
+ #### **Prerelease Branches**
186
+ ```
187
+ v1.0.0-stage.1 # First stage release
188
+ v1.0.0-stage.2 # Second stage release
189
+ v1.0.0-sandbox.1 # First sandbox release
190
+ ```
191
+
192
+ ### 🔄 Version Progression
193
+
194
+ ```
195
+ sandbox: 1.0.0-sandbox.1 → 1.0.0-sandbox.2
196
+
197
+ stage: 1.0.0-stage.1 → 1.0.0-stage.2
198
+
199
+ prod: 1.0.1 ← Production version finally bumps!
200
+
201
+ stage: 1.0.1-stage.1 ← Based on new production version
202
+ ```
203
+
204
+ ### 📈 Current Release Status
205
+
206
+ ```
207
+ ✅ sandbox: v1.0.0-sandbox.1
208
+ ✅ stage: v1.0.0-stage.2
209
+ ⏳ prod: Ready for v1.0.1
210
+ ```
211
+
212
+ ---
213
+
214
+ ## 🌳 Branch Strategy
215
+
216
+ ### 📋 Branch Configuration
217
+
218
+ ```json
219
+ {
220
+ "branches": [
221
+ "prod", // Production releases
222
+ {
223
+ "name": "stage", // Stage prereleases
224
+ "prerelease": "stage"
225
+ },
226
+ {
227
+ "name": "sandbox", // Sandbox prereleases
228
+ "prerelease": "sandbox"
229
+ }
230
+ ]
231
+ }
232
+ ```
233
+
234
+ ### 🎯 Branch Purposes
235
+
236
+ | Branch | Purpose | Release Type | Deploy Target |
237
+ |--------|---------|--------------|---------------|
238
+ | **prod** | Production-ready code | Production | Production servers |
239
+ | **stage** | Release candidate testing | Prerelease | Staging environment |
240
+ | **sandbox** | Integration testing | Prerelease | Sandbox environment |
241
+
242
+ ### 🔄 Merge Strategy
243
+
244
+ ```
245
+ sandbox → stage → prod
246
+ ↓ ↓ ↓
247
+ Integration QA Production
248
+ ```
249
+
250
+ ---
251
+
252
+ ## 📝 Commit Conventions
253
+
254
+ ### 🎯 Commit Message Format
255
+
256
+ ```
257
+ <type>[optional scope]: <description>
258
+
259
+ [optional body]
260
+
261
+ [optional footer(s)]
262
+ ```
263
+
264
+ ### 📋 Commit Types
265
+
266
+ | Type | Description | Version Bump | Example |
267
+ |------|-------------|--------------|---------|
268
+ | `feat` | New feature | Minor | `feat: add user login` |
269
+ | `fix` | Bug fix | Patch | `fix: resolve login issue` |
270
+ | `docs` | Documentation | None | `docs: update README` |
271
+ | `style` | Code style changes | None | `style: format code` |
272
+ | `refactor` | Code refactoring | None | `refactor: simplify auth logic` |
273
+ | `test` | Adding tests | None | `test: add login tests` |
274
+ | `chore` | Maintenance tasks | None | `chore: update dependencies` |
275
+
276
+ ### 🚨 Breaking Changes
277
+
278
+ ```bash
279
+ feat!: redesign authentication API
280
+
281
+ BREAKING CHANGE: The authentication API has been completely redesigned.
282
+ Migration guide available in MIGRATION.md
283
+ ```
284
+
285
+ ### ✅ Good Commit Examples
286
+
287
+ ```bash
288
+ ✅ feat: add two-factor authentication
289
+ ✅ fix: resolve memory leak in data processing
290
+ ✅ feat(auth): implement OAuth2 integration
291
+ ✅ fix(ui): correct button alignment on mobile
292
+ ✅ docs: add API documentation for user endpoints
293
+ ```
294
+
295
+ ### ❌ Bad Commit Examples
296
+
297
+ ```bash
298
+ ❌ update stuff
299
+ ❌ fixes
300
+ ❌ WIP
301
+ ❌ asdf
302
+ ❌ more changes
303
+ ```
304
+
305
+ ---
306
+
307
+ ## 🛠️ Commands Reference
308
+
309
+ ### 🚀 Release Commands
310
+
311
+ ```bash
312
+ # Real releases (recommended)
313
+ npm run release:real # Create actual release with --no-ci flag
314
+
315
+ # Test releases
316
+ npm run release:dry # Dry run - shows what would happen
317
+ npm run release # Original command (may run in dry-run mode)
318
+ ```
319
+
320
+ ### 🏗️ Build Commands
321
+
322
+ ```bash
323
+ # Environment-specific builds
324
+ npm run build:production # Production build
325
+ npm run build:stage # Stage build
326
+ npm run build:sandbox # Sandbox build
327
+
328
+ # Build all environments
329
+ npm run build:all # Builds production, stage, and sandbox
330
+ ```
331
+
332
+ ### 👀 Preview Commands
333
+
334
+ ```bash
335
+ # Environment-specific previews
336
+ npm run preview:production # Preview production build
337
+ npm run preview:stage # Preview stage build
338
+ npm run preview:sandbox # Preview sandbox build
339
+ ```
340
+
341
+ ### 📊 Information Commands
342
+
343
+ ```bash
344
+ # Version information
345
+ npm run version:check # Show current version
346
+ git tag --list # Show all release tags
347
+ git tag --list | grep stage # Show stage-specific tags
348
+
349
+ # Environment information
350
+ npm run env:check # Show environment variables
351
+ npm run env:list # List all .env files
352
+ ls -la .env* # Show environment files with details
353
+ ```
354
+
355
+ ### 📋 Git Commands
356
+
357
+ ```bash
358
+ # Tag management
359
+ git tag --list # List all tags
360
+ git tag --sort=-version:refname # List tags sorted by version
361
+ git show v1.0.0-stage.2 # Show specific tag details
362
+
363
+ # Commit history
364
+ git log --oneline -10 # Recent commits
365
+ git log --oneline --grep="feat" # Filter by commit type
366
+ git log --oneline --decorate # Show commits with tags
367
+ ```
368
+
369
+ ---
370
+
371
+ ## 🔧 Troubleshooting
372
+
373
+ ### ❓ Common Issues
374
+
375
+ #### **1. Release Running in Dry-Run Mode**
376
+
377
+ **Problem**: Release shows "running in dry-run mode"
378
+ ```bash
379
+ ⚠ This run was not triggered in a known CI environment, running in dry-run mode.
380
+ ```
381
+
382
+ **Solution**:
383
+ ```bash
384
+ # Use the real release command
385
+ npm run release:real
386
+
387
+ # Or force with environment variable
388
+ CI=true npm run release
389
+ ```
390
+
391
+ #### **2. No Version Bump on Prerelease Branch**
392
+
393
+ **Problem**: Version shows `1.0.0-stage.2` instead of `1.0.1-stage.1`
394
+
395
+ **Solution**: This is **expected behavior**. Main version only bumps on `main` branch.
396
+ ```bash
397
+ # To get main version bump:
398
+ git checkout main
399
+ git merge stage
400
+ npm run release:real # This will create v1.0.1
401
+ ```
402
+
403
+ #### **3. No Commits Found**
404
+
405
+ **Problem**: "No commits found since last release"
406
+
407
+ **Solution**: Make sure you have new conventional commits since the last release.
408
+ ```bash
409
+ # Check recent commits
410
+ git log --oneline -5
411
+
412
+ # Make a new commit
413
+ git add .
414
+ git commit -m "feat: add new feature"
415
+ npm run release:real
416
+ ```
417
+
418
+ #### **4. Build Failures**
419
+
420
+ **Problem**: TypeScript errors during build
421
+
422
+ **Solution**: Fix TypeScript errors or build without strict checking:
423
+ ```bash
424
+ # Skip TypeScript checking temporarily
425
+ npx vite build --mode production
426
+
427
+ # Fix errors in codebase
428
+ npm run lint
429
+ # Fix the reported issues
430
+ ```
431
+
432
+ #### **5. Wrong Environment Variables**
433
+
434
+ **Problem**: App shows wrong environment or API URL
435
+
436
+ **Solution**: Check environment file loading:
437
+ ```bash
438
+ # Verify environment files exist
439
+ npm run env:list
440
+
441
+ # Check current environment detection
442
+ npm run env:check
443
+
444
+ # Check vite config
445
+ cat vite.config.ts
446
+ ```
447
+
448
+ ### 🔍 Debug Commands
449
+
450
+ ```bash
451
+ # Debug semantic release
452
+ npm run semantic-release -- --dry-run --debug
453
+
454
+ # Debug environment loading
455
+ node -e "console.log(require('vite').loadEnv('production', process.cwd()))"
456
+
457
+ # Debug build process
458
+ npm run build:stage -- --debug
459
+ ```
460
+
461
+ ---
462
+
463
+ ## 📚 Examples
464
+
465
+ ### 🎬 Example: Feature Development to Production
466
+
467
+ ```bash
468
+ # 1. Start in sandbox
469
+ git checkout sandbox
470
+ git add .
471
+ git commit -m "feat: implement user dashboard"
472
+ npm run release:real
473
+ # Creates: v1.0.0-sandbox.1
474
+
475
+ # 2. Test in sandbox
476
+ npm run build:sandbox
477
+
478
+ # 3. Stage for QA
479
+ git checkout stage
480
+ git merge sandbox
481
+ npm run release:real
482
+ npm run build:stage
483
+ # Creates: v1.0.0-stage.1
484
+
485
+ # 4. Deploy to production
486
+ git checkout prod
487
+ git merge stage
488
+ npm run release:real
489
+ npm run build:production
490
+ # Creates: v1.0.1 🎉
491
+ ```
492
+
493
+ ### 🐛 Example: Hotfix Release
494
+
495
+ ```bash
496
+ # 1. Create hotfix on prod
497
+ git checkout prod
498
+ git add .
499
+ git commit -m "fix: resolve critical security issue"
500
+ npm run release:real
501
+ # Creates: v1.0.2
502
+
503
+ # 2. Merge back to development branches
504
+ git checkout stage
505
+ git merge prod
506
+ git checkout sandbox
507
+ git merge prod
508
+ ```
509
+
510
+ ### 🔄 Example: Multiple Features
511
+
512
+ ```bash
513
+ # Feature A
514
+ git checkout sandbox
515
+ git commit -m "feat: add user authentication"
516
+ npm run release:real
517
+ # Creates: v1.0.0-sandbox.1
518
+
519
+ # Feature B
520
+ git commit -m "feat: add password reset"
521
+ npm run release:real
522
+ # Creates: v1.0.0-sandbox.2
523
+
524
+ # Deploy both features
525
+ git checkout stage
526
+ git merge sandbox
527
+ npm run release:real
528
+ # Creates: v1.0.0-stage.1 (includes both features)
529
+ ```
530
+
531
+ ### 📊 Example: Viewing Release History
532
+
533
+ ```bash
534
+ # View all releases
535
+ git tag --list --sort=-version:refname
536
+
537
+ # View specific branch releases
538
+ git tag --list | grep stage
539
+ git tag --list | grep sandbox
540
+
541
+ # View changelog
542
+ cat CHANGELOG.md
543
+
544
+ # View specific release details
545
+ git show v1.0.0-stage.2
546
+ ```
547
+
548
+ ---
549
+
550
+ ## 📞 Support & Resources
551
+
552
+ ### 🔗 Useful Links
553
+
554
+ - **Conventional Commits**: https://conventionalcommits.org/
555
+ - **Semantic Release**: https://semantic-release.gitbook.io/semantic-release/
556
+ - **Semantic Versioning**: https://semver.org/
557
+
558
+ ### 📋 Quick Reference Card
559
+
560
+ ```bash
561
+ # Daily commands
562
+ npm run release:real # Create release
563
+ npm run version:check # Check version
564
+ npm run build:stage # Build for staging
565
+
566
+ # Emergency commands
567
+ npm run release:dry # Test release
568
+ git tag --list # List all versions
569
+ git log --oneline -5 # Recent commits
570
+ ```
571
+
572
+ ### 🆘 Getting Help
573
+
574
+ 1. **Check this documentation** first
575
+ 2. **Run debug commands** to gather information
576
+ 3. **Check recent commits** for conventional format
577
+ 4. **Verify environment files** are correct
578
+ 5. **Contact the development team** if issues persist
579
+
580
+ ---
581
+
582
+ ## 📅 Changelog
583
+
584
+ | Date | Version | Changes |
585
+ |------|---------|---------|
586
+ | 2025-06-23 | 1.0.0 | Initial release documentation |
587
+ | 2025-06-23 | 1.0.0-stage.2 | Current version with all features |
588
+
589
+ ---
590
+
591
+ **🎉 Happy Releasing!**