@lando/php 1.6.3 → 1.7.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lando/php",
3
3
  "description": "A Lando plugin that provides a tight integration with PHP.",
4
- "version": "1.6.3",
4
+ "version": "1.7.0",
5
5
  "author": "Mike Pirog @pirog",
6
6
  "license": "GPL-3.0",
7
7
  "repository": "lando/php",
@@ -66,9 +66,9 @@
66
66
  "semver"
67
67
  ],
68
68
  "dist": {
69
- "integrity": "sha512-ob+QIOJAhWamdWvGKl8DNISxFOjsxXWGd7cl3M/afWThMRT+EH7iYyy2MuBzxAF7YbQ3FfxcoGSt3YvH1fRiNg==",
70
- "shasum": "6f506661057bf7807c5f156264e9e2822c347fa6",
71
- "filename": "lando-php-1.6.3.tgz",
72
- "unpackedSize": 3119748
69
+ "integrity": "sha512-SMAjegMZXUtiSQOHdsdbjnrIFRX9DkO6/7gWlEs5q+KRXXzjfHPhwMtddd5225jbGSnDlKQUWKBlHaDWHRDaAA==",
70
+ "shasum": "222014d582a6d1377d0da500571651149cb1e048",
71
+ "filename": "lando-php-1.7.0.tgz",
72
+ "unpackedSize": 3128242
73
73
  }
74
74
  }
@@ -16,6 +16,10 @@ elif [ "$VERSION" = '2-latest' ]; then
16
16
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2
17
17
  elif [ "$VERSION" = '2' ]; then
18
18
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2
19
+ elif [ "$VERSION" = '2.2' ]; then
20
+ php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2
21
+ elif [ "$VERSION" = '2.2-latest' ]; then
22
+ php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --2.2
19
23
  elif [ "$VERSION" = 'preview' ]; then
20
24
  php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --preview
21
25
  elif [ "$VERSION" = 'snapshot' ]; then
@@ -3,9 +3,23 @@
3
3
  // Modules
4
4
  const _ = require('lodash');
5
5
 
6
- /*
7
- * Helper to get global deps
8
- * @TODO: this looks pretty testable? should services have libs?
6
+ /**
7
+ * Helper function to add build steps to a service's configuration
8
+ *
9
+ * @param {string|string[]} steps - The build step(s) to add
10
+ * @param {Object} app - The Lando app object
11
+ * @param {string} name - The name of the service
12
+ * @param {string} [step='build_internal'] - The build step type to modify
13
+ * @param {boolean} [front=false] - Whether to add steps to front of array
14
+ * @return {void} - Modifies app config object directly
15
+ *
16
+ * @example
17
+ * // Add a build step to the end
18
+ * addBuildStep('npm install', app, 'web');
19
+ *
20
+ * @example
21
+ * // Add multiple build steps to the front
22
+ * addBuildStep(['composer install', 'npm install'], app, 'web', 'build_internal', true);
9
23
  */
10
24
  module.exports = (steps, app, name, step = 'build_internal', front = false) => {
11
25
  const current = _.get(app, `config.services.${name}.${step}`, []);
@@ -3,9 +3,25 @@
3
3
  // Modules
4
4
  const _ = require('lodash');
5
5
 
6
- /*
7
- * Helper to get global deps
8
- * @TODO: this looks pretty testable? should services have libs?
6
+ /**
7
+ * Helper function to generate installation commands for dependencies
8
+ *
9
+ * @param {Object} deps - Dependencies object with package names as keys and versions as values
10
+ * @param {Function} pkger - Function that generates package installation command
11
+ * @param {string[]} [prefix=[]] - Command prefix to prepend to each installation command
12
+ * @return {string[]} Array of formatted installation commands
13
+ *
14
+ * @example
15
+ * // Generate npm install commands
16
+ * const deps = { 'lodash': '^4.0.0', 'express': '4.17.1' };
17
+ * const npmInstall = (pkg, version) => ['npm', 'install', `${pkg}@${version}`];
18
+ * getInstallCommands(deps, npmInstall);
19
+ * // Returns: ['npm install lodash@^4.0.0', 'npm install express@4.17.1']
20
+ *
21
+ * @example
22
+ * // Generate commands with prefix
23
+ * getInstallCommands(deps, npmInstall, ['sudo', '-E']);
24
+ * // Returns: ['sudo -E npm install lodash@^4.0.0', 'sudo -E npm install express@4.17.1']
9
25
  */
10
26
  module.exports = (deps, pkger, prefix = []) => _(deps)
11
27
  .map((version, pkg) => _.flatten([prefix, pkger(pkg, version)]))