mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-06 04:21:09 +00:00
fix: eject command with no component specified (#1709)
This commit is contained in:
5
.changeset/wicked-birds-jam.md
Normal file
5
.changeset/wicked-birds-jam.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@redocly/cli": patch
|
||||
---
|
||||
|
||||
Added the ability to run the `eject` command without specifying components, which displays a selectable list of all available components.
|
||||
@@ -5,7 +5,7 @@ import type { VerifyConfigOptions } from '../types';
|
||||
|
||||
export type EjectOptions = {
|
||||
type: 'component';
|
||||
path: string;
|
||||
path?: string;
|
||||
'project-dir'?: string;
|
||||
force: boolean;
|
||||
} & VerifyConfigOptions;
|
||||
@@ -20,7 +20,7 @@ export const handleEject = async ({ argv }: CommandArgs<EjectOptions>) => {
|
||||
'@redocly/realm',
|
||||
'eject',
|
||||
`${argv.type}`,
|
||||
`${argv.path}`,
|
||||
`${argv.path ?? ''}`,
|
||||
`-d=${argv['project-dir']}`,
|
||||
argv.force ? `--force=${argv.force}` : '',
|
||||
],
|
||||
|
||||
@@ -26,7 +26,7 @@ export const previewProject = async ({ argv }: CommandArgs<PreviewProjectOptions
|
||||
|
||||
spawn(
|
||||
npxExecutableName,
|
||||
['-y', packageName, 'develop', `--plan=${plan}`, `--port=${port || 4000}`],
|
||||
['-y', packageName, 'preview', `--plan=${plan}`, `--port=${port || 4000}`],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
cwd: projectDir,
|
||||
|
||||
@@ -817,7 +817,7 @@ yargs
|
||||
}
|
||||
)
|
||||
.command(
|
||||
'eject <type> <path>',
|
||||
'eject <type> [path]',
|
||||
'Helper function to eject project elements for customization.',
|
||||
(yargs) =>
|
||||
yargs
|
||||
@@ -830,7 +830,6 @@ yargs
|
||||
.positional('path', {
|
||||
description: 'Filepath to a component or filepath with glob pattern.',
|
||||
type: 'string',
|
||||
demandOption: true,
|
||||
})
|
||||
.options({
|
||||
'project-dir': {
|
||||
|
||||
Reference in New Issue
Block a user