Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null entries in dependsOn #31

Closed
aidansteele opened this issue Dec 15, 2021 · 1 comment · Fixed by #68 or #70
Closed

null entries in dependsOn #31

aidansteele opened this issue Dec 15, 2021 · 1 comment · Fixed by #68 or #70
Labels
help wanted Extra attention is needed

Comments

@aidansteele
Copy link

Hi,

This behaviour is using @cyclonedx/webpack-plugin v1.0.1. Unfortunately I'm having a fair bit of difficulty reproducing it in a minimal example (I'm seeing different behaviour in our closed source app) but I thought it might still be worth reporting.

For the closed source app, I am seeing the following entry in the generated bom.json:

{
    "ref": "pkg:npm/%40reach/[email protected]",
    "dependsOn": [
        "pkg:npm/%40reach/[email protected]",
        null
    ]
}

In my attempt at a minimal repro, I don't get a null in the dependsOn array, but I do get an empty object in the dependencies array:

    {
      "ref": "pkg:npm/%40reach/[email protected]",
      "dependsOn": [
        "pkg:npm/[email protected]",
        "pkg:npm/[email protected]",
        "pkg:npm/[email protected]",
        "pkg:npm/%40reach/[email protected]"
      ]
    },
    {
      "ref": "pkg:npm/[email protected]",
      "dependsOn": [
        "pkg:npm/[email protected]"
      ]
    },
    {
      "ref": "pkg:npm/[email protected]"
    },
    {
      "ref": "pkg:npm/[email protected]",
      "dependsOn": [
        "pkg:npm/[email protected]"
      ]
    },
    {
      "ref": "pkg:npm/%40reach/[email protected]"
    },
    {},

I will continue to try to pare down the closed source webpack config (it's big) and see if I can reproduce the nulls in a sample for you. Or let me know if there are specific things I can do to help debug this.

@aidansteele
Copy link
Author

const {package: dependencyPackage, path: dependencyPath} = dependencyPkg;

(If it helps) I sprinkled logs throughout this plugin and found that in the above line, dependencyPath is /<trim>/node_modules/@reach/utils/compose-refs/package.json and dependencyPackage is:

{
    "main": "dist/reach-utils-compose-refs.cjs.js",
    "module": "dist/reach-utils-compose-refs.esm.js",
    "name": "",
    "version": "",
    "readme": "ERROR: No README data found!",
    "_id": "@"
}

I think this is because the @reach/utils package has a file at /compose-refs/package.json in addition to /package.json. And this nested package.json is very bare:

{
  "main": "dist/reach-utils-compose-refs.cjs.js",
  "module": "dist/reach-utils-compose-refs.esm.js"
}

@jkowalleck jkowalleck added the help wanted Extra attention is needed label Apr 20, 2022
@jkowalleck jkowalleck reopened this Jun 11, 2022
@jkowalleck jkowalleck mentioned this issue Jun 19, 2022
Merged
3 tasks
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires node `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires `webpack` version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4 '`.
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#70]:  #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires node `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires `webpack` version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]:  #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires node `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires `webpack` version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]:  #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires _Node.js_ `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires _webpack_ version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
    You may use _webpack_'s `--stats` switch instead.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]:  #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires _Node.js_ `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires _webpack_ version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
    You may use _webpack_'s `--stats` switch instead.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]: #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires _Node.js_ `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires _webpack_ version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
    You may use _webpack_'s `--stats` switch instead.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]: #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires _Node.js_ `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires _webpack_ version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
    You may use _webpack_'s `--stats` switch instead.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]: #70

Signed-off-by: Jan Kowalleck <[email protected]>
jkowalleck added a commit that referenced this issue Jun 20, 2022
This is a reboot, written in _TypeScript_ and compiled to _JavaScript_.

* BREAKING changes
  * Requires _Node.js_ `>= 14.0.0` now, was `>= 12.0.0`.
  * Requires _webpack_ version `^5` as a `peerDependency`, was `>=4 <6`.
* Changed:
  * The optional configuration options changed in name and meaning. Consult the `README` for details.
* Added
  * Added an optional switch to select the desired CycloneDX spec version for the output.
    The value currently defaults to `'1.4'`. (fixes [#53] via [#70])
  * Full support for typing. This will make the configuration of this plugin easier.
  * Lots of small features got added due to the fact that the data processing is managed by  `@cyclonedx/cyclonedx-library` now.
* Fixed
  * Dependency graph no longer has `null` or `undefined` values. (fixes [#31] via [#70])
* Removed
  * The optional config option `emitStats` and its functionality were dropped.
    You may use _webpack_'s `--stats` switch instead.
* Misc
  * Uses `@cyclonedx/cyclonedx-library` now, instead of `@cyclonedx/bom`.

[#31]: #31
[#53]: #53
[#70]: #70

Signed-off-by: Jan Kowalleck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
2 participants