@citolab/tspci-qbci 2.7.1 → 2.8.4
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 +40 -0
- package/package.json +6 -5
- package/src/createPackage.mjs +23 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,46 @@
|
|
|
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.8.4](https://github.com/Citolab/tspci/compare/v2.8.3...v2.8.4) (2026-02-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @citolab/tspci-qbci
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [2.8.3](https://github.com/Citolab/tspci/compare/v2.8.2...v2.8.3) (2026-02-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @citolab/tspci-qbci
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [2.8.2](https://github.com/Citolab/tspci/compare/v2.8.1...v2.8.2) (2026-02-24)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @citolab/tspci-qbci
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [2.8.1](https://github.com/Citolab/tspci/compare/v2.8.0...v2.8.1) (2026-02-24)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @citolab/tspci-qbci
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [2.8.0](https://github.com/Citolab/tspci/compare/v2.7.1...v2.8.0) (2026-02-24)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @citolab/tspci-qbci
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
6
46
|
## [2.7.1](https://github.com/Citolab/tspci/compare/v2.7.0...v2.7.1) (2026-02-09)
|
|
7
47
|
|
|
8
48
|
**Note:** Version bump only for package @citolab/tspci-qbci
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@citolab/tspci-qbci",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.4",
|
|
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": "",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"types": "types/index.d.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"chalk": "5.6.2",
|
|
11
|
+
"yazl": "^3.3.1"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "2ad2236ae56f3927ef2d836c987b86a94ba5c070",
|
|
15
15
|
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
16
|
+
"access": "public",
|
|
17
|
+
"registry": "https://registry.npmjs.org/"
|
|
17
18
|
}
|
|
18
19
|
}
|
package/src/createPackage.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import fs, { mkdirSync } from "fs";
|
|
3
3
|
import path from "path";
|
|
4
|
-
import archiver from "archiver";
|
|
5
4
|
import chalk from "chalk";
|
|
5
|
+
import yazl from "yazl";
|
|
6
6
|
|
|
7
7
|
export const bundle = () => {
|
|
8
8
|
const PACKAGE_ROOT_PATH = process.cwd();
|
|
@@ -122,7 +122,7 @@ export const bundle = () => {
|
|
|
122
122
|
|
|
123
123
|
function getMediaPathFilesArray(assetsFolderPath) {
|
|
124
124
|
if (!fs.existsSync(assetsFolderPath)) {
|
|
125
|
-
console.log(chalk.
|
|
125
|
+
console.log(chalk.yellow(`Assets folder not found: ${assetsFolderPath}`));
|
|
126
126
|
return [];
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -178,16 +178,28 @@ function copyDirectoryRecursiveSync(source, target) {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
function zipDirectory(sourceDir, outPath) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
const zipFile = new yazl.ZipFile();
|
|
182
|
+
addDirectoryToZip(zipFile, sourceDir, sourceDir);
|
|
184
183
|
return new Promise((resolve, reject) => {
|
|
185
|
-
|
|
186
|
-
.directory(sourceDir, false)
|
|
187
|
-
.on("error", (err) => reject(err))
|
|
188
|
-
.pipe(stream);
|
|
189
|
-
|
|
184
|
+
const stream = fs.createWriteStream(outPath);
|
|
190
185
|
stream.on("close", () => resolve());
|
|
191
|
-
|
|
186
|
+
stream.on("error", (err) => reject(err));
|
|
187
|
+
zipFile.outputStream.on("error", (err) => reject(err)).pipe(stream);
|
|
188
|
+
zipFile.end();
|
|
192
189
|
});
|
|
193
190
|
}
|
|
191
|
+
|
|
192
|
+
function addDirectoryToZip(zipFile, rootDir, currentDir) {
|
|
193
|
+
for (const entry of fs.readdirSync(currentDir, { withFileTypes: true })) {
|
|
194
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
195
|
+
if (entry.isDirectory()) {
|
|
196
|
+
addDirectoryToZip(zipFile, rootDir, fullPath);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (!entry.isFile()) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
const relativePath = path.relative(rootDir, fullPath).split(path.sep).join("/");
|
|
203
|
+
zipFile.addFile(fullPath, relativePath, { compress: true });
|
|
204
|
+
}
|
|
205
|
+
}
|