Skip to content

Commit f672d78

Browse files
authored
fix: drop module suffixes (.mts) for compatibility (#9)
1 parent 8d5529c commit f672d78

File tree

14 files changed

+29
-29
lines changed

14 files changed

+29
-29
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ npm install github:herodevs/eol-shared
1414

1515
## API
1616

17-
### [`spdxToCdxBom(spdxBom: SPDX23): CdxBom`](./src/spdx-to-cdx.mts#L61)
17+
### [`spdxToCdxBom(spdxBom: SPDX23): CdxBom`](./src/spdx-to-cdx.ts#L61)
1818

1919
Converts an SPDX BOM to CycloneDX format. This conversion takes the most important package and relationship data from SPDX and translates them into CycloneDX components and dependencies as closely as possible.
2020

@@ -31,7 +31,7 @@ const cdxBom: CdxBom = spdxToCdxBom(spdxBom);
3131
**Parameters**: `spdxBom` - The SPDX BOM object to convert
3232
**Returns**: A CycloneDX BOM object
3333

34-
### [`xmlStringToJSON(xmlString: string): CdxBom`](./src/cdx-xml-to-json.mts#L161)
34+
### [`xmlStringToJSON(xmlString: string): CdxBom`](./src/cdx-xml-to-json.ts#L161)
3535

3636
Converts a CycloneDX XML string to a JSON object. The CycloneDX spec does not change between formats, so conversion from XML to JSON is lossless.
3737

@@ -46,7 +46,7 @@ const jsonBom: CdxBom = xmlStringToJSON(xmlString);
4646
**Parameters**: `xmlString` - The XML string to parse
4747
**Returns**: The parsed CycloneDX BOM object
4848

49-
### [`trimCdxBom(cdxBom: CdxBom): CdxBom`](./src/trim-cdx-bom.mts#L3)
49+
### [`trimCdxBom(cdxBom: CdxBom): CdxBom`](./src/trim-cdx-bom.ts#L3)
5050

5151
Creates a trimmed copy of a CycloneDX BOM by removing SBOM data not necessary for EOL scanning:
5252

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
],
1616
"exports": {
1717
".": {
18-
"import": "./dist/index.mjs",
19-
"require": "./dist/index.mjs",
20-
"types": "./dist/index.d.mts"
18+
"import": "./dist/index.js",
19+
"require": "./dist/index.js",
20+
"types": "./dist/index.d.ts"
2121
}
2222
},
23-
"main": "./dist/index.mjs",
24-
"types": "./dist/index.d.mts",
23+
"main": "./dist/index.js",
24+
"types": "./dist/index.d.ts",
2525
"repository": {
2626
"type": "git",
2727
"url": "git+https://github.com/herodevs/eol-shared.git"

src/bom/validation.mts renamed to src/bom/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { SPDX23 } from '../types/bom/spdx-2.3.schema.ts';
2-
import type { CdxBom, SupportedBom } from '../types/index.mjs';
2+
import type { CdxBom, SupportedBom } from '../types/index.js';
33

44
function parseBomOrString(bomOrString: string | object): SupportedBom | null {
55
if (typeof bomOrString === 'string') {

src/cdx-xml-to-json.test.mts renamed to src/cdx-xml-to-json.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, describe } from 'node:test';
22
import { strict as assert } from 'node:assert';
33
import { readFile } from 'node:fs/promises';
4-
import { xmlStringToJSON } from './cdx-xml-to-json.mts';
4+
import { xmlStringToJSON } from './cdx-xml-to-json.ts';
55

66
describe('CycloneDX XML to JSON Converter', () => {
77
test('should convert CycloneDX 1.4 XML to JSON with correct structure', async () => {

src/cdx-xml-to-json.mts renamed to src/cdx-xml-to-json.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { XMLParser } from 'fast-xml-parser';
2-
import type { CdxBom } from './index.mts';
2+
import type { CdxBom } from './index.ts';
33

44
const COLLECTION_KEYS = [
55
'tools',

src/eol/utils.test.mts renamed to src/eol/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { test, describe } from 'node:test';
22
import { strict as assert } from 'node:assert';
3-
import { deriveComponentStatus } from './utils.mts';
4-
import type { EolScanComponentMetadata } from '../types/eol-scan.mts';
3+
import { deriveComponentStatus } from './utils.ts';
4+
import type { EolScanComponentMetadata } from '../types/eol-scan.ts';
55

66
describe('deriveComponentStatus', () => {
77
test('should return UNKNOWN when there is no metadata', () => {

src/eol/utils.mts renamed to src/eol/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { PackageURL } from 'packageurl-js';
2-
import type { CdxBom } from '../types/index.mjs';
2+
import type { CdxBom } from '../types/index.js';
33
import type {
44
ComponentStatus,
55
EolScanComponentMetadata,
6-
} from '../types/eol-scan.mjs';
6+
} from '../types/eol-scan.js';
77

88
export function deriveComponentStatus(
99
metadata: EolScanComponentMetadata | null,
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export { xmlStringToJSON } from './cdx-xml-to-json.mjs';
2-
export { trimCdxBom } from './trim-cdx-bom.mjs';
3-
export { spdxToCdxBom } from './spdx-to-cdx.mjs';
4-
export { deriveComponentStatus, extractPurlsFromCdxBom } from './eol/utils.mjs';
1+
export { xmlStringToJSON } from './cdx-xml-to-json.js';
2+
export { trimCdxBom } from './trim-cdx-bom.js';
3+
export { spdxToCdxBom } from './spdx-to-cdx.js';
4+
export { deriveComponentStatus, extractPurlsFromCdxBom } from './eol/utils.js';
55

66
export type {
77
ComponentStatus,
@@ -14,7 +14,7 @@ export type {
1414
EolReportQueryResponse,
1515
EolReportMutationResponse,
1616
NesRemediation,
17-
} from './types/eol-scan.mjs';
17+
} from './types/eol-scan.js';
1818

1919
export type {
2020
CdxBom,
@@ -25,7 +25,7 @@ export type {
2525
License,
2626
SPDX23,
2727
SupportedBom,
28-
} from './types/index.mjs';
28+
} from './types/index.js';
2929

30-
export { ComponentScope } from './types/index.mjs';
31-
export { isCdxBom, isSpdxBom, isSupportedBom } from './bom/validation.mjs';
30+
export { ComponentScope } from './types/index.js';
31+
export { isCdxBom, isSpdxBom, isSupportedBom } from './bom/validation.js';

src/spdx-to-cdx.test.mts renamed to src/spdx-to-cdx.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { test, describe } from 'node:test';
22
import { strict as assert } from 'node:assert';
3-
import { spdxToCdxBom } from './spdx-to-cdx.mts';
3+
import { spdxToCdxBom } from './spdx-to-cdx.ts';
44
import type { SPDX23 } from './types/bom/spdx-2.3.schema.js';
5-
import type { Component, Dependency } from './types/index.mts';
5+
import type { Component, Dependency } from './types/index.ts';
66

77
function buildSpdxAndConvert(spdx: Partial<SPDX23>) {
88
const baseSpdx: SPDX23 = {
File renamed without changes.

0 commit comments

Comments
 (0)