From b3616a763b0c13dfe46ea9b67acb3fe2e6ec69d2 Mon Sep 17 00:00:00 2001 From: aramissennyeydd Date: Tue, 11 Mar 2025 22:57:40 -0400 Subject: [PATCH] module: move new commands to their own module Signed-off-by: aramissennyeydd --- packages/cli/src/alpha.ts | 1 + packages/cli/src/commands/index.ts | 63 +----------- packages/cli/src/lib/removed.ts | 25 +++++ packages/cli/src/modules/new/alpha.ts | 99 +++++++++++++++++++ .../GithubCreateAppServer.ts | 0 .../new}/commands/create-github-app/index.ts | 2 +- .../new => modules/new/commands}/new.test.ts | 2 +- .../new => modules/new/commands}/new.ts | 2 +- packages/cli/src/modules/new/index.ts | 70 +++++++++++++ .../new/lib}/createNewPackage.ts | 0 .../new/lib}/defaultTemplates.ts | 0 .../new/lib}/execution/PortableTemplater.ts | 6 +- .../lib}/execution/executePortableTemplate.ts | 4 +- .../new/lib}/execution/index.ts | 0 .../new/lib}/execution/installNewPackage.ts | 4 +- .../execution/writeTemplateContents.test.ts | 2 +- .../lib}/execution/writeTemplateContents.ts | 2 +- .../collectPortableTemplateInput.test.ts | 0 .../collectPortableTemplateInput.ts | 7 +- .../new/lib}/preparation/index.ts | 0 .../preparation/loadPortableTemplate.test.ts | 0 .../lib}/preparation/loadPortableTemplate.ts | 2 +- .../loadPortableTemplateConfig.test.ts | 0 .../preparation/loadPortableTemplateConfig.ts | 2 +- .../preparation/resolvePackageParams.test.ts | 0 .../lib}/preparation/resolvePackageParams.ts | 0 .../selectTemplateInteractively.test.ts | 0 .../selectTemplateInteractively.ts | 0 .../src/{lib/new => modules/new/lib}/types.ts | 0 29 files changed, 218 insertions(+), 75 deletions(-) create mode 100644 packages/cli/src/lib/removed.ts create mode 100644 packages/cli/src/modules/new/alpha.ts rename packages/cli/src/{ => modules/new}/commands/create-github-app/GithubCreateAppServer.ts (100%) rename packages/cli/src/{ => modules/new}/commands/create-github-app/index.ts (98%) rename packages/cli/src/{commands/new => modules/new/commands}/new.test.ts (95%) rename packages/cli/src/{commands/new => modules/new/commands}/new.ts (97%) create mode 100644 packages/cli/src/modules/new/index.ts rename packages/cli/src/{lib/new => modules/new/lib}/createNewPackage.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/defaultTemplates.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/PortableTemplater.ts (94%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/executePortableTemplate.ts (95%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/index.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/installNewPackage.ts (98%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/writeTemplateContents.test.ts (98%) rename packages/cli/src/{lib/new => modules/new/lib}/execution/writeTemplateContents.ts (98%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/collectPortableTemplateInput.test.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/collectPortableTemplateInput.ts (97%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/index.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/loadPortableTemplate.test.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/loadPortableTemplate.ts (98%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/loadPortableTemplateConfig.test.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/loadPortableTemplateConfig.ts (99%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/resolvePackageParams.test.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/resolvePackageParams.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/selectTemplateInteractively.test.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/preparation/selectTemplateInteractively.ts (100%) rename packages/cli/src/{lib/new => modules/new/lib}/types.ts (100%) diff --git a/packages/cli/src/alpha.ts b/packages/cli/src/alpha.ts index f1ccb65a53..6bb16f0f7e 100644 --- a/packages/cli/src/alpha.ts +++ b/packages/cli/src/alpha.ts @@ -25,6 +25,7 @@ import chalk from 'chalk'; ), ); const initializer = new CliInitializer(); + initializer.add(import('./modules/new/alpha')); initializer.add(import('./modules/info/alpha')); initializer.add(import('./modules/config/alpha')); initializer.add(import('./modules/build/alpha')); diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index 6dd2017a71..3f32bd396f 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -40,6 +40,8 @@ import { registerPackageCommands as registerMaintenancePackageCommands, registerRepoCommands as registerMaintenanceRepoCommands, } from '../modules/maintenance'; +import { removed } from '../lib/removed'; +import { registerCommands as registerNewCommands } from '../modules/new'; export function registerRepoCommand(program: Command) { const command = program @@ -66,62 +68,16 @@ export function registerScriptCommand(program: Command) { } export function registerCommands(program: Command) { - program - .command('new') - .storeOptionsAsProperties(false) - .description( - 'Open up an interactive guide to creating new things in your app', - ) - .option( - '--select ', - 'Select the thing you want to be creating upfront', - ) - .option( - '--option =', - 'Pre-fill options for the creation process', - (opt, arr: string[]) => [...arr, opt], - [], - ) - .option( - '--skip-install', - `Skips running 'yarn install' and 'yarn lint --fix'`, - ) - .option('--scope ', 'The scope to use for new packages') - .option( - '--npm-registry ', - 'The package registry to use for new packages', - ) - .option( - '--baseVersion ', - 'The version to use for any new packages (default: 0.1.0)', - ) - .option( - '--license ', - 'The license to use for any new packages (default: Apache-2.0)', - ) - .option('--no-private', 'Do not mark new packages as private') - .action(lazy(() => import('./new/new'), 'default')); - registerConfigCommands(program); registerRepoCommand(program); registerScriptCommand(program); registerMigrateCommand(program); registerBuildCommands(program); registerInfoCommands(program); - program - .command('create-github-app ') - .description('Create new GitHub App in your organization.') - .action(lazy(() => import('./create-github-app'), 'default')); + registerNewCommands(program); // Notifications for removed commands - program - .command('create') - .allowUnknownOption(true) - .action(removed("use 'backstage-cli new' instead")); - program - .command('create-plugin') - .allowUnknownOption(true) - .action(removed("use 'backstage-cli new' instead")); + program .command('plugin:diff') .allowUnknownOption(true) @@ -145,14 +101,3 @@ export function registerCommands(program: Command) { program.command('install').allowUnknownOption(true).action(removed()); program.command('onboard').allowUnknownOption(true).action(removed()); } - -function removed(message?: string) { - return () => { - console.error( - message - ? `This command has been removed, ${message}` - : 'This command has been removed', - ); - process.exit(1); - }; -} diff --git a/packages/cli/src/lib/removed.ts b/packages/cli/src/lib/removed.ts new file mode 100644 index 0000000000..063882be18 --- /dev/null +++ b/packages/cli/src/lib/removed.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export function removed(message?: string) { + return () => { + console.error( + message + ? `This command has been removed, ${message}` + : 'This command has been removed', + ); + process.exit(1); + }; +} diff --git a/packages/cli/src/modules/new/alpha.ts b/packages/cli/src/modules/new/alpha.ts new file mode 100644 index 0000000000..d9b1f44daf --- /dev/null +++ b/packages/cli/src/modules/new/alpha.ts @@ -0,0 +1,99 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { createCliPlugin } from '../../wiring/factory'; +import { Command } from 'commander'; +import { lazy } from '../../lib/lazy'; +import { removed } from '../../lib/removed'; + +export default createCliPlugin({ + pluginId: 'new', + init: async reg => { + reg.addCommand({ + path: ['new'], + description: + 'Open up an interactive guide to creating new things in your app', + execute: async ({ args }) => { + const command = new Command(); + const defaultCommand = command + .storeOptionsAsProperties(false) + .description( + 'Open up an interactive guide to creating new things in your app', + ) + .option( + '--select ', + 'Select the thing you want to be creating upfront', + ) + .option( + '--option =', + 'Pre-fill options for the creation process', + (opt, arr: string[]) => [...arr, opt], + [], + ) + .option( + '--skip-install', + `Skips running 'yarn install' and 'yarn lint --fix'`, + ) + .option('--scope ', 'The scope to use for new packages') + .option( + '--npm-registry ', + 'The package registry to use for new packages', + ) + .option( + '--baseVersion ', + 'The version to use for any new packages (default: 0.1.0)', + ) + .option( + '--license ', + 'The license to use for any new packages (default: Apache-2.0)', + ) + .option('--no-private', 'Do not mark new packages as private') + .action(lazy(() => import('./commands/new'), 'default')); + + await defaultCommand.parseAsync(args, { from: 'user' }); + }, + }); + + reg.addCommand({ + path: ['create'], + description: 'Create a new Backstage app', + execute: async () => { + removed("use 'backstage-cli new' instead")(); + }, + }); + reg.addCommand({ + path: ['create-plugin'], + description: 'Create a new Backstage plugin', + execute: async () => { + removed("use 'backstage-cli new' instead")(); + }, + }); + + reg.addCommand({ + path: ['create-github-app'], + description: 'Create new GitHub App in your organization.', + execute: async ({ args }) => { + const command = new Command(); + const defaultCommand = command + .argument('') + .action( + lazy(() => import('./commands/create-github-app'), 'default'), + ); + + await defaultCommand.parseAsync(args, { from: 'user' }); + }, + }); + }, +}); diff --git a/packages/cli/src/commands/create-github-app/GithubCreateAppServer.ts b/packages/cli/src/modules/new/commands/create-github-app/GithubCreateAppServer.ts similarity index 100% rename from packages/cli/src/commands/create-github-app/GithubCreateAppServer.ts rename to packages/cli/src/modules/new/commands/create-github-app/GithubCreateAppServer.ts diff --git a/packages/cli/src/commands/create-github-app/index.ts b/packages/cli/src/modules/new/commands/create-github-app/index.ts similarity index 98% rename from packages/cli/src/commands/create-github-app/index.ts rename to packages/cli/src/modules/new/commands/create-github-app/index.ts index 105a6b4c24..6c0e422080 100644 --- a/packages/cli/src/commands/create-github-app/index.ts +++ b/packages/cli/src/modules/new/commands/create-github-app/index.ts @@ -18,7 +18,7 @@ import fs from 'fs-extra'; import chalk from 'chalk'; import { stringify as stringifyYaml } from 'yaml'; import inquirer, { Question, Answers } from 'inquirer'; -import { paths } from '../../lib/paths'; +import { paths } from '../../../../lib/paths'; import { GithubCreateAppServer } from './GithubCreateAppServer'; import openBrowser from 'react-dev-utils/openBrowser'; diff --git a/packages/cli/src/commands/new/new.test.ts b/packages/cli/src/modules/new/commands/new.test.ts similarity index 95% rename from packages/cli/src/commands/new/new.test.ts rename to packages/cli/src/modules/new/commands/new.test.ts index e1cb3b0ffa..f301167b8c 100644 --- a/packages/cli/src/commands/new/new.test.ts +++ b/packages/cli/src/modules/new/commands/new.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createNewPackage } from '../../lib/new/createNewPackage'; +import { createNewPackage } from '../lib/createNewPackage'; import { default as newCommand } from './new'; jest.mock('../../lib/new/createNewPackage'); diff --git a/packages/cli/src/commands/new/new.ts b/packages/cli/src/modules/new/commands/new.ts similarity index 97% rename from packages/cli/src/commands/new/new.ts rename to packages/cli/src/modules/new/commands/new.ts index 970034429c..9d09f42cf3 100644 --- a/packages/cli/src/commands/new/new.ts +++ b/packages/cli/src/modules/new/commands/new.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { createNewPackage } from '../../lib/new/createNewPackage'; +import { createNewPackage } from '../lib/createNewPackage'; type ArgOptions = { option: string[]; diff --git a/packages/cli/src/modules/new/index.ts b/packages/cli/src/modules/new/index.ts new file mode 100644 index 0000000000..ec7b2eca3b --- /dev/null +++ b/packages/cli/src/modules/new/index.ts @@ -0,0 +1,70 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { Command } from 'commander'; +import { lazy } from '../../lib/lazy'; +import { removed } from '../../lib/removed'; + +export function registerCommands(program: Command) { + program + .command('new') + .storeOptionsAsProperties(false) + .description( + 'Open up an interactive guide to creating new things in your app', + ) + .option( + '--select ', + 'Select the thing you want to be creating upfront', + ) + .option( + '--option =', + 'Pre-fill options for the creation process', + (opt, arr: string[]) => [...arr, opt], + [], + ) + .option( + '--skip-install', + `Skips running 'yarn install' and 'yarn lint --fix'`, + ) + .option('--scope ', 'The scope to use for new packages') + .option( + '--npm-registry ', + 'The package registry to use for new packages', + ) + .option( + '--baseVersion ', + 'The version to use for any new packages (default: 0.1.0)', + ) + .option( + '--license ', + 'The license to use for any new packages (default: Apache-2.0)', + ) + .option('--no-private', 'Do not mark new packages as private') + .action(lazy(() => import('./commands/new'), 'default')); + + program + .command('create-github-app ') + .description('Create new GitHub App in your organization.') + .action(lazy(() => import('./commands/create-github-app'), 'default')); + + program + .command('create') + .allowUnknownOption(true) + .action(removed("use 'backstage-cli new' instead")); + program + .command('create-plugin') + .allowUnknownOption(true) + .action(removed("use 'backstage-cli new' instead")); +} diff --git a/packages/cli/src/lib/new/createNewPackage.ts b/packages/cli/src/modules/new/lib/createNewPackage.ts similarity index 100% rename from packages/cli/src/lib/new/createNewPackage.ts rename to packages/cli/src/modules/new/lib/createNewPackage.ts diff --git a/packages/cli/src/lib/new/defaultTemplates.ts b/packages/cli/src/modules/new/lib/defaultTemplates.ts similarity index 100% rename from packages/cli/src/lib/new/defaultTemplates.ts rename to packages/cli/src/modules/new/lib/defaultTemplates.ts diff --git a/packages/cli/src/lib/new/execution/PortableTemplater.ts b/packages/cli/src/modules/new/lib/execution/PortableTemplater.ts similarity index 94% rename from packages/cli/src/lib/new/execution/PortableTemplater.ts rename to packages/cli/src/modules/new/lib/execution/PortableTemplater.ts index 8e5e9251d4..519f7c6dbc 100644 --- a/packages/cli/src/lib/new/execution/PortableTemplater.ts +++ b/packages/cli/src/modules/new/lib/execution/PortableTemplater.ts @@ -24,9 +24,9 @@ import startCase from 'lodash/startCase'; import upperCase from 'lodash/upperCase'; import upperFirst from 'lodash/upperFirst'; import lowerFirst from 'lodash/lowerFirst'; -import { Lockfile } from '../../versioning'; -import { paths } from '../../paths'; -import { createPackageVersionProvider } from '../../version'; +import { Lockfile } from '../../../../lib/versioning'; +import { paths } from '../../../../lib/paths'; +import { createPackageVersionProvider } from '../../../../lib/version'; const builtInHelpers = { camelCase, diff --git a/packages/cli/src/lib/new/execution/executePortableTemplate.ts b/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts similarity index 95% rename from packages/cli/src/lib/new/execution/executePortableTemplate.ts rename to packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts index 0041b931ba..cb076f3aa0 100644 --- a/packages/cli/src/lib/new/execution/executePortableTemplate.ts +++ b/packages/cli/src/modules/new/lib/execution/executePortableTemplate.ts @@ -15,8 +15,8 @@ */ import { assertError } from '@backstage/errors'; -import { addCodeownersEntry } from '../../codeowners'; -import { Task } from '../../tasks'; +import { addCodeownersEntry } from '../../../../lib/codeowners'; +import { Task } from '../../../../lib/tasks'; import { PortableTemplate, PortableTemplateConfig, diff --git a/packages/cli/src/lib/new/execution/index.ts b/packages/cli/src/modules/new/lib/execution/index.ts similarity index 100% rename from packages/cli/src/lib/new/execution/index.ts rename to packages/cli/src/modules/new/lib/execution/index.ts diff --git a/packages/cli/src/lib/new/execution/installNewPackage.ts b/packages/cli/src/modules/new/lib/execution/installNewPackage.ts similarity index 98% rename from packages/cli/src/lib/new/execution/installNewPackage.ts rename to packages/cli/src/modules/new/lib/execution/installNewPackage.ts index 39983e29cf..733a688bfb 100644 --- a/packages/cli/src/lib/new/execution/installNewPackage.ts +++ b/packages/cli/src/modules/new/lib/execution/installNewPackage.ts @@ -16,8 +16,8 @@ import fs from 'fs-extra'; import upperFirst from 'lodash/upperFirst'; import camelCase from 'lodash/camelCase'; -import { paths } from '../../paths'; -import { Task } from '../../tasks'; +import { paths } from '../../../../lib/paths'; +import { Task } from '../../../../lib/tasks'; import { PortableTemplateInput } from '../types'; export async function installNewPackage(input: PortableTemplateInput) { diff --git a/packages/cli/src/lib/new/execution/writeTemplateContents.test.ts b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts similarity index 98% rename from packages/cli/src/lib/new/execution/writeTemplateContents.test.ts rename to packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts index 7e0e81f137..a9f1ad61f7 100644 --- a/packages/cli/src/lib/new/execution/writeTemplateContents.test.ts +++ b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.test.ts @@ -17,7 +17,7 @@ import { relative as relativePath } from 'node:path'; import { writeTemplateContents } from './writeTemplateContents'; import { createMockDirectory } from '@backstage/backend-test-utils'; -import { paths } from '../../paths'; +import { paths } from '../../../../lib/paths'; const baseConfig = { version: '0.1.0', diff --git a/packages/cli/src/lib/new/execution/writeTemplateContents.ts b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts similarity index 98% rename from packages/cli/src/lib/new/execution/writeTemplateContents.ts rename to packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts index f54b2d73d6..8b5d6855ca 100644 --- a/packages/cli/src/lib/new/execution/writeTemplateContents.ts +++ b/packages/cli/src/modules/new/lib/execution/writeTemplateContents.ts @@ -17,7 +17,7 @@ import fs from 'fs-extra'; import { dirname, resolve as resolvePath } from 'path'; -import { paths } from '../../paths'; +import { paths } from '../../../../lib/paths'; import { PortableTemplate, PortableTemplateInput } from '../types'; import { ForwardedError, InputError } from '@backstage/errors'; import { isMonoRepo as getIsMonoRepo } from '@backstage/cli-node'; diff --git a/packages/cli/src/lib/new/preparation/collectPortableTemplateInput.test.ts b/packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.test.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/collectPortableTemplateInput.test.ts rename to packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.test.ts diff --git a/packages/cli/src/lib/new/preparation/collectPortableTemplateInput.ts b/packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.ts similarity index 97% rename from packages/cli/src/lib/new/preparation/collectPortableTemplateInput.ts rename to packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.ts index 720993e25c..23a30721b0 100644 --- a/packages/cli/src/lib/new/preparation/collectPortableTemplateInput.ts +++ b/packages/cli/src/modules/new/lib/preparation/collectPortableTemplateInput.ts @@ -15,8 +15,11 @@ */ import inquirer, { DistinctQuestion } from 'inquirer'; -import { getCodeownersFilePath, parseOwnerIds } from '../../codeowners'; -import { paths } from '../../paths'; +import { + getCodeownersFilePath, + parseOwnerIds, +} from '../../../../lib/codeowners'; +import { paths } from '../../../../lib/paths'; import { PortableTemplateConfig, PortableTemplateInput, diff --git a/packages/cli/src/lib/new/preparation/index.ts b/packages/cli/src/modules/new/lib/preparation/index.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/index.ts rename to packages/cli/src/modules/new/lib/preparation/index.ts diff --git a/packages/cli/src/lib/new/preparation/loadPortableTemplate.test.ts b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplate.test.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/loadPortableTemplate.test.ts rename to packages/cli/src/modules/new/lib/preparation/loadPortableTemplate.test.ts diff --git a/packages/cli/src/lib/new/preparation/loadPortableTemplate.ts b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplate.ts similarity index 98% rename from packages/cli/src/lib/new/preparation/loadPortableTemplate.ts rename to packages/cli/src/modules/new/lib/preparation/loadPortableTemplate.ts index c792119ae6..f59546a308 100644 --- a/packages/cli/src/lib/new/preparation/loadPortableTemplate.ts +++ b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplate.ts @@ -20,7 +20,7 @@ import recursiveReaddir from 'recursive-readdir'; import { resolve as resolvePath, relative as relativePath } from 'path'; import { dirname } from 'node:path'; import { parse as parseYaml } from 'yaml'; -import { paths } from '../../paths'; +import { paths } from '../../../../lib/paths'; import { PortableTemplateFile, PortableTemplatePointer, diff --git a/packages/cli/src/lib/new/preparation/loadPortableTemplateConfig.test.ts b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplateConfig.test.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/loadPortableTemplateConfig.test.ts rename to packages/cli/src/modules/new/lib/preparation/loadPortableTemplateConfig.test.ts diff --git a/packages/cli/src/lib/new/preparation/loadPortableTemplateConfig.ts b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplateConfig.ts similarity index 99% rename from packages/cli/src/lib/new/preparation/loadPortableTemplateConfig.ts rename to packages/cli/src/modules/new/lib/preparation/loadPortableTemplateConfig.ts index d4705b0320..5ef61bfb6b 100644 --- a/packages/cli/src/lib/new/preparation/loadPortableTemplateConfig.ts +++ b/packages/cli/src/modules/new/lib/preparation/loadPortableTemplateConfig.ts @@ -16,7 +16,7 @@ import fs from 'fs-extra'; import { resolve as resolvePath, dirname, isAbsolute } from 'node:path'; -import { paths } from '../../paths'; +import { paths } from '../../../../lib/paths'; import { defaultTemplates } from '../defaultTemplates'; import { PortableTemplateConfig, diff --git a/packages/cli/src/lib/new/preparation/resolvePackageParams.test.ts b/packages/cli/src/modules/new/lib/preparation/resolvePackageParams.test.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/resolvePackageParams.test.ts rename to packages/cli/src/modules/new/lib/preparation/resolvePackageParams.test.ts diff --git a/packages/cli/src/lib/new/preparation/resolvePackageParams.ts b/packages/cli/src/modules/new/lib/preparation/resolvePackageParams.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/resolvePackageParams.ts rename to packages/cli/src/modules/new/lib/preparation/resolvePackageParams.ts diff --git a/packages/cli/src/lib/new/preparation/selectTemplateInteractively.test.ts b/packages/cli/src/modules/new/lib/preparation/selectTemplateInteractively.test.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/selectTemplateInteractively.test.ts rename to packages/cli/src/modules/new/lib/preparation/selectTemplateInteractively.test.ts diff --git a/packages/cli/src/lib/new/preparation/selectTemplateInteractively.ts b/packages/cli/src/modules/new/lib/preparation/selectTemplateInteractively.ts similarity index 100% rename from packages/cli/src/lib/new/preparation/selectTemplateInteractively.ts rename to packages/cli/src/modules/new/lib/preparation/selectTemplateInteractively.ts diff --git a/packages/cli/src/lib/new/types.ts b/packages/cli/src/modules/new/lib/types.ts similarity index 100% rename from packages/cli/src/lib/new/types.ts rename to packages/cli/src/modules/new/lib/types.ts