@apptoolkit/harness 1.0.2 → 1.0.4
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apptoolkit/harness",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A portable harness for configuring AI coding agents and engineering workflows.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,81 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"harness.js",
|
|
12
|
-
"payload/"
|
|
12
|
+
"payload/HARNESS.md",
|
|
13
|
+
"payload/author-style/README.md",
|
|
14
|
+
"payload/author-style/biome-core.json",
|
|
15
|
+
"payload/author-style/biome-react.json",
|
|
16
|
+
"payload/author-style/biome-sql.json",
|
|
17
|
+
"payload/author-style/bun.lock",
|
|
18
|
+
"payload/author-style/check.llm.md",
|
|
19
|
+
"payload/author-style/check.test.llm.md",
|
|
20
|
+
"payload/author-style/check.test.ts",
|
|
21
|
+
"payload/author-style/check.ts",
|
|
22
|
+
"payload/author-style/member-spacing.test.ts",
|
|
23
|
+
"payload/author-style/member-spacing.ts",
|
|
24
|
+
"payload/author-style/package.json",
|
|
25
|
+
"payload/author-style/plugins/class-member-order.grit",
|
|
26
|
+
"payload/author-style/plugins/event-handler-names.grit",
|
|
27
|
+
"payload/author-style/plugins/explicit-arrow-body.grit",
|
|
28
|
+
"payload/author-style/plugins/explicit-source-constructs.grit",
|
|
29
|
+
"payload/author-style/plugins/react-arrow-body.grit",
|
|
30
|
+
"payload/author-style/plugins/sql-style.grit",
|
|
31
|
+
"payload/author-style/react-module.llm.md",
|
|
32
|
+
"payload/author-style/react-module.test.ts",
|
|
33
|
+
"payload/author-style/react-module.ts",
|
|
34
|
+
"payload/author-style/source-policy.llm.md",
|
|
35
|
+
"payload/author-style/source-policy.test.ts",
|
|
36
|
+
"payload/author-style/source-policy.ts",
|
|
37
|
+
"payload/author-style/spacing.llm.md",
|
|
38
|
+
"payload/author-style/spacing.test.ts",
|
|
39
|
+
"payload/author-style/spacing.ts",
|
|
40
|
+
"payload/harness/POLICY.md",
|
|
41
|
+
"payload/harness/PROJECT.md",
|
|
42
|
+
"payload/harness/REVIEW.md",
|
|
43
|
+
"payload/harness/TEMPLATES.md",
|
|
44
|
+
"payload/harness/WORKFLOWS.md",
|
|
45
|
+
"payload/harness/runtime/ZOD-LICENSE",
|
|
46
|
+
"payload/harness/runtime/harness.mjs",
|
|
47
|
+
"payload/harness/services/README.md",
|
|
48
|
+
"payload/harness/services/penpot.json",
|
|
49
|
+
"payload/harness/services/plane.json",
|
|
50
|
+
"payload/harness/workflows/W01.md",
|
|
51
|
+
"payload/harness/workflows/W02.md",
|
|
52
|
+
"payload/harness/workflows/W03.md",
|
|
53
|
+
"payload/harness/workflows/W04.md",
|
|
54
|
+
"payload/harness/workflows/W05.md",
|
|
55
|
+
"payload/harness/workflows/W06.md",
|
|
56
|
+
"payload/harness/workflows/W07.md",
|
|
57
|
+
"payload/harness/workflows/W08.md",
|
|
58
|
+
"payload/harness/workflows/W09.md",
|
|
59
|
+
"payload/harness/workflows/W10.md",
|
|
60
|
+
"payload/harness/workflows/W11.md",
|
|
61
|
+
"payload/harness/workflows/W12.md",
|
|
62
|
+
"payload/harness/workflows/W13.md",
|
|
63
|
+
"payload/harness/workflows/W14.md",
|
|
64
|
+
"payload/harness/workflows/W15.md",
|
|
65
|
+
"payload/harness/workflows/W16.md",
|
|
66
|
+
"payload/harness/workflows/W17.md",
|
|
67
|
+
"payload/harness/workflows/W18.md",
|
|
68
|
+
"payload/harness/workflows/W19.md",
|
|
69
|
+
"payload/harness/workflows/W20.md",
|
|
70
|
+
"payload/harness/workflows/W21.md",
|
|
71
|
+
"payload/harness/workflows/W22.md",
|
|
72
|
+
"payload/harness/workflows/W23.md",
|
|
73
|
+
"payload/harness/workflows/W24.md",
|
|
74
|
+
"payload/harness/workflows/W25.md",
|
|
75
|
+
"payload/harness/workflows/W26.md",
|
|
76
|
+
"payload/harness/workflows/W27.md",
|
|
77
|
+
"payload/harness/workflows/W28.md",
|
|
78
|
+
"payload/harness/workflows/W29.md",
|
|
79
|
+
"payload/harness/workflows/W30.md",
|
|
80
|
+
"payload/harness/workflows/W31.md",
|
|
81
|
+
"payload/harness/workflows/W32.md",
|
|
82
|
+
"payload/harness/workflows/W33.md",
|
|
83
|
+
"payload/harness/workflows/W34.md",
|
|
84
|
+
"payload/harness/workflows/W35.md",
|
|
85
|
+
"payload/harness/workflows/W36.md",
|
|
86
|
+
"payload/harness/workflows/W37.md"
|
|
13
87
|
],
|
|
14
88
|
"packageManager": "bun@1.4.2",
|
|
15
89
|
"publishConfig": {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Comments and protected headers
|
|
8
8
|
|
|
9
|
-
`hasGeneratedHeader` examines leading comment trivia. `collectComments` visits syntax tokens without mistaking JSX text and literals for comments. `sqlMarkers` identifies supported marker positions. Parsed TypeScript reference directives are handled by `findSourcePolicyIssues`.
|
|
9
|
+
`hasGeneratedHeader` examines leading comment trivia. `collectComments` visits syntax tokens without mistaking JSX text and literals for comments. `findBiomeSuppressions` uses the same comment inventory to detect Biome directives even when inherited diagnostics prevent a full style pass. `sqlMarkers` identifies supported marker positions. Parsed TypeScript reference directives are handled by `findSourcePolicyIssues`.
|
|
10
10
|
|
|
11
11
|
## Type patterns
|
|
12
12
|
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
2
|
import { test } from 'node:test';
|
|
3
|
-
import { findSourcePolicyIssues } from './source-policy.ts';
|
|
3
|
+
import { findBiomeSuppressions, findSourcePolicyIssues } from './source-policy.ts';
|
|
4
|
+
|
|
5
|
+
test('detects Biome suppressions in comments without treating string content as a directive', () => {
|
|
6
|
+
assert.deepEqual(findBiomeSuppressions('const guide = "// biome-ignore-all lint: text";', 'sample.ts'), []);
|
|
7
|
+
assert.deepEqual(findBiomeSuppressions('export const value = 1;', 'sample.ts'), []);
|
|
8
|
+
|
|
9
|
+
const source = '// biome-ignore-all lint: hidden\n/* biome-ignore lint: hidden */\nconst value = 1;\n';
|
|
10
|
+
|
|
11
|
+
assert.deepEqual(
|
|
12
|
+
findBiomeSuppressions(source, 'sample.ts').map(({ line }) => line),
|
|
13
|
+
[1, 2],
|
|
14
|
+
);
|
|
15
|
+
});
|
|
4
16
|
|
|
5
17
|
test('separates real comments from strings, regular expressions and JSX text', () => {
|
|
6
18
|
const source = [
|
|
@@ -49,6 +49,29 @@ function collectComments(file: ts.SourceFile): Map<number, number> {
|
|
|
49
49
|
return comments;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
export function findBiomeSuppressions(source: string, fileName: string): SourceIssue[] {
|
|
53
|
+
if (!source.includes('biome-ignore')) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const file = ts.createSourceFile(fileName, source, ts.ScriptTarget.Latest, true);
|
|
58
|
+
const issues: SourceIssue[] = [];
|
|
59
|
+
|
|
60
|
+
for (const [start, end] of collectComments(file)) {
|
|
61
|
+
if (/^\s*(?:\/\/|\/\*+|\*)\s*biome-ignore\b/mu.test(source.slice(start, end))) {
|
|
62
|
+
const location = file.getLineAndCharacterOfPosition(start);
|
|
63
|
+
|
|
64
|
+
issues.push({
|
|
65
|
+
line: location.line + 1,
|
|
66
|
+
column: location.character + 1,
|
|
67
|
+
message: 'Remove the Biome suppression.',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return issues;
|
|
73
|
+
}
|
|
74
|
+
|
|
52
75
|
function sqlMarkers(file: ts.SourceFile): Set<number> {
|
|
53
76
|
const markers = new Set<number>();
|
|
54
77
|
|