x-fidelity 3.12.0 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [3.12.1](https://github.com/zotoio/x-fidelity/compare/v3.12.0...v3.12.1) (2025-03-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **examples:** simple rules to check code evolution ([46547a6](https://github.com/zotoio/x-fidelity/commit/46547a6d5127976178b57010dbc33ad16d0cbdbc))
7
+
1
8
  # [3.12.0](https://github.com/zotoio/x-fidelity/compare/v3.11.0...v3.12.0) (2025-03-10)
2
9
 
3
10
 
@@ -10,7 +10,8 @@
10
10
  "invalidSystemIdConfigured-iterative",
11
11
  "missingRequiredFiles-global",
12
12
  "factDoesNotAddResultToAlmanac-iterative",
13
- "newSdkFeatureNotAdoped-global"
13
+ "newSdkFeatureNotAdoped-global",
14
+ "mutuallyExclusivePackages-global"
14
15
  ],
15
16
  "operators": [
16
17
  "fileContains",
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "mutuallyExclusivePackages-global",
3
+ "conditions": {
4
+ "all": [
5
+ {
6
+ "fact": "fileData",
7
+ "path": "$.fileName",
8
+ "operator": "equal",
9
+ "value": "REPO_GLOBAL_CHECK"
10
+ },
11
+ {
12
+ "fact": "globalFileAnalysis",
13
+ "params": {
14
+ "patterns": [
15
+ "import.*from\\s+['\"](@mui/material.*)['\"]",
16
+ "import.*from\\s+['\"](antd)['\"]",
17
+ "require\\(['\"](@mui/material.*)['\"]\\)",
18
+ "require\\(['\"](antd)['\"]\\)"
19
+ ],
20
+ "fileFilter": "\\.(js|jsx|ts|tsx)$",
21
+ "resultFact": "packageUsageAnalysis"
22
+ },
23
+ "operator": "globalPatternCount",
24
+ "value": 0
25
+ }
26
+ ]
27
+ },
28
+ "event": {
29
+ "type": "fatality",
30
+ "params": {
31
+ "message": "Mutually exclusive packages detected. MUI and AntDesign should not be used together.",
32
+ "details": {
33
+ "fact": "packageUsageAnalysis",
34
+ "recommendation": "Choose migrate to MUI."
35
+ }
36
+ }
37
+ }
38
+ }
@@ -12,7 +12,7 @@
12
12
  "fact": "globalFileAnalysis",
13
13
  "params": {
14
14
  "newPatterns": [
15
- "const plugin: XFiPlugin = {"
15
+ "const plugin: XFiPlugin.="
16
16
  ],
17
17
  "legacyPatterns": [
18
18
  "import {.*FactDefn.*} from '\\.\\./types/typeDefs';"
@@ -60,7 +60,7 @@ exports.globalFileAnalysis = {
60
60
  fileMatches++;
61
61
  matchDetails.push({
62
62
  lineNumber: i + 1,
63
- match: match[0],
63
+ match: pattern,
64
64
  context: (0, maskSensitiveData_1.maskSensitiveData)(line.trim())
65
65
  });
66
66
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-fidelity",
3
- "version": "3.12.0",
3
+ "version": "3.12.1",
4
4
  "description": "cli for opinionated framework adherence checks",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -10,7 +10,8 @@
10
10
  "invalidSystemIdConfigured-iterative",
11
11
  "missingRequiredFiles-global",
12
12
  "factDoesNotAddResultToAlmanac-iterative",
13
- "newSdkFeatureNotAdoped-global"
13
+ "newSdkFeatureNotAdoped-global",
14
+ "mutuallyExclusivePackages-global"
14
15
  ],
15
16
  "operators": [
16
17
  "fileContains",
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "mutuallyExclusivePackages-global",
3
+ "conditions": {
4
+ "all": [
5
+ {
6
+ "fact": "fileData",
7
+ "path": "$.fileName",
8
+ "operator": "equal",
9
+ "value": "REPO_GLOBAL_CHECK"
10
+ },
11
+ {
12
+ "fact": "globalFileAnalysis",
13
+ "params": {
14
+ "patterns": [
15
+ "import.*from\\s+['\"](@mui/material.*)['\"]",
16
+ "import.*from\\s+['\"](antd)['\"]",
17
+ "require\\(['\"](@mui/material.*)['\"]\\)",
18
+ "require\\(['\"](antd)['\"]\\)"
19
+ ],
20
+ "fileFilter": "\\.(js|jsx|ts|tsx)$",
21
+ "resultFact": "packageUsageAnalysis"
22
+ },
23
+ "operator": "globalPatternCount",
24
+ "value": 0
25
+ }
26
+ ]
27
+ },
28
+ "event": {
29
+ "type": "fatality",
30
+ "params": {
31
+ "message": "Mutually exclusive packages detected. MUI and AntDesign should not be used together.",
32
+ "details": {
33
+ "fact": "packageUsageAnalysis",
34
+ "recommendation": "Choose migrate to MUI."
35
+ }
36
+ }
37
+ }
38
+ }
@@ -12,7 +12,7 @@
12
12
  "fact": "globalFileAnalysis",
13
13
  "params": {
14
14
  "newPatterns": [
15
- "const plugin: XFiPlugin = {"
15
+ "const plugin: XFiPlugin.="
16
16
  ],
17
17
  "legacyPatterns": [
18
18
  "import {.*FactDefn.*} from '\\.\\./types/typeDefs';"
@@ -0,0 +1,11 @@
1
+ import { Button } from 'antd';
2
+ import * as React from 'react';
3
+ import Checkbox from '@mui/material/Checkbox';
4
+
5
+ export default function ButtonUsage() {
6
+ return <Button variant="contained">Hello world</Button>;
7
+ }
8
+
9
+ export default function CheckboxUsage() {
10
+ return <Checkbox type="primary">Click Me</Checkbox>;
11
+ }
@@ -63,7 +63,7 @@ export const globalFileAnalysis: FactDefn = {
63
63
  fileMatches++;
64
64
  matchDetails.push({
65
65
  lineNumber: i + 1,
66
- match: match[0],
66
+ match: pattern,
67
67
  context: maskSensitiveData(line.trim())
68
68
  });
69
69
  }
@@ -62,6 +62,10 @@ Options:
62
62
  - `CERT_PATH`: SSL certificate path
63
63
  - `NODE_TLS_REJECT_UNAUTHORIZED`: Allow self-signed certs
64
64
  - `XFI_SHARED_SECRET`: Shared secret for security
65
+ - `NOTIFICATIONS_ENABLED`: Enable notification system
66
+ - `NOTIFICATION_PROVIDERS`: Comma-separated list of notification providers to use
67
+ - `CODEOWNERS_PATH`: Path to CODEOWNERS file (default: .github/CODEOWNERS)
68
+ - `CODEOWNERS_ENABLED`: Enable code owners integration
65
69
 
66
70
  ## Example Commands
67
71
 
@@ -112,6 +112,28 @@ Example `team1-exemptions.json`:
112
112
  ]
113
113
  ```
114
114
 
115
+ ### Notification Configuration
116
+
117
+ Example notification settings in `.xfi-config.json`:
118
+ ```json
119
+ {
120
+ "notifications": {
121
+ "recipients": {
122
+ "email": ["team@example.com"],
123
+ "slack": ["U123456", "U789012"],
124
+ "teams": ["user1@example.com", "user2@example.com"]
125
+ },
126
+ "codeOwners": true,
127
+ "notifyOnSuccess": false,
128
+ "notifyOnFailure": true,
129
+ "customTemplates": {
130
+ "success": "All checks passed successfully! 🎉\n\nArchetype: ${archetype}\nFiles analyzed: ${fileCount}\nExecution time: ${executionTime}s",
131
+ "failure": "Issues found in codebase:\n\nArchetype: ${archetype}\nTotal issues: ${totalIssues}\n- Warnings: ${warningCount}\n- Errors: ${errorCount}\n- Fatalities: ${fatalityCount}\n\nAffected files:\n${affectedFiles}"
132
+ }
133
+ }
134
+ }
135
+ ```
136
+
115
137
  ## Best Practices
116
138
 
117
139
  1. **Version Control**: Keep configurations in version control
@@ -34,6 +34,7 @@ module.exports = {
34
34
  'docker-deployment',
35
35
  'github-webhooks',
36
36
  'telemetry',
37
+ 'notifications',
37
38
  ],
38
39
  },
39
40
  {