A lean, production-grade template for TypeScript libraries and Python packages with a strict green workflow.
It mirrors CI locally, enforces style/tests/typing, ships with GitHub Actions (Linux matrix) and CodeQL, and keeps histories clean and linear.
Use it to bootstrap small libs or new repos that must stay green, integrate safely, and scale with confidence.
.
├── lib/ # TS build output
├── test/ # TS tests (Jest)
├── src/star_template/ # Python package
├── tests/ # Python tests (pytest)
└── .github/workflows/ # build.yml, codeql.yml
npm ci
npx prettier -c .
npx eslint . --max-warnings=0
[ -f tsconfig.json ] && npx tsc -p tsconfig.json --noEmit || true
npm test --silentPack + smoke locally:
npm pack
mkdir -p /tmp/star-template-npm-smoke && cd /tmp/star-template-npm-smoke
npm init -y >/dev/null
npm install "/absolute/path/to/star-template-ts-<version>.tgz" --silent
node -e "require('star-template-ts'); console.log('node import OK')"poetry install --no-interaction
poetry run ruff check .
poetry run black --check .
PYTHONPATH=src poetry run pytest -q
poetry run mypy src
poetry build
python - <<'PY'
import importlib; m = importlib.import_module("star_template")
print("python import OK:", getattr(m, "__version__", "unknown"))
PY# Node
npx prettier -c .
npx eslint . --max-warnings=0
[ -f tsconfig.json ] && npx tsc --noEmit || true
npm test --silent
# Python
poetry run ruff check .
poetry run black --check .
PYTHONPATH=src poetry run pytest -q
poetry run mypy src- Linux matrix for Node and Python (3.11, 3.12).
- Jobs match local gates to avoid “works-on-my-machine”.
- Logs per job are uploaded as artifacts for troubleshooting.
- CodeQL enabled for static analysis.
Example Python job steps:
- run: python -m pip install -U pip
- run: pip install ruff black pytest mypy
- run: ruff check .
- run: black --check .
- run: pytest -q
- run: mypy src- You need a minimal yet strict starter for Node + Python libs.
- Always-green policy: PRs blocked unless checks pass.
- You value linear history (squash merge) and reproducible local gates.
- Use only one stack? Remove the other stack’s files and its CI job.
- Add Windows/macOS runners by extending
build.yml. - Lower strictness (e.g., Python coverage) by adjusting
pytest.ini.
- Private disclosures via GitHub Security advisories.
- CodeQL runs on PRs and pushes to
main.
- Small, atomic PRs with Conventional Commits.
- Keep local gates green before pushing.
- Enable auto-merge once checks pass.
always green ci template, always-green workflow, typescript library starter, node eslint prettier jest template,
python package template poetry, ruff black pytest mypy starter, github actions matrix ci, codeql security scan template,
branch protection required checks, dual stack repo template, clean history conventional commits, npm pack smoke test,
poetry build smoke test, linux matrix ci, job log artifacts, reproducible dev workflow
CoderDeltaLAN (Yosvel)
Email: coderdeltalan.cargo784@8alias.com
GitHub: https://github.com/CoderDeltaLAN
Open-source takes time. If this template saves you hours, consider supporting continued maintenance and polish. Thank you!
Released under the Apache License 2.0. See LICENSE.