Skip to content

Commit 5b4ae52

Browse files
committed
Address review feedback on fedify init --skip-install
Move the skipped-install notice into handleHydRun so it lives next to the installation step it relates to and only runs in the non-dry-run branch, dropping the now-redundant isDry guard from the top-level pipeline. Render the manual install command with Optique's commandLine() instead of text() so it is presented as a command-line example rather than plain text. Assisted-by: Claude Code:claude-opus-4-8
1 parent 0cccc38 commit 5b4ae52

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

packages/init/src/action/mod.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ import {
3939
* 5. Converts `InitCommandOptions` into `InitCommandData` via `setData`.
4040
* 6. Branches based on `isDry`:
4141
* - If dry run, executes `handleDryRun`.
42-
* - Otherwise, executes `handleHydRun`.
42+
* - Otherwise, executes `handleHydRun`, which installs dependencies, or—when
43+
* `--skip-install` is set—prints how to install them manually via
44+
* `noticeSkippedInstall`.
4345
* 7. Recommends configuration environment via `recommendConfigEnv`.
44-
* 8. If installation was skipped and not a dry run, prints how to install
45-
* dependencies manually via `noticeSkippedInstall`.
46-
* 9. Shows how to run the project via `noticeHowToRun`.
46+
* 8. Shows how to run the project via `noticeHowToRun`.
4747
*/
4848
const runInit = (options: InitCommand) =>
4949
pipe(
@@ -56,7 +56,6 @@ const runInit = (options: InitCommand) =>
5656
when(isDry, handleDryRun),
5757
unless(isDry, handleHydRun),
5858
tap(recommendConfigEnv),
59-
tap(unless(isDry, when(isSkipInstall, noticeSkippedInstall))),
6059
tap(noticeHowToRun),
6160
);
6261

@@ -82,4 +81,5 @@ const handleHydRun = (data: InitCommandData) =>
8281
tap(when(hasCommand, runPrecommand)),
8382
tap(patchFiles),
8483
tap(unless(isSkipInstall, installDependencies)),
84+
tap(when(isSkipInstall, noticeSkippedInstall)),
8585
);

packages/init/src/action/notice.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { text } from "@optique/core";
1+
import { commandLine, text } from "@optique/core";
22
import { flow } from "es-toolkit";
33
import type { InitCommand } from "../command.ts";
44
import type { InitCommandData } from "../types.ts";
@@ -123,7 +123,7 @@ export const noticeSkippedInstall = (
123123
) =>
124124
printMessage`
125125
Dependencies were not installed. Run ${
126-
text(`${packageManager} install`)
126+
commandLine(`${packageManager} install`)
127127
} in the project directory to install them.
128128
`;
129129

0 commit comments

Comments
 (0)