Skip to content

serverAuthSetup runs twice for mern+tailwind+auth and mevn+tailwind+auth stacks #277

Description

@vipul674

Bug

For the two *+tailwind+auth stacks, the Express server setup (which runs npm init -y and installs dependencies) executes twice:

  1. Once inside the stack setup itself:
    • mernSetup() calls serverAuthSetup() when config.stack === "mern+tailwind+auth" (utils/installer.js:321-322)
    • mevnTailwindAuthSetup() calls serverAuthSetup() at the end (utils/installer.js:398)
  2. Then again from utils/project.js:
    • mern+tailwind+auth path: project.js:204serverAuthSetup(...) after mernTailwindSetup
    • mevn+tailwind+auth path: project.js:210serverAuthSetup(...) after copyTemplates

Reproduction

  1. celtrix create → stack mern+tailwind+auth
  2. Observe npm init -y + dependency install output twice for the server/ directory

Impact

  • Redundant npm init -y + full dependency install → noticeably slower scaffolding.
  • Second npm init -y rewrites server/package.json (dependencies are dropped, then reinstalled) — wasteful and risks losing the deps between the two passes.

Suggested fix

Call serverAuthSetup in exactly one place per stack — either inside the *Setup helper or in project.js, not both. Prefer keeping it in project.js so the auth-server setup is uniform across stacks.

Environment

  • celtrix v3.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions