@atlaskit/dependency-version-analytics 0.3.11 → 0.3.13

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,17 @@
1
1
  # @atlaskit/dependency-version-analytics
2
2
 
3
+ ## 0.3.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 0.3.12
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
14
+
3
15
  ## 0.3.11
4
16
 
5
17
  ### Patch Changes
package/cli/package.json CHANGED
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/cli.js",
5
5
  "module:es2019": "../dist/es2019/cli.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/cli.d.ts"
7
+ "types": "../dist/types/cli.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/cli.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/constants.js",
5
5
  "module:es2019": "../dist/es2019/constants.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/constants.d.ts"
7
+ "types": "../dist/types/constants.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/constants.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "sideEffects": false
5
5
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,4 @@
1
+ /// <reference lib="es2017.object" />
2
+ export declare function run({ dev }: {
3
+ dev: boolean;
4
+ }): Promise<void> | Promise<import("./types").UpgradeEvent[]>;
@@ -0,0 +1,2 @@
1
+ import type { LogResult } from 'simple-git';
2
+ export declare const generateLogs: (fileChanges: string[][]) => LogResult;
@@ -0,0 +1,2 @@
1
+ export { default as populateProduct } from './product';
2
+ export { default as populatePackage } from './package';
@@ -0,0 +1,39 @@
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
+ }
@@ -0,0 +1,7 @@
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[]>;
@@ -0,0 +1,9 @@
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>;
@@ -0,0 +1,18 @@
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
+ };
@@ -0,0 +1,3 @@
1
+ import { AkPackageChange } from '../types';
2
+ /** Generates a CSV of product package changes over time */
3
+ export declare const generateCSV: (packageChanges: AkPackageChange[]) => string;
@@ -0,0 +1,19 @@
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
+ ];
@@ -0,0 +1,3 @@
1
+ export { populateProduct, populatePackage, } from './commands/populate-historic-data';
2
+ export { sendAnalytics } from './util/analytics';
3
+ export type { DependencyType, UpgradeType, UpgradeSubType, UpgradeEvent, } from './types';
@@ -0,0 +1,18 @@
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
+ };
@@ -0,0 +1,12 @@
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>;
@@ -0,0 +1,2 @@
1
+ /** Generic assertion function */
2
+ export declare function assert(condition: any, msg?: string): asserts condition;
@@ -0,0 +1 @@
1
+ export default function (name: string): string | null;
@@ -0,0 +1 @@
1
+ export default function getFileHistoryFromGit(fileName: string): Promise<string>;
@@ -0,0 +1,4 @@
1
+ export declare type PackageVersionHistory = {
2
+ [version: string]: string;
3
+ };
4
+ export default function getPackageVersionHistory(packageName: string): Promise<PackageVersionHistory>;
@@ -0,0 +1,14 @@
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[]>;
@@ -0,0 +1,5 @@
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>;
@@ -0,0 +1,2 @@
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[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/dependency-version-analytics",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "description": "Tool to pull atlaskit version history from a repo",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -10,6 +10,13 @@
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
+ },
13
20
  "sideEffects": false,
14
21
  "atlaskit:src": "src/index.ts",
15
22
  "atlassian": {
@@ -40,8 +47,8 @@
40
47
  "@types/jest": "^26.0.14",
41
48
  "@types/micromatch": "^4.0.1",
42
49
  "@types/node": "~16.11.27",
43
- "ts-node": "^10.0.0",
44
- "typescript": "4.2.4"
50
+ "ts-node": "^10.9.1",
51
+ "typescript": "4.5.5"
45
52
  },
46
53
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
47
54
  }
package/report.api.md CHANGED
@@ -2,16 +2,24 @@
2
2
 
3
3
  > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
4
 
5
+ <!--
6
+ Generated API Report version: 2.0
7
+ -->
8
+
9
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
10
+
5
11
  ```ts
6
12
  import { ReleaseType } from 'semver';
7
13
 
8
- export declare type DependencyType =
14
+ // @public (undocumented)
15
+ export type DependencyType =
9
16
  | 'devDependency'
10
17
  | 'dependency'
11
18
  | 'optionalDependency'
12
19
  | 'peerDependency';
13
20
 
14
- declare type PopulateHistoricDataFlags = {
21
+ // @public (undocumented)
22
+ type PopulateHistoricDataFlags = {
15
23
  cwd?: string;
16
24
  dev: boolean;
17
25
  dryRun: boolean;
@@ -19,20 +27,22 @@ declare type PopulateHistoricDataFlags = {
19
27
  interactive: boolean;
20
28
  };
21
29
 
22
- export declare function populatePackage(
30
+ // @public (undocumented)
31
+ export function populatePackage(
23
32
  flags: PopulatePackageFlags,
24
33
  ): Promise<UpgradeEvent[]>;
25
34
 
26
- declare type PopulatePackageFlags = PopulateHistoricDataFlags & {
35
+ // @public (undocumented)
36
+ type PopulatePackageFlags = PopulateHistoricDataFlags & {
27
37
  since?: string;
28
38
  pkg: string;
29
39
  };
30
40
 
31
- export declare function populateProduct(
32
- flags: PopulateProductFlags,
33
- ): Promise<void>;
41
+ // @public (undocumented)
42
+ export function populateProduct(flags: PopulateProductFlags): Promise<void>;
34
43
 
35
- declare type PopulateProductFlags = PopulateHistoricDataFlags & {
44
+ // @public (undocumented)
45
+ type PopulateProductFlags = PopulateHistoricDataFlags & {
36
46
  csv: boolean;
37
47
  product: string;
38
48
  reset: boolean;
@@ -40,7 +50,8 @@ declare type PopulateProductFlags = PopulateHistoricDataFlags & {
40
50
  tag?: string;
41
51
  };
42
52
 
43
- export declare function sendAnalytics(
53
+ // @public (undocumented)
54
+ export function sendAnalytics(
44
55
  analyticsEvents: UpgradeEvent[],
45
56
  {
46
57
  dev,
@@ -55,7 +66,8 @@ export declare function sendAnalytics(
55
66
  },
56
67
  ): Promise<void>;
57
68
 
58
- export declare type UpgradeEvent = {
69
+ // @public (undocumented)
70
+ export type UpgradeEvent = {
59
71
  dependencyName: string;
60
72
  versionString: string;
61
73
  major: string | null;
@@ -70,9 +82,11 @@ export declare type UpgradeEvent = {
70
82
  commitHash?: string;
71
83
  };
72
84
 
73
- export declare type UpgradeSubType = ReleaseType | null;
85
+ // @public (undocumented)
86
+ export type UpgradeSubType = ReleaseType | null;
74
87
 
75
- export declare type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
88
+ // @public (undocumented)
89
+ export type UpgradeType = 'add' | 'upgrade' | 'remove' | 'downgrade';
76
90
 
77
- export {};
91
+ // (No @packageDocumentation comment for this package)
78
92
  ```
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/types.d.ts"
7
+ "types": "../dist/types/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }