digital-asset / digital-asset/dpm

Support components implementing cli sub-commands

Open
#121 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
3
Forks
2
Avg merge
21h 16m
Merged PRs (30d)
1

Description

## Problem Statement

Currently in a component's component.yaml, it can only define top level commands without sub-commands or a hierarch

So if I want to implement

`dpm create new` / `dpm create new application` `dpm create new component`

I could only define `dpm create` in my component.yaml, and all the sub-sequence sub-commands I would have to implement opaquely in my components.

Instead,, let's have the component.yaml define not just the parent level command, but also the available sub-commands.

NOTE : this will complicate the checks that alternative components do not try to stomp on each other by implementing competiting subcommands

i.e. --> there may be two components they try to implement `dpm codegen js` --> one by taking ownership of the root `dpm codegen` namespace and one by explicitly writing `dpm codegen js` and `dpm codegen java` sub-commands

### Checklist

- [ ] Modify the existing `component.yaml` schema to allow name field (which represents the actual command string used) to be a list
- [ ] Modify the assembler to output a tree of commands instead of a list of commands
- [ ] Tests
- [ ] Docs

Contributor guide

Open the contributing guide

Research direction

Start with the existing component.yaml schema and assembler, then trace how command ownership conflicts are checked. Cover nested command declarations and root-versus-subcommand collisions in tests, and update the documentation; done means commands such as dpm create new application can be declared and assembled without ambiguous ownership.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.