-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alokai-cli core module #7099
base: main
Are you sure you want to change the base?
alokai-cli core module #7099
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there going to be tests? If not, please remove this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not in the core probably, removing
.name("alokai") | ||
.description("Alokai CLI is a tool to help you manage your Alokai projects") | ||
.usage("[command] [options]") | ||
.version("0.0.1", "-v, --version", "display the version number") | ||
.action(() => { | ||
program.help(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the exact same snippet in src/index.ts? Shouldn't the duplication be removed, as it looks like prebuild.js ins the main file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prebuild.js is used to generate src/index.ts
dynamically based on alokai-*
packages from node modules
Please also add changeset ( |
```typescript | ||
import alokaiCli[YourPackageName] from 'alokai-[your-package-name]'; | ||
``` | ||
|
||
Then, you can use the package in the `index.ts` file: | ||
|
||
```typescript | ||
alokaiCli[YourPackageName].forEach((command) => { | ||
program.addCommand(command); | ||
}); | ||
``` | ||
|
||
This will add the command to the core CLI application and will be available to use once the project is published. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo it's better to create an abstraction over the commands' registration. We could have a following API
import integrationCommands from "alokai-integrations";
const program = createAlokaiCli({
plugins: [
{ name: "integrations", commands: integrationCommands },
{ name: "modules", commands: modulesCommands },
//...
]
});
or
import integrationCommands from "alokai-integrations";
const program = createAlokaiCli({
plugins: {
integrations: integrationsCommands,
modules: modulesCommands,
//...
}
});
π Linked issue
β Type of change
π Description
π Checklist