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 +7 -0
- package/dist/demoConfig/node-fullstack.json +2 -1
- package/dist/demoConfig/rules/mutuallyExclusivePackages-global-rule.json +38 -0
- package/dist/demoConfig/rules/newSdkFeatureNotAdoped-global-rule.json +1 -1
- package/dist/facts/globalFileAnalysisFacts.js +1 -1
- package/package.json +1 -1
- package/src/demoConfig/node-fullstack.json +2 -1
- package/src/demoConfig/rules/mutuallyExclusivePackages-global-rule.json +38 -0
- package/src/demoConfig/rules/newSdkFeatureNotAdoped-global-rule.json +1 -1
- package/src/exampleTriggerFiles/mixedUIComponents.tsx +11 -0
- package/src/facts/globalFileAnalysisFacts.ts +1 -1
- package/website/docs/getting-started.md +4 -0
- package/website/docs/local-configuration.md +22 -0
- package/website/sidebars.js +1 -0
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
|
+
}
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|