Skip to content
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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

alokai-cli core module #7099

wants to merge 17 commits into from

Conversation

skirianov
Copy link
Contributor

@skirianov skirianov commented Mar 28, 2024

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@skirianov skirianov requested a review from a team as a code owner March 28, 2024 16:43
Copy link

changeset-bot bot commented Mar 28, 2024

⚠️ No Changeset found

Latest commit: 84939ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

packages/alokai-cli/pnpm-lock.yaml Show resolved Hide resolved
packages/alokai-cli/package.json Show resolved Hide resolved
packages/alokai-cli/package.json Show resolved Hide resolved
packages/alokai-cli/package.json Show resolved Hide resolved
Copy link
Contributor

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

Copy link
Contributor Author

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

packages/alokai-cli/prebuild.js Show resolved Hide resolved
Comment on lines +44 to +50
.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();
});
Copy link
Contributor

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?

Copy link
Contributor Author

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

@sethidden
Copy link
Contributor

Please also add changeset (npx changeset)

packages/alokai-cli/README.md Show resolved Hide resolved
packages/alokai-cli/README.md Show resolved Hide resolved
Comment on lines +15 to +27
```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.
Copy link
Contributor

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,
    //...
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants