Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to this project will be documented in this file.

<!-- add unreleased items here -->

* Added
* Publish sub-namespace types `OptionalFeature` (via [#1535])

[#1535]: https://github.com/CycloneDX/cyclonedx-javascript-library/pull/1535

## 10.4.0 -- 2026-11-03

* Added
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
"default": "./dist.node/index.node.js"
},
"./package.json": "./package.json",
"./OptionalFeature": {
"types": "./dist.d/optionalFeature.d.ts"
},
"./Enums": {
"types": "./dist.d/enums/index.d.ts",
"default": "./dist.node/enums/index.js"
Expand Down
2 changes: 1 addition & 1 deletion src/_optPlug.node/cannot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type { Cannot } from '../_opt'
import type { Cannot } from '../optionalFeature'
import { isWillThrow } from './_wrapper'

/**
Expand Down
3 changes: 3 additions & 0 deletions src/index.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type * as OptionalFeature from './optionalFeature'

export * as Enums from './enums'
export * as Models from './models'
export * as SPDX from './spdx'
export * as Spec from './spec'
export * as Types from './types'
export type { OptionalFeature }

// do not export the _helpers, they are for internal use only
2 changes: 1 addition & 1 deletion src/_opt.ts → src/optionalFeature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
/**
* Describes why an optional feature cannot act.
*/
interface Blocker {
export interface Blocker {
readonly message: string
}

Expand Down
2 changes: 1 addition & 1 deletion src/serialize/jsonSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type * as OptionalFeature from '../_opt'
import type { Bom } from '../models/bom'
import type * as OptionalFeature from '../optionalFeature'
import { Format } from '../spec/enums'
import { UnsupportedFormatError } from '../spec/errors'
import { BaseSerializer } from './baseSerializer'
Expand Down
2 changes: 1 addition & 1 deletion src/serialize/xmlSerializer.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type * as OptionalFeature from '../_opt'
import cannotOf from '../_optPlug.node/cannot'
import stringify from '../_optPlug.node/xmlStringify'
import type * as OptionalFeature from '../optionalFeature'
import { MissingOptionalDependencyError } from './errors'
import type { SerializerOptions } from './types'
import type { SimpleXml } from './xml/types'
Expand Down
2 changes: 1 addition & 1 deletion src/serialize/xmlSerializer.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import { isNotUndefined } from '../_helpers/notUndefined'
import type * as OptionalFeature from '../_opt'
import type * as OptionalFeature from '../optionalFeature'
import type { SerializerOptions } from './types'
import type { SimpleXml } from './xml/types'
import { XmlBaseSerializer } from './xmlBaseSerializer'
Expand Down
2 changes: 1 addition & 1 deletion src/validation/jsonValidator.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type * as OptionalFeature from '../_opt'
import cannotOf from '../_optPlug.node/cannot'
import makeValidator, { type Validator } from '../_optPlug.node/jsonValidator'
import type * as OptionalFeature from '../optionalFeature'
import { FILES } from '../resources.node'
import { BaseValidator } from './baseValidator'
import { MissingOptionalDependencyError, NotImplementedError } from './errors'
Expand Down
2 changes: 1 addition & 1 deletion src/validation/xmlValidator.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

import type * as OptionalFeature from '../_opt'
import cannotOf from '../_optPlug.node/cannot'
import makeValidator, { type Validator } from '../_optPlug.node/xmlValidator'
import type * as OptionalFeature from '../optionalFeature'
import { FILES } from '../resources.node'
import { BaseValidator } from './baseValidator'
import { MissingOptionalDependencyError, NotImplementedError } from './errors'
Expand Down
9 changes: 8 additions & 1 deletion tests/functional/packageManifestExports.node.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ suite('functional: packageManifest:exports', () => {
/** @type {Set<string>} */
const pjRelExported = new Set(
Object.keys(pjExports)
.filter(e => {
const ed = pjExports[e]
const edT = typeof ed
if (edT === 'string') return true
if (edT !== 'object') throw new RangeError(`unexpected export definition type for ${e}`)
return Object.hasOwn(ed, 'node') || Object.hasOwn(ed, 'default')
})
.filter(e => e.startsWith('./'))
.map(e => e.substring(2))
)
Expand Down Expand Up @@ -61,7 +68,7 @@ suite('functional: packageManifest:exports', () => {
}
})

suite('does not export internal sobmodules', () => {
suite('does not export internal submodules', () => {
for (const [cdxModName, cdxMod] of Object.entries(CDX)) {
if (!cdxModName.startsWith('_')) {
continue // skip non-internal
Expand Down
Loading