Background
scripts/run-single-page-translation-flow.sh is a 486-line Bash orchestration script. It cannot be type-checked, unit-tested, or linted, and it duplicates logic (path resolution, argument parsing) that already exists in the TypeScript scripts it wraps.
What to do
Convert to a TypeScript CLI script (e.g. scripts/notion-fetch-one/flow.ts) that:
- Uses the same Bun-native argument parsing pattern as other scripts in this repo
- Calls the existing TypeScript functions directly instead of shelling out
- Can be covered by Vitest tests
- Removes the need to maintain Bash-specific quoting and error-handling idioms
The new script should be invoked the same way from package.json so no external workflow changes are needed.
Background
scripts/run-single-page-translation-flow.shis a 486-line Bash orchestration script. It cannot be type-checked, unit-tested, or linted, and it duplicates logic (path resolution, argument parsing) that already exists in the TypeScript scripts it wraps.What to do
Convert to a TypeScript CLI script (e.g.
scripts/notion-fetch-one/flow.ts) that:The new script should be invoked the same way from
package.jsonso no external workflow changes are needed.