Skip to content

Make smoke-test generation in fedify init opt-in (or opt-out) #994

Description

@2chanhaeng

Summary

#990 makes fedify init unconditionally generate a smoke-test script (scripts/smokeTest.ts) together with a test task/script and, for Node.js-based package managers, a tsx dev dependency. This issue proposes turning that into an opt-in flag (working name: --smoke-test or --with-smoke-test): by default nothing extra is generated, and users who want the smoke test ask for it explicitly.

Motivation

  • Less generated code for newcomers to digest. For a beginner, every auto-generated file is one more thing they feel obliged to read and understand before they trust their project. A scaffold that stays minimal by default is less stressful to approach; the smoke test is a convenience, not something the app needs to run.
  • Experienced users will find the flag themselves. Developers who want a smoke test are exactly the ones who skim fedify init --help and pick the options they need, so an opt-in flag reaches its audience without imposing on anyone else.
  • Avoids side effects on projects that did not ask for it. Some framework scaffolders ship their own testing setup (e.g. a SvelteKit project scaffolded with Vitest already claims the test script), and the smoke test pulls in an extra dev dependency (tsx) on Node.js-based package managers. Making generation explicit sidesteps both concerns.
  • The CLI already has precedent for behavior-toggling flags: --skip-install, --allow-non-empty, and --dry-run in packages/init/src/command.ts.

Proposed behavior

  • fedify init --smoke-test generates what Add a smoke test to generated fedify init apps #990 currently generates unconditionally:
    • scripts/smokeTest.ts,
    • the test task (deno.json) / test script (package.json),
    • the tsx dev dependency where the smoke test needs it.
  • Without the flag, none of the above is generated.
  • No new interactive prompt: the flag is CLI-only, mirroring how --skip-install works today.

Acceptable alternative: opt-out

The discussion in #898 leaned toward giving every generated project a working test task out of the box, which an opt-in default walks back. If maintainers prefer to keep that default, an opt-out flag (--no-smoke-test) that skips the generation is an acceptable outcome for this issue as well. The core request is that smoke-test generation becomes controllable from the CLI; whether the default is on or off is open to maintainer preference.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions