Skip to content

Commit

Permalink
fix: eject command with no component specified (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr authored Sep 5, 2024
1 parent 81a1eca commit 8240c78
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-birds-jam.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions packages/cli/src/commands/eject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { VerifyConfigOptions } from '../types';

export type EjectOptions = {
type: 'component';
path: string;
path?: string;
'project-dir'?: string;
force: boolean;
} & VerifyConfigOptions;
Expand All @@ -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}` : '',
],
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/preview-project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ yargs
}
)
.command(
'eject <type> <path>',
'eject <type> [path]',
'Helper function to eject project elements for customization.',
(yargs) =>
yargs
Expand All @@ -830,7 +830,6 @@ yargs
.positional('path', {
description: 'Filepath to a component or filepath with glob pattern.',
type: 'string',
demandOption: true,
})
.options({
'project-dir': {
Expand Down

1 comment on commit 8240c78

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 78.05% 4872/6242
🟡 Branches 66.39% 2007/3023
🟡 Functions 72.52% 805/1110
🟡 Lines 78.34% 4593/5863

Test suite run success

786 tests passing in 118 suites.

Report generated by 🧪jest coverage report action from 8240c78

Please sign in to comment.