@code-pushup/js-packages-plugin 0.35.0 → 0.42.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.
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@code-pushup/js-packages-plugin",
3
- "version": "0.35.0",
3
+ "version": "0.42.0",
4
4
  "dependencies": {
5
- "@code-pushup/models": "0.35.0",
6
- "@code-pushup/utils": "0.35.0",
5
+ "@code-pushup/models": "0.42.0",
6
+ "@code-pushup/utils": "0.42.0",
7
+ "semver": "^7.6.0",
7
8
  "zod": "^3.22.4"
8
9
  },
9
10
  "license": "MIT",
@@ -13,7 +14,7 @@
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
16
- "url": "https://github.com/code-pushup/cli.git",
17
+ "url": "git+https://github.com/code-pushup/cli.git",
17
18
  "directory": "packages/plugin-js-packages"
18
19
  },
19
20
  "contributors": [
@@ -0,0 +1,4 @@
1
+ import { OutdatedDependency } from '../../runner/outdated/types';
2
+ import { Yarnv1FieldName } from './types';
3
+ export declare const outdatedtoFieldMapper: Record<keyof OutdatedDependency, Yarnv1FieldName>;
4
+ export declare const REQUIRED_OUTDATED_FIELDS: Yarnv1FieldName[];
@@ -1,2 +1,4 @@
1
- import { OutdatedResult } from '../../runner/outdated/types';
1
+ import { OutdatedDependency, OutdatedResult } from '../../runner/outdated/types';
2
2
  export declare function yarnv1ToOutdatedResult(output: string): OutdatedResult;
3
+ export declare function validateOutdatedFields(head: string[]): boolean;
4
+ export declare function getOutdatedFieldIndexes(all: string[]): Record<keyof OutdatedDependency, number>;
@@ -1,5 +1,4 @@
1
1
  import { PackageAuditLevel } from '../../config';
2
- import { DependencyGroupLong } from '../../runner/outdated/types';
3
2
  export type Yarnv1AuditAdvisory = {
4
3
  type: 'auditAdvisory';
5
4
  data: {
@@ -27,22 +26,16 @@ export type Yarnv1AuditResultJson = [
27
26
  ...Yarnv1AuditAdvisory[],
28
27
  Yarnv1AuditSummary
29
28
  ];
30
- export type Yarnv1VersionOverview = [
31
- string,
32
- string,
33
- string,
34
- string,
35
- string,
36
- DependencyGroupLong,
37
- string
38
- ];
29
+ export declare const yarnv1FieldNames: readonly ["Package", "Current", "Latest", "Package Type", "URL"];
30
+ export type Yarnv1FieldName = (typeof yarnv1FieldNames)[number];
39
31
  type Yarnv1Info = {
40
32
  type: 'info';
41
33
  };
42
34
  type Yarnv1Table = {
43
35
  type: 'table';
44
36
  data: {
45
- body: Yarnv1VersionOverview[];
37
+ head: string[];
38
+ body: string[][];
46
39
  };
47
40
  };
48
41
  export type Yarnv1OutdatedResultJson = [Yarnv1Info, Yarnv1Table];
@@ -1,3 +1,4 @@
1
+ import type { ReleaseType } from 'semver';
1
2
  import type { IssueSeverity } from '@code-pushup/models';
2
- import { VersionType } from './types';
3
- export declare const outdatedSeverity: Record<VersionType, IssueSeverity>;
3
+ export declare const outdatedSeverity: Record<ReleaseType, IssueSeverity>;
4
+ export declare const RELEASE_TYPES: ReleaseType[];
@@ -1,6 +1,7 @@
1
- import { Issue } from '@code-pushup/models';
1
+ import { ReleaseType } from 'semver';
2
+ import type { Issue } from '@code-pushup/models';
2
3
  import { DependencyGroup, PackageManagerId } from '../../config';
3
- import { OutdatedResult, PackageVersion, VersionType } from './types';
4
+ import { OutdatedResult } from './types';
4
5
  export declare function outdatedResultToAuditOutput(result: OutdatedResult, packageManager: PackageManagerId, depGroup: DependencyGroup): {
5
6
  details?: {
6
7
  issues: {
@@ -23,7 +24,5 @@ export declare function outdatedResultToAuditOutput(result: OutdatedResult, pack
23
24
  displayValue: string;
24
25
  };
25
26
  export declare function calculateOutdatedScore(majorOutdated: number, totalDeps: number): number;
26
- export declare function outdatedToDisplayValue(stats: Record<VersionType, number>): string;
27
+ export declare function outdatedToDisplayValue(stats: Record<ReleaseType, number>): string;
27
28
  export declare function outdatedToIssues(dependencies: OutdatedResult): Issue[];
28
- export declare function getOutdatedLevel(currentFullVersion: string, latestFullVersion: string): VersionType;
29
- export declare function splitPackageVersion(fullVersion: string): PackageVersion;
@@ -1,11 +1,11 @@
1
- export declare const versionType: readonly ["major", "minor", "patch"];
2
- export type VersionType = (typeof versionType)[number];
3
- export type PackageVersion = Record<VersionType, number>;
1
+ import type { ReleaseType } from 'semver';
2
+ export type PackageVersion = Record<ReleaseType, number>;
4
3
  export type DependencyGroupLong = 'dependencies' | 'devDependencies' | 'optionalDependencies';
5
- export type OutdatedResult = {
4
+ export type OutdatedDependency = {
6
5
  name: string;
7
6
  current: string;
8
7
  latest: string;
9
8
  type: DependencyGroupLong;
10
9
  url?: string;
11
- }[];
10
+ };
11
+ export type OutdatedResult = OutdatedDependency[];