@scandipwa/magento-scripts 1.11.3 → 1.12.2
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/.eslintrc +0 -0
- package/LICENSE +0 -0
- package/lib/config/dependencies-for-platforms.js +0 -1
- package/lib/config/index.js +4 -2
- package/lib/config/{php.js → php-config.js} +0 -0
- package/lib/config/phpbrew.js +12 -0
- package/lib/config/phpstorm/debug-config.js +46 -0
- package/lib/config/save-config.js +0 -0
- package/lib/config/templates/Project_Default.template.xml +13 -0
- package/lib/config/templates/cma-config.template.js +0 -0
- package/lib/config/templates/dataSources.local.template.xml +11 -0
- package/lib/config/templates/dataSources.template.xml +12 -0
- package/lib/config/templates/magentorc.template +0 -0
- package/lib/config/templates/php-fpm.template.conf +0 -0
- package/lib/config/templates/php.template.xml +14 -0
- package/lib/config/templates/vscode-launch.template.json +15 -0
- package/lib/config/templates/workspace.template.xml +20 -0
- package/lib/config/versions/magento-2.3.0.js +1 -1
- package/lib/config/versions/magento-2.3.1.js +1 -1
- package/lib/config/versions/magento-2.3.2-p2.js +1 -1
- package/lib/config/versions/magento-2.3.2.js +1 -1
- package/lib/config/versions/magento-2.3.3-p1.js +1 -1
- package/lib/config/versions/magento-2.3.3.js +1 -1
- package/lib/config/versions/magento-2.3.4-p2.js +1 -1
- package/lib/config/versions/magento-2.3.4.js +1 -1
- package/lib/config/versions/magento-2.3.5-p1.js +1 -1
- package/lib/config/versions/magento-2.3.5-p2.js +1 -1
- package/lib/config/versions/magento-2.3.5.js +1 -1
- package/lib/config/versions/magento-2.3.6-p1.js +1 -1
- package/lib/config/versions/magento-2.3.6.js +1 -1
- package/lib/config/versions/magento-2.3.7-p1.js +3 -3
- package/lib/config/versions/magento-2.3.7.js +3 -3
- package/lib/config/versions/magento-2.4.0-p1.js +2 -2
- package/lib/config/versions/magento-2.4.0.js +2 -2
- package/lib/config/versions/magento-2.4.1-p1.js +2 -2
- package/lib/config/versions/magento-2.4.1.js +2 -2
- package/lib/config/versions/magento-2.4.2-p1.js +3 -3
- package/lib/config/versions/magento-2.4.2-p2.js +3 -3
- package/lib/config/versions/magento-2.4.2.js +3 -3
- package/lib/config/versions/magento-2.4.3-p1.js +3 -3
- package/lib/config/versions/magento-2.4.3.js +3 -3
- package/lib/tasks/cache/index.js +0 -0
- package/lib/tasks/cli/index.js +0 -0
- package/lib/tasks/composer/index.js +13 -6
- package/lib/tasks/docker/index.js +1 -1
- package/lib/tasks/docker/network.js +2 -2
- package/lib/tasks/execute/index.js +0 -0
- package/lib/tasks/file-system/create-php-storm-config.js +82 -0
- package/lib/tasks/file-system/create-vscode-config.js +111 -0
- package/lib/tasks/file-system/index.js +5 -1
- package/lib/tasks/magento/index.js +0 -0
- package/lib/tasks/magento/setup-magento/adjust-magento-configuration.js +0 -0
- package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +0 -0
- package/lib/tasks/magento/setup-magento/create-admin.js +0 -0
- package/lib/tasks/magento/setup-magento/delete-admin-users.js +0 -0
- package/lib/tasks/magento/setup-magento/flush-redis-config.js +0 -0
- package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +0 -0
- package/lib/tasks/magento/setup-magento/set-base-url.js +0 -0
- package/lib/tasks/magento/setup-magento/set-deployment-mode.js +1 -1
- package/lib/tasks/magento/setup-magento/set-url-rewrite.js +0 -0
- package/lib/tasks/magento/setup-magento/waiting-for-redis.js +1 -1
- package/lib/tasks/mysql/index.js +0 -0
- package/lib/tasks/php/compile.js +2 -2
- package/lib/tasks/php/configure.js +80 -59
- package/lib/tasks/php/extensions/disable.js +41 -0
- package/lib/tasks/php/extensions/enable.js +44 -0
- package/lib/tasks/php/extensions/install.js +47 -0
- package/lib/tasks/php/update-phpbrew.js +0 -0
- package/lib/tasks/php-fpm/index.js +0 -0
- package/lib/tasks/php-fpm/start-php-fpm.js +3 -3
- package/lib/tasks/php-fpm/stop-php-fpm.js +2 -2
- package/lib/tasks/requirements/composer.js +1 -1
- package/lib/tasks/requirements/dependency/arch.js +0 -0
- package/lib/tasks/requirements/dependency/centos.js +2 -2
- package/lib/tasks/requirements/dependency/fedora.js +0 -0
- package/lib/tasks/requirements/dependency/index.js +1 -4
- package/lib/tasks/requirements/dependency/mac.js +0 -0
- package/lib/tasks/requirements/dependency/ubuntu.js +0 -0
- package/lib/tasks/requirements/docker/index.js +2 -2
- package/lib/util/clean-object.js +0 -0
- package/lib/util/config-file-validator.js +7 -1
- package/lib/util/download-file.js +0 -0
- package/lib/util/ip.js +0 -0
- package/lib/util/match-filesystem.js +0 -0
- package/lib/util/move-file.js +0 -0
- package/lib/util/path-exists-sync.js +0 -0
- package/lib/util/portscanner.js +0 -0
- package/lib/util/run-composer.js +0 -0
- package/lib/util/run-magento.js +0 -0
- package/lib/util/run-php.js +0 -0
- package/lib/util/set-config.js +0 -0
- package/lib/util/sleep.js +0 -0
- package/lib/util/wait-for-it.js +0 -0
- package/lib/util/wait-for-logs.js +0 -0
- package/package.json +3 -2
- package/typings/context.d.ts +2 -2
- package/typings/index.d.ts +36 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* eslint-disable max-len */
|
|
2
|
+
const macosVersion = require('macos-version');
|
|
3
|
+
const { execAsyncSpawn } = require('../../../util/exec-async-command');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {String} extensionName
|
|
7
|
+
* @param {import('../../../../typings/index').PHPExtension} extensionOptions
|
|
8
|
+
* @returns {import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
9
|
+
*/
|
|
10
|
+
const installExtension = (extensionName, extensionOptions) => ({
|
|
11
|
+
title: `Installing ${extensionName} extension`,
|
|
12
|
+
task: async (ctx, task) => {
|
|
13
|
+
const {
|
|
14
|
+
config,
|
|
15
|
+
config: { php }
|
|
16
|
+
} = ctx;
|
|
17
|
+
const { hooks } = extensionOptions;
|
|
18
|
+
|
|
19
|
+
if (extensionOptions.install) {
|
|
20
|
+
await Promise.resolve(extensionOptions.install(ctx, task));
|
|
21
|
+
} else {
|
|
22
|
+
const options = macosVersion.isMacOS ? extensionOptions.macosOptions : extensionOptions.linuxOptions;
|
|
23
|
+
|
|
24
|
+
if (hooks && hooks.preInstall) {
|
|
25
|
+
await Promise.resolve(hooks.preInstall(config));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
await execAsyncSpawn(`source ~/.phpbrew/bashrc && \
|
|
29
|
+
phpbrew use ${ php.version } && \
|
|
30
|
+
phpbrew ext install ${ extensionName }${ extensionOptions.version ? ` ${extensionOptions.version}` : ''}${ options ? ` -- ${ options }` : ''}`,
|
|
31
|
+
{
|
|
32
|
+
callback: (t) => {
|
|
33
|
+
task.output = t;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
if (hooks && hooks.postInstall) {
|
|
38
|
+
await Promise.resolve(hooks.postInstall(config));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
options: {
|
|
43
|
+
bottomBar: 10
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
module.exports = installExtension;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { execAsyncSpawn } = require('../../util/exec-async-command');
|
|
2
|
-
const getPhpConfig = require('../../config/php');
|
|
2
|
+
const getPhpConfig = require('../../config/php-config');
|
|
3
3
|
const { getBaseConfig } = require('../../config/index');
|
|
4
4
|
const getProcessId = require('./get-process-id');
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ const getProcessId = require('./get-process-id');
|
|
|
7
7
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
8
8
|
*/
|
|
9
9
|
const startPhpFpm = () => ({
|
|
10
|
-
title: 'Starting
|
|
10
|
+
title: 'Starting PHP-FPM',
|
|
11
11
|
task: async ({ config: { overridenConfiguration }, projectPath }, task) => {
|
|
12
12
|
const php = getPhpConfig(overridenConfiguration.configuration, getBaseConfig(projectPath));
|
|
13
13
|
const processId = await getProcessId(php.fpmPidFilePath);
|
|
@@ -35,7 +35,7 @@ const startPhpFpm = () => ({
|
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
} catch (e) {
|
|
38
|
-
throw new Error(`Error during
|
|
38
|
+
throw new Error(`Error during PHP-FPM start\n\n${e}`);
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
options: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const { execAsyncSpawn } = require('../../util/exec-async-command');
|
|
3
3
|
const pathExists = require('../../util/path-exists');
|
|
4
|
-
const getPhpConfig = require('../../config/php');
|
|
4
|
+
const getPhpConfig = require('../../config/php-config');
|
|
5
5
|
const { getBaseConfig } = require('../../config/index');
|
|
6
6
|
const getProcessId = require('./get-process-id');
|
|
7
7
|
|
|
@@ -9,7 +9,7 @@ const getProcessId = require('./get-process-id');
|
|
|
9
9
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
10
10
|
*/
|
|
11
11
|
const stopPhpFpmTask = () => ({
|
|
12
|
-
title: 'Stopping
|
|
12
|
+
title: 'Stopping PHP-FPM',
|
|
13
13
|
task: async ({ config: { overridenConfiguration }, projectPath }, task) => {
|
|
14
14
|
const php = getPhpConfig(overridenConfiguration.configuration, getBaseConfig(projectPath));
|
|
15
15
|
const processId = await getProcessId(php.fpmPidFilePath);
|
|
@@ -4,7 +4,7 @@ const logger = require('@scandipwa/scandipwa-dev-utils/logger');
|
|
|
4
4
|
* @type {() => import('listr2').ListrTask<import('../../../typings/context').ListrContext>}
|
|
5
5
|
*/
|
|
6
6
|
const checkComposer = () => ({
|
|
7
|
-
title: 'Checking
|
|
7
|
+
title: 'Checking Composer environmental variables',
|
|
8
8
|
task: () => {
|
|
9
9
|
try {
|
|
10
10
|
if (!process.env.COMPOSER_AUTH) {
|
|
File without changes
|
|
@@ -5,7 +5,7 @@ const installDependenciesTask = require('../../../util/install-dependencies-task
|
|
|
5
5
|
/**
|
|
6
6
|
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const centosDependenciesCheck = () => ({
|
|
9
9
|
title: 'Checking CentOS dependencies',
|
|
10
10
|
task: async (ctx, task) => {
|
|
11
11
|
const installedDependencies = (await execAsyncSpawn('yum list installed')).split('\n')
|
|
@@ -32,4 +32,4 @@ const fedoraDependenciesCheck = () => ({
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
module.exports =
|
|
35
|
+
module.exports = centosDependenciesCheck;
|
|
File without changes
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
const os = require('os');
|
|
2
1
|
const osPlatform = require('../../../util/os-platform');
|
|
3
2
|
const archDependenciesCheck = require('./arch');
|
|
4
3
|
const fedoraDependenciesCheck = require('./fedora');
|
|
@@ -7,9 +6,7 @@ const ubuntuDependenciesCheck = require('./ubuntu');
|
|
|
7
6
|
const macDependenciesCheck = require('./mac');
|
|
8
7
|
|
|
9
8
|
const dependencyCheck = async () => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (currentPlatform === 'darwin') {
|
|
9
|
+
if (process.platform === 'darwin') {
|
|
13
10
|
return macDependenciesCheck();
|
|
14
11
|
}
|
|
15
12
|
|
|
File without changes
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ const getDockerVersion = require('./version');
|
|
|
9
9
|
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
10
10
|
*/
|
|
11
11
|
const checkDocker = () => ({
|
|
12
|
-
title: 'Checking
|
|
12
|
+
title: 'Checking Docker',
|
|
13
13
|
task: async (ctx, task) => {
|
|
14
14
|
const { code } = await execAsyncSpawn('docker -v', {
|
|
15
15
|
withCode: true
|
|
@@ -63,7 +63,7 @@ ${ logger.style.link('https://docs.create-magento-app.com/getting-started/prereq
|
|
|
63
63
|
getDockerVersion(),
|
|
64
64
|
{
|
|
65
65
|
task: (ctx) => {
|
|
66
|
-
task.title = `Using
|
|
66
|
+
task.title = `Using Docker version ${ctx.dockerVersion}`;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
]);
|
package/lib/util/clean-object.js
CHANGED
|
File without changes
|
|
@@ -83,7 +83,13 @@ const serviceConfigurationSchema = Joi.object({
|
|
|
83
83
|
* @type {Joi.ObjectSchema<import('../../typings').CMAConfiguration['configuration']['composer']>}
|
|
84
84
|
*/
|
|
85
85
|
const composerConfigurationSchema = Joi.object({
|
|
86
|
-
version: Joi.string().optional().
|
|
86
|
+
version: Joi.string().optional().custom((value) => {
|
|
87
|
+
if (['1', '2'].includes(value)) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return versionValidator(value);
|
|
92
|
+
})
|
|
87
93
|
});
|
|
88
94
|
|
|
89
95
|
/**
|
|
File without changes
|
package/lib/util/ip.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/util/move-file.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/util/portscanner.js
CHANGED
|
File without changes
|
package/lib/util/run-composer.js
CHANGED
|
File without changes
|
package/lib/util/run-magento.js
CHANGED
|
File without changes
|
package/lib/util/run-php.js
CHANGED
|
File without changes
|
package/lib/util/set-config.js
CHANGED
|
File without changes
|
package/lib/util/sleep.js
CHANGED
|
File without changes
|
package/lib/util/wait-for-it.js
CHANGED
|
File without changes
|
|
File without changes
|
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.12.2",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"enquirer": "2.3.6",
|
|
28
28
|
"eta": "1.12.3",
|
|
29
29
|
"getos": "3.2.1",
|
|
30
|
+
"hjson": "^3.2.2",
|
|
30
31
|
"is-installed-globally": "0.4.0",
|
|
31
32
|
"joi": "17.4.2",
|
|
32
33
|
"listr2": "3.13.0",
|
|
@@ -41,5 +42,5 @@
|
|
|
41
42
|
"publishConfig": {
|
|
42
43
|
"access": "public"
|
|
43
44
|
},
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "8e4db94149d0d2b56fef23f6c9db8c0df223da2e"
|
|
45
46
|
}
|
package/typings/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CMAConfiguration,
|
|
1
|
+
import { CMAConfiguration, PHPExtensions } from './index';
|
|
2
2
|
|
|
3
3
|
export interface ListrContext {
|
|
4
4
|
magentoVersion: string
|
|
@@ -29,7 +29,7 @@ export interface ListrContext {
|
|
|
29
29
|
fpmBinPath: string
|
|
30
30
|
fpmConfPath: string
|
|
31
31
|
fpmPidFilePath: string
|
|
32
|
-
extensions:
|
|
32
|
+
extensions: PHPExtensions
|
|
33
33
|
version: string
|
|
34
34
|
}
|
|
35
35
|
composer: {
|
package/typings/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ListrTaskWrapper } from 'listr2';
|
|
2
|
+
|
|
3
|
+
import { ListrContext } from './context';
|
|
4
|
+
|
|
1
5
|
/* eslint-disable no-use-before-define */
|
|
2
6
|
export interface ServiceWithVersion {
|
|
3
7
|
/**
|
|
@@ -37,11 +41,40 @@ export interface PHPExtension extends Record<string, unknown> {
|
|
|
37
41
|
* }
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
44
|
+
linuxOptions?: string
|
|
45
|
+
macosOptions?: string
|
|
40
46
|
extensionName?: string
|
|
41
47
|
hooks?: {
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
preEnable?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
49
|
+
postEnable?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
50
|
+
preDisable?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
51
|
+
postDisable?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
52
|
+
preInstall?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
53
|
+
postInstall?: (config: CMAConfiguration['configuration']) => Promise<void> | void
|
|
44
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Allow to define custom logic to install extension
|
|
57
|
+
*/
|
|
58
|
+
install?: (
|
|
59
|
+
ctx: ListrContext,
|
|
60
|
+
task: ListrTaskWrapper<ListrContext, any>
|
|
61
|
+
) => Promise<void> | void
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Allow to define custom logic to enable an extension
|
|
65
|
+
*/
|
|
66
|
+
enable?: (
|
|
67
|
+
ctx: ListrContext,
|
|
68
|
+
task: ListrTaskWrapper<ListrContext, any>
|
|
69
|
+
) => Promise<void> | void
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Allow to define custom logic to disable an extension
|
|
73
|
+
*/
|
|
74
|
+
disable?: (
|
|
75
|
+
ctx: ListrContext,
|
|
76
|
+
task: ListrTaskWrapper<ListrContext, any>
|
|
77
|
+
) => Promise<void> | void
|
|
45
78
|
}
|
|
46
79
|
|
|
47
80
|
export interface PHPExtensions {
|
|
@@ -54,6 +87,7 @@ export interface PHPExtensions {
|
|
|
54
87
|
xdebug: PHPExtension
|
|
55
88
|
fileinfo: PHPExtension
|
|
56
89
|
libsodium: PHPExtension
|
|
90
|
+
[key: string]: PHPExtension
|
|
57
91
|
}
|
|
58
92
|
|
|
59
93
|
export interface PHPConfiguration {
|