Module Commands
Creating Modules
module init
Creates a new module.
ajs module init <path>
What it does:
Walks you through setting up a new module using templates. The wizard helps you pick the right options so your module follows best practices.
Arguments:
Argument | Description | Required |
---|---|---|
<path> | Where to create it | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--git | -g | Where to get templates from | https://github.com/antelopejs/interfaces.git |
Example:
ajs module init my-module
module test
Run tests for a module.
ajs module test <path>
What it does:
Executes the tests defined in your module's test directory to verify functionality.
Arguments:
Argument | Description | Required |
---|---|---|
<path> | Path to module directory | Yes |
Example:
ajs module test my-module
Managing Imports
These commands help you work with interfaces that your module uses from other modules.
module imports list
Lists all imported interfaces.
ajs module imports list
What it does:
Shows all required and optional interfaces that your module is using.
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to check | Current directory |
--verbose | -v | Show detailed information including overrides | false |
Example:
ajs module imports list --verbose
module imports add
Add interfaces to your module.
ajs module imports add <interfaces...>
What it does:
Gets the interfaces you need and adds them to your module.
Arguments:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to add (list them) | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--git | -g | Where to get interfaces from | https://github.com/antelopejs/interfaces.git |
--module | -m | Which module to modify | Current directory |
--optional | -o | Make imports optional | false |
Example:
ajs module imports add database@1 api@2
module imports remove
Take out interfaces you don't need anymore.
ajs module imports remove <interfaces...>
What it does:
Removes interfaces from your module and cleans up related files.
Arguments:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to remove (list them) | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to modify | Current directory |
Example:
ajs module imports remove database@1
module imports update
Update all your imported interfaces.
ajs module imports update
What it does:
Gets the latest version of all interfaces your module is using.
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to update | Current directory |
Example:
ajs module imports update
Managing Exports
These commands help you set up the interfaces your module offers to others.
module exports set
Tell Antelopejs where your module's interfaces are.
ajs module exports set <path>
What it does:
Sets which folder contains the interfaces your module shares with others.
Arguments:
Argument | Description | Required |
---|---|---|
<path> | Where your interfaces are located | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to modify | Current directory |
Example:
ajs module exports set src/interfaces
module exports generate
Generate TypeScript declaration files for your module's exports.
ajs module exports generate
What it does:
Creates TypeScript definition files for your module's interfaces to be consumed by other modules.
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to generate exports for | Current directory |
Example:
ajs module exports generate