@ihyeon/error-to-test 0.1.1 → 0.1.3

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/README.ko.md CHANGED
@@ -6,6 +6,7 @@ SDK에서 내보낸 브라우저 오류 로그 또는 **직접 입력한 오류
6
6
 
7
7
  ```sh
8
8
  npm install -g @ihyeon/error-to-test
9
+ error-to-test --version
9
10
  error-to-test analyze --error "TypeError: item is undefined" --page /items --out ./new-result
10
11
  ```
11
12
 
@@ -26,7 +27,7 @@ node bin/error-to-test.mjs analyze --input examples/errors.json --profile exampl
26
27
 
27
28
  결과는 `analysis.json`, `report.md`, `flows/error-to-test.md`, `cases/error-to-test.json`, `provenance.json`입니다. 빈 조회 결과에는 suite를 만들지 않습니다. 출력 폴더는 매번 새 경로를 지정해야 합니다.
28
29
 
29
- `report.md`에서 오류 묶음·수집 건수·부족한 정보를 확인하세요. 재현 단계와 정상 기대 결과, 명시적인 assertion이 없으면 질문이 있는 TC를 생성합니다. 직접 입력한 보고서에는 실제 발생 시각·사용자 수를 만들어 넣지 않습니다. 수집 건수도 실제 발생률을 뜻하지 않으며, 원본 내보내기의 일부 데이터 표시를 유지합니다.
30
+ `report.md`에서 오류 묶음·수집 건수와 함께 재현 방법·사전 조건·테스트 단계·부족한 정보를 확인하세요. 재현 단계와 정상 기대 결과, 명시적인 assertion이 없으면 질문이 있는 TC를 생성합니다. 직접 입력한 보고서에는 실제 발생 시각·사용자 수를 만들어 넣지 않습니다. 수집 건수도 실제 발생률을 뜻하지 않으며, 원본 내보내기의 일부 데이터 표시를 유지합니다.
30
31
 
31
32
  기본 suite는 검토 질문으로 실행이 차단됩니다. TC와 프로필을 확인한 뒤 다른 출력 폴더에 `--reviewed`로 다시 생성하면 검토 질문만 제거됩니다. 나머지 질문은 그대로 실행을 차단합니다. 프로필의 `setupConfirmed`는 준비 조건을 확인했다는 표시이며, 계정·데이터를 자동으로 준비하는 기능은 아닙니다.
32
33
 
package/README.md CHANGED
@@ -10,6 +10,7 @@ Turn captured browser errors **or a pasted error report** into grouped issues, r
10
10
 
11
11
  ```sh
12
12
  npm install -g @ihyeon/error-to-test
13
+ error-to-test --version
13
14
  error-to-test analyze --error "TypeError: item is undefined" --page /items --out ./new-result
14
15
  ```
15
16
 
@@ -60,7 +61,7 @@ Supported web steps match Flow QA: `open`, `click`, `fill`, `act`, `assertVisibl
60
61
  Generated files (Flow QA source is limited to 128 KB; suite JSON to 512 KiB):
61
62
 
62
63
  - `analysis.json`: coverage, ranked groups, safe representative evidence, full-source context checks, and TC candidates.
63
- - `report.md`: human-readable analysis and missing context.
64
+ - `report.md`: human-readable analysis, reported reproduction, preconditions, proposed test steps, and missing context.
64
65
  - `flows/error-to-test.md`: observed facts, requirements, steps, and questions.
65
66
  - `cases/error-to-test.json`: Flow QA `suite-1` (omitted when no records match).
66
67
  - `provenance.json`: source/profile/analysis/report/flow/suite hashes and event → group → case mappings.
package/dist/artifacts.js CHANGED
@@ -25,7 +25,7 @@ export function renderReport(analysis) {
25
25
  for (const group of analysis.groups) {
26
26
  lines.push(`## ${group.id}`, '', `Records: ${group.count} · Observed page views: ${group.viewCount} · Last observed: ${group.lastOccurredAt ?? 'unknown'}`, '', literal(`${group.project} / ${group.environment} / ${group.release} / ${group.runtime}\n${group.type} ${group.pagePath}\n${group.message}`), '');
27
27
  for (const candidate of analysis.candidates.filter(item => item.groupId === group.id)) {
28
- lines.push(`### ${candidate.id} · ${candidate.state}`, '', literal(candidate.title), '', 'Observed facts:', literal(candidate.facts.join('\n')), '', 'Expected behavior:', literal(candidate.expected ? `${candidate.expected.text}\nSource: ${candidate.expected.source}` : 'Unresolved'), '', 'Questions:', literal(candidate.questions.join('\n') || 'No context questions. Review is still required before execution.'), '');
28
+ lines.push(`### ${candidate.id} · ${candidate.state}`, '', literal(candidate.title), '', 'Observed facts:', literal(candidate.facts.join('\n')), '', 'Reported reproduction:', literal(candidate.reproduction.join('\n') || 'Not supplied'), '', 'Preconditions:', literal(candidate.preconditions.join('\n') || 'Not supplied'), '', 'Proposed test steps:', literal(candidate.steps.length ? JSON.stringify(candidate.steps, null, 2) : 'Not supplied'), '', 'Expected behavior:', literal(candidate.expected ? `${candidate.expected.text}\nSource: ${candidate.expected.source}` : 'Unresolved'), '', 'Questions:', literal(candidate.questions.join('\n') || 'No context questions. Review is still required before execution.'), '');
29
29
  }
30
30
  }
31
31
  return `${lines.join('\n')}\n`;
package/dist/cli.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { parseArgs } from 'node:util';
2
2
  import { randomUUID } from 'node:crypto';
3
+ import { readFile } from 'node:fs/promises';
3
4
  import { resolve } from 'node:path';
4
5
  import { analyzeErrors } from "./analysis.js";
5
6
  import { readBoundedFile, verifyBundle, writeBundle } from "./artifacts.js";
@@ -34,6 +35,7 @@ Options:
34
35
  --out DIRECTORY New directory; existing files are never overwritten
35
36
  --reviewed Acknowledge review; unresolved questions still block cases
36
37
  --report FILE Normalized Flow QA report (link-run only)
38
+ --version, -v Print the package version
37
39
 
38
40
  No model call or browser execution occurs. Review report.md and cases/error-to-test.json first.
39
41
  Use a local file or stdin for private errors; avoid secrets in shell history.
@@ -54,14 +56,23 @@ async function stdinText() {
54
56
  }
55
57
  export async function main(args = process.argv.slice(2)) {
56
58
  const { values, positionals } = parseArgs({ args, allowPositionals: true, strict: true, options: {
57
- help: { type: 'boolean', short: 'h' }, input: { type: 'string' }, error: { type: 'string' }, report: { type: 'string' },
59
+ help: { type: 'boolean', short: 'h' }, version: { type: 'boolean', short: 'v' }, input: { type: 'string' }, error: { type: 'string' }, report: { type: 'string' },
58
60
  format: { type: 'string' }, profile: { type: 'string' }, project: { type: 'string' }, environment: { type: 'string' },
59
61
  release: { type: 'string' }, page: { type: 'string' }, type: { type: 'string' }, runtime: { type: 'string' }, from: { type: 'string' }, to: { type: 'string' },
60
62
  top: { type: 'string' }, out: { type: 'string' }, reviewed: { type: 'boolean' },
61
63
  reproduce: { type: 'string', multiple: true }, precondition: { type: 'string', multiple: true },
62
64
  expected: { type: 'string' }, 'expected-source': { type: 'string' },
63
65
  } });
64
- if (values.help || positionals.length === 0) {
66
+ if (values.help) {
67
+ process.stdout.write(help);
68
+ return;
69
+ }
70
+ if (values.version) {
71
+ const manifest = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
72
+ process.stdout.write(`${manifest.version}\n`);
73
+ return;
74
+ }
75
+ if (positionals.length === 0) {
65
76
  process.stdout.write(help);
66
77
  return;
67
78
  }
package/package.json CHANGED
@@ -1,19 +1,51 @@
1
1
  {
2
2
  "name": "@ihyeon/error-to-test",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Turn captured browser errors and pasted error reports into traceable regression test candidates.",
5
5
  "license": "MIT",
6
6
  "author": "Hyeonse Im",
7
- "repository": { "type": "git", "url": "git+https://github.com/hyeonse-swing/error-to-test.git" },
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/hyeonse-swing/error-to-test.git"
10
+ },
8
11
  "homepage": "https://github.com/hyeonse-swing/error-to-test#readme",
9
- "bugs": { "url": "https://github.com/hyeonse-swing/error-to-test/issues" },
10
- "keywords": ["browser-errors", "regression-testing", "test-cases", "qa", "cli", "flow-qa"],
11
- "publishConfig": { "access": "public", "tag": "latest", "registry": "https://registry.npmjs.org" },
12
+ "bugs": {
13
+ "url": "https://github.com/hyeonse-swing/error-to-test/issues"
14
+ },
15
+ "keywords": [
16
+ "browser-errors",
17
+ "regression-testing",
18
+ "test-cases",
19
+ "qa",
20
+ "cli",
21
+ "flow-qa"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public",
25
+ "tag": "latest",
26
+ "registry": "https://registry.npmjs.org"
27
+ },
12
28
  "type": "module",
13
- "engines": { "node": ">=24.8.0" },
14
- "exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
15
- "bin": { "error-to-test": "bin/error-to-test.mjs" },
16
- "files": ["dist", "bin/error-to-test.mjs", "docs", "examples", "README.ko.md", "LICENSE"],
29
+ "engines": {
30
+ "node": ">=24.8.0"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js"
36
+ }
37
+ },
38
+ "bin": {
39
+ "error-to-test": "bin/error-to-test.mjs"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "bin/error-to-test.mjs",
44
+ "docs",
45
+ "examples",
46
+ "README.ko.md",
47
+ "LICENSE"
48
+ ],
17
49
  "scripts": {
18
50
  "build": "tsc",
19
51
  "typecheck": "tsc --noEmit",
@@ -24,5 +56,8 @@
24
56
  "smoke:flowqa": "node scripts/flowqa-smoke.ts",
25
57
  "demo": "node bin/dev.mjs analyze --input examples/errors.json --profile examples/profile.json --out .error-to-test/demo"
26
58
  },
27
- "devDependencies": { "@types/node": "^24.0.0", "typescript": "5.9.3" }
59
+ "devDependencies": {
60
+ "@types/node": "^24.0.0",
61
+ "typescript": "5.9.3"
62
+ }
28
63
  }