@docker-doctor/cli 0.0.0
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.cjs +372 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.mts +2 -0
- package/dist/cli.mjs +368 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +99 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +99 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +9 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src-D3U-LUsr.cjs +983 -0
- package/dist/src-D3U-LUsr.cjs.map +1 -0
- package/dist/src-IXht-l0J.mjs +881 -0
- package/dist/src-IXht-l0J.mjs.map +1 -0
- package/package.json +72 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
//#region ../core/src/types/index.d.ts
|
|
4
|
+
interface DockerfileInstruction {
|
|
5
|
+
instruction: string;
|
|
6
|
+
args: string;
|
|
7
|
+
line: number;
|
|
8
|
+
raw: string;
|
|
9
|
+
}
|
|
10
|
+
interface Diagnostic {
|
|
11
|
+
file: string;
|
|
12
|
+
rule: string;
|
|
13
|
+
severity: "error" | "warning" | "info";
|
|
14
|
+
message: string;
|
|
15
|
+
help: string;
|
|
16
|
+
line?: number;
|
|
17
|
+
column?: number;
|
|
18
|
+
}
|
|
19
|
+
interface ProjectInfo {
|
|
20
|
+
dockerfiles: string[];
|
|
21
|
+
composeFiles: string[];
|
|
22
|
+
}
|
|
23
|
+
type RuleCategory = "Security" | "Performance" | "Best Practices" | "Compose" | "Image Size";
|
|
24
|
+
type RuleSeverity = "error" | "warning" | "info" | "off";
|
|
25
|
+
interface RuleDefinition {
|
|
26
|
+
key: string;
|
|
27
|
+
category: RuleCategory;
|
|
28
|
+
defaultSeverity: RuleSeverity;
|
|
29
|
+
message: string;
|
|
30
|
+
help: string;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region ../core/src/project-info/discover.d.ts
|
|
34
|
+
declare const discoverProject: (rootDir: string) => Promise<ProjectInfo>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ../core/src/parsers/dockerfile-parser.d.ts
|
|
37
|
+
declare const parseDockerfile: (content: string) => DockerfileInstruction[];
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ../core/src/parsers/compose-parser.d.ts
|
|
40
|
+
declare const parseCompose: (content: string, filepath: string) => unknown;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region ../core/src/runners/dockerfile-runner.d.ts
|
|
43
|
+
declare const runDockerfileRules: (instructions: DockerfileInstruction[], file: string, projectFiles: string[], rulesConfig?: Record<string, RuleSeverity>) => Diagnostic[];
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../core/src/runners/compose-runner.d.ts
|
|
46
|
+
declare const runComposeRules: (composeContent: unknown, file: string, rulesConfig?: Record<string, RuleSeverity>) => Diagnostic[];
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ../core/src/rules/index.d.ts
|
|
49
|
+
declare const allRules: RuleDefinition[];
|
|
50
|
+
declare const findRule: (key: string) => RuleDefinition | undefined;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region ../core/src/schemas/config.d.ts
|
|
53
|
+
declare const DockerDoctorConfigSchema: Schema.Struct<{
|
|
54
|
+
readonly categories: Schema.optional<Schema.Struct<{
|
|
55
|
+
readonly "Best Practices": Schema.optional<Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>;
|
|
56
|
+
readonly Compose: Schema.optional<Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>;
|
|
57
|
+
readonly "Image Size": Schema.optional<Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>;
|
|
58
|
+
readonly Performance: Schema.optional<Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>;
|
|
59
|
+
readonly Security: Schema.optional<Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>;
|
|
60
|
+
}>>;
|
|
61
|
+
readonly ignore: Schema.optional<Schema.Struct<{
|
|
62
|
+
readonly files: Schema.optional<Schema.$Array<Schema.String>>;
|
|
63
|
+
}>>;
|
|
64
|
+
readonly rules: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.Literal<"error">, Schema.Literal<"warning">, Schema.Literal<"info">, Schema.Literal<"off">]>>>;
|
|
65
|
+
}>;
|
|
66
|
+
type DockerDoctorConfig = Schema.Schema.Type<typeof DockerDoctorConfigSchema>;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../core/src/config/loader.d.ts
|
|
69
|
+
declare const loadConfig: (rootDir: string, customPath?: string) => Promise<DockerDoctorConfig>;
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region ../core/src/scoring.d.ts
|
|
72
|
+
declare const calculateScore: (diagnostics: Diagnostic[]) => {
|
|
73
|
+
score: number;
|
|
74
|
+
label: string;
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region ../core/src/report.d.ts
|
|
78
|
+
interface JsonReport {
|
|
79
|
+
diagnostics: {
|
|
80
|
+
column?: number;
|
|
81
|
+
file: string;
|
|
82
|
+
help: string;
|
|
83
|
+
line?: number;
|
|
84
|
+
message: string;
|
|
85
|
+
rule: string;
|
|
86
|
+
severity: "error" | "warning" | "info";
|
|
87
|
+
}[];
|
|
88
|
+
label: string;
|
|
89
|
+
project: ProjectInfo;
|
|
90
|
+
score: number;
|
|
91
|
+
timestamp: string;
|
|
92
|
+
}
|
|
93
|
+
declare const toJsonReport: (diagnostics: Diagnostic[], score: number, label: string, project: ProjectInfo) => JsonReport;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/index.d.ts
|
|
96
|
+
declare const version: string;
|
|
97
|
+
//#endregion
|
|
98
|
+
export { type Diagnostic, type RuleSeverity, allRules, calculateScore, discoverProject, findRule, loadConfig, parseCompose, parseDockerfile, runComposeRules, runDockerfileRules, toJsonReport, version };
|
|
99
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/types/index.ts","../../core/src/project-info/discover.ts","../../core/src/parsers/dockerfile-parser.ts","../../core/src/parsers/compose-parser.ts","../../core/src/runners/dockerfile-runner.ts","../../core/src/runners/compose-runner.ts","../../core/src/rules/index.ts","../../core/src/schemas/config.ts","../../core/src/config/loader.ts","../../core/src/scoring.ts","../../core/src/report.ts","../src/index.ts"],"mappings":";;;UAAiB;EACf;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;;KAUU;KAMA;UAEK;EACf;EACA,UAAU;EACV,iBAAiB;EACjB;EACA;;;;cCVW,kBACX,oBACC,QAAQ;;;cChCE,kBAAmB,oBAAkB;;;cCErC,eAAgB,iBAAiB;;;cCGjC,qBACX,cAAc,yBACd,cACA,wBACA,cAAc,eAAe,kBAC5B;;;cCTU,kBACX,yBACA,cACA,cAAc,eAAe,kBAC5B;;;cCaU,UAAU;cAKV,WAAY,gBAAc;;;cChB1B,0BAAwB,OAAA;;;;;;;;;;;;;KAkBzB,qBAAqB,OAAO,OAAO,YACtC;;;cCcI,aACX,iBACA,wBACC,QAAQ;;;cC3CE,iBACX,aAAa;EAEb;EACA;;;;UCJe;EACf;IACE;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF;EACA,SAAS;EACT;EACA;;cAGW,eACX,aAAa,cACb,eACA,eACA,SAAS,gBACR;;;cCPY"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as runDockerfileRules, c as parseCompose, d as package_default, i as runComposeRules, l as parseDockerfile, n as calculateScore, o as allRules, r as loadConfig, s as findRule, t as toJsonReport, u as discoverProject } from "./src-IXht-l0J.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const { version } = package_default;
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
export { allRules, calculateScore, discoverProject, findRule, loadConfig, parseCompose, parseDockerfile, runComposeRules, runDockerfileRules, toJsonReport, version };
|
|
9
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["packageJson"],"sources":["../src/index.ts"],"sourcesContent":["import packageJson from \"../package.json\" with { type: \"json\" };\n\n// Re-export core programmatic API\nexport {\n discoverProject,\n parseDockerfile,\n parseCompose,\n runDockerfileRules,\n runComposeRules,\n calculateScore,\n loadConfig,\n allRules,\n findRule,\n toJsonReport,\n} from \"@docker-doctor/core\";\nexport type { Diagnostic, RuleSeverity } from \"@docker-doctor/core\";\nexport const { version } = packageJson;\n"],"mappings":";;;;AAgBA,MAAa,EAAE,YAAYA"}
|