Skip to content

feat: Moved non‑standard implementations to Contrib area#1343

Merged
jkowalleck merged 22 commits intomainfrom
feat/prep-contrib
Dec 2, 2025
Merged

feat: Moved non‑standard implementations to Contrib area#1343
jkowalleck merged 22 commits intomainfrom
feat/prep-contrib

Conversation

@jkowalleck
Copy link
Member

@jkowalleck jkowalleck commented Nov 26, 2025

Added

  • New entry point for /Contrib and known submodules
    See package.json::exports for details.

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.05% (target: -1.00%) 100.00% (target: 90.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8c36d6c) 26565 26139 98.40%
Head commit (81bed86) 27486 (+921) 27060 (+921) 98.45% (+0.05%)

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) 353 353 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>
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
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>
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 36 out of 41 changed files in this pull request and generated 8 comments.


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

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
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 37 out of 42 changed files in this pull request and generated 2 comments.


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

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
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 37 out of 42 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

tests/contrib/license/unit/internals/helpers.mime.node.spec.js:26

  • The require path is missing the .js file extension. It should be:
} = require('../../../../../dist.node/contrib/license/_helpers/mime.node.js')

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

@jkowalleck jkowalleck merged commit ea8f1f3 into main Dec 2, 2025
40 checks passed
@jkowalleck jkowalleck deleted the feat/prep-contrib branch December 2, 2025 12:08
jkowalleck added a commit that referenced this pull request Feb 19, 2026
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅

You can expedite processing of your PR by using this template to provide
context
and additional information. Before actually opening a PR please make
sure that it
does NOT fall into any of the following categories

🚫 Spam PRs (accidental or intentional) - these will result in a 30-days
or even
∞ ban from interacting with the project depending on reoccurrence and
severity.

🚫 Lazy typo fixing PRs - if you fix a typo in a file, your PR will only
be merged
if all other typos in the same file are also fixed with the same PR

🚫 If you fail to provide any _Description_ below, your PR will be
considered spam.
If you do not check the _Affirmation_ box below, your PR will not be
merged.

🚫 If you do not check one of the _AI Tool Disclosure_ boxes below, your
PR will
not be merged. If you used AI tools to assist you in writing code, but
fail to
provide the required disclosure, your PR will not be merged.

🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅-->

### Description

<!-- ✍️-->
in #1343
some contrib implementations were moved, and the old exports were kept.
they are marked deprecated -- and now the were removed



* Removed
  * Entrypoint `Builders` (via [#1377])
  * Entrypoint `Factories` (via [#1377])
  * Entrypoint `Utils` (via [#1377])
  * Deprecated symbol `Builders` ([#1346] via [#1377])
* Deprecated symbol `Builders.FromNodePackageJson` ([#1346] via [#1377])
* Deprecated symbol `Builders.FromNodePackageJson.ToolBuilder` ([#1346]
via [#1377])
    Use `Contrib.FromNodePackageJson.Builders.ToolBuilder` instead.
* Deprecated symbol `Builders.FromNodePackageJson.ComponentBuilder`
([#1346] via [#1377])
    Use `Contrib.FromNodePackageJson.Builders.ComponentBuilder` instead.
  * Deprecated symbol `Factories` ([#1346] via [#1377])
* Deprecated symbol `Factories.FromNodePackageJson` ([#1346] via
[#1377])
* Deprecated symbol
`Factories.FromNodePackageJson.ExternalReferenceFactory` ([#1346] via
[#1377])
Use `Contrib.FromNodePackageJson.Factories.ExternalReferenceFactory`
instead.
* Deprecated symbol `Factories.FromNodePackageJson.PackageUrlFactory`
([#1346] via [#1377])
Use `Contrib.FromNodePackageJson.Factories.PackageUrlFactory` instead.
  * Deprecated symbol `Factories.LicenseFactory` ([#1346] via [#1377])  
    Use `Contrib.License.Factories.LicenseFactory` instead.
* Deprecated symbol `Factories.PackageUrlFactory` ([#1346] via [#1377])
    Use `Contrib.PackageUrl.Factories.PackageUrlFactory` instead.
  * Deprecated symbol `Types.NodePackageJson` ([#1346] via [#1377])  
    Use `Contrib.FromNodePackageJson.Types.NodePackageJson` instead.
* Deprecated symbol `Types.assertNodePackageJson` ([#1346] via [#1377])
Use `Contrib.FromNodePackageJson.Types.assertNodePackageJson` instead.
  * Deprecated symbol `Types.isNodePackageJson` ([#1346] via [#1377])  
    Use `Contrib.FromNodePackageJson.Types.isNodePackageJson` instead.
  * Deprecated symbol `Utils` ([#1346] via [#1377])
  * Deprecated symbol `Utils.BomUtility` ([#1346] via [#1377])
* Deprecated symbol `Utils.BomUtility.randomSerialNumber` ([#1346] via
[#1377])
    Use `Contrib.Bom.Utils.randomSerialNumber` instead.
  * Deprecated symbol `Utils.LicenseUtility` ([#1346] via [#1377])
* Deprecated symbol `Utils.LicenseUtility.FsUtils` ([#1346] via [#1377])
    Use `Contrib.License.Utils.FsUtils` instead.
* Deprecated symbol `Utils.LicenseUtility.PathUtils` ([#1346] via
[#1377])
  * Use `Contrib.License.Utils.PathUtils` instead.
* Deprecated symbol `Utils.LicenseUtility.FileAttachment` ([#1346] via
[#1377])
    Use `Contrib.License.Utils.FileAttachment` instead.
* Deprecated symbol `Utils.LicenseUtility.ErrorReporter` ([#1346] via
[#1377])
    Use `Contrib.License.Utils.ErrorReporter` instead.
* Deprecated symbol `Utils.LicenseUtility.LicenseEvidenceGatherer`
([#1346] via [#1377])
    Use `Contrib.License.Utils.LicenseEvidenceGatherer` instead.
  * Deprecated symbol `Utils.NpmjsUtility` ([#1346] via [#1377])
* Deprecated symbol `Utils.NpmjsUtility.parsePackageIntegrity` ([#1346]
via [#1377])
Use `Contrib.FromNodePackageJson.Utils.parsePackageIntegrity` instead.
* Deprecated symbol `Utils.NpmjsUtility.defaultRegistryMatcher` ([#1346]
via [#1377])
Use `Contrib.FromNodePackageJson.Utils.defaultRegistryMatcher` instead.

fixes: #1346

### AI Tool Disclosure

- [x] My contribution does not include any AI-generated content
- [ ] My contribution includes AI-generated content, as disclosed below:
  - AI Tools: `[e.g. GitHub CoPilot, ChatGPT, JetBrains Junie etc.]`
- LLMs and versions: `[e.g. GPT-4.1, Claude Haiku 4.5, Gemini 2.5 Pro
etc.]`
- Prompts: `[Summarize the key prompts or instructions given to the AI
tools]`

### Affirmation

- [x] My code follows the
[CONTRIBUTING.md](https://github.com/CycloneDX/cyclonedx-javascript-library/blob/main/CONTRIBUTING.md)
guidelines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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