@aiready/doc-drift 0.9.5 → 0.11.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/.turbo/turbo-build.log +10 -52
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +4 -4
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +62 -0
- package/dist/index.mjs +64 -0
- package/package.json +4 -4
- package/src/index.ts +7 -0
- package/src/provider.ts +74 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/doc-drift@0.
|
|
3
|
+
> @aiready/doc-drift@0.10.0 build /Users/pengcao/projects/aiready/packages/doc-drift
|
|
4
4
|
> tsup src/index.ts src/cli.ts --format cjs,esm --dts
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,58 +9,16 @@
|
|
|
9
9
|
[34mCLI[39m Target: es2020
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[34mESM[39m Build start
|
|
12
|
-
|
|
13
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json] [90m9:38:41 pm[39m
|
|
14
|
-
|
|
15
|
-
package.json:33:6:
|
|
16
|
-
[37m 33 │ [32m"types"[37m: "./dist/index.d.ts"
|
|
17
|
-
╵ [32m~~~~~~~[0m
|
|
18
|
-
|
|
19
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
20
|
-
|
|
21
|
-
package.json:31:6:
|
|
22
|
-
[37m 31 │ [32m"import"[37m: "./dist/index.mjs",
|
|
23
|
-
╵ [32m~~~~~~~~[0m
|
|
24
|
-
|
|
25
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
26
|
-
|
|
27
|
-
package.json:32:6:
|
|
28
|
-
[37m 32 │ [32m"require"[37m: "./dist/index.js",
|
|
29
|
-
╵ [32m~~~~~~~~~[0m
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
[43m[30m WARN [39m[49m [33m▲ [43;33m[[43;30mWARNING[43;33m][0m [1mThe condition "types" here will never be used as it comes after both "import" and "require"[0m [package.json] [90m9:38:41 pm[39m
|
|
35
|
-
|
|
36
|
-
package.json:33:6:
|
|
37
|
-
[37m 33 │ [32m"types"[37m: "./dist/index.d.ts"
|
|
38
|
-
╵ [32m~~~~~~~[0m
|
|
39
|
-
|
|
40
|
-
The "import" condition comes earlier and will be used for all "import" statements:
|
|
41
|
-
|
|
42
|
-
package.json:31:6:
|
|
43
|
-
[37m 31 │ [32m"import"[37m: "./dist/index.mjs",
|
|
44
|
-
╵ [32m~~~~~~~~[0m
|
|
45
|
-
|
|
46
|
-
The "require" condition comes earlier and will be used for all "require" calls:
|
|
47
|
-
|
|
48
|
-
package.json:32:6:
|
|
49
|
-
[37m 32 │ [32m"require"[37m: "./dist/index.js",
|
|
50
|
-
╵ [32m~~~~~~~~~[0m
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
[32mCJS[39m [1mdist/index.js [22m[32m5.57 KB[39m
|
|
55
|
-
[32mCJS[39m [1mdist/cli.js [22m[32m7.60 KB[39m
|
|
56
|
-
[32mCJS[39m ⚡️ Build success in 92ms
|
|
57
|
-
[32mESM[39m [1mdist/chunk-CGSYYULO.mjs [22m[32m4.85 KB[39m
|
|
58
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m88.00 B[39m
|
|
59
12
|
[32mESM[39m [1mdist/cli.mjs [22m[32m1.39 KB[39m
|
|
60
|
-
[32mESM[39m
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m1.63 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/chunk-CGSYYULO.mjs [22m[32m4.85 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 44ms
|
|
16
|
+
[32mCJS[39m [1mdist/cli.js [22m[32m7.60 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js [22m[32m7.21 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 44ms
|
|
61
19
|
DTS Build start
|
|
62
|
-
DTS ⚡️ Build success in
|
|
20
|
+
DTS ⚡️ Build success in 2730ms
|
|
63
21
|
DTS dist/cli.d.ts 108.00 B
|
|
64
|
-
DTS dist/index.d.ts
|
|
22
|
+
DTS dist/index.d.ts 1.07 KB
|
|
65
23
|
DTS dist/cli.d.mts 108.00 B
|
|
66
|
-
DTS dist/index.d.mts
|
|
24
|
+
DTS dist/index.d.mts 1.07 KB
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @aiready/doc-drift@0.
|
|
3
|
+
> @aiready/doc-drift@0.10.0 test /Users/pengcao/projects/aiready/packages/doc-drift
|
|
4
4
|
> vitest run
|
|
5
5
|
|
|
6
6
|
[?25l
|
|
7
7
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/Users/pengcao/projects/aiready/packages/doc-drift[39m
|
|
8
8
|
|
|
9
|
-
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
9
|
+
[32m✓[39m src/__tests__/analyzer.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
10
10
|
|
|
11
11
|
[2m Test Files [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
12
12
|
[2m Tests [22m [1m[32m1 passed[39m[22m[90m (1)[39m
|
|
13
|
-
[2m Start at [22m
|
|
14
|
-
[2m Duration [22m
|
|
13
|
+
[2m Start at [22m 09:33:04
|
|
14
|
+
[2m Duration [22m 442ms[2m (transform 132ms, setup 0ms, import 317ms, tests 19ms, environment 0ms)[22m
|
|
15
15
|
|
|
16
16
|
[?25h
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { Issue, IssueType, ScanOptions } from '@aiready/core';
|
|
1
|
+
import { ToolProvider, Issue, IssueType, ScanOptions } from '@aiready/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Documentation Drift Tool Provider
|
|
5
|
+
*/
|
|
6
|
+
declare const DocDriftProvider: ToolProvider;
|
|
2
7
|
|
|
3
8
|
interface DocDriftOptions extends ScanOptions {
|
|
4
9
|
/** Maximum commit distance to check for drift */
|
|
@@ -28,4 +33,4 @@ interface DocDriftReport {
|
|
|
28
33
|
|
|
29
34
|
declare function analyzeDocDrift(options: DocDriftOptions): Promise<DocDriftReport>;
|
|
30
35
|
|
|
31
|
-
export { type DocDriftIssue, type DocDriftOptions, type DocDriftReport, analyzeDocDrift };
|
|
36
|
+
export { type DocDriftIssue, type DocDriftOptions, DocDriftProvider, type DocDriftReport, analyzeDocDrift };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { Issue, IssueType, ScanOptions } from '@aiready/core';
|
|
1
|
+
import { ToolProvider, Issue, IssueType, ScanOptions } from '@aiready/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Documentation Drift Tool Provider
|
|
5
|
+
*/
|
|
6
|
+
declare const DocDriftProvider: ToolProvider;
|
|
2
7
|
|
|
3
8
|
interface DocDriftOptions extends ScanOptions {
|
|
4
9
|
/** Maximum commit distance to check for drift */
|
|
@@ -28,4 +33,4 @@ interface DocDriftReport {
|
|
|
28
33
|
|
|
29
34
|
declare function analyzeDocDrift(options: DocDriftOptions): Promise<DocDriftReport>;
|
|
30
35
|
|
|
31
|
-
export { type DocDriftIssue, type DocDriftOptions, type DocDriftReport, analyzeDocDrift };
|
|
36
|
+
export { type DocDriftIssue, type DocDriftOptions, DocDriftProvider, type DocDriftReport, analyzeDocDrift };
|
package/dist/index.js
CHANGED
|
@@ -20,9 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
DocDriftProvider: () => DocDriftProvider,
|
|
23
24
|
analyzeDocDrift: () => analyzeDocDrift
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
|
+
var import_core3 = require("@aiready/core");
|
|
28
|
+
|
|
29
|
+
// src/provider.ts
|
|
30
|
+
var import_core2 = require("@aiready/core");
|
|
26
31
|
|
|
27
32
|
// src/analyzer.ts
|
|
28
33
|
var import_core = require("@aiready/core");
|
|
@@ -150,7 +155,64 @@ async function analyzeDocDrift(options) {
|
|
|
150
155
|
recommendations: riskResult.recommendations
|
|
151
156
|
};
|
|
152
157
|
}
|
|
158
|
+
|
|
159
|
+
// src/provider.ts
|
|
160
|
+
var DocDriftProvider = {
|
|
161
|
+
id: import_core2.ToolName.DocDrift,
|
|
162
|
+
alias: ["doc-drift", "docs", "jsdoc"],
|
|
163
|
+
async analyze(options) {
|
|
164
|
+
const report = await analyzeDocDrift(options);
|
|
165
|
+
const fileIssuesMap = /* @__PURE__ */ new Map();
|
|
166
|
+
for (const issue of report.issues) {
|
|
167
|
+
const file = issue.location.file;
|
|
168
|
+
if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
|
|
169
|
+
fileIssuesMap.get(file).push(issue);
|
|
170
|
+
}
|
|
171
|
+
const results = Array.from(fileIssuesMap.entries()).map(
|
|
172
|
+
([fileName, issues]) => ({
|
|
173
|
+
fileName,
|
|
174
|
+
issues,
|
|
175
|
+
metrics: {}
|
|
176
|
+
})
|
|
177
|
+
);
|
|
178
|
+
return import_core2.SpokeOutputSchema.parse({
|
|
179
|
+
results,
|
|
180
|
+
summary: report.summary,
|
|
181
|
+
metadata: {
|
|
182
|
+
toolName: import_core2.ToolName.DocDrift,
|
|
183
|
+
version: "0.9.5",
|
|
184
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
185
|
+
rawData: report.rawData
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
score(output, options) {
|
|
190
|
+
const summary = output.summary;
|
|
191
|
+
const rawData = output.metadata?.rawData || {};
|
|
192
|
+
return {
|
|
193
|
+
toolName: import_core2.ToolName.DocDrift,
|
|
194
|
+
score: summary.score || 0,
|
|
195
|
+
rawMetrics: {
|
|
196
|
+
...summary,
|
|
197
|
+
...rawData
|
|
198
|
+
},
|
|
199
|
+
factors: [],
|
|
200
|
+
recommendations: (summary.recommendations || []).map(
|
|
201
|
+
(action) => ({
|
|
202
|
+
action,
|
|
203
|
+
estimatedImpact: 5,
|
|
204
|
+
priority: "medium"
|
|
205
|
+
})
|
|
206
|
+
)
|
|
207
|
+
};
|
|
208
|
+
},
|
|
209
|
+
defaultWeight: 8
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// src/index.ts
|
|
213
|
+
import_core3.ToolRegistry.register(DocDriftProvider);
|
|
153
214
|
// Annotate the CommonJS export names for ESM import in node:
|
|
154
215
|
0 && (module.exports = {
|
|
216
|
+
DocDriftProvider,
|
|
155
217
|
analyzeDocDrift
|
|
156
218
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeDocDrift
|
|
3
3
|
} from "./chunk-CGSYYULO.mjs";
|
|
4
|
+
|
|
5
|
+
// src/index.ts
|
|
6
|
+
import { ToolRegistry } from "@aiready/core";
|
|
7
|
+
|
|
8
|
+
// src/provider.ts
|
|
9
|
+
import {
|
|
10
|
+
ToolName,
|
|
11
|
+
SpokeOutputSchema
|
|
12
|
+
} from "@aiready/core";
|
|
13
|
+
var DocDriftProvider = {
|
|
14
|
+
id: ToolName.DocDrift,
|
|
15
|
+
alias: ["doc-drift", "docs", "jsdoc"],
|
|
16
|
+
async analyze(options) {
|
|
17
|
+
const report = await analyzeDocDrift(options);
|
|
18
|
+
const fileIssuesMap = /* @__PURE__ */ new Map();
|
|
19
|
+
for (const issue of report.issues) {
|
|
20
|
+
const file = issue.location.file;
|
|
21
|
+
if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
|
|
22
|
+
fileIssuesMap.get(file).push(issue);
|
|
23
|
+
}
|
|
24
|
+
const results = Array.from(fileIssuesMap.entries()).map(
|
|
25
|
+
([fileName, issues]) => ({
|
|
26
|
+
fileName,
|
|
27
|
+
issues,
|
|
28
|
+
metrics: {}
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
return SpokeOutputSchema.parse({
|
|
32
|
+
results,
|
|
33
|
+
summary: report.summary,
|
|
34
|
+
metadata: {
|
|
35
|
+
toolName: ToolName.DocDrift,
|
|
36
|
+
version: "0.9.5",
|
|
37
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
38
|
+
rawData: report.rawData
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
score(output, options) {
|
|
43
|
+
const summary = output.summary;
|
|
44
|
+
const rawData = output.metadata?.rawData || {};
|
|
45
|
+
return {
|
|
46
|
+
toolName: ToolName.DocDrift,
|
|
47
|
+
score: summary.score || 0,
|
|
48
|
+
rawMetrics: {
|
|
49
|
+
...summary,
|
|
50
|
+
...rawData
|
|
51
|
+
},
|
|
52
|
+
factors: [],
|
|
53
|
+
recommendations: (summary.recommendations || []).map(
|
|
54
|
+
(action) => ({
|
|
55
|
+
action,
|
|
56
|
+
estimatedImpact: 5,
|
|
57
|
+
priority: "medium"
|
|
58
|
+
})
|
|
59
|
+
)
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
defaultWeight: 8
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// src/index.ts
|
|
66
|
+
ToolRegistry.register(DocDriftProvider);
|
|
4
67
|
export {
|
|
68
|
+
DocDriftProvider,
|
|
5
69
|
analyzeDocDrift
|
|
6
70
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aiready/doc-drift",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "AI-Readiness: Documentation Drift Detection",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"commander": "^14.0.0",
|
|
11
11
|
"glob": "^13.0.0",
|
|
12
12
|
"picocolors": "^1.0.0",
|
|
13
|
-
"@aiready/core": "0.
|
|
13
|
+
"@aiready/core": "0.21.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^24.0.0",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"import": "./dist/index.mjs",
|
|
25
|
-
"require": "./dist/index.js"
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
26
|
+
"require": "./dist/index.js"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
import { ToolRegistry } from '@aiready/core';
|
|
2
|
+
import { DocDriftProvider } from './provider';
|
|
3
|
+
|
|
4
|
+
// Register with global registry
|
|
5
|
+
ToolRegistry.register(DocDriftProvider);
|
|
6
|
+
|
|
1
7
|
export * from './types';
|
|
2
8
|
export * from './analyzer';
|
|
9
|
+
export { DocDriftProvider };
|
package/src/provider.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ToolProvider,
|
|
3
|
+
ToolName,
|
|
4
|
+
SpokeOutput,
|
|
5
|
+
ScanOptions,
|
|
6
|
+
ToolScoringOutput,
|
|
7
|
+
AnalysisResult,
|
|
8
|
+
SpokeOutputSchema,
|
|
9
|
+
} from '@aiready/core';
|
|
10
|
+
import { analyzeDocDrift } from './analyzer';
|
|
11
|
+
import { DocDriftOptions, DocDriftIssue } from './types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Documentation Drift Tool Provider
|
|
15
|
+
*/
|
|
16
|
+
export const DocDriftProvider: ToolProvider = {
|
|
17
|
+
id: ToolName.DocDrift,
|
|
18
|
+
alias: ['doc-drift', 'docs', 'jsdoc'],
|
|
19
|
+
|
|
20
|
+
async analyze(options: ScanOptions): Promise<SpokeOutput> {
|
|
21
|
+
const report = await analyzeDocDrift(options as DocDriftOptions);
|
|
22
|
+
|
|
23
|
+
// Group issues by file for AnalysisResult format
|
|
24
|
+
const fileIssuesMap = new Map<string, DocDriftIssue[]>();
|
|
25
|
+
for (const issue of report.issues) {
|
|
26
|
+
const file = issue.location.file;
|
|
27
|
+
if (!fileIssuesMap.has(file)) fileIssuesMap.set(file, []);
|
|
28
|
+
fileIssuesMap.get(file)!.push(issue);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const results: AnalysisResult[] = Array.from(fileIssuesMap.entries()).map(
|
|
32
|
+
([fileName, issues]) => ({
|
|
33
|
+
fileName,
|
|
34
|
+
issues: issues as any[],
|
|
35
|
+
metrics: {},
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return SpokeOutputSchema.parse({
|
|
40
|
+
results,
|
|
41
|
+
summary: report.summary,
|
|
42
|
+
metadata: {
|
|
43
|
+
toolName: ToolName.DocDrift,
|
|
44
|
+
version: '0.9.5',
|
|
45
|
+
timestamp: new Date().toISOString(),
|
|
46
|
+
rawData: report.rawData,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
score(output: SpokeOutput, options: ScanOptions): ToolScoringOutput {
|
|
52
|
+
const summary = output.summary as any;
|
|
53
|
+
const rawData = (output.metadata as any)?.rawData || {};
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
toolName: ToolName.DocDrift,
|
|
57
|
+
score: summary.score || 0,
|
|
58
|
+
rawMetrics: {
|
|
59
|
+
...summary,
|
|
60
|
+
...rawData,
|
|
61
|
+
},
|
|
62
|
+
factors: [],
|
|
63
|
+
recommendations: (summary.recommendations || []).map(
|
|
64
|
+
(action: string) => ({
|
|
65
|
+
action,
|
|
66
|
+
estimatedImpact: 5,
|
|
67
|
+
priority: 'medium',
|
|
68
|
+
})
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
defaultWeight: 8,
|
|
74
|
+
};
|