Skip to content

Conversation

@jkowalleck
Copy link
Member

@jkowalleck jkowalleck commented Nov 26, 2025

Added

Changed

  • Moved non‑standard implementations to Contrib area

Deprecated

  • Certain exports have been deprecated; downstream imports should be updated to the new locations
    Note: the symbols themselves remain supported. See documentation and the "Refactored" section below for details.

Refactored

  • The following symbols were moved.
    The symbols are still import-able through their old location.
    • OLD -> NEW
    • Builders.FromNodePackageJson -> Contrib.FromNodePackageJson.Builders
    • Factories.FromNodePackageJson -> Contrib.FromNodePackageJson.Factories
    • Factories.LicenseFactory -> Contrib.License.Factories.LicenseFactory
    • Factories.PackageUrlFactory -> Contrib.PackageUrl.Factories.PackageUrlFactory
    • Types.assertNodePackageJson -> Contrib.FromNodePackageJson.Types.assertNodePackageJson
    • Types.isNodePackageJson -> Contrib.FromNodePackageJson.Types.isNodePackageJson
    • Types.NodePackageJson -> Contrib.FromNodePackageJson.Types.NodePackageJson
    • Utils.LicenseUtility -> Contrib.License.Utils
    • Utils.NpmjsUtility -> Contrib.FromNodePackageJson.Utils

⚠️ tests for contribs were not moved yet, to show that all functionality still works.
the tests will be moved in a later step


  • wrote docs
  • moved functionality
  • mark old imports ad deprecated
  • write changelog

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck requested a review from a team as a code owner November 26, 2025 09:46
@jkowalleck jkowalleck added the enhancement New feature or request label Nov 26, 2025
@jkowalleck jkowalleck marked this pull request as draft November 26, 2025 10:33
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 added refactor and removed enhancement New feature or request labels Nov 26, 2025
@codacy-production
Copy link

codacy-production bot commented Nov 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-0.15% (target: -1.00%) 100.00% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (f2e3072) 26565 26192 98.60%
Head commit (9120af8) 27375 (+810) 26949 (+757) 98.44% (-0.15%)

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 (#1343) 315 315 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>
@jkowalleck jkowalleck marked this pull request as ready for review November 27, 2025 11:02
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck added the enhancement New feature or request label Nov 27, 2025
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck requested a review from Copilot November 28, 2025 13:36
Copilot finished reviewing on behalf of jkowalleck November 28, 2025 13:38
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 reorganizes non-standard implementations into a new /Contrib area to better separate community-contributed features from core CycloneDX functionality. The refactoring maintains backward compatibility by creating deprecated re-exports at the old locations while establishing new canonical import paths.

Key Changes:

  • Introduces a new /Contrib namespace with submodules for FromNodePackageJson, License, and PackageUrl
  • Moves existing implementations (factories, builders, utilities, types) from core areas to their respective contrib modules
  • Adds package.json exports for all new contrib entry points
  • Provides comprehensive deprecation notices for old import paths while keeping symbols functional

Reviewed changes

Copilot reviewed 28 out of 32 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
package.json Adds new export entries for /Contrib and its submodules (FromNodePackageJson, License, PackageUrl)
HISTORY.md Documents the refactoring with detailed migration paths for affected symbols
src/index.node.ts, src/index.web.ts, src/index.common.ts Exports new Contrib namespace at the root level
src/contrib/index.node.ts, src/contrib/index.web.ts, src/contrib/index.common.ts New entry points for contrib modules with platform-specific exports
src/contrib/README.md Documentation explaining the contrib area's purpose and guidelines
src/contrib/fromNodePackageJson/* Relocated Node package.json utilities, builders, factories, and types from root modules
src/contrib/license/* Relocated license-related factories and utilities to contrib area
src/contrib/packageUrl/* Relocated PackageURL factory to contrib area
src/types/index.ts Adds deprecated re-exports for NodePackageJson types with migration notices
src/factories/index.common.ts, src/factories/index.node.ts Adds deprecated re-exports for LicenseFactory, PackageUrlFactory, and FromNodePackageJson factories
src/builders/index.node.ts Adds deprecated re-export for FromNodePackageJson builders
src/utils/index.node.ts Adds deprecated re-exports for LicenseUtility and NpmjsUtility
tests/contrib/license/unit/internals/helpers.mime.node.spec.js Updates test import path to reflect new location of mime helper
Comments suppressed due to low confidence (2)

src/contrib/fromNodePackageJson/factories.ts:34

  • Inconsistent quote style in import statement. Use single quotes to match the style of other imports in this file (lines 32-33, 35-41).
    src/contrib/fromNodePackageJson/factories.ts:39
  • Inconsistent quote style in import statement. Use single quotes to match the style of other imports in this file (lines 32-33, 35-38, 40-41).

💡 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>
@jkowalleck jkowalleck changed the title feat: prepare "contrib" area feat: move non-standard implementations to "contrib" area Nov 28, 2025
@jkowalleck jkowalleck changed the title feat: move non-standard implementations to "contrib" area feat: Moved non‑standard implementations to Contrib area Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: move every implementation that does not implement the standard to sub-namespace "contrib"

2 participants