60 lines
1.5 KiB
Markdown
60 lines
1.5 KiB
Markdown
# 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`.
|