@pnpm/deps.compliance.sbom 1000.0.0-0 → 1100.0.1

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 (2) hide show
  1. package/lib/license.js +10 -5
  2. package/package.json +17 -17
package/lib/license.js CHANGED
@@ -1,18 +1,23 @@
1
1
  // Sub-path import to pull only the SPDX module — avoids dragging in the
2
2
  // validation/serialize layers with optional native deps that break esbuild bundling.
3
- import { isSupportedSpdxId, isValidSpdxLicenseExpression } from '@cyclonedx/cyclonedx-library/SPDX';
3
+ import { fixupSpdxId, isSupportedSpdxId } from '@cyclonedx/cyclonedx-library/SPDX';
4
4
  // Classifies a license string into the appropriate CycloneDX representation.
5
5
  // Uses the CycloneDX library's own SPDX list rather than spdx-license-ids,
6
6
  // since CycloneDX maintains its own subset of recognized IDs.
7
7
  // Order matters: check ID first because "MIT" matches both isSupportedSpdxId
8
- // and isValidSpdxLicenseExpression, but we prefer the more specific license.id form.
8
+ // and isSpdxExpression, but we prefer the more specific license.id form.
9
9
  export function classifyLicense(license) {
10
- if (isSupportedSpdxId(license)) {
11
- return { license: { id: license } };
10
+ const fixedId = fixupSpdxId(license);
11
+ if (fixedId != null && isSupportedSpdxId(fixedId)) {
12
+ return { license: { id: fixedId } };
12
13
  }
13
- if (isValidSpdxLicenseExpression(license)) {
14
+ if (isSpdxExpression(license)) {
14
15
  return { expression: license };
15
16
  }
16
17
  return { license: { name: license } };
17
18
  }
19
+ // Checks if a string looks like an SPDX license expression (compound with operators).
20
+ function isSpdxExpression(license) {
21
+ return /\b(?:AND|OR|WITH)\b/.test(license);
22
+ }
18
23
  //# sourceMappingURL=license.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/deps.compliance.sbom",
3
- "version": "1000.0.0-0",
3
+ "version": "1100.0.1",
4
4
  "description": "Generate SBOM from pnpm lockfile",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -27,26 +27,26 @@
27
27
  "!*.map"
28
28
  ],
29
29
  "dependencies": {
30
- "@cyclonedx/cyclonedx-library": "9.4.1",
30
+ "@cyclonedx/cyclonedx-library": "10.0.0",
31
31
  "p-limit": "^7.1.0",
32
- "ssri": "13.0.0",
33
- "@pnpm/lockfile.detect-dep-types": "1001.0.16",
34
- "@pnpm/lockfile.utils": "1003.0.3",
35
- "@pnpm/lockfile.types": "1002.0.2",
36
- "@pnpm/pkg-manifest.reader": "1000.1.2",
37
- "@pnpm/types": "1000.9.0",
38
- "@pnpm/lockfile.walker": "1001.0.16",
39
- "@pnpm/store.index": "1000.0.0-0",
40
- "@pnpm/store.pkg-finder": "1000.0.0-0"
32
+ "ssri": "13.0.1",
33
+ "@pnpm/lockfile.types": "1100.0.1",
34
+ "@pnpm/lockfile.utils": "1100.0.1",
35
+ "@pnpm/lockfile.detect-dep-types": "1100.0.1",
36
+ "@pnpm/pkg-manifest.reader": "1100.0.1",
37
+ "@pnpm/store.index": "1100.0.0",
38
+ "@pnpm/lockfile.walker": "1100.0.1",
39
+ "@pnpm/store.pkg-finder": "1100.0.1",
40
+ "@pnpm/types": "1101.0.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@pnpm/logger": ">=1001.0.0 <1002.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@jest/globals": "30.0.5",
46
+ "@jest/globals": "30.3.0",
47
47
  "@types/ssri": "^7.1.5",
48
- "@pnpm/deps.compliance.sbom": "1000.0.0-0",
49
- "@pnpm/logger": "1001.0.1"
48
+ "@pnpm/deps.compliance.sbom": "1100.0.1",
49
+ "@pnpm/logger": "1100.0.0"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=22.13"
@@ -55,9 +55,9 @@
55
55
  "preset": "@pnpm/jest-config"
56
56
  },
57
57
  "scripts": {
58
- "test": "pnpm run compile && pnpm run _test",
58
+ "test": "pn compile && pn .test",
59
59
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
60
- "_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest",
61
- "compile": "tsgo --build && pnpm run lint --fix"
60
+ "compile": "tsgo --build && pn lint --fix",
61
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
62
62
  }
63
63
  }