Address review feedback from freben
- Use cli-defaults instead of listing individual CLI modules in create-app template and root package.json - Move nodeTransform config files from cli-module-build to cli-node to avoid cross-module direct imports - Rename cli-module-create-github-app to cli-module-github - Start createCliModule init chain with Promise.resolve() - Deduplicate exitWithError in runCliModule.ts - Extract shared isCommandNodeHidden to @internal/cli - Add explanatory comment for fromArray deduplication field - Restore error for cli role packages missing bin in runCliExtraction Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -53,3 +53,17 @@ export const OpaqueCommandLeafNode = OpaqueType.create<{
|
||||
type: '@backstage/CommandLeafNode',
|
||||
versions: ['v1'],
|
||||
});
|
||||
|
||||
/**
|
||||
* Checks whether a command node should be hidden from help output.
|
||||
* Leaf nodes are hidden if they are deprecated or experimental.
|
||||
* Tree nodes are hidden if all of their children are hidden.
|
||||
*/
|
||||
export function isCommandNodeHidden(node: CommandNode): boolean {
|
||||
if (OpaqueCommandLeafNode.isType(node)) {
|
||||
const { command } = OpaqueCommandLeafNode.toInternal(node);
|
||||
return !!command.deprecated || !!command.experimental;
|
||||
}
|
||||
const { children } = OpaqueCommandTreeNode.toInternal(node);
|
||||
return children.every(child => isCommandNodeHidden(child));
|
||||
}
|
||||
|
||||
@@ -23,4 +23,5 @@ export type {
|
||||
export {
|
||||
OpaqueCommandTreeNode,
|
||||
OpaqueCommandLeafNode,
|
||||
isCommandNodeHidden,
|
||||
} from './InternalCommandNode';
|
||||
|
||||
Reference in New Issue
Block a user