@atlaskit/dependency-version-analytics 0.3.13 → 0.4.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 (32) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/commands/populate-historic-data/product.js +1 -1
  3. package/dist/cjs/util/yarn.js +1 -1
  4. package/dist/cjs/version.json +1 -1
  5. package/dist/es2019/commands/populate-historic-data/product.js +1 -1
  6. package/dist/es2019/util/yarn.js +1 -1
  7. package/dist/es2019/version.json +1 -1
  8. package/dist/esm/commands/populate-historic-data/product.js +1 -1
  9. package/dist/esm/util/yarn.js +1 -1
  10. package/dist/esm/version.json +1 -1
  11. package/package.json +3 -10
  12. package/report.api.md +30 -10
  13. package/tmp/api-report-tmp.d.ts +74 -0
  14. package/dist/types-ts4.0/cli.d.ts +0 -4
  15. package/dist/types-ts4.0/commands/populate-historic-data/__fixtures__/git.d.ts +0 -2
  16. package/dist/types-ts4.0/commands/populate-historic-data/index.d.ts +0 -2
  17. package/dist/types-ts4.0/commands/populate-historic-data/lib/dependency-store.d.ts +0 -39
  18. package/dist/types-ts4.0/commands/populate-historic-data/package.d.ts +0 -7
  19. package/dist/types-ts4.0/commands/populate-historic-data/product.d.ts +0 -9
  20. package/dist/types-ts4.0/commands/populate-historic-data/types.d.ts +0 -18
  21. package/dist/types-ts4.0/commands/populate-historic-data/util/generate-csv.d.ts +0 -3
  22. package/dist/types-ts4.0/constants.d.ts +0 -19
  23. package/dist/types-ts4.0/index.d.ts +0 -3
  24. package/dist/types-ts4.0/types.d.ts +0 -18
  25. package/dist/types-ts4.0/util/analytics.d.ts +0 -12
  26. package/dist/types-ts4.0/util/assert.d.ts +0 -2
  27. package/dist/types-ts4.0/util/env-with-guard.d.ts +0 -1
  28. package/dist/types-ts4.0/util/get-file-history-from-git.d.ts +0 -1
  29. package/dist/types-ts4.0/util/get-package-version-history.d.ts +0 -4
  30. package/dist/types-ts4.0/util/git.d.ts +0 -14
  31. package/dist/types-ts4.0/util/statlas.d.ts +0 -5
  32. package/dist/types-ts4.0/util/yarn.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/dependency-version-analytics
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`00ea8db4763`](https://bitbucket.org/atlassian/atlassian-frontend/commits/00ea8db4763) - Upgrading the simple-git version
8
+
3
9
  ## 0.3.13
4
10
 
5
11
  ### Patch Changes
@@ -17,7 +17,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
17
17
 
18
18
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
19
19
 
20
- var _constants = require("./../../constants");
20
+ var _constants = require("../../constants");
21
21
 
22
22
  var _chalk = _interopRequireDefault(require("chalk"));
23
23
 
@@ -22,7 +22,7 @@ var _debug = _interopRequireDefault(require("debug"));
22
22
 
23
23
  var _micromatch = _interopRequireDefault(require("micromatch"));
24
24
 
25
- var git = _interopRequireWildcard(require("../util/git"));
25
+ var git = _interopRequireWildcard(require("./git"));
26
26
 
27
27
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
28
28
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -1,4 +1,4 @@
1
- import { DEFAULT_TAG } from './../../constants';
1
+ import { DEFAULT_TAG } from '../../constants';
2
2
  import chalk from 'chalk';
3
3
  import { createUpgradeEvent, sendAnalytics } from '../../util/analytics';
4
4
  import { getChangesSince, tagCommit, doesTagExist, refetchTag, getHash } from '../../util/git';
@@ -1,7 +1,7 @@
1
1
  import path from 'path';
2
2
  import debugModule from 'debug';
3
3
  import micromatch from 'micromatch';
4
- import * as git from '../util/git';
4
+ import * as git from './git';
5
5
  const rootPackageJsonPath = 'package.json';
6
6
  const debug = debugModule('atlaskit:yarn');
7
7
  export async function getWorkspaceGlobs(ref, cwd) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "sideEffects": false
5
5
  }
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
- import { DEFAULT_TAG } from './../../constants';
5
+ import { DEFAULT_TAG } from '../../constants';
6
6
  import chalk from 'chalk';
7
7
  import { createUpgradeEvent, sendAnalytics } from '../../util/analytics';
8
8
  import { getChangesSince, tagCommit, doesTagExist, refetchTag, getHash } from '../../util/git';
@@ -4,7 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import path from 'path';
5
5
  import debugModule from 'debug';
6
6
  import micromatch from 'micromatch';
7
- import * as git from '../util/git';
7
+ import * as git from './git';
8
8
  var rootPackageJsonPath = 'package.json';
9
9
  var debug = debugModule('atlaskit:yarn');
10
10
  export function getWorkspaceGlobs(_x, _x2) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.13",
3
+ "version": "0.4.0",
4
4
  "description": "Tool to pull atlaskit version history from a repo",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -10,17 +10,10 @@
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",
12
12
  "types": "dist/types/index.d.ts",
13
- "typesVersions": {
14
- ">=4.0 <4.5": {
15
- "*": [
16
- "dist/types-ts4.0/*"
17
- ]
18
- }
19
- },
20
13
  "sideEffects": false,
21
14
  "atlaskit:src": "src/index.ts",
22
15
  "atlassian": {
23
- "team": "UIP: Monorepo",
16
+ "team": "UIP - Platform Integration Trust (PITa)",
24
17
  "deprecatedAutoEntryPoints": true,
25
18
  "releaseModel": "continuous"
26
19
  },
@@ -36,7 +29,7 @@
36
29
  "micromatch": "^4.0.2",
37
30
  "node-fetch": "^2.6.7",
38
31
  "semver": "^7.3.0",
39
- "simple-git": "^3.5.0"
32
+ "simple-git": "^3.15.0"
40
33
  },
41
34
  "peerDependencies": {
42
35
  "@atlassiansox/analytics-node-client": "^1.2.2"
package/report.api.md CHANGED
@@ -1,20 +1,26 @@
1
+ <!-- API Report Version: 2.3 -->
2
+
1
3
  ## API Report File for "@atlaskit/dependency-version-analytics"
2
4
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
4
12
 
5
- <!--
6
- Generated API Report version: 2.0
7
- -->
13
+ ### Main Entry Types
8
14
 
9
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
15
+ <!--SECTION START: Main Entry Types-->
10
16
 
11
17
  ```ts
12
18
  import { ReleaseType } from 'semver';
13
19
 
14
20
  // @public (undocumented)
15
21
  export type DependencyType =
16
- | 'devDependency'
17
22
  | 'dependency'
23
+ | 'devDependency'
18
24
  | 'optionalDependency'
19
25
  | 'peerDependency';
20
26
 
@@ -70,9 +76,9 @@ export function sendAnalytics(
70
76
  export type UpgradeEvent = {
71
77
  dependencyName: string;
72
78
  versionString: string;
73
- major: string | null;
74
- minor: string | null;
75
- patch: string | null;
79
+ major: null | string;
80
+ minor: null | string;
81
+ patch: null | string;
76
82
  date: string;
77
83
  upgradeType: UpgradeType;
78
84
  upgradeSubType: UpgradeSubType;
@@ -86,7 +92,21 @@ export type UpgradeEvent = {
86
92
  export type UpgradeSubType = ReleaseType | null;
87
93
 
88
94
  // @public (undocumented)
89
- export type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
95
+ export type UpgradeType = 'add' | 'downgrade' | 'remove' | 'upgrade';
90
96
 
91
97
  // (No @packageDocumentation comment for this package)
92
98
  ```
99
+
100
+ <!--SECTION END: Main Entry Types-->
101
+
102
+ ### Peer Dependencies
103
+
104
+ <!--SECTION START: Peer Dependencies-->
105
+
106
+ ```json
107
+ {
108
+ "@atlassiansox/analytics-node-client": "^1.2.2"
109
+ }
110
+ ```
111
+
112
+ <!--SECTION END: Peer Dependencies-->
@@ -0,0 +1,74 @@
1
+ ## API Report File for "@atlaskit/dependency-version-analytics"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ import { ReleaseType } from 'semver';
8
+
9
+ // @public (undocumented)
10
+ export type DependencyType = 'dependency' | 'devDependency' | 'optionalDependency' | 'peerDependency';
11
+
12
+ // @public (undocumented)
13
+ type PopulateHistoricDataFlags = {
14
+ cwd?: string;
15
+ dev: boolean;
16
+ dryRun: boolean;
17
+ limit?: number;
18
+ interactive: boolean;
19
+ };
20
+
21
+ // @public (undocumented)
22
+ export function populatePackage(flags: PopulatePackageFlags): Promise<UpgradeEvent[]>;
23
+
24
+ // @public (undocumented)
25
+ type PopulatePackageFlags = PopulateHistoricDataFlags & {
26
+ since?: string;
27
+ pkg: string;
28
+ };
29
+
30
+ // @public (undocumented)
31
+ export function populateProduct(flags: PopulateProductFlags): Promise<void>;
32
+
33
+ // @public (undocumented)
34
+ type PopulateProductFlags = PopulateHistoricDataFlags & {
35
+ csv: boolean;
36
+ product: string;
37
+ reset: boolean;
38
+ statlas?: boolean;
39
+ tag?: string;
40
+ };
41
+
42
+ // @public (undocumented)
43
+ export function sendAnalytics(analyticsEvents: UpgradeEvent[], { dev, limit, product, skipPrompt, }: {
44
+ dev?: boolean;
45
+ limit?: number;
46
+ product: string;
47
+ skipPrompt?: boolean;
48
+ }): Promise<void>;
49
+
50
+ // @public (undocumented)
51
+ export type UpgradeEvent = {
52
+ dependencyName: string;
53
+ versionString: string;
54
+ major: null | string;
55
+ minor: null | string;
56
+ patch: null | string;
57
+ date: string;
58
+ upgradeType: UpgradeType;
59
+ upgradeSubType: UpgradeSubType;
60
+ cliVersion: string;
61
+ dependencyType?: DependencyType;
62
+ historical?: boolean;
63
+ commitHash?: string;
64
+ };
65
+
66
+ // @public (undocumented)
67
+ export type UpgradeSubType = ReleaseType | null;
68
+
69
+ // @public (undocumented)
70
+ export type UpgradeType = 'add' | 'downgrade' | 'remove' | 'upgrade';
71
+
72
+ // (No @packageDocumentation comment for this package)
73
+
74
+ ```
@@ -1,4 +0,0 @@
1
- /// <reference lib="es2017.object" />
2
- export declare function run({ dev }: {
3
- dev: boolean;
4
- }): Promise<void> | Promise<import("./types").UpgradeEvent[]>;
@@ -1,2 +0,0 @@
1
- import type { LogResult } from 'simple-git';
2
- export declare const generateLogs: (fileChanges: string[][]) => LogResult;
@@ -1,2 +0,0 @@
1
- export { default as populateProduct } from './product';
2
- export { default as populatePackage } from './package';
@@ -1,39 +0,0 @@
1
- /** Workspace code */
2
- import { DependencyMap } from '../types';
3
- import type { DefaultLogFields, ListLogLine } from 'simple-git';
4
- /**
5
- * Stores the state of atlaskit dependencies in a repository
6
- */
7
- export declare class DependencyStore {
8
- private cwd;
9
- /** Mapping of dependency names to arrays of unique dependency type + versions */
10
- private dependencies;
11
- /** Mapping of workspaces to their dependency map. Each dependency in their map links to an entry in `dependencies` */
12
- private workspaces;
13
- /** Set of workspace globs. Used to verify that a package.json is a valid workspace */
14
- private workspaceGlobs;
15
- private initialised;
16
- constructor(cwd?: string);
17
- /** Scans the repo for dependencies at the specified git ref and return the flattened dependency map */
18
- initialise(gitRef: string | undefined): Promise<DependencyMap>;
19
- /** Updates the repo dependency store based on the changes in `logItem`.
20
- * Returns the updated flattened dependencies
21
- */
22
- update(logItem: DefaultLogFields & ListLogLine): Promise<DependencyMap>;
23
- /** Retrieve a flattened list of p repo dependencies.
24
- * If multiple versions of a dependency exist, the lowest version is returned.
25
- * If the dependency is listed under multiple dependency types, 'dependencies' is prioritised over 'devDependencies'
26
- */
27
- private getFlattenedDeps;
28
- private assertInitialised;
29
- /** Scans all workspaces in repo and rebuilds dependency store */
30
- private resetStore;
31
- private getWorkspaceDependencies;
32
- private updateWorkspaces;
33
- private addDependency;
34
- private removeDependency;
35
- private static getAkDependencies;
36
- private static getMinimumVersion;
37
- private static transformDepName;
38
- private static transformDepVersion;
39
- }
@@ -1,7 +0,0 @@
1
- import { PopulateHistoricDataFlags } from './types';
2
- import { UpgradeEvent } from '../../types';
3
- export declare type PopulatePackageFlags = PopulateHistoricDataFlags & {
4
- since?: string;
5
- pkg: string;
6
- };
7
- export default function populatePackage(flags: PopulatePackageFlags): Promise<UpgradeEvent[]>;
@@ -1,9 +0,0 @@
1
- import { PopulateHistoricDataFlags } from './types';
2
- export declare type PopulateProductFlags = PopulateHistoricDataFlags & {
3
- csv: boolean;
4
- product: string;
5
- reset: boolean;
6
- statlas?: boolean;
7
- tag?: string;
8
- };
9
- export default function populateProduct(flags: PopulateProductFlags): Promise<void>;
@@ -1,18 +0,0 @@
1
- import { DependencyType } from '../../types';
2
- export declare type PopulateHistoricDataFlags = {
3
- cwd?: string;
4
- dev: boolean;
5
- dryRun: boolean;
6
- limit?: number;
7
- interactive: boolean;
8
- };
9
- export declare type DependencyMap = {
10
- [name: string]: {
11
- version: string;
12
- type: DependencyType;
13
- };
14
- };
15
- export declare type AkPackageChange = {
16
- akDeps: DependencyMap;
17
- date: string;
18
- };
@@ -1,3 +0,0 @@
1
- import { AkPackageChange } from '../types';
2
- /** Generates a CSV of product package changes over time */
3
- export declare const generateCSV: (packageChanges: AkPackageChange[]) => string;
@@ -1,19 +0,0 @@
1
- export declare const DEFAULT_TAG = "atlaskit-dependency-version-analytics-last-run";
2
- export declare const DEP_TYPES: readonly [
3
- {
4
- readonly packageJsonKey: "devDependencies";
5
- readonly depTypeName: "devDependency";
6
- },
7
- {
8
- readonly packageJsonKey: "dependencies";
9
- readonly depTypeName: "dependency";
10
- },
11
- {
12
- readonly packageJsonKey: "peerDependencies";
13
- readonly depTypeName: "peerDependency";
14
- },
15
- {
16
- readonly packageJsonKey: "optionalDependencies";
17
- readonly depTypeName: "optionalDependency";
18
- }
19
- ];
@@ -1,3 +0,0 @@
1
- export { populateProduct, populatePackage, } from './commands/populate-historic-data';
2
- export { sendAnalytics } from './util/analytics';
3
- export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent, } from './types';
@@ -1,18 +0,0 @@
1
- import { ReleaseType } from 'semver';
2
- export declare type DependencyType = 'devDependency' | 'dependency' | 'optionalDependency' | 'peerDependency';
3
- export declare type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
4
- export declare type UpgradeSubType = ReleaseType | null;
5
- export declare type UpgradeEvent = {
6
- dependencyName: string;
7
- versionString: string;
8
- major: string | null;
9
- minor: string | null;
10
- patch: string | null;
11
- date: string;
12
- upgradeType: UpgradeType;
13
- upgradeSubType: UpgradeSubType;
14
- cliVersion: string;
15
- dependencyType?: DependencyType;
16
- historical?: boolean;
17
- commitHash?: string;
18
- };
@@ -1,12 +0,0 @@
1
- import { UpgradeEvent, DependencyType } from '../types';
2
- export declare function createUpgradeEvent(name: string, version: string | undefined, previousVersion: string | undefined, date: string, optionalArgs?: {
3
- commitHash?: string;
4
- dependencyType?: DependencyType;
5
- historical?: boolean;
6
- }): UpgradeEvent | null;
7
- export declare function sendAnalytics(analyticsEvents: UpgradeEvent[], { dev, limit, product, skipPrompt, }: {
8
- dev?: boolean;
9
- limit?: number;
10
- product: string;
11
- skipPrompt?: boolean;
12
- }): Promise<void>;
@@ -1,2 +0,0 @@
1
- /** Generic assertion function */
2
- export declare function assert(condition: any, msg?: string): asserts condition;
@@ -1 +0,0 @@
1
- export default function (name: string): string | null;
@@ -1 +0,0 @@
1
- export default function getFileHistoryFromGit(fileName: string): Promise<string>;
@@ -1,4 +0,0 @@
1
- export declare type PackageVersionHistory = {
2
- [version: string]: string;
3
- };
4
- export default function getPackageVersionHistory(packageName: string): Promise<PackageVersionHistory>;
@@ -1,14 +0,0 @@
1
- import type { LogResult } from 'simple-git';
2
- export declare function getChangesSince(since?: string): Promise<LogResult>;
3
- export declare function tagCommit(tag: string): Promise<string>;
4
- export declare function doesTagExist(tag: string): Promise<boolean>;
5
- export declare function refetchTag(tag: string): Promise<{
6
- fetchTagResult: import("simple-git").FetchResult | undefined;
7
- }>;
8
- export declare function getHash(ref: string): Promise<string>;
9
- export declare function showFile(ref: string, filename: string, opts?: {
10
- cwd?: string;
11
- }): import("simple-git").Response<string>;
12
- export declare function getFiles(ref: string, glob: string, opts?: {
13
- cwd?: string;
14
- }): Promise<string[]>;
@@ -1,5 +0,0 @@
1
- export declare type Meta = {
2
- lastRunHash: string;
3
- };
4
- export declare function getMeta(product: string): Promise<Meta | null>;
5
- export declare function uploadMeta(product: string, lastRunHash: string): Promise<void>;
@@ -1,2 +0,0 @@
1
- export declare function getWorkspaceGlobs(ref: string, cwd: string): Promise<Set<string> | null>;
2
- export declare function getWorkspacePaths(ref: string, workspaceGlobs: Set<string>, cwd: string): Promise<string[]>;