bun:test types live in 'bun-types', which is pulled in transitively by
@types/bun via a /// <reference types="bun-types" /> directive. bunx tsc
finds this via auto-discovery, but VS Code's TS Language Server doesn't
always honor auto-discovered @types/* packages under moduleResolution:
bundler, so it shows a phantom 'Cannot find module bun:test' error in
the editor.
Adding 'types': ['bun'] to compilerOptions makes the inclusion explicit
and matches what 'bun init' generates for new projects. tsc still
passes; the bun test suite still passes; the editor LSP now resolves
bun:test correctly.
src/ now contains only source code; tests live alongside it under
tests/. Bun's test runner discovers '**/*.test.ts' so no test-runner
config change is needed.
Changes:
- tests/config.test.ts (was src/config.test.ts)
- tests/configFile.test.ts (was src/configFile.test.ts)
- Imports updated: ./config.ts -> ../src/config.ts (likewise for
configFile.ts and errors.ts).
- tsconfig.json include adds 'tests/**/*.ts' so tsc type-checks
the test files too.
All 25 tests still pass; tsc clean.
Tighter type-checking: array indexing and dynamic property access now
return T | undefined rather than T. Catches bugs where code assumes a
key exists without checking.
No code changes were needed — the existing modules already either:
- cast through Record<string, unknown> (configFile.ts), where access
is already 'unknown';
- cast values from parseArgs to '... | undefined' (cli.ts), already
nullable; or
- use static, statically-known fields (Config, ConfigOverrides,
DEFAULT_CONFIG).
tsc --noEmit remains clean. The full test suite still passes.
The defaults now live in a single file, scripts/config.default.json:
- src/config.ts imports it via 'with { type: "json" }' and derives
DEFAULT_CONFIG (with seconds->ms conversion at the boundary), so the
CLI help text always matches what the seeded user config contains.
- scripts/install.sh copies the same file to
$XDG_CONFIG_HOME/move/config.json only if no file is already there.
Existing configs (yours or from a previous install) are never
overwritten.
- scripts/uninstall.sh does not touch the user config file at all,
following the strict Unix convention. It does print a one-line
notice pointing at the path so the user can rm -rf the dir
themselves if they want a fully-clean removal.
- tsconfig.json gains resolveJsonModule:true so tsc accepts the JSON
import.
- A small runtime assertion in src/config.ts (assertSeedShape) fails
loudly if the seed file is missing keys or has wrong types.
- README Configuration section documents the seed behavior; Uninstall
section documents the leave-config-behind policy with the rm-it-
yourself command; Files table gains scripts/config.default.json.
- src/move.ts entry point with CLI parsing, --help, --version
- src/cli.ts: parseCliArgs, printHelp, ParsedCliArgs, CliError, VERSION
- src/config.ts: Config type, DEFAULT_CONFIG, resolveConfig
- src/keeper.ts: synthetic-activity sweep + idle-watch loop
- package.json bin entry + shebang for 'bun link' global install
- install.sh: contributor bootstrap (will be repurposed; see
DISTRIBUTION-PLAN.md for the end-user installer design)
- DISTRIBUTION-PLAN.md captures the tabled end-user distribution work