@gld5000-cli/dependency-finder 1.0.11 → 1.0.12

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/README.md CHANGED
@@ -35,7 +35,7 @@ npx @gld5000-cli/dependency-finder
35
35
  ## Run with arguments
36
36
 
37
37
  ```
38
- npx @gld5000-cli/dependency-finder [Component directory] [Dependents paths] [File ignore patterns] [PascalCase only] [Import path filter]
38
+ npx @gld5000-cli/dependency-finder [Component directory] [Dependents paths] [File ignore patterns] [PascalCase only] [Import path includes]
39
39
  ```
40
40
 
41
41
  ### Arguments
@@ -46,7 +46,7 @@ npx @gld5000-cli/dependency-finder [Component directory] [Dependents paths] [Fil
46
46
  | **Dependents paths** | Pipe-separated glob patterns for where to search for imports | `./components/**/*.tsx\|./pages/**/*.tsx` | `./src/**/*.tsx\|./app/**/*.ts` |
47
47
  | **File ignore patterns** | Pipe-separated patterns to exclude from analysis | `.test\|.stories` | `.test\|.spec\|.mock` |
48
48
  | **PascalCase only** | Filter exports to PascalCase names only (React components) | `y` | `y` or `n` |
49
- | **Import path filter** | Filter imports to only those containing this substring | (none) | `folder-a` or `@components` |
49
+ | **Import path includes** | Filter imports to only those containing this substring | (none) | `folder-a` or `@components` |
50
50
 
51
51
  ### Example Usage
52
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gld5000-cli/dependency-finder",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Finds how many dependents your components have.",
5
5
  "keywords": [
6
6
  "CLI",
@@ -7,7 +7,7 @@ export function findDependentsInTargetPaths(
7
7
  componentObjectArray,
8
8
  targetPaths,
9
9
  ignorePatterns,
10
- importPathSubstring,
10
+ importPathIncludes,
11
11
  ) {
12
12
  return targetPaths.reduce(targetPathReducer, componentObjectArray);
13
13
  /**
@@ -67,13 +67,13 @@ export function findDependentsInTargetPaths(
67
67
  ),
68
68
  )
69
69
  .filter((currentString) => {
70
- // console.log("importPathSubstring", importPathSubstring);
70
+ // console.log("importPathIncludes", importPathIncludes);
71
71
  // console.log("currentsSring", currentString);
72
72
  return (
73
- (currentString.length > 0 && !importPathSubstring) ||
74
- (importPathSubstring &&
73
+ (currentString.length > 0 && !importPathIncludes) ||
74
+ (importPathIncludes &&
75
75
  currentString.length > 0 &&
76
- currentString.indexOf(importPathSubstring) !== -1)
76
+ currentString.indexOf(importPathIncludes) !== -1)
77
77
  );
78
78
  });
79
79
  if (dependentsCandidates && dependentsCandidates.length > 0) {
package/src/index.mjs CHANGED
@@ -17,14 +17,14 @@ export function runDependencyFinder(
17
17
  targetPaths,
18
18
  ignorePatterns,
19
19
  isPascalCase,
20
- importPathSubstring,
20
+ importPathIncludes,
21
21
  ) {
22
22
  // Get files with TSX exports
23
23
  const allDependents = findDependentsInTargetPaths(
24
24
  findComponents(searchPattern, ignorePatterns, isPascalCase),
25
25
  targetPaths,
26
26
  ignorePatterns,
27
- importPathSubstring,
27
+ importPathIncludes,
28
28
  );
29
29
  const noDependents = filterNoDependents(allDependents);
30
30
  const someDependents = filterSomeDependents(allDependents);