Template for an AntelopeJS module that defines an interface and implements it, with a playground project that calls it.
A starter for a module that defines an AntelopeJS interface and implements it, with a playground project that calls it.
my-module/
├── src/
│ ├── interfaces/template-module/beta/index.ts # the contract: export const Log = InterfaceFunction<...>()
│ ├── implementations/template-module/beta/index.ts # the code behind Log
│ └── index.ts # construct() binds them with ImplementInterface
├── test/
│ └── log.test.ts # checks that Log reaches the implementation
├── playground/ # an AntelopeJS project that loads this module and calls Log
│ ├── src/index.ts
│ ├── antelope.config.ts
│ └── package.json
├── antelope.test.ts # test configuration, referenced by antelopeJs.test
├── AGENTS.md # repository facts and rules for coding agents
├── oxlint.config.ts # lint, format and dead-code configs from @antelopejs/tooling-configs
├── oxfmt.config.ts
├── knip.config.ts
├── .nvmrc # the Node version CI uses
├── lefthook.yml # pre-commit lint, format, size and ratchet hooks, pre-push typecheck
├── package.json
└── tsconfig.json
Create a module from this template:
npx @antelopejs/core module init my-module --template module-typescript --pm pnpmThe command copies the template and installs its dependencies. It installs before git init, so run pnpm install once more in the new repository to install the pre-commit hooks. Run npx @antelopejs/core module init my-module without flags to answer the questions interactively, and pick pnpm, because the scripts, hooks and CI use it.
One root pnpm install installs both the module and playground dependencies. Each package keeps its own lockfile to preserve its dependency resolution. The playground imports the built module, so build once, then start it.
cd my-module
pnpm install
pnpm build
pnpm devpnpm dev runs the playground project in watch mode (ajs project run -w -p playground). It builds both modules, and the playground prints Hello world through the Log interface.
| Command | What it does |
|---|---|
pnpm dev |
Runs the playground in watch mode |
pnpm build |
Builds the module into dist/ |
pnpm test |
Builds the module, starts it, and runs the test/*.test.ts files with ajs module test |
pnpm run checks |
Runs typecheck, lint, format, knip, the tests, size, suppressions, sync and lockfile checks |
- Rename the module in
package.json(nameandantelopeJs.implements),antelope.test.ts,playground/antelope.config.tsandplayground/package.json. - Rename the
template-modulefolders undersrc/interfaces/andsrc/implementations/to your interface name, and update the imports insrc/index.ts,playground/src/index.tsandtest/. - Declare your functions in the interface and implement them with the same signatures.
- Creating a module: the module layout and its
package.json. - Exporting interfaces: publish your interface for other modules.
- Proxies: how
InterfaceFunctionqueues calls until a module implements it. - Testing: write module tests.
Using Claude Code or Codex? Install the AntelopeJS agent skills plugin so your agent knows the framework and its CLI.
See CONTRIBUTING.md. Run pnpm install then pnpm run checks before you open a pull request.
This template belongs to AntelopeJS, the TypeScript framework where modules depend on contracts and the application chooses the provider. The open-source back office AntelopeJS DMS is built on it.