init: typescript esm boilerplate

This commit is contained in:
devilreef 2026-04-29 12:14:17 +06:00
commit 6b522a0803
Signed by: devilreef
SSH key fingerprint: SHA256:UZisRr4iuXx+IhkbZnR655L2RWAT6o2rgbGv5F/6m3Y
16 changed files with 3518 additions and 0 deletions

60
AGENTS.md Normal file
View file

@ -0,0 +1,60 @@
# Agents
## Project Overview
TypeScript ESM boilerplate. Runtime-only via `tsx`, no build step.
## Stack
- **Runtime**: Node 24+, tsx
- **Package manager**: pnpm
- **Linting**: @antfu/eslint-config v8 (eslint.config.mjs)
- **Env**: env-var + native `loadEnvFile`
- **Container**: Docker, node:24-alpine
## Structure
```
src/
├── index.ts # entrypoint
└── shared/
└── config.ts # env config
```
## Preferred Folder Structure
```
src/
├── index.ts # entrypoint
├── shared/ # cross-cutting concerns (config, types, utilities)
└── lib/ # third-party wrappers, adapters
```
Expand based on project type as needed. Keep `src/index.ts` as the single entrypoint.
## Conventions
- ESM only (`"type": "module"`)
- Path alias `@/*` maps to `src/*` — imports must end with `.js` extension (nodenext resolution)
- No build step — tsx runs TS directly in dev and prod
- `cross-env` for cross-platform env vars in npm scripts
- No useless comments
- Split code into multiple files rather than monoliths
## Commands
- `pnpm dev` — watch mode
- `pnpm start` — production run
- `pnpm lint` — check
- `pnpm lint:fix` — auto-fix
## Lint Rules
- `no-console: off` — console.log is allowed
- `antfu/no-top-level-await: off`
- Stylistic: 2-space indent, single quotes
- JSON key ordering enforced (auto-fixed)
## Docker
Single-stage, no build. Copies source, installs prod deps, runs via `pnpm start`.