-
-
Notifications
You must be signed in to change notification settings - Fork 14
fix: 6.4.0 deprecated types #1351
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9e4d33d
wip
jkowalleck 7829318
fix: fix type exports
jkowalleck dbf759f
docs
jkowalleck d084581
docs
jkowalleck a2697cd
style
jkowalleck e901930
examples
jkowalleck bdd3196
examples
jkowalleck 49738a6
dings
jkowalleck 7940ef3
dings
jkowalleck 9e721b0
dings
jkowalleck d2b41cc
docs
jkowalleck ad5761d
examples
jkowalleck 2ae97f4
tidy
jkowalleck ee4ff85
dings
jkowalleck e193f1a
dings
jkowalleck d495475
dings
jkowalleck d916383
docs
jkowalleck aa82910
ci
jkowalleck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /*! | ||
| This file is part of CycloneDX JavaScript Library. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| /** | ||
| * Example showcasing the deprecated symbols still work. | ||
| * @see https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1350 | ||
| */ | ||
|
|
||
| const fs = require('node:fs') | ||
| const path = require('node:path') | ||
|
|
||
| const CDX = require('@cyclonedx/cyclonedx-library') | ||
| // full Library is available as `CDX`, now | ||
|
|
||
| const dBU1 = CDX.Utils.BomUtility.randomSerialNumber() | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBU1) | ||
|
|
||
| const dNU1 = CDX.Utils.NpmjsUtility.defaultRegistryMatcher.test('foo') | ||
| const dNU2 = CDX.Utils.NpmjsUtility.parsePackageIntegrity('sha1-aSbRsZT7xze47tUTdW3i/Np+pAg=') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dNU1, dNU2) | ||
|
|
||
| const dLU1 = new CDX.Utils.LicenseUtility.LicenseEvidenceGatherer({fs, path}) | ||
| console.log(dLU1) | ||
|
|
||
| /** @type {CDX.Types.NodePackageJson} */ | ||
| const dTnpj1 = {} | ||
| // const dTnpj2 =CDX.Types.isNodePackageJson(dTnpj1) | ||
| try { CDX.Types.assertNodePackageJson(dTnpj1) } catch { /* pass */ } | ||
| console.log(dTnpj1) | ||
|
|
||
| const dF1 = new CDX.Factories.PackageUrlFactory('generic') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dF2 = new CDX.Factories.LicenseFactory() | ||
| console.log(dF1, dF2) | ||
|
|
||
| const dFnpj3 = new CDX.Factories.FromNodePackageJson.PackageUrlFactory('npm') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dFnpj4 = new CDX.Factories.FromNodePackageJson.ExternalReferenceFactory() | ||
| console.log(dFnpj3, dFnpj4) | ||
|
|
||
| const dBnpj1 = new CDX.Builders.FromNodePackageJson.ComponentBuilder(dFnpj4, dF2) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dBnpj2 = new CDX.Builders.FromNodePackageJson.ToolBuilder(dFnpj4) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBnpj1, dBnpj2) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| /*! | ||
| This file is part of CycloneDX JavaScript Library. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| /** | ||
| * Example showcasing the deprecated symbols still work. | ||
| * @see https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1350 | ||
| */ | ||
|
|
||
| import * as fs from 'node:fs' | ||
| import * as path from 'node:path' | ||
|
|
||
| import * as CDX from '@cyclonedx/cyclonedx-library' | ||
| // full Library is available as `CDX`, now | ||
|
|
||
| const dBU1 = CDX.Utils.BomUtility.randomSerialNumber() | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBU1) | ||
|
|
||
| const dNU1 = CDX.Utils.NpmjsUtility.defaultRegistryMatcher.test('foo') | ||
| const dNU2 = CDX.Utils.NpmjsUtility.parsePackageIntegrity('sha1-aSbRsZT7xze47tUTdW3i/Np+pAg=') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dNU1, dNU2) | ||
|
|
||
| const dLU1 = new CDX.Utils.LicenseUtility.LicenseEvidenceGatherer({fs, path}) | ||
| console.log(dLU1) | ||
|
|
||
| /** @type {CDX.Types.NodePackageJson} */ | ||
| const dTnpj1 = {} | ||
| // const dTnpj2 =CDX.Types.isNodePackageJson(dTnpj1) | ||
| try { CDX.Types.assertNodePackageJson(dTnpj1) } catch { /* pass */ } | ||
| console.log(dTnpj1) | ||
|
|
||
| const dF1 = new CDX.Factories.PackageUrlFactory('generic') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dF2 = new CDX.Factories.LicenseFactory() | ||
| console.log(dF1, dF2) | ||
|
|
||
| const dFnpj3 = new CDX.Factories.FromNodePackageJson.PackageUrlFactory('npm') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dFnpj4 = new CDX.Factories.FromNodePackageJson.ExternalReferenceFactory() | ||
| console.log(dFnpj3, dFnpj4) | ||
|
|
||
| const dBnpj1 = new CDX.Builders.FromNodePackageJson.ComponentBuilder(dFnpj4, dF2) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dBnpj2 = new CDX.Builders.FromNodePackageJson.ToolBuilder(dFnpj4) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBnpj1, dBnpj2) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "checkJs": true, | ||
| "target": "ESNext", | ||
| "module": "NodeNext", | ||
| "moduleResolution": "NodeNext", | ||
| "types": ["node"], | ||
| "lib": ["esnext"], | ||
| "strict": true | ||
| }, | ||
| "exclude": ["node_modules"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /*! | ||
| This file is part of CycloneDX JavaScript Library. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| /** | ||
| * Example showcasing the deprecated symbols still work. | ||
| * @see https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1350 | ||
| */ | ||
|
|
||
| import * as fs from 'node:fs' | ||
| import * as path from 'node:path' | ||
|
|
||
| import * as CDX from '@cyclonedx/cyclonedx-library' | ||
| // full Library is available as `CDX`, now | ||
|
|
||
| const dBU1 = CDX.Utils.BomUtility.randomSerialNumber() | ||
| console.log(dBU1) | ||
|
|
||
| const dNU1 = CDX.Utils.NpmjsUtility.defaultRegistryMatcher.test('foo') | ||
| const dNU2 = CDX.Utils.NpmjsUtility.parsePackageIntegrity('sha1-aSbRsZT7xze47tUTdW3i/Np+pAg=') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dNU1, dNU2) | ||
|
|
||
| type dLU1_T = CDX.Utils.LicenseUtility.LicenseEvidenceGatherer | ||
| const fsU: CDX.Utils.LicenseUtility.FsUtils<string> = fs | ||
| const pathU: CDX.Utils.LicenseUtility.PathUtils<string> = path | ||
| const dLU1: dLU1_T = new CDX.Utils.LicenseUtility.LicenseEvidenceGatherer({fs: fsU, path: pathU}) | ||
| console.log(dLU1) | ||
|
|
||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dTnpj1: CDX.Types.NodePackageJson = {} | ||
| // const dTnpj2 =CDX.Types.isNodePackageJson(dTnpj1) | ||
| try { CDX.Types.assertNodePackageJson(dTnpj1) } catch { /* pass */ } | ||
| console.log(dTnpj1) | ||
|
|
||
| type dF1_T = CDX.Factories.PackageUrlFactory | ||
| type dF2_T = CDX.Factories.LicenseFactory | ||
| const dF1: dF1_T = new CDX.Factories.PackageUrlFactory('generic') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dF2: dF2_T = new CDX.Factories.LicenseFactory() | ||
| console.log(dF1, dF2) | ||
|
|
||
| type dFnpj3_T = CDX.Factories.FromNodePackageJson.PackageUrlFactory | ||
| const dFnpj3: dFnpj3_T = new CDX.Factories.FromNodePackageJson.PackageUrlFactory('npm') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type dFnpj4_T = CDX.Factories.FromNodePackageJson.ExternalReferenceFactory | ||
| const dFnpj4: dFnpj4_T = new CDX.Factories.FromNodePackageJson.ExternalReferenceFactory() | ||
| console.log(dFnpj3, dFnpj4) | ||
|
|
||
| type dBnpj1_T = CDX.Builders.FromNodePackageJson.ComponentBuilder | ||
| const dBnpj1: dBnpj1_T = new CDX.Builders.FromNodePackageJson.ComponentBuilder(dFnpj4, dF2) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type dBnpj2_T = CDX.Builders.FromNodePackageJson.ToolBuilder | ||
| const dBnpj2: dBnpj2_T = new CDX.Builders.FromNodePackageJson.ToolBuilder(dFnpj4) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBnpj1, dBnpj2) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /*! | ||
| This file is part of CycloneDX JavaScript Library. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
|
|
||
| SPDX-License-Identifier: Apache-2.0 | ||
| Copyright (c) OWASP Foundation. All Rights Reserved. | ||
| */ | ||
|
|
||
| /** | ||
| * Example showcasing the deprecated symbols still work. | ||
| * @see https://github.com/CycloneDX/cyclonedx-javascript-library/issues/1350 | ||
| */ | ||
|
|
||
| import * as fs from 'node:fs' | ||
| import * as path from 'node:path' | ||
|
|
||
| import * as CDX from '@cyclonedx/cyclonedx-library' | ||
| // full Library is available as `CDX`, now | ||
|
|
||
| const dBU1 = CDX.Utils.BomUtility.randomSerialNumber() | ||
| console.log(dBU1) | ||
|
|
||
| const dNU1 = CDX.Utils.NpmjsUtility.defaultRegistryMatcher.test('foo') | ||
| const dNU2 = CDX.Utils.NpmjsUtility.parsePackageIntegrity('sha1-aSbRsZT7xze47tUTdW3i/Np+pAg=') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dNU1, dNU2) | ||
|
|
||
| type dLU1_T = CDX.Utils.LicenseUtility.LicenseEvidenceGatherer | ||
| const fsU: CDX.Utils.LicenseUtility.FsUtils<string> = fs | ||
| const pathU: CDX.Utils.LicenseUtility.PathUtils<string> = path | ||
| const dLU1: dLU1_T = new CDX.Utils.LicenseUtility.LicenseEvidenceGatherer({fs: fsU, path: pathU}) | ||
| console.log(dLU1) | ||
|
|
||
| const dTnpj1: CDX.Types.NodePackageJson = {} | ||
| // const dTnpj2 =CDX.Types.isNodePackageJson(dTnpj1) | ||
| try { CDX.Types.assertNodePackageJson(dTnpj1) } catch { /* pass */ } | ||
| console.log(dTnpj1) | ||
|
|
||
| type dF1_T = CDX.Factories.PackageUrlFactory | ||
| type dF2_T = CDX.Factories.LicenseFactory | ||
| const dF1: dF1_T = new CDX.Factories.PackageUrlFactory('generic') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const dF2: dF2_T = new CDX.Factories.LicenseFactory() | ||
| console.log(dF1, dF2) | ||
|
|
||
| type dFnpj3_T = CDX.Factories.FromNodePackageJson.PackageUrlFactory | ||
| const dFnpj3: dFnpj3_T = new CDX.Factories.FromNodePackageJson.PackageUrlFactory('npm') | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type dFnpj4_T = CDX.Factories.FromNodePackageJson.ExternalReferenceFactory | ||
| const dFnpj4: dFnpj4_T = new CDX.Factories.FromNodePackageJson.ExternalReferenceFactory() | ||
| console.log(dFnpj3, dFnpj4) | ||
|
|
||
| type dBnpj1_T = CDX.Builders.FromNodePackageJson.ComponentBuilder | ||
| const dBnpj1: dBnpj1_T = new CDX.Builders.FromNodePackageJson.ComponentBuilder(dFnpj4, dF2) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type dBnpj2_T = CDX.Builders.FromNodePackageJson.ToolBuilder | ||
| const dBnpj2: dBnpj2_T = new CDX.Builders.FromNodePackageJson.ToolBuilder(dFnpj4) | ||
jkowalleck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| console.log(dBnpj1, dBnpj2) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.