pipecraft 0.0.0-releaseit

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 (176) hide show
  1. package/.claude/settings.local.json +35 -0
  2. package/.github/actions/calculate-version/action.yml +106 -0
  3. package/.github/actions/create-pr/action.yml +122 -0
  4. package/.github/actions/create-release/action.yml +74 -0
  5. package/.github/actions/create-tag/action.yml +94 -0
  6. package/.github/actions/detect-changes/action.yml +62 -0
  7. package/.github/actions/manage-branch/action.yml +113 -0
  8. package/.github/actions/promote-branch/action.yml +352 -0
  9. package/.github/example/workflows/job.analyze.code.yml +26 -0
  10. package/.github/example/workflows/job.analyze.docker.yml +32 -0
  11. package/.github/example/workflows/job.app.api.deploy.yml +127 -0
  12. package/.github/example/workflows/job.app.api.test.yml +102 -0
  13. package/.github/example/workflows/job.app.docs.deploy.yml +40 -0
  14. package/.github/example/workflows/job.app.docs.test.yml +50 -0
  15. package/.github/example/workflows/job.app.web.deploy.yml +96 -0
  16. package/.github/example/workflows/job.app.web.test.yml +49 -0
  17. package/.github/example/workflows/job.changes.yml +82 -0
  18. package/.github/example/workflows/job.create-pr.yml +96 -0
  19. package/.github/example/workflows/job.env-check.yml +43 -0
  20. package/.github/example/workflows/job.fast-forward.yml +103 -0
  21. package/.github/example/workflows/job.lint.yml +64 -0
  22. package/.github/example/workflows/job.pr-name.yml +70 -0
  23. package/.github/example/workflows/job.pr-squash-name.yml +27 -0
  24. package/.github/example/workflows/job.tag.yml +38 -0
  25. package/.github/example/workflows/job.version.yml +99 -0
  26. package/.github/example/workflows/lib.plugin-base.publish.yml +59 -0
  27. package/.github/example/workflows/pipe.yml +178 -0
  28. package/.github/example/workflows/scripts/fastforward.sh +51 -0
  29. package/.github/example/workflows/scripts/pipe-cleaner.sh +70 -0
  30. package/.github/scripts/fastforward.sh +51 -0
  31. package/.github/scripts/pipe-cleaner.sh +70 -0
  32. package/.github/workflows/pipeline.yml +220 -0
  33. package/.github/workflows/pr-title-check.yml +70 -0
  34. package/.github/workflows/publish.yml +39 -0
  35. package/.pipecraftrc.json +78 -0
  36. package/.release-it.cjs +71 -0
  37. package/PIPELINE_TESTING_PLAN.md +499 -0
  38. package/README.md +1101 -0
  39. package/TRUNK_FLOW_PLAN.md +401 -0
  40. package/assets/logo_banner.png +0 -0
  41. package/assets/logo_banner.webp +0 -0
  42. package/dist/cli/index.d.ts +3 -0
  43. package/dist/cli/index.d.ts.map +1 -0
  44. package/dist/cli/index.js +364 -0
  45. package/dist/cli/index.js.map +1 -0
  46. package/dist/generators/init.tpl.d.ts +3 -0
  47. package/dist/generators/init.tpl.d.ts.map +1 -0
  48. package/dist/generators/init.tpl.js +117 -0
  49. package/dist/generators/init.tpl.js.map +1 -0
  50. package/dist/generators/workflows.tpl.d.ts +7 -0
  51. package/dist/generators/workflows.tpl.d.ts.map +1 -0
  52. package/dist/generators/workflows.tpl.js +73 -0
  53. package/dist/generators/workflows.tpl.js.map +1 -0
  54. package/dist/templates/actions/calculate-version.yml.tpl.d.ts +3 -0
  55. package/dist/templates/actions/calculate-version.yml.tpl.d.ts.map +1 -0
  56. package/dist/templates/actions/calculate-version.yml.tpl.js +122 -0
  57. package/dist/templates/actions/calculate-version.yml.tpl.js.map +1 -0
  58. package/dist/templates/actions/create-pr.yml.tpl.d.ts +3 -0
  59. package/dist/templates/actions/create-pr.yml.tpl.d.ts.map +1 -0
  60. package/dist/templates/actions/create-pr.yml.tpl.js +145 -0
  61. package/dist/templates/actions/create-pr.yml.tpl.js.map +1 -0
  62. package/dist/templates/actions/create-tag.yml.tpl.d.ts +3 -0
  63. package/dist/templates/actions/create-tag.yml.tpl.d.ts.map +1 -0
  64. package/dist/templates/actions/create-tag.yml.tpl.js +111 -0
  65. package/dist/templates/actions/create-tag.yml.tpl.js.map +1 -0
  66. package/dist/templates/actions/detect-changes.yml.tpl.d.ts +3 -0
  67. package/dist/templates/actions/detect-changes.yml.tpl.d.ts.map +1 -0
  68. package/dist/templates/actions/detect-changes.yml.tpl.js +79 -0
  69. package/dist/templates/actions/detect-changes.yml.tpl.js.map +1 -0
  70. package/dist/templates/actions/manage-branch.yml.tpl.d.ts +3 -0
  71. package/dist/templates/actions/manage-branch.yml.tpl.d.ts.map +1 -0
  72. package/dist/templates/actions/manage-branch.yml.tpl.js +130 -0
  73. package/dist/templates/actions/manage-branch.yml.tpl.js.map +1 -0
  74. package/dist/templates/actions/promote-branch.yml.tpl.d.ts +3 -0
  75. package/dist/templates/actions/promote-branch.yml.tpl.d.ts.map +1 -0
  76. package/dist/templates/actions/promote-branch.yml.tpl.js +362 -0
  77. package/dist/templates/actions/promote-branch.yml.tpl.js.map +1 -0
  78. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts +16 -0
  79. package/dist/templates/workflows/pipeline-path-based.yml.tpl.d.ts.map +1 -0
  80. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js +652 -0
  81. package/dist/templates/workflows/pipeline-path-based.yml.tpl.js.map +1 -0
  82. package/dist/types/index.d.ts +63 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/index.js +2 -0
  85. package/dist/types/index.js.map +1 -0
  86. package/dist/utils/ast-path-operations.d.ts +287 -0
  87. package/dist/utils/ast-path-operations.d.ts.map +1 -0
  88. package/dist/utils/ast-path-operations.js +419 -0
  89. package/dist/utils/ast-path-operations.js.map +1 -0
  90. package/dist/utils/config.d.ts +3 -0
  91. package/dist/utils/config.d.ts.map +1 -0
  92. package/dist/utils/config.js +49 -0
  93. package/dist/utils/config.js.map +1 -0
  94. package/dist/utils/github-setup.d.ts +74 -0
  95. package/dist/utils/github-setup.d.ts.map +1 -0
  96. package/dist/utils/github-setup.js +418 -0
  97. package/dist/utils/github-setup.js.map +1 -0
  98. package/dist/utils/idempotency.d.ts +47 -0
  99. package/dist/utils/idempotency.d.ts.map +1 -0
  100. package/dist/utils/idempotency.js +176 -0
  101. package/dist/utils/idempotency.js.map +1 -0
  102. package/dist/utils/preflight.d.ts +55 -0
  103. package/dist/utils/preflight.d.ts.map +1 -0
  104. package/dist/utils/preflight.js +261 -0
  105. package/dist/utils/preflight.js.map +1 -0
  106. package/dist/utils/versioning.d.ts +41 -0
  107. package/dist/utils/versioning.d.ts.map +1 -0
  108. package/dist/utils/versioning.js +219 -0
  109. package/dist/utils/versioning.js.map +1 -0
  110. package/docs/USER_JOURNEY_ERRORS.md +352 -0
  111. package/eslint.config.js +77 -0
  112. package/examples/basic-config.json +41 -0
  113. package/examples/monorepo-config.json +49 -0
  114. package/examples/usage.md +289 -0
  115. package/package.json +58 -0
  116. package/scripts/debug-workflows.sh +339 -0
  117. package/scripts/parse-pipeline.js +29 -0
  118. package/scripts/test-job-order.cjs +140 -0
  119. package/scripts/validate-pipeline.cjs +379 -0
  120. package/scripts/verify-job-order.sh +30 -0
  121. package/src/cli/index.ts +414 -0
  122. package/src/generators/init.tpl.ts +126 -0
  123. package/src/generators/workflows.tpl.ts +80 -0
  124. package/src/templates/actions/calculate-version.yml.tpl.ts +124 -0
  125. package/src/templates/actions/create-pr.yml.tpl.ts +147 -0
  126. package/src/templates/actions/create-tag.yml.tpl.ts +112 -0
  127. package/src/templates/actions/detect-changes.yml.tpl.ts +87 -0
  128. package/src/templates/actions/manage-branch.yml.tpl.ts +132 -0
  129. package/src/templates/actions/promote-branch.yml.tpl.ts +364 -0
  130. package/src/templates/workflows/pipeline-path-based.yml.tpl.ts +706 -0
  131. package/src/types/index.ts +64 -0
  132. package/src/utils/README-ast-path-operations.md +390 -0
  133. package/src/utils/ast-path-operations.ts +581 -0
  134. package/src/utils/config.ts +64 -0
  135. package/src/utils/github-setup.ts +558 -0
  136. package/src/utils/idempotency.ts +215 -0
  137. package/src/utils/preflight.ts +306 -0
  138. package/src/utils/versioning.ts +244 -0
  139. package/tests/README.md +229 -0
  140. package/tests/TEST_STRUCTURE.md +256 -0
  141. package/tests/act/run-act-tests.sh +345 -0
  142. package/tests/debugging/debug-utils.ts +538 -0
  143. package/tests/debugging/debug-workflow.test.ts +339 -0
  144. package/tests/debugging/debug-workflows.sh +339 -0
  145. package/tests/debugging/iterative-debug.ts +652 -0
  146. package/tests/debugging/run-debug-tests.sh +431 -0
  147. package/tests/fixtures/basic-config.json +51 -0
  148. package/tests/fixtures/invalid-config.json +9 -0
  149. package/tests/fixtures/pipeline-generated.yml +235 -0
  150. package/tests/fixtures/pipeline-preserve-comments.yml +245 -0
  151. package/tests/fixtures/pipeline-user-modified.yml +245 -0
  152. package/tests/fixtures/test-config.json +58 -0
  153. package/tests/github-live/README.md +250 -0
  154. package/tests/github-local/JOB_WORKFLOW_TESTS.md +296 -0
  155. package/tests/github-local/README.md +240 -0
  156. package/tests/github-local/run-all-tests.sh +422 -0
  157. package/tests/github-local/test-job-workflows.sh +631 -0
  158. package/tests/github-local/test-pipeline-workflow.sh +440 -0
  159. package/tests/integration/generators.test.ts +578 -0
  160. package/tests/integration/path-based-template.test.ts +510 -0
  161. package/tests/integration/simple-path-based.test.ts +415 -0
  162. package/tests/setup.ts +56 -0
  163. package/tests/unit/ast-path-operations-extended.test.ts +302 -0
  164. package/tests/unit/cli.test.ts +541 -0
  165. package/tests/unit/config-extended.test.ts +412 -0
  166. package/tests/unit/config.test.ts +152 -0
  167. package/tests/unit/github-setup.test.ts +189 -0
  168. package/tests/unit/idempotency-isolated.test.ts +297 -0
  169. package/tests/unit/job-order.test.ts +157 -0
  170. package/tests/unit/pipeline-path-based.test.ts +511 -0
  171. package/tests/unit/validate-pipeline.test.ts +384 -0
  172. package/tests/unit/versioning-extended.test.ts +279 -0
  173. package/tests/unit/versioning.test.ts +241 -0
  174. package/tsconfig.debug.json +17 -0
  175. package/tsconfig.json +28 -0
  176. package/vitest.config.ts +51 -0
@@ -0,0 +1,352 @@
1
+ # PipeCraft User Journey Error Analysis
2
+
3
+ This document maps out every failure point a new user might encounter and the error handling needed.
4
+
5
+ ## Phase 1: Installation
6
+
7
+ ### Scenario A: User tries `npm install -g pipecraft`
8
+
9
+ **Prerequisites Check:**
10
+ - [ ] Node.js installed (>=18.0.0)
11
+ - [ ] npm installed
12
+ - [ ] Proper permissions (or using sudo)
13
+ - [ ] Package published to npm
14
+
15
+ **Possible Errors:**
16
+ ```bash
17
+ # Error: Node not installed
18
+ bash: npm: command not found
19
+ → Need: "Please install Node.js: https://nodejs.org"
20
+
21
+ # Error: Old Node version
22
+ npm ERR! Unsupported engine
23
+ → Need: "PipeCraft requires Node.js >=18.0.0. Current: vX.X.X"
24
+
25
+ # Error: Permission denied
26
+ EACCES: permission denied
27
+ → Need: "Try: sudo npm install -g pipecraft OR use npx"
28
+
29
+ # Error: Package not found (before published)
30
+ 404 Not Found - GET https://registry.npmjs.org/pipecraft
31
+ → Need: "Use npx or install from source"
32
+ ```
33
+
34
+ ### Scenario B: User tries `npx pipecraft`
35
+
36
+ **Prerequisites Check:**
37
+ - [ ] Node.js installed
38
+ - [ ] npm installed
39
+ - [ ] In a directory (any directory)
40
+
41
+ **Possible Errors:**
42
+ ```bash
43
+ # Same Node/npm errors as above
44
+ ```
45
+
46
+ ## Phase 2: `pipecraft init`
47
+
48
+ ### User Location Check
49
+
50
+ **Where might users run this?**
51
+
52
+ 1. **❌ Not in git repo yet**
53
+ ```bash
54
+ cd ~/projects/my-new-project
55
+ pipecraft init
56
+ ```
57
+ → Should work! (git not required for init)
58
+
59
+ 2. **❌ In git repo but no remote**
60
+ ```bash
61
+ git init
62
+ pipecraft init
63
+ ```
64
+ → Should work! (remote not required for init)
65
+
66
+ 3. **✅ In git repo with remote**
67
+ ```bash
68
+ git clone <repo>
69
+ pipecraft init
70
+ ```
71
+ → Should work!
72
+
73
+ **Current Issues:**
74
+ - ❌ No check for existing config file
75
+ - ❌ No warning about overwriting
76
+ - ❌ Unclear prompts for new users
77
+ - ❌ No validation of branch names
78
+
79
+ ### Init Process Errors
80
+
81
+ **Error 1: Config Already Exists**
82
+ ```bash
83
+ pipecraft init
84
+ # .pipecraftrc.json already exists
85
+ ```
86
+ → Need: "Config already exists. Use --force to overwrite or edit manually"
87
+
88
+ **Error 2: Invalid Branch Names**
89
+ ```bash
90
+ # User enters: "my branch" (with space)
91
+ ```
92
+ → Need: Validate branch names (no spaces, valid git ref)
93
+
94
+ **Error 3: Duplicate Branch Names**
95
+ ```bash
96
+ # User enters same branch for develop and main
97
+ ```
98
+ → Need: "Branch names must be unique"
99
+
100
+ **Error 4: Invalid Domain Paths**
101
+ ```bash
102
+ # User enters: "../../../etc/passwd"
103
+ ```
104
+ → Need: Validate paths are within project
105
+
106
+ **Error 5: No Domains Configured**
107
+ ```bash
108
+ # User skips all domain configuration
109
+ ```
110
+ → Need: "At least one domain is required"
111
+
112
+ ## Phase 3: `pipecraft generate`
113
+
114
+ ### Prerequisites Check
115
+
116
+ **Must Have:**
117
+ - [ ] Config file exists (.pipecraftrc.json)
118
+ - [ ] Config is valid JSON
119
+ - [ ] Config has required fields
120
+ - [ ] In git repository (for git commands)
121
+ - [ ] Has git remote (for GitHub Actions)
122
+ - [ ] Branches exist or can be created
123
+
124
+ ### Error Scenarios
125
+
126
+ **Error 1: No Config File**
127
+ ```bash
128
+ pipecraft generate
129
+ # Error: Config file not found
130
+ ```
131
+ → Current: Generic error
132
+ → Need: "No configuration found. Run 'pipecraft init' first"
133
+
134
+ **Error 2: Invalid Config**
135
+ ```bash
136
+ # .pipecraftrc.json has syntax error
137
+ {
138
+ "ciProvider": "github",
139
+ missing closing brace
140
+ ```
141
+ → Need: "Invalid JSON in .pipecraftrc.json: <specific error>"
142
+
143
+ **Error 3: Missing Required Fields**
144
+ ```bash
145
+ # Config missing 'domains' field
146
+ ```
147
+ → Need: "Config validation failed: Missing required field 'domains'"
148
+
149
+ **Error 4: Not in Git Repo**
150
+ ```bash
151
+ cd ~/not-a-git-repo
152
+ pipecraft generate
153
+ ```
154
+ → Need: "Must be in a git repository. Run 'git init' first"
155
+
156
+ **Error 5: No Git Remote**
157
+ ```bash
158
+ git init # But no remote added
159
+ pipecraft generate
160
+ ```
161
+ → Need: "No git remote found. Add remote: git remote add origin <url>"
162
+
163
+ **Error 6: Can't Write to .github Directory**
164
+ ```bash
165
+ # Permission denied
166
+ ```
167
+ → Need: "Permission denied writing to .github/workflows. Check permissions"
168
+
169
+ **Error 7: Branches Don't Exist**
170
+ ```bash
171
+ # Config specifies 'staging' but doesn't exist
172
+ ```
173
+ → Need: "Branch 'staging' not found. Run 'pipecraft setup' to create branches"
174
+
175
+ ## Phase 4: `pipecraft setup-github`
176
+
177
+ ### Prerequisites Check
178
+
179
+ **Must Have:**
180
+ - [ ] In git repository
181
+ - [ ] Git remote is GitHub (not GitLab/Bitbucket)
182
+ - [ ] GitHub token available
183
+ - [ ] Token has correct permissions
184
+
185
+ ### Error Scenarios
186
+
187
+ **Error 1: No Token**
188
+ ```bash
189
+ pipecraft setup-github
190
+ ```
191
+ → Current: Good error message ✅
192
+ → Shows: How to set GITHUB_TOKEN or use gh CLI
193
+
194
+ **Error 2: Invalid Token**
195
+ ```bash
196
+ export GITHUB_TOKEN=invalid_token_123
197
+ pipecraft setup-github
198
+ ```
199
+ → Need: "GitHub API returned 401 Unauthorized. Check your token"
200
+
201
+ **Error 3: Token Missing Permissions**
202
+ ```bash
203
+ # Token has read-only access
204
+ ```
205
+ → Need: "Token needs 'admin:org' or 'repo' scope. Create new token at: <url>"
206
+
207
+ **Error 4: Not a GitHub Repo**
208
+ ```bash
209
+ git remote add origin git@gitlab.com:user/repo.git
210
+ pipecraft setup-github
211
+ ```
212
+ → Current: Good error ✅
213
+ → Shows: "Could not parse GitHub repository URL"
214
+
215
+ **Error 5: Private Repo, Wrong Token**
216
+ ```bash
217
+ # Using personal token on org repo
218
+ ```
219
+ → Need: "403 Forbidden. You may need organization admin access"
220
+
221
+ ## Phase 5: First Workflow Run
222
+
223
+ ### Prerequisites Check
224
+
225
+ **Must Have:**
226
+ - [ ] GitHub Actions enabled on repo
227
+ - [ ] Workflow file exists (.github/workflows/pipeline.yml)
228
+ - [ ] Branches exist (develop, staging, main)
229
+ - [ ] Repository permissions configured
230
+ - [ ] At least one commit
231
+
232
+ ### Error Scenarios
233
+
234
+ **Error 1: Actions Disabled**
235
+ ```bash
236
+ # User pushes, nothing happens
237
+ ```
238
+ → Need: Documentation/CLI check: "Verify Actions enabled at: <repo>/settings/actions"
239
+
240
+ **Error 2: Missing Branches**
241
+ ```bash
242
+ # Workflow references 'staging' but doesn't exist
243
+ ```
244
+ → Need: "Run 'pipecraft setup' to create all branches"
245
+
246
+ **Error 3: Permissions Not Set**
247
+ ```bash
248
+ # Workflow fails: "Resource not accessible by integration"
249
+ ```
250
+ → Current: Good error from setup-github ✅
251
+ → But: Could add to generate command validation
252
+
253
+ ## Required Error Handling Improvements
254
+
255
+ ### Priority 1: Critical Path
256
+
257
+ 1. **✅ DONE**: setup-github token validation
258
+ 2. **❌ TODO**: init - check for existing config
259
+ 3. **❌ TODO**: generate - validate config file exists
260
+ 4. **❌ TODO**: generate - validate in git repo
261
+ 5. **❌ TODO**: generate - validate git remote exists
262
+
263
+ ### Priority 2: User Experience
264
+
265
+ 6. **❌ TODO**: Validate branch names in init
266
+ 7. **❌ TODO**: Check Node.js version on startup
267
+ 8. **❌ TODO**: Better error messages for JSON parse errors
268
+ 9. **❌ TODO**: Suggest next steps after each command
269
+
270
+ ### Priority 3: Nice to Have
271
+
272
+ 10. **❌ TODO**: Pre-flight checks before generate
273
+ 11. **❌ TODO**: Dry-run mode for generate
274
+ 12. **❌ TODO**: Validation summary before applying changes
275
+ 13. **❌ TODO**: Interactive troubleshooting guide
276
+
277
+ ## Proposed CLI Flow with Checks
278
+
279
+ ```bash
280
+ # Step 1: Install
281
+ npm install -g pipecraft
282
+ → Check: Node version
283
+ → Success: "PipeCraft installed! Run 'pipecraft init' to get started"
284
+
285
+ # Step 2: Init
286
+ pipecraft init
287
+ → Check: Existing config? Warn before overwrite
288
+ → Interactive: Guide through configuration
289
+ → Validate: Branch names, domain paths
290
+ → Success: "Config created! Next: 'pipecraft generate'"
291
+
292
+ # Step 3: Setup branches (optional but recommended)
293
+ pipecraft setup
294
+ → Check: Git repo exists
295
+ → Check: Git remote configured
296
+ → Create: All branches from branchFlow
297
+ → Success: "Branches created! Next: 'pipecraft setup-github'"
298
+
299
+ # Step 4: Setup GitHub
300
+ pipecraft setup-github
301
+ → Check: Git remote is GitHub
302
+ → Check: Token available
303
+ → Check: Token has permissions
304
+ → Update: Repository settings
305
+ → Success: "GitHub configured! Next: 'pipecraft generate'"
306
+
307
+ # Step 5: Generate
308
+ pipecraft generate
309
+ → Pre-flight checks:
310
+ - Config valid?
311
+ - In git repo?
312
+ - Remote exists?
313
+ - Branches exist? (suggest 'pipecraft setup')
314
+ - Can write to .github/?
315
+ → Generate: Workflows and actions
316
+ → Update: Idempotency cache
317
+ → Success: "Workflows generated! Commit and push to test"
318
+
319
+ # Step 6: First run
320
+ git add .
321
+ git commit -m "feat: add pipecraft workflows"
322
+ git push
323
+ → Instructions: "Check Actions at: <repo>/actions"
324
+ → If fails: "Run 'pipecraft verify' to troubleshoot"
325
+ ```
326
+
327
+ ## New Command Idea: `pipecraft verify`
328
+
329
+ A troubleshooting command that checks everything:
330
+
331
+ ```bash
332
+ pipecraft verify
333
+
334
+ Checking PipeCraft setup...
335
+
336
+ ✅ Node.js version: 20.0.0 (>= 18.0.0)
337
+ ✅ Git repository: Yes
338
+ ✅ Git remote: Yes (github.com/user/repo)
339
+ ✅ Config file: .pipecraftrc.json (valid)
340
+ ✅ Branches exist: develop, staging, main
341
+ ✅ Workflows exist: .github/workflows/pipeline.yml
342
+ ⚠️ GitHub Actions permissions: Not configured
343
+ → Run: pipecraft setup-github
344
+
345
+ ✅ GitHub token: Found (GITHUB_TOKEN)
346
+ ❌ Branches don't match config
347
+ → Config expects: develop, staging, main
348
+ → Repo has: main, master
349
+ → Run: pipecraft setup --force
350
+
351
+ Summary: 7 passed, 1 warning, 1 error
352
+ ```
@@ -0,0 +1,77 @@
1
+ import jsxA11Y from "eslint-plugin-jsx-a11y";
2
+ import typescriptEslint from "@typescript-eslint/eslint-plugin";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import js from "@eslint/js";
6
+ import { FlatCompat } from "@eslint/eslintrc";
7
+ import globals from "globals";
8
+ import react from "eslint-plugin-react"; // Import the react plugin
9
+ import reactHooks from "eslint-plugin-react-hooks"; // Import the react-hooks plugin
10
+
11
+
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
14
+ const compat = new FlatCompat({
15
+ baseDirectory: __dirname,
16
+ recommendedConfig: js.configs.recommended,
17
+ allConfig: js.configs.all
18
+ });
19
+
20
+ export default [
21
+ ...compat.extends(
22
+ "eslint:recommended",
23
+ "plugin:react/recommended",
24
+ "plugin:@typescript-eslint/recommended",
25
+ "plugin:jsx-a11y/recommended",
26
+ ),
27
+ {
28
+ plugins: {
29
+ "jsx-a11y": jsxA11Y,
30
+ "@typescript-eslint": typescriptEslint,
31
+ "react": react,
32
+ "react-hooks": reactHooks // Add the react-hooks plugin here
33
+ },
34
+ rules: {
35
+ "react/react-in-jsx-scope": "off",
36
+
37
+ // Disable some rules tmemporarily,
38
+ "@typescript-eslint/no-explicit-any": "off",
39
+ "@typescript-eslint/no-unused-vars": "off",
40
+ "no-unsafe-optional-chaining": "off",
41
+ "no-undef": "off",
42
+ "no-extra-boolean-cast": "off",
43
+ "@typescript-eslint/no-unused-expressions": "off",
44
+ "no-unexpected-multiline": "off",
45
+ "@typescript-eslint/no-require-imports": "off",
46
+ "no-prototype-builtins": "off",
47
+ "no-redeclare": "off",
48
+ "react/prop-types": "off",
49
+ "react/jsx-key": "off",
50
+ "prefer-const": "off",
51
+ "no-dupe-keys": "off",
52
+ "@typescript-eslint/no-empty-object-type": "off",
53
+ "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
54
+ "react-hooks/exhaustive-deps": "warn" // Checks effect dependencies
55
+ },
56
+ languageOptions: {
57
+ globals: {
58
+ ...globals.node,
59
+ ...globals.browser,
60
+ ...globals.mocha
61
+ }
62
+ }
63
+ },
64
+ {
65
+ ignores: [
66
+ "**/dist/**",
67
+ "**/.nx/**",
68
+ "**/node_modules/**",
69
+ "**/.next/**",
70
+ "**/.vercel/**",
71
+ "**/build/**",
72
+ "apps/interfaces/DEPRECATED_cli/**",
73
+ "**/.docusaurus/**",
74
+ "apps/interfaces/chrome-extension/**",
75
+ ],
76
+ },
77
+ ];
@@ -0,0 +1,41 @@
1
+ {
2
+ "ciProvider": "github",
3
+ "mergeStrategy": "fast-forward",
4
+ "requireConventionalCommits": true,
5
+ "initialBranch": "develop",
6
+ "finalBranch": "main",
7
+ "branchFlow": [
8
+ "develop",
9
+ "staging",
10
+ "main"
11
+ ],
12
+ "semver": {
13
+ "bumpRules": {
14
+ "feat": "minor",
15
+ "fix": "patch",
16
+ "breaking": "major"
17
+ }
18
+ },
19
+ "actions": {
20
+ "onDevelopMerge": ["runTests", "fastForwardToStaging"],
21
+ "onStagingMerge": ["runTests", "calculateVersion", "createOrFastForwardToMain"]
22
+ },
23
+ "domains": {
24
+ "api": {
25
+ "paths": ["apps/api/**"],
26
+ "description": "API application changes"
27
+ },
28
+ "web": {
29
+ "paths": ["apps/web/**"],
30
+ "description": "Web application changes"
31
+ },
32
+ "libs": {
33
+ "paths": ["libs/**"],
34
+ "description": "Shared library changes"
35
+ },
36
+ "cicd": {
37
+ "paths": [".github/workflows/**"],
38
+ "description": "CI/CD configuration changes"
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "ciProvider": "github",
3
+ "mergeStrategy": "fast-forward",
4
+ "requireConventionalCommits": true,
5
+ "initialBranch": "develop",
6
+ "finalBranch": "main",
7
+ "branchFlow": [
8
+ "develop",
9
+ "staging",
10
+ "main"
11
+ ],
12
+ "semver": {
13
+ "bumpRules": {
14
+ "feat": "minor",
15
+ "fix": "patch",
16
+ "breaking": "major"
17
+ }
18
+ },
19
+ "actions": {
20
+ "onDevelopMerge": ["runTests", "fastForwardToStaging"],
21
+ "onStagingMerge": ["runTests", "calculateVersion", "createOrFastForwardToMain"]
22
+ },
23
+ "domains": {
24
+ "frontend": {
25
+ "paths": ["packages/frontend/**", "apps/web/**"],
26
+ "description": "Frontend application changes"
27
+ },
28
+ "backend": {
29
+ "paths": ["packages/backend/**", "apps/api/**"],
30
+ "description": "Backend application changes"
31
+ },
32
+ "shared": {
33
+ "paths": ["packages/shared/**", "libs/**"],
34
+ "description": "Shared library changes"
35
+ },
36
+ "mobile": {
37
+ "paths": ["packages/mobile/**", "apps/mobile/**"],
38
+ "description": "Mobile application changes"
39
+ },
40
+ "infrastructure": {
41
+ "paths": ["infrastructure/**", "terraform/**", "k8s/**"],
42
+ "description": "Infrastructure changes"
43
+ },
44
+ "cicd": {
45
+ "paths": [".github/workflows/**", ".gitlab-ci.yml"],
46
+ "description": "CI/CD configuration changes"
47
+ }
48
+ }
49
+ }