Skip to content

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

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

Add --skip-install option to fedify init#776
fru1tworld wants to merge 4 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: 81693cc3-c610-4119-88b5-be50974814d0

📥 Commits

Reviewing files that changed from the base of the PR and between 39bb2df and c4b189b.

📒 Files selected for processing (1)
  • packages/init/src/action/mod.ts

📝 Walkthrough

Walkthrough

Adds a --skip-install flag to fedify init: CLI option, types/initializer support, utilities to inject skip args, run-time gating of dependency installation, a user notice when install is skipped, tests/fixtures updates, CLI docs, and a CHANGES entry.

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 as skipInstall.
Types and framework initializers
packages/init/src/types.ts, packages/init/src/webframeworks/next.ts
WebFrameworkInitializer gains optional skipInstallArgs?: string[]; Next initializer returns skipInstallArgs: ["--skip-install"].
Core utilities and helpers
packages/init/src/action/utils.ts, packages/init/src/action/notice.ts
New isSkipInstall and withSkipInstallArgs utilities; runPrecommand uses injected args; noticePrecommand now prints the mutated dry-run command; new noticeSkippedInstall prints manual {packageManager} install instruction.
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 only runs installDependencies when skip is false.
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 CLI parsing and utility tests for --skip-install; updates existing init fixtures to include skipInstall: false.
User documentation
docs/cli.md, CHANGES.md
CLI docs and changelog describe the --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 Notice

  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->>Notice: noticeSkippedInstall(packageManager)
  end
  runInit->>CLI: exit
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

component/cli

Suggested reviewers

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

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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 PR title clearly and concisely describes the main change: adding a --skip-install option to the fedify init command.
Description check ✅ Passed The PR description is related to the changeset, explaining the motivation, implementation approach, and verification steps for the --skip-install feature.
Linked Issues check ✅ Passed The PR fully implements issue #720 requirements: adds --skip-install flag, skips dependency installation when set, defaults to install behavior, and provides user-friendly output for manual installation.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the --skip-install feature. Documentation, tests, type definitions, and implementation are appropriately scoped to the feature requirements.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 thread packages/init/src/action/mod.ts Outdated
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!

@codecov
Copy link
Copy Markdown

codecov Bot commented May 24, 2026

Codecov Report

❌ Patch coverage is 71.79487% with 11 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/init/src/action/notice.ts 9.09% 10 Missing ⚠️
packages/init/src/action/utils.ts 94.73% 0 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
packages/init/src/action/mod.ts 100.00% <100.00%> (ø)
packages/init/src/command.ts 100.00% <100.00%> (ø)
packages/init/src/webframeworks/next.ts 78.72% <100.00%> (+0.46%) ⬆️
packages/init/src/action/utils.ts 69.01% <94.73%> (+6.51%) ⬆️
packages/init/src/action/notice.ts 9.19% <9.09%> (+0.65%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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