Skip to content

refactor(cli): extract shared scaffold logic into scaffold-shared (1/3)#536

Open
moranshe-max wants to merge 1 commit into
mainfrom
feature/scaffold-shared
Open

refactor(cli): extract shared scaffold logic into scaffold-shared (1/3)#536
moranshe-max wants to merge 1 commit into
mainfrom
feature/scaffold-shared

Conversation

@moranshe-max

@moranshe-max moranshe-max commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Note

Description

Extracts the shared post-scaffold setup logic (entity push, site deploy, AI agent skills install, and project summary printing) out of the create command into a new scaffold-shared.ts module. This decouples the reusable setup flow from the create.ts command wiring so it can be shared by other scaffolding commands, with no change to user-facing behavior.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Added packages/cli/src/cli/commands/project/scaffold-shared.ts exposing DEFAULT_TEMPLATE_ID, getTemplateById(), completeProjectSetup(), and printProjectSummary().
  • Moved entity push, site deploy, and AI agent skills installation logic from create.ts into completeProjectSetup().
  • Moved the project/dashboard/site summary output into printProjectSummary().
  • Slimmed down create.ts to import these shared helpers; removed now-unused imports (execa, confirm, isCancel, getDashboardUrl, deploySite, pushEntities, readProjectConfig, join).
  • Changed the ctx parameter in createInteractive/createNonInteractive/executeCreate from a narrowed Pick<CLIContext, ...> to the full CLIContext so it can be passed through to the shared helpers.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (`npm test`)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated `docs/` (AGENTS.md) if I made architectural changes

Additional Notes

Pure refactoring: the logic and prompts are moved verbatim with no behavioral change. completeProjectSetup() documents that it requires setAppConfig() to have run first so getDashboardUrl()/getAppClient() resolve.


🤖 Generated by Claude | 2026-06-10 13:07 UTC | 1c139b6

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/[email protected]

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/[email protected]"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/[email protected]"
  }
}

Preview published to npm registry — try new features instantly!

@moranshe-max moranshe-max changed the title refactor(cli): extract shared scaffold logic into scaffold-shared refactor(cli): extract shared scaffold logic into scaffold-shared (1/3) Jun 9, 2026
@moranshe-max moranshe-max changed the title refactor(cli): extract shared scaffold logic into scaffold-shared (1/3) refactor(cli): extract shared scaffold logic into scaffold-shared (1/4) Jun 9, 2026
Comment thread packages/cli/src/cli/commands/project/scaffold-shared.ts
Comment thread packages/cli/src/cli/commands/project/scaffold-shared.ts Outdated
Comment thread packages/cli/src/cli/commands/project/scaffold-shared.ts Outdated
Comment thread packages/cli/src/cli/commands/project/create.ts Outdated
@moranshe-max moranshe-max changed the title refactor(cli): extract shared scaffold logic into scaffold-shared (1/4) refactor(cli): extract shared scaffold logic into scaffold-shared (1/3) Jun 10, 2026

@kfirstri kfirstri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, Small changes :)

@moranshe-max moranshe-max force-pushed the feature/scaffold-shared branch 3 times, most recently from d77abe1 to 64d9bd8 Compare June 10, 2026 12:44
Move create's post-scaffold steps (push entities, deploy site, install
AI skills, print the project/dashboard/site summary) plus getTemplateById
and DEFAULT_TEMPLATE_ID into a new scaffold-shared.ts, so they can be
reused by sibling commands. Pure refactor — no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@moranshe-max moranshe-max force-pushed the feature/scaffold-shared branch from 64d9bd8 to d26c239 Compare June 10, 2026 13:07
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.

2 participants