Skip to content

support package "exports" #87

@jkowalleck

Description

@jkowalleck

currently only the main context is directly exported.
This means, that a Model for example needs to be required like

const { Models: { Component } }  = require('@cyclonedx/cyclonedx-library');

of as

const Component  = require('@cyclonedx/cyclonedx-library').Models.Component;

-> this requires a wider import than needed.

Feature request:

allow imports ala

const { Component }  = require('@cyclonedx/cyclonedx-library/models');

implementation:

utilize package.json's "exports" key. attention! have typing, web and node confugured properly for each sub path export.

additionally:

have a functional test that reads this data and tests that the mentioned files actually exist.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions