Skip to content

Add --skip-install option to fedify init#776

Open
fru1tworld wants to merge 2 commits into
fedify-dev:mainfrom
fru1tworld:skip-install
Open

Add --skip-install option to fedify init#776
fru1tworld wants to merge 2 commits into
fedify-dev:mainfrom
fru1tworld:skip-install

Conversation

@fru1tworld
Copy link
Copy Markdown

Closes #720.

fedify init always ran the package manager's install command after
scaffolding, with no way to skip it. This is disruptive in CI
pipelines that install from a fixed lockfile in a separate step, in
monorepo workspaces that install from the root, and when developers
want to inspect the generated files before installing.

Adds --skip-install to the initOptions schema and threads an
isSkipInstall predicate through the action pipeline so
installDependencies is bypassed when the flag is set. When the run
is not in dry-run mode, noticeSkippedInstall prints the exact install
command for the selected package manager.

Verification

  • mise run check
  • mise run test

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: daadb3aa-5f87-4266-a411-b44dc3b64ca5

📥 Commits

Reviewing files that changed from the base of the PR and between e3e9ea5 and c5dd734.

📒 Files selected for processing (1)
  • CHANGES.md

📝 Walkthrough

Walkthrough

This PR adds a --skip-install flag to fedify init, adding a CLI option, an isSkipInstall utility and noticeSkippedInstall helper, gating of dependency installation in the init flow, updated tests/fixtures, and user-facing docs including CHANGES and CLI docs.

Changes

Skip-Install Flag Feature

Layer / File(s) Summary
CLI option definition
packages/init/src/command.ts
The --skip-install boolean option is added to the initOptions schema with description.
Core utilities and helpers
packages/init/src/action/utils.ts, packages/init/src/action/notice.ts
New isSkipInstall utility exposes the skipInstall flag; new noticeSkippedInstall helper prints a post-init message with the manual {packageManager} install command.
Integration into execution flow
packages/init/src/action/mod.ts
runInit imports utilities and conditionally calls noticeSkippedInstall when not a dry-run and skip is requested; handleHydRun gates installDependencies to skip installation when skipInstall is true.
Test coverage
packages/init/src/skip-install.test.ts, packages/init/src/action/configs.test.ts, packages/init/src/action/patch.test.ts, packages/init/src/package.test.ts, packages/init/src/webframeworks.test.ts
Adds tests for CLI parsing and defaulting; updates existing test fixtures to include skipInstall: false in InitCommandData.
User documentation
CHANGES.md, docs/cli.md
Changelog entry and CLI docs describe the new --skip-install option, availability since 2.3.0, behavior, and an example invocation.

Sequence Diagram

sequenceDiagram
  participant CLI
  participant runInit
  participant handleHydRun
  participant Installer
  participant noticeSkippedInstall

  CLI->>runInit: parse options (skipInstall, dryRun, packageManager)
  runInit->>handleHydRun: start hydration (passes InitCommandData)
  alt skipInstall is false
    handleHydRun->>Installer: installDependencies({ packageManager })
  else skipInstall is true
    handleHydRun->>noticeSkippedInstall: noticeSkippedInstall({ packageManager })
  end
  runInit->>CLI: exit
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

component/cli, type/documentation

Suggested reviewers

  • 2chanhaeng
  • sij411
  • dahlia
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and concisely describes the main change: adding a --skip-install option to the fedify init command.
Description check ✅ Passed The description clearly explains the motivation, implementation approach, and verification steps, all relevant to the changeset.
Linked Issues check ✅ Passed The PR fully implements issue #720: adds --skip-install flag, threads isSkipInstall through the action pipeline, bypasses installDependencies when set, and prints the install command when needed.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the --skip-install feature and updating tests to accommodate the new option; no out-of-scope modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGES.md`:
- Around line 270-274: The CHANGES.md entry for the `--skip-install` option to
`fedify init` currently only includes the issue link `[[`#720`]]`; update this
changelog line to also include the PR number (e.g. `[[PR#<number>]]`) and the
author attribution (your name) in the same format used elsewhere in CHANGES.md
so it reads: description, then issue link, PR link, and author name; edit the
existing `--skip-install` entry text to append the PR reference and author
attribution to match the repository’s changelog convention.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 73163226-a947-4e5d-ae20-f63ef9e6f85e

📥 Commits

Reviewing files that changed from the base of the PR and between 8db5848 and e3e9ea5.

📒 Files selected for processing (11)
  • CHANGES.md
  • docs/cli.md
  • packages/init/src/action/configs.test.ts
  • packages/init/src/action/mod.ts
  • packages/init/src/action/notice.ts
  • packages/init/src/action/patch.test.ts
  • packages/init/src/action/utils.ts
  • packages/init/src/command.ts
  • packages/init/src/package.test.ts
  • packages/init/src/skip-install.test.ts
  • packages/init/src/webframeworks.test.ts

Comment thread CHANGES.md Outdated
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a --skip-install option to the fedify init command, allowing users to skip the automatic dependency installation step. This is useful for CI environments, monorepos, or manual inspection. The changes include updates to the CLI documentation, the addition of the flag in the command configuration, logic to conditionally skip installation in the initialization pipeline, and a new notice to inform users how to install dependencies manually. Feedback suggests reordering the final notices so that the instruction to install dependencies appears before the instructions on how to run the project, ensuring a more logical flow for the user.

Comment on lines 59 to +60
tap(noticeHowToRun),
tap(unless(isDry, when(isSkipInstall, noticeSkippedInstall))),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The notice about skipped dependency installation should ideally appear before the "how to run" instructions. This provides a better user experience by informing the user that they need to perform an installation step before they attempt to run the project using the commands shown in the next step.

Suggested change
tap(noticeHowToRun),
tap(unless(isDry, when(isSkipInstall, noticeSkippedInstall))),
tap(unless(isDry, when(isSkipInstall, noticeSkippedInstall))),
tap(noticeHowToRun),

@sij411
Copy link
Copy Markdown
Contributor

sij411 commented May 22, 2026

cc @2chanhaeng

@2chanhaeng
Copy link
Copy Markdown
Contributor

Hi there! Thank you so much for your interest in contributing to our package. When initializing an app with the @fedify/init package, it executes the initialization command of the web framework that the user intends to use for that app. This is stored in the WebFrameworkInitializer.command of the respective web framework. For now, the currently supported frameworks prevent package installation when running this command, but frameworks added in the future might allow it. Could you also add a flow that prevents package installation while this command is running when the --skip-install flag is used? Thanks again for your interest in contributing to our package! I hope your contributions merge into our package as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --skip-install flag to fedify init

3 participants