@akanjs/devkit 0.0.143 → 0.0.145

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.
@@ -0,0 +1,109 @@
1
+ import { ESLint, type Linter as ESLintLinter } from "eslint";
2
+ export declare class Linter {
3
+ #private;
4
+ lintRoot: string;
5
+ constructor(cwdPath: string);
6
+ lint(filePath: string, { fix, dryRun }?: {
7
+ fix?: boolean;
8
+ dryRun?: boolean;
9
+ }): Promise<{
10
+ fixed: boolean;
11
+ output?: string;
12
+ results: ESLint.LintResult[];
13
+ errors: ESLintLinter.LintMessage[];
14
+ warnings: ESLintLinter.LintMessage[];
15
+ }>;
16
+ /**
17
+ * Lint a single file using ESLint
18
+ * @param filePath - Path to the file to lint
19
+ * @returns Array of ESLint results
20
+ */
21
+ lintFile(filePath: string): Promise<{
22
+ fixed: boolean;
23
+ output?: string;
24
+ results: ESLint.LintResult[];
25
+ errors: ESLintLinter.LintMessage[];
26
+ warnings: ESLintLinter.LintMessage[];
27
+ }>;
28
+ /**
29
+ * Format lint results for console output
30
+ * @param results - Array of ESLint results
31
+ * @returns Formatted string
32
+ */
33
+ formatLintResults(results: ESLint.LintResult[]): string;
34
+ /**
35
+ * Get detailed lint information
36
+ * @param filePath - Path to the file to lint
37
+ * @returns Object containing detailed lint information
38
+ */
39
+ getDetailedLintInfo(filePath: string): Promise<{
40
+ results: ESLint.LintResult[];
41
+ details: {
42
+ line: number;
43
+ column: number;
44
+ message: string;
45
+ ruleId: string | null;
46
+ severity: "error" | "warning";
47
+ fix?: {
48
+ range: [number, number];
49
+ text: string;
50
+ };
51
+ suggestions?: {
52
+ desc: string;
53
+ fix: {
54
+ range: [number, number];
55
+ text: string;
56
+ };
57
+ }[];
58
+ }[];
59
+ stats: {
60
+ errorCount: number;
61
+ warningCount: number;
62
+ fixableErrorCount: number;
63
+ fixableWarningCount: number;
64
+ };
65
+ }>;
66
+ /**
67
+ * Check if a file has lint errors
68
+ * @param filePath - Path to the file to check
69
+ * @returns true if there are no errors, false otherwise
70
+ */
71
+ hasNoLintErrors(filePath: string): Promise<boolean>;
72
+ /**
73
+ * Get only error messages (excluding warnings)
74
+ * @param filePath - Path to the file to lint
75
+ * @returns Array of error messages
76
+ */
77
+ getErrors(filePath: string): Promise<ESLintLinter.LintMessage[]>;
78
+ /**
79
+ * Get only warning messages
80
+ * @param filePath - Path to the file to lint
81
+ * @returns Array of warning messages
82
+ */
83
+ getWarnings(filePath: string): Promise<ESLintLinter.LintMessage[]>;
84
+ /**
85
+ * Fix lint errors automatically
86
+ * @param filePath - Path to the file to fix
87
+ * @param dryRun - If true, returns the fixed content without writing to file
88
+ * @returns Fixed content and remaining issues
89
+ */
90
+ fixFile(filePath: string, dryRun?: boolean): Promise<{
91
+ fixed: boolean;
92
+ output?: string;
93
+ results: ESLint.LintResult[];
94
+ errors: ESLintLinter.LintMessage[];
95
+ warnings: ESLintLinter.LintMessage[];
96
+ }>;
97
+ /**
98
+ * Get ESLint configuration for a file
99
+ * @param filePath - Path to the file
100
+ * @returns ESLint configuration object
101
+ */
102
+ getConfigForFile(filePath: string): Promise<unknown>;
103
+ /**
104
+ * Get rules that are causing errors in a file
105
+ * @param filePath - Path to the file to check
106
+ * @returns Object mapping rule IDs to their error counts
107
+ */
108
+ getProblematicRules(filePath: string): Promise<Record<string, number>>;
109
+ }
@@ -0,0 +1,13 @@
1
+ import type { GuideGenerateJson } from "./guideline";
2
+ interface FileUpdateRequestProps {
3
+ context: string;
4
+ request: string;
5
+ }
6
+ export declare class Prompter {
7
+ static selectGuideline(): Promise<string>;
8
+ static getGuideJson(guideName: string): Promise<GuideGenerateJson>;
9
+ static getInstruction(guideName: string): Promise<string>;
10
+ makeTsFileUpdatePrompt({ context, request }: FileUpdateRequestProps): Promise<string>;
11
+ getDocumentation(guideName: string): Promise<string>;
12
+ }
13
+ export {};
@@ -0,0 +1,49 @@
1
+ import * as ts from "typescript";
2
+ import type { Executor } from "./executors";
3
+ export declare class TypeChecker {
4
+ #private;
5
+ readonly configPath: string;
6
+ readonly configFile: {
7
+ config?: any;
8
+ error?: ts.Diagnostic;
9
+ };
10
+ readonly config: ts.ParsedCommandLine;
11
+ constructor(executor: Executor);
12
+ /**
13
+ * Type-check a single TypeScript file
14
+ * @param filePath - Path to the TypeScript file to check
15
+ * @returns Array of diagnostic messages
16
+ */
17
+ check(filePath: string): {
18
+ diagnostics: ts.Diagnostic[];
19
+ errors: ts.Diagnostic[];
20
+ warnings: ts.Diagnostic[];
21
+ };
22
+ /**
23
+ * Format diagnostics for console output
24
+ * @param diagnostics - Array of TypeScript diagnostics
25
+ * @returns Formatted string
26
+ */
27
+ formatDiagnostics(diagnostics: ts.Diagnostic[]): string;
28
+ /**
29
+ * Get detailed diagnostic information with code snippet
30
+ * @param filePath - Path to the TypeScript file to check
31
+ * @returns Object containing diagnostics and detailed information
32
+ */
33
+ getDetailedDiagnostics(filePath: string): {
34
+ diagnostics: ts.Diagnostic[];
35
+ details: {
36
+ line: number;
37
+ column: number;
38
+ message: string;
39
+ code: number;
40
+ codeSnippet?: string;
41
+ }[];
42
+ };
43
+ /**
44
+ * Check if a file has type errors
45
+ * @param filePath - Path to the TypeScript file to check
46
+ * @returns true if there are no type errors, false otherwise
47
+ */
48
+ hasNoTypeErrors(filePath: string): boolean;
49
+ }
package/src/types.d.ts CHANGED
@@ -24,3 +24,7 @@ export interface TsConfigJson {
24
24
  path: string;
25
25
  }[];
26
26
  }
27
+ export interface FileContent {
28
+ filePath: string;
29
+ content: string;
30
+ }
@@ -1,4 +1,4 @@
1
- export declare const uploadRelease: (projectName: string, { workspaceRoot, environment, buildNum, platformVersion, local, }: {
1
+ export declare const uploadRelease: (appName: string, { workspaceRoot, environment, buildNum, platformVersion, local, }: {
2
2
  workspaceRoot: string;
3
3
  environment: string;
4
4
  buildNum: number;