Skip to content

Commit 4d21e48

Browse files
committed
Merge branch 'main' into feat/merge-sdk-cli
2 parents fd0beb2 + 6fe8040 commit 4d21e48

File tree

10 files changed

+69
-18
lines changed

10 files changed

+69
-18
lines changed

packages/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vue-storefront/cli",
3-
"version": "4.1.1",
3+
"version": "4.2.2",
44
"description": "Vue Storefront's CLI.",
55
"bin": "./bin/run",
66
"homepage": "https://github.com/vuestorefront/vue-storefront",

packages/cli/src/commands/m2-only.ts

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { intro } from '@clack/prompts';
2+
import { Command } from '@oclif/core';
3+
import { initLogger } from '../domains/logging/logger';
4+
import { checkDocker, getMagentoDomainName } from '../domains/magento2/docker';
5+
import { getMagentoDetails } from '../domains/magento2/functions';
6+
import { installMagento } from '../domains/magento2/installMagento';
7+
import { simpleLog } from '../domains/magento2/functions/terminalHelpers';
8+
import picocolors from 'picocolors';
9+
import { t } from 'i18next';
10+
11+
export default class M2Only extends Command {
12+
static override description = 'Install local Magento 2 instance';
13+
14+
static override examples = ['<%= config.bin %> <%= command.id %>'];
15+
16+
static override flags = {};
17+
18+
static override args = [];
19+
20+
async run(): Promise<void> {
21+
const { writeLog, deleteLog } = initLogger();
22+
23+
intro('Welcome to the Magento 2 local instance installer!');
24+
25+
await checkDocker(writeLog);
26+
27+
const { magentoDirName, magentoAccessKey, magentoSecretKey } =
28+
await getMagentoDetails();
29+
30+
const magentoDomain = await getMagentoDomainName(
31+
t('command.generate_store.magento.domain')
32+
);
33+
34+
await installMagento({
35+
isInstallMagento: true,
36+
magentoDirName,
37+
magentoDomain,
38+
magentoAccessKey,
39+
magentoSecretKey,
40+
writeLog
41+
});
42+
43+
deleteLog();
44+
45+
simpleLog('Happy coding! 🎉', picocolors.green);
46+
47+
this.exit(0);
48+
}
49+
}

packages/cli/src/domains/generate/git-repository-url/getGitRepositoryURL.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ import { simpleLog } from '../magento2/functions/terminalHelpers';
99
const validateURL = async (url: string): Promise<void | any> => {
1010
const error = await validateGitRepositoryURL(url);
1111

12-
simpleLog(
13-
error instanceof git.Errors.UrlParseError
14-
? t<string>('domain.git_repository_url.is_invalid')
15-
: t<string>('domain.git_repository_url.was_not_found')
16-
);
12+
if (error) {
13+
simpleLog(
14+
error instanceof git.Errors.UrlParseError
15+
? t<string>('domain.git_repository_url.is_invalid')
16+
: t<string>('domain.git_repository_url.was_not_found')
17+
);
18+
}
1719

1820
return error;
1921
};

packages/cli/src/domains/generate/magento2/docker/checkDocker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ const checkDocker = async (
2626

2727
if (!isDockerInstalled) {
2828
writeLog(
29-
'Docker is not installed or not running. Please make sure that prerequisites are complied with and run command again. For more information, please visit https://docs.vuestorefront.io/magento/installation-setup/configure-magento.html'
29+
'Docker is not installed or not running. Please make sure that prerequisites are complied with and run command again.'
3030
);
3131
logSimpleErrorMessage(
32-
'Docker is not installed or not running. Please make sure that prerequisites are complied with and run command again. For more information, please visit https://docs.vuestorefront.io/magento/installation-setup/configure-magento.html'
32+
'Docker is not installed or not running. Please make sure that prerequisites are complied with and run command again.'
3333
);
3434
logSimpleInfoMessage(t('command.generate_store.magento.failed_log'));
3535
process.exit(1);

packages/cli/src/domains/generate/magento2/functions/copyEnv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const copyEnv = async (vsfDirName: string, magentoDomain?: string) => {
3131
process.exit(1);
3232
}
3333

34-
fs.rmdirSync(path.join(vsfDirName, '.env.example'));
34+
fs.unlinkSync(path.join(vsfDirName, '.env.example'));
3535
};
3636

3737
export default copyEnv;

packages/cli/src/domains/generate/magento2/functions/getMagentoDetails.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { t } from 'i18next';
77
import handleMagentoKeys from '../prompts/handleMagentoKeys';
88
import { note } from '@clack/prompts';
99

10-
const getMagentoDetails = async (projectName: string) => {
10+
const getMagentoDetails = async (projectName?: string) => {
1111
let magentoAccessKey: string;
1212
let magentoSecretKey: string;
1313

packages/docs/.vuepress/integrations.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ const INTEGRATIONS = {
7272
},
7373
{
7474
name: 'Sylius',
75-
link: 'https://github.com/BitBagCommerce/SyliusVueStorefront2Plugin',
75+
link: 'https://vsf2-docs.bitbag.io/',
7676
image: 'https://uploads-ssl.webflow.com/5e90e5cd5f86784ad554a3c2/5ed6275b7df0e61000941a54_sylius_logo.svg',
77-
status: STATUS.BETA,
77+
status: STATUS.STABLE,
7878
license: LICENSE.OPEN_SOURCE,
7979
maintainedBy: [{ name: 'BitBag', link: 'https://bitbag.io/' }],
8080
},

packages/docs/.vuepress/theme/layouts/Integrations.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="prose pt-8 container relative mx-auto max-w-7xl gap-y-16">
44
<Content slot-key="header" />
55
</div>
6-
<div class="mt-12 pt-6 bg-gray-50 dark:bg-zinc-800">
6+
<div class="mt-12 pt-6">
77
<div class="container relative mx-auto max-w-7xl gap-y-16 grid grid-cols-12 lg:gap-8">
88
<aside class="hidden lg:block lg:col-span-3 relative">
99
<nav class="sticky top-32 mt-9 custom-block text-black dark:text-white text-sm flex flex-col">

packages/docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
"dependencies": {
3131
"sass-loader": "^8.0.2",
3232
"tailwindcss": "npm:@tailwindcss/postcss7-compat",
33-
"vuepress-theme-vsf-docs": "^1.2.20"
33+
"vuepress-theme-vsf-docs": "^1.3.1"
3434
}
3535
}

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -17657,10 +17657,10 @@ vuepress-plugin-smooth-scroll@^0.0.3:
1765717657
dependencies:
1765817658
smoothscroll-polyfill "^0.4.3"
1765917659

17660-
vuepress-theme-vsf-docs@^1.2.20:
17661-
version "1.2.20"
17662-
resolved "https://registry.npmjs.org/vuepress-theme-vsf-docs/-/vuepress-theme-vsf-docs-1.2.20.tgz#f4e59dc4ce3a179ce05d42e3648adae2962dbfc4"
17663-
integrity sha512-Kw+wMcXHls1+GrOU7lxRrrIaiA+SkYQ1Tf4xNHUHdd+cwTWhtWfO0nG02Rtqr1Qmt2+Ug7v++o8SSRJhuldVaw==
17660+
vuepress-theme-vsf-docs@^1.3.1:
17661+
version "1.3.1"
17662+
resolved "https://registry.npmjs.org/vuepress-theme-vsf-docs/-/vuepress-theme-vsf-docs-1.3.1.tgz#7eda0989976b74b142ebd3c2782442809942dbd1"
17663+
integrity sha512-F3U1j9YWrwkWFCAudcOQRAgamgQ4r8Z0dfSY1LP9blcX6p1UKMRyR5JCf390aSjH+QKpiGwRbB/yQTOqv24N3A==
1766417664
dependencies:
1766517665
"@vuepress/plugin-active-header-links" "1.9.7"
1766617666
"@vuepress/plugin-nprogress" "1.9.7"

0 commit comments

Comments
 (0)