@atlaskit/dependency-version-analytics 1.6.6 → 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.
Files changed (57) hide show
  1. package/CHANGELOG.md +198 -70
  2. package/analytics/package.json +15 -0
  3. package/bin/dependency-version-analytics.js +9 -9
  4. package/cli/package.json +1 -1
  5. package/constants/package.json +1 -1
  6. package/dist/cjs/commands/populate-historic-data/product.js +1 -2
  7. package/dist/cjs/entry-points/analytics.js +12 -0
  8. package/dist/cjs/entry-points/package.js +13 -0
  9. package/dist/cjs/entry-points/product.js +13 -0
  10. package/dist/cjs/util/analytics.js +2 -2
  11. package/dist/cjs/util/yarn.js +1 -2
  12. package/dist/es2019/cli.js +0 -1
  13. package/dist/es2019/entry-points/analytics.js +1 -0
  14. package/dist/es2019/entry-points/package.js +1 -0
  15. package/dist/es2019/entry-points/product.js +1 -0
  16. package/dist/es2019/util/analytics.js +2 -2
  17. package/dist/esm/cli.js +0 -1
  18. package/dist/esm/commands/populate-historic-data/lib/dependency-store.js +10 -9
  19. package/dist/esm/commands/populate-historic-data/product.js +2 -2
  20. package/dist/esm/entry-points/analytics.js +1 -0
  21. package/dist/esm/entry-points/package.js +1 -0
  22. package/dist/esm/entry-points/product.js +1 -0
  23. package/dist/esm/util/analytics.js +2 -2
  24. package/dist/types/cli.d.ts +2 -2
  25. package/dist/types/commands/populate-historic-data/lib/dependency-store.d.ts +1 -1
  26. package/dist/types/commands/populate-historic-data/package.d.ts +2 -2
  27. package/dist/types/commands/populate-historic-data/product.d.ts +1 -1
  28. package/dist/types/commands/populate-historic-data/types.d.ts +1 -1
  29. package/dist/types/commands/populate-historic-data/util/generate-csv.d.ts +1 -1
  30. package/dist/types/entry-points/analytics.d.ts +1 -0
  31. package/dist/types/entry-points/package.d.ts +1 -0
  32. package/dist/types/entry-points/product.d.ts +1 -0
  33. package/dist/types/index.d.ts +2 -2
  34. package/dist/types/types.d.ts +1 -1
  35. package/dist/types/util/analytics.d.ts +1 -1
  36. package/dist/types/util/get-package-version-history.d.ts +1 -1
  37. package/dist/types/util/git.d.ts +3 -3
  38. package/dist/types-ts4.5/cli.d.ts +2 -2
  39. package/dist/types-ts4.5/commands/populate-historic-data/lib/dependency-store.d.ts +1 -1
  40. package/dist/types-ts4.5/commands/populate-historic-data/package.d.ts +2 -2
  41. package/dist/types-ts4.5/commands/populate-historic-data/product.d.ts +1 -1
  42. package/dist/types-ts4.5/commands/populate-historic-data/types.d.ts +1 -1
  43. package/dist/types-ts4.5/commands/populate-historic-data/util/generate-csv.d.ts +1 -1
  44. package/dist/types-ts4.5/entry-points/analytics.d.ts +1 -0
  45. package/dist/types-ts4.5/entry-points/package.d.ts +1 -0
  46. package/dist/types-ts4.5/entry-points/product.d.ts +1 -0
  47. package/dist/types-ts4.5/index.d.ts +2 -2
  48. package/dist/types-ts4.5/types.d.ts +1 -1
  49. package/dist/types-ts4.5/util/analytics.d.ts +1 -1
  50. package/dist/types-ts4.5/util/get-package-version-history.d.ts +1 -1
  51. package/dist/types-ts4.5/util/git.d.ts +3 -3
  52. package/jest.config.js +1 -1
  53. package/package/package.json +15 -0
  54. package/package.json +55 -62
  55. package/product/package.json +15 -0
  56. package/report.api.md +51 -52
  57. package/types/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "sendAnalytics", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _analytics.sendAnalytics;
10
+ }
11
+ });
12
+ var _analytics = require("../util/analytics");
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "populatePackage", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _package.default;
11
+ }
12
+ });
13
+ var _package = _interopRequireDefault(require("../commands/populate-historic-data/package"));
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ Object.defineProperty(exports, "populateProduct", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _product.default;
11
+ }
12
+ });
13
+ var _product = _interopRequireDefault(require("../commands/populate-historic-data/product"));
@@ -10,7 +10,7 @@ var _chalk = _interopRequireDefault(require("chalk"));
10
10
  var _inquirer = _interopRequireDefault(require("inquirer"));
11
11
  var _semver = _interopRequireDefault(require("semver"));
12
12
  var _analyticsNodeClient = require("@atlassiansox/analytics-node-client");
13
- /* eslint-disable-next-line import/no-unresolved */
13
+ /* eslint-disable-next-line @repo/internal/import/no-unresolved */
14
14
 
15
15
  function getUpgradeType(version, previousVersion) {
16
16
  if (previousVersion == null && version != null) {
@@ -67,7 +67,7 @@ function createUpgradeEvent(name, version, previousVersion, date, optionalEventA
67
67
  }
68
68
  });
69
69
  return {
70
- cliVersion: "1.6.6",
70
+ cliVersion: "0.0.0-development",
71
71
  dependencyName: name,
72
72
  versionString: eventVersion,
73
73
  major: parsedVersion ? `${parsedVersion.major}` : null,
@@ -10,8 +10,7 @@ var _path = _interopRequireDefault(require("path"));
10
10
  var _debug = _interopRequireDefault(require("debug"));
11
11
  var _micromatch = _interopRequireDefault(require("micromatch"));
12
12
  var git = _interopRequireWildcard(require("./git"));
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
14
  const debug = (0, _debug.default)('atlaskit:yarn');
16
15
  async function getWorkspacePackageJsonPaths(hash, subWorkDir) {
17
16
  let file;
@@ -3,7 +3,6 @@
3
3
  import chalk from 'chalk';
4
4
  import meow from 'meow';
5
5
  import { populateProduct, populatePackage } from './commands/populate-historic-data';
6
-
7
6
  // prettier-ignore
8
7
  const HELP_MSG = `
9
8
  ${chalk.green('Global options')}
@@ -0,0 +1 @@
1
+ export { sendAnalytics } from '../util/analytics';
@@ -0,0 +1 @@
1
+ export { default as populatePackage } from '../commands/populate-historic-data/package';
@@ -0,0 +1 @@
1
+ export { default as populateProduct } from '../commands/populate-historic-data/product';
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import inquirer from 'inquirer';
3
3
  import semver from 'semver';
4
- /* eslint-disable-next-line import/no-unresolved */
4
+ /* eslint-disable-next-line @repo/internal/import/no-unresolved */
5
5
  import { analyticsClient } from '@atlassiansox/analytics-node-client';
6
6
  function getUpgradeType(version, previousVersion) {
7
7
  if (previousVersion == null && version != null) {
@@ -59,7 +59,7 @@ export function createUpgradeEvent(name, version, previousVersion, date, optiona
59
59
  }
60
60
  });
61
61
  return {
62
- cliVersion: "1.6.6",
62
+ cliVersion: "0.0.0-development",
63
63
  dependencyName: name,
64
64
  versionString: eventVersion,
65
65
  major: parsedVersion ? `${parsedVersion.major}` : null,
package/dist/esm/cli.js CHANGED
@@ -4,7 +4,6 @@ import _toArray from "@babel/runtime/helpers/toArray";
4
4
  import chalk from 'chalk';
5
5
  import meow from 'meow';
6
6
  import { populateProduct, populatePackage } from './commands/populate-historic-data';
7
-
8
7
  // prettier-ignore
9
8
  var HELP_MSG = "\n".concat(chalk.green('Global options'), "\n ").concat(chalk.yellow('--dev'), " Send analytics to dev analytics pipeline instead of prod\n ").concat(chalk.yellow('--dryRun'), " Performs a dry run, prints analytics events to console in JSON format instead of sending them\n ").concat(chalk.yellow('--limit'), " Limit the number of events sent, used for validation purposes\n ").concat(chalk.yellow('--no-interactive'), " Disable any interactive prompts\n ").concat(chalk.yellow('--include-restricted-scopes'), " Include analytics for @atlassian and @atlassiansox scoped packages as well\n\n").concat(chalk.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.green('Options'), "\n ").concat(chalk.yellow('--csv'), " Prints dependency history in CSV format\n ").concat(chalk.yellow('--reset'), " Reset change detection to detect changes from the beginning of time\n ").concat(chalk.yellow('--tag'), " Specify a different tag to mark when the tool was last run\n ").concat(chalk.yellow('--statlas'), " Use statlas rather than git tags for storing and sourcing last run info\n ").concat(chalk.yellow('--supported-packages'), " List of supported packages in JSON format\n\n ").concat(chalk.green('Examples'), "\n ").concat(chalk.dim('$ atlaskit-version-analytics populate-product jira'), "\n\n").concat(chalk.yellow.bold('[populate-package] <package>'), "\n Sends analytics events for published versions of the specified package.\n\n ").concat(chalk.green('Options'), "\n ").concat(chalk.yellow('--since'), " Only publish versions since the following JS date string (exclusive)\n\n ").concat(chalk.green('Examples'), "\n ").concat(chalk.dim('$ atlaskit-version-analytics populate-package @atlaskit/button'), "\n");
10
9
  export function run(_ref) {
@@ -6,9 +6,9 @@ import _createClass from "@babel/runtime/helpers/createClass";
6
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
10
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12
12
  import _regeneratorRuntime from "@babel/runtime/regenerator";
13
13
  /** Workspace code */
14
14
 
@@ -48,9 +48,9 @@ export var DependencyStore = /*#__PURE__*/function () {
48
48
  }
49
49
 
50
50
  /** Scans the repo for dependencies at the specified git ref and return the flattened dependency map */
51
- _createClass(DependencyStore, [{
51
+ return _createClass(DependencyStore, [{
52
52
  key: "initialise",
53
- value: function () {
53
+ value: (function () {
54
54
  var _initialise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(gitRef) {
55
55
  return _regeneratorRuntime.wrap(function _callee$(_context) {
56
56
  while (1) switch (_context.prev = _context.next) {
@@ -78,9 +78,10 @@ export var DependencyStore = /*#__PURE__*/function () {
78
78
  /** Updates the repo dependency store based on the changes in `logItem`.
79
79
  * Returns the updated flattened dependencies
80
80
  */
81
+ )
81
82
  }, {
82
83
  key: "update",
83
- value: function () {
84
+ value: (function () {
84
85
  var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
85
86
  var item, subWorkDir, hash, changedPackageJsons, rootPackageJson, didRootPackageJsonChange, workspacePackageJsonPaths, workspacePackageJsonPathsChanged, changedWorkspaces, _iterator, _step, workspacePath, workspaceDeps, validWorkspace, noLongerWorkspace;
86
87
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
@@ -188,6 +189,7 @@ export var DependencyStore = /*#__PURE__*/function () {
188
189
  * If multiple versions of a dependency exist, the lowest version is returned.
189
190
  * If the dependency is listed under multiple dependency types, 'dependencies' is prioritised over 'devDependencies'
190
191
  */
192
+ )
191
193
  }, {
192
194
  key: "getFlattenedDeps",
193
195
  value: function getFlattenedDeps() {
@@ -214,7 +216,7 @@ export var DependencyStore = /*#__PURE__*/function () {
214
216
  /** Scans all workspaces in repo and rebuilds dependency store */
215
217
  }, {
216
218
  key: "resetStore",
217
- value: function () {
219
+ value: (function () {
218
220
  var _resetStore = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(hash) {
219
221
  var workspaceGlobs, workspacePaths, _iterator2, _step2, wsPath, workspaceDeps;
220
222
  return _regeneratorRuntime.wrap(function _callee3$(_context3) {
@@ -284,7 +286,7 @@ export var DependencyStore = /*#__PURE__*/function () {
284
286
  return _resetStore.apply(this, arguments);
285
287
  }
286
288
  return resetStore;
287
- }()
289
+ }())
288
290
  }, {
289
291
  key: "getWorkspaceDependencies",
290
292
  value: function () {
@@ -489,5 +491,4 @@ export var DependencyStore = /*#__PURE__*/function () {
489
491
  return parts[parts.length - 1];
490
492
  }
491
493
  }]);
492
- return DependencyStore;
493
494
  }();
@@ -64,7 +64,7 @@ var getUpgradeEventsFromPkgChange = function getUpgradeEventsFromPkgChange(oldDe
64
64
  return [].concat(_toConsumableArray(addOrUpgradeEvents), _toConsumableArray(removeEvents));
65
65
  };
66
66
  var getEventsFromHistory = /*#__PURE__*/function () {
67
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(packageChangesLog, prevRunHash, directoryOptions, supportedScopes, supportedPackages) {
67
+ var _ref0 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(packageChangesLog, prevRunHash, directoryOptions, supportedScopes, supportedPackages) {
68
68
  var allPackageChanges, allUpgradeEvents, dependencyStore, dependencies, i, item, newDependencies, packageChange, upgradeEvents;
69
69
  return _regeneratorRuntime.wrap(function _callee$(_context) {
70
70
  while (1) switch (_context.prev = _context.next) {
@@ -125,7 +125,7 @@ var getEventsFromHistory = /*#__PURE__*/function () {
125
125
  }, _callee);
126
126
  }));
127
127
  return function getEventsFromHistory(_x, _x2, _x3, _x4, _x5) {
128
- return _ref10.apply(this, arguments);
128
+ return _ref0.apply(this, arguments);
129
129
  };
130
130
  }();
131
131
  function getSinceRef(_x6) {
@@ -0,0 +1 @@
1
+ export { sendAnalytics } from '../util/analytics';
@@ -0,0 +1 @@
1
+ export { default as populatePackage } from '../commands/populate-historic-data/package';
@@ -0,0 +1 @@
1
+ export { default as populateProduct } from '../commands/populate-historic-data/product';
@@ -6,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
6
6
  import chalk from 'chalk';
7
7
  import inquirer from 'inquirer';
8
8
  import semver from 'semver';
9
- /* eslint-disable-next-line import/no-unresolved */
9
+ /* eslint-disable-next-line @repo/internal/import/no-unresolved */
10
10
  import { analyticsClient } from '@atlassiansox/analytics-node-client';
11
11
  function getUpgradeType(version, previousVersion) {
12
12
  if (previousVersion == null && version != null) {
@@ -66,7 +66,7 @@ export function createUpgradeEvent(name, version, previousVersion, date) {
66
66
  }
67
67
  });
68
68
  return _objectSpread({
69
- cliVersion: "1.6.6",
69
+ cliVersion: "0.0.0-development",
70
70
  dependencyName: name,
71
71
  versionString: eventVersion,
72
72
  major: parsedVersion ? "".concat(parsedVersion.major) : null,
@@ -1,4 +1,4 @@
1
- /// <reference lib="es2017.object" />
1
+ import type { UpgradeEvent } from './types';
2
2
  export declare function run({ dev }: {
3
3
  dev: boolean;
4
- }): Promise<void> | Promise<import("./types").UpgradeEvent[]>;
4
+ }): Promise<void> | Promise<UpgradeEvent[]>;
@@ -1,5 +1,5 @@
1
1
  /** Workspace code */
2
- import { DependencyMap } from '../types';
2
+ import { type DependencyMap } from '../types';
3
3
  import type { DefaultLogFields, ListLogLine } from 'simple-git';
4
4
  /**
5
5
  * Stores the state of atlaskit dependencies in a repository
@@ -1,5 +1,5 @@
1
- import { PopulateHistoricDataFlags } from './types';
2
- import { UpgradeEvent } from '../../types';
1
+ import { type PopulateHistoricDataFlags } from './types';
2
+ import { type UpgradeEvent } from '../../types';
3
3
  export type PopulatePackageFlags = PopulateHistoricDataFlags & {
4
4
  since?: string;
5
5
  pkg: string;
@@ -1,4 +1,4 @@
1
- import { PopulateHistoricDataFlags } from './types';
1
+ import { type PopulateHistoricDataFlags } from './types';
2
2
  export type PopulateProductFlags = PopulateHistoricDataFlags & {
3
3
  csv: boolean;
4
4
  product: string;
@@ -1,4 +1,4 @@
1
- import { DependencyType } from '../../types';
1
+ import { type DependencyType } from '../../types';
2
2
  export type PopulateHistoricDataFlags = {
3
3
  cwd?: string;
4
4
  dev: boolean;
@@ -1,3 +1,3 @@
1
- import { PackageChange } from '../types';
1
+ import { type PackageChange } from '../types';
2
2
  /** Generates a CSV of product package changes over time */
3
3
  export declare const generateCSV: (packageChanges: PackageChange[]) => string;
@@ -0,0 +1 @@
1
+ export { sendAnalytics } from '../util/analytics';
@@ -0,0 +1 @@
1
+ export { default as populatePackage } from '../commands/populate-historic-data/package';
@@ -0,0 +1 @@
1
+ export { default as populateProduct } from '../commands/populate-historic-data/product';
@@ -1,3 +1,3 @@
1
- export { populateProduct, populatePackage, } from './commands/populate-historic-data';
1
+ export { populateProduct, populatePackage } from './commands/populate-historic-data';
2
2
  export { sendAnalytics } from './util/analytics';
3
- export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent, } from './types';
3
+ export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent } from './types';
@@ -1,4 +1,4 @@
1
- import { ReleaseType } from 'semver';
1
+ import { type ReleaseType } from 'semver';
2
2
  export type DependencyType = 'devDependency' | 'dependency' | 'optionalDependency' | 'peerDependency';
3
3
  export type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
4
4
  export type UpgradeSubType = ReleaseType | null;
@@ -1,4 +1,4 @@
1
- import { UpgradeEvent, DependencyType, DistTagsType } from '../types';
1
+ import { type UpgradeEvent, type DependencyType, type DistTagsType } from '../types';
2
2
  export declare function createUpgradeEvent(name: string, version: string | undefined, previousVersion: string | undefined, date: string, optionalEventArgs?: {
3
3
  commitHash?: string;
4
4
  dependencyType?: DependencyType;
@@ -1,4 +1,4 @@
1
- import { DistTagsType } from '../types';
1
+ import { type DistTagsType } from '../types';
2
2
  export type PackageVersionHistoryAndTagsType = {
3
3
  time: {
4
4
  [version: string]: string;
@@ -1,14 +1,14 @@
1
- import type { LogResult } from 'simple-git';
1
+ import type { LogResult, FetchResult, Response } from 'simple-git';
2
2
  export declare function getChangesSince(since?: string): Promise<LogResult>;
3
3
  export declare function tagCommit(tag: string): Promise<string>;
4
4
  export declare function doesTagExist(tag: string): Promise<boolean>;
5
5
  export declare function refetchTag(tag: string): Promise<{
6
- fetchTagResult: import("simple-git").FetchResult | undefined;
6
+ fetchTagResult: FetchResult | undefined;
7
7
  }>;
8
8
  export declare function getHash(ref: string): Promise<string>;
9
9
  export declare function showFile(ref: string, filename: string, opts?: {
10
10
  cwd?: string;
11
- }): import("simple-git").Response<string>;
11
+ }): Response<string>;
12
12
  export declare function getFiles(ref: string, glob: string, opts?: {
13
13
  cwd?: string;
14
14
  }): Promise<string[]>;
@@ -1,4 +1,4 @@
1
- /// <reference lib="es2017.object" />
1
+ import type { UpgradeEvent } from './types';
2
2
  export declare function run({ dev }: {
3
3
  dev: boolean;
4
- }): Promise<void> | Promise<import("./types").UpgradeEvent[]>;
4
+ }): Promise<void> | Promise<UpgradeEvent[]>;
@@ -1,5 +1,5 @@
1
1
  /** Workspace code */
2
- import { DependencyMap } from '../types';
2
+ import { type DependencyMap } from '../types';
3
3
  import type { DefaultLogFields, ListLogLine } from 'simple-git';
4
4
  /**
5
5
  * Stores the state of atlaskit dependencies in a repository
@@ -1,5 +1,5 @@
1
- import { PopulateHistoricDataFlags } from './types';
2
- import { UpgradeEvent } from '../../types';
1
+ import { type PopulateHistoricDataFlags } from './types';
2
+ import { type UpgradeEvent } from '../../types';
3
3
  export type PopulatePackageFlags = PopulateHistoricDataFlags & {
4
4
  since?: string;
5
5
  pkg: string;
@@ -1,4 +1,4 @@
1
- import { PopulateHistoricDataFlags } from './types';
1
+ import { type PopulateHistoricDataFlags } from './types';
2
2
  export type PopulateProductFlags = PopulateHistoricDataFlags & {
3
3
  csv: boolean;
4
4
  product: string;
@@ -1,4 +1,4 @@
1
- import { DependencyType } from '../../types';
1
+ import { type DependencyType } from '../../types';
2
2
  export type PopulateHistoricDataFlags = {
3
3
  cwd?: string;
4
4
  dev: boolean;
@@ -1,3 +1,3 @@
1
- import { PackageChange } from '../types';
1
+ import { type PackageChange } from '../types';
2
2
  /** Generates a CSV of product package changes over time */
3
3
  export declare const generateCSV: (packageChanges: PackageChange[]) => string;
@@ -0,0 +1 @@
1
+ export { sendAnalytics } from '../util/analytics';
@@ -0,0 +1 @@
1
+ export { default as populatePackage } from '../commands/populate-historic-data/package';
@@ -0,0 +1 @@
1
+ export { default as populateProduct } from '../commands/populate-historic-data/product';
@@ -1,3 +1,3 @@
1
- export { populateProduct, populatePackage, } from './commands/populate-historic-data';
1
+ export { populateProduct, populatePackage } from './commands/populate-historic-data';
2
2
  export { sendAnalytics } from './util/analytics';
3
- export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent, } from './types';
3
+ export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent } from './types';
@@ -1,4 +1,4 @@
1
- import { ReleaseType } from 'semver';
1
+ import { type ReleaseType } from 'semver';
2
2
  export type DependencyType = 'devDependency' | 'dependency' | 'optionalDependency' | 'peerDependency';
3
3
  export type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
4
4
  export type UpgradeSubType = ReleaseType | null;
@@ -1,4 +1,4 @@
1
- import { UpgradeEvent, DependencyType, DistTagsType } from '../types';
1
+ import { type UpgradeEvent, type DependencyType, type DistTagsType } from '../types';
2
2
  export declare function createUpgradeEvent(name: string, version: string | undefined, previousVersion: string | undefined, date: string, optionalEventArgs?: {
3
3
  commitHash?: string;
4
4
  dependencyType?: DependencyType;
@@ -1,4 +1,4 @@
1
- import { DistTagsType } from '../types';
1
+ import { type DistTagsType } from '../types';
2
2
  export type PackageVersionHistoryAndTagsType = {
3
3
  time: {
4
4
  [version: string]: string;
@@ -1,14 +1,14 @@
1
- import type { LogResult } from 'simple-git';
1
+ import type { LogResult, FetchResult, Response } from 'simple-git';
2
2
  export declare function getChangesSince(since?: string): Promise<LogResult>;
3
3
  export declare function tagCommit(tag: string): Promise<string>;
4
4
  export declare function doesTagExist(tag: string): Promise<boolean>;
5
5
  export declare function refetchTag(tag: string): Promise<{
6
- fetchTagResult: import("simple-git").FetchResult | undefined;
6
+ fetchTagResult: FetchResult | undefined;
7
7
  }>;
8
8
  export declare function getHash(ref: string): Promise<string>;
9
9
  export declare function showFile(ref: string, filename: string, opts?: {
10
10
  cwd?: string;
11
- }): import("simple-git").Response<string>;
11
+ }): Response<string>;
12
12
  export declare function getFiles(ref: string, glob: string, opts?: {
13
13
  cwd?: string;
14
14
  }): Promise<string[]>;
package/jest.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const config = {
2
- preset: 'ts-jest/presets/js-with-babel',
2
+ preset: 'ts-jest/presets/js-with-babel',
3
3
  };
4
4
 
5
5
  module.exports = config;
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@atlaskit/dependency-version-analytics/package",
3
+ "main": "../dist/cjs/entry-points/package.js",
4
+ "module": "../dist/esm/entry-points/package.js",
5
+ "module:es2019": "../dist/es2019/entry-points/package.js",
6
+ "sideEffects": false,
7
+ "types": "../dist/types/entry-points/package.d.ts",
8
+ "typesVersions": {
9
+ ">=4.5 <5.9": {
10
+ "*": [
11
+ "../dist/types-ts4.5/entry-points/package.d.ts"
12
+ ]
13
+ }
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,64 +1,57 @@
1
1
  {
2
- "name": "@atlaskit/dependency-version-analytics",
3
- "version": "1.6.6",
4
- "description": "Tool to pull atlaskit version history from a repo",
5
- "publishConfig": {
6
- "registry": "https://registry.npmjs.org/"
7
- },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
- "author": "Atlassian Pty Ltd",
10
- "license": "Apache-2.0",
11
- "main": "dist/cjs/index.js",
12
- "types": "dist/types/index.d.ts",
13
- "typesVersions": {
14
- ">=4.5 <4.9": {
15
- "*": [
16
- "dist/types-ts4.5/*",
17
- "dist/types-ts4.5/index.d.ts"
18
- ]
19
- }
20
- },
21
- "sideEffects": false,
22
- "atlaskit:src": "src/index.ts",
23
- "atlassian": {
24
- "team": "UIP - Platform Integration Trust (PITa)",
25
- "releaseModel": "continuous"
26
- },
27
- "bin": "./bin/dependency-version-analytics.js",
28
- "scripts": {
29
- "test": "jest"
30
- },
31
- "dependencies": {
32
- "@babel/runtime": "^7.0.0",
33
- "chalk": "^4.1.2",
34
- "debug": "^4.3.4",
35
- "inquirer": "^8.2.0",
36
- "meow": "^8.1.1",
37
- "micromatch": "^4.0.2",
38
- "node-fetch": "^2.6.7",
39
- "semver": "^7.5.2",
40
- "simple-git": "^3.16.0"
41
- },
42
- "peerDependencies": {
43
- "@atlassiansox/analytics-node-client": "^4.0.0"
44
- },
45
- "devDependencies": {
46
- "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
47
- "@atlassiansox/analytics-node-client": "^4.0.0",
48
- "@types/debug": "^4.1.10",
49
- "@types/jest": "^26.0.14",
50
- "@types/micromatch": "^4.0.1",
51
- "@types/node": "~18.17.1",
52
- "jest": "^26.4.2",
53
- "ts-jest": "26.5.6",
54
- "ts-node": "^10.9.1",
55
- "typescript": "~4.9.5"
56
- },
57
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0",
58
- "af:exports": {
59
- ".": "./src/index.ts",
60
- "./cli": "./src/cli.ts",
61
- "./constants": "./src/constants.ts",
62
- "./types": "./src/types.ts"
63
- }
2
+ "name": "@atlaskit/dependency-version-analytics",
3
+ "version": "1.7.0",
4
+ "description": "Tool to pull atlaskit version history from a repo",
5
+ "publishConfig": {
6
+ "registry": "https://registry.npmjs.org/"
7
+ },
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
+ "author": "Atlassian Pty Ltd",
10
+ "license": "Apache-2.0",
11
+ "main": "dist/cjs/index.js",
12
+ "types": "dist/types/index.d.ts",
13
+ "typesVersions": {
14
+ ">=4.5 <4.9": {
15
+ "*": [
16
+ "dist/types-ts4.5/*",
17
+ "dist/types-ts4.5/index.d.ts"
18
+ ]
19
+ }
20
+ },
21
+ "sideEffects": false,
22
+ "atlaskit:src": "src/index.ts",
23
+ "atlassian": {
24
+ "team": "Build Infra",
25
+ "toolingLabels": [
26
+ "__unclassified_tooling__"
27
+ ]
28
+ },
29
+ "bin": "./bin/dependency-version-analytics.js",
30
+ "scripts": {
31
+ "test": "jest"
32
+ },
33
+ "dependencies": {
34
+ "@babel/runtime": "^7.0.0",
35
+ "chalk": "^4.1.2",
36
+ "debug": "^4.3.4",
37
+ "inquirer": "^8.2.0",
38
+ "meow": "^8.1.1",
39
+ "micromatch": "^4.0.2",
40
+ "node-fetch": "^2.6.7",
41
+ "semver": "^7.5.2",
42
+ "simple-git": "^3.16.0"
43
+ },
44
+ "peerDependencies": {
45
+ "@atlassiansox/analytics-node-client": "^4.0.0"
46
+ },
47
+ "devDependencies": {
48
+ "@atlassiansox/analytics-node-client": "^4.0.0",
49
+ "@types/debug": "^4.1.10",
50
+ "@types/jest": "^29.5.12",
51
+ "@types/micromatch": "^4.0.1",
52
+ "@types/node": "^24.0.0",
53
+ "jest": "^29.7.0",
54
+ "ts-jest": "^29.2.2",
55
+ "ts-node": "^10.9.1"
56
+ }
64
57
  }