@citolab/tspci-qbci 2.10.0 → 2.12.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,28 @@
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.12.0](https://github.com/Citolab/tspci/compare/v2.11.0...v2.12.0) (2026-08-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * include the SBOM in the exported package by default ([376b89a](https://github.com/Citolab/tspci/commit/376b89a5651bb9a420fbd2973d221a7e5200bd35))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.11.0](https://github.com/Citolab/tspci/compare/v2.10.0...v2.11.0) (2026-08-19)
18
+
19
+
20
+ ### Features
21
+
22
+ * generate a CycloneDX SBOM of the bundle ([fdc8cf7](https://github.com/Citolab/tspci/commit/fdc8cf7caf8d25b58737866d654315e6cb2e6fcf))
23
+
24
+
25
+
26
+
27
+
6
28
  # [2.10.0](https://github.com/Citolab/tspci/compare/v2.9.13...v2.10.0) (2026-08-18)
7
29
 
8
30
  **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.10.0",
3
+ "version": "2.12.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": "7dbead5cfa41583d47bb503d40970df2d3444a1e",
14
+ "gitHead": "eb7676525e9bf75daa9b2f42f035faed9b8e9a70",
15
15
  "publishConfig": {
16
16
  "access": "public",
17
17
  "registry": "https://registry.npmjs.org/"
package/readme.md CHANGED
@@ -14,3 +14,15 @@ 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 included in the package as `ref/script/sbom.cdx.json`, next to the
21
+ bundle it describes, and copied next to the `.ci` package in `ci-dist/` as
22
+ `<name>_<version>.sbom.cdx.json` for your own technical documentation.
23
+
24
+ It is deliberately not registered in `ref/json/manifest.json`: the `script` array drives what the player
25
+ loads, and the SBOM is data, not a script.
26
+
27
+ Use `--no-include-sbom` to keep it out of the package, or `--no-sbom` to skip generating one. See
28
+ [@citolab/tspci](https://github.com/Citolab/tspci/tree/main/lib/tspci#sbom) for the configuration.
package/release-notes.md CHANGED
@@ -1,3 +1,37 @@
1
+ # 2.12.0
2
+
3
+ - the SBOM is included in the package as `ref/script/sbom.cdx.json`, next to the bundle
4
+ - it is deliberately not registered in `ref/json/manifest.json`: the `script` array drives what the player loads and the SBOM is data, not a script
5
+ - `--no-include-sbom` keeps it out of the package
6
+
7
+ # 2.11.0
8
+
9
+ - a CycloneDX SBOM of the bundle is copied next to the `.ci` package in `ci-dist/` as `<name>_<version>.sbom.cdx.json`
10
+ - `--include-sbom` also adds `sbom.cdx.json` to the package itself, `--no-sbom` skips generating one
11
+
12
+ _The notes for 2.5.0 up to and including 2.10.0 were reconstructed from the git history afterwards, so
13
+ they list the highlights per minor version. Versions without an entry contained no changes for this
14
+ package: all packages in this repository are published in lockstep. `CHANGELOG.md` has the complete
15
+ list of published versions._
16
+
17
+ # 2.7.0
18
+
19
+ - added a GPL-3.0 LICENSE file to the package
20
+ - updated the development index.html
21
+
22
+ # 2.6.0
23
+
24
+ - images can be used with the native `CES.getMedia()` of the player
25
+ - media files from the assets folder are copied to `ref/media` and registered in `ref/json/manifest.json`
26
+ - a warning is shown when the bundled js file is too large for the player
27
+ - replaced the deprecated `fs.rmdir` with `fs.rm`
28
+
29
+ # 2.5.0
30
+
31
+ - dropped the `ci` prefix from the package name and export to a separate `ci-dist` folder
32
+ - the metadata.json of the PCI is picked up, `typeIdentifier` is also read from `config.tspci` in package.json
33
+ - the script folder is created when it does not exist
34
+
1
35
 
2
36
  # 2.1.1
3
37
  tspci
@@ -112,6 +112,17 @@ export const bundle = () => {
112
112
 
113
113
  isMaxFileSize(maxJsFileSize, minifiedFilePath);
114
114
 
115
+ // SBOM: shipped inside the package next to the bundle it describes, and
116
+ // copied next to the package for your own technical documentation
117
+ handleSbom({
118
+ distDirectory: path.join(PACKAGE_ROOT_PATH, path.dirname((packageData.main || "dist/index.js").replace(/^\//, ""))),
119
+ outputDirectory,
120
+ packageTempDirectory: outputDirectoryTemp,
121
+ packageDirectory: path.posix.join("ref", "script"),
122
+ baseName: `${name}_${packageData.version}`,
123
+ packageData,
124
+ });
125
+
115
126
  // zip the folder
116
127
  const zipName = `${name}_${packageData.version}.ci`;
117
128
  zipDirectory(outputDirectoryTemp, path.join(outputDirectory, zipName)).then(() =>
@@ -203,3 +214,31 @@ function addDirectoryToZip(zipFile, rootDir, currentDir) {
203
214
  zipFile.addFile(fullPath, relativePath, { compress: true });
204
215
  }
205
216
  }
217
+
218
+ // The SBOM travels inside the package, because a file next to the zip does not
219
+ // survive an import into another system, and that is exactly the party that
220
+ // needs it. A copy is left next to the package for your own technical
221
+ // documentation. Use --no-include-sbom (or config.tspci.sbom.includeInPackage:
222
+ // false) to keep it out of the package, and --no-sbom to skip it altogether.
223
+ function handleSbom({ distDirectory, outputDirectory, packageTempDirectory, packageDirectory, baseName, packageData }) {
224
+ const settings = packageData?.config?.tspci?.sbom || {};
225
+ if (settings.enabled === false || process.argv.includes("--no-sbom")) {
226
+ return "";
227
+ }
228
+ const fileName = settings.fileName || "sbom.cdx.json";
229
+ const source = path.join(distDirectory, fileName);
230
+ if (!fs.existsSync(source)) {
231
+ console.warn(chalk.yellow(`no SBOM found at ${source}, skipping it`));
232
+ return "";
233
+ }
234
+ fs.copyFileSync(source, path.join(outputDirectory, `${baseName}.${fileName}`));
235
+ console.log(chalk.green(`created sbom: ${baseName}.${fileName}`));
236
+
237
+ if (settings.includeInPackage === false || process.argv.includes("--no-include-sbom")) {
238
+ return "";
239
+ }
240
+ const target = packageDirectory ? path.join(packageTempDirectory, packageDirectory) : packageTempDirectory;
241
+ fs.mkdirSync(target, { recursive: true });
242
+ fs.copyFileSync(source, path.join(target, fileName));
243
+ return packageDirectory ? path.posix.join(packageDirectory, fileName) : fileName;
244
+ }