init: typescript esm boilerplate
This commit is contained in:
commit
6b522a0803
16 changed files with 3518 additions and 0 deletions
60
AGENTS.md
Normal file
60
AGENTS.md
Normal 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`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue