Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.

<!-- add unreleased items here -->

* Refactor
* Add typing to internal function `getBuildtimeInfo` (via [#345])
* Dependencies
* Upgraded runtime-dependency `@cyclonedx/cyclonedx-library@^8.5.0`, was `@^8.4.0` (via [#345])

[#345]: https://github.com/CycloneDX/cyclonedx-node-yarn/pull/345

## 3.1.0 - 2025-06-16

* Changed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
],
"dependencies": {
"@cyclonedx/cyclonedx-library": "^8.4.0",
"@cyclonedx/cyclonedx-library": "^8.5.0",
"@yarnpkg/cli": "^4",
"@yarnpkg/core": "^4",
"@yarnpkg/fslib": "^3",
Expand Down
17 changes: 10 additions & 7 deletions src/_buildtimeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ SPDX-License-Identifier: Apache-2.0
Copyright (c) OWASP Foundation. All Rights Reserved.
*/

/* eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- dynamic import helper */
export async function getBuildtimeInfo () {
/*
The included file is generated by `../tools/gather-buildtime-info.cjs`.
Its content is pseudo-dynamic and so is the return type of this function.
*/
return (await import('./__buildtimeInfo.json')).default
import type { NodePackageJson } from "@cyclonedx/cyclonedx-library/Types";

interface BuildtimeInfo {
self: NodePackageJson
[key: string]: NodePackageJson
}

export async function getBuildtimeInfo (): Promise<BuildtimeInfo> {
/* if this fails, run `yarn run build:gbti` in your dev-env */
return (await import('./__buildtimeInfo.json')).default satisfies BuildtimeInfo
}
10 changes: 5 additions & 5 deletions yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading