Skip to content

[create-content-sdk-app] Add help flag output#494

Open
aeroplaniko-sitecore wants to merge 1 commit into
devfrom
fix/JSS-9643-create-content-sdk-app-help
Open

[create-content-sdk-app] Add help flag output#494
aeroplaniko-sitecore wants to merge 1 commit into
devfrom
fix/JSS-9643-create-content-sdk-app-help

Conversation

@aeroplaniko-sitecore
Copy link
Copy Markdown
Collaborator

@aeroplaniko-sitecore aeroplaniko-sitecore commented May 29, 2026

Description / Motivation

Fixes JSS-9643.

The create-content-sdk-app initializer now handles --help and -h before entering template selection or interactive prompts, displaying usage information and exiting the command flow.

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Ran:

  • yarn test in packages/create-content-sdk-app
  • yarn lint in packages/create-content-sdk-app

Note: lint completed with one existing warning in src/common/processes/transform.ts.

Types of changes

  • 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 change)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

⚠️ No Changeset found

Latest commit: 30aef1e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

📦 Package Size and Test Coverage Report

Package Base Size PR Size Δ Change Base Coverage PR Coverage Δ Change
analytics-core 67.34 KB 67.34 KB ✅ 0.00 KB 97.40% 97.40% 0.00%
cli 59.14 KB 59.14 KB ✅ 0.00 KB 70.09% 70.09% 0.00%
content 429.03 KB 429.03 KB ✅ 0.00 KB 92.38% 92.38% 0.00%
core 120.61 KB 120.61 KB ✅ 0.00 KB 91.27% 91.27% 0.00%
create-content-sdk-app 542.41 KB 543.13 KB 🔺 +0.72 KB 96.35% 96.43% +0.08%
events 72.27 KB 72.27 KB ✅ 0.00 KB 97.97% 97.97% 0.00%
nextjs 568.35 KB 568.35 KB ✅ 0.00 KB 90.97% 90.97% 0.00%
personalize 64.01 KB 64.01 KB ✅ 0.00 KB 99.74% 99.74% 0.00%
react 230.78 KB 230.78 KB ✅ 0.00 KB 93.80% 93.80% 0.00%
search 8.10 KB 8.10 KB ✅ 0.00 KB 98.57% 98.57% 0.00%
Total 🔺 +0.72 KB

Copy link
Copy Markdown
Collaborator

@illiakovalenko illiakovalenko left a comment

Choose a reason for hiding this comment

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

Looks good 👍
A couple of minor suggestions below
Also, please, add a changeset, can be a "patch" version

Comment on lines +36 to +38
Templates:
nextjs
nextjs-app-router
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.

We have a getAllTemplates() function, and it's used in main(), it returns the dynamic list of templates. Currently, when a new template is added, printHelp will silently fall out of sync.
Could you, please, accept here a list of templates and show them?

Comment on lines +33 to +48
console.log(`Usage:
create-content-sdk-app [template] [options]

Templates:
nextjs
nextjs-app-router

Options:
--template <name> Template to scaffold
--destination <path> Destination folder
--yes Use defaults and skip prompts where possible
--force Continue if destination is not empty
--noInstall Skip package install and lint fix
--silent Suppress normal output
--help, -h Show help`);
};
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.

A minor suggestion to add some styling

Suggested change
console.log(`Usage:
create-content-sdk-app [template] [options]
Templates:
nextjs
nextjs-app-router
Options:
--template <name> Template to scaffold
--destination <path> Destination folder
--yes Use defaults and skip prompts where possible
--force Continue if destination is not empty
--noInstall Skip package install and lint fix
--silent Suppress normal output
--help, -h Show help`);
};
console.log(`${chalk.bold('Usage:')} create-content-sdk-app ${chalk.cyan('[template]')} ${chalk.yellow('[options]')}
${chalk.bold('Arguments:')}
${chalk.cyan('template')} Template to scaffold (e.g. nextjs, nextjs-app-router)
Templates: <--TODO - Show a dynamic list of templates -->
nextjs
nextjs-app-router
${chalk.bold('Options:')}
${chalk.yellow('--template')} ${chalk.dim('<name>')} Template to scaffold
${chalk.yellow('--destination')} ${chalk.dim('<path>')} Destination folder
${chalk.yellow('--yes')} Use defaults and skip prompts where possible
${chalk.yellow('--force')} Continue if destination is not empty
${chalk.yellow('--noInstall')} Skip package install and lint fix
${chalk.yellow('--silent')} Suppress normal output
${chalk.yellow('-h, --help')} Show help`);
};

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