@scandipwa/magento-scripts 1.13.5-alpha.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config/versions/magento-2.3.0.js +3 -1
- package/lib/config/versions/magento-2.3.1.js +3 -1
- package/lib/config/versions/magento-2.3.2-p2.js +3 -1
- package/lib/config/versions/magento-2.3.2.js +3 -1
- package/lib/config/versions/magento-2.3.3-p1.js +3 -1
- package/lib/config/versions/magento-2.3.3.js +3 -1
- package/lib/config/versions/magento-2.3.4-p2.js +3 -1
- package/lib/config/versions/magento-2.3.4.js +3 -1
- package/lib/config/versions/magento-2.3.5-p1.js +3 -1
- package/lib/config/versions/magento-2.3.5-p2.js +3 -1
- package/lib/config/versions/magento-2.3.5.js +3 -1
- package/lib/config/versions/magento-2.3.6-p1.js +3 -1
- package/lib/config/versions/magento-2.3.6.js +3 -1
- package/lib/tasks/composer/index.js +1 -1
- package/lib/tasks/php/compile-options.js +2 -1
- package/lib/tasks/php/compile.js +1 -1
- package/lib/tasks/requirements/composer.js +211 -19
- package/lib/tasks/requirements/index.js +1 -2
- package/package.json +2 -2
- package/readme.md +54 -124
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.2.33',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.2.33',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.2.33',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.2.33',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -8,7 +8,9 @@ module.exports = ({ templateDir } = {}) => ({
|
|
|
8
8
|
version: '7.3.28',
|
|
9
9
|
configTemplate: path.join(templateDir || '', 'php.template.ini'),
|
|
10
10
|
extensions: {
|
|
11
|
-
gd: {
|
|
11
|
+
gd: {
|
|
12
|
+
macosOptions: '--with-zlib-dir=$(brew --prefix zlib) --with-freetype-dir=$(brew --prefix freetype)'
|
|
13
|
+
},
|
|
12
14
|
intl: {},
|
|
13
15
|
zlib: {},
|
|
14
16
|
openssl: {},
|
|
@@ -17,7 +17,7 @@ const getComposerVersion = async ({ composer, php }) => {
|
|
|
17
17
|
|
|
18
18
|
const composerVersion = safeRegexExtract({
|
|
19
19
|
string: composerVersionOutput,
|
|
20
|
-
regex: /(\d+\.\d+\.\d+)/i,
|
|
20
|
+
regex: /composer.+(\d+\.\d+\.\d+)/i,
|
|
21
21
|
onNoMatch: () => {
|
|
22
22
|
throw new Error(`
|
|
23
23
|
No composer version found in composer version output!\n\n${composerVersionOutput}
|
|
@@ -74,7 +74,8 @@ const compileOptions = {
|
|
|
74
74
|
CPATH: '$CPATH:$(brew --prefix openssl@1.1)/include',
|
|
75
75
|
CXX: 'g++ -DTRUE=1 -DFALSE=0',
|
|
76
76
|
CC: 'gcc -DTRUE=1 -DFALSE=0',
|
|
77
|
-
LDFLAGS: '$(brew --prefix openssl@1.1)/lib/libssl.dylib $(brew --prefix openssl@1.1)/lib/libcrypto.dylib'
|
|
77
|
+
LDFLAGS: '$(brew --prefix openssl@1.1)/lib/libssl.dylib $(brew --prefix openssl@1.1)/lib/libcrypto.dylib',
|
|
78
|
+
CFLAGS: '-Wno-implicit-function-declaration' // https://github.com/phpbrew/phpbrew/issues/1222
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
};
|
package/lib/tasks/php/compile.js
CHANGED
|
@@ -16,7 +16,7 @@ const compile = () => ({
|
|
|
16
16
|
platformCompileOptions.extraOptions.push('--with-libdir=lib64');
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
const commandEnv = Object.entries(platformCompileOptions.env || {}).map(([key, value]) =>
|
|
19
|
+
const commandEnv = Object.entries(platformCompileOptions.env || {}).map(([key, value]) => `export ${key}="${value}"`).join(' && ');
|
|
20
20
|
const phpCompileCommand = `${commandEnv ? `${commandEnv} && ` : ''} \
|
|
21
21
|
phpbrew install -j ${platformCompileOptions.cpuCount} ${php.version} ${platformCompileOptions.variants.join(' ')} \
|
|
22
22
|
-- ${platformCompileOptions.extraOptions.join(' ')}`;
|
|
@@ -1,36 +1,228 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const os = require('os');
|
|
1
4
|
const logger = require('@scandipwa/scandipwa-dev-utils/logger');
|
|
5
|
+
const pathExists = require('../../util/path-exists');
|
|
6
|
+
|
|
7
|
+
const authJsonPath = path.join(process.cwd(), 'auth.json');
|
|
8
|
+
const shellName = process.env.SHELL.split('/').pop();
|
|
9
|
+
const shellConfigFileName = `.${shellName}rc`;
|
|
10
|
+
const shellConfigFilePath = path.join(os.homedir(), shellConfigFileName);
|
|
11
|
+
|
|
12
|
+
const pasteKeybinding = process.platform === 'darwin' ? 'CMD + V' : 'CTRL + SHIFT + V';
|
|
13
|
+
|
|
14
|
+
const MISSING_COMPOSER_AUTH_ENV = 'missing composer auth environment variable';
|
|
15
|
+
const MISSING_AUTH_JSON = 'missing auth.json file';
|
|
2
16
|
|
|
3
17
|
/**
|
|
4
18
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
5
19
|
*/
|
|
6
|
-
const
|
|
7
|
-
title: '
|
|
8
|
-
task: () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
20
|
+
const configureComposerCredentials = () => ({
|
|
21
|
+
title: 'Configuring Composer Credentials',
|
|
22
|
+
task: async (ctx, task) => {
|
|
23
|
+
const configureLocation = await task.prompt({
|
|
24
|
+
type: 'Select',
|
|
25
|
+
message: `We didn't find Composer credentials in your ${ logger.style.misc('$COMPOSER_AUTH') } environment variable or in your ${ logger.style.file('./auth.json') } file.
|
|
26
|
+
|
|
27
|
+
Those credentials are required to install Magento.
|
|
28
|
+
|
|
29
|
+
Where do you want to store them?`,
|
|
30
|
+
choices: [
|
|
31
|
+
{
|
|
32
|
+
message: `Inside my projects directory in ${ logger.style.file('auth.json') } file [${ logger.style.misc('Recommended') }]`,
|
|
33
|
+
name: 'auth.json'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
message: `Inside my shells configuration file located in users home directory ${ logger.style.file(shellConfigFileName) } [${ logger.style.misc('Shared credentials, not recommended') }] `,
|
|
37
|
+
name: 'shell'
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const usernameCredentials = await task.prompt({
|
|
43
|
+
type: 'Input',
|
|
44
|
+
message: `Please enter your username key.
|
|
45
|
+
|
|
46
|
+
You can obtain this key from Magento Marketplace
|
|
47
|
+
|
|
48
|
+
1. Go to ${ logger.style.link('https://marketplace.magento.com/customer/accessKeys/') }
|
|
49
|
+
2. Use created Access Keypair or click ${ logger.style.misc('Generate Access Keypair') } to generate new Access Keypair
|
|
50
|
+
3. Click ${ logger.style.misc('Copy') } on ${ logger.style.misc('Public key') } and paste it here (${logger.style.misc(pasteKeybinding)})
|
|
51
|
+
|
|
52
|
+
${ logger.style.misc('Username') } (${ logger.style.misc('Public key') }):`,
|
|
53
|
+
required: true,
|
|
54
|
+
validate: (value) => {
|
|
55
|
+
if (value.trim() === '') {
|
|
56
|
+
return 'Username must not be empty';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return true;
|
|
12
60
|
}
|
|
61
|
+
});
|
|
13
62
|
|
|
14
|
-
|
|
63
|
+
const passwordCredentials = await task.prompt({
|
|
64
|
+
type: 'Input',
|
|
65
|
+
message: `Please enter your password key.
|
|
15
66
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
67
|
+
You can obtain this key from Magento Marketplace
|
|
68
|
+
|
|
69
|
+
1. Go to ${ logger.style.link('https://marketplace.magento.com/customer/accessKeys/') }
|
|
70
|
+
2. Use created Access Keypair or click ${ logger.style.misc('Generate Access Keypair') } to generate new Access Keypair
|
|
71
|
+
3. Click ${ logger.style.misc('Copy') } on ${ logger.style.misc('Private key') } and paste it here (${logger.style.misc(pasteKeybinding)})
|
|
72
|
+
|
|
73
|
+
${ logger.style.comment('Make sure to use Private key from the same Keypair as your Public key!')}
|
|
74
|
+
|
|
75
|
+
${ logger.style.misc('Password') } (${ logger.style.misc('Private key') }):`,
|
|
76
|
+
required: true,
|
|
77
|
+
validate: (value) => {
|
|
78
|
+
if (value.trim() === '') {
|
|
79
|
+
return 'Password must not be empty';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return true;
|
|
20
83
|
}
|
|
84
|
+
});
|
|
21
85
|
|
|
22
|
-
|
|
23
|
-
|
|
86
|
+
const authContent = {
|
|
87
|
+
'http-basic': {
|
|
88
|
+
'repo.magento.com': {
|
|
89
|
+
username: usernameCredentials,
|
|
90
|
+
password: passwordCredentials
|
|
91
|
+
}
|
|
24
92
|
}
|
|
25
|
-
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const authJsonContent = JSON.stringify(authContent, null, 4);
|
|
96
|
+
const authEnvContent = `export COMPOSER_AUTH='${JSON.stringify(authContent)}'`;
|
|
97
|
+
|
|
98
|
+
process.env.COMPOSER_AUTH = authJsonContent;
|
|
99
|
+
|
|
100
|
+
if (configureLocation === 'auth.json') {
|
|
101
|
+
await fs.promises.writeFile(authJsonPath, authJsonContent, 'utf-8');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
switch (shellName) {
|
|
106
|
+
case 'bash':
|
|
107
|
+
case 'zsh': {
|
|
108
|
+
await fs.promises.appendFile(
|
|
109
|
+
path.join(os.homedir(), shellConfigFileName),
|
|
110
|
+
`\n${authEnvContent}\n`
|
|
111
|
+
);
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
default: {
|
|
26
115
|
throw new Error(
|
|
27
|
-
`
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
116
|
+
`Unfortunately we cannot automatically add credentials for your shell ${process.env.SHELL}!
|
|
117
|
+
|
|
118
|
+
You will need to that manually!
|
|
119
|
+
|
|
120
|
+
Add following string to your shell configuration file: ${ logger.style.code()}`
|
|
31
121
|
);
|
|
32
122
|
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
await task.prompt({
|
|
126
|
+
type: 'Confirm',
|
|
127
|
+
message: `Before we continue with installation...
|
|
128
|
+
|
|
129
|
+
You selected to add your Magento credentials to your shell environment, you should know that shell configuration does not update automatically.
|
|
130
|
+
|
|
131
|
+
To update it you can either restart your existing shell or run the following command to update the configuration temporarily: ${ logger.style.code('source <path/to/config/file>')}
|
|
132
|
+
|
|
133
|
+
Press ${ logger.style.misc('Y') } to continue`
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
140
|
+
*/
|
|
141
|
+
const checkComposerCredentials = () => ({
|
|
142
|
+
title: 'Checking Composer credentials',
|
|
143
|
+
task: async (ctx, task) => {
|
|
144
|
+
const problems = new Map();
|
|
145
|
+
if (!process.env.COMPOSER_AUTH) {
|
|
146
|
+
problems.set(MISSING_COMPOSER_AUTH_ENV, true);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (!await pathExists(authJsonPath)) {
|
|
150
|
+
problems.set(MISSING_AUTH_JSON, true);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (problems.has(MISSING_COMPOSER_AUTH_ENV) && problems.has(MISSING_AUTH_JSON)) {
|
|
154
|
+
let doConfigure = true;
|
|
155
|
+
if (await pathExists(shellConfigFilePath)) {
|
|
156
|
+
const rcFileContent = await fs.promises.readFile(shellConfigFilePath, 'utf-8');
|
|
157
|
+
|
|
158
|
+
const lines = rcFileContent.split('\n');
|
|
159
|
+
const composerAuthInRcFile = lines.some((line) => line.startsWith('export COMPOSER_AUTH='));
|
|
160
|
+
|
|
161
|
+
if (composerAuthInRcFile) {
|
|
162
|
+
doConfigure = false;
|
|
163
|
+
const loadCredentialsFrom = await task.prompt({
|
|
164
|
+
type: 'Confirm',
|
|
165
|
+
message: `We detected that you have ${ logger.style.misc('COMPOSER_AUTH') } environment variable set in ${ logger.style.file(shellConfigFilePath) } file,
|
|
166
|
+
but we do not see this variable inside ${ logger.style.code('magento-scripts') } process.
|
|
167
|
+
|
|
168
|
+
${ logger.style.misc('! Don\'t forget to reload your shell after process is finished !') }
|
|
169
|
+
|
|
170
|
+
Would you like to load them now?`
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if (loadCredentialsFrom) {
|
|
174
|
+
const credentialsLine = lines.find((line) => line.startsWith('export COMPOSER_AUTH='));
|
|
175
|
+
process.env.COMPOSER_AUTH = credentialsLine.replace('export COMPOSER_AUTH=', '').replace(/'/ig, '').trim();
|
|
176
|
+
problems.delete(MISSING_COMPOSER_AUTH_ENV);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (doConfigure) {
|
|
182
|
+
return task.newListr(
|
|
183
|
+
configureComposerCredentials()
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let composerAuthContent;
|
|
189
|
+
|
|
190
|
+
if (!problems.has(MISSING_AUTH_JSON)) {
|
|
191
|
+
try {
|
|
192
|
+
const composerAuthFileContent = await fs.promises.readFile(authJsonPath, 'utf-8');
|
|
193
|
+
|
|
194
|
+
composerAuthContent = JSON.parse(composerAuthFileContent);
|
|
195
|
+
|
|
196
|
+
process.env.COMPOSER_AUTH = composerAuthFileContent;
|
|
197
|
+
} catch (e) {
|
|
198
|
+
throw new Error(
|
|
199
|
+
`We found an error in your ${ logger.style.file('./auth.json') } file.
|
|
200
|
+
|
|
201
|
+
Make sure that this file contains a valid JSON!
|
|
202
|
+
|
|
203
|
+
You can try linting your file here: ${ logger.style.link('https://jsonformatter.curiousconcept.com/') }
|
|
204
|
+
|
|
205
|
+
Error message that we got: ${e}`
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (!problems.has(MISSING_COMPOSER_AUTH_ENV) && !composerAuthContent) {
|
|
211
|
+
try {
|
|
212
|
+
composerAuthContent = JSON.parse(process.env.COMPOSER_AUTH);
|
|
213
|
+
} catch (e) {
|
|
214
|
+
throw new Error(
|
|
215
|
+
`We found an error in your ${ logger.style.misc('$COMPOSER_AUTH') } environment variable.
|
|
216
|
+
|
|
217
|
+
Make sure that this variable contains a valid JSON!
|
|
218
|
+
|
|
219
|
+
You can try linting your variable here: ${ logger.style.link('https://jsonformatter.curiousconcept.com/') }
|
|
220
|
+
|
|
221
|
+
Error message that we got: ${e}`
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
33
225
|
}
|
|
34
226
|
});
|
|
35
227
|
|
|
36
|
-
module.exports =
|
|
228
|
+
module.exports = checkComposerCredentials;
|
|
@@ -4,7 +4,6 @@ const checkComposer = require('./composer');
|
|
|
4
4
|
const checkDocker = require('./docker');
|
|
5
5
|
const checkNodeVersion = require('./node-version');
|
|
6
6
|
const checkPHPVersion = require('./php-version');
|
|
7
|
-
const localAuthJson = require('../composer/local-auth-json');
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
@@ -21,7 +20,7 @@ const checkRequirements = () => ({
|
|
|
21
20
|
// check the Docker installation
|
|
22
21
|
checkDocker(),
|
|
23
22
|
// check for COMPOSER_AUTH or auth.json
|
|
24
|
-
localAuthJson(),
|
|
23
|
+
// localAuthJson(),
|
|
25
24
|
checkComposer(),
|
|
26
25
|
// check for Node.js version
|
|
27
26
|
checkNodeVersion()
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Scripts and configuration used by CMA.",
|
|
4
4
|
"homepage": "https://docs.create-magento-app.com/",
|
|
5
5
|
"repository": "github:scandipwa/create-magento-app",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.14.0",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "60c7a2bacde24256dcb2d17128e41c0b371987a7"
|
|
45
45
|
}
|
package/readme.md
CHANGED
|
@@ -1,150 +1,80 @@
|
|
|
1
1
|
# magento-scripts
|
|
2
2
|
|
|
3
|
-
This package contains scripts and configuration used by
|
|
3
|
+
This package contains scripts and configuration used by [Create Magento App](https://github.com/scandipwa/create-magento-app).
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
7
|
What this package does:
|
|
8
|
-
- Compiles correct
|
|
9
|
-
- Organize services required to run Magento on your system, such as Nginx, Redis, MySQL and Elasticsearch
|
|
8
|
+
- Compiles correct PHP version with all necessary extensions to run Magento on your system.
|
|
9
|
+
- Organize services required to run Magento on your system, such as Nginx, Redis, MySQL and Elasticsearch in Docker containers with forwarded ports to host system.
|
|
10
10
|
- Allows you to run multiple M2 projects simultaneously on the same machine without ports/files/context overlapping.
|
|
11
11
|
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
### Linux Requirements
|
|
15
|
+
|
|
16
|
+
Dependency list and installation guide is available in our [documentation for installation on Linux](https://docs.create-magento-app.com/getting-started/prerequisites/installation-on-linux)!
|
|
17
|
+
|
|
18
|
+
### MacOS Requirements
|
|
19
|
+
|
|
20
|
+
Dependency list and installation guide is available in our [documentation for installation on Mac](https://docs.create-magento-app.com/getting-started/prerequisites/installation-on-macos)!
|
|
21
|
+
|
|
22
|
+
### Windows Requirements
|
|
23
|
+
|
|
24
|
+
Dependency list and installation guide is available in our [documentation for installation on Windows](https://docs.create-magento-app.com/getting-started/prerequisites/windows-requirements)!
|
|
25
|
+
|
|
26
|
+
> If you miss a requirement CMA will tell you and will give instructions or even provide a one click fix!
|
|
27
|
+
|
|
12
28
|
## Usage
|
|
13
29
|
|
|
14
|
-
|
|
15
|
-
> npx create-magento-app <folder name>
|
|
16
|
-
> cd <folder name>
|
|
17
|
-
> yarn/npm run start
|
|
18
|
-
```
|
|
30
|
+
### Start the App
|
|
19
31
|
|
|
20
|
-
To use commands such as `composer`, `magento` and `php` with correct version run command:
|
|
21
32
|
```bash
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
This will open bash with correct aliases to `php`, `magento` and `composer`.
|
|
33
|
+
# Create an App
|
|
34
|
+
npx create-magento-app <folder name>
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
cd <folder name>
|
|
37
|
+
|
|
38
|
+
# Run it with yarn
|
|
39
|
+
yarn start
|
|
40
|
+
|
|
41
|
+
# Or with npm
|
|
42
|
+
npm run start
|
|
30
43
|
```
|
|
31
44
|
|
|
32
|
-
>
|
|
45
|
+
> Documentation for `start` command is available [here](https://docs.create-magento-app.com/getting-started/available-commands/start).
|
|
33
46
|
|
|
34
|
-
|
|
47
|
+
### Access Application CLI
|
|
35
48
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## Dependencies
|
|
45
|
-
|
|
46
|
-
### Ubuntu
|
|
47
|
-
|
|
48
|
-
```sh
|
|
49
|
-
apt-get install \
|
|
50
|
-
libcurl4-openssl-dev \
|
|
51
|
-
libonig-dev \
|
|
52
|
-
libjpeg-dev \
|
|
53
|
-
libjpeg8-dev \
|
|
54
|
-
libjpeg-turbo8-dev \
|
|
55
|
-
libpng-dev \
|
|
56
|
-
libicu-dev \
|
|
57
|
-
libfreetype6-dev \
|
|
58
|
-
libzip-dev \
|
|
59
|
-
libssl-dev \
|
|
60
|
-
build-essential \
|
|
61
|
-
libbz2-dev \
|
|
62
|
-
libreadline-dev \
|
|
63
|
-
libsqlite3-dev \
|
|
64
|
-
libssl-dev \
|
|
65
|
-
libxml2-dev \
|
|
66
|
-
libxslt-dev \
|
|
67
|
-
libonig-dev \
|
|
68
|
-
php-cli \
|
|
69
|
-
php-bz2 \
|
|
70
|
-
pkg-config \
|
|
71
|
-
autoconf
|
|
49
|
+
To access Magento CLI, Composer and PHP use `cli` command:
|
|
50
|
+
```bash
|
|
51
|
+
# With yarn
|
|
52
|
+
yarn cli
|
|
53
|
+
|
|
54
|
+
# Or npm
|
|
55
|
+
npm run cli
|
|
72
56
|
```
|
|
73
57
|
|
|
74
|
-
|
|
58
|
+
This will a new instance of Bash with aliases for PHP, Composer and Magento used in Create Magento App project.
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
apt-get install \
|
|
78
|
-
libjpeg-dev \
|
|
79
|
-
libjpeg8-dev \
|
|
80
|
-
libjpeg-turbo8-dev \
|
|
81
|
-
libpng-dev \
|
|
82
|
-
libicu-dev \
|
|
83
|
-
libfreetype6-dev \
|
|
84
|
-
libzip-dev \
|
|
85
|
-
libssl-dev \
|
|
86
|
-
build-essential \
|
|
87
|
-
libbz2-dev \
|
|
88
|
-
libreadline-dev \
|
|
89
|
-
libsqlite3-dev \
|
|
90
|
-
libssl-dev \
|
|
91
|
-
libxml2-dev \
|
|
92
|
-
libxslt-dev \
|
|
93
|
-
libonig-dev \
|
|
94
|
-
php-cli \
|
|
95
|
-
php-bz2 \
|
|
96
|
-
pkg-config \
|
|
97
|
-
autoconf \
|
|
98
|
-
libcurl4-openssl-dev
|
|
99
|
-
```
|
|
60
|
+
> Documentation for `cli` command is available [here](https://docs.create-magento-app.com/getting-started/available-commands/cli).
|
|
100
61
|
|
|
101
|
-
###
|
|
102
|
-
```sh
|
|
103
|
-
yum install --enablerepo=PowerTools openssl-devel \
|
|
104
|
-
libjpeg-turbo-devel \
|
|
105
|
-
libpng-devel \
|
|
106
|
-
gd-devel \
|
|
107
|
-
libicu libicu-devel \
|
|
108
|
-
libzip-devel \
|
|
109
|
-
libtool-ltdl-devel \
|
|
110
|
-
oniguruma-devel
|
|
111
|
-
```
|
|
62
|
+
### Access Application Logs
|
|
112
63
|
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
oniguruma \
|
|
118
|
-
libxslt \
|
|
119
|
-
bzip2 \
|
|
120
|
-
libjpeg-turbo \
|
|
121
|
-
libpng \
|
|
122
|
-
icu \
|
|
123
|
-
libxml2 \
|
|
124
|
-
autoconf \
|
|
125
|
-
libzip \
|
|
126
|
-
sqlite \
|
|
127
|
-
readline \
|
|
128
|
-
perl
|
|
129
|
-
```
|
|
64
|
+
To open logs use command `logs` with one of the scopes: `redis`, `mysql`, `elasticsearch`, `nginx` or `magento`.
|
|
65
|
+
```bash
|
|
66
|
+
# With yarn
|
|
67
|
+
yarn logs nginx
|
|
130
68
|
|
|
131
|
-
|
|
69
|
+
# Or npm
|
|
70
|
+
npm run logs nginx
|
|
132
71
|
|
|
133
|
-
|
|
134
|
-
sudo xcode-select -switch /Applications/Xcode.app
|
|
135
|
-
```
|
|
136
|
-
```sh
|
|
137
|
-
brew install zlib \
|
|
138
|
-
bzip2 \
|
|
139
|
-
libiconv \
|
|
140
|
-
curl \
|
|
141
|
-
libpng \
|
|
142
|
-
gd \
|
|
143
|
-
freetype \
|
|
144
|
-
oniguruma \
|
|
145
|
-
icu4c \
|
|
146
|
-
libzip
|
|
72
|
+
> ... nginx logs
|
|
147
73
|
```
|
|
148
74
|
|
|
149
|
-
|
|
150
|
-
|
|
75
|
+
> NOTE: you can also use name matching for logs! Like `yarn logs m` will show `mysql` logs, `yarn logs ma` will show `magento` logs and e.t.c.
|
|
76
|
+
Read more about this [here](https://docs.create-magento-app.com/getting-started/available-commands/logs#usage-example).
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
CMA contains even more useful commands like [checking application status](https://docs.create-magento-app.com/getting-started/available-commands/status), [executing commands in Docker containers](https://docs.create-magento-app.com/getting-started/available-commands/exec), [linking a theme](https://docs.create-magento-app.com/getting-started/available-commands/link) and [importing database](https://docs.create-magento-app.com/getting-started/available-commands/import-db)!
|