Skip to content

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

Open
fru1tworld wants to merge 1 commit into
fedify-dev:mainfrom
fru1tworld:skip-install
Open

Add --skip-install option to fedify init#776
fru1tworld wants to merge 1 commit 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

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a --skip-install CLI flag to fedify init to skip automatic dependency installation after project scaffolding. The feature includes CLI option parsing, utility helpers for condition checking and user notices, integration into the execution pipeline, framework-specific scaffold updates, comprehensive test coverage, and user-facing documentation.

Changes

Skip-Install Flag Feature

Layer / File(s) Summary
CLI option definition
packages/init/src/command.ts
Add --skip-install boolean option to initOptions command schema.
Utility helpers and notice functions
packages/init/src/action/utils.ts, packages/init/src/action/notice.ts
Add isSkipInstall helper to extract the flag from command data, and noticeSkippedInstall to print the manual install instruction when skipped.
Execution flow integration
packages/init/src/action/mod.ts
Import and integrate utilities into runInit: conditionally output skipped-install notice and gate dependency installation based on the flag.
Next.js framework scaffold integration
packages/init/src/webframeworks/next.ts
Accept skipInstall in init callback and conditionally append --skip-install argument to the create-next-app command.
Test fixtures and initializers
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
Add skipInstall: false to all test fixture data to match the updated command-data shape.
Skip-install test suite
packages/init/src/skip-install.test.ts
Add tests validating CLI parsing (flag sets skipInstall to true, absent flag defaults to false) and isSkipInstall helper behavior.
User documentation and changelog
docs/cli.md, CHANGES.md
Document the new option with availability version (2.3.0), behavior description, example invocation, and changelog entry referencing issue #720 and PR #776.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 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 title clearly and concisely describes the main feature being added: a --skip-install option to the fedify init command.
Description check ✅ Passed The description is well-detailed and directly related to the changeset, explaining the motivation, implementation approach, and verification steps.
Linked Issues check ✅ Passed The PR successfully implements the --skip-install flag for fedify init as requested in #720, adding the option to the command schema, threading it through the action pipeline, and bypassing dependency installation when set.
Out of Scope Changes check ✅ Passed All changes are within scope of implementing the --skip-install feature, including documentation, CLI option definition, action pipeline modifications, tests, and framework integration.

✏️ 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
fru1tworld added a commit to fru1tworld/fedify that referenced this pull request May 22, 2026
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.

Copy link
Copy Markdown
Contributor

@2chanhaeng 2chanhaeng left a comment

Choose a reason for hiding this comment

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

Thanks for your contributions, again!
First, sorry for late. I've been sick for the past few days and still haven't fully recovered, so my review is late. I should have at least let you know. I apologize if you've been waiting a long time.
Before getting into the review, I recommend that in the future, you leave a comment on the review explaining how you applied the feedback along with the relevant commit if you accepted it, or the reasoning behind your decision if you rejected it. This will help the reviewer review your revisions more quickly.
The flow you added looks more complex than I thought. Since InitCommandOptions has a skipInstall prop, I think it would be enough to just add the related command in WebFrameworkDescription.init when skipInstall is present. I'm really sorry, but could you revert 39bb2df and then only add the part that handles the skipInstall argument in packages/init/src/webframeworks/next.ts? It should be sufficient to add the skipInstall: boolean param to getNextInitCommand and then append "--skip-install" if that argument is true.
Also, this repo doesn't ban contributions using AI agents, but you should add trailers in the commit messages if you used any AI agents. You can find explanations about trailers in AI_POLICY.md. Are you sure you didn't use any AI agents at all?

@2chanhaeng 2chanhaeng self-requested a review May 30, 2026 10:50
@fru1tworld fru1tworld marked this pull request as draft May 31, 2026 03:44
Assisted-by: Claude Code:claude-opus-4-7
@fru1tworld fru1tworld marked this pull request as ready for review May 31, 2026 03:51
@fru1tworld
Copy link
Copy Markdown
Author

Thanks for the feedback. I've simplified the approach by removing the withSkipInstallArgs logic and now directly passing skipInstall: boolean to getNextInitCommand in next.ts (0cccc38).
Additionally, I apologize for omitting the AI disclosure trailer in my previous commits. I missed checking AI_POLICY.md regarding this requirement. The Assisted-by trailer is now included.

Copy link
Copy Markdown
Contributor

@2chanhaeng 2chanhaeng left a comment

Choose a reason for hiding this comment

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

Thanks for your contributions, and I like your work! I have some suggestions to make your contribution even better. Please consider applying these reviews.

when(isDry, handleDryRun),
unless(isDry, handleHydRun),
tap(recommendConfigEnv),
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.

It seems more sense to place when(isSkipInstall, noticeSkippedInstall) inside handleHydRun. Or is there a specific reason you intended for it to be here?

) =>
printMessage`
Dependencies were not installed. Run ${
text(`${packageManager} install`)
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.

The text function outputs its arguments so that they appear as plain text. I think commandLine is better for this.

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