@automattic/vip 2.30.0 → 2.31.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.
Files changed (47) hide show
  1. package/dist/bin/vip-dev-env-sync-sql.js +11 -18
  2. package/dist/bin/vip-export-sql.js +12 -11
  3. package/dist/bin/vip-import-sql.js +2 -2
  4. package/dist/bin/vip-whoami.js +7 -10
  5. package/dist/commands/dev-env-sync-sql.js +29 -15
  6. package/dist/commands/export-sql.js +1 -1
  7. package/dist/lib/analytics/clients/pendo.js +11 -20
  8. package/dist/lib/analytics/clients/tracks.js +12 -12
  9. package/dist/lib/analytics/index.js +9 -12
  10. package/dist/lib/api/app.js +10 -13
  11. package/dist/lib/api/cache-purge.js +3 -10
  12. package/dist/lib/api/feature-flags.js +4 -2
  13. package/dist/lib/api/http.js +10 -18
  14. package/dist/lib/api/user.js +3 -8
  15. package/dist/lib/api.js +11 -14
  16. package/dist/lib/app-logs/app-logs.js +3 -6
  17. package/dist/lib/cli/apiConfig.js +10 -7
  18. package/dist/lib/cli/config.js +2 -3
  19. package/dist/lib/cli/envAlias.js +11 -9
  20. package/dist/lib/cli/exit.js +4 -7
  21. package/dist/lib/cli/format.js +25 -26
  22. package/dist/lib/cli/progress.js +7 -3
  23. package/dist/lib/cli/prompt.js +3 -2
  24. package/dist/lib/client-file-uploader.js +86 -87
  25. package/dist/lib/config/software.js +18 -12
  26. package/dist/lib/env.js +16 -13
  27. package/dist/lib/envvar/api-delete.js +2 -0
  28. package/dist/lib/envvar/api-get-all.js +4 -1
  29. package/dist/lib/envvar/api-get.js +3 -1
  30. package/dist/lib/envvar/api-list.js +8 -3
  31. package/dist/lib/envvar/api-set.js +2 -0
  32. package/dist/lib/envvar/api.js +2 -5
  33. package/dist/lib/envvar/input.js +7 -8
  34. package/dist/lib/envvar/read-file.js +4 -7
  35. package/dist/lib/http/proxy-agent.js +5 -4
  36. package/dist/lib/read-file.js +13 -14
  37. package/dist/lib/search-and-replace.js +17 -26
  38. package/dist/lib/tracker.js +12 -12
  39. package/dist/lib/user-error.js +6 -5
  40. package/dist/lib/utils.js +18 -22
  41. package/dist/lib/vip-import-validate-files.js +23 -22
  42. package/npm-shrinkwrap.json +37 -1003
  43. package/package.json +4 -4
  44. package/tsconfig.json +4 -2
  45. package/dist/lib/analytics/clients/stub.js +0 -16
  46. package/dist/lib/cli/repo.js +0 -61
  47. package/noImplictAnyImportBypass.d.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/vip",
3
- "version": "2.30.0",
3
+ "version": "2.31.0-dev1",
4
4
  "description": "The VIP Javascript library & CLI",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "vip-wp": "dist/bin/vip-wp.js"
55
55
  },
56
56
  "scripts": {
57
- "test": "npm run lint && npm run flow && jest --coverage --testPathIgnorePatterns __tests__/devenv-e2e/",
57
+ "test": "npm run lint && npm run flow && npm run check-types && jest --testPathIgnorePatterns __tests__/devenv-e2e/",
58
58
  "test:e2e:dev-env": "jest -c __tests__/devenv-e2e/jest/jest.config.js",
59
59
  "clean": "rimraf dist",
60
60
  "prepare": "npm run clean && npm run build",
@@ -122,6 +122,7 @@
122
122
  "@types/xdg-basedir": "^4.0.2",
123
123
  "@types/xml2js": "^0.4.11",
124
124
  "babel-jest": "^29.5.0",
125
+ "babel-plugin-explicit-exports-references": "^1.0.2",
125
126
  "babel-plugin-module-resolver": "5.0.0",
126
127
  "check-node-version": "^4.2.1",
127
128
  "dockerode": "^3.3.4",
@@ -129,7 +130,6 @@
129
130
  "eslint-plugin-flowtype": "^8.0.3",
130
131
  "flow-bin": "^0.206.0",
131
132
  "jest": "^29.5.0",
132
- "jest-environment-jsdom": "^29.5.0",
133
133
  "nock": "13.3.1",
134
134
  "prettier": "^2.0.5",
135
135
  "publish-please": "5.5.2",
@@ -139,7 +139,7 @@
139
139
  "dependencies": {
140
140
  "@apollo/client": "3.3.6",
141
141
  "@automattic/vip-go-preflight-checks": "^2.0.16",
142
- "@automattic/vip-search-replace": "^1.0.15",
142
+ "@automattic/vip-search-replace": "^1.1.1",
143
143
  "args": "5.0.3",
144
144
  "chalk": "4.1.2",
145
145
  "cli-columns": "^4.0.0",
package/tsconfig.json CHANGED
@@ -11,10 +11,12 @@
11
11
  "checkJs": false,
12
12
  // Disallow features that require cross-file information for emit as we're using Babel
13
13
  "isolatedModules": true,
14
+ "resolveJsonModule": true,
14
15
  "baseUrl": ".",
15
16
  "paths": {
16
- "root/*": [
17
- "./*"
17
+ "*": [
18
+ "./types/*",
19
+ "./node_modules/*"
18
20
  ]
19
21
  },
20
22
  // It's worth enabling this, I promise!
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /**
8
- * Internal dependencies
9
- */
10
- class AnalyticsClientStub {
11
- // eslint-disable-next-line no-unused-vars
12
- trackEvent(name, props) {
13
- return Promise.resolve(true);
14
- }
15
- }
16
- exports.default = AnalyticsClientStub;
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = getRepoFromGitConfig;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _path = _interopRequireDefault(require("path"));
9
- var _ini = _interopRequireDefault(require("ini"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- /**
12
- * External dependencies
13
- */
14
- async function getRepoFromGitConfig() {
15
- const file = await find();
16
- if (!file.length) {
17
- return '';
18
- }
19
- const config = _ini.default.parse(_fs.default.readFileSync(file, 'utf-8'));
20
-
21
- // Find the first 'wpcomvip' remote
22
- for (const key in config) {
23
- if ('remote' !== key.substring(0, 6)) {
24
- continue;
25
- }
26
- if (!config[key].url) {
27
- continue;
28
- }
29
- if (0 > config[key].url.indexOf('wpcomvip/')) {
30
- continue;
31
- }
32
- let repo = config[key].url;
33
- repo = repo.replace(/.git$/, '');
34
- repo = repo.replace('https://github.com/', '');
35
- repo = repo.replace('git@github.com:', '');
36
- return repo;
37
- }
38
- }
39
- async function find(dir) {
40
- dir = dir || process.cwd();
41
- const test = dir + '/.git/config';
42
- if (await exists(test)) {
43
- return test;
44
- }
45
-
46
- // Bail if we went all the way and didn't find it
47
- const directory = _path.default.parse(dir);
48
- if (directory.dir === directory.root) {
49
- return '';
50
- }
51
-
52
- // cd ..
53
- const up = dir.split(_path.default.sep);
54
- up.pop();
55
- return find(up.join(_path.default.sep));
56
- }
57
- async function exists(file) {
58
- return new Promise(resolve => {
59
- _fs.default.access(file, _fs.default.constants.F_OK, err => resolve(!err));
60
- });
61
- }
@@ -1,6 +0,0 @@
1
- // This file allows us to bypass the noImplicitAny rule for importing modules
2
- // noImplicitAny is too good of a rule to fully disable, so we provide this file to ensure that we can still import modules without types.
3
- // as that seems to have been a big pain point for everyone.
4
- // reference: https://www.typescriptlang.org/docs/handbook/modules.html#shorthand-ambient-modules
5
-
6
- declare module '*';