analyze-codebase 1.0.0 → 1.0.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/dist/index.js +1 -0
- package/package.json +2 -2
- package/tsconfig.json +2 -7
- package/dist/analyze/file/fileName.d.ts +0 -1
- package/dist/analyze/file/index.d.ts +0 -4
- package/dist/analyze/index.d.ts +0 -2
- package/dist/analyze/sourceCode/lineCount.d.ts +0 -12
- package/dist/index.d.ts +0 -1
- package/dist/runner.d.ts +0 -5
- package/dist/types.d.ts +0 -29
- package/dist/utils/file.d.ts +0 -9
- package/dist/utils/index.d.ts +0 -23
- package/dist/utils/output.d.ts +0 -9
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mtahagocer/analyze-codebase"
|
|
7
7
|
},
|
|
8
|
-
"version": "1.0.
|
|
8
|
+
"version": "1.0.1",
|
|
9
9
|
"main": "dist/index.js",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"bin": {
|
|
12
|
-
"analyze-project": "dist/index.js"
|
|
12
|
+
"analyze-project": "./dist/index.js"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"cli": "ts-node ./src/index.ts",
|
package/tsconfig.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const analyzeFileName: (filePath: string) => import("../../utils").NamingCase;
|
package/dist/analyze/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ICodeContentType } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Analyze the line count of the specified file
|
|
4
|
-
*/
|
|
5
|
-
export declare const analyzeLineCount: (filePath: string) => number;
|
|
6
|
-
export declare const isSingleLineComment: (line?: string) => boolean;
|
|
7
|
-
export declare const isBlockComment: (line?: string) => boolean;
|
|
8
|
-
export declare const isMixedComment: (line?: string) => boolean;
|
|
9
|
-
export declare const isEmptyBlockComment: (line?: string) => boolean;
|
|
10
|
-
export declare const isComment: (line?: string) => boolean;
|
|
11
|
-
export declare const isToDo: (line?: string) => boolean;
|
|
12
|
-
export declare const analyzeLineCountByCategory: (filePath: string, output: ICodeContentType) => ICodeContentType;
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/runner.d.ts
DELETED
package/dist/types.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface IAnalysisOptions {
|
|
2
|
-
directory: string;
|
|
3
|
-
framework?: string;
|
|
4
|
-
extensions?: string[];
|
|
5
|
-
exclude?: string[];
|
|
6
|
-
conventions?: string[];
|
|
7
|
-
checkFileNames?: boolean;
|
|
8
|
-
checkFileContent?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface IViolation {
|
|
11
|
-
filePath: string;
|
|
12
|
-
message: string;
|
|
13
|
-
type: string;
|
|
14
|
-
}
|
|
15
|
-
export interface Identifier {
|
|
16
|
-
name: string;
|
|
17
|
-
line: number;
|
|
18
|
-
}
|
|
19
|
-
export interface ICodeContentType {
|
|
20
|
-
Physical: number;
|
|
21
|
-
Source: number;
|
|
22
|
-
Comment: number;
|
|
23
|
-
SingleLineComment: number;
|
|
24
|
-
BlockComment: number;
|
|
25
|
-
Mixed: number;
|
|
26
|
-
EmptyBlockComment: number;
|
|
27
|
-
Empty: number;
|
|
28
|
-
ToDo: number;
|
|
29
|
-
}
|
package/dist/utils/file.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface ITraverseDirectoryProps {
|
|
2
|
-
directory: string;
|
|
3
|
-
exclude?: string[];
|
|
4
|
-
extensions?: string[];
|
|
5
|
-
checkFileNames?: boolean;
|
|
6
|
-
onFile: (filePath: string) => void;
|
|
7
|
-
onDirectory?: (dirPath: string) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const traverseDirectory: ({ directory, onFile, onDirectory, exclude, extensions, checkFileNames, }: ITraverseDirectoryProps) => Promise<void>;
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare enum NamingCase {
|
|
2
|
-
CamelCase = "CamelCase",
|
|
3
|
-
PascalCase = "PascalCase",
|
|
4
|
-
SnakeCase = "SnakeCase",
|
|
5
|
-
UpperCase = "UpperCase",
|
|
6
|
-
LowerCase = "LowerCase",
|
|
7
|
-
KebabCase = "KebabCase",
|
|
8
|
-
StartCase = "StartCase",
|
|
9
|
-
DotCase = "DotCase",
|
|
10
|
-
PathCase = "PathCase",
|
|
11
|
-
SpaceCase = "SpaceCase",
|
|
12
|
-
NoCase = "NoCase",
|
|
13
|
-
ConstantCase = "ConstantCase",
|
|
14
|
-
SentenceCase = "SentenceCase",
|
|
15
|
-
Unknown = "Unknown"
|
|
16
|
-
}
|
|
17
|
-
export declare const NamingCases: Record<NamingCase, RegExp>;
|
|
18
|
-
export declare const NamingCasesArray: {
|
|
19
|
-
regexp: RegExp;
|
|
20
|
-
type: NamingCase;
|
|
21
|
-
}[];
|
|
22
|
-
export declare const controlCase: (str: string, caseType: NamingCase) => boolean;
|
|
23
|
-
export declare const whatCase: (str: string) => NamingCase;
|
package/dist/utils/output.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NamingCase } from ".";
|
|
2
|
-
import { IAnalysisOptions, ICodeContentType } from "../types";
|
|
3
|
-
export interface IParams {
|
|
4
|
-
output: ICodeContentType;
|
|
5
|
-
fileCount: number;
|
|
6
|
-
options: IAnalysisOptions;
|
|
7
|
-
fileNameCases: Partial<Record<NamingCase, number>>;
|
|
8
|
-
}
|
|
9
|
-
export declare const logOutput: ({ fileCount, output, fileNameCases, options }: IParams) => void;
|