@prosopo/datasets-fs 3.0.4 → 3.0.6

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/cli/cli.js +51 -51
  3. package/dist/index.js +4 -2
  4. package/dist/tests/data/flat_resized/labels.json +11 -11
  5. package/dist/tests/data/flat_resized/relocated_data.json +362 -362
  6. package/package.json +15 -12
  7. package/vite.cjs.config.ts +4 -1
  8. package/vite.esm.config.ts +20 -0
  9. package/dist/cli/cli.d.ts +0 -9
  10. package/dist/cli/cli.d.ts.map +0 -1
  11. package/dist/cli/cli.js.map +0 -1
  12. package/dist/cli/cliCommand.d.ts +0 -17
  13. package/dist/cli/cliCommand.d.ts.map +0 -1
  14. package/dist/cli/cliCommand.js +0 -31
  15. package/dist/cli/cliCommand.js.map +0 -1
  16. package/dist/cli/cliCommandComposite.d.ts +0 -14
  17. package/dist/cli/cliCommandComposite.d.ts.map +0 -1
  18. package/dist/cli/cliCommandComposite.js +0 -32
  19. package/dist/cli/cliCommandComposite.js.map +0 -1
  20. package/dist/cli.d.ts +0 -2
  21. package/dist/cli.d.ts.map +0 -1
  22. package/dist/cli.js +0 -34
  23. package/dist/cli.js.map +0 -1
  24. package/dist/commands/flatten.d.ts +0 -59
  25. package/dist/commands/flatten.d.ts.map +0 -1
  26. package/dist/commands/flatten.js +0 -97
  27. package/dist/commands/flatten.js.map +0 -1
  28. package/dist/commands/generate.d.ts +0 -115
  29. package/dist/commands/generate.d.ts.map +0 -1
  30. package/dist/commands/generate.js +0 -150
  31. package/dist/commands/generate.js.map +0 -1
  32. package/dist/commands/generateV1.d.ts +0 -179
  33. package/dist/commands/generateV1.d.ts.map +0 -1
  34. package/dist/commands/generateV1.js +0 -169
  35. package/dist/commands/generateV1.js.map +0 -1
  36. package/dist/commands/generateV2.d.ts +0 -189
  37. package/dist/commands/generateV2.d.ts.map +0 -1
  38. package/dist/commands/generateV2.js +0 -200
  39. package/dist/commands/generateV2.js.map +0 -1
  40. package/dist/commands/get.d.ts +0 -35
  41. package/dist/commands/get.d.ts.map +0 -1
  42. package/dist/commands/get.js +0 -92
  43. package/dist/commands/get.js.map +0 -1
  44. package/dist/commands/labels.d.ts +0 -47
  45. package/dist/commands/labels.d.ts.map +0 -1
  46. package/dist/commands/labels.js +0 -48
  47. package/dist/commands/labels.js.map +0 -1
  48. package/dist/commands/relocate.d.ts +0 -71
  49. package/dist/commands/relocate.d.ts.map +0 -1
  50. package/dist/commands/relocate.js +0 -81
  51. package/dist/commands/relocate.js.map +0 -1
  52. package/dist/commands/resize.d.ts +0 -69
  53. package/dist/commands/resize.d.ts.map +0 -1
  54. package/dist/commands/resize.js +0 -112
  55. package/dist/commands/resize.js.map +0 -1
  56. package/dist/dummy.d.ts +0 -2
  57. package/dist/dummy.d.ts.map +0 -1
  58. package/dist/dummy.js +0 -28
  59. package/dist/dummy.js.map +0 -1
  60. package/dist/index.d.ts +0 -2
  61. package/dist/index.d.ts.map +0 -1
  62. package/dist/index.js.map +0 -1
  63. package/dist/tests/lodash.unit.test.d.ts +0 -2
  64. package/dist/tests/lodash.unit.test.d.ts.map +0 -1
  65. package/dist/tests/lodash.unit.test.js +0 -29
  66. package/dist/tests/lodash.unit.test.js.map +0 -1
  67. package/dist/tests/mocked.unit.test.d.ts +0 -2
  68. package/dist/tests/mocked.unit.test.d.ts.map +0 -1
  69. package/dist/tests/mocked.unit.test.js +0 -253
  70. package/dist/tests/mocked.unit.test.js.map +0 -1
  71. package/dist/tests/utils.d.ts +0 -35
  72. package/dist/tests/utils.d.ts.map +0 -1
  73. package/dist/tests/utils.js +0 -101
  74. package/dist/tests/utils.js.map +0 -1
  75. package/dist/utils/input.d.ts +0 -24
  76. package/dist/utils/input.d.ts.map +0 -1
  77. package/dist/utils/input.js +0 -35
  78. package/dist/utils/input.js.map +0 -1
  79. package/dist/utils/inputOutput.d.ts +0 -21
  80. package/dist/utils/inputOutput.d.ts.map +0 -1
  81. package/dist/utils/inputOutput.js +0 -10
  82. package/dist/utils/inputOutput.js.map +0 -1
  83. package/dist/utils/output.d.ts +0 -36
  84. package/dist/utils/output.d.ts.map +0 -1
  85. package/dist/utils/output.js +0 -62
  86. package/dist/utils/output.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @prosopo/datasets-fs
2
2
 
3
+ ## 3.0.6
4
+ ### Patch Changes
5
+
6
+ - 52dbf21: bumping deps
7
+ - 93d5e50: ensure packages have @prosopo/config as dep for vite configs
8
+ - 3573f0b: fix npm scripts bundle command
9
+ - 3573f0b: build using vite, typecheck using tsc
10
+ - efd8102: Add tests for unwrap error helper
11
+ - 93d5e50: fix missing dep for @prosopo/config
12
+ - 3573f0b: standardise all vite based npm scripts for bundling
13
+ - Updated dependencies [52dbf21]
14
+ - Updated dependencies [93d5e50]
15
+ - Updated dependencies [3573f0b]
16
+ - Updated dependencies [3573f0b]
17
+ - Updated dependencies [efd8102]
18
+ - Updated dependencies [93d5e50]
19
+ - Updated dependencies [63519d7]
20
+ - Updated dependencies [f29fc7e]
21
+ - Updated dependencies [3573f0b]
22
+ - Updated dependencies [2d0dd8a]
23
+ - @prosopo/util@3.0.3
24
+ - @prosopo/types@3.0.4
25
+ - @prosopo/common@3.1.0
26
+ - @prosopo/config@3.1.1
27
+
28
+ ## 3.0.5
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [b0d7207]
32
+ - @prosopo/types@3.0.3
33
+
3
34
  ## 3.0.4
4
35
  ### Patch Changes
5
36
 
package/dist/cli/cli.js CHANGED
@@ -1,58 +1,58 @@
1
- var _Cli_commands;
2
- import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
- import { LogLevel, ProsopoCliError, getLogger } from "@prosopo/common";
1
+ import { getLogger, LogLevel, ProsopoCliError } from "@prosopo/common";
4
2
  import yargs from "yargs";
5
3
  import { hideBin } from "yargs/helpers";
6
4
  const dirname = process.cwd();
7
- export class Cli {
8
- constructor(commands) {
9
- _Cli_commands.set(this, void 0);
10
- this.logger = getLogger("info", import.meta.url);
11
- __classPrivateFieldSet(this, _Cli_commands, commands, "f");
12
- }
13
- config() {
14
- let y = yargs(hideBin(process.argv))
15
- .option("log-level", {
16
- type: "string",
17
- choices: Object.values(LogLevel.options),
18
- default: LogLevel.enum.info,
19
- description: "The log level",
20
- })
21
- .middleware((argv) => {
22
- this.logger.setLogLevel(argv.logLevel);
23
- }, true);
24
- for (const command of __classPrivateFieldGet(this, _Cli_commands, "f")) {
25
- y = y.command({
26
- command: command.getCommandName(),
27
- describe: command.getDescription(),
28
- builder: command.getOptions(),
29
- handler: async (argv) => {
30
- this.logger.debug(() => ({
31
- msg: `running ${command.getCommandName()}`,
32
- }));
33
- const args = await command.parse(argv);
34
- await command.exec(args);
35
- },
36
- });
37
- }
38
- if (!__classPrivateFieldGet(this, _Cli_commands, "f").find((c) => c.getCommandName() === "$0")) {
39
- y = y.command("$0", "default command", (y) => y, () => {
40
- throw new ProsopoCliError("CLI.PARAMETER_ERROR", {
41
- context: { error: "no command specified" },
42
- });
43
- });
5
+ class Cli {
6
+ constructor(commands) {
7
+ this.logger = getLogger("info", import.meta.url);
8
+ this.#commands = commands;
9
+ }
10
+ #commands;
11
+ config() {
12
+ let y = yargs(hideBin(process.argv)).option("log-level", {
13
+ type: "string",
14
+ choices: Object.values(LogLevel.options),
15
+ default: LogLevel.enum.info,
16
+ description: "The log level"
17
+ }).middleware((argv) => {
18
+ this.logger.setLogLevel(argv.logLevel);
19
+ }, true);
20
+ for (const command of this.#commands) {
21
+ y = y.command({
22
+ command: command.getCommandName(),
23
+ describe: command.getDescription(),
24
+ builder: command.getOptions(),
25
+ // biome-ignore lint/suspicious/noExplicitAny: TODO fix
26
+ handler: async (argv) => {
27
+ this.logger.debug(() => ({
28
+ msg: `running ${command.getCommandName()}`
29
+ }));
30
+ const args = await command.parse(argv);
31
+ await command.exec(args);
44
32
  }
45
- y = y
46
- .demandCommand()
47
- .strict()
48
- .showHelpOnFail(false, "Specify --help for available options");
49
- return y;
33
+ });
50
34
  }
51
- async exec(args = process.argv.slice(2)) {
52
- const config = this.config();
53
- this.logger.debug(() => ({ data: { args }, msg: "parsing" }));
54
- await config.parse(args);
35
+ if (!this.#commands.find((c) => c.getCommandName() === "$0")) {
36
+ y = y.command(
37
+ "$0",
38
+ "default command",
39
+ (y2) => y2,
40
+ () => {
41
+ throw new ProsopoCliError("CLI.PARAMETER_ERROR", {
42
+ context: { error: "no command specified" }
43
+ });
44
+ }
45
+ );
55
46
  }
47
+ y = y.demandCommand().strict().showHelpOnFail(false, "Specify --help for available options");
48
+ return y;
49
+ }
50
+ async exec(args = process.argv.slice(2)) {
51
+ const config = this.config();
52
+ this.logger.debug(() => ({ data: { args }, msg: "parsing" }));
53
+ await config.parse(args);
54
+ }
56
55
  }
57
- _Cli_commands = new WeakMap();
58
- //# sourceMappingURL=cli.js.map
56
+ export {
57
+ Cli
58
+ };
package/dist/index.js CHANGED
@@ -1,2 +1,4 @@
1
- export * from "./cli/cli.js";
2
- //# sourceMappingURL=index.js.map
1
+ import { Cli } from "./cli/cli.js";
2
+ export {
3
+ Cli
4
+ };
@@ -1,13 +1,13 @@
1
1
  {
2
- "labels": [
3
- "bird",
4
- "bus",
5
- "car",
6
- "cat",
7
- "deer",
8
- "dog",
9
- "horse",
10
- "plane",
11
- "train"
12
- ]
2
+ "labels": [
3
+ "bird",
4
+ "bus",
5
+ "car",
6
+ "cat",
7
+ "deer",
8
+ "dog",
9
+ "horse",
10
+ "plane",
11
+ "train"
12
+ ]
13
13
  }