Skip to content

Conversation

@jkowalleck
Copy link
Member

@jkowalleck jkowalleck commented Dec 4, 2025

Fixed

  • Type declarations for deprecated symbols support usage as types

Refactor

  • Deprecated symbols turned from re-exports into re-declares
    Note: this change adds runtime overhead for the sake of documentation.

docs preview: https://cyclonedx-javascript-library--1351.org.readthedocs.build/en/1351/

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck requested a review from a team as a code owner December 4, 2025 11:54
@jkowalleck jkowalleck added the bug Something isn't working label Dec 4, 2025
@codacy-production
Copy link

codacy-production bot commented Dec 4, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.03% (target: -1.00%) 100.00% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ded3f6b) 27486 27060 98.45%
Head commit (aa82910) 28008 (+522) 27582 (+522) 98.48% (+0.03%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1351) 276 276 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck marked this pull request as draft December 4, 2025 12:14
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck marked this pull request as ready for review December 4, 2025 12:50
@jkowalleck jkowalleck requested a review from Copilot December 4, 2025 12:50
Copilot finished reviewing on behalf of jkowalleck December 4, 2025 12:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes type declarations for deprecated symbols by changing the deprecation strategy from simple re-exports to class extensions and type aliases, allowing deprecated types to be used as types again (fixing issue #1350).

Key changes include:

  • Refactored deprecated exports in factories and builders from direct re-exports to class extensions
  • Created new wrapper files for deprecated symbols (bomUtility.ts, licenseUtility.node.ts, npmjsUtility.node.ts, etc.)
  • Updated deprecation documentation to be more concise and consistent
  • Added comprehensive test examples demonstrating deprecated APIs still work

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 38 comments.

Show a summary per file
File Description
src/utils/npmjsUtility.node.ts New wrapper file that re-exports parsePackageIntegrity and defaultRegistryMatcher as deprecated aliases
src/utils/licenseUtility.node.ts New wrapper file that re-exports license utility types and classes as deprecated aliases
src/utils/bomUtility.ts New wrapper file that re-exports randomSerialNumber as a deprecated alias
src/utils/index.node.ts Changed from direct re-exports to namespace re-exports using new wrapper files
src/utils/index.common.ts Changed from direct re-exports to namespace re-exports using new wrapper file
src/factories/packageUrl.ts New wrapper file with class extension for deprecated PackageUrlFactory
src/factories/license.ts New wrapper file with class extension for deprecated LicenseFactory
src/factories/fromNodePackageJson.node.ts New wrapper file with class extensions for deprecated factories
src/factories/index.node.ts Changed from direct re-exports to namespace re-exports using new wrapper file
src/factories/index.common.ts Changed from direct re-exports to namespace re-exports using new wrapper files
src/builders/index.node.ts Changed from direct re-exports to namespace re-exports using new wrapper file
src/builders/fromNodePackageJson.node.ts New wrapper file with class extensions for deprecated builders
src/types/index.ts Updated deprecation documentation to be more concise
package.json Added explicit "node" keys to exports configuration for better Node.js resolution
examples//deprecated. New example files demonstrating usage of all deprecated APIs
examples/*/tsconfig.json Added deprecated example files to compilation
examples/*/package.json Updated scripts to run both regular and deprecated examples
examples/node/javascript/.gitignore Added deprecated example files to git tracking
HISTORY.md Documented the fix and refactoring changes
.github/workflows/nodejs.yml Added workflow step to run deprecated API examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Copilot finished reviewing on behalf of jkowalleck December 4, 2025 18:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Dec 4, 2025

@jkowalleck I've opened a new pull request, #1352, to work on those changes. Once the pull request is ready, I'll request review from you.

@jkowalleck jkowalleck requested a review from Copilot December 4, 2025 18:15
Copilot finished reviewing on behalf of jkowalleck December 4, 2025 18:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck merged commit d124458 into main Dec 4, 2025
40 checks passed
@jkowalleck jkowalleck deleted the fix/6.4.0_deprecated_types branch December 4, 2025 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: exported type declaration incompatible since 9.4.0

2 participants