@atlaskit/dependency-version-analytics 0.4.2 → 1.1.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -1
  3. package/dist/cjs/cli.js +4 -18
  4. package/dist/cjs/commands/populate-historic-data/index.js +0 -3
  5. package/dist/cjs/commands/populate-historic-data/lib/dependency-store.js +24 -141
  6. package/dist/cjs/commands/populate-historic-data/package.js +8 -29
  7. package/dist/cjs/commands/populate-historic-data/product.js +114 -150
  8. package/dist/cjs/commands/populate-historic-data/util/generate-csv.js +4 -16
  9. package/dist/cjs/index.js +0 -2
  10. package/dist/cjs/util/analytics.js +16 -41
  11. package/dist/cjs/util/assert.js +0 -1
  12. package/dist/cjs/util/env-with-guard.js +0 -2
  13. package/dist/cjs/util/get-file-history-from-git.js +0 -5
  14. package/dist/cjs/util/get-package-version-history.js +8 -10
  15. package/dist/cjs/util/git.js +20 -58
  16. package/dist/cjs/util/statlas.js +0 -25
  17. package/dist/cjs/util/yarn.js +0 -32
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/cli.js +4 -8
  20. package/dist/es2019/commands/populate-historic-data/lib/dependency-store.js +24 -73
  21. package/dist/es2019/commands/populate-historic-data/package.js +7 -12
  22. package/dist/es2019/commands/populate-historic-data/product.js +21 -23
  23. package/dist/es2019/commands/populate-historic-data/util/generate-csv.js +2 -9
  24. package/dist/es2019/util/analytics.js +17 -19
  25. package/dist/es2019/util/env-with-guard.js +0 -1
  26. package/dist/es2019/util/get-file-history-from-git.js +2 -3
  27. package/dist/es2019/util/get-package-version-history.js +7 -7
  28. package/dist/es2019/util/git.js +29 -24
  29. package/dist/es2019/util/statlas.js +0 -6
  30. package/dist/es2019/util/yarn.js +2 -11
  31. package/dist/es2019/version.json +1 -1
  32. package/dist/esm/cli.js +6 -12
  33. package/dist/esm/commands/populate-historic-data/lib/dependency-store.js +27 -131
  34. package/dist/esm/commands/populate-historic-data/package.js +10 -24
  35. package/dist/esm/commands/populate-historic-data/product.js +114 -134
  36. package/dist/esm/commands/populate-historic-data/util/generate-csv.js +4 -13
  37. package/dist/esm/util/analytics.js +18 -31
  38. package/dist/esm/util/env-with-guard.js +0 -1
  39. package/dist/esm/util/get-file-history-from-git.js +2 -3
  40. package/dist/esm/util/get-package-version-history.js +7 -7
  41. package/dist/esm/util/git.js +21 -50
  42. package/dist/esm/util/statlas.js +0 -19
  43. package/dist/esm/util/yarn.js +0 -19
  44. package/dist/esm/version.json +1 -1
  45. package/dist/types/types.d.ts +7 -0
  46. package/dist/types/util/analytics.d.ts +2 -1
  47. package/dist/types/util/get-package-version-history.d.ts +7 -3
  48. package/package.json +3 -3
  49. package/report.api.md +5 -1
  50. package/tmp/api-report-tmp.d.ts +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/dependency-version-analytics
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`dd9a70fcafc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dd9a70fcafc) - Add npm dist-tags (latest, next, rc, hotfix) to analytics
8
+
9
+ ## 1.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - [`7913f15625c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7913f15625c) - Upgraded @atlassiansox/analytics-node-client from 2.2.1 to 3.2.1
14
+
3
15
  ## 0.4.2
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -59,7 +59,8 @@ This command will be used to record when atlaskit publish new versions of their
59
59
  This will run the 'dev' mode of the tool and compile typescript on the fly. Any changes made to the source will instantly reflect in the product repo.
60
60
 
61
61
  1. Run `yarn link` inside the package
62
- 2. Run `yarn link add '@atlaskit/dependency-version-analytics'` inside the product repo of your choosing
62
+ 2. `cd` to the root of the `alassian-frontend` repo then run `yarn build @atlaskit/dependency-version-analytics`
63
+ 2. Run `yarn link '@atlaskit/dependency-version-analytics'` inside the product repo of your choosing or in the [`atlaskit-version-analytics`](https://bitbucket.org/atlassian/atlaskit-version-analytics/src/master/) repo to test your changes
63
64
 
64
65
  Make dev changes + save.
65
66
 
package/dist/cjs/cli.js CHANGED
@@ -1,24 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.run = run;
9
-
10
8
  var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
11
-
12
9
  var _chalk = _interopRequireDefault(require("chalk"));
13
-
14
10
  var _meow = _interopRequireDefault(require("meow"));
15
-
16
11
  var _populateHistoricData = require("./commands/populate-historic-data");
17
-
18
12
  /// <reference lib="es2017.object" />
13
+
19
14
  // prettier-ignore
20
15
  var HELP_MSG = "\n".concat(_chalk.default.green('Global options'), "\n ").concat(_chalk.default.yellow('--dev'), " Send analytics to dev analytics pipeline instead of prod\n ").concat(_chalk.default.yellow('--dryRun'), " Performs a dry run, prints analytics events to console in JSON format instead of sending them\n ").concat(_chalk.default.yellow('--limit'), " Limit the number of events sent, used for validation purposes\n ").concat(_chalk.default.yellow('--no-interactive'), " Disable any interactive prompts\n\n").concat(_chalk.default.yellow.bold('[populate-product] <product>'), "\n Sends analytics events for atlaskit dependency versions changes in package.json.\n\n Detects changes since the last time the tool was run by storing the last run in either statlas (--statlas flag) or using the\n 'atlaskit-dependency-version-analytics-last-run' git tag.\n If running the tool for the first time (last run does not exist), --reset must be used to detect changes since the beginning of the repo.\n\n ").concat(_chalk.default.green('Options'), "\n ").concat(_chalk.default.yellow('--csv'), " Prints AK dependency history in CSV format\n ").concat(_chalk.default.yellow('--reset'), " Reset change detection to detect changes from the beginning of time\n ").concat(_chalk.default.yellow('--tag'), " Specify a different tag to mark when the tool was last run\n ").concat(_chalk.default.yellow('--statlas'), " Use statlas rather than git tags for storing and sourcing last run info\n\n ").concat(_chalk.default.green('Examples'), "\n ").concat(_chalk.default.dim('$ atlaskit-version-analytics populate-product jira'), "\n\n").concat(_chalk.default.yellow.bold('[populate-package] <package>'), "\n Sends analytics events for published versions of the specified atlaskit package.\n\n ").concat(_chalk.default.green('Options'), "\n ").concat(_chalk.default.yellow('--since'), " Only publish versions since the following JS date string (exclusive)\n\n ").concat(_chalk.default.green('Examples'), "\n ").concat(_chalk.default.dim('$ atlaskit-version-analytics populate-package @atlaskit/button'), "\n");
21
-
22
16
  function run(_ref) {
23
17
  var dev = _ref.dev;
24
18
  var cli = (0, _meow.default)(HELP_MSG, {
@@ -54,21 +48,16 @@ function run(_ref) {
54
48
  }
55
49
  }
56
50
  });
57
-
58
51
  var _cli$input = (0, _toArray2.default)(cli.input),
59
- command = _cli$input[0],
60
- inputs = _cli$input.slice(1);
61
-
52
+ command = _cli$input[0],
53
+ inputs = _cli$input.slice(1);
62
54
  var limit = cli.flags.limit != null ? +cli.flags.limit : undefined;
63
-
64
55
  if (command === 'populate-product') {
65
56
  var product = inputs[0];
66
-
67
57
  if (!product) {
68
58
  console.error(_chalk.default.red('Must pass a product parameter'));
69
59
  process.exit(1);
70
60
  }
71
-
72
61
  return (0, _populateHistoricData.populateProduct)({
73
62
  csv: cli.flags.csv || false,
74
63
  dev: dev || cli.flags.dev || false,
@@ -82,12 +71,10 @@ function run(_ref) {
82
71
  });
83
72
  } else if (command === 'populate-package') {
84
73
  var pkg = inputs[0];
85
-
86
74
  if (!pkg) {
87
75
  console.error(_chalk.default.red('Must pass a package parameter'));
88
76
  process.exit(1);
89
77
  }
90
-
91
78
  return (0, _populateHistoricData.populatePackage)({
92
79
  dev: dev || cli.flags.dev || false,
93
80
  dryRun: cli.flags.dryRun || false,
@@ -97,8 +84,7 @@ function run(_ref) {
97
84
  since: cli.flags.since
98
85
  });
99
86
  }
100
- /* eslint-disable no-console */
101
-
102
87
 
88
+ /* eslint-disable no-console */
103
89
  return Promise.resolve(console.log(cli.help));
104
90
  }
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
@@ -17,7 +16,5 @@ Object.defineProperty(exports, "populateProduct", {
17
16
  return _product.default;
18
17
  }
19
18
  });
20
-
21
19
  var _product = _interopRequireDefault(require("./product"));
22
-
23
20
  var _package = _interopRequireDefault(require("./package"));