feat: Moved non‑standard implementations to Contrib area#1343
feat: Moved non‑standard implementations to Contrib area#1343jkowalleck merged 22 commits intomainfrom
Conversation
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>
2b9e1f3 to
9754509
Compare
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: 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>
There was a problem hiding this comment.
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
/Contribnamespace with submodules forFromNodePackageJson,License, andPackageUrl - 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>
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>
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.jsfile 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.
<!--🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅🔅 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
Added
/Contriband known submodulesSee
package.json::exportsfor details.Changed
Deprecated
Note: the symbols themselves remain supported. See documentation and the "Refactored" section below for details.
Refactored
The symbols are still import-able through their old location.
Builders.FromNodePackageJson->Contrib.FromNodePackageJson.BuildersFactories.FromNodePackageJson->Contrib.FromNodePackageJson.FactoriesFactories.LicenseFactory->Contrib.License.Factories.LicenseFactoryFactories.PackageUrlFactory->Contrib.PackageUrl.Factories.PackageUrlFactoryTypes.assertNodePackageJson->Contrib.FromNodePackageJson.Types.assertNodePackageJsonTypes.isNodePackageJson->Contrib.FromNodePackageJson.Types.isNodePackageJsonTypes.NodePackageJson->Contrib.FromNodePackageJson.Types.NodePackageJsonUtils.LicenseUtility->Contrib.License.UtilsUtils.NpmjsUtility->Contrib.FromNodePackageJson.Utilsthe tests will be moved in a later step