@ihyeon/error-to-test 0.1.2 → 0.1.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/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
 
@@ -13,6 +14,8 @@ JavaScript API는 `npm install @ihyeon/error-to-test`로 설치합니다. [배
13
14
 
14
15
  Node.js 24.8 이상이 필요합니다. 현재 폴더에서 `npm ci`, `npm run check`를 실행한 뒤 사용하세요.
15
16
 
17
+ 샘플은 `npm run demo`로 실행합니다. 매번 새 `.error-to-test/run-*` 폴더에 결과를 저장하고 보고서 경로를 출력합니다.
18
+
16
19
  ```sh
17
20
  # SDK 없이 오류 하나를 직접 입력
18
21
  node bin/error-to-test.mjs analyze --error "TypeError: item is undefined" --page /items --runtime browser --reproduce "View item 버튼 클릭" --expected "빈 상태 안내 표시" --expected-source "사용자가 설명한 기대 동작" --out .error-to-test/pasted
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
 
@@ -23,9 +24,11 @@ Requires Node.js 24.8+. From this directory:
23
24
  npm ci
24
25
  npm run check
25
26
  node bin/error-to-test.mjs --help
26
- node bin/error-to-test.mjs analyze --input examples/errors.json --profile examples/profile.json --out .error-to-test/example
27
+ npm run demo
27
28
  ```
28
29
 
30
+ Each demo run saves its results in a new `.error-to-test/run-*` directory and prints the report path.
31
+
29
32
  Every output directory must be new. The command never overwrites an existing analysis.
30
33
 
31
34
  ## Submit an error without an SDK
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihyeon/error-to-test",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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",
@@ -54,7 +54,7 @@
54
54
  "prepack": "npm run build",
55
55
  "check:package": "npm run build && node scripts/package-smoke.mjs",
56
56
  "smoke:flowqa": "node scripts/flowqa-smoke.ts",
57
- "demo": "node bin/dev.mjs analyze --input examples/errors.json --profile examples/profile.json --out .error-to-test/demo"
57
+ "demo": "node bin/error-to-test.mjs analyze --input examples/errors.json --profile examples/profile.json"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^24.0.0",