Dev.bootstrap.typescript
Overview
Bootstrap new TypeScript projects from a local Copier template or add a pre-commit hook that runs linting and formatting for an existing project.
Workflow
1. Pick the path
- New project: run
scripts/bootstrap_project.sh - Existing project: run
scripts/add_precommit.sh
2. Bootstrap a new project
- Ensure
copieris installed and/Users/kevinlin/code/copier-typescript-codexexists. - Run
scripts/bootstrap_project.sh <target_dir> [copier args]. - Use
--datato avoid interactive prompts when needed.
3. Post-bootstrap follow-up (new project)
- By default,
scripts/bootstrap_project.shruns these steps; pass--skip-followup(or--no-followup) to skip. - If you ran Copier directly, from
target_dirrunpnpm installandpnpm test. - If no
.gitdirectory exists, rungit initthenpnpm prepareto activate Husky hooks.
4. Add pre-commit hook (augment)
- Ensure
package.jsonexists and defineslintandformatscripts. - Run
scripts/add_precommit.sh [project_root]. - If
.husky/_/husky.shis missing, run your package manager install (ornpx husky install) to activate hooks.