@aiready/pattern-detect 0.9.8 → 0.9.9

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/dist/cli.js CHANGED
@@ -726,16 +726,17 @@ program.name("aiready-patterns").description("Detect duplicate patterns in your
726
726
  includeTests: options.includeTests || mergedConfig.includeTests,
727
727
  maxResults: options.maxResults ? parseInt(options.maxResults) : mergedConfig.maxResults
728
728
  };
729
- if (!finalOptions.includeTests) {
729
+ if (finalOptions.includeTests && finalOptions.exclude) {
730
730
  const testPatterns = [
731
731
  "**/*.test.*",
732
732
  "**/*.spec.*",
733
733
  "**/__tests__/**",
734
734
  "**/test/**",
735
- "**/*.test",
736
- "**/*.spec"
735
+ "**/tests/**"
737
736
  ];
738
- finalOptions.exclude = finalOptions.exclude ? [...finalOptions.exclude, ...testPatterns] : testPatterns;
737
+ finalOptions.exclude = finalOptions.exclude.filter(
738
+ (pattern) => !testPatterns.includes(pattern)
739
+ );
739
740
  }
740
741
  const { results, duplicates: rawDuplicates, files } = await analyzePatterns(finalOptions);
741
742
  let filteredDuplicates = rawDuplicates;
package/dist/cli.mjs CHANGED
@@ -55,16 +55,17 @@ program.name("aiready-patterns").description("Detect duplicate patterns in your
55
55
  includeTests: options.includeTests || mergedConfig.includeTests,
56
56
  maxResults: options.maxResults ? parseInt(options.maxResults) : mergedConfig.maxResults
57
57
  };
58
- if (!finalOptions.includeTests) {
58
+ if (finalOptions.includeTests && finalOptions.exclude) {
59
59
  const testPatterns = [
60
60
  "**/*.test.*",
61
61
  "**/*.spec.*",
62
62
  "**/__tests__/**",
63
63
  "**/test/**",
64
- "**/*.test",
65
- "**/*.spec"
64
+ "**/tests/**"
66
65
  ];
67
- finalOptions.exclude = finalOptions.exclude ? [...finalOptions.exclude, ...testPatterns] : testPatterns;
66
+ finalOptions.exclude = finalOptions.exclude.filter(
67
+ (pattern) => !testPatterns.includes(pattern)
68
+ );
68
69
  }
69
70
  const { results, duplicates: rawDuplicates, files } = await analyzePatterns(finalOptions);
70
71
  let filteredDuplicates = rawDuplicates;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/pattern-detect",
3
- "version": "0.9.8",
3
+ "version": "0.9.9",
4
4
  "description": "Semantic duplicate pattern detection for AI-generated code - finds similar implementations that waste AI context tokens",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "commander": "^14.0.0",
47
47
  "chalk": "^5.3.0",
48
- "@aiready/core": "0.7.3"
48
+ "@aiready/core": "0.7.4"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "^8.3.5",