@citolab/tspci-qbci 2.9.13 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,25 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.11.0](https://github.com/Citolab/tspci/compare/v2.10.0...v2.11.0) (2026-08-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * generate a CycloneDX SBOM of the bundle ([fdc8cf7](https://github.com/Citolab/tspci/commit/fdc8cf7caf8d25b58737866d654315e6cb2e6fcf))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.10.0](https://github.com/Citolab/tspci/compare/v2.9.13...v2.10.0) (2026-08-18)
18
+
19
+ **Note:** Version bump only for package @citolab/tspci-qbci
20
+
21
+
22
+
23
+
24
+
6
25
  ## [2.9.13](https://github.com/Citolab/tspci/compare/v2.9.12...v2.9.13) (2026-03-18)
7
26
 
8
27
  **Note:** Version bump only for package @citolab/tspci-qbci
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citolab/tspci-qbci",
3
- "version": "2.9.13",
3
+ "version": "2.11.0",
4
4
  "description": "create a .ci file that can be imported into Questify",
5
5
  "author": "patrick <patrick.deklein@cito.nl>, Marcel Hoekstra <marcel.hoekstra@cito.nl>",
6
6
  "repository": "",
@@ -11,7 +11,7 @@
11
11
  "yazl": "^3.3.1"
12
12
  },
13
13
  "scripts": {},
14
- "gitHead": "81bf2cf80de144c2ea6cd1c256fc59e5b637c962",
14
+ "gitHead": "ad0858f9b665b6778cdf19685e858e167847e930",
15
15
  "publishConfig": {
16
16
  "access": "public",
17
17
  "registry": "https://registry.npmjs.org/"
package/readme.md CHANGED
@@ -14,3 +14,11 @@ In the package.json of the pci:
14
14
  - label (if empty, package name will be used)
15
15
  - config: { tspci: { width: '500' }} (optional, default: 500)
16
16
  - config: { tspci: { height: '500' }} (optional, default: 500)
17
+
18
+ ## sbom
19
+
20
+ A CycloneDX SBOM of the bundle is copied next to the `.ci` package in `ci-dist/` as
21
+ `<name>_<version>.sbom.cdx.json`. Pass `--include-sbom` to also add `sbom.cdx.json` to the package
22
+ itself; note that Questify does not expect the extra file, so only do that when a customer asks for it.
23
+ Pass `--no-sbom` to skip generating one.
24
+ See [@citolab/tspci](https://github.com/Citolab/tspci/tree/main/lib/tspci#sbom) for the configuration.
package/release-notes.md CHANGED
@@ -1,3 +1,31 @@
1
+ # 2.11.0
2
+
3
+ - a CycloneDX SBOM of the bundle is copied next to the `.ci` package in `ci-dist/` as `<name>_<version>.sbom.cdx.json`
4
+ - `--include-sbom` also adds `sbom.cdx.json` to the package itself, `--no-sbom` skips generating one
5
+
6
+ _The notes for 2.5.0 up to and including 2.10.0 were reconstructed from the git history afterwards, so
7
+ they list the highlights per minor version. Versions without an entry contained no changes for this
8
+ package: all packages in this repository are published in lockstep. `CHANGELOG.md` has the complete
9
+ list of published versions._
10
+
11
+ # 2.7.0
12
+
13
+ - added a GPL-3.0 LICENSE file to the package
14
+ - updated the development index.html
15
+
16
+ # 2.6.0
17
+
18
+ - images can be used with the native `CES.getMedia()` of the player
19
+ - media files from the assets folder are copied to `ref/media` and registered in `ref/json/manifest.json`
20
+ - a warning is shown when the bundled js file is too large for the player
21
+ - replaced the deprecated `fs.rmdir` with `fs.rm`
22
+
23
+ # 2.5.0
24
+
25
+ - dropped the `ci` prefix from the package name and export to a separate `ci-dist` folder
26
+ - the metadata.json of the PCI is picked up, `typeIdentifier` is also read from `config.tspci` in package.json
27
+ - the script folder is created when it does not exist
28
+
1
29
 
2
30
  # 2.1.1
3
31
  tspci
@@ -112,6 +112,15 @@ export const bundle = () => {
112
112
 
113
113
  isMaxFileSize(maxJsFileSize, minifiedFilePath);
114
114
 
115
+ // SBOM: delivered next to the package by default, optionally inside it
116
+ handleSbom({
117
+ distDirectory: path.join(PACKAGE_ROOT_PATH, path.dirname((packageData.main || "dist/index.js").replace(/^\//, ""))),
118
+ outputDirectory,
119
+ packageTempDirectory: outputDirectoryTemp,
120
+ baseName: `${name}_${packageData.version}`,
121
+ packageData,
122
+ });
123
+
115
124
  // zip the folder
116
125
  const zipName = `${name}_${packageData.version}.ci`;
117
126
  zipDirectory(outputDirectoryTemp, path.join(outputDirectory, zipName)).then(() =>
@@ -203,3 +212,29 @@ function addDirectoryToZip(zipFile, rootDir, currentDir) {
203
212
  zipFile.addFile(fullPath, relativePath, { compress: true });
204
213
  }
205
214
  }
215
+
216
+ // The CRA requires an SBOM as part of the technical documentation, not as part
217
+ // of the delivery to the customer, so it is written next to the package per
218
+ // version. Use --include-sbom (or config.tspci.sbom.includeInPackage) to also
219
+ // ship it inside the package, and --no-sbom to skip it altogether.
220
+ function handleSbom({ distDirectory, outputDirectory, packageTempDirectory, baseName, packageData }) {
221
+ const settings = packageData?.config?.tspci?.sbom || {};
222
+ if (settings.enabled === false || process.argv.includes("--no-sbom")) {
223
+ return "";
224
+ }
225
+ const fileName = settings.fileName || "sbom.cdx.json";
226
+ const source = path.join(distDirectory, fileName);
227
+ if (!fs.existsSync(source)) {
228
+ console.warn(chalk.yellow(`no SBOM found at ${source}, skipping it`));
229
+ return "";
230
+ }
231
+ fs.copyFileSync(source, path.join(outputDirectory, `${baseName}.${fileName}`));
232
+ console.log(chalk.green(`created sbom: ${baseName}.${fileName}`));
233
+
234
+ const includeInPackage = process.argv.includes("--include-sbom") || settings.includeInPackage === true;
235
+ if (!includeInPackage) {
236
+ return "";
237
+ }
238
+ fs.copyFileSync(source, path.join(packageTempDirectory, fileName));
239
+ return fileName;
240
+ }