Why
resolveTarget() in src/cli/index.ts throws when the argument looks like a local path without --dir:
"..." looks like a local path. Use --dir flag: npx aeoptimize scan <path> --dir
First-time npx users hit this. There is no test that the message stays stable.
Ask
Add a failing-then-passing test around resolveTarget (or the CLI entry) for:
./dist or /tmp/site without --dir → error mentions --dir
https://example.com → treated as URL
example.com (bare domain) → treated as URL with https://
Do not change scoring. Keep the existing hint; only cover it with a test, unless the current wording is objectively wrong for one of those cases.
Pointers
src/cli/index.ts (resolveTarget)
- existing CLI / core tests under
src/
Why
resolveTarget()insrc/cli/index.tsthrows when the argument looks like a local path without--dir:First-time
npxusers hit this. There is no test that the message stays stable.Ask
Add a failing-then-passing test around
resolveTarget(or the CLI entry) for:./distor/tmp/sitewithout--dir→ error mentions--dirhttps://example.com→ treated as URLexample.com(bare domain) → treated as URL withhttps://Do not change scoring. Keep the existing hint; only cover it with a test, unless the current wording is objectively wrong for one of those cases.
Pointers
src/cli/index.ts(resolveTarget)src/