@ihyeon/error-to-test 0.1.2 → 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
 
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
 
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.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",