@automattic/vip 2.26.1 → 2.27.0-dev1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  ## Changelog
2
2
 
3
+ ### 2.26.1
4
+
5
+ - #1275 Prepare v2.26.1
6
+ - #1271 refactor(dev-env): Switch to mysql:8
7
+ - #1273 Add library for the dev-env-sync-sql command
8
+ - #1274 Run validation on filename & not on full filepath
9
+ - #1272 fix(dev-env): Suppress health warnings for new environments
10
+ - #1234 fix(dev-env): Force IPv4 for services bound to localhost
11
+
3
12
  ### 2.26.0
4
13
 
5
14
  - #1237 Skip requoting if the arg is a valid JSON Object
Binary file
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ *
5
+ * @format
6
+ */
7
+
8
+ /**
9
+ * External dependencies
10
+ */
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ "use strict";
16
+
17
+ var _command = _interopRequireDefault(require("../lib/cli/command"));
18
+ var _devEnvironmentCore = require("../lib/dev-environment/dev-environment-core");
19
+ var _devEnvironmentLando = require("../lib/dev-environment/dev-environment-lando");
20
+ var _userError = _interopRequireDefault(require("../lib/user-error"));
21
+ var _devEnvSyncSql = require("../commands/dev-env-sync-sql");
22
+ var _devEnvironment = require("../lib/constants/dev-environment");
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ const examples = [{
25
+ usage: `${_devEnvironment.DEV_ENVIRONMENT_FULL_COMMAND} sync sql @my-test.develop --slug=my_site`,
26
+ description: 'Syncs with the `my-test` site\'s `develop` environment database into `my_site`'
27
+ }];
28
+ const appQuery = `
29
+ id,
30
+ name,
31
+ type,
32
+ organization { id, name },
33
+ environments{
34
+ id
35
+ appId
36
+ type
37
+ name
38
+ primaryDomain { name }
39
+ }
40
+ `;
41
+ (0, _command.default)({
42
+ appContext: true,
43
+ appQuery,
44
+ envContext: true,
45
+ requiredArgs: 0,
46
+ module: 'dev-env-sync-sql'
47
+ }).option('slug', 'Custom name of the dev environment').examples(examples).argv(process.argv, async (arg, {
48
+ app,
49
+ env,
50
+ slug
51
+ }) => {
52
+ const lando = await (0, _devEnvironmentLando.bootstrapLando)();
53
+ const envPath = (0, _devEnvironmentCore.getEnvironmentPath)(slug);
54
+ if (!(await (0, _devEnvironmentLando.isEnvUp)(lando, envPath))) {
55
+ throw new _userError.default('Environment needs to be started first');
56
+ }
57
+ const cmd = new _devEnvSyncSql.DevEnvSyncSQLCommand(app, env, slug);
58
+ await cmd.run();
59
+ });
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ *
5
+ * @format
6
+ */
7
+
8
+ /**
9
+ * External dependencies
10
+ */
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ "use strict";
16
+
17
+ var _command = _interopRequireDefault(require("../lib/cli/command"));
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ (0, _command.default)({
20
+ requiredArgs: 1
21
+ }).command('sql', 'Sync local database with a production environment').argv(process.argv);
@@ -18,4 +18,4 @@ var _command = _interopRequireDefault(require("../lib/cli/command"));
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
  (0, _command.default)({
20
20
  requiredArgs: 1
21
- }).command('create', 'Create a new local dev environment').command('update', 'Update an already created local dev environment').command('start', 'Start a local dev environment').command('stop', 'Stop a local dev environment').command('destroy', 'Remove containers, networks, volumes and configuration files of a local dev environment').command('info', 'Provides basic info about one or multiple local dev environments').command('list', 'Provides basic info about all local dev environments').command('exec', 'Execute an operation on a dev environment').command('import', 'Import data into a local WordPress environment').argv(process.argv);
21
+ }).command('create', 'Create a new local dev environment').command('update', 'Update an already created local dev environment').command('start', 'Start a local dev environment').command('stop', 'Stop a local dev environment').command('destroy', 'Remove containers, networks, volumes and configuration files of a local dev environment').command('info', 'Provides basic info about one or multiple local dev environments').command('list', 'Provides basic info about all local dev environments').command('exec', 'Execute an operation on a dev environment').command('import', 'Import data into a local WordPress environment').command('sync', 'Pull data from production to local development environment').argv(process.argv);
@@ -29,6 +29,7 @@ var _chalk = _interopRequireDefault(require("chalk"));
29
29
  var _zlib = require("zlib");
30
30
  var _crypto = require("crypto");
31
31
  var _promises = require("node:stream/promises");
32
+ var _stream = require("stream");
32
33
  var _xml2js = require("xml2js");
33
34
  var _debug = _interopRequireDefault(require("debug"));
34
35
  var _http = _interopRequireDefault(require("../lib/api/http"));
@@ -186,7 +187,7 @@ async function uploadUsingPutObject({
186
187
  };
187
188
 
188
189
  let readBytes = 0;
189
- const progressPassThrough = new _promises.PassThrough();
190
+ const progressPassThrough = new _stream.PassThrough();
190
191
  progressPassThrough.on('data', data => {
191
192
  readBytes += data.length;
192
193
  const percentage = Math.floor(100 * readBytes / fileSize) + '%';
@@ -409,7 +410,7 @@ async function uploadParts({
409
410
  index,
410
411
  partSize
411
412
  } = part;
412
- const progressPassThrough = new _promises.PassThrough();
413
+ const progressPassThrough = new _stream.PassThrough();
413
414
  let partBytesRead = 0;
414
415
  progressPassThrough.on('data', data => {
415
416
  totalBytesRead += data.length;
@@ -19,6 +19,7 @@ var _os = _interopRequireDefault(require("os"));
19
19
  var _fs = _interopRequireDefault(require("fs"));
20
20
  var _path = _interopRequireDefault(require("path"));
21
21
  var _lando = _interopRequireDefault(require("lando/lib/lando"));
22
+ var _bootstrap = require("lando/lib/bootstrap");
22
23
  var _utils = _interopRequireDefault(require("lando/plugins/lando-core/lib/utils"));
23
24
  var _build = _interopRequireDefault(require("lando/plugins/lando-tooling/lib/build"));
24
25
  var _chalk = _interopRequireDefault(require("chalk"));
@@ -49,7 +50,7 @@ async function getLandoConfig() {
49
50
  const nodeModulesPath = _path.default.join(__dirname, '..', '..', '..', 'node_modules');
50
51
  const landoPath = _path.default.join(nodeModulesPath, 'lando');
51
52
  const atLandoPath = _path.default.join(nodeModulesPath, '@lando');
52
- debug(`Getting lando config, using paths '${landoPath}' and '${atLandoPath}' for plugins`);
53
+ debug(`Getting Lando config, using paths '${landoPath}' and '${atLandoPath}' for plugins`);
53
54
  const isLandoDebugSelected = _debug.default.enabled(DEBUG_KEY);
54
55
  const isAllDebugSelected = _debug.default.enabled('"*"');
55
56
  let logLevelConsole;
@@ -70,8 +71,9 @@ async function getLandoConfig() {
70
71
  } catch (err) {
71
72
  // Ignore
72
73
  }
73
- return {
74
+ const config = {
74
75
  logLevelConsole,
76
+ configSources: [_path.default.join(landoDir, 'config.yml')],
75
77
  landoFile: '.lando.yml',
76
78
  preLandoFiles: ['.lando.base.yml', '.lando.dist.yml', '.lando.upstream.yml'],
77
79
  postLandoFiles: ['.lando.local.yml'],
@@ -93,6 +95,7 @@ async function getLandoConfig() {
93
95
  domain: 'lndo.site',
94
96
  version: 'unknown'
95
97
  };
98
+ return (0, _bootstrap.buildConfig)(config);
96
99
  }
97
100
  const appMap = new Map();
98
101
  async function regenerateLandofile(instancePath) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.26.1",
3
+ "version": "2.27.0-dev1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.26.1",
3
+ "version": "2.27.0-dev1",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -31,6 +31,8 @@
31
31
  "vip-dev-env-list": "dist/bin/vip-dev-env-list.js",
32
32
  "vip-dev-env-start": "dist/bin/vip-dev-env-start.js",
33
33
  "vip-dev-env-stop": "dist/bin/vip-dev-env-stop.js",
34
+ "vip-dev-env-sync": "dist/bin/vip-dev-env-sync.js",
35
+ "vip-dev-env-sync-sql": "dist/bin/vip-dev-env-sync-sql.js",
34
36
  "vip-import": "dist/bin/vip-import.js",
35
37
  "vip-import-media": "dist/bin/vip-import-media.js",
36
38
  "vip-import-media-abort": "dist/bin/vip-import-media-abort.js",
Binary file