Skip to content

Conversation

@meenu155
Copy link
Collaborator


Summary

Adds dynamic service count selection to the project scaffolding flow. Previously, the number of services was hardcoded to 5, which limited flexibility.
Closes #145.

Type of Change

  • Bug fix
  • Feature
  • Chore / Refactor
  • Docs
  • Tests
  • CI / Build
  • Other

Motivation / Context

Currently, the CLI scaffolding process assumes there are always five services. This limits users who may want fewer or more services. This change makes the CLI prompt for the desired number of services before asking for the tech stack of each service, improving flexibility and usability.

Approach

  • Added a new prompt asking the user: “How many services would you like to create?”
  • Dynamically iterated over the number provided to ask for the tech stack of each service.
  • Removed the hardcoded limit of 5 services in scaffoldMonorepo() logic.
  • Ensured compatibility with existing templates and service generation flow.

CLI Impact

New prompt added — now asks for service count before individual tech stack inputs.
✅ Backward compatible (defaults to 5 if not specified in non-interactive mode).

Before:

node bin/index.js demo --services node --no-install --yes
# Always created 5 services

After:

node bin/index.js demo --services node --no-install --yes
# Prompts:
# How many services would you like to create? → 3
# Then asks tech stack for each of the 3 services

Generated Output Impact

  • Updated generated structure to reflect dynamic number of service folders.
  • Example: if user selects 3 services → creates /services/service1, /service2, /service3.
  • Docker Compose and defaultPorts mapping dynamically adjusted to number of services.

Tests

Describe test coverage:

  • Added new test(s) for variable service count.
  • Updated existing scaffold tests.
  • Manually smoke-tested locally.

Smoke test command:

node bin/index.js demo --services node --no-install --yes

Result: ✅ Successful generation with variable service counts (1–10 tested).

Screenshots / Logs (Optional)

✔ How many services would you like to create? 3
✔ Select tech stack for service #1: node
✔ Select tech stack for service #2: python
✔ Select tech stack for service #3: go
✨ Successfully created monorepo with 3 services!

Docs

  • Updated README.md with new prompt details.
  • Updated .github/copilot-instructions.md
  • Not applicable

Checklist

  • Code follows existing style (chalk usage, emoji prefixes, exit codes).
  • No large asset additions outside templates/.
  • Default ports handled dynamically.
  • New prompt validated for numeric input.
  • Git history clean and rebased.
  • Minimal dependencies added.

Open Questions / Follow-ups


Copy link
Owner

@kaifcoder kaifcoder left a comment

Choose a reason for hiding this comment

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

closes #35

@meenu155 meenu155 merged commit 842bfe7 into main Oct 31, 2025
14 checks passed
@meenu155 meenu155 deleted the feature/dynamic-services branch October 31, 2025 15:22
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.

3 participants