From 090b2873ac70091a7e5ad8182913152696d6b29f Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 10 Feb 2025 17:11:04 +0100 Subject: [PATCH] cli/new: add deprecation warning for global config via cli args Signed-off-by: Patrik Oldsberg --- packages/cli/src/commands/new/new.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/new/new.ts b/packages/cli/src/commands/new/new.ts index 62b746a7a8..df495323f5 100644 --- a/packages/cli/src/commands/new/new.ts +++ b/packages/cli/src/commands/new/new.ts @@ -31,6 +31,7 @@ export default async (opts: ArgOptions) => { option: rawArgOptions, select: preselectedTemplateId, scope, + private: isPrivate, ...otherGlobals } = opts; @@ -46,13 +47,22 @@ export default async (opts: ArgOptions) => { pluginInfix = scope.includes('backstage') ? 'plugin-' : 'backstage-plugin-'; } + if ( + isPrivate === false || // set to false with --no-private flag + Object.values(otherGlobals).filter(Boolean).length !== 0 + ) { + console.warn( + `Global template configuration via CLI flags is deprecated, see https://backstage.io/docs/cli/new for information on how to configure package templating`, + ); + } + await createNewPackage({ prefilledParams, preselectedTemplateId, configOverrides: { license: otherGlobals.license, version: otherGlobals.baseVersion, - private: otherGlobals.private, + private: isPrivate, publishRegistry: otherGlobals.npmRegistry, packageNamePrefix: packagePrefix, packageNamePluginInfix: pluginInfix,