From a773834cc7cfa939d1bebc67aaa507ef7333c8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20G=C3=B3ral?= Date: Fri, 13 Dec 2024 16:02:14 +0700 Subject: [PATCH] feat!: remove `generate` command from cli (#7351) --- .changeset/shaggy-turtles-ring.md | 5 + packages/cli/README.md | 116 ++++++++++--- .../cli/__tests__/domains/async/wait.spec.ts | 15 -- .../domains/directory/existsDirectory.spec.ts | 22 --- .../domains/directory/getDirectory.spec.ts | 64 ------- .../directory/removeFileOrDirectory.spec.ts | 28 --- .../domains/error/resolveToError.spec.ts | 45 ----- .../extractSuggestionFromError.spec.ts | 78 --------- .../getGitRepositoryURL.spec.ts | 138 --------------- .../validateGitRepositoryURL.spec.ts | 35 ---- .../git-repository/cloneGitRepository.spec.ts | 27 --- .../terminateGitRepository.spec.ts | 20 --- .../domains/integration/Integration.spec.ts | 17 -- .../integration/fetchIntegrations.spec.ts | 16 -- .../domains/magento2/confirmOverwrite.spec.ts | 62 ------- .../magento2/getMagentoDirName.spec.ts | 68 -------- .../domains/magento2/getMagentoDomain.spec.ts | 68 -------- .../magento2/handleMagentoKeys.unused.ts | 55 ------ .../magento2/isGenerateSampleData.spec.ts | 61 ------- .../domains/magento2/isInstallMagento.spec.ts | 46 ----- .../domains/magento2/isMagentoKeys.spec.ts | 44 ----- .../__tests__/domains/math/identity.spec.ts | 10 -- .../project-name/formatToProjectName.spec.ts | 13 -- .../project-name/getProjectName.spec.ts | 68 -------- .../cli/__tests__/terminalHelpers.spec.ts | 20 --- packages/cli/package.json | 2 +- packages/cli/src/commands/generate/store.ts | 164 ------------------ .../cli/src/commands/generate/template.ts | 53 ------ packages/cli/src/commands/init.ts | 17 -- packages/cli/src/commands/m2-only.ts | 52 ------ .../cli/src/domains/generate/async/index.ts | 1 - .../cli/src/domains/generate/async/wait.ts | 11 -- .../generate/directory/existsDirectory.ts | 15 -- .../generate/directory/getDirectory.ts | 33 ---- .../directory/handleProjectDiretoryExists.ts | 47 ----- .../src/domains/generate/directory/index.ts | 3 - .../directory/removeFileOrDirectory.ts | 5 - .../cli/src/domains/generate/error/index.ts | 1 - .../domains/generate/error/resolveToError.ts | 16 -- .../extractSuggestionFromError.ts | 19 -- .../git-repository-url/getGitRepositoryURL.ts | 64 ------- .../generate/git-repository-url/index.ts | 3 - .../validateGitRepositoryURL.ts | 18 -- .../git-repository/cloneGitRepository.ts | 22 --- .../domains/generate/git-repository/index.ts | 2 - .../git-repository/terminateGitRepository.ts | 9 - .../generate/integration/Integration.ts | 7 - .../generate/integration/fetchIntegrations.ts | 12 -- .../generate/integration/getIntegration.ts | 64 ------- .../src/domains/generate/integration/index.ts | 3 - .../src/domains/generate/logging/logger.ts | 18 -- .../generate/magento2/docker/checkDocker.ts | 42 ----- .../docker/checkExistingDockerContainers.ts | 16 -- .../domains/generate/magento2/docker/index.ts | 5 - .../magento2/docker/installMagentoImage.ts | 97 ----------- .../generate/magento2/docker/removeDocker.ts | 19 -- .../generate/magento2/functions/checkNode.ts | 42 ----- .../generate/magento2/functions/checkYarn.ts | 54 ------ .../generate/magento2/functions/copyAuth.ts | 37 ---- .../generate/magento2/functions/copyEnv.ts | 37 ---- .../magento2/functions/getMagentoDetails.ts | 71 -------- .../magento2/functions/handleGraphQL.ts | 81 --------- .../magento2/functions/handleSampleData.ts | 54 ------ .../generate/magento2/functions/index.ts | 12 -- .../magento2/functions/installDeps.ts | 41 ----- .../magento2/functions/terminalHelpers.ts | 32 ---- .../generate/magento2/installMagento.ts | 46 ----- .../magento2/prompts/confirmOverwrite.ts | 52 ------ .../magento2/prompts/getMagentoDirName.ts | 42 ----- .../magento2/prompts/getMagentoDomain.ts | 34 ---- .../magento2/prompts/handleMagentoKeys.ts | 95 ---------- .../magento2/prompts/isGenerateSampleData.ts | 20 --- .../magento2/prompts/isInstallMagento.ts | 15 -- .../magento2/prompts/isMagentoKeys.ts | 20 --- .../cli/src/domains/generate/math/identity.ts | 8 - .../cli/src/domains/generate/math/index.ts | 1 - .../project-name/formatToProjectName.ts | 6 - .../generate/project-name/getProjectName.ts | 32 ---- .../domains/generate/project-name/index.ts | 2 - .../cli/src/domains/generate/theme/index.ts | 1 - .../domains/generate/theme/inheritTheme.ts | 57 ------ .../generate/theme/processMagicComments.ts | 16 -- .../generate/theme/removeDevCommentBlocks.ts | 8 - .../theme/uncommentProjectOnlyBlocks.ts | 8 - packages/cli/src/infrastructures/i18next.ts | 18 -- 85 files changed, 95 insertions(+), 2828 deletions(-) create mode 100644 .changeset/shaggy-turtles-ring.md delete mode 100644 packages/cli/__tests__/domains/async/wait.spec.ts delete mode 100644 packages/cli/__tests__/domains/directory/existsDirectory.spec.ts delete mode 100644 packages/cli/__tests__/domains/directory/getDirectory.spec.ts delete mode 100644 packages/cli/__tests__/domains/directory/removeFileOrDirectory.spec.ts delete mode 100644 packages/cli/__tests__/domains/error/resolveToError.spec.ts delete mode 100644 packages/cli/__tests__/domains/git-repository-url/extractSuggestionFromError.spec.ts delete mode 100644 packages/cli/__tests__/domains/git-repository-url/getGitRepositoryURL.spec.ts delete mode 100644 packages/cli/__tests__/domains/git-repository-url/validateGitRepositoryURL.spec.ts delete mode 100644 packages/cli/__tests__/domains/git-repository/cloneGitRepository.spec.ts delete mode 100644 packages/cli/__tests__/domains/git-repository/terminateGitRepository.spec.ts delete mode 100644 packages/cli/__tests__/domains/integration/Integration.spec.ts delete mode 100644 packages/cli/__tests__/domains/integration/fetchIntegrations.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/confirmOverwrite.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/getMagentoDirName.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/getMagentoDomain.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/handleMagentoKeys.unused.ts delete mode 100644 packages/cli/__tests__/domains/magento2/isGenerateSampleData.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/isInstallMagento.spec.ts delete mode 100644 packages/cli/__tests__/domains/magento2/isMagentoKeys.spec.ts delete mode 100644 packages/cli/__tests__/domains/math/identity.spec.ts delete mode 100644 packages/cli/__tests__/domains/project-name/formatToProjectName.spec.ts delete mode 100644 packages/cli/__tests__/domains/project-name/getProjectName.spec.ts delete mode 100644 packages/cli/__tests__/terminalHelpers.spec.ts delete mode 100644 packages/cli/src/commands/generate/store.ts delete mode 100644 packages/cli/src/commands/generate/template.ts delete mode 100644 packages/cli/src/commands/init.ts delete mode 100644 packages/cli/src/commands/m2-only.ts delete mode 100644 packages/cli/src/domains/generate/async/index.ts delete mode 100644 packages/cli/src/domains/generate/async/wait.ts delete mode 100644 packages/cli/src/domains/generate/directory/existsDirectory.ts delete mode 100644 packages/cli/src/domains/generate/directory/getDirectory.ts delete mode 100644 packages/cli/src/domains/generate/directory/handleProjectDiretoryExists.ts delete mode 100644 packages/cli/src/domains/generate/directory/index.ts delete mode 100644 packages/cli/src/domains/generate/directory/removeFileOrDirectory.ts delete mode 100644 packages/cli/src/domains/generate/error/index.ts delete mode 100644 packages/cli/src/domains/generate/error/resolveToError.ts delete mode 100644 packages/cli/src/domains/generate/git-repository-url/extractSuggestionFromError.ts delete mode 100644 packages/cli/src/domains/generate/git-repository-url/getGitRepositoryURL.ts delete mode 100644 packages/cli/src/domains/generate/git-repository-url/index.ts delete mode 100644 packages/cli/src/domains/generate/git-repository-url/validateGitRepositoryURL.ts delete mode 100644 packages/cli/src/domains/generate/git-repository/cloneGitRepository.ts delete mode 100644 packages/cli/src/domains/generate/git-repository/index.ts delete mode 100644 packages/cli/src/domains/generate/git-repository/terminateGitRepository.ts delete mode 100644 packages/cli/src/domains/generate/integration/Integration.ts delete mode 100644 packages/cli/src/domains/generate/integration/fetchIntegrations.ts delete mode 100644 packages/cli/src/domains/generate/integration/getIntegration.ts delete mode 100644 packages/cli/src/domains/generate/integration/index.ts delete mode 100644 packages/cli/src/domains/generate/logging/logger.ts delete mode 100644 packages/cli/src/domains/generate/magento2/docker/checkDocker.ts delete mode 100644 packages/cli/src/domains/generate/magento2/docker/checkExistingDockerContainers.ts delete mode 100644 packages/cli/src/domains/generate/magento2/docker/index.ts delete mode 100644 packages/cli/src/domains/generate/magento2/docker/installMagentoImage.ts delete mode 100644 packages/cli/src/domains/generate/magento2/docker/removeDocker.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/checkNode.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/checkYarn.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/copyAuth.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/copyEnv.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/getMagentoDetails.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/handleGraphQL.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/handleSampleData.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/index.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/installDeps.ts delete mode 100644 packages/cli/src/domains/generate/magento2/functions/terminalHelpers.ts delete mode 100644 packages/cli/src/domains/generate/magento2/installMagento.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/confirmOverwrite.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/getMagentoDirName.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/getMagentoDomain.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/handleMagentoKeys.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/isGenerateSampleData.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/isInstallMagento.ts delete mode 100644 packages/cli/src/domains/generate/magento2/prompts/isMagentoKeys.ts delete mode 100644 packages/cli/src/domains/generate/math/identity.ts delete mode 100644 packages/cli/src/domains/generate/math/index.ts delete mode 100644 packages/cli/src/domains/generate/project-name/formatToProjectName.ts delete mode 100644 packages/cli/src/domains/generate/project-name/getProjectName.ts delete mode 100644 packages/cli/src/domains/generate/project-name/index.ts delete mode 100644 packages/cli/src/domains/generate/theme/index.ts delete mode 100644 packages/cli/src/domains/generate/theme/inheritTheme.ts delete mode 100644 packages/cli/src/domains/generate/theme/processMagicComments.ts delete mode 100644 packages/cli/src/domains/generate/theme/removeDevCommentBlocks.ts delete mode 100644 packages/cli/src/domains/generate/theme/uncommentProjectOnlyBlocks.ts delete mode 100644 packages/cli/src/infrastructures/i18next.ts diff --git a/.changeset/shaggy-turtles-ring.md b/.changeset/shaggy-turtles-ring.md new file mode 100644 index 0000000000..303431adfe --- /dev/null +++ b/.changeset/shaggy-turtles-ring.md @@ -0,0 +1,5 @@ +--- +"@vue-storefront/cli": major +--- + +**[REMOVED]** `generate` command. If you are an enterprise user, please check the [Getting started](https://docs.alokai.com/storefront/introduction/getting-started) page in the docs. If you are a community user, please check the example [Next.js project](https://github.com/vuestorefront/storefront-next13-boilerplate) and [Nuxt project](https://github.com/vuestorefront/storefront-nuxt3-boilerplate). diff --git a/packages/cli/README.md b/packages/cli/README.md index b9691d2976..5ecf62fa45 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -17,10 +17,11 @@ npx @vue-storefront/cli generate template ## Commands -* [`@vue-storefront/cli generate store`](#vue-storefrontcli-generate-store) -* [`@vue-storefront/cli generate template`](#vue-storefrontcli-generate-template) -* [`@vue-storefront/cli help [COMMAND]`](#vue-storefrontcli-help-command) -* [`@vue-storefront/cli init`](#vue-storefrontcli-init) +* [`@vue-storefront/cli add [COMMANDARG] [ENDPOINT]`](#vue-storefrontcli-add-commandarg-endpoint) +* [`@vue-storefront/cli add endpoint [NAME]`](#vue-storefrontcli-add-endpoint-name) +* [`@vue-storefront/cli create [COMMANDNAME] [INTEGRATIONNAME]`](#vue-storefrontcli-create-commandname-integrationname) +* [`@vue-storefront/cli create integration [NAME]`](#vue-storefrontcli-create-integration-name) +* [`@vue-storefront/cli help [COMMANDS]`](#vue-storefrontcli-help-commands) * [`@vue-storefront/cli plugins`](#vue-storefrontcli-plugins) * [`@vue-storefront/cli plugins:install PLUGIN...`](#vue-storefrontcli-pluginsinstall-plugin) * [`@vue-storefront/cli plugins:inspect PLUGIN...`](#vue-storefrontcli-pluginsinspect-plugin) @@ -32,60 +33,108 @@ npx @vue-storefront/cli generate template * [`@vue-storefront/cli plugins update`](#vue-storefrontcli-plugins-update) * [`@vue-storefront/cli update [CHANNEL]`](#vue-storefrontcli-update-channel) -## `@vue-storefront/cli generate store` +## `@vue-storefront/cli add [COMMANDARG] [ENDPOINT]` + +Create new endpoint boilerplate code ``` USAGE - $ @vue-storefront/cli generate store + $ @vue-storefront/cli add [COMMANDARG] [ENDPOINT] + +ARGUMENTS + COMMANDARG Name of the command + ENDPOINT Name of the endpoint + +DESCRIPTION + Create new endpoint boilerplate code EXAMPLES - $ @vue-storefront/cli generate store + $ @vue-storefront/cli add ``` -## `@vue-storefront/cli generate template` +_See code: [src/commands/add/index.ts](https://github.com/vuestorefront/vue-storefront/blob/v5.0.0/src/commands/add/index.ts)_ + +## `@vue-storefront/cli add endpoint [NAME]` + +Create new endpoint boilerplate code ``` USAGE - $ @vue-storefront/cli generate template [--output ] + $ @vue-storefront/cli add endpoint [NAME] -FLAGS - --output= [default: .] +ARGUMENTS + NAME Name of the endpoint + +DESCRIPTION + Create new endpoint boilerplate code EXAMPLES - $ @vue-storefront/cli generate template + $ @vue-storefront/cli add endpoint ``` -## `@vue-storefront/cli help [COMMAND]` +_See code: [src/commands/add/endpoint.ts](https://github.com/vuestorefront/vue-storefront/blob/v5.0.0/src/commands/add/endpoint.ts)_ -Display help for @vue-storefront/cli. +## `@vue-storefront/cli create [COMMANDNAME] [INTEGRATIONNAME]` + +Generate integration boilerplate ``` USAGE - $ @vue-storefront/cli help [COMMAND] [-n] - -ARGUMENTS - COMMAND Command to show help for. + $ @vue-storefront/cli create [COMMANDNAME] [INTEGRATIONNAME] [-t nuxt|next] FLAGS - -n, --nested-commands Include all nested commands in the output. + -t, --framework=