ccfb08f4d5
Follow-up to #20, which was merged before this landed. bot-agents has no `package.json` `imports` aliases (`src/` is flat and everything imports relatively), so no code changes. This records the new rule in the docs: - `.agents/memory/imports-aliases-barrels.md`: aliases may target only a direct subfolder of `src/` (its `index.ts` or a `#x/*` pattern); nothing outside `src/`, not `src/` itself, not deeper folders; such code imports relatively. - `.agents/memory/tests-layout-vitest.md`: `tests/` reach the public entry through a relative import, not a `#plugin` alias. - `.agents/skills/migrate-deno-repo/SKILL.md` and `AGENTS.md`: same rule. `vp check`, `vp test`, and `damem doctor` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: #21 Reviewed-by: bot <noreply@capsulizers.com> Co-authored-by: Danny Kim <temeddix@gmail.com> Co-committed-by: Danny Kim <temeddix@gmail.com>
32 lines
2.0 KiB
Markdown
32 lines
2.0 KiB
Markdown
---
|
|
description: The action runs src/<phase>.ts directly with node on node:24-bookworm (no build); protect-source.sh copies only src/*.ts, package.json, profiles.json, prompt.md
|
|
---
|
|
|
|
`action.yml` is a composite action running three phases as
|
|
`node "<source>/src/{prepare,run,post}.ts"`. Node's built-in type stripping
|
|
runs the TypeScript; there is **no build step, no bundle, and no runtime
|
|
dependency**. Hence `tsconfig.json` has `erasableSyntaxOnly` and
|
|
`allowImportingTsExtensions`: only erasable syntax (no `enum`, no parameter
|
|
properties, no decorators) and relative `.ts` imports.
|
|
|
|
- **Image:** the steps assume the `node:24-bookworm` job container. Node must
|
|
be 24.2+ for `import.meta.main` in `post.ts`. That image is the only Node
|
|
pin (`package.json` has no `engines`); `check.yml` prints `node --version`
|
|
to confirm the cached image's minor.
|
|
- **Root-owned source copy:** `scripts/protect-source.sh` copies the action
|
|
into `$RUNNER_TEMP` so an agent editing the checkout can't swap a later
|
|
phase. It copies exactly `src/*.ts`, `package.json` (`"type": "module"`
|
|
makes Node load the sources as ES modules), `profiles.json`, and
|
|
`prompt.md`. **A new runtime file or subdirectory must be added there**, or
|
|
it is missing at run time. Runtime code in `src/` is flat; a subfolder would
|
|
not be copied. The only subfolder, `src/testing/`, is test-only.
|
|
- `tests/entrypoints.test.ts` runs each phase under real Node with a cleared
|
|
environment and expects its first "X is not set" error, which proves the
|
|
whole import graph loads without a build. Keep it in sync with the phases.
|
|
- **None of the app build conventions apply here:** no `vp build`, no
|
|
frontend or Rust/Tauri output paths, no Containerfile, no decorators
|
|
plugin, no lit-check, no generated JS. Don't add any of them.
|
|
- **CI** (`.gitea/workflows/check.yml`) runs on the self-hosted runner's
|
|
default image as root: `npm ci`, `npx vp check`, `npx vp test`. It does not
|
|
use `setup-vp`. YAML stays declarative ([[yaml-stays-declarative]]).
|