Skip to content

Commit bcf0dc1

Browse files
committed
fixup! docs: add AGENTS.md guide for AI agents
1 parent 125acc3 commit bcf0dc1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎AGENTS.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ This is the source code for the Angular CLI and related build tooling. This guid
2828
- Tests in this repository only run in Bazel. **ALWAYS** use `process.env['TEST_TMPDIR']` and assert that it is set:
2929
```ts
3030
import assert from 'node:assert';
31-
import { mkdtemp } from 'node:fs/promises';
31+
import fs from 'node:fs/promises';
3232
import path from 'node:path';
3333

3434
const baseTmpDir = process.env['TEST_TMPDIR'];
3535
assert(baseTmpDir, 'TEST_TMPDIR is not set');
36-
const tempRoot = await mkdtemp(path.join(baseTmpDir, 'SOMETHING'));
36+
const tempRoot = await fs.mkdtemp(path.join(baseTmpDir, 'SOMETHING'));
3737
```
3838
- **NEVER** use or fallback to `os.tmpdir()`. Bazel executes tests in hermetic sandboxes and sets `TEST_TMPDIR` to an isolated, sandboxed directory. Using `os.tmpdir()` can cause sandboxing failures, permission errors, or file leakage outside the Bazel sandbox.
39+
- **Imports:**
40+
- Always use the `node:` protocol for Node.js built-in imports (e.g., `node:fs`, `node:path`, `node:assert`).
41+
- Prefer `import fs from 'node:fs'` (or `'node:fs/promises'`) instead of `import * as fs`.
3942
- **Unit Tests:**
4043
- Run all unit tests: `pnpm bazel test //packages/...`
4144
- Run a specific test target: `pnpm bazel test //packages/angular/build:test`

0 commit comments

Comments
 (0)