@atlaskit/dependency-version-analytics 1.2.1 → 1.2.2

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,11 @@
1
1
  # @atlaskit/dependency-version-analytics
2
2
 
3
+ ## 1.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2d3cc41d7d6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2d3cc41d7d6) - Removed logic to fetch tags metadata during product flow.
8
+
3
9
  ## 1.2.1
4
10
 
5
11
  ### Patch Changes
@@ -13,7 +13,6 @@ var statlas = _interopRequireWildcard(require("../../util/statlas"));
13
13
  var _generateCsv = require("./util/generate-csv");
14
14
  var _assert = require("../../util/assert");
15
15
  var _dependencyStore = require("./lib/dependency-store");
16
- var _getPackageVersionHistory = _interopRequireDefault(require("../../util/get-package-version-history"));
17
16
  var _allowedScopes = require("./util/allowed-scopes");
18
17
  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); }
19
18
  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; }
@@ -78,20 +77,6 @@ const getEventsFromHistory = async (packageChangesLog, prevRunHash, {
78
77
  allPackageChanges.push(packageChange);
79
78
  }
80
79
  }
81
- // add dist-tags to upgrade event
82
- allUpgradeEvents = await Promise.all(allUpgradeEvents.map(async upgradeEvent => {
83
- const getPackageTags = await (0, _getPackageVersionHistory.default)(upgradeEvent.dependencyName);
84
- const distTags = getPackageTags['dist-tags'];
85
- Object.keys(distTags).forEach(key => {
86
- if (key.startsWith('rc')) {
87
- upgradeEvent.rcTag = distTags[key];
88
- }
89
- });
90
- upgradeEvent.hotfixTag = distTags['hotfix'] ?? null;
91
- upgradeEvent.latestTag = distTags['latest'] ?? null;
92
- upgradeEvent.nextTag = distTags['next'] ?? null;
93
- return upgradeEvent;
94
- }));
95
80
  return {
96
81
  allPackageChanges,
97
82
  allUpgradeEvents
@@ -9,11 +9,11 @@ function getPackageVersionHistoryAndTags(packageName) {
9
9
  return new Promise((resolve, reject) => {
10
10
  (0, _child_process.exec)(`yarn info ${packageName} --json`, (error, stdout, stderr) => {
11
11
  if (error) {
12
- console.log(`error: Unable to execute yarn info for ${packageName}`);
12
+ console.error(`error: Unable to execute yarn info for ${packageName}`);
13
13
  reject(error);
14
14
  }
15
15
  if (stderr) {
16
- console.log(`stderr: Unable to execute yarn info for ${packageName}`);
16
+ console.error(`stderr: Unable to execute yarn info for ${packageName}`);
17
17
  reject(stderr);
18
18
  }
19
19
  let json;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "sideEffects": false
5
5
  }
@@ -14,15 +14,12 @@ const debug = debugModule('atlaskit:dependency');
14
14
  * Stores the state of atlaskit dependencies in a repository
15
15
  */
16
16
  export class DependencyStore {
17
- /** Mapping of dependency names to arrays of unique dependency type + versions */
18
-
19
- /** Mapping of workspaces to their dependency map. Each dependency in their map links to an entry in `dependencies` */
20
-
21
- /** Set of workspace globs. Used to verify that a package.json is a valid workspace */
22
-
23
17
  constructor(cwd = process.cwd(), supportedScopes) {
18
+ /** Mapping of dependency names to arrays of unique dependency type + versions */
24
19
  _defineProperty(this, "dependencies", {});
20
+ /** Mapping of workspaces to their dependency map. Each dependency in their map links to an entry in `dependencies` */
25
21
  _defineProperty(this, "workspaces", {});
22
+ /** Set of workspace globs. Used to verify that a package.json is a valid workspace */
26
23
  _defineProperty(this, "workspaceGlobs", new Set());
27
24
  _defineProperty(this, "initialised", false);
28
25
  this.cwd = cwd;
@@ -6,7 +6,6 @@ import * as statlas from '../../util/statlas';
6
6
  import { generateCSV } from './util/generate-csv';
7
7
  import { assert } from '../../util/assert';
8
8
  import { DependencyStore } from './lib/dependency-store';
9
- import getPackageVersionHistoryAndTags from '../../util/get-package-version-history';
10
9
  import { getSupportedScopes } from './util/allowed-scopes';
11
10
  const getUpgradeEventsFromPkgChange = (oldDeps, newDeps, {
12
11
  date,
@@ -69,21 +68,6 @@ const getEventsFromHistory = async (packageChangesLog, prevRunHash, {
69
68
  allPackageChanges.push(packageChange);
70
69
  }
71
70
  }
72
- // add dist-tags to upgrade event
73
- allUpgradeEvents = await Promise.all(allUpgradeEvents.map(async upgradeEvent => {
74
- var _distTags$hotfix, _distTags$latest, _distTags$next;
75
- const getPackageTags = await getPackageVersionHistoryAndTags(upgradeEvent.dependencyName);
76
- const distTags = getPackageTags['dist-tags'];
77
- Object.keys(distTags).forEach(key => {
78
- if (key.startsWith('rc')) {
79
- upgradeEvent.rcTag = distTags[key];
80
- }
81
- });
82
- upgradeEvent.hotfixTag = (_distTags$hotfix = distTags['hotfix']) !== null && _distTags$hotfix !== void 0 ? _distTags$hotfix : null;
83
- upgradeEvent.latestTag = (_distTags$latest = distTags['latest']) !== null && _distTags$latest !== void 0 ? _distTags$latest : null;
84
- upgradeEvent.nextTag = (_distTags$next = distTags['next']) !== null && _distTags$next !== void 0 ? _distTags$next : null;
85
- return upgradeEvent;
86
- }));
87
71
  return {
88
72
  allPackageChanges,
89
73
  allUpgradeEvents
@@ -3,11 +3,11 @@ export default function getPackageVersionHistoryAndTags(packageName) {
3
3
  return new Promise((resolve, reject) => {
4
4
  exec(`yarn info ${packageName} --json`, (error, stdout, stderr) => {
5
5
  if (error) {
6
- console.log(`error: Unable to execute yarn info for ${packageName}`);
6
+ console.error(`error: Unable to execute yarn info for ${packageName}`);
7
7
  reject(error);
8
8
  }
9
9
  if (stderr) {
10
- console.log(`stderr: Unable to execute yarn info for ${packageName}`);
10
+ console.error(`stderr: Unable to execute yarn info for ${packageName}`);
11
11
  reject(stderr);
12
12
  }
13
13
  let json;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "sideEffects": false
5
5
  }