cli: leave initial create logging to the factories
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -80,9 +80,6 @@ export default async (cmd: Command) => {
|
||||
|
||||
let modified = false;
|
||||
try {
|
||||
Task.log();
|
||||
Task.log(`Creating new ${factory.name}`);
|
||||
|
||||
await factory.create(options, {
|
||||
isMonoRepo,
|
||||
defaultVersion,
|
||||
|
||||
@@ -90,6 +90,8 @@ describe('backendPlugin factory', () => {
|
||||
expect(modified).toBe(true);
|
||||
|
||||
expect(output).toEqual([
|
||||
'',
|
||||
'Creating backend plugin plugin-test-backend',
|
||||
'Checking Prerequisites:',
|
||||
'availability plugins/test-backend ✔',
|
||||
'creating temp dir ✔',
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import chalk from 'chalk';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import { paths } from '../../paths';
|
||||
import { addCodeownersEntry, getCodeownersFilePath } from '../../codeowners';
|
||||
@@ -40,6 +41,9 @@ export const backendPlugin = createFactory<Options>({
|
||||
const id = `${options.id}-backend`;
|
||||
const name = ctx.scope ? `@${ctx.scope}/plugin-${id}` : `plugin-${id}`;
|
||||
|
||||
Task.log();
|
||||
Task.log(`Creating backend plugin ${chalk.cyan(name)}`);
|
||||
|
||||
const targetDir = ctx.isMonoRepo
|
||||
? paths.resolveTargetRoot('plugins', id)
|
||||
: paths.resolveTargetRoot(`backstage-plugin-${id}`);
|
||||
|
||||
@@ -103,6 +103,8 @@ describe('frontendPlugin factory', () => {
|
||||
expect(modified).toBe(true);
|
||||
|
||||
expect(output).toEqual([
|
||||
'',
|
||||
'Creating backend plugin plugin-test',
|
||||
'Checking Prerequisites:',
|
||||
'availability plugins/test ✔',
|
||||
'creating temp dir ✔',
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import chalk from 'chalk';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import { paths } from '../../paths';
|
||||
@@ -43,6 +44,9 @@ export const frontendPlugin = createFactory<Options>({
|
||||
const name = ctx.scope ? `@${ctx.scope}/plugin-${id}` : `plugin-${id}`;
|
||||
const extensionName = `${upperFirst(camelCase(id))}Page`;
|
||||
|
||||
Task.log();
|
||||
Task.log(`Creating backend plugin ${chalk.cyan(name)}`);
|
||||
|
||||
const targetDir = ctx.isMonoRepo
|
||||
? paths.resolveTargetRoot('plugins', id)
|
||||
: paths.resolveTargetRoot(`backstage-plugin-${id}`);
|
||||
|
||||
@@ -85,6 +85,8 @@ describe('pluginCommon factory', () => {
|
||||
expect(modified).toBe(true);
|
||||
|
||||
expect(output).toEqual([
|
||||
'',
|
||||
'Creating backend plugin plugin-test-common',
|
||||
'Checking Prerequisites:',
|
||||
'availability plugins/test-common ✔',
|
||||
'creating temp dir ✔',
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import chalk from 'chalk';
|
||||
import { paths } from '../../paths';
|
||||
import { addCodeownersEntry, getCodeownersFilePath } from '../../codeowners';
|
||||
import { createFactory, CreateContext } from '../types';
|
||||
@@ -38,6 +39,9 @@ export const pluginCommon = createFactory<Options>({
|
||||
const id = `${options.id}-common`;
|
||||
const name = ctx.scope ? `@${ctx.scope}/plugin-${id}` : `plugin-${id}`;
|
||||
|
||||
Task.log();
|
||||
Task.log(`Creating backend plugin ${chalk.cyan(name)}`);
|
||||
|
||||
const targetDir = ctx.isMonoRepo
|
||||
? paths.resolveTargetRoot('plugins', id)
|
||||
: paths.resolveTargetRoot(`backstage-plugin-${id}`);
|
||||
|
||||
Reference in New Issue
Block a user