Skip to content

Commit 5445ad0

Browse files
committed
fix: add default ignore dirs
1 parent a937d78 commit 5445ad0

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

src/const.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,27 @@ export const CONFIG_FILENAME = '.coderflyrc.js';
1414
export const MATCHED_VUE = path.resolve(CODERFLY_FOLDER, 'matched_vue');
1515
export const TREE_FILE = path.resolve(CODERFLY_FOLDER, 'file_tree.json');
1616
export const REPORT_FILE = path.resolve(CODERFLY_FOLDER, 'impact_report.json');
17-
export const FILE_MODIFY_DETAIL = path.resolve(CODERFLY_FOLDER, 'file_modify_detail.json');
17+
export const FILE_MODIFY_DETAIL = path.resolve(CODERFLY_FOLDER, 'file_modify_detail.json');
18+
19+
export const IGNORE_DIRS = [
20+
'logs',
21+
'pids',
22+
'lib-cov',
23+
'coverage',
24+
'bower_components',
25+
'node_modules',
26+
'jspm_packages',
27+
'web_modules',
28+
'dist',
29+
'.rpt2_cache',
30+
'.rts2_cache_cjs',
31+
'.rts2_cache_es',
32+
'.rts2_cache_umd',
33+
'.cache',
34+
'.parcel-cache',
35+
'.vuepress',
36+
'.serverless',
37+
'.fusebox',
38+
'.dynamodb',
39+
'.yarn',
40+
];

src/utils/handle_file_utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { visit } from 'recast';
44
import { parse } from '@babel/parser';
55
import { parseComponent, compile } from '../coderfly_vue_compiler/index.js';
66
import lineByLine from 'n-readlines';
7-
import { ALLOW_EXT, CODERFLY_FOLDER, IS_TOP_SCOPE, TREE_FILE, TS_DECLARATION_EXT, UN_KNOWN } from '../const.js';
7+
import { ALLOW_EXT, CODERFLY_FOLDER, IGNORE_DIRS, IS_TOP_SCOPE, TREE_FILE, TS_DECLARATION_EXT, UN_KNOWN } from '../const.js';
88
import {
99
AllFuncsInfo,
1010
FileAstInfo,
@@ -36,7 +36,9 @@ function getAllFiles (folderPath: string): string[] {
3636
if (fs.statSync(absolutePath).isFile()) {
3737
isAllowExt(absolutePath) && fileList.push(absolutePath);
3838
} else {
39-
dfs(absolutePath);
39+
if (!IGNORE_DIRS.includes(absolutePath)) {
40+
dfs(absolutePath);
41+
}
4042
}
4143
}
4244
}

0 commit comments

Comments
 (0)