Skip to content

About

Template for an AntelopeJS module that defines an interface and implements it, with a playground project that calls it.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

TEMPLATE · MODULE TYPESCRIPT: part of AntelopeJS, hexagonal architecture beyond your own code. A glowing button reads Star AntelopeJS.

AntelopeJS module TypeScript template

License Discord Documentation Star AntelopeJS

Template for an AntelopeJS module that defines an interface and implements it, with a playground project that calls it.

Documentation · All interfaces and providers

A starter for a module that defines an AntelopeJS interface and implements it, with a playground project that calls it.

What you get

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 it

Create a module from this template:

npx @antelopejs/core module init my-module --template module-typescript --pm pnpm

The 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.

Run 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 dev

pnpm 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

Make it yours

  1. Rename the module in package.json (name and antelopeJs.implements), antelope.test.ts, playground/antelope.config.ts and playground/package.json.
  2. Rename the template-module folders under src/interfaces/ and src/implementations/ to your interface name, and update the imports in src/index.ts, playground/src/index.ts and test/.
  3. Declare your functions in the interface and implement them with the same signatures.

Next steps

Using Claude Code or Codex? Install the AntelopeJS agent skills plugin so your agent knows the framework and its CLI.

Contributing

See CONTRIBUTING.md. Run pnpm install then pnpm run checks before you open a pull request.

Part of AntelopeJS

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.

License

Apache-2.0

About

Template for an AntelopeJS module that defines an interface and implements it, with a playground project that calls it.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages