@prosopo/datasets-fs 2.5.3 → 2.6.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ # @prosopo/datasets-fs
2
+
3
+ ## 2.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [52feffc]
8
+ - @prosopo/types@2.6.1
9
+
10
+ ## 2.6.0
11
+
12
+ ### Minor Changes
13
+
14
+ - a0bfc8a: bump all pkg versions since independent versioning applied
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [a0bfc8a]
19
+ - @prosopo/common@2.6.0
20
+ - @prosopo/types@2.6.0
21
+ - @prosopo/util@2.6.0
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const common = require("@prosopo/common");
4
+ const yargs = require("yargs");
5
+ const helpers = require("yargs/helpers");
6
+ const dirname = process.cwd();
7
+ const logger = common.getLogger(common.LogLevel.enum.info, `${dirname}`);
8
+ class Cli extends common.Loggable {
9
+ #commands;
10
+ constructor(commands) {
11
+ super();
12
+ this.#commands = commands;
13
+ this.logger = logger;
14
+ }
15
+ config() {
16
+ let y = yargs(helpers.hideBin(process.argv)).option("log-level", {
17
+ type: "string",
18
+ choices: Object.values(common.LogLevel.options),
19
+ default: common.LogLevel.enum.info,
20
+ description: "The log level"
21
+ }).middleware((argv) => {
22
+ this.logger.setLogLevel(argv.logLevel);
23
+ }, true);
24
+ for (const command of this.#commands) {
25
+ y = y.command({
26
+ command: command.getCommandName(),
27
+ describe: command.getDescription(),
28
+ builder: command.getOptions(),
29
+ // biome-ignore lint/suspicious/noExplicitAny: TODO fix
30
+ handler: async (argv) => {
31
+ this.logger.debug(`running ${command.getCommandName()}}`);
32
+ const args = await command.parse(argv);
33
+ await command.exec(args);
34
+ }
35
+ });
36
+ }
37
+ if (!this.#commands.find((c) => c.getCommandName() === "$0")) {
38
+ y = y.command(
39
+ "$0",
40
+ "default command",
41
+ (y2) => y2,
42
+ () => {
43
+ throw new common.ProsopoCliError("CLI.PARAMETER_ERROR", {
44
+ context: { error: "no command specified" }
45
+ });
46
+ }
47
+ );
48
+ }
49
+ y = y.demandCommand().strict().showHelpOnFail(false, "Specify --help for available options");
50
+ return y;
51
+ }
52
+ async exec(args = process.argv.slice(2)) {
53
+ const config = this.config();
54
+ this.logger.debug("parsing", args);
55
+ await config.parse(args);
56
+ }
57
+ }
58
+ exports.Cli = Cli;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const cli = require("./cli/cli.cjs");
4
+ exports.Cli = cli.Cli;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/datasets-fs",
3
- "version": "2.5.3",
3
+ "version": "2.6.1",
4
4
  "author": "PROSOPO LIMITED <info@prosopo.io>",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
@@ -28,9 +28,9 @@
28
28
  "@noble/hashes": "1.5.0",
29
29
  "@polkadot/util": "12.6.2",
30
30
  "@polkadot/util-crypto": "12.6.2",
31
- "@prosopo/common": "2.5.3",
32
- "@prosopo/types": "2.5.3",
33
- "@prosopo/util": "2.5.3",
31
+ "@prosopo/common": "2.6.0",
32
+ "@prosopo/types": "2.6.1",
33
+ "@prosopo/util": "2.6.0",
34
34
  "bcrypt": "5.1.1",
35
35
  "cli-progress": "3.12.0",
36
36
  "express": "4.21.2",
@@ -39,10 +39,10 @@
39
39
  "zod": "3.23.8"
40
40
  },
41
41
  "devDependencies": {
42
- "@prosopo/config": "2.5.3",
42
+ "@prosopo/config": "2.6.0",
43
43
  "@types/bcrypt": "5.0.2",
44
44
  "@types/cli-progress": "3.11.6",
45
- "@vitest/coverage-v8": "2.1.1",
45
+ "@vitest/coverage-v8": "3.0.9",
46
46
  "concurrently": "9.0.1",
47
47
  "del-cli": "6.0.0",
48
48
  "dotenv": "16.4.5",
@@ -50,12 +50,13 @@
50
50
  "tslib": "2.7.0",
51
51
  "tsx": "4.19.1",
52
52
  "typescript": "5.6.2",
53
- "vite": "5.4.6",
54
- "vitest": "2.1.1"
53
+ "vite": "6.2.3",
54
+ "vitest": "3.0.9"
55
55
  },
56
56
  "repository": {
57
57
  "type": "git",
58
- "url": "git+https://github.com/prosopo/captcha.git"
58
+ "url": "git+https://github.com/prosopo/captcha.git",
59
+ "directory": "packages/datasets-fs"
59
60
  },
60
61
  "bugs": {
61
62
  "url": "https://github.com/prosopo/captcha/issues"